react-native-unit-components 0.1.0 → 1.0.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 (241) hide show
  1. package/README.md +157 -2
  2. package/lib/commonjs/assets/images/close.png +0 -0
  3. package/lib/commonjs/assets/images/index.js +16 -0
  4. package/lib/commonjs/assets/images/index.js.map +1 -0
  5. package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js +28 -0
  6. package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js.map +1 -0
  7. package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js +20 -0
  8. package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -0
  9. package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js +39 -0
  10. package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -0
  11. package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.js +40 -0
  12. package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.js.map +1 -0
  13. package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.js +9 -0
  14. package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.js.map +1 -0
  15. package/lib/commonjs/components/{BottomSheet/BottomSheetComponent.js → UNBottomSheetComponent/UNBottomSheetComponent.js} +84 -65
  16. package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -0
  17. package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.styles.js +23 -0
  18. package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.styles.js.map +1 -0
  19. package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js +49 -0
  20. package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js.map +1 -0
  21. package/lib/commonjs/components/{Card/CardComponent.js → UNCardComponent/UNCardComponent.js} +42 -46
  22. package/lib/commonjs/components/UNCardComponent/UNCardComponent.js.map +1 -0
  23. package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js +42 -0
  24. package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js.map +1 -0
  25. package/lib/commonjs/components/index.js +34 -8
  26. package/lib/commonjs/components/index.js.map +1 -1
  27. package/lib/commonjs/custom.d.js +2 -0
  28. package/lib/commonjs/custom.d.js.map +1 -0
  29. package/lib/commonjs/helpers/{BottomSheet.js → BottomSheet/BottomSheet.js} +36 -82
  30. package/lib/commonjs/helpers/BottomSheet/BottomSheet.js.map +1 -0
  31. package/lib/commonjs/helpers/BottomSheet/BottomSheet.styles.js +82 -0
  32. package/lib/commonjs/helpers/BottomSheet/BottomSheet.styles.js.map +1 -0
  33. package/lib/commonjs/helpers/EventBus.js +5 -13
  34. package/lib/commonjs/helpers/EventBus.js.map +1 -1
  35. package/lib/commonjs/hooks/listenerToBus.js +31 -0
  36. package/lib/commonjs/hooks/listenerToBus.js.map +1 -0
  37. package/lib/commonjs/hooks/useAppStateListener.js +34 -0
  38. package/lib/commonjs/hooks/useAppStateListener.js.map +1 -0
  39. package/lib/commonjs/index.js +33 -0
  40. package/lib/commonjs/index.js.map +1 -1
  41. package/lib/commonjs/messages/nativeMessages/index.js +13 -0
  42. package/lib/commonjs/messages/nativeMessages/index.js.map +1 -0
  43. package/lib/commonjs/messages/webMessages/bookPaymentMessage.js +13 -0
  44. package/lib/commonjs/messages/webMessages/bookPaymentMessage.js.map +1 -0
  45. package/lib/commonjs/{webComponent → messages}/webMessages/cardMessage.js +1 -1
  46. package/lib/commonjs/messages/webMessages/cardMessage.js.map +1 -0
  47. package/lib/commonjs/messages/webMessages/index.js +6 -0
  48. package/lib/commonjs/messages/webMessages/index.js.map +1 -0
  49. package/lib/commonjs/{webComponent → messages}/webMessages/pageMessage.js +0 -0
  50. package/lib/commonjs/{webComponent → messages}/webMessages/pageMessage.js.map +0 -0
  51. package/lib/commonjs/{webComponent → messages}/webMessages/unitMessages.js +0 -0
  52. package/lib/commonjs/messages/webMessages/unitMessages.js.map +1 -0
  53. package/lib/commonjs/nativeComponenet/NativeComponentExample.js +2 -2
  54. package/lib/commonjs/nativeComponenet/NativeComponentExample.js.map +1 -1
  55. package/lib/commonjs/scripts/html/bodyHtml.js +52 -0
  56. package/lib/commonjs/scripts/html/bodyHtml.js.map +1 -0
  57. package/lib/commonjs/scripts/html/bodyScript.js +78 -0
  58. package/lib/commonjs/scripts/html/bodyScript.js.map +1 -0
  59. package/lib/commonjs/sharedTypes/bookPayment.types.js +6 -0
  60. package/lib/commonjs/sharedTypes/bookPayment.types.js.map +1 -0
  61. package/lib/commonjs/sharedTypes/card.types.js +6 -0
  62. package/lib/commonjs/sharedTypes/card.types.js.map +1 -0
  63. package/lib/commonjs/sharedTypes/index.js +32 -0
  64. package/lib/commonjs/sharedTypes/index.js.map +1 -0
  65. package/lib/commonjs/sharedTypes/types.js +2 -0
  66. package/lib/commonjs/sharedTypes/types.js.map +1 -0
  67. package/lib/commonjs/styles/variables.js +17 -0
  68. package/lib/commonjs/styles/variables.js.map +1 -0
  69. package/lib/commonjs/unitSdkManager/UnitSdk.api.js +54 -0
  70. package/lib/commonjs/unitSdkManager/UnitSdk.api.js.map +1 -0
  71. package/lib/commonjs/unitSdkManager/UnitSdkManager.js +51 -0
  72. package/lib/commonjs/unitSdkManager/UnitSdkManager.js.map +1 -0
  73. package/lib/commonjs/webComponent/WebComponent.js +35 -15
  74. package/lib/commonjs/webComponent/WebComponent.js.map +1 -1
  75. package/lib/commonjs/webComponent/html.js +22 -45
  76. package/lib/commonjs/webComponent/html.js.map +1 -1
  77. package/lib/module/assets/images/close.png +0 -0
  78. package/lib/module/assets/images/index.js +2 -0
  79. package/lib/module/assets/images/index.js.map +1 -0
  80. package/lib/module/components/UNActivityComponent/UNActivityComponent.js +13 -0
  81. package/lib/module/components/UNActivityComponent/UNActivityComponent.js.map +1 -0
  82. package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js +10 -0
  83. package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -0
  84. package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js +23 -0
  85. package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -0
  86. package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.js +26 -0
  87. package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.js.map +1 -0
  88. package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.js +2 -0
  89. package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.js.map +1 -0
  90. package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js +131 -0
  91. package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -0
  92. package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.styles.js +13 -0
  93. package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.styles.js.map +1 -0
  94. package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js +29 -0
  95. package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js.map +1 -0
  96. package/lib/module/components/UNCardComponent/UNCardComponent.js +65 -0
  97. package/lib/module/components/UNCardComponent/UNCardComponent.js.map +1 -0
  98. package/lib/module/components/UNCardComponent/UNCardComponent.utils.js +24 -0
  99. package/lib/module/components/UNCardComponent/UNCardComponent.utils.js.map +1 -0
  100. package/lib/module/components/index.js +4 -2
  101. package/lib/module/components/index.js.map +1 -1
  102. package/lib/module/custom.d.js +2 -0
  103. package/lib/module/custom.d.js.map +1 -0
  104. package/lib/module/helpers/{BottomSheet.js → BottomSheet/BottomSheet.js} +34 -81
  105. package/lib/module/helpers/BottomSheet/BottomSheet.js.map +1 -0
  106. package/lib/module/helpers/BottomSheet/BottomSheet.styles.js +70 -0
  107. package/lib/module/helpers/BottomSheet/BottomSheet.styles.js.map +1 -0
  108. package/lib/module/helpers/EventBus.js +4 -11
  109. package/lib/module/helpers/EventBus.js.map +1 -1
  110. package/lib/module/hooks/listenerToBus.js +18 -0
  111. package/lib/module/hooks/listenerToBus.js.map +1 -0
  112. package/lib/module/hooks/useAppStateListener.js +23 -0
  113. package/lib/module/hooks/useAppStateListener.js.map +1 -0
  114. package/lib/module/index.js +2 -0
  115. package/lib/module/index.js.map +1 -1
  116. package/lib/module/messages/nativeMessages/index.js +6 -0
  117. package/lib/module/messages/nativeMessages/index.js.map +1 -0
  118. package/lib/module/messages/webMessages/bookPaymentMessage.js +6 -0
  119. package/lib/module/messages/webMessages/bookPaymentMessage.js.map +1 -0
  120. package/lib/module/messages/webMessages/cardMessage.js +6 -0
  121. package/lib/module/messages/webMessages/cardMessage.js.map +1 -0
  122. package/lib/module/messages/webMessages/index.js +2 -0
  123. package/lib/module/messages/webMessages/index.js.map +1 -0
  124. package/lib/module/{webComponent → messages}/webMessages/pageMessage.js +0 -0
  125. package/lib/module/{webComponent → messages}/webMessages/pageMessage.js.map +0 -0
  126. package/lib/module/{webComponent → messages}/webMessages/unitMessages.js +0 -0
  127. package/lib/module/messages/webMessages/unitMessages.js.map +1 -0
  128. package/lib/module/nativeComponenet/NativeComponentExample.js +2 -2
  129. package/lib/module/nativeComponenet/NativeComponentExample.js.map +1 -1
  130. package/lib/module/scripts/html/bodyHtml.js +42 -0
  131. package/lib/module/scripts/html/bodyHtml.js.map +1 -0
  132. package/lib/module/scripts/html/bodyScript.js +64 -0
  133. package/lib/module/scripts/html/bodyScript.js.map +1 -0
  134. package/lib/module/sharedTypes/bookPayment.types.js +2 -0
  135. package/lib/module/sharedTypes/bookPayment.types.js.map +1 -0
  136. package/lib/module/sharedTypes/card.types.js +2 -0
  137. package/lib/module/sharedTypes/card.types.js.map +1 -0
  138. package/lib/module/sharedTypes/index.js +3 -0
  139. package/lib/module/sharedTypes/index.js.map +1 -0
  140. package/lib/module/sharedTypes/types.js +2 -0
  141. package/lib/module/sharedTypes/types.js.map +1 -0
  142. package/lib/module/styles/variables.js +10 -0
  143. package/lib/module/styles/variables.js.map +1 -0
  144. package/lib/module/unitSdkManager/UnitSdk.api.js +37 -0
  145. package/lib/module/unitSdkManager/UnitSdk.api.js.map +1 -0
  146. package/lib/module/unitSdkManager/UnitSdkManager.js +38 -0
  147. package/lib/module/unitSdkManager/UnitSdkManager.js.map +1 -0
  148. package/lib/module/webComponent/WebComponent.js +34 -14
  149. package/lib/module/webComponent/WebComponent.js.map +1 -1
  150. package/lib/module/webComponent/html.js +18 -44
  151. package/lib/module/webComponent/html.js.map +1 -1
  152. package/lib/typescript/assets/images/index.d.ts +1 -0
  153. package/lib/typescript/components/UNActivityComponent/UNActivityComponent.d.ts +6 -0
  154. package/lib/typescript/components/UNActivityComponent/UNActivityComponent.utils.d.ts +2 -0
  155. package/lib/typescript/components/UNBookPaymentComponent/UNBookPaymentComponent.d.ts +11 -0
  156. package/lib/typescript/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.d.ts +3 -0
  157. package/lib/typescript/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.d.ts +1 -0
  158. package/lib/typescript/components/{BottomSheet/BottomSheetComponent.d.ts → UNBottomSheetComponent/UNBottomSheetComponent.d.ts} +0 -0
  159. package/lib/typescript/components/UNBottomSheetComponent/UNBottomSheetComponent.styles.d.ts +9 -0
  160. package/lib/typescript/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.d.ts +5 -0
  161. package/lib/typescript/components/{Card/CardComponent.d.ts → UNCardComponent/UNCardComponent.d.ts} +3 -1
  162. package/lib/typescript/components/UNCardComponent/UNCardComponent.utils.d.ts +6 -0
  163. package/lib/typescript/components/index.d.ts +4 -2
  164. package/lib/typescript/helpers/{BottomSheet.d.ts → BottomSheet/BottomSheet.d.ts} +1 -0
  165. package/lib/typescript/helpers/BottomSheet/BottomSheet.styles.d.ts +63 -0
  166. package/lib/typescript/helpers/EventBus.d.ts +5 -7
  167. package/lib/typescript/hooks/listenerToBus.d.ts +7 -0
  168. package/lib/typescript/hooks/useAppStateListener.d.ts +1 -0
  169. package/lib/typescript/index.d.ts +2 -0
  170. package/lib/typescript/messages/nativeMessages/index.d.ts +3 -0
  171. package/lib/typescript/messages/webMessages/bookPaymentMessage.d.ts +8 -0
  172. package/lib/typescript/{webComponent → messages}/webMessages/cardMessage.d.ts +3 -2
  173. package/lib/typescript/messages/webMessages/index.d.ts +11 -0
  174. package/lib/typescript/{webComponent → messages}/webMessages/pageMessage.d.ts +0 -0
  175. package/lib/typescript/{webComponent → messages}/webMessages/unitMessages.d.ts +0 -0
  176. package/lib/typescript/scripts/html/bodyHtml.d.ts +7 -0
  177. package/lib/typescript/scripts/html/bodyScript.d.ts +11 -0
  178. package/lib/typescript/sharedTypes/bookPayment.types.d.ts +26 -0
  179. package/lib/typescript/sharedTypes/card.types.d.ts +56 -0
  180. package/lib/typescript/sharedTypes/index.d.ts +2 -0
  181. package/lib/typescript/sharedTypes/types.d.ts +27 -0
  182. package/lib/typescript/styles/variables.d.ts +9 -0
  183. package/lib/typescript/unitSdkManager/UnitSdk.api.d.ts +3 -0
  184. package/lib/typescript/unitSdkManager/UnitSdkManager.d.ts +15 -0
  185. package/lib/typescript/webComponent/WebComponent.d.ts +8 -11
  186. package/lib/typescript/webComponent/html.d.ts +6 -1
  187. package/package.json +9 -5
  188. package/{unit-react-native-components.podspec → react-native-unit-components.podspec} +1 -1
  189. package/src/assets/images/close.png +0 -0
  190. package/src/assets/images/index.ts +1 -0
  191. package/src/components/UNActivityComponent/UNActivityComponent.tsx +21 -0
  192. package/src/components/UNActivityComponent/UNActivityComponent.utils.ts +11 -0
  193. package/src/components/UNBookPaymentComponent/UNBookPaymentComponent.tsx +37 -0
  194. package/src/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.ts +29 -0
  195. package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.ts +1 -0
  196. package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.styles.ts +13 -0
  197. package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.tsx +136 -0
  198. package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.ts +34 -0
  199. package/src/components/UNCardComponent/UNCardComponent.tsx +73 -0
  200. package/src/components/UNCardComponent/UNCardComponent.utils.ts +28 -0
  201. package/src/components/index.ts +4 -2
  202. package/src/custom.d.ts +5 -0
  203. package/src/helpers/BottomSheet/BottomSheet.styles.ts +70 -0
  204. package/src/helpers/{BottomSheet.tsx → BottomSheet/BottomSheet.tsx} +72 -110
  205. package/src/helpers/EventBus.ts +13 -13
  206. package/src/hooks/listenerToBus.ts +23 -0
  207. package/src/hooks/useAppStateListener.ts +25 -0
  208. package/src/index.tsx +5 -1
  209. package/src/messages/nativeMessages/index.ts +3 -0
  210. package/src/messages/webMessages/bookPaymentMessage.ts +12 -0
  211. package/src/{webComponent → messages}/webMessages/cardMessage.ts +4 -2
  212. package/src/messages/webMessages/index.ts +21 -0
  213. package/src/{webComponent → messages}/webMessages/pageMessage.ts +0 -0
  214. package/src/{webComponent → messages}/webMessages/unitMessages.ts +1 -0
  215. package/src/nativeComponenet/NativeComponentExample.tsx +2 -2
  216. package/src/scripts/html/bodyHtml.ts +46 -0
  217. package/src/scripts/html/bodyScript.ts +67 -0
  218. package/src/sharedTypes/bookPayment.types.ts +27 -0
  219. package/src/sharedTypes/card.types.ts +59 -0
  220. package/src/sharedTypes/index.ts +2 -0
  221. package/src/sharedTypes/types.ts +35 -0
  222. package/src/styles/variables.ts +9 -0
  223. package/src/unitSdkManager/UnitSdk.api.ts +31 -0
  224. package/src/unitSdkManager/UnitSdkManager.ts +33 -0
  225. package/src/webComponent/WebComponent.tsx +43 -45
  226. package/src/webComponent/html.ts +22 -46
  227. package/lib/commonjs/components/BottomSheet/BottomSheetComponent.js.map +0 -1
  228. package/lib/commonjs/components/Card/CardComponent.js.map +0 -1
  229. package/lib/commonjs/helpers/BottomSheet.js.map +0 -1
  230. package/lib/commonjs/webComponent/webMessages/cardMessage.js.map +0 -1
  231. package/lib/commonjs/webComponent/webMessages/unitMessages.js.map +0 -1
  232. package/lib/module/components/BottomSheet/BottomSheetComponent.js +0 -118
  233. package/lib/module/components/BottomSheet/BottomSheetComponent.js.map +0 -1
  234. package/lib/module/components/Card/CardComponent.js +0 -75
  235. package/lib/module/components/Card/CardComponent.js.map +0 -1
  236. package/lib/module/helpers/BottomSheet.js.map +0 -1
  237. package/lib/module/webComponent/webMessages/cardMessage.js +0 -6
  238. package/lib/module/webComponent/webMessages/cardMessage.js.map +0 -1
  239. package/lib/module/webComponent/webMessages/unitMessages.js.map +0 -1
  240. package/src/components/BottomSheet/BottomSheetComponent.tsx +0 -113
  241. package/src/components/Card/CardComponent.tsx +0 -75
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getStylesObject","fadeAnim","StyleSheet","create","outsideContainer","position","top","bottom","right","left","animation","backgroundColor","flex","opacity","container","marginTop","Dimensions","get","height","BOTTOM_SHEET_MAX_PRECANTAGE_SIZE","shadowColor","VARIABLES","COLORS","BLACK","shadowOffset","width","shadowOpacity","shadowRadius","elevation","borderTopLeftRadius","borderTopRightRadius","WHITE","overflow","lineContainer","alignItems","line","borderRadius","SILVER_FLAKE","outerContent","innerContent","closeButton","display","justifyContent","padding","zIndex"],"sources":["BottomSheet.styles.ts"],"sourcesContent":["import { Dimensions, StyleSheet } from 'react-native';\nimport { BOTTOM_SHEET_MAX_PRECANTAGE_SIZE } from '../../components/UNBottomSheetComponent/UNBottomSheetComponent.constants';\nimport { VARIABLES } from '../../styles/variables';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const getStylesObject = (fadeAnim: any) => {\n return StyleSheet.create({\n outsideContainer: {\n position: 'absolute',\n top: 0,\n bottom: 0,\n right: 0,\n left: 0\n },\n animation: {\n backgroundColor: 'black',\n flex: 1,\n opacity: fadeAnim,\n },\n container: {\n position: 'relative',\n flex: 1,\n marginTop: Dimensions.get('window').height * (1 - BOTTOM_SHEET_MAX_PRECANTAGE_SIZE),\n shadowColor: VARIABLES.COLORS.BLACK,\n shadowOffset: {\n width: 0,\n height: 6,\n },\n shadowOpacity: 0.37,\n shadowRadius: 7.49,\n elevation: 12,\n borderTopLeftRadius: 15,\n borderTopRightRadius: 15,\n backgroundColor: VARIABLES.COLORS.WHITE,\n overflow: 'hidden'\n },\n lineContainer: {\n borderTopLeftRadius: 30,\n borderTopRightRadius: 30,\n alignItems: 'center'\n },\n line: {\n width: 35,\n height: 4,\n borderRadius: 2,\n marginTop: 18,\n backgroundColor: VARIABLES.COLORS.SILVER_FLAKE,\n },\n outerContent: {\n flex: -1,\n },\n innerContent: {\n flex: -1,\n },\n closeButton: {\n position: 'absolute',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: 36,\n height: 36,\n backgroundColor: VARIABLES.COLORS.WHITE,\n borderRadius: 18,\n padding: 7,\n top: 12,\n right: 12,\n zIndex: 100\n }\n });\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;AACO,MAAMA,eAAe,GAAIC,QAAD,IAAmB;EAChD,OAAOC,uBAAA,CAAWC,MAAX,CAAkB;IACvBC,gBAAgB,EAAE;MAChBC,QAAQ,EAAE,UADM;MAEhBC,GAAG,EAAE,CAFW;MAGhBC,MAAM,EAAE,CAHQ;MAIhBC,KAAK,EAAE,CAJS;MAKhBC,IAAI,EAAE;IALU,CADK;IAQvBC,SAAS,EAAE;MACTC,eAAe,EAAE,OADR;MAETC,IAAI,EAAE,CAFG;MAGTC,OAAO,EAAEZ;IAHA,CARY;IAavBa,SAAS,EAAE;MACTT,QAAQ,EAAE,UADD;MAETO,IAAI,EAAE,CAFG;MAGTG,SAAS,EAAEC,uBAAA,CAAWC,GAAX,CAAe,QAAf,EAAyBC,MAAzB,IAAmC,IAAIC,wDAAvC,CAHF;MAITC,WAAW,EAAEC,oBAAA,CAAUC,MAAV,CAAiBC,KAJrB;MAKTC,YAAY,EAAE;QACZC,KAAK,EAAE,CADK;QAEZP,MAAM,EAAE;MAFI,CALL;MASTQ,aAAa,EAAE,IATN;MAUTC,YAAY,EAAE,IAVL;MAWTC,SAAS,EAAE,EAXF;MAYTC,mBAAmB,EAAE,EAZZ;MAaTC,oBAAoB,EAAE,EAbb;MAcTnB,eAAe,EAAEU,oBAAA,CAAUC,MAAV,CAAiBS,KAdzB;MAeTC,QAAQ,EAAE;IAfD,CAbY;IA8BvBC,aAAa,EAAE;MACbJ,mBAAmB,EAAE,EADR;MAEbC,oBAAoB,EAAE,EAFT;MAGbI,UAAU,EAAE;IAHC,CA9BQ;IAmCvBC,IAAI,EAAE;MACJV,KAAK,EAAE,EADH;MAEJP,MAAM,EAAE,CAFJ;MAGJkB,YAAY,EAAE,CAHV;MAIJrB,SAAS,EAAE,EAJP;MAKJJ,eAAe,EAAEU,oBAAA,CAAUC,MAAV,CAAiBe;IAL9B,CAnCiB;IA0CvBC,YAAY,EAAE;MACZ1B,IAAI,EAAE,CAAC;IADK,CA1CS;IA6CvB2B,YAAY,EAAE;MACZ3B,IAAI,EAAE,CAAC;IADK,CA7CS;IAgDvB4B,WAAW,EAAE;MACXnC,QAAQ,EAAE,UADC;MAEXoC,OAAO,EAAE,MAFE;MAGXP,UAAU,EAAE,QAHD;MAIXQ,cAAc,EAAE,QAJL;MAKXjB,KAAK,EAAE,EALI;MAMXP,MAAM,EAAE,EANG;MAOXP,eAAe,EAAEU,oBAAA,CAAUC,MAAV,CAAiBS,KAPvB;MAQXK,YAAY,EAAE,EARH;MASXO,OAAO,EAAE,CATE;MAUXrC,GAAG,EAAE,EAVM;MAWXE,KAAK,EAAE,EAXI;MAYXoC,MAAM,EAAE;IAZG;EAhDU,CAAlB,CAAP;AA+DD,CAhEM"}
@@ -3,19 +3,11 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = exports.BusEvent = void 0;
6
+ exports.default = void 0;
7
7
 
8
8
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
9
 
10
- let BusEvent;
11
- exports.BusEvent = BusEvent;
12
-
13
- (function (BusEvent) {
14
- BusEvent["REQUEST_RENDERING"] = "unitRequestRendering";
15
- BusEvent["CARD_STATUS_CHANGED"] = "cardStatusChanged";
16
- BusEvent["REQUEST_REFRESH"] = "requestRefresh";
17
- })(BusEvent || (exports.BusEvent = BusEvent = {}));
18
-
10
+ /* eslint-disable @typescript-eslint/no-explicit-any */
19
11
  class EventBus {
20
12
  constructor() {
21
13
  _defineProperty(this, "eventListeners", {});
@@ -28,7 +20,7 @@ class EventBus {
28
20
  }
29
21
 
30
22
  event(event, data) {
31
- let listeners = this.eventListeners[event.valueOf()];
23
+ const listeners = this.eventListeners[event.valueOf()];
32
24
 
33
25
  if (Array.isArray(listeners)) {
34
26
  listeners.map(listener => {
@@ -40,7 +32,7 @@ class EventBus {
40
32
  }
41
33
 
42
34
  addListener(event, listener) {
43
- let listeners = this.eventListeners[event.valueOf()];
35
+ const listeners = this.eventListeners[event.valueOf()];
44
36
 
45
37
  if (Array.isArray(listeners)) {
46
38
  listeners.push(listener);
@@ -51,7 +43,7 @@ class EventBus {
51
43
 
52
44
  removeListener(listener) {
53
45
  Object.keys(this.eventListeners).map(eventName => {
54
- let listeners = this.eventListeners[eventName];
46
+ const listeners = this.eventListeners[eventName];
55
47
 
56
48
  if (listeners) {
57
49
  this._remove(listeners, listener);
@@ -1 +1 @@
1
- {"version":3,"names":["BusEvent","EventBus","constructor","eventListeners","Instance","_instance","event","data","listeners","valueOf","Array","isArray","map","listener","addListener","push","removeListener","Object","keys","eventName","_remove","length","array","item","i","l","splice"],"sources":["EventBus.ts"],"sourcesContent":["export enum BusEvent {\n REQUEST_RENDERING = 'unitRequestRendering',\n CARD_STATUS_CHANGED = 'cardStatusChanged',\n REQUEST_REFRESH = 'requestRefresh'\n}\n\nexport default class EventBus {\n private static _instance: EventBus;\n\n private eventListeners: { [name: string]: Array<(data: any) => void> } = {}\n\n private constructor() {\n this.eventListeners = {};\n }\n\n public static get Instance() {\n return this._instance || (this._instance = new this());\n }\n\n public event(event: BusEvent, data: any) {\n let listeners = this.eventListeners[event.valueOf()];\n if (Array.isArray(listeners)) {\n listeners.map(listener => {\n if (typeof listener === 'function') {\n listener(data);\n }\n })\n }\n }\n\n public addListener(event: BusEvent, listener: (data: any) => void) {\n let listeners = this.eventListeners[event.valueOf()];\n if (Array.isArray(listeners)) {\n listeners.push(listener);\n } else {\n this.eventListeners[event.valueOf()] = [listener];\n }\n }\n\n public removeListener(listener: (data: any) => void) {\n Object.keys(this.eventListeners).map(eventName => {\n let listeners = this.eventListeners[eventName];\n if (listeners) {\n this._remove(listeners, listener);\n if (listeners.length === 0) {\n delete this.eventListeners[eventName];\n }\n }\n })\n }\n\n private _remove(array: Array<(data: any) => void>, item: (data: string) => void) {\n if (!array) return;\n for (let i = 0, l = array.length; i < l; i++) {\n if (item === array[i]) array.splice(i, 1);\n }\n }\n}\n"],"mappings":";;;;;;;;;IAAYA,Q;;;WAAAA,Q;EAAAA,Q;EAAAA,Q;EAAAA,Q;GAAAA,Q,wBAAAA,Q;;AAMG,MAAMC,QAAN,CAAe;EAKpBC,WAAW,GAAG;IAAA,wCAFmD,EAEnD;;IACpB,KAAKC,cAAL,GAAsB,EAAtB;EACD;;EAEyB,WAARC,QAAQ,GAAG;IAC3B,OAAO,KAAKC,SAAL,KAAmB,KAAKA,SAAL,GAAiB,IAAI,IAAJ,EAApC,CAAP;EACD;;EAEMC,KAAK,CAACA,KAAD,EAAkBC,IAAlB,EAA6B;IACvC,IAAIC,SAAS,GAAG,KAAKL,cAAL,CAAoBG,KAAK,CAACG,OAAN,EAApB,CAAhB;;IACA,IAAIC,KAAK,CAACC,OAAN,CAAcH,SAAd,CAAJ,EAA8B;MAC5BA,SAAS,CAACI,GAAV,CAAcC,QAAQ,IAAI;QACxB,IAAI,OAAOA,QAAP,KAAoB,UAAxB,EAAoC;UAClCA,QAAQ,CAACN,IAAD,CAAR;QACD;MACF,CAJD;IAKD;EACF;;EAEMO,WAAW,CAACR,KAAD,EAAkBO,QAAlB,EAAiD;IACjE,IAAIL,SAAS,GAAG,KAAKL,cAAL,CAAoBG,KAAK,CAACG,OAAN,EAApB,CAAhB;;IACA,IAAIC,KAAK,CAACC,OAAN,CAAcH,SAAd,CAAJ,EAA8B;MAC5BA,SAAS,CAACO,IAAV,CAAeF,QAAf;IACD,CAFD,MAEO;MACL,KAAKV,cAAL,CAAoBG,KAAK,CAACG,OAAN,EAApB,IAAuC,CAACI,QAAD,CAAvC;IACD;EACF;;EAEMG,cAAc,CAACH,QAAD,EAAgC;IACnDI,MAAM,CAACC,IAAP,CAAY,KAAKf,cAAjB,EAAiCS,GAAjC,CAAqCO,SAAS,IAAI;MAChD,IAAIX,SAAS,GAAG,KAAKL,cAAL,CAAoBgB,SAApB,CAAhB;;MACA,IAAIX,SAAJ,EAAe;QACb,KAAKY,OAAL,CAAaZ,SAAb,EAAwBK,QAAxB;;QACA,IAAIL,SAAS,CAACa,MAAV,KAAqB,CAAzB,EAA4B;UAC1B,OAAO,KAAKlB,cAAL,CAAoBgB,SAApB,CAAP;QACD;MACF;IACF,CARD;EASD;;EAEOC,OAAO,CAACE,KAAD,EAAoCC,IAApC,EAAkE;IAC/E,IAAI,CAACD,KAAL,EAAY;;IACZ,KAAK,IAAIE,CAAC,GAAG,CAAR,EAAWC,CAAC,GAAGH,KAAK,CAACD,MAA1B,EAAkCG,CAAC,GAAGC,CAAtC,EAAyCD,CAAC,EAA1C,EAA8C;MAC5C,IAAID,IAAI,KAAKD,KAAK,CAACE,CAAD,CAAlB,EAAuBF,KAAK,CAACI,MAAN,CAAaF,CAAb,EAAgB,CAAhB;IACxB;EACF;;AAlD2B;;;;gBAATvB,Q"}
1
+ {"version":3,"names":["EventBus","constructor","eventListeners","Instance","_instance","event","data","listeners","valueOf","Array","isArray","map","listener","addListener","push","removeListener","Object","keys","eventName","_remove","length","array","item","i","l","splice"],"sources":["EventBus.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { NativeMessage } from '../messages/nativeMessages';\nimport type { WebViewMessageType } from '../messages/webMessages';\n\nexport type BusEventKey = NativeMessage | WebViewMessageType\n\nexport default class EventBus {\n private static _instance: EventBus;\n\n private eventListeners: { [name: string]: Array<(data: any) => void> } = {};\n\n private constructor() {\n this.eventListeners = {};\n }\n\n public static get Instance() {\n return this._instance || (this._instance = new this());\n }\n\n public event(event: BusEventKey, data: any) {\n const listeners = this.eventListeners[event.valueOf()];\n if (Array.isArray(listeners)) {\n listeners.map(listener => {\n if (typeof listener === 'function') {\n listener(data);\n }\n });\n }\n }\n\n public addListener(event: BusEventKey, listener: (data: any) => void) {\n const listeners = this.eventListeners[event.valueOf()];\n if (Array.isArray(listeners)) {\n listeners.push(listener);\n } else {\n this.eventListeners[event.valueOf()] = [listener];\n }\n }\n\n public removeListener(listener: (data: any) => void) {\n Object.keys(this.eventListeners).map(eventName => {\n const listeners = this.eventListeners[eventName];\n if (listeners) {\n this._remove(listeners, listener);\n if (listeners.length === 0) {\n delete this.eventListeners[eventName];\n }\n }\n });\n }\n\n private _remove(array: Array<(data: any) => void>, item: (data: string) => void) {\n if (!array) return;\n for (let i = 0, l = array.length; i < l; i++) {\n if (item === array[i]) array.splice(i, 1);\n }\n }\n}\n"],"mappings":";;;;;;;;;AAAA;AAMe,MAAMA,QAAN,CAAe;EAKpBC,WAAW,GAAG;IAAA,wCAFmD,EAEnD;;IACpB,KAAKC,cAAL,GAAsB,EAAtB;EACD;;EAEyB,WAARC,QAAQ,GAAG;IAC3B,OAAO,KAAKC,SAAL,KAAmB,KAAKA,SAAL,GAAiB,IAAI,IAAJ,EAApC,CAAP;EACD;;EAEMC,KAAK,CAACA,KAAD,EAAqBC,IAArB,EAAgC;IAC1C,MAAMC,SAAS,GAAG,KAAKL,cAAL,CAAoBG,KAAK,CAACG,OAAN,EAApB,CAAlB;;IACA,IAAIC,KAAK,CAACC,OAAN,CAAcH,SAAd,CAAJ,EAA8B;MAC5BA,SAAS,CAACI,GAAV,CAAcC,QAAQ,IAAI;QACxB,IAAI,OAAOA,QAAP,KAAoB,UAAxB,EAAoC;UAClCA,QAAQ,CAACN,IAAD,CAAR;QACD;MACF,CAJD;IAKD;EACF;;EAEMO,WAAW,CAACR,KAAD,EAAqBO,QAArB,EAAoD;IACpE,MAAML,SAAS,GAAG,KAAKL,cAAL,CAAoBG,KAAK,CAACG,OAAN,EAApB,CAAlB;;IACA,IAAIC,KAAK,CAACC,OAAN,CAAcH,SAAd,CAAJ,EAA8B;MAC5BA,SAAS,CAACO,IAAV,CAAeF,QAAf;IACD,CAFD,MAEO;MACL,KAAKV,cAAL,CAAoBG,KAAK,CAACG,OAAN,EAApB,IAAuC,CAACI,QAAD,CAAvC;IACD;EACF;;EAEMG,cAAc,CAACH,QAAD,EAAgC;IACnDI,MAAM,CAACC,IAAP,CAAY,KAAKf,cAAjB,EAAiCS,GAAjC,CAAqCO,SAAS,IAAI;MAChD,MAAMX,SAAS,GAAG,KAAKL,cAAL,CAAoBgB,SAApB,CAAlB;;MACA,IAAIX,SAAJ,EAAe;QACb,KAAKY,OAAL,CAAaZ,SAAb,EAAwBK,QAAxB;;QACA,IAAIL,SAAS,CAACa,MAAV,KAAqB,CAAzB,EAA4B;UAC1B,OAAO,KAAKlB,cAAL,CAAoBgB,SAApB,CAAP;QACD;MACF;IACF,CARD;EASD;;EAEOC,OAAO,CAACE,KAAD,EAAoCC,IAApC,EAAkE;IAC/E,IAAI,CAACD,KAAL,EAAY;;IACZ,KAAK,IAAIE,CAAC,GAAG,CAAR,EAAWC,CAAC,GAAGH,KAAK,CAACD,MAA1B,EAAkCG,CAAC,GAAGC,CAAtC,EAAyCD,CAAC,EAA1C,EAA8C;MAC5C,IAAID,IAAI,KAAKD,KAAK,CAACE,CAAD,CAAlB,EAAuBF,KAAK,CAACI,MAAN,CAAaF,CAAb,EAAgB,CAAhB;IACxB;EACF;;AAlD2B;;;;gBAATvB,Q"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useListenerToBus = void 0;
7
+
8
+ var _react = require("react");
9
+
10
+ var _EventBus = _interopRequireDefault(require("../helpers/EventBus"));
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ /* eslint-disable @typescript-eslint/no-explicit-any */
15
+ const useListenerToBus = listeners => {
16
+ (0, _react.useEffect)(() => {
17
+ {
18
+ listeners.map(listener => {
19
+ _EventBus.default.Instance.addListener(listener.busEventKey, listener.action);
20
+ });
21
+ }
22
+ return () => {
23
+ listeners.map(listener => {
24
+ _EventBus.default.Instance.removeListener(listener.action);
25
+ });
26
+ };
27
+ }, []);
28
+ };
29
+
30
+ exports.useListenerToBus = useListenerToBus;
31
+ //# sourceMappingURL=listenerToBus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useListenerToBus","listeners","useEffect","map","listener","EventBus","Instance","addListener","busEventKey","action","removeListener"],"sources":["listenerToBus.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { useEffect } from 'react';\nimport EventBus, { BusEventKey } from '../helpers/EventBus';\n\ntype Listener = {\n busEventKey: BusEventKey,\n action: (data: any) => void\n}\n\nexport const useListenerToBus = (listeners: Listener[]) => {\n useEffect(() => {\n {\n listeners.map((listener: {busEventKey: BusEventKey, action: (data: any) => void}) => {\n EventBus.Instance.addListener(listener.busEventKey, listener.action);\n });\n }\n return (() => {\n listeners.map((listener: {busEventKey: BusEventKey, action: (data: any) => void}) => {\n EventBus.Instance.removeListener(listener.action);\n });\n });\n }, []);\n};\n"],"mappings":";;;;;;;AACA;;AACA;;;;AAFA;AASO,MAAMA,gBAAgB,GAAIC,SAAD,IAA2B;EACzD,IAAAC,gBAAA,EAAU,MAAM;IACd;MACED,SAAS,CAACE,GAAV,CAAeC,QAAD,IAAuE;QACnFC,iBAAA,CAASC,QAAT,CAAkBC,WAAlB,CAA8BH,QAAQ,CAACI,WAAvC,EAAoDJ,QAAQ,CAACK,MAA7D;MACD,CAFD;IAGD;IACD,OAAQ,MAAM;MACZR,SAAS,CAACE,GAAV,CAAeC,QAAD,IAAuE;QACnFC,iBAAA,CAASC,QAAT,CAAkBI,cAAlB,CAAiCN,QAAQ,CAACK,MAA1C;MACD,CAFD;IAGD,CAJD;EAKD,CAXD,EAWG,EAXH;AAYD,CAbM"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useAppStateListener = void 0;
7
+
8
+ var _react = require("react");
9
+
10
+ var _reactNative = require("react-native");
11
+
12
+ /* eslint-disable @typescript-eslint/no-explicit-any */
13
+ const getIsAppActive = currentAppState => {
14
+ return currentAppState !== 'background' && currentAppState !== 'inactive';
15
+ };
16
+
17
+ const useAppStateListener = () => {
18
+ const appState = (0, _react.useRef)(_reactNative.AppState.currentState);
19
+ const [isAppActive, setIsAppActive] = (0, _react.useState)(getIsAppActive(appState.current));
20
+ (0, _react.useEffect)(() => {
21
+ const subscription = _reactNative.AppState.addEventListener('change', nextAppState => {
22
+ appState.current = nextAppState;
23
+ setIsAppActive(getIsAppActive(appState.current));
24
+ });
25
+
26
+ return () => {
27
+ subscription.remove();
28
+ };
29
+ }, []);
30
+ return isAppActive;
31
+ };
32
+
33
+ exports.useAppStateListener = useAppStateListener;
34
+ //# sourceMappingURL=useAppStateListener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getIsAppActive","currentAppState","useAppStateListener","appState","useRef","AppState","currentState","isAppActive","setIsAppActive","useState","current","useEffect","subscription","addEventListener","nextAppState","remove"],"sources":["useAppStateListener.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { useEffect, useRef, useState } from 'react';\nimport { AppState, AppStateStatus } from 'react-native';\n\nconst getIsAppActive = (currentAppState: AppStateStatus) => {\n return currentAppState !== 'background' && currentAppState !== 'inactive';\n};\n\nexport const useAppStateListener = () => {\n const appState = useRef(AppState.currentState);\n const [isAppActive, setIsAppActive] = useState<boolean>(getIsAppActive(appState.current));\n\n useEffect(() => {\n const subscription = AppState.addEventListener('change', nextAppState => {\n appState.current = nextAppState;\n setIsAppActive(getIsAppActive(appState.current));\n });\n\n return () => {\n subscription.remove();\n };\n }, []);\n\n return isAppActive;\n};\n"],"mappings":";;;;;;;AACA;;AACA;;AAFA;AAIA,MAAMA,cAAc,GAAIC,eAAD,IAAqC;EAC1D,OAAOA,eAAe,KAAK,YAApB,IAAoCA,eAAe,KAAK,UAA/D;AACD,CAFD;;AAIO,MAAMC,mBAAmB,GAAG,MAAM;EACvC,MAAMC,QAAQ,GAAG,IAAAC,aAAA,EAAOC,qBAAA,CAASC,YAAhB,CAAjB;EACA,MAAM,CAACC,WAAD,EAAcC,cAAd,IAAgC,IAAAC,eAAA,EAAkBT,cAAc,CAACG,QAAQ,CAACO,OAAV,CAAhC,CAAtC;EAEA,IAAAC,gBAAA,EAAU,MAAM;IACd,MAAMC,YAAY,GAAGP,qBAAA,CAASQ,gBAAT,CAA0B,QAA1B,EAAoCC,YAAY,IAAI;MACvEX,QAAQ,CAACO,OAAT,GAAmBI,YAAnB;MACAN,cAAc,CAACR,cAAc,CAACG,QAAQ,CAACO,OAAV,CAAf,CAAd;IACD,CAHoB,CAArB;;IAKA,OAAO,MAAM;MACXE,YAAY,CAACG,MAAb;IACD,CAFD;EAGD,CATD,EASG,EATH;EAWA,OAAOR,WAAP;AACD,CAhBM"}
@@ -3,11 +3,28 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ var _exportNames = {
7
+ UnitSDK: true,
8
+ UNEnvironment: true
9
+ };
10
+ Object.defineProperty(exports, "UNEnvironment", {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _UnitSdkManager.UNEnvironment;
14
+ }
15
+ });
16
+ Object.defineProperty(exports, "UnitSDK", {
17
+ enumerable: true,
18
+ get: function () {
19
+ return _UnitSdkManager.UnitSDK;
20
+ }
21
+ });
6
22
 
7
23
  var _components = require("./components");
8
24
 
9
25
  Object.keys(_components).forEach(function (key) {
10
26
  if (key === "default" || key === "__esModule") return;
27
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
11
28
  if (key in exports && exports[key] === _components[key]) return;
12
29
  Object.defineProperty(exports, key, {
13
30
  enumerable: true,
@@ -16,4 +33,20 @@ Object.keys(_components).forEach(function (key) {
16
33
  }
17
34
  });
18
35
  });
36
+
37
+ var _sharedTypes = require("./sharedTypes");
38
+
39
+ Object.keys(_sharedTypes).forEach(function (key) {
40
+ if (key === "default" || key === "__esModule") return;
41
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
42
+ if (key in exports && exports[key] === _sharedTypes[key]) return;
43
+ Object.defineProperty(exports, key, {
44
+ enumerable: true,
45
+ get: function () {
46
+ return _sharedTypes[key];
47
+ }
48
+ });
49
+ });
50
+
51
+ var _UnitSdkManager = require("./unitSdkManager/UnitSdkManager");
19
52
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.tsx"],"sourcesContent":["export * from './components'\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
1
+ {"version":3,"names":[],"sources":["index.tsx"],"sourcesContent":["export * from './components';\n\nexport * from './sharedTypes';\n\nexport { UnitSDK, UNEnvironment } from './unitSdkManager/UnitSdkManager';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AAEA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AAEA"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.NativeMessage = void 0;
7
+ let NativeMessage;
8
+ exports.NativeMessage = NativeMessage;
9
+
10
+ (function (NativeMessage) {
11
+ NativeMessage["IS_SCRIPT_FETCHED"] = "isScriptFetched";
12
+ })(NativeMessage || (exports.NativeMessage = NativeMessage = {}));
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NativeMessage"],"sources":["index.ts"],"sourcesContent":["export enum NativeMessage {\n IS_SCRIPT_FETCHED = 'isScriptFetched'\n}\n"],"mappings":";;;;;;IAAYA,a;;;WAAAA,a;EAAAA,a;GAAAA,a,6BAAAA,a"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.BookPaymentMessage = void 0;
7
+ let BookPaymentMessage;
8
+ exports.BookPaymentMessage = BookPaymentMessage;
9
+
10
+ (function (BookPaymentMessage) {
11
+ BookPaymentMessage["PAYMENT_CREATED"] = "unitPaymentCreated";
12
+ })(BookPaymentMessage || (exports.BookPaymentMessage = BookPaymentMessage = {}));
13
+ //# sourceMappingURL=bookPaymentMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["BookPaymentMessage"],"sources":["bookPaymentMessage.ts"],"sourcesContent":["import type { UNBookPaymentData } from '../../sharedTypes';\n\nexport enum BookPaymentMessage {\n PAYMENT_CREATED = 'unitPaymentCreated'\n}\n\nexport interface PaymentCreatedEvent {\n data: UNBookPaymentData\n}\n\nexport type BookPaymentEvent =\n| PaymentCreatedEvent\n"],"mappings":";;;;;;IAEYA,kB;;;WAAAA,kB;EAAAA,kB;GAAAA,kB,kCAAAA,kB"}
@@ -8,6 +8,6 @@ let CardMessage;
8
8
  exports.CardMessage = CardMessage;
9
9
 
10
10
  (function (CardMessage) {
11
- CardMessage["CARD_STATUS_CHANGE"] = "cardStatusChanged";
11
+ CardMessage["CARD_STATUS_CHANGED"] = "unitCardStatusChanged";
12
12
  })(CardMessage || (exports.CardMessage = CardMessage = {}));
13
13
  //# sourceMappingURL=cardMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["CardMessage"],"sources":["cardMessage.ts"],"sourcesContent":["import type { UNCardData } from '../../sharedTypes';\n\nexport enum CardMessage {\n CARD_STATUS_CHANGED = 'unitCardStatusChanged'\n}\n\nexport interface CardStatusChangedEvent {\n card: UNCardData;\n}\n\nexport type CardEvent =\n | CardStatusChangedEvent\n"],"mappings":";;;;;;IAEYA,W;;;WAAAA,W;EAAAA,W;GAAAA,W,2BAAAA,W"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["import type { BookPaymentEvent, BookPaymentMessage } from './bookPaymentMessage';\nimport type { CardEvent, CardMessage } from './cardMessage';\nimport type { PageEvent, PageMessage } from './pageMessage';\nimport type { UnitEvent, UnitMessage } from './unitMessages';\n\nexport type WebViewMessageType =\n | PageMessage\n | CardMessage\n | UnitMessage\n | BookPaymentMessage\n\ntype WebViewEvent =\n | PageEvent\n | UnitEvent\n | CardEvent\n | BookPaymentEvent\n\nexport interface WebViewMessage {\n type: WebViewMessageType,\n details?: WebViewEvent\n}\n"],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"names":["UnitMessage"],"sources":["unitMessages.ts"],"sourcesContent":["export enum UnitMessage {\n UNIT_REQUEST_RENDERING = 'unitRequestRendering',\n UNIT_REQUEST_REFRESH = 'unitRequestRefresh',\n UNIT_REQUEST_CLOSE_FLOW = 'unitRequestCloseFlow',\n UNIT_REQUEST_OPEN_LINK = 'unitRequestOpenLink',\n UNIT_ON_LOAD = 'unitOnLoad'\n}\n\nexport interface RequestRenderingData {\n nativePlace: string;\n nativeComponent: string;\n}\n\nexport interface RequestRenderingEvent {\n data: string;\n}\n\nexport interface RequestRefreshEvent {\n refEvent: string;\n dependencies: string[];\n resourceId: string;\n}\n\nexport interface RequestOpenLinkEvent {\n href: string;\n target: string\n}\n\nexport type UnitEvent =\n | RequestRenderingEvent\n | RequestRefreshEvent\n | RequestOpenLinkEvent\n"],"mappings":";;;;;;IAAYA,W;;;WAAAA,W;EAAAA,W;EAAAA,W;EAAAA,W;EAAAA,W;EAAAA,W;GAAAA,W,2BAAAA,W"}
@@ -7,8 +7,8 @@ exports.UnitReactNativeComponentsView = void 0;
7
7
 
8
8
  var _reactNative = require("react-native");
9
9
 
10
- const LINKING_ERROR = `The package 'unit-react-native-components' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
11
- ios: "- You have run 'pod install'\n",
10
+ const LINKING_ERROR = 'The package \'react-native-unit-components\' doesn\'t seem to be linked. Make sure: \n\n' + _reactNative.Platform.select({
11
+ ios: '- You have run \'pod install\'\n',
12
12
  default: ''
13
13
  }) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo managed workflow\n';
14
14
  const ComponentName = 'UnitReactNativeComponentsView';
@@ -1 +1 @@
1
- {"version":3,"names":["LINKING_ERROR","Platform","select","ios","default","ComponentName","UnitReactNativeComponentsView","UIManager","getViewManagerConfig","requireNativeComponent","Error"],"sources":["NativeComponentExample.tsx"],"sourcesContent":["import {\n requireNativeComponent,\n UIManager,\n Platform,\n ViewStyle,\n} from 'react-native';\n\nconst LINKING_ERROR =\n `The package 'unit-react-native-components' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\ntype UnitReactNativeComponentsProps = {\n color: string;\n style: ViewStyle;\n};\n\nconst ComponentName = 'UnitReactNativeComponentsView';\n\nexport const UnitReactNativeComponentsView =\n UIManager.getViewManagerConfig(ComponentName) != null\n ? requireNativeComponent<UnitReactNativeComponentsProps>(ComponentName)\n : () => {\n throw new Error(LINKING_ERROR);\n };\n"],"mappings":";;;;;;;AAAA;;AAOA,MAAMA,aAAa,GAChB,uFAAD,GACAC,qBAAA,CAASC,MAAT,CAAgB;EAAEC,GAAG,EAAE,gCAAP;EAAyCC,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAWA,MAAMC,aAAa,GAAG,+BAAtB;AAEO,MAAMC,6BAA6B,GACxCC,sBAAA,CAAUC,oBAAV,CAA+BH,aAA/B,KAAiD,IAAjD,GACI,IAAAI,mCAAA,EAAuDJ,aAAvD,CADJ,GAEI,MAAM;EACN,MAAM,IAAIK,KAAJ,CAAUV,aAAV,CAAN;AACD,CALE"}
1
+ {"version":3,"names":["LINKING_ERROR","Platform","select","ios","default","ComponentName","UnitReactNativeComponentsView","UIManager","getViewManagerConfig","requireNativeComponent","Error"],"sources":["NativeComponentExample.tsx"],"sourcesContent":["import {\n requireNativeComponent,\n UIManager,\n Platform,\n ViewStyle,\n} from 'react-native';\n\nconst LINKING_ERROR =\n 'The package \\'react-native-unit-components\\' doesn\\'t seem to be linked. Make sure: \\n\\n' +\n Platform.select({ ios: '- You have run \\'pod install\\'\\n', default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\ntype UnitReactNativeComponentsProps = {\n color: string;\n style: ViewStyle;\n};\n\nconst ComponentName = 'UnitReactNativeComponentsView';\n\nexport const UnitReactNativeComponentsView =\n UIManager.getViewManagerConfig(ComponentName) != null\n ? requireNativeComponent<UnitReactNativeComponentsProps>(ComponentName)\n : () => {\n throw new Error(LINKING_ERROR);\n };\n"],"mappings":";;;;;;;AAAA;;AAOA,MAAMA,aAAa,GACjB,6FACAC,qBAAA,CAASC,MAAT,CAAgB;EAAEC,GAAG,EAAE,kCAAP;EAA2CC,OAAO,EAAE;AAApD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAWA,MAAMC,aAAa,GAAG,+BAAtB;AAEO,MAAMC,6BAA6B,GACxCC,sBAAA,CAAUC,oBAAV,CAA+BH,aAA/B,KAAiD,IAAjD,GACI,IAAAI,mCAAA,EAAuDJ,aAAvD,CADJ,GAEI,MAAM;EACN,MAAM,IAAIK,KAAJ,CAAUV,aAAV,CAAN;AACD,CALE"}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.webViewId = exports.getHtmlBody = exports.PresentationMode = void 0;
7
+ const webViewId = 'webViewContainer';
8
+ exports.webViewId = webViewId;
9
+ let PresentationMode;
10
+ exports.PresentationMode = PresentationMode;
11
+
12
+ (function (PresentationMode) {
13
+ PresentationMode["CoverInjectedHeight"] = "coverInjectedHeight";
14
+ PresentationMode["Inherit"] = "inherit";
15
+ PresentationMode["Default"] = "deafult";
16
+ })(PresentationMode || (exports.PresentationMode = PresentationMode = {}));
17
+
18
+ const getHtmlBody = (unitComponent, unitComponentProps, presentationMode) => {
19
+ const currentComponent = `<${unitComponent} ${unitComponentProps || ''}> </${unitComponent}>`;
20
+
21
+ switch (presentationMode) {
22
+ case PresentationMode.CoverInjectedHeight:
23
+ return getCoverInjectedHeightBodyScript(currentComponent);
24
+
25
+ case PresentationMode.Inherit:
26
+ return getInheritParentSizeScript(currentComponent);
27
+
28
+ default:
29
+ return currentComponent;
30
+ }
31
+ };
32
+
33
+ exports.getHtmlBody = getHtmlBody;
34
+
35
+ const getCoverInjectedHeightBodyScript = currentUnitScript => {
36
+ return `
37
+ <div id=${webViewId}>
38
+ <div style="height: 100%; display: block; padding: 1px;">
39
+ ${currentUnitScript}
40
+ </div>
41
+ </div>
42
+ `;
43
+ };
44
+
45
+ const getInheritParentSizeScript = currentUnitScript => {
46
+ return `
47
+ <div style="height: 100vh">
48
+ ${currentUnitScript}
49
+ </div>
50
+ `;
51
+ };
52
+ //# sourceMappingURL=bodyHtml.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["webViewId","PresentationMode","getHtmlBody","unitComponent","unitComponentProps","presentationMode","currentComponent","CoverInjectedHeight","getCoverInjectedHeightBodyScript","Inherit","getInheritParentSizeScript","currentUnitScript"],"sources":["bodyHtml.ts"],"sourcesContent":["export const webViewId = 'webViewContainer';\n\nexport enum PresentationMode {\n /*\n CoverInjectedHeight - give id (<webViewId> param) to enable style injection to the root. Then cover the injected height.\n\n Inherit - inherit the parent size by style of 100 view height\n\n Default - return the unit component script\n */\n\n CoverInjectedHeight = 'coverInjectedHeight',\n Inherit = 'inherit',\n Default = 'deafult'\n}\n\nexport const getHtmlBody = (unitComponent: string, unitComponentProps?: string, presentationMode?: PresentationMode) => {\n const currentComponent = `<${unitComponent} ${unitComponentProps || ''}> </${unitComponent}>`;\n\n switch (presentationMode) {\n case PresentationMode.CoverInjectedHeight:\n return getCoverInjectedHeightBodyScript(currentComponent);\n case PresentationMode.Inherit:\n return getInheritParentSizeScript(currentComponent);\n default:\n return currentComponent;\n }\n};\n\nconst getCoverInjectedHeightBodyScript = (currentUnitScript: string) => {\n return `\n <div id=${webViewId}>\n <div style=\"height: 100%; display: block; padding: 1px;\">\n ${currentUnitScript}\n </div>\n </div>\n `;\n};\n\nconst getInheritParentSizeScript = (currentUnitScript: string) => {\n return `\n <div style=\"height: 100vh\">\n ${currentUnitScript}\n </div>\n `;\n};\n"],"mappings":";;;;;;AAAO,MAAMA,SAAS,GAAG,kBAAlB;;IAEKC,gB;;;WAAAA,gB;EAAAA,gB;EAAAA,gB;EAAAA,gB;GAAAA,gB,gCAAAA,gB;;AAcL,MAAMC,WAAW,GAAG,CAACC,aAAD,EAAwBC,kBAAxB,EAAqDC,gBAArD,KAA6F;EACtH,MAAMC,gBAAgB,GAAI,IAAGH,aAAc,IAAGC,kBAAkB,IAAI,EAAG,OAAMD,aAAc,GAA3F;;EAEA,QAAQE,gBAAR;IACE,KAAKJ,gBAAgB,CAACM,mBAAtB;MACE,OAAOC,gCAAgC,CAACF,gBAAD,CAAvC;;IACF,KAAKL,gBAAgB,CAACQ,OAAtB;MACE,OAAOC,0BAA0B,CAACJ,gBAAD,CAAjC;;IACF;MACE,OAAOA,gBAAP;EANJ;AAQD,CAXM;;;;AAaP,MAAME,gCAAgC,GAAIG,iBAAD,IAA+B;EACtE,OAAQ;AACV,cAAcX,SAAU;AACxB;AACA,UAAUW,iBAAkB;AAC5B;AACA;AACA,GANE;AAOD,CARD;;AAUA,MAAMD,0BAA0B,GAAIC,iBAAD,IAA+B;EAChE,OAAQ;AACV;AACA,QAAQA,iBAAkB;AAC1B;AACA,GAJE;AAKD,CAND"}
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.POST_PAGE_HEIGHT = exports.POST_MESSAGE_TO_SDK = exports.LISTENERS = exports.DISPTACH_RENDERING_EVENT = void 0;
7
+
8
+ var _cardMessage = require("../../messages/webMessages/cardMessage");
9
+
10
+ var _pageMessage = require("../../messages/webMessages/pageMessage");
11
+
12
+ var _unitMessages = require("../../messages/webMessages/unitMessages");
13
+
14
+ const POST_MESSAGE_TO_SDK = `
15
+ const postMessageToSDK = (message) => {
16
+ if ('ReactNativeWebView' in window) {
17
+ const messageString = JSON.stringify(message)
18
+ window['ReactNativeWebView'].postMessage(messageString)
19
+ }
20
+ }
21
+ `;
22
+ exports.POST_MESSAGE_TO_SDK = POST_MESSAGE_TO_SDK;
23
+ const POST_PAGE_HEIGHT = `
24
+ const postHeight = () => {
25
+ setTimeout(() => {
26
+ const height = window.document.documentElement.getBoundingClientRect().height
27
+ postMessageToSDK({ type: "${_pageMessage.PageMessage.PAGE_HEIGHT}", details: { height } })
28
+ })
29
+ }
30
+ `;
31
+ exports.POST_PAGE_HEIGHT = POST_PAGE_HEIGHT;
32
+ const LISTENERS = {
33
+ isPageLoaded: `
34
+ window.addEventListener('DOMContentLoaded', e => {
35
+ postMessageToSDK({ type: "${_pageMessage.PageMessage.PAGE_LOADED}" })
36
+ });
37
+ `,
38
+ requestRendering: `
39
+ window.addEventListener("${_unitMessages.UnitMessage.UNIT_REQUEST_RENDERING}", (e) => {
40
+ postMessageToSDK({ type: "${_unitMessages.UnitMessage.UNIT_REQUEST_RENDERING}", details: { data: JSON.stringify(e.detail) }})
41
+ });
42
+ `,
43
+ onLoad: `
44
+ window.addEventListener("${_unitMessages.UnitMessage.UNIT_ON_LOAD}", (e) => {
45
+ postHeight()
46
+ postMessageToSDK({ type: "${_unitMessages.UnitMessage.UNIT_ON_LOAD}" })
47
+ });
48
+ `,
49
+ requestCloseFlow: `
50
+ window.addEventListener("${_unitMessages.UnitMessage.UNIT_REQUEST_CLOSE_FLOW}", (e) => {
51
+ postMessageToSDK({ type: "${_unitMessages.UnitMessage.UNIT_REQUEST_CLOSE_FLOW}" })
52
+ });
53
+ `,
54
+ requestOpenLink: `
55
+ window.addEventListener("${_unitMessages.UnitMessage.UNIT_REQUEST_OPEN_LINK}", (e) => {
56
+ postMessageToSDK({ type: "${_unitMessages.UnitMessage.UNIT_REQUEST_OPEN_LINK}", details: e.detail })
57
+ });
58
+ `,
59
+ cardStatusChange: `
60
+ window.addEventListener("${_cardMessage.CardMessage.CARD_STATUS_CHANGED}", (e) => {
61
+ const response = e.detail
62
+ response.then((data) => {
63
+ postMessageToSDK({ type: "${_cardMessage.CardMessage.CARD_STATUS_CHANGED}", details: { card: JSON.stringify(data.data) }})
64
+ }).catch((e) => {
65
+ console.log(e)
66
+ })
67
+ });
68
+ `
69
+ };
70
+ exports.LISTENERS = LISTENERS;
71
+ const DISPTACH_RENDERING_EVENT = `
72
+ const dispatchRenderingEvent = (details) => {
73
+ const event = new CustomEvent("${_unitMessages.UnitMessage.UNIT_REQUEST_RENDERING}",{ detail: JSON.parse(details) })
74
+ window.dispatchEvent(event)
75
+ }
76
+ `;
77
+ exports.DISPTACH_RENDERING_EVENT = DISPTACH_RENDERING_EVENT;
78
+ //# sourceMappingURL=bodyScript.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["POST_MESSAGE_TO_SDK","POST_PAGE_HEIGHT","PageMessage","PAGE_HEIGHT","LISTENERS","isPageLoaded","PAGE_LOADED","requestRendering","UnitMessage","UNIT_REQUEST_RENDERING","onLoad","UNIT_ON_LOAD","requestCloseFlow","UNIT_REQUEST_CLOSE_FLOW","requestOpenLink","UNIT_REQUEST_OPEN_LINK","cardStatusChange","CardMessage","CARD_STATUS_CHANGED","DISPTACH_RENDERING_EVENT"],"sources":["bodyScript.ts"],"sourcesContent":["import { CardMessage } from '../../messages/webMessages/cardMessage';\nimport { PageMessage } from '../../messages/webMessages/pageMessage';\nimport { UnitMessage } from '../../messages/webMessages/unitMessages';\n\nexport const POST_MESSAGE_TO_SDK = `\n const postMessageToSDK = (message) => {\n if ('ReactNativeWebView' in window) {\n const messageString = JSON.stringify(message)\n window['ReactNativeWebView'].postMessage(messageString)\n }\n }\n`;\n\nexport const POST_PAGE_HEIGHT = `\n const postHeight = () => {\n setTimeout(() => {\n const height = window.document.documentElement.getBoundingClientRect().height\n postMessageToSDK({ type: \"${PageMessage.PAGE_HEIGHT}\", details: { height } })\n })\n }\n`;\n\nexport const LISTENERS = {\n isPageLoaded:`\n window.addEventListener('DOMContentLoaded', e => {\n postMessageToSDK({ type: \"${PageMessage.PAGE_LOADED}\" })\n });\n `,\n requestRendering: `\n window.addEventListener(\"${UnitMessage.UNIT_REQUEST_RENDERING}\", (e) => {\n postMessageToSDK({ type: \"${UnitMessage.UNIT_REQUEST_RENDERING}\", details: { data: JSON.stringify(e.detail) }})\n });\n `,\n onLoad: `\n window.addEventListener(\"${UnitMessage.UNIT_ON_LOAD}\", (e) => {\n postHeight()\n postMessageToSDK({ type: \"${UnitMessage.UNIT_ON_LOAD}\" })\n });\n `,\n requestCloseFlow: `\n window.addEventListener(\"${UnitMessage.UNIT_REQUEST_CLOSE_FLOW}\", (e) => {\n postMessageToSDK({ type: \"${UnitMessage.UNIT_REQUEST_CLOSE_FLOW}\" })\n });\n `,\n requestOpenLink: `\n window.addEventListener(\"${UnitMessage.UNIT_REQUEST_OPEN_LINK}\", (e) => {\n postMessageToSDK({ type: \"${UnitMessage.UNIT_REQUEST_OPEN_LINK}\", details: e.detail })\n });\n `,\n cardStatusChange: `\n window.addEventListener(\"${CardMessage.CARD_STATUS_CHANGED}\", (e) => {\n const response = e.detail\n response.then((data) => {\n postMessageToSDK({ type: \"${CardMessage.CARD_STATUS_CHANGED}\", details: { card: JSON.stringify(data.data) }})\n }).catch((e) => {\n console.log(e)\n })\n });\n `\n};\n\nexport const DISPTACH_RENDERING_EVENT = `\n const dispatchRenderingEvent = (details) => {\n const event = new CustomEvent(\"${UnitMessage.UNIT_REQUEST_RENDERING}\",{ detail: JSON.parse(details) })\n window.dispatchEvent(event)\n }\n`;\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEO,MAAMA,mBAAmB,GAAI;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,CAPO;;AASA,MAAMC,gBAAgB,GAAI;AACjC;AACA;AACA;AACA,kCAAkCC,wBAAA,CAAYC,WAAY;AAC1D;AACA;AACA,CAPO;;AASA,MAAMC,SAAS,GAAG;EACvBC,YAAY,EAAE;AAChB;AACA,kCAAkCH,wBAAA,CAAYI,WAAY;AAC1D;AACA,GALyB;EAMvBC,gBAAgB,EAAG;AACrB,+BAA+BC,yBAAA,CAAYC,sBAAuB;AAClE,kCAAkCD,yBAAA,CAAYC,sBAAuB;AACrE;AACA,GAVyB;EAWvBC,MAAM,EAAG;AACX,+BAA+BF,yBAAA,CAAYG,YAAa;AACxD;AACA,kCAAkCH,yBAAA,CAAYG,YAAa;AAC3D;AACA,GAhByB;EAiBvBC,gBAAgB,EAAG;AACrB,+BAA+BJ,yBAAA,CAAYK,uBAAwB;AACnE,kCAAkCL,yBAAA,CAAYK,uBAAwB;AACtE;AACA,GArByB;EAsBvBC,eAAe,EAAG;AACpB,+BAA+BN,yBAAA,CAAYO,sBAAuB;AAClE,kCAAkCP,yBAAA,CAAYO,sBAAuB;AACrE;AACA,GA1ByB;EA2BvBC,gBAAgB,EAAG;AACrB,+BAA+BC,wBAAA,CAAYC,mBAAoB;AAC/D;AACA;AACA,oCAAoCD,wBAAA,CAAYC,mBAAoB;AACpE;AACA;AACA;AACA;AACA;AApCyB,CAAlB;;AAuCA,MAAMC,wBAAwB,GAAI;AACzC;AACA,qCAAqCX,yBAAA,CAAYC,sBAAuB;AACxE;AACA;AACA,CALO"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=bookPayment.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["bookPayment.types.ts"],"sourcesContent":["import type { Tags, Relationship } from \"./types\"\n\ntype BookPaymentStatus = \"Sent\" | \"Rejected\"\n\nexport type UNBookPaymentData = {\n type: \"bookPayment\",\n id: string,\n attributes: {\n createdAt: string | Date,\n status: BookPaymentStatus,\n reason: string,\n direction: 'Debit' | 'Credit',\n description: string,\n transactionSummaryOverride?: string,\n amount: string,\n tags: Tags,\n },\n relationships: {\n account: Relationship,\n customer?: Relationship,\n customers?: Relationship,\n counterpartyAccount: Relationship,\n counterpartyCustomer: Relationship,\n transaction: Relationship,\n recurringPayment: Relationship\n }\n}\n"],"mappings":""}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=card.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["card.types.ts"],"sourcesContent":["import type { Address, FullName, Limits, Relationship, Tags } from \"./types\"\n\nexport type UNCardData = IndividualDebitCard | BusinessDebitCard\n\ntype CardStatus = \"Active\" | \"Inactive\" | \"Stolen\" | \"Lost\" | \"Frozen\" | \"ClosedByCustomer\" | \"SuspectedFraud\"\n\ntype IndividualDebitCard = {\n id: string,\n type: \"individualDebitCard\" | \"individualVirtualDebitCard\",\n attributes: {\n createdAt: string,\n last4Digits: string,\n expirationDate: string,\n status: CardStatus,\n shippingAddress?: Address, /* not exists in virtual card */\n updatedAt?: string,\n design?: string,\n additionalEmbossedText?: string,\n idempotencyKey?: string,\n tags?: Tags,\n limits?: Limits,\n printOnlyBusinessName?: boolean\n },\n relationships: {\n account: Relationship,\n customer: Relationship\n }\n}\n\ntype BusinessDebitCard = {\n id: string,\n type: \"businessDebitCard\" | \"businessVirtualDebitCard\",\n attributes: {\n fullName: FullName,\n dateOfBirth: string,\n address: Address,\n shippingAddress?: Address,\n phone: string,\n email: string,\n createdAt: string,\n last4Digits: string,\n expirationDate: string,\n status: CardStatus,\n updatedAt?: string,\n ssn?: string,\n passport?: string,\n nationality?: string,\n design?: string,\n additionalEmbossedText?: string,\n idempotencyKey?: string,\n tags?: Record<string, string>\n limits?: Limits,\n printOnlyBusinessName?: boolean\n },\n relationships: {\n account: Relationship,\n customer: Relationship\n }\n}\n"],"mappings":""}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _bookPayment = require("./bookPayment.types");
8
+
9
+ Object.keys(_bookPayment).forEach(function (key) {
10
+ if (key === "default" || key === "__esModule") return;
11
+ if (key in exports && exports[key] === _bookPayment[key]) return;
12
+ Object.defineProperty(exports, key, {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _bookPayment[key];
16
+ }
17
+ });
18
+ });
19
+
20
+ var _card = require("./card.types");
21
+
22
+ Object.keys(_card).forEach(function (key) {
23
+ if (key === "default" || key === "__esModule") return;
24
+ if (key in exports && exports[key] === _card[key]) return;
25
+ Object.defineProperty(exports, key, {
26
+ enumerable: true,
27
+ get: function () {
28
+ return _card[key];
29
+ }
30
+ });
31
+ });
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './bookPayment.types';\nexport * from './card.types';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export type Address = {\n street: string,\n street2?: string,\n city: string,\n state: string,\n postalCode: string,\n country: string\n}\n\nexport type Limits = {\n dailyWithdrawal?: string | number,\n dailyPurchase?: string | number,\n monthlyWithdrawal?: string | number,\n monthlyPurchase?: string | number,\n}\n\ntype Data = {\n type: string,\n id: string\n}\n\nexport type Relationship = {\n data:\n | null\n | []\n | Data\n | Data[]\n}\n\nexport type FullName = {\n first: string,\n last: string\n}\n\nexport type Tags = Record<string, string> // TODO: specify Tag type\n"],"mappings":""}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.VARIABLES = void 0;
7
+ const VARIABLES = {
8
+ COLORS: {
9
+ WHITE: '#ffffff',
10
+ BLACK: '#000000',
11
+ BLUE: '#005fF0',
12
+ GREY: '#bbbbbb',
13
+ SILVER_FLAKE: '#D5DDE0'
14
+ }
15
+ };
16
+ exports.VARIABLES = VARIABLES;
17
+ //# sourceMappingURL=variables.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["VARIABLES","COLORS","WHITE","BLACK","BLUE","GREY","SILVER_FLAKE"],"sources":["variables.ts"],"sourcesContent":["export const VARIABLES = {\n COLORS: {\n WHITE: '#ffffff',\n BLACK: '#000000',\n BLUE: '#005fF0',\n GREY: '#bbbbbb',\n SILVER_FLAKE: '#D5DDE0'\n }\n};\n"],"mappings":";;;;;;AAAO,MAAMA,SAAS,GAAG;EACvBC,MAAM,EAAE;IACNC,KAAK,EAAE,SADD;IAENC,KAAK,EAAE,SAFD;IAGNC,IAAI,EAAE,SAHA;IAINC,IAAI,EAAE,SAJA;IAKNC,YAAY,EAAE;EALR;AADe,CAAlB"}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.globalUnitScript = exports.fetchUnitScript = void 0;
7
+
8
+ var _EventBus = _interopRequireDefault(require("../helpers/EventBus"));
9
+
10
+ var _nativeMessages = require("../messages/nativeMessages");
11
+
12
+ var _UnitSdkManager = require("./UnitSdkManager");
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
16
+ let isLoadingScript = false;
17
+ /** globalUnitScript is exported ONLY to our project components **/
18
+
19
+ let globalUnitScript = '';
20
+ exports.globalUnitScript = globalUnitScript;
21
+
22
+ const fetchUnitScript = async () => {
23
+ const env = _UnitSdkManager.UnitSDK.getEnv();
24
+
25
+ if (isLoadingScript || globalUnitScript || !env) {
26
+ // init function is called and success OR in progress
27
+ return null;
28
+ }
29
+
30
+ isLoadingScript = true;
31
+
32
+ try {
33
+ const unitScriptRes = await fetch(_UnitSdkManager.UNIT_SCRIPT_URL[env]);
34
+ const unitScript = await unitScriptRes.text();
35
+
36
+ if (unitScript) {
37
+ _EventBus.default.Instance.event(_nativeMessages.NativeMessage.IS_SCRIPT_FETCHED, {
38
+ unitScript
39
+ });
40
+
41
+ exports.globalUnitScript = globalUnitScript = unitScript;
42
+ }
43
+
44
+ return null;
45
+ } catch (e) {
46
+ console.log(e);
47
+ return null;
48
+ } finally {
49
+ isLoadingScript = false;
50
+ }
51
+ };
52
+
53
+ exports.fetchUnitScript = fetchUnitScript;
54
+ //# sourceMappingURL=UnitSdk.api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["isLoadingScript","globalUnitScript","fetchUnitScript","env","UnitSDK","getEnv","unitScriptRes","fetch","UNIT_SCRIPT_URL","unitScript","text","EventBus","Instance","event","NativeMessage","IS_SCRIPT_FETCHED","e","console","log"],"sources":["UnitSdk.api.ts"],"sourcesContent":["import EventBus from '../helpers/EventBus';\nimport { NativeMessage } from '../messages/nativeMessages';\nimport { UnitSDK, UNIT_SCRIPT_URL } from './UnitSdkManager';\n\nlet isLoadingScript = false;\n\n/** globalUnitScript is exported ONLY to our project components **/\nexport let globalUnitScript = '';\n\nexport const fetchUnitScript = async () => {\n const env = UnitSDK.getEnv();\n if (isLoadingScript || globalUnitScript || !env) {\n // init function is called and success OR in progress\n return null;\n }\n isLoadingScript = true;\n try {\n const unitScriptRes = await fetch(UNIT_SCRIPT_URL[env]);\n const unitScript = await unitScriptRes.text();\n if (unitScript) {\n EventBus.Instance.event(NativeMessage.IS_SCRIPT_FETCHED, { unitScript });\n globalUnitScript = unitScript;\n }\n return null;\n } catch (e) {\n console.log(e);\n return null;\n } finally {\n isLoadingScript = false;\n }\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;AAEA,IAAIA,eAAe,GAAG,KAAtB;AAEA;;AACO,IAAIC,gBAAgB,GAAG,EAAvB;;;AAEA,MAAMC,eAAe,GAAG,YAAY;EACzC,MAAMC,GAAG,GAAGC,uBAAA,CAAQC,MAAR,EAAZ;;EACA,IAAIL,eAAe,IAAIC,gBAAnB,IAAuC,CAACE,GAA5C,EAAiD;IAC/C;IACA,OAAO,IAAP;EACD;;EACDH,eAAe,GAAG,IAAlB;;EACA,IAAI;IACF,MAAMM,aAAa,GAAG,MAAMC,KAAK,CAACC,+BAAA,CAAgBL,GAAhB,CAAD,CAAjC;IACA,MAAMM,UAAU,GAAG,MAAMH,aAAa,CAACI,IAAd,EAAzB;;IACA,IAAID,UAAJ,EAAgB;MACdE,iBAAA,CAASC,QAAT,CAAkBC,KAAlB,CAAwBC,6BAAA,CAAcC,iBAAtC,EAAyD;QAAEN;MAAF,CAAzD;;MACA,2BAAAR,gBAAgB,GAAGQ,UAAnB;IACD;;IACD,OAAO,IAAP;EACD,CARD,CAQE,OAAOO,CAAP,EAAU;IACVC,OAAO,CAACC,GAAR,CAAYF,CAAZ;IACA,OAAO,IAAP;EACD,CAXD,SAWU;IACRhB,eAAe,GAAG,KAAlB;EACD;AACF,CArBM"}