chat 1.0.8 → 4.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 (327) hide show
  1. package/dist/chunk-ACQNDPTB.js +356 -0
  2. package/dist/chunk-ACQNDPTB.js.map +1 -0
  3. package/dist/index.d.ts +1312 -0
  4. package/dist/index.js +1433 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/jsx-runtime-D7zHSnXe.d.ts +349 -0
  7. package/dist/jsx-runtime.d.ts +1 -0
  8. package/dist/jsx-runtime.js +17 -0
  9. package/dist/jsx-runtime.js.map +1 -0
  10. package/package.json +61 -97
  11. package/lib/module/ChatContext/index.js +0 -2
  12. package/lib/module/ChatContext/index.js.map +0 -1
  13. package/lib/module/ChatContext/types.js +0 -2
  14. package/lib/module/ChatContext/types.js.map +0 -1
  15. package/lib/module/classes/Chat/index.js +0 -2
  16. package/lib/module/classes/Chat/index.js.map +0 -1
  17. package/lib/module/classes/Chat/types.js +0 -2
  18. package/lib/module/classes/Chat/types.js.map +0 -1
  19. package/lib/module/classes/Inbox/index.js +0 -2
  20. package/lib/module/classes/Inbox/index.js.map +0 -1
  21. package/lib/module/classes/Inbox/types.js +0 -2
  22. package/lib/module/classes/Inbox/types.js.map +0 -1
  23. package/lib/module/classes/Message/index.js +0 -2
  24. package/lib/module/classes/Message/index.js.map +0 -1
  25. package/lib/module/classes/Message/types.js +0 -2
  26. package/lib/module/classes/Message/types.js.map +0 -1
  27. package/lib/module/classes/Reaction/index.js +0 -2
  28. package/lib/module/classes/Reaction/index.js.map +0 -1
  29. package/lib/module/classes/Reaction/types.js +0 -2
  30. package/lib/module/classes/Reaction/types.js.map +0 -1
  31. package/lib/module/classes/Room/index.js +0 -2
  32. package/lib/module/classes/Room/index.js.map +0 -1
  33. package/lib/module/classes/Room/types.js +0 -2
  34. package/lib/module/classes/Room/types.js.map +0 -1
  35. package/lib/module/classes/index.js +0 -2
  36. package/lib/module/classes/index.js.map +0 -1
  37. package/lib/module/components/Avatar/index.js +0 -2
  38. package/lib/module/components/Avatar/index.js.map +0 -1
  39. package/lib/module/components/Chat/Bubble/index.js +0 -2
  40. package/lib/module/components/Chat/Bubble/index.js.map +0 -1
  41. package/lib/module/components/Chat/Composer/Input/index.js +0 -2
  42. package/lib/module/components/Chat/Composer/Input/index.js.map +0 -1
  43. package/lib/module/components/Chat/Composer/Send/index.js +0 -2
  44. package/lib/module/components/Chat/Composer/Send/index.js.map +0 -1
  45. package/lib/module/components/Chat/Composer/index.js +0 -2
  46. package/lib/module/components/Chat/Composer/index.js.map +0 -1
  47. package/lib/module/components/Chat/Media/Image/index.js +0 -2
  48. package/lib/module/components/Chat/Media/Image/index.js.map +0 -1
  49. package/lib/module/components/Chat/Media/index.js +0 -2
  50. package/lib/module/components/Chat/Media/index.js.map +0 -1
  51. package/lib/module/components/Chat/Message/Swiper/Action/index.js +0 -2
  52. package/lib/module/components/Chat/Message/Swiper/Action/index.js.map +0 -1
  53. package/lib/module/components/Chat/Message/Swiper/index.js +0 -2
  54. package/lib/module/components/Chat/Message/Swiper/index.js.map +0 -1
  55. package/lib/module/components/Chat/Message/Touchable/index.js +0 -2
  56. package/lib/module/components/Chat/Message/Touchable/index.js.map +0 -1
  57. package/lib/module/components/Chat/Message/index.js +0 -2
  58. package/lib/module/components/Chat/Message/index.js.map +0 -1
  59. package/lib/module/components/Chat/SystemMessage/index.js +0 -2
  60. package/lib/module/components/Chat/SystemMessage/index.js.map +0 -1
  61. package/lib/module/components/Chat/TypingFooter/index.js +0 -2
  62. package/lib/module/components/Chat/TypingFooter/index.js.map +0 -1
  63. package/lib/module/components/Chat/index.js +0 -2
  64. package/lib/module/components/Chat/index.js.map +0 -1
  65. package/lib/module/components/Chat/types.js +0 -2
  66. package/lib/module/components/Chat/types.js.map +0 -1
  67. package/lib/module/components/Chat-Old/Bubble/index.js +0 -2
  68. package/lib/module/components/Chat-Old/Bubble/index.js.map +0 -1
  69. package/lib/module/components/Chat-Old/Composer/Input/index.js +0 -2
  70. package/lib/module/components/Chat-Old/Composer/Input/index.js.map +0 -1
  71. package/lib/module/components/Chat-Old/Composer/Send/index.js +0 -2
  72. package/lib/module/components/Chat-Old/Composer/Send/index.js.map +0 -1
  73. package/lib/module/components/Chat-Old/Composer/index.js +0 -2
  74. package/lib/module/components/Chat-Old/Composer/index.js.map +0 -1
  75. package/lib/module/components/Chat-Old/Message/index.js +0 -2
  76. package/lib/module/components/Chat-Old/Message/index.js.map +0 -1
  77. package/lib/module/components/Chat-Old/Swiper/Action/index.js +0 -2
  78. package/lib/module/components/Chat-Old/Swiper/Action/index.js.map +0 -1
  79. package/lib/module/components/Chat-Old/Swiper/index.js +0 -2
  80. package/lib/module/components/Chat-Old/Swiper/index.js.map +0 -1
  81. package/lib/module/components/Chat-Old/SystemMessage/index.js +0 -2
  82. package/lib/module/components/Chat-Old/SystemMessage/index.js.map +0 -1
  83. package/lib/module/components/Chat-Old/index.js +0 -2
  84. package/lib/module/components/Chat-Old/index.js.map +0 -1
  85. package/lib/module/components/Chat-Old/types.js +0 -2
  86. package/lib/module/components/Chat-Old/types.js.map +0 -1
  87. package/lib/module/components/ChatProvider/index.js +0 -2
  88. package/lib/module/components/ChatProvider/index.js.map +0 -1
  89. package/lib/module/components/ChatProvider/types.js +0 -2
  90. package/lib/module/components/ChatProvider/types.js.map +0 -1
  91. package/lib/module/components/Inbox/Item/Circle/index.js +0 -2
  92. package/lib/module/components/Inbox/Item/Circle/index.js.map +0 -1
  93. package/lib/module/components/Inbox/Item/Circle/types.js +0 -2
  94. package/lib/module/components/Inbox/Item/Circle/types.js.map +0 -1
  95. package/lib/module/components/Inbox/Item/Initials/index.js +0 -2
  96. package/lib/module/components/Inbox/Item/Initials/index.js.map +0 -1
  97. package/lib/module/components/Inbox/Item/ItemDate/index.js +0 -2
  98. package/lib/module/components/Inbox/Item/ItemDate/index.js.map +0 -1
  99. package/lib/module/components/Inbox/Item/Separator/index.js +0 -2
  100. package/lib/module/components/Inbox/Item/Separator/index.js.map +0 -1
  101. package/lib/module/components/Inbox/Item/Subtitle/index.js +0 -2
  102. package/lib/module/components/Inbox/Item/Subtitle/index.js.map +0 -1
  103. package/lib/module/components/Inbox/Item/Swipeable/index.js +0 -2
  104. package/lib/module/components/Inbox/Item/Swipeable/index.js.map +0 -1
  105. package/lib/module/components/Inbox/Item/Title/index.js +0 -2
  106. package/lib/module/components/Inbox/Item/Title/index.js.map +0 -1
  107. package/lib/module/components/Inbox/Item/UnreadIndicator/index.js +0 -2
  108. package/lib/module/components/Inbox/Item/UnreadIndicator/index.js.map +0 -1
  109. package/lib/module/components/Inbox/Item/index.js +0 -2
  110. package/lib/module/components/Inbox/Item/index.js.map +0 -1
  111. package/lib/module/components/Inbox/index.js +0 -2
  112. package/lib/module/components/Inbox/index.js.map +0 -1
  113. package/lib/module/components/Inbox/question.md +0 -21
  114. package/lib/module/components/Inbox/readme.md +0 -21
  115. package/lib/module/components/Inbox/types.js +0 -2
  116. package/lib/module/components/Inbox/types.js.map +0 -1
  117. package/lib/module/components/RoomCreator/Content/Footer/Button/index.js +0 -2
  118. package/lib/module/components/RoomCreator/Content/Footer/Button/index.js.map +0 -1
  119. package/lib/module/components/RoomCreator/Content/Footer/Input/index.js +0 -2
  120. package/lib/module/components/RoomCreator/Content/Footer/Input/index.js.map +0 -1
  121. package/lib/module/components/RoomCreator/Content/Footer/index.js +0 -2
  122. package/lib/module/components/RoomCreator/Content/Footer/index.js.map +0 -1
  123. package/lib/module/components/RoomCreator/Content/Item/Icon/index.js +0 -2
  124. package/lib/module/components/RoomCreator/Content/Item/Icon/index.js.map +0 -1
  125. package/lib/module/components/RoomCreator/Content/Item/index.js +0 -2
  126. package/lib/module/components/RoomCreator/Content/Item/index.js.map +0 -1
  127. package/lib/module/components/RoomCreator/Content/index.js +0 -2
  128. package/lib/module/components/RoomCreator/Content/index.js.map +0 -1
  129. package/lib/module/components/RoomCreator/Header/index.js +0 -2
  130. package/lib/module/components/RoomCreator/Header/index.js.map +0 -1
  131. package/lib/module/components/RoomCreator/index.js +0 -2
  132. package/lib/module/components/RoomCreator/index.js.map +0 -1
  133. package/lib/module/components/RoomCreator/types.js +0 -2
  134. package/lib/module/components/RoomCreator/types.js.map +0 -1
  135. package/lib/module/components/TypingIndicator/index.js +0 -2
  136. package/lib/module/components/TypingIndicator/index.js.map +0 -1
  137. package/lib/module/components/index.js +0 -2
  138. package/lib/module/components/index.js.map +0 -1
  139. package/lib/module/helpers/getInitials.js +0 -2
  140. package/lib/module/helpers/getInitials.js.map +0 -1
  141. package/lib/module/helpers/sortByAvatar.js +0 -2
  142. package/lib/module/helpers/sortByAvatar.js.map +0 -1
  143. package/lib/module/hooks/index.js +0 -2
  144. package/lib/module/hooks/index.js.map +0 -1
  145. package/lib/module/hooks/useCreateRoom/index.js +0 -2
  146. package/lib/module/hooks/useCreateRoom/index.js.map +0 -1
  147. package/lib/module/hooks/useCreator/index.js +0 -2
  148. package/lib/module/hooks/useCreator/index.js.map +0 -1
  149. package/lib/module/hooks/useInbox/index.js +0 -2
  150. package/lib/module/hooks/useInbox/index.js.map +0 -1
  151. package/lib/module/hooks/useInbox/types.js +0 -2
  152. package/lib/module/hooks/useInbox/types.js.map +0 -1
  153. package/lib/module/hooks/useMessages/index.js +0 -2
  154. package/lib/module/hooks/useMessages/index.js.map +0 -1
  155. package/lib/module/hooks/useMessages/types.js +0 -2
  156. package/lib/module/hooks/useMessages/types.js.map +0 -1
  157. package/lib/module/hooks/useRoom/index.js +0 -2
  158. package/lib/module/hooks/useRoom/index.js.map +0 -1
  159. package/lib/module/hooks/useRoom/types.js +0 -2
  160. package/lib/module/hooks/useRoom/types.js.map +0 -1
  161. package/lib/module/hooks/useSend/useSendToGroup/index.js +0 -2
  162. package/lib/module/hooks/useSend/useSendToGroup/index.js.map +0 -1
  163. package/lib/module/hooks/useSend/useSendToPeople/index.js +0 -2
  164. package/lib/module/hooks/useSend/useSendToPeople/index.js.map +0 -1
  165. package/lib/module/hooks/useTyping/index.js +0 -2
  166. package/lib/module/hooks/useTyping/index.js.map +0 -1
  167. package/lib/module/hooks/useTypingOLD/index.js +0 -2
  168. package/lib/module/hooks/useTypingOLD/index.js.map +0 -1
  169. package/lib/module/hooks/useTypingOLD/types.js +0 -2
  170. package/lib/module/hooks/useTypingOLD/types.js.map +0 -1
  171. package/lib/module/hooks/useViewMessages/index.js +0 -2
  172. package/lib/module/hooks/useViewMessages/index.js.map +0 -1
  173. package/lib/module/hooks/useViewMessages/types.js +0 -2
  174. package/lib/module/hooks/useViewMessages/types.js.map +0 -1
  175. package/lib/module/hooks/useViewMessagesOld/index.js +0 -2
  176. package/lib/module/hooks/useViewMessagesOld/index.js.map +0 -1
  177. package/lib/module/index.js +0 -2
  178. package/lib/module/index.js.map +0 -1
  179. package/lib/typescript/ChatContext/index.d.ts +0 -2
  180. package/lib/typescript/ChatContext/types.d.ts +0 -4
  181. package/lib/typescript/classes/Chat/index.d.ts +0 -14
  182. package/lib/typescript/classes/Chat/types.d.ts +0 -21
  183. package/lib/typescript/classes/Inbox/types.d.ts +0 -2
  184. package/lib/typescript/classes/Message/index.d.ts +0 -47
  185. package/lib/typescript/classes/Message/types.d.ts +0 -66
  186. package/lib/typescript/classes/Reaction/index.d.ts +0 -17
  187. package/lib/typescript/classes/Reaction/types.d.ts +0 -33
  188. package/lib/typescript/classes/Room/index.d.ts +0 -42
  189. package/lib/typescript/classes/Room/types.d.ts +0 -112
  190. package/lib/typescript/classes/index.d.ts +0 -4
  191. package/lib/typescript/components/Avatar/index.d.ts +0 -4
  192. package/lib/typescript/components/Chat/Bubble/index.d.ts +0 -4
  193. package/lib/typescript/components/Chat/Composer/Input/index.d.ts +0 -7
  194. package/lib/typescript/components/Chat/Composer/Send/index.d.ts +0 -4
  195. package/lib/typescript/components/Chat/Composer/index.d.ts +0 -8
  196. package/lib/typescript/components/Chat/Media/Image/index.d.ts +0 -7
  197. package/lib/typescript/components/Chat/Media/index.d.ts +0 -4
  198. package/lib/typescript/components/Chat/Message/Touchable/index.d.ts +0 -4
  199. package/lib/typescript/components/Chat/Message/index.d.ts +0 -8
  200. package/lib/typescript/components/Chat/SystemMessage/index.d.ts +0 -4
  201. package/lib/typescript/components/Chat/TypingFooter/index.d.ts +0 -4
  202. package/lib/typescript/components/Chat/index.d.ts +0 -8
  203. package/lib/typescript/components/Chat/types.d.ts +0 -843
  204. package/lib/typescript/components/ChatProvider/index.d.ts +0 -10
  205. package/lib/typescript/components/ChatProvider/types.d.ts +0 -7
  206. package/lib/typescript/components/Inbox/Item/Initials/index.d.ts +0 -4
  207. package/lib/typescript/components/Inbox/Item/ItemDate/index.d.ts +0 -4
  208. package/lib/typescript/components/Inbox/Item/Separator/index.d.ts +0 -6
  209. package/lib/typescript/components/Inbox/Item/Subtitle/index.d.ts +0 -3
  210. package/lib/typescript/components/Inbox/Item/Swipeable/index.d.ts +0 -4
  211. package/lib/typescript/components/Inbox/Item/Title/index.d.ts +0 -3
  212. package/lib/typescript/components/Inbox/Item/UnreadIndicator/index.d.ts +0 -4
  213. package/lib/typescript/components/Inbox/Item/index.d.ts +0 -6
  214. package/lib/typescript/components/Inbox/index.d.ts +0 -4
  215. package/lib/typescript/components/Inbox/types.d.ts +0 -304
  216. package/lib/typescript/components/RoomCreator/Content/Footer/Button/index.d.ts +0 -4
  217. package/lib/typescript/components/RoomCreator/Content/Footer/Input/index.d.ts +0 -4
  218. package/lib/typescript/components/RoomCreator/Content/Footer/index.d.ts +0 -3
  219. package/lib/typescript/components/RoomCreator/Content/Item/Icon/index.d.ts +0 -4
  220. package/lib/typescript/components/RoomCreator/Content/Item/index.d.ts +0 -4
  221. package/lib/typescript/components/RoomCreator/Content/index.d.ts +0 -4
  222. package/lib/typescript/components/RoomCreator/Header/index.d.ts +0 -4
  223. package/lib/typescript/components/RoomCreator/index.d.ts +0 -4
  224. package/lib/typescript/components/RoomCreator/types.d.ts +0 -208
  225. package/lib/typescript/components/TypingIndicator/index.d.ts +0 -9
  226. package/lib/typescript/components/index.d.ts +0 -12
  227. package/lib/typescript/helpers/getInitials.d.ts +0 -1
  228. package/lib/typescript/hooks/index.d.ts +0 -8
  229. package/lib/typescript/hooks/useCreator/index.d.ts +0 -27
  230. package/lib/typescript/hooks/useInbox/index.d.ts +0 -29
  231. package/lib/typescript/hooks/useInbox/types.d.ts +0 -5
  232. package/lib/typescript/hooks/useMessages/index.d.ts +0 -24
  233. package/lib/typescript/hooks/useMessages/types.d.ts +0 -5
  234. package/lib/typescript/hooks/useRoom/index.d.ts +0 -26
  235. package/lib/typescript/hooks/useRoom/types.d.ts +0 -5
  236. package/lib/typescript/hooks/useSend/useSendToGroup/index.d.ts +0 -6
  237. package/lib/typescript/hooks/useSend/useSendToPeople/index.d.ts +0 -6
  238. package/lib/typescript/hooks/useTyping/index.d.ts +0 -36
  239. package/lib/typescript/hooks/useViewMessages/index.d.ts +0 -18
  240. package/lib/typescript/hooks/useViewMessages/types.d.ts +0 -20
  241. package/lib/typescript/index.d.ts +0 -11
  242. package/readme.md +0 -201
  243. package/src/ChatContext/index.tsx +0 -9
  244. package/src/ChatContext/types.ts +0 -4
  245. package/src/classes/Chat/index.ts +0 -46
  246. package/src/classes/Chat/types.ts +0 -23
  247. package/src/classes/Inbox/index.ts +0 -12
  248. package/src/classes/Inbox/types.ts +0 -3
  249. package/src/classes/Message/index.ts +0 -310
  250. package/src/classes/Message/types.ts +0 -118
  251. package/src/classes/Reaction/index.ts +0 -108
  252. package/src/classes/Reaction/types.ts +0 -37
  253. package/src/classes/Room/index.ts +0 -323
  254. package/src/classes/Room/types.ts +0 -161
  255. package/src/classes/index.ts +0 -4
  256. package/src/components/Avatar/index.tsx +0 -25
  257. package/src/components/Chat/Bubble/index.tsx +0 -139
  258. package/src/components/Chat/Composer/Input/index.tsx +0 -45
  259. package/src/components/Chat/Composer/Send/index.tsx +0 -51
  260. package/src/components/Chat/Composer/index.tsx +0 -187
  261. package/src/components/Chat/Media/Image/index.tsx +0 -26
  262. package/src/components/Chat/Media/index.tsx +0 -11
  263. package/src/components/Chat/Message/Swiper/Action/index.tsx +0 -7
  264. package/src/components/Chat/Message/Swiper/index.tsx +0 -32
  265. package/src/components/Chat/Message/Touchable/index.tsx +0 -60
  266. package/src/components/Chat/Message/index.tsx +0 -328
  267. package/src/components/Chat/SystemMessage/index.tsx +0 -44
  268. package/src/components/Chat/TypingFooter/index.tsx +0 -48
  269. package/src/components/Chat/index.tsx +0 -596
  270. package/src/components/Chat/types.ts +0 -913
  271. package/src/components/Chat-Old/Bubble/index.tsx +0 -58
  272. package/src/components/Chat-Old/Composer/Input/index.tsx +0 -34
  273. package/src/components/Chat-Old/Composer/Send/index.tsx +0 -37
  274. package/src/components/Chat-Old/Composer/index.tsx +0 -131
  275. package/src/components/Chat-Old/Message/index.tsx +0 -160
  276. package/src/components/Chat-Old/Swiper/Action/index.tsx +0 -7
  277. package/src/components/Chat-Old/Swiper/index.tsx +0 -30
  278. package/src/components/Chat-Old/SystemMessage/index.tsx +0 -44
  279. package/src/components/Chat-Old/index.tsx +0 -356
  280. package/src/components/Chat-Old/types.ts +0 -752
  281. package/src/components/ChatProvider/index.tsx +0 -31
  282. package/src/components/ChatProvider/types.ts +0 -8
  283. package/src/components/Inbox/Item/Circle/index.tsx +0 -47
  284. package/src/components/Inbox/Item/Circle/types.ts +0 -8
  285. package/src/components/Inbox/Item/Initials/index.tsx +0 -41
  286. package/src/components/Inbox/Item/ItemDate/index.tsx +0 -26
  287. package/src/components/Inbox/Item/Separator/index.tsx +0 -13
  288. package/src/components/Inbox/Item/Subtitle/index.tsx +0 -23
  289. package/src/components/Inbox/Item/Swipeable/index.tsx +0 -143
  290. package/src/components/Inbox/Item/Title/index.tsx +0 -23
  291. package/src/components/Inbox/Item/UnreadIndicator/index.tsx +0 -84
  292. package/src/components/Inbox/Item/index.tsx +0 -307
  293. package/src/components/Inbox/index.tsx +0 -315
  294. package/src/components/Inbox/question.md +0 -21
  295. package/src/components/Inbox/readme.md +0 -21
  296. package/src/components/Inbox/types.ts +0 -371
  297. package/src/components/RoomCreator/Content/Footer/Button/index.tsx +0 -55
  298. package/src/components/RoomCreator/Content/Footer/Input/index.tsx +0 -27
  299. package/src/components/RoomCreator/Content/Footer/index.tsx +0 -72
  300. package/src/components/RoomCreator/Content/Item/Icon/index.tsx +0 -16
  301. package/src/components/RoomCreator/Content/Item/index.tsx +0 -87
  302. package/src/components/RoomCreator/Content/index.tsx +0 -75
  303. package/src/components/RoomCreator/Header/index.tsx +0 -74
  304. package/src/components/RoomCreator/index.tsx +0 -177
  305. package/src/components/RoomCreator/types.ts +0 -233
  306. package/src/components/TypingIndicator/index.tsx +0 -169
  307. package/src/components/index.ts +0 -18
  308. package/src/helpers/getInitials.ts +0 -11
  309. package/src/helpers/sortByAvatar.ts +0 -1
  310. package/src/hooks/index.ts +0 -8
  311. package/src/hooks/useCreateRoom/index.ts +0 -34
  312. package/src/hooks/useCreator/index.ts +0 -33
  313. package/src/hooks/useInbox/index.ts +0 -76
  314. package/src/hooks/useInbox/types.ts +0 -6
  315. package/src/hooks/useMessages/index.ts +0 -109
  316. package/src/hooks/useMessages/types.ts +0 -6
  317. package/src/hooks/useRoom/index.ts +0 -82
  318. package/src/hooks/useRoom/types.ts +0 -6
  319. package/src/hooks/useSend/useSendToGroup/index.ts +0 -38
  320. package/src/hooks/useSend/useSendToPeople/index.ts +0 -38
  321. package/src/hooks/useTyping/index.ts +0 -154
  322. package/src/hooks/useTypingOLD/index.ts +0 -67
  323. package/src/hooks/useTypingOLD/types.ts +0 -7
  324. package/src/hooks/useViewMessages/index.ts +0 -61
  325. package/src/hooks/useViewMessages/types.ts +0 -22
  326. package/src/hooks/useViewMessagesOld/index.ts +0 -39
  327. package/src/index.ts +0 -13
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","useMemo","useRef","useEffect","useCallback","SafeAreaView","View","StyleSheet","Animated","KeyboardAvoidingView","Alert","Clipboard","Transitioning","Transition","Message","Composer","SystemMessage","TypingFooter","Chat","props","checkForBrokenProps","user","name","console","error","id","ref","chatRef","inputRef","flatListRef","componentRef","current","focusInput","focus","blurInput","blur","scrollToEnd","getNode","scrollToIndex","params","scrollToItem","scrollToOffset","transitionRef","mounted","scrollY","animatedScrollNode","Value","onScroll","event","nativeEvent","contentOffset","y","useNativeDriver","messagesRef","messages","latestMessageIsNew","iSentLastMessage","disableScrollToBottomOnSend","offset","scrollToBottomOnAllNewMessages","onViewableItemsChangedRef","onViewableItemsChanged","onViewMessagesRef","onViewMessages","messagesDict","forEach","message","info","visibleMessages","viewableItems","filter","i","isViewable","map","item","latestMessageId","numberOfUsersTyping","namesOfUsersTyping","length","disableTransitions","disableTransitionOnMount","animateNextTransition","onPressMessage","onDoubleTapMessage","onLongPressMessage","onPressItem","onDoubleTapItem","onLongPressItem","text","alert","onPress","setString","style","renderItem","renderMessage","index","system","systemProps","createdAt","textStyle","systemMessageTextStyle","containerStyle","systemMessageContainerStyle","dateToStringFunc","systemMessageDateToStringFunc","dateStyle","systemMessageDateStyle","renderSystemMessage","isMe","messageCreatesNewBunch","isMostRecentMessageInBunch","showName","showNameForEveryMessage","showMyName","showAvatar","showAvatarForEveryMessage","renderAvatar","hideMyAvatar","bubbleStyle","messageContainerStyle","bubbleTextStyle","messageWrapperStyle","bubbleBackgroundColor","bubbleTextColor","initialsBackgroundColor","initialsTextColor","messageProps","delivered","renderFooter","renderMessageFooter","imageProps","read","renderMedia","renderMessageMedia","onLongPress","onDoubleTap","doubleTapDelay","messageDoubleTapDelay","disableSwipeActions","swipeActions","longPressDelay","messageLongPressDelay","avatar","avatarImageProps","avatarSize","renderInitials","nameStyle","tintColor","swipeActionWidth","renderSwipeAction","userId","userName","AvatarImageComponent","mediaHeight","media","height","mediaWidth","width","mediaUri","uri","mediaContentType","contentType","mediaUrl","url","createsNewBunch","renderText","renderMessageText","keyExtractor","typingText","join","renderTypingIndicator","typingIndicatorProps","ListFooterComponent","showTypingText","flatListProps","keyboardDismissMode","keyboardShouldPersistTaps","extraData","contentContainerStyle","renderList","styles","contentContainer","renderHeader","renderComposer","composerProps","onInputTextChanged","initialText","placeholderColor","placeholderText","renderSendButton","renderTextInput","textInputProps","onChangeMedia","onSend","sendButtonMode","composerContainerStyle","inputContainerStyle","inputStyle","sendButtonContainerStyle","sendOnKeyboardReturn","Container","ContainerComponent","safeArea","KeyboardView","avoidKeyboard","transition","transitionConfig","container","append","state","create","flex","flexGrow","marginTop"],"mappings":"+jCAAA,MAAOA,CAAAA,KAAP,EACCC,OADD,CAECC,MAFD,CAGCC,SAHD,CAICC,WAJD,KAMO,OANP,CAOA,OAGCC,YAHD,CAICC,IAJD,CAKCC,UALD,CAMCC,QAND,CASCC,oBATD,CAUCC,KAVD,CAWCC,SAXD,KAYO,cAZP,CAaA,OACCC,aADD,CAECC,UAFD,KAIO,yBAJP,CAMA,MAAOC,CAAAA,OAAP,KAAoB,WAApB,CAQA,MAAOC,CAAAA,QAAP,KAAqB,YAArB,CACA,MAAOC,CAAAA,aAAP,KAA0B,iBAA1B,CACA,MAAOC,CAAAA,YAAP,KAAyB,gBAAzB,CAEA,QAASC,CAAAA,IAAT,CACCC,KADD,CAEE,CACD,GAAMC,CAAAA,mBAAmB,CAAG,QAAtBA,CAAAA,mBAAsB,EAAM,CACjC,GAAI,CAACD,KAAK,CAACE,IAAN,CAAWC,IAAhB,CAAsB,CACrBC,OAAO,CAACC,KAAR,CACC,wEADD,EAGA,CACD,GAAI,CAACL,KAAK,CAACE,IAAN,CAAWI,EAAhB,CAAoB,CACnBF,OAAO,CAACC,KAAR,CACC,uEADD,EAGA,CACD,CAXD,CAYAJ,mBAAmB,GAblB,GAegBM,CAAAA,GAfhB,CAewBP,KAfxB,CAeOQ,OAfP,CAgBD,GAAMC,CAAAA,QAAQ,CAAG1B,MAAM,EAAvB,CACA,GAAM2B,CAAAA,WAAW,CAAG3B,MAAM,EAA1B,CAEA,GAAM4B,CAAAA,YAAY,CAAG5B,MAAM,EAA3B,CAEAC,SAAS,CAAC,UAAM,CACf2B,YA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U,CAAC2M,MAAX,CAAkB,CAChCH,SAAS,CAAE,CACVI,IAAI,CAAE,CADI,CADqB,CAIhC9B,gBAAgB,CAAE,CACjB+B,QAAQ,CAAE,CADO,CAEjBC,SAAS,CAAE,CAFM,CAJc,CAAlB,CAAf","sourcesContent":["import React, {\n\tuseMemo,\n\tuseRef,\n\tuseEffect,\n\tuseCallback,\n\tMutableRefObject,\n} from 'react'\nimport {\n\tFlatList,\n\tListRenderItemInfo,\n\tSafeAreaView,\n\tView,\n\tStyleSheet,\n\tAnimated,\n\tViewToken,\n\tTextInput,\n\tKeyboardAvoidingView,\n\tAlert,\n\tClipboard,\n} from 'react-native'\nimport {\n\tTransitioning,\n\tTransition,\n\tTransitioningView,\n} from 'react-native-reanimated'\nimport { NewMessageModel } from '../../classes/Message/types'\nimport Message from './Message'\nimport {\n\tChatProps,\n\tMessageProps,\n\tComposerProps,\n\tSystemMessageProps,\n\tChatRef,\n} from './types'\nimport Composer from './Composer'\nimport SystemMessage from './SystemMessage'\nimport TypingFooter from './TypingFooter'\n\nfunction Chat<MessageModel extends NewMessageModel = NewMessageModel>(\n\tprops: ChatProps<MessageModel>\n) {\n\tconst checkForBrokenProps = () => {\n\t\tif (!props.user.name) {\n\t\t\tconsole.error(\n\t\t\t\t'Breaking error: Messages component is missing a name in the user prop.'\n\t\t\t)\n\t\t}\n\t\tif (!props.user.id) {\n\t\t\tconsole.error(\n\t\t\t\t'Breaking error: Messages component is missing an id in the user prop.'\n\t\t\t)\n\t\t}\n\t}\n\tcheckForBrokenProps()\n\t// \"constructor\" variables\n\tconst { chatRef: ref } = props\n\tconst inputRef = useRef<TextInput>()\n\tconst flatListRef = useRef<typeof Animated.ScrollView>()\n\t// const flatListRef = useRef<typeof Animated.FlatList<MessageModel>>()\n\tconst componentRef = useRef<ChatRef<MessageModel>>()\n\n\tuseEffect(() => {\n\t\tcomponentRef.current = {\n\t\t\tfocusInput: () => inputRef.current?.focus(),\n\t\t\tblurInput: () => inputRef.current?.blur(),\n\t\t\tscrollToEnd: () => flatListRef.current?.getNode().scrollToEnd(),\n\t\t\tscrollToIndex: params =>\n\t\t\t\tflatListRef.current?.getNode().scrollToIndex(params),\n\t\t\tscrollToItem: params =>\n\t\t\t\tflatListRef.current?.getNode().scrollToItem(params),\n\t\t\tscrollToOffset: params =>\n\t\t\t\tflatListRef.current?.getNode().scrollToOffset(params),\n\t\t}\n\t\tif (ref) ref.current = componentRef.current\n\t})\n\n\t// if (!componentRef.current) {\n\t// \tcomponentRef.current = {\n\t// \t\tfocusInput: () => inputRef.current && inputRef.current.focus(),\n\t// \t\tblurInput: () => inputRef.current && inputRef.current.blur(),\n\t// \t\tscrollToEnd: () =>\n\t// \t\t\tflatListRef.current && flatListRef.current.getNode().scrollToEnd(),\n\t// \t\tscrollToIndex: params =>\n\t// \t\t\tflatListRef.current &&\n\t// \t\t\tflatListRef.current.getNode().scrollToIndex(params),\n\t// \t\tscrollToItem: params =>\n\t// \t\t\tflatListRef.current &&\n\t// \t\t\tflatListRef.current.getNode().scrollToItem(params),\n\t// \t\tscrollToOffset: params =>\n\t// \t\t\tflatListRef.current &&\n\t// \t\t\tflatListRef.current.getNode().scrollToOffset(params),\n\t// \t}\n\t// \tif (ref) ref.current = componentRef.current\n\t// }\n\n\t// used to shuffle/transition the inbox when it changes\n\tconst transitionRef = useRef<TransitioningView>(null)\n\tconst mounted = useRef(false)\n\n\t// track animated position of scroll\n\tconst scrollY: Animated.Value = useMemo(\n\t\t() => props.animatedScrollNode || new Animated.Value(0),\n\t\t[props.animatedScrollNode]\n\t)\n\n\t// upate position of scroll variable\n\tconst onScroll = Animated.event(\n\t\t[{ nativeEvent: { contentOffset: { y: scrollY } } }],\n\t\t{ useNativeDriver: true }\n\t)\n\n\tconst messagesRef = useRef(props.messages)\n\n\t// effect to handle new messages coming in / scrolling to bottom\n\t// TODO we may have to use getNode() for the animated flatlist, right?\n\tuseEffect(() => {\n\t\tconst latestMessageIsNew =\n\t\t\t(props.messages[0] && props.messages[0].id) !==\n\t\t\t(messagesRef.current[0] && messagesRef.current[0].id)\n\t\t// const numberOfMessagesIncreased =\n\t\t// \tprops.messages.length > messagesRef.current.length\n\t\tif (\n\t\t\tlatestMessageIsNew &&\n\t\t\t// numberOfMessagesIncreased &&\n\t\t\tflatListRef.current\n\t\t) {\n\t\t\tconst iSentLastMessage =\n\t\t\t\tprops.messages[0] &&\n\t\t\t\tprops.messages[0].user &&\n\t\t\t\tprops.messages[0].user.id === props.user.id\n\t\t\tif (iSentLastMessage && !props.disableScrollToBottomOnSend)\n\t\t\t\tflatListRef.current.getNode().scrollToOffset({ offset: 0 })\n\t\t\telse if (props.scrollToBottomOnAllNewMessages)\n\t\t\t\tflatListRef.current.getNode().scrollToOffset({ offset: 0 })\n\t\t}\n\t}, [\n\t\tprops.disableScrollToBottomOnSend,\n\t\tprops.scrollToBottomOnAllNewMessages,\n\t\tprops.messages,\n\t\tprops.user.id,\n\t])\n\n\t// 💩 a super way of handling viewable items not on the fly. (easy way to track viewed messages)\n\t// TODO abstract this to a different custom hook.\n\tconst onViewableItemsChangedRef = useRef(props.onViewableItemsChanged)\n\tconst onViewMessagesRef = useRef(props.onViewMessages)\n\t// track the messages in a non-array too for fast querying.\n\tconst messagesDict = useRef<{ [id: string]: MessageModel }>({})\n\t// ...onto the effect 😅\n\tuseEffect(() => {\n\t\t// make updated methods available to onviewable items changed\n\t\tonViewableItemsChangedRef.current = props.onViewableItemsChanged\n\t\tonViewMessagesRef.current = props.onViewMessages\n\t\tmessagesRef.current = props.messages\n\t\tmessagesDict.current = {}\n\t\tif (props.messages) {\n\t\t\tprops.messages.forEach(message => {\n\t\t\t\tmessagesDict.current[message.id] = message\n\t\t\t})\n\t\t}\n\t}, [props.onViewableItemsChanged, props.onViewMessages, props.messages])\n\n\tconst onViewableItemsChanged: FlatList<\n\t\tMessageModel\n\t>['props']['onViewableItemsChanged'] = useCallback(\n\t\t(info: { viewableItems: ViewToken[]; changed: ViewToken[] }) => {\n\t\t\tif (onViewableItemsChangedRef.current)\n\t\t\t\tonViewableItemsChangedRef.current(info)\n\n\t\t\tif (onViewMessagesRef.current) {\n\t\t\t\tconst visibleMessages = info.viewableItems\n\t\t\t\t\t.filter(i => i.isViewable)\n\t\t\t\t\t.map(i => i.item)\n\t\t\t\tconst latestMessageId =\n\t\t\t\t\tmessagesRef.current &&\n\t\t\t\t\tmessagesRef.current[0] &&\n\t\t\t\t\tmessagesRef.current[0].id\n\t\t\t\tonViewMessagesRef.current({\n\t\t\t\t\tvisibleMessages,\n\t\t\t\t\tlatestMessageId,\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\t\t[]\n\t)\n\t// END OF THAT 💩\n\n\tconst numberOfUsersTyping = useMemo(\n\t\t() => props.namesOfUsersTyping?.length ?? 0,\n\t\t[props.namesOfUsersTyping]\n\t)\n\t// effect to handle animating the screen if the messages changed or people typing just changed\n\tuseEffect(() => {\n\t\tif (\n\t\t\t!props.disableTransitions &&\n\t\t\t// if we've already mounted, or we want to transition even if we haven't...\n\t\t\t(mounted.current || !props.disableTransitionOnMount) &&\n\t\t\t// and assuming the transition component is initialized...\n\t\t\ttransitionRef.current\n\t\t)\n\t\t\t// animate\n\t\t\ttransitionRef.current.animateNextTransition()\n\t\telse mounted.current = true\n\t}, [\n\t\tprops.disableTransitionOnMount,\n\t\tnumberOfUsersTyping,\n\t\tprops.messages,\n\t\tprops.disableTransitions,\n\t])\n\n\tconst { onPressMessage, onDoubleTapMessage, onLongPressMessage } = props\n\tconst onPressItem = useCallback(\n\t\tid => {\n\t\t\tconst message = messagesDict.current?.[id]\n\t\t\tif (onPressMessage) onPressMessage(message)\n\t\t},\n\t\t[onPressMessage]\n\t)\n\n\tconst onDoubleTapItem = useCallback(\n\t\tid => {\n\t\t\tconst message = messagesDict.current?.[id]\n\t\t\tif (onDoubleTapMessage) onDoubleTapMessage(message)\n\t\t},\n\t\t[onDoubleTapMessage]\n\t)\n\n\tconst onLongPressItem = useCallback(\n\t\tid => {\n\t\t\tconst message = messagesDict.current?.[id]\n\t\t\tif (onLongPressMessage) return onLongPressMessage(message)\n\t\t\tif (message && message.text) {\n\t\t\t\tAlert.alert('Message', message.text, [\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'Copy text',\n\t\t\t\t\t\tonPress: () => {\n\t\t\t\t\t\t\tClipboard.setString(message.text)\n\t\t\t\t\t\t},\n\t\t\t\t\t\tstyle: 'cancel',\n\t\t\t\t\t},\n\t\t\t\t\t{ text: 'Go back' },\n\t\t\t\t])\n\t\t\t}\n\t\t},\n\t\t[onLongPressMessage]\n\t)\n\n\tconst renderItem = (info: ListRenderItemInfo<MessageModel>) => {\n\t\tif (props.renderItem) return props.renderItem(info)\n\t\tif (props.renderMessage === null) return null\n\n\t\tconst { item: message, index } = info\n\n\t\tif (message.system) {\n\t\t\tconst systemProps: SystemMessageProps = {\n\t\t\t\ttext: message.text,\n\t\t\t\tcreatedAt: message.createdAt,\n\t\t\t\ttextStyle: props.systemMessageTextStyle,\n\t\t\t\tcontainerStyle: props.systemMessageContainerStyle,\n\t\t\t\tdateToStringFunc: props.systemMessageDateToStringFunc,\n\t\t\t\tdateStyle: props.systemMessageDateStyle,\n\t\t\t}\n\n\t\t\tif (props.renderSystemMessage === null) return null\n\t\t\tif (props.renderSystemMessage)\n\t\t\t\treturn props.renderSystemMessage(systemProps)\n\n\t\t\treturn <SystemMessage {...systemProps} />\n\t\t}\n\n\t\tconst isMe = message.user.id === props.user.id\n\n\t\t// indicates that the previous message was sent by someone else, so this starts a new bunch\n\t\tconst messageCreatesNewBunch = !(\n\t\t\tprops.messages[index + 1] &&\n\t\t\tprops.messages[index + 1].user &&\n\t\t\tprops.messages[index + 1].user.id ===\n\t\t\t\t(props.messages[index] &&\n\t\t\t\t\tprops.messages[index].user &&\n\t\t\t\t\tprops.messages[index].user.id)\n\t\t)\n\n\t\tconst isMostRecentMessageInBunch = !(\n\t\t\tprops.messages[index - 1] &&\n\t\t\tprops.messages[index - 1].user &&\n\t\t\tprops.messages[index - 1].user.id ===\n\t\t\t\t(props.messages[index] &&\n\t\t\t\t\tprops.messages[index].user &&\n\t\t\t\t\tprops.messages[index].user.id)\n\t\t)\n\n\t\t// show name if the previous message was sent by someone else\n\t\t// also, only show my own name if specified, since that's kinda weird to show my own. beat my dribble\n\t\tlet showName = props.showNameForEveryMessage || messageCreatesNewBunch\n\t\tif (isMe && !props.showMyName) showName = false\n\n\t\t// by default, only show avatar for a the bottom of a bunch\n\t\tconst showAvatar =\n\t\t\tprops.showAvatarForEveryMessage || isMostRecentMessageInBunch\n\t\tlet renderAvatar = props.renderAvatar\n\t\t// and we hide the avatar if we say to\n\t\tif (isMe && props.hideMyAvatar) {\n\t\t\t// showAvatar = false\n\t\t\trenderAvatar = null\n\t\t}\n\n\t\tconst bubbleStyle = props.bubbleStyle?.({ isMe })\n\t\tconst messageContainerStyle = props.messageContainerStyle?.({ isMe })\n\t\tconst bubbleTextStyle = props.bubbleTextStyle?.({ isMe })\n\t\tconst messageWrapperStyle = props.messageWrapperStyle?.({ isMe })\n\t\tconst bubbleBackgroundColor = props.bubbleBackgroundColor?.({ isMe })\n\t\tconst bubbleTextColor = props.bubbleTextColor?.({ isMe })\n\t\tconst initialsBackgroundColor = props.initialsBackgroundColor?.({ isMe })\n\t\tconst initialsTextColor = props.initialsTextColor?.({ isMe })\n\n\t\tconst messageProps: MessageProps = {\n\t\t\tmessageContainerStyle,\n\t\t\tbubbleStyle,\n\t\t\tbubbleTextStyle,\n\t\t\tmessageWrapperStyle,\n\t\t\tdelivered: true,\n\t\t\t// isMe: (message.user && message.user.id) === (props.user && props.user.id),\n\t\t\tisMe,\n\t\t\trenderFooter: props.renderMessageFooter,\n\t\t\timageProps: props.imageProps,\n\t\t\t// media: message.media,\n\t\t\tname: message.user.name,\n\t\t\tsystem: message.system,\n\t\t\ttext: message.text,\n\t\t\tread: true,\n\t\t\trenderMedia: props.renderMessageMedia,\n\t\t\tonLongPress: onLongPressItem,\n\t\t\tonPress: onPressItem,\n\t\t\t// pressType: props.messagePressType || 'double',\n\t\t\tonDoubleTap: onDoubleTapItem,\n\t\t\tdoubleTapDelay: props.messageDoubleTapDelay,\n\t\t\tdisableSwipeActions: props.disableSwipeActions,\n\t\t\tswipeActions: props.swipeActions,\n\t\t\tlongPressDelay: props.messageLongPressDelay,\n\t\t\tid: message.id,\n\t\t\tshowName,\n\t\t\tavatar: message.user.avatar,\n\t\t\tavatarImageProps: props.avatarImageProps,\n\t\t\tavatarSize: props.avatarSize,\n\t\t\trenderAvatar,\n\t\t\tshowAvatar,\n\t\t\t// initialsBackgroundColor: props.initialsBackgroundColor,\n\t\t\t// initialsTextColor: props.initialsTextColor,\n\t\t\tinitialsBackgroundColor,\n\t\t\tinitialsTextColor,\n\t\t\trenderInitials: props.renderInitials,\n\t\t\tnameStyle: props.nameStyle,\n\t\t\ttintColor: props.tintColor,\n\t\t\tswipeActionWidth: props.swipeActionWidth,\n\t\t\trenderSwipeAction: props.renderSwipeAction,\n\t\t\tbubbleBackgroundColor,\n\t\t\tbubbleTextColor,\n\t\t\tuserId: message.user.id,\n\t\t\tuserName: message.user.name,\n\t\t\tAvatarImageComponent: props.AvatarImageComponent,\n\t\t\tmediaHeight: message.media?.height,\n\t\t\tmediaWidth: message.media?.width,\n\t\t\tmediaUri: message.media?.uri,\n\t\t\tmediaContentType: message.media?.contentType,\n\t\t\tmediaUrl: message.media?.url,\n\t\t\tcreatesNewBunch: messageCreatesNewBunch,\n\t\t\trenderText: props.renderMessageText,\n\t\t\tcreatedAt: message.createdAt,\n\t\t}\n\n\t\tif (props.renderMessage) return props.renderMessage(messageProps)\n\t\treturn <Message {...messageProps} />\n\t}\n\t// \t,\n\t// \t[\n\t// \t\tprops.tintColor,\n\t// \t\tprops.user,\n\t// \t\tprops.renderItem,\n\t// \t\tprops.renderMessage,\n\t// \t\tprops.renderMessageFooter,\n\t// \t\tprops.renderSystemMessage,\n\t// \t\tprops.renderMessageMedia,\n\t// \t\tprops.onPressMessage,\n\t// \t\tprops.systemMessageContainerStyle,\n\t// \t\tprops.systemMessageDateToStringFunc,\n\t// \t\tprops.systemMessageDateStyle,\n\t// \t\tprops.systemMessageTextStyle,\n\t// \t\tprops.messages,\n\t// \t\tprops.showNameForEveryMessage,\n\t// \t\tprops.showMyName,\n\t// \t\tprops.showAvatarForEveryMessage,\n\t// \t\tprops.renderAvatar,\n\t// \t\tprops.hideMyAvatar,\n\t// \t\tprops.bubbleStyle,\n\t// \t\tprops.messageContainerStyle,\n\t// \t\tprops.bubbleTextStyle,\n\t// \t\tprops.messageWrapperStyle,\n\t// \t\tprops.bubbleBackgroundColor,\n\t// \t\tprops.bubbleTextStyle,\n\t// \t\tprops.bubbleTextColor,\n\t// \t\tprops.renderMessageFooter,\n\t// \t\tprops.imageProps,\n\t// \t\tprops.onLongPressMessage,\n\t// \t\tprops.messagePressType,\n\t// \t\tprops.onPressMessage,\n\t// \t\tprops.messageDoubleTapDelay,\n\t// \t\tprops.disableSwipeActions,\n\t// \t\tprops.swipeActionWidth,\n\t// \t\tprops.swipeActions,\n\t// \t\tprops.messageLongPressDelay,\n\t// \t\tprops.avatarImageProps,\n\t// \t\tprops.avatarSize,\n\t// \t\tprops.initialsBackgroundColor,\n\t// \t\tprops.initialsTextColor,\n\t// \t\tprops.renderInitials,\n\t// \t\tprops.nameStyle,\n\t// \t\tprops.swipeActionWidth,\n\t// \t\tprops.AvatarImageComponent,\n\t// \t],\n\t// )\n\n\tconst keyExtractor = useMemo(\n\t\t() => props.keyExtractor || (({ id }: MessageModel) => id),\n\t\t[props.keyExtractor]\n\t)\n\tconst namesOfUsersTyping = useMemo(() => props.namesOfUsersTyping || [], [\n\t\tprops.namesOfUsersTyping,\n\t])\n\n\tconst typingText = namesOfUsersTyping.join(', ')\n\n\tconst { renderTypingIndicator, typingIndicatorProps } = props\n\tconst ListFooterComponent = useCallback(() => {\n\t\tif (renderTypingIndicator === null || !numberOfUsersTyping) return null\n\n\t\treturn (\n\t\t\t<TypingFooter\n\t\t\t\ttypingText={props.showTypingText ? typingText : ''}\n\t\t\t\tnumberOfUsersTyping={numberOfUsersTyping}\n\t\t\t\t{...typingIndicatorProps}\n\t\t\t/>\n\t\t)\n\t}, [\n\t\ttypingText,\n\t\tprops.showTypingText,\n\t\trenderTypingIndicator,\n\t\tnumberOfUsersTyping,\n\t\ttypingIndicatorProps,\n\t])\n\n\tconst {\n\t\tflatListProps,\n\t\tkeyboardDismissMode = 'interactive',\n\t\tkeyboardShouldPersistTaps = 'handled',\n\t\textraData,\n\t\tmessages,\n\t\tcontentContainerStyle,\n\t} = props\n\tconst renderList = () => {\n\t\treturn (\n\t\t\t<Animated.FlatList\n\t\t\t\t{...flatListProps}\n\t\t\t\tref={flatListRef as MutableRefObject<FlatList<MessageModel>>}\n\t\t\t\tdata={messages}\n\t\t\t\tkeyExtractor={keyExtractor}\n\t\t\t\trenderItem={renderItem}\n\t\t\t\textraData={extraData}\n\t\t\t\tListHeaderComponent={ListFooterComponent}\n\t\t\t\tinverted\n\t\t\t\t// initialNum\n\t\t\t\tonScroll={onScroll}\n\t\t\t\tonViewableItemsChanged={onViewableItemsChanged}\n\t\t\t\tkeyboardShouldPeristTaps={keyboardShouldPersistTaps}\n\t\t\t\tkeyboardDismissMode={keyboardDismissMode}\n\t\t\t\tcontentContainerStyle={{\n\t\t\t\t\t...styles.contentContainer,\n\t\t\t\t\t...(contentContainerStyle || {}),\n\t\t\t\t}}\n\t\t\t\tinitialNumToRender={20}\n\t\t\t/>\n\t\t)\n\t}\n\t// , [\n\t// \tflatListProps,\n\t// \tkeyboardDismissMode,\n\t// \tkeyboardShouldPersistTaps,\n\t// \textraData,\n\t// \tmessages,\n\t// \tonViewableItemsChanged,\n\t// \tListFooterComponent,\n\t// \tonScroll,\n\t// \tkeyExtractor,\n\t// \trenderItem,\n\t// \tcontentContainerStyle,\n\t// ])\n\tconst renderHeader = () => {\n\t\tif (props.renderHeader) return props.renderHeader()\n\t\treturn null\n\t}\n\tconst renderFooter = () => {\n\t\tif (props.renderFooter) return props.renderFooter()\n\t\treturn null\n\t}\n\tconst renderComposer = () => {\n\t\tif (props.renderComposer === null) return null\n\n\t\tconst composerProps: ComposerProps = {\n\t\t\tonInputTextChanged: props.onInputTextChanged,\n\t\t\ttext: props.text,\n\t\t\tinitialText: props.initialText,\n\t\t\tplaceholderColor: props.placeholderColor,\n\t\t\tplaceholderText: props.placeholderText,\n\t\t\trenderSendButton: props.renderSendButton,\n\t\t\trenderTextInput: props.renderTextInput,\n\t\t\ttextInputProps: props.textInputProps,\n\t\t\tmedia: props.media,\n\t\t\tonChangeMedia: props.onChangeMedia,\n\t\t\tuser: props.user,\n\t\t\tonSend: props.onSend,\n\t\t\tsendButtonMode: props.sendButtonMode,\n\t\t\tcontainerStyle: props.composerContainerStyle,\n\t\t\tinputContainerStyle: props.inputContainerStyle,\n\t\t\tinputStyle: props.inputStyle,\n\t\t\ttintColor: props.tintColor,\n\t\t\tinputRef: inputRef as MutableRefObject<TextInput>,\n\t\t\tsendButtonContainerStyle: props.sendButtonContainerStyle,\n\t\t\tsendOnKeyboardReturn: props.sendOnKeyboardReturn,\n\t\t}\n\t\tif (props.renderComposer) return props.renderComposer(composerProps)\n\n\t\treturn <Composer {...composerProps} />\n\t}\n\n\t// now, onto the actual render code\n\tconst Container =\n\t\tprops.ContainerComponent || (props.safeArea ? SafeAreaView : View)\n\tconst KeyboardView =\n\t\tprops.avoidKeyboard === false ? View : KeyboardAvoidingView\n\n\t// reanimated transition\n\tconst transition = useMemo(\n\t\t() =>\n\t\t\tprops.transitionConfig ||\n\t\t\t(true && (\n\t\t\t\t<Transition.Together>\n\t\t\t\t\t{/* <Transition.Out type=\"fade\" durationMs={100} /> */}\n\t\t\t\t\t<Transition.Change interpolation=\"easeInOut\" />\n\t\t\t\t\t<Transition.In type=\"fade\" />\n\t\t\t\t</Transition.Together>\n\t\t\t)),\n\t\t[props.transitionConfig]\n\t)\n\tconst containerStyle = useMemo(\n\t\t() => ({\n\t\t\t...styles.container,\n\t\t\t...props.containerStyle,\n\t\t}),\n\t\t[props.containerStyle]\n\t)\n\treturn (\n\t\t<Transitioning.View\n\t\t\tref={transitionRef}\n\t\t\ttransition={transition}\n\t\t\tstyle={containerStyle}\n\t\t>\n\t\t\t<Container style={containerStyle}>\n\t\t\t\t<KeyboardView\n\t\t\t\t\tstyle={containerStyle}\n\t\t\t\t\t// behavior={Platform.OS === 'ios' ? 'padding' : undefined}\n\t\t\t\t\tbehavior=\"padding\"\n\t\t\t\t>\n\t\t\t\t\t{renderHeader()}\n\t\t\t\t\t{renderList()}\n\t\t\t\t\t{renderFooter()}\n\t\t\t\t\t{renderComposer()}\n\t\t\t\t</KeyboardView>\n\t\t\t</Container>\n\t\t</Transitioning.View>\n\t)\n}\n\nChat.append = function<M>(state: M[], messages: M[]) {\n\treturn [...messages, ...state]\n}\n\nexport default Chat\n\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\tflex: 1,\n\t},\n\tcontentContainer: {\n\t\tflexGrow: 1,\n\t\tmarginTop: 5,\n\t},\n})\n"]}
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -1,2 +0,0 @@
1
- var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/Chat-Old/Bubble/index.tsx";import React,{useMemo}from'react';import{View,Text,StyleSheet}from'react-native';var Bubble=function Bubble(props){var containerStyles=useMemo(function(){return[styles.container,props.isMe?meStyles.container:otherStyles.container,props.style];},[props.style,props.isMe]);var textStyles=useMemo(function(){return[styles.text,props.isMe?meStyles.text:otherStyles.text,props.style];},[props.style,props.isMe]);return React.createElement(View,{style:containerStyles,ref:props.bubbleRef,__source:{fileName:_jsxFileName,lineNumber:23}},React.createElement(Text,{style:textStyles,__source:{fileName:_jsxFileName,lineNumber:24}},props.text));};export default Bubble;var styles=StyleSheet.create({container:{paddingHorizontal:10,paddingVertical:5,borderRadius:10},text:{textAlign:'left'}});var meStyles=StyleSheet.create({container:{backgroundColor:'blue'},text:{color:'white'}});var otherStyles=StyleSheet.create({container:{backgroundColor:'lightgray'},text:{color:'black'}});
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","useMemo","View","Text","StyleSheet","Bubble","props","containerStyles","styles","container","isMe","meStyles","otherStyles","style","textStyles","text","bubbleRef","create","paddingHorizontal","paddingVertical","borderRadius","textAlign","backgroundColor","color"],"mappings":"6GAAA,MAAOA,CAAAA,KAAP,EAAgBC,OAAhB,KAAkD,OAAlD,CAEA,OAASC,IAAT,CAAeC,IAAf,CAAqBC,UAArB,KAAuC,cAAvC,CAEA,GAAMC,CAAAA,MAAsC,CAAG,QAAzCA,CAAAA,MAAyC,CAAAC,KAAK,CAAI,CACvD,GAAMC,CAAAA,eAAe,CAAGN,OAAO,CAC9B,iBAAM,CACLO,MAAM,CAACC,SADF,CAELH,KAAK,CAACI,IAAN,CAAaC,QAAQ,CAACF,SAAtB,CAAkCG,WAAW,CAACH,SAFzC,CAGLH,KAAK,CAACO,KAHD,CAAN,EAD8B,CAM9B,CAACP,KAAK,CAACO,KAAP,CAAcP,KAAK,CAACI,IAApB,CAN8B,CAA/B,CAQA,GAAMI,CAAAA,UAAU,CAAGb,OAAO,CACzB,iBAAM,CACLO,MAAM,CAACO,IADF,CAELT,KAAK,CAACI,IAAN,CAAaC,QAAQ,CAACI,IAAtB,CAA6BH,WAAW,CAACG,IAFpC,CAGLT,KAAK,CAACO,KAHD,CAAN,EADyB,CAMzB,CAACP,KAAK,CAACO,KAAP,CAAcP,KAAK,CAACI,IAApB,CANyB,CAA1B,CAQA,MACC,qBAAC,IAAD,EAAM,KAAK,CAAEH,eAAb,CAA8B,GAAG,CAAED,KAAK,CAACU,SAAzC,iDACC,oBAAC,IAAD,EAAM,KAAK,CAAEF,UAAb,iDAA0BR,KAAK,CAACS,IAAhC,CADD,CADD,CAKA,CAtBD,CAwBA,cAAeV,CAAAA,MAAf,CAEA,GAAMG,CAAAA,MAAM,CAAGJ,UAAU,CAACa,MAAX,CAAkB,CAChCR,SAAS,CAAE,CACVS,iBAAiB,CAAE,EADT,CAEVC,eAAe,CAAE,CAFP,CAGVC,YAAY,CAAE,EAHJ,CADqB,CAMhCL,IAAI,CAAE,CACLM,SAAS,CAAE,MADN,CAN0B,CAAlB,CAAf,CAWA,GAAMV,CAAAA,QAAQ,CAAGP,UAAU,CAACa,MAAX,CAAkB,CAClCR,SAAS,CAAE,CACVa,eAAe,CAAE,MADP,CADuB,CAIlCP,IAAI,CAAE,CACLQ,KAAK,CAAE,OADF,CAJ4B,CAAlB,CAAjB,CASA,GAAMX,CAAAA,WAAW,CAAGR,UAAU,CAACa,MAAX,CAAkB,CACrCR,SAAS,CAAE,CACVa,eAAe,CAAE,WADP,CAD0B,CAIrCP,IAAI,CAAE,CACLQ,KAAK,CAAE,OADF,CAJ+B,CAAlB,CAApB","sourcesContent":["import React, { useMemo, FunctionComponent } from 'react'\nimport { BubbleProps } from '../types'\nimport { View, Text, StyleSheet } from 'react-native'\n\nconst Bubble: FunctionComponent<BubbleProps> = props => {\n\tconst containerStyles = useMemo(\n\t\t() => [\n\t\t\tstyles.container,\n\t\t\tprops.isMe ? meStyles.container : otherStyles.container,\n\t\t\tprops.style\n\t\t],\n\t\t[props.style, props.isMe]\n\t)\n\tconst textStyles = useMemo(\n\t\t() => [\n\t\t\tstyles.text,\n\t\t\tprops.isMe ? meStyles.text : otherStyles.text,\n\t\t\tprops.style\n\t\t],\n\t\t[props.style, props.isMe]\n\t)\n\treturn (\n\t\t<View style={containerStyles} ref={props.bubbleRef}>\n\t\t\t<Text style={textStyles}>{props.text}</Text>\n\t\t</View>\n\t)\n}\n\nexport default Bubble\n\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\tpaddingHorizontal: 10,\n\t\tpaddingVertical: 5,\n\t\tborderRadius: 10\n\t},\n\ttext: {\n\t\ttextAlign: 'left'\n\t}\n})\n\nconst meStyles = StyleSheet.create({\n\tcontainer: {\n\t\tbackgroundColor: 'blue'\n\t},\n\ttext: {\n\t\tcolor: 'white'\n\t}\n})\n\nconst otherStyles = StyleSheet.create({\n\tcontainer: {\n\t\tbackgroundColor: 'lightgray'\n\t},\n\ttext: {\n\t\tcolor: 'black'\n\t}\n})\n"]}
@@ -1,2 +0,0 @@
1
- import _extends from"@babel/runtime/helpers/extends";var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/Chat-Old/Composer/Input/index.tsx";import React from'react';import{TextInput,StyleSheet,View}from'react-native';var Input=function Input(props){return React.createElement(View,{style:[styles.container,props.containerStyle],__source:{fileName:_jsxFileName,lineNumber:7}},React.createElement(TextInput,_extends({},props.inputProps,{placeholder:props.placeholderText||'Type a new message...',placeholderTextColor:props.placeholderColor||'lightgray',selectionColor:props.tintColor||'blue',onChangeText:props.onChangeText,value:props.text,style:[styles.input,props.style],multiline:true,ref:props.inputRef,__source:{fileName:_jsxFileName,lineNumber:8}})));};export default Input;var styles=StyleSheet.create({container:{flex:1,flexDirection:'row'},input:{flex:1,padding:10}});
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","TextInput","StyleSheet","View","Input","props","styles","container","containerStyle","inputProps","placeholderText","placeholderColor","tintColor","onChangeText","text","input","style","inputRef","create","flex","flexDirection","padding"],"mappings":"0KAAA,MAAOA,CAAAA,KAAP,KAAkB,OAAlB,CACA,OAASC,SAAT,CAAoBC,UAApB,CAAgCC,IAAhC,KAA4C,cAA5C,CAGA,GAAMC,CAAAA,KAAK,CAAG,QAARA,CAAAA,KAAQ,CAACC,KAAD,CAAuB,CACpC,MACC,qBAAC,IAAD,EAAM,KAAK,CAAE,CAACC,MAAM,CAACC,SAAR,CAAmBF,KAAK,CAACG,cAAzB,CAAb,gDACC,oBAAC,SAAD,aACKH,KAAK,CAACI,UADX,EAEC,WAAW,CAAEJ,KAAK,CAACK,eAAN,EAAyB,uBAFvC,CAGC,oBAAoB,CAAEL,KAAK,CAACM,gBAAN,EAA0B,WAHjD,CAIC,cAAc,CAAEN,KAAK,CAACO,SAAN,EAAmB,MAJpC,CAKC,YAAY,CAAEP,KAAK,CAACQ,YALrB,CAMC,KAAK,CAAER,KAAK,CAACS,IANd,CAOC,KAAK,CAAE,CAACR,MAAM,CAACS,KAAR,CAAeV,KAAK,CAACW,KAArB,CAPR,CAQC,SAAS,KARV,CASC,GAAG,CAAEX,KAAK,CAACY,QATZ,iDADD,CADD,CAeA,CAhBD,CAkBA,cAAeb,CAAAA,KAAf,CAEA,GAAME,CAAAA,MAAM,CAAGJ,UAAU,CAACgB,MAAX,CAAkB,CAChCX,SAAS,CAAE,CACVY,IAAI,CAAE,CADI,CAEVC,aAAa,CAAE,KAFL,CADqB,CAKhCL,KAAK,CAAE,CACNI,IAAI,CAAE,CADA,CAENE,OAAO,CAAE,EAFH,CALyB,CAAlB,CAAf","sourcesContent":["import React from 'react'\nimport { TextInput, StyleSheet, View } from 'react-native'\nimport { InputProps } from '../../types'\n\nconst Input = (props: InputProps) => {\n\treturn (\n\t\t<View style={[styles.container, props.containerStyle]}>\n\t\t\t<TextInput\n\t\t\t\t{...props.inputProps}\n\t\t\t\tplaceholder={props.placeholderText || 'Type a new message...'}\n\t\t\t\tplaceholderTextColor={props.placeholderColor || 'lightgray'}\n\t\t\t\tselectionColor={props.tintColor || 'blue'}\n\t\t\t\tonChangeText={props.onChangeText}\n\t\t\t\tvalue={props.text}\n\t\t\t\tstyle={[styles.input, props.style]}\n\t\t\t\tmultiline\n\t\t\t\tref={props.inputRef}\n\t\t\t/>\n\t\t</View>\n\t)\n}\n\nexport default Input\n\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\tflex: 1,\n\t\tflexDirection: 'row'\n\t},\n\tinput: {\n\t\tflex: 1,\n\t\tpadding: 10\n\t}\n})\n"]}
@@ -1,2 +0,0 @@
1
- var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/Chat-Old/Composer/Send/index.tsx";import React from'react';import{Button,StyleSheet,TouchableOpacity}from'react-native';import{Ionicons}from'@expo/vector-icons';export default(function(props){if(props.mode==='hidden')return null;if(props.mode==='icon')return React.createElement(TouchableOpacity,{onPress:props.onSend,style:[styles.button,{backgroundColor:props.tintColor||'blue'}],__source:{fileName:_jsxFileName,lineNumber:10}},React.createElement(Ionicons,{name:"ios-arrow-round-up",size:size,color:'white',__source:{fileName:_jsxFileName,lineNumber:14}}));return React.createElement(Button,{title:"Send",onPress:props.onSend,color:props.tintColor||'blue',__source:{fileName:_jsxFileName,lineNumber:18}});});var size=20;var styles=StyleSheet.create({button:{borderRadius:size,height:size*1.5,width:size*1.5,justifyContent:'center',alignItems:'center',padding:size/2}});
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","Button","StyleSheet","TouchableOpacity","Ionicons","props","mode","onSend","styles","button","backgroundColor","tintColor","size","create","borderRadius","height","width","justifyContent","alignItems","padding"],"mappings":"oHAAA,MAAOA,CAAAA,KAAP,KAAkB,OAAlB,CACA,OAASC,MAAT,CAAiBC,UAAjB,CAA6BC,gBAA7B,KAAqD,cAArD,CACA,OAASC,QAAT,KAAyB,oBAAzB,CAGA,eAAe,SAACC,KAAD,CAA4B,CAC1C,GAAIA,KAAK,CAACC,IAAN,GAAe,QAAnB,CAA6B,MAAO,KAAP,CAC7B,GAAID,KAAK,CAACC,IAAN,GAAe,MAAnB,CACC,MACC,qBAAC,gBAAD,EACC,OAAO,CAAED,KAAK,CAACE,MADhB,CAEC,KAAK,CAAE,CAACC,MAAM,CAACC,MAAR,CAAgB,CAAEC,eAAe,CAAEL,KAAK,CAACM,SAAN,EAAmB,MAAtC,CAAhB,CAFR,iDAIC,oBAAC,QAAD,EAAU,IAAI,CAAC,oBAAf,CAAoC,IAAI,CAAEC,IAA1C,CAAgD,KAAK,CAAE,OAAvD,iDAJD,CADD,CAQD,MACC,qBAAC,MAAD,EACC,KAAK,CAAC,MADP,CAEC,OAAO,CAAEP,KAAK,CAACE,MAFhB,CAGC,KAAK,CAAEF,KAAK,CAACM,SAAN,EAAmB,MAH3B,iDADD,CAOA,CAlBD,EAoBA,GAAMC,CAAAA,IAAI,CAAG,EAAb,CAEA,GAAMJ,CAAAA,MAAM,CAAGN,UAAU,CAACW,MAAX,CAAkB,CAChCJ,MAAM,CAAE,CACPK,YAAY,CAAEF,IADP,CAEPG,MAAM,CAAEH,IAAI,CAAG,GAFR,CAGPI,KAAK,CAAEJ,IAAI,CAAG,GAHP,CAIPK,cAAc,CAAE,QAJT,CAKPC,UAAU,CAAE,QALL,CAMPC,OAAO,CAAEP,IAAI,CAAG,CANT,CADwB,CAAlB,CAAf","sourcesContent":["import React from 'react'\nimport { Button, StyleSheet, TouchableOpacity } from 'react-native'\nimport { Ionicons } from '@expo/vector-icons'\nimport { SendButtonProps } from '../../types'\n\nexport default (props: SendButtonProps) => {\n\tif (props.mode === 'hidden') return null\n\tif (props.mode === 'icon')\n\t\treturn (\n\t\t\t<TouchableOpacity\n\t\t\t\tonPress={props.onSend}\n\t\t\t\tstyle={[styles.button, { backgroundColor: props.tintColor || 'blue' }]}\n\t\t\t>\n\t\t\t\t<Ionicons name=\"ios-arrow-round-up\" size={size} color={'white'} />\n\t\t\t</TouchableOpacity>\n\t\t)\n\treturn (\n\t\t<Button\n\t\t\ttitle=\"Send\"\n\t\t\tonPress={props.onSend}\n\t\t\tcolor={props.tintColor || 'blue'}\n\t\t/>\n\t)\n}\n\nconst size = 20\n\nconst styles = StyleSheet.create({\n\tbutton: {\n\t\tborderRadius: size,\n\t\theight: size * 1.5,\n\t\twidth: size * 1.5,\n\t\tjustifyContent: 'center',\n\t\talignItems: 'center',\n\t\tpadding: size / 2\n\t}\n})\n"]}
@@ -1,2 +0,0 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";import _extends from"@babel/runtime/helpers/extends";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/Chat-Old/Composer/index.tsx";function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly)symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;});keys.push.apply(keys,symbols);}return keys;}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};if(i%2){ownKeys(Object(source),true).forEach(function(key){_defineProperty(target,key,source[key]);});}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source));}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key));});}}return target;}import React,{useState,useCallback,useMemo}from'react';import uuid from'uuid';import{View,StyleSheet}from'react-native';import Input from'./Input';import Send from'./Send';var emptyMedia=[];export default React.memo(function(props){var _useState=useState(props.initialText||''),_useState2=_slicedToArray(_useState,2),textState=_useState2[0],setText=_useState2[1];var _ref=[props.text||textState,props.text&&props.onInputTextChanged||setText],text=_ref[0],onChangeText=_ref[1];var _useState3=useState(emptyMedia),_useState4=_slicedToArray(_useState3,2),mediaState=_useState4[0],setMedia=_useState4[1];var _ref2=[props.media||mediaState,props.media&&props.onChangeMedia||setMedia],media=_ref2[0],onChangeMedia=_ref2[1];var textInputProps=props.textInputProps,renderTextInput=props.renderTextInput;var renderInput=useCallback(function(){if(renderTextInput===null)return null;var inputProps={inputProps:textInputProps,onChangeText:onChangeText,text:text,containerStyle:props.inputContainerStyle,placeholderColor:props.placeholderColor,placeholderText:props.placeholderText,style:props.inputStyle,tintColor:props.tintColor,inputRef:props.inputRef};if(renderTextInput)return renderTextInput(inputProps);return React.createElement(Input,_extends({},inputProps,{__source:{fileName:_jsxFileName,lineNumber:44}}));},[onChangeText,text,textInputProps,renderTextInput,props.inputContainerStyle,props.placeholderColor,props.placeholderText,props.inputStyle,props.tintColor,props.inputRef]);var user=props.user;var messagesReadyToSend=useMemo(function(){var messages=[];if(media.length){;media.forEach(function(item){var message={user:user,text:'',id:uuid.v4(),createdAt:new Date(),media:item};messages.push(message);});}if(text){var message={user:user,text:text&&text.trim(),id:uuid.v4(),createdAt:new Date()};messages.push(message);}return messages;},[user,text,media]);var onSend=props.onSend;var send=useCallback(function(){if(messagesReadyToSend.length){onChangeText('');onChangeMedia([]);onSend(messagesReadyToSend);}},[onChangeText,onChangeMedia,messagesReadyToSend,onSend]);var renderSendButton=props.renderSendButton,sendButtonMode=props.sendButtonMode;var renderSend=useCallback(function(){if(renderSendButton===null)return null;var mode=_objectSpread({empty:'hidden',withText:'icon'},sendButtonMode||{});var sendProps={onSend:send,text:text,media:media,user:user,mode:(text&&text.trim?mode.withText:mode.empty)||'icon'};if(renderSendButton)return renderSendButton(sendProps);return React.createElement(Send,_extends({},sendProps,{__source:{fileName:_jsxFileName,lineNumber:113}}));},[send,text,user,media,renderSendButton,sendButtonMode]);return React.createElement(View,{style:props.containerStyle,__source:{fileName:_jsxFileName,lineNumber:117}},React.createElement(View,{style:styles.wrapper,__source:{fileName:_jsxFileName,lineNumber:118}},renderInput(),renderSend()));});var styles=StyleSheet.create({container:{},wrapper:{flexDirection:'row'}});
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","useState","useCallback","useMemo","uuid","View","StyleSheet","Input","Send","emptyMedia","memo","props","initialText","textState","setText","text","onInputTextChanged","onChangeText","mediaState","setMedia","media","onChangeMedia","textInputProps","renderTextInput","renderInput","inputProps","containerStyle","inputContainerStyle","placeholderColor","placeholderText","style","inputStyle","tintColor","inputRef","user","messagesReadyToSend","messages","length","forEach","item","message","id","v4","createdAt","Date","push","trim","onSend","send","renderSendButton","sendButtonMode","renderSend","mode","empty","withText","sendProps","styles","wrapper","create","container","flexDirection"],"mappings":"okCAAA,MAAOA,CAAAA,KAAP,EAAgBC,QA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xB,CAAnC,CAOA,GAAIJ,gBAAJ,CAAsB,MAAOA,CAAAA,gBAAgB,CAACM,SAAD,CAAvB,CAEtB,MAAO,qBAAC,IAAD,aAAUA,SAAV,oDAAP,CACA,CAlB6B,CAkB3B,CAACP,IAAD,CAAOjC,IAAP,CAAamB,IAAb,CAAmBd,KAAnB,CAA0B6B,gBAA1B,CAA4CC,cAA5C,CAlB2B,CAA9B,CAoBA,MACC,qBAAC,IAAD,EAAM,KAAK,CAAEvC,KAAK,CAACe,cAAnB,kDACC,oBAAC,IAAD,EAAM,KAAK,CAAE8B,MAAM,CAACC,OAApB,kDACEjC,WAAW,EADb,CAEE2B,UAAU,EAFZ,CADD,CADD,CAQA,CAjHc,CAAf,CAmHA,GAAMK,CAAAA,MAAM,CAAGlD,UAAU,CAACoD,MAAX,CAAkB,CAChCC,SAAS,CAAE,EADqB,CAEhCF,OAAO,CAAE,CACRG,aAAa,CAAE,KADP,CAFuB,CAAlB,CAAf","sourcesContent":["import React, { useState, useCallback, useMemo } from 'react'\nimport uuid from 'uuid'\nimport { View, StyleSheet } from 'react-native'\nimport { ComposerProps, InputProps, SendButtonProps, ChatProps } from '../types'\nimport Input from './Input'\nimport { MessageMedia, NewMessageModel, MessageMediaWithUri } from '../../../classes/Message/types'\nimport Send from './Send'\n\nconst emptyMedia: Omit<MessageMedia, 'url'>[] = []\n\nexport default React.memo((props: ComposerProps) => {\n\t// First, we set up a state manager for the composer's text.\n\tconst [textState, setText] = useState(props.initialText || '')\n\t// if you pass a text prop, use that state instead\n\tconst [text, onChangeText] = [\n\t\tprops.text || textState,\n\t\t(props.text && props.onInputTextChanged) || setText\n\t]\n\n\tconst [mediaState, setMedia] = useState<MessageMediaWithUri[]>(emptyMedia)\n\tconst [media, onChangeMedia] = [\n\t\tprops.media || mediaState,\n\t\t(props.media && props.onChangeMedia) || setMedia\n\t]\n\n\tconst { textInputProps, renderTextInput } = props\n\tconst renderInput = useCallback(() => {\n\t\tif (renderTextInput === null) return null\n\n\t\tconst inputProps: InputProps = {\n\t\t\tinputProps: textInputProps,\n\t\t\tonChangeText,\n\t\t\ttext,\n\t\t\tcontainerStyle: props.inputContainerStyle,\n\t\t\tplaceholderColor: props.placeholderColor,\n\t\t\tplaceholderText: props.placeholderText,\n\t\t\tstyle: props.inputStyle,\n\t\t\ttintColor: props.tintColor,\n\t\t\tinputRef: props.inputRef\n\t\t}\n\n\t\tif (renderTextInput) return renderTextInput(inputProps)\n\n\t\treturn <Input {...inputProps} />\n\t}, [\n\t\tonChangeText,\n\t\ttext,\n\t\ttextInputProps,\n\t\trenderTextInput,\n\t\tprops.inputContainerStyle,\n\t\tprops.placeholderColor,\n\t\tprops.placeholderText,\n\t\tprops.inputStyle,\n\t\tprops.tintColor,\n\t\t// TODO leave or take out?\n\t\tprops.inputRef\n\t])\n\n\tconst { user } = props\n\tconst messagesReadyToSend = useMemo(() => {\n\t\tconst messages: NewMessageModel[] = []\n\t\tif (media.length) {\n\t\t\t;(media as MessageMedia[]).forEach(item => {\n\t\t\t\tconst message: NewMessageModel = {\n\t\t\t\t\tuser,\n\t\t\t\t\ttext: '',\n\t\t\t\t\tid: uuid.v4(),\n\t\t\t\t\tcreatedAt: new Date(),\n\t\t\t\t\tmedia: item\n\t\t\t\t}\n\t\t\t\tmessages.push(message)\n\t\t\t})\n\t\t}\n\t\tif (text) {\n\t\t\tconst message: NewMessageModel = {\n\t\t\t\tuser,\n\t\t\t\ttext: text && text.trim(),\n\t\t\t\tid: uuid.v4(),\n\t\t\t\tcreatedAt: new Date()\n\t\t\t}\n\t\t\tmessages.push(message)\n\t\t}\n\t\treturn messages\n\t}, [user, text, media])\n\n\tconst { onSend } = props\n\tconst send = useCallback(() => {\n\t\tif (messagesReadyToSend.length) {\n\t\t\tonChangeText('')\n\t\t\tonChangeMedia([])\n\t\t\tonSend(messagesReadyToSend)\n\t\t}\n\t}, [onChangeText, onChangeMedia, messagesReadyToSend, onSend])\n\n\tconst { renderSendButton, sendButtonMode } = props\n\tconst renderSend = useCallback(() => {\n\t\tif (renderSendButton === null) return null\n\n\t\tconst mode: ChatProps['sendButtonMode'] = {\n\t\t\tempty: 'hidden',\n\t\t\twithText: 'icon',\n\t\t\t...(sendButtonMode || {})\n\t\t}\n\t\tconst sendProps: SendButtonProps = {\n\t\t\tonSend: send,\n\t\t\ttext,\n\t\t\tmedia,\n\t\t\tuser,\n\t\t\tmode: (text && text.trim ? mode.withText : mode.empty) || 'icon'\n\t\t}\n\t\tif (renderSendButton) return renderSendButton(sendProps)\n\n\t\treturn <Send {...sendProps} />\n\t}, [send, text, user, media, renderSendButton, sendButtonMode])\n\n\treturn (\n\t\t<View style={props.containerStyle}>\n\t\t\t<View style={styles.wrapper}>\n\t\t\t\t{renderInput()}\n\t\t\t\t{renderSend()}\n\t\t\t</View>\n\t\t</View>\n\t)\n})\n\nconst styles = StyleSheet.create({\n\tcontainer: {},\n\twrapper: {\n\t\tflexDirection: 'row'\n\t}\n})\n"]}
@@ -1,2 +0,0 @@
1
- import _extends from"@babel/runtime/helpers/extends";var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/Chat-Old/Message/index.tsx";import React,{useCallback,useRef,useMemo}from'react';import{View,StyleSheet,Text}from'react-native';import Bubble from'../Bubble';import{Avatar,Initials}from'../..';import{getInitials}from'../../../helpers/getInitials';var Message=function Message(props){var bubble=useRef();var renderFooter=props.renderFooter;var footer=useCallback(function(){return renderFooter?renderFooter({id:props.id}):null;},[props.id,renderFooter]);var containerStyle=useMemo(function(){return[styles.container,props.isMe?meStyles.container:otherStyles.container,props.messageContainerStyle];},[props.isMe,props.messageContainerStyle]);var wrapperStyle=useMemo(function(){return[styles.wrapper,props.isMe?meStyles.wrapper:otherStyles.wrapper,props.messageWrapperStyle];},[props.isMe,props.messageWrapperStyle]);var maybeRenderName=useCallback(function(){return props.showName&&props.name?React.createElement(Text,{style:styles.name,__source:{fileName:_jsxFileName,lineNumber:45}},props.name):null;},[props.showName,props.name]);var renderAvatar=props.renderAvatar,avatar=props.avatar,avatarImageProps=props.avatarImageProps,avatarSize=props.avatarSize,showAvatar=props.showAvatar,name=props.name,renderInitials=props.renderInitials,initialsBackgroundColor=props.initialsBackgroundColor,initialsTextColor=props.initialsTextColor;var renderAvatarOrInitials=useCallback(function(){if(renderAvatar===null)return null;var opacity=showAvatar===false?0:1;var size=avatarSize||40;var Container=function Container(_ref){var children=_ref.children;return React.createElement(View,{style:{opacity:opacity},__source:{fileName:_jsxFileName,lineNumber:67}},children);};if(avatar){var avatarProps={avatar:avatar,imageProps:avatarImageProps,size:size};if(renderAvatar)return renderAvatar(avatarProps);return React.createElement(Container,{__source:{fileName:_jsxFileName,lineNumber:78}},React.createElement(Avatar,_extends({},avatarProps,{__source:{fileName:_jsxFileName,lineNumber:79}})));}var initialsProps={initials:getInitials(name),size:size,textColor:initialsTextColor,backgroundColor:initialsBackgroundColor||props.tintColor};if(renderInitials)return renderInitials(initialsProps);return React.createElement(Container,{__source:{fileName:_jsxFileName,lineNumber:91}},React.createElement(Initials,_extends({},initialsProps,{__source:{fileName:_jsxFileName,lineNumber:92}})));},[avatar,avatarImageProps,avatarSize,renderAvatar,showAvatar,name,renderInitials,initialsBackgroundColor,initialsTextColor,props.tintColor]);return React.createElement(View,{style:containerStyle,__source:{fileName:_jsxFileName,lineNumber:109}},React.createElement(View,{style:wrapperStyle,__source:{fileName:_jsxFileName,lineNumber:110}},renderAvatarOrInitials(),React.createElement(View,{__source:{fileName:_jsxFileName,lineNumber:112}},maybeRenderName(),React.createElement(Bubble,{text:props.text,isMe:props.isMe,style:props.bubbleStyle,textStyle:props.bubbleTextStyle,bubbleRef:bubble,__source:{fileName:_jsxFileName,lineNumber:114}}))),footer());};export default React.memo(Message);var styles=StyleSheet.create({container:{marginTop:1,flexDirection:'row'},wrapper:{flex:1},name:{marginLeft:5}});var meStyles=StyleSheet.create({container:{justifyContent:'flex-end'},wrapper:{flexDirection:'row-reverse'}});var otherStyles=StyleSheet.create({container:{justifyContent:'flex-end'},wrapper:{flexDirection:'row'}});
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","useCallback","useRef","useMemo","View","StyleSheet","Text","Bubble","Avatar","Initials","getInitials","Message","props","bubble","renderFooter","footer","id","containerStyle","styles","container","isMe","meStyles","otherStyles","messageContainerStyle","wrapperStyle","wrapper","messageWrapperStyle","maybeRenderName","showName","name","renderAvatar","avatar","avatarImageProps","avatarSize","showAvatar","renderInitials","initialsBackgroundColor","initialsTextColor","renderAvatarOrInitials","opacity","size","Container","children","avatarProps","imageProps","initialsProps","initials","textColor","backgroundColor","tintColor","text","bubbleStyle","bubbleTextStyle","memo","create","marginTop","flexDirection","flex","marginLeft","justifyContent"],"mappings":"mKAAA,MAAOA,CAAAA,KAAP,EACCC,WADD,CAECC,MAFD,CAICC,OAJD,KAMO,OANP,CAOA,OAASC,IAAT,CAAeC,UAAf,CAA2BC,IAA3B,KAAuC,cAAvC,CAGA,MAAOC,CAAAA,MAAP,KAAmB,WAAnB,CACA,OAASC,MAAT,CAAiBC,QAAjB,KAAiC,OAAjC,CAEA,OAASC,WAAT,KAA4B,8BAA5B,CAEA,GAAMC,CAAAA,OAAO,CAAG,QAAVA,CAAAA,OAAU,CACfC,KADe,CAEX,CACJ,GAAMC,CAAAA,MAAM,CAAGX,MAAM,EAArB,CADI,GAGIY,CAAAA,YAHJ,CAGqBF,KAHrB,CAGIE,YAHJ,CAIJ,GAAMC,CAAAA,MAAM,CAAGd,WAAW,CACzB,iBAAOa,CAAAA,YAAY,CAAGA,YAAY,CAAC,CAAEE,EAAE,CAAEJ,KAAK,CAACI,EAAZ,CAAD,CAAf,CAAoC,IAAvD,EADyB,CAEzB,CAACJ,KAAK,CAACI,EAAP,CAAWF,YAAX,CAFyB,CAA1B,CAKA,GAAMG,CAAAA,cAAc,CAAGd,OAAO,CAAC,UAAM,CACpC,MAAO,CACNe,MAAM,CAACC,SADD,CAENP,KAAK,CAACQ,IAAN,CAA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VJ,CAnCuC,CAA1C,CAgDA,MACC,qBAAC,IAAD,EAAM,KAAK,CAAEhC,cAAb,kDACC,oBAAC,IAAD,EAAM,KAAK,CAAEO,YAAb,kDACEc,sBAAsB,EADxB,CAEC,oBAAC,IAAD,mDACEX,eAAe,EADjB,CAEC,oBAAC,MAAD,EACC,IAAI,CAAEf,KAAK,CAACsC,IADb,CAEC,IAAI,CAAEtC,KAAK,CAACQ,IAFb,CAGC,KAAK,CAAER,KAAK,CAACuC,WAHd,CAIC,SAAS,CAAEvC,KAAK,CAACwC,eAJlB,CAKC,SAAS,CAAEvC,MALZ,kDAFD,CAFD,CADD,CAcEE,MAAM,EAdR,CADD,CAkBA,CA9GD,CAgHA,cAAef,CAAAA,KAAK,CAACqD,IAAN,CAAW1C,OAAX,CAAf,CAEA,GAAMO,CAAAA,MAAM,CAAGb,UAAU,CAACiD,MAAX,CAAkB,CAChCnC,SAAS,CAAE,CACVoC,SAAS,CAAE,CADD,CAEVC,aAAa,CAAE,KAFL,CADqB,CAMhC/B,OAAO,CAAE,CACRgC,IAAI,CAAE,CADE,CANuB,CAShC5B,IAAI,CAAE,CACL6B,UAAU,CAAE,CADP,CAT0B,CAAlB,CAAf,CAcA,GAAMrC,CAAAA,QAAQ,CAAGhB,UAAU,CAACiD,MAAX,CAAkB,CAClCnC,SAAS,CAAE,CACVwC,cAAc,CAAE,UADN,CADuB,CAIlClC,OAAO,CAAE,CACR+B,aAAa,CAAE,aADP,CAJyB,CAAlB,CAAjB,CASA,GAAMlC,CAAAA,WAAW,CAAGjB,UAAU,CAACiD,MAAX,CAAkB,CACrCnC,SAAS,CAAE,CACVwC,cAAc,CAAE,UADN,CAD0B,CAIrClC,OAAO,CAAE,CACR+B,aAAa,CAAE,KADP,CAJ4B,CAAlB,CAApB","sourcesContent":["import React, {\n\tuseCallback,\n\tuseRef,\n\tMutableRefObject,\n\tuseMemo,\n\tFunctionComponent\n} from 'react'\nimport { View, StyleSheet, Text } from 'react-native'\nimport { MessageProps } from '../types'\nimport { NewMessageModel } from '../../../classes/Message/types'\nimport Bubble from '../Bubble'\nimport { Avatar, Initials } from '../..'\nimport { AvatarProps, InitialsProps } from '../../Inbox/types'\nimport { getInitials } from '../../../helpers/getInitials'\n\nconst Message = <Model extends NewMessageModel = NewMessageModel>(\n\tprops: MessageProps<Model>\n) => {\n\tconst bubble = useRef<View>()\n\n\tconst { renderFooter } = props\n\tconst footer = useCallback(\n\t\t() => (renderFooter ? renderFooter({ id: props.id }) : null),\n\t\t[props.id, renderFooter]\n\t)\n\n\tconst containerStyle = useMemo(() => {\n\t\treturn [\n\t\t\tstyles.container,\n\t\t\tprops.isMe ? meStyles.container : otherStyles.container,\n\t\t\tprops.messageContainerStyle\n\t\t]\n\t}, [props.isMe, props.messageContainerStyle])\n\n\tconst wrapperStyle = useMemo(() => {\n\t\treturn [\n\t\t\tstyles.wrapper,\n\t\t\tprops.isMe ? meStyles.wrapper : otherStyles.wrapper,\n\t\t\tprops.messageWrapperStyle\n\t\t]\n\t}, [props.isMe, props.messageWrapperStyle])\n\n\tconst maybeRenderName = useCallback(() => {\n\t\treturn props.showName && props.name ? (\n\t\t\t<Text style={styles.name}>{props.name}</Text>\n\t\t) : null\n\t}, [props.showName, props.name])\n\n\tconst {\n\t\trenderAvatar,\n\t\tavatar,\n\t\tavatarImageProps,\n\t\tavatarSize,\n\t\tshowAvatar,\n\t\tname,\n\t\trenderInitials,\n\t\tinitialsBackgroundColor,\n\t\tinitialsTextColor\n\t} = props\n\tconst renderAvatarOrInitials = useCallback(() => {\n\t\tif (renderAvatar === null) return null\n\t\t// we make opacity 0 instead of hiding it to maintain the same width from the side\n\t\tconst opacity = showAvatar === false ? 0 : 1\n\t\tconst size = avatarSize || 40\n\n\t\tconst Container: FunctionComponent<{}> = ({ children }) => (\n\t\t\t<View style={{ opacity }}>{children}</View>\n\t\t)\n\n\t\tif (avatar) {\n\t\t\tconst avatarProps: AvatarProps = {\n\t\t\t\tavatar: avatar,\n\t\t\t\timageProps: avatarImageProps,\n\t\t\t\tsize\n\t\t\t}\n\t\t\tif (renderAvatar) return renderAvatar(avatarProps)\n\t\t\treturn (\n\t\t\t\t<Container>\n\t\t\t\t\t<Avatar {...avatarProps} />\n\t\t\t\t</Container>\n\t\t\t)\n\t\t}\n\t\tconst initialsProps: InitialsProps = {\n\t\t\tinitials: getInitials(name),\n\t\t\tsize,\n\t\t\ttextColor: initialsTextColor,\n\t\t\tbackgroundColor: initialsBackgroundColor || props.tintColor\n\t\t}\n\t\tif (renderInitials) return renderInitials(initialsProps)\n\t\treturn (\n\t\t\t<Container>\n\t\t\t\t<Initials {...initialsProps} />\n\t\t\t</Container>\n\t\t)\n\t}, [\n\t\tavatar,\n\t\tavatarImageProps,\n\t\tavatarSize,\n\t\trenderAvatar,\n\t\tshowAvatar,\n\t\tname,\n\t\trenderInitials,\n\t\tinitialsBackgroundColor,\n\t\tinitialsTextColor,\n\t\tprops.tintColor\n\t])\n\n\treturn (\n\t\t<View style={containerStyle}>\n\t\t\t<View style={wrapperStyle}>\n\t\t\t\t{renderAvatarOrInitials()}\n\t\t\t\t<View>\n\t\t\t\t\t{maybeRenderName()}\n\t\t\t\t\t<Bubble\n\t\t\t\t\t\ttext={props.text}\n\t\t\t\t\t\tisMe={props.isMe}\n\t\t\t\t\t\tstyle={props.bubbleStyle}\n\t\t\t\t\t\ttextStyle={props.bubbleTextStyle}\n\t\t\t\t\t\tbubbleRef={bubble as MutableRefObject<View>}\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t</View>\n\t\t\t{footer()}\n\t\t</View>\n\t)\n}\n\nexport default React.memo(Message)\n\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\tmarginTop: 1,\n\t\tflexDirection: 'row'\n\t},\n\t// wrapper is concerned with which side the avatar is on relative to the bubble\n\twrapper: {\n\t\tflex: 1\n\t},\n\tname: {\n\t\tmarginLeft: 5\n\t}\n})\n\nconst meStyles = StyleSheet.create({\n\tcontainer: {\n\t\tjustifyContent: 'flex-end'\n\t},\n\twrapper: {\n\t\tflexDirection: 'row-reverse'\n\t}\n})\n\nconst otherStyles = StyleSheet.create({\n\tcontainer: {\n\t\tjustifyContent: 'flex-end'\n\t},\n\twrapper: {\n\t\tflexDirection: 'row'\n\t}\n})\n"]}
@@ -1,2 +0,0 @@
1
- var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/Chat-Old/Swiper/Action/index.tsx";import React from'react';import{View}from'react-native';export default(function(props){return React.createElement(View,{__source:{fileName:_jsxFileName,lineNumber:6}});});
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","View","props"],"mappings":"oHAAA,MAAOA,CAAAA,KAAP,KAAkB,OAAlB,CAEA,OAASC,IAAT,KAAqB,cAArB,CAEA,eAAe,SAACC,KAAD,CAA6B,CAC3C,MAAO,qBAAC,IAAD,iDAAP,CACA,CAFD","sourcesContent":["import React from 'react'\nimport { SwipeableProps, SwipeActionProps } from '../../types'\nimport { View } from 'react-native'\n\nexport default (props: SwipeActionProps) => {\n\treturn <View></View>\n}\n"]}
@@ -1,2 +0,0 @@
1
- import _extends from"@babel/runtime/helpers/extends";var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/Chat-Old/Swiper/index.tsx";import React,{useCallback}from'react';import Swipeable from'react-native-gesture-handler/Swipeable';import Action from'./Action';export default(function(props){var renderSwipeAction=props.renderSwipeAction;var renderAction=useCallback(function(actionProps){if(renderSwipeAction)return renderSwipeAction(actionProps);return React.createElement(Action,_extends({},actionProps,{__source:{fileName:_jsxFileName,lineNumber:12}}));},[renderSwipeAction]);var swipeActions=props.swipeActions;var leftActions=swipeActions&&swipeActions.left;var rightActions=swipeActions&&swipeActions.right;var renderRightActions=useCallback(function(){if(rightActions){rightActions.forEach(function(action){});}},[rightActions]);var renderActionList=useCallback(function(){},[]);return React.createElement(Swipeable,{__source:{fileName:_jsxFileName,lineNumber:29}});});
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","useCallback","Swipeable","Action","props","renderSwipeAction","renderAction","actionProps","swipeActions","leftActions","left","rightActions","right","renderRightActions","forEach","action","renderActionList"],"mappings":"kKAAA,MAAOA,CAAAA,KAAP,EAAgBC,WAAhB,KAAmC,OAAnC,CACA,MAAOC,CAAAA,SAAP,KAAsB,wCAAtB,CAEA,MAAOC,CAAAA,MAAP,KAAmB,UAAnB,CAEA,eAAe,SAACC,KAAD,CAA2B,IACjCC,CAAAA,iBADiC,CACXD,KADW,CACjCC,iBADiC,CAEzC,GAAMC,CAAAA,YAAY,CAAGL,WAAW,CAC/B,SAACM,WAAD,CAAmC,CAClC,GAAIF,iBAAJ,CAAuB,MAAOA,CAAAA,iBAAiB,CAACE,WAAD,CAAxB,CAEvB,MAAO,qBAAC,MAAD,aAAYA,WAAZ,mDAAP,CACA,CAL8B,CAM/B,CAACF,iBAAD,CAN+B,CAAhC,CAFyC,GAWjCG,CAAAA,YAXiC,CAWhBJ,KAXgB,CAWjCI,YAXiC,CAYzC,GAAMC,CAAAA,WAAW,CAAGD,YAAY,EAAIA,YAAY,CAACE,IAAjD,CACA,GAAMC,CAAAA,YAAY,CAAGH,YAAY,EAAIA,YAAY,CAACI,KAAlD,CAEA,GAAMC,CAAAA,kBAAkB,CAAGZ,WAAW,CAAC,UAAM,CAC5C,GAAIU,YAAJ,CAAkB,CACjBA,YAAY,CAACG,OAAb,CAAqB,SAAAC,MAAM,CAAI,CAAE,CAAjC,EACA,CACD,CAJqC,CAInC,CAACJ,YAAD,CAJmC,CAAtC,CAMA,GAAMK,CAAAA,gBAAgB,CAAGf,WAAW,CAAC,UAAM,CAAE,CAAT,CAAW,EAAX,CAApC,CAEA,MAAO,qBAAC,SAAD,kDAAP,CACA,CAxBD","sourcesContent":["import React, { useCallback } from 'react'\nimport Swipeable from 'react-native-gesture-handler/Swipeable'\nimport { SwipeableProps, SwipeActionProps } from '../types'\nimport Action from './Action'\n\nexport default (props: SwipeableProps) => {\n\tconst { renderSwipeAction } = props\n\tconst renderAction = useCallback(\n\t\t(actionProps: SwipeActionProps) => {\n\t\t\tif (renderSwipeAction) return renderSwipeAction(actionProps)\n\n\t\t\treturn <Action {...actionProps} />\n\t\t},\n\t\t[renderSwipeAction]\n\t)\n\n\tconst { swipeActions } = props\n\tconst leftActions = swipeActions && swipeActions.left\n\tconst rightActions = swipeActions && swipeActions.right\n\n\tconst renderRightActions = useCallback(() => {\n\t\tif (rightActions) {\n\t\t\trightActions.forEach(action => {})\n\t\t}\n\t}, [rightActions])\n\n\tconst renderActionList = useCallback(() => {}, [])\n\n\treturn <Swipeable></Swipeable>\n}\n"]}
@@ -1,2 +0,0 @@
1
- var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/Chat-Old/SystemMessage/index.tsx";import React from'react';import{View,Text,StyleSheet}from'react-native';import moment from'moment';var SystemMessage=React.memo(function(props){return React.createElement(View,{style:[styles.container,props.containerStyle],__source:{fileName:_jsxFileName,lineNumber:8}},React.createElement(Text,{style:styles.date,__source:{fileName:_jsxFileName,lineNumber:9}},props.dateToStringFunc?props.dateToStringFunc(props.createdAt):moment(props.createdAt).calendar(undefined,{lastDay:'[Yesterday]',sameDay:'LT',nextDay:'[Tomorrow at] LT',lastWeek:'dddd',nextWeek:'[Next] dddd',sameElse:'L'})),React.createElement(Text,{style:styles.text,__source:{fileName:_jsxFileName,lineNumber:21}},props.text));});export default SystemMessage;var styles=StyleSheet.create({container:{paddingHorizontal:10,paddingVertical:5},date:{color:'gray',textAlign:'center',fontSize:14},text:{color:'gray',fontWeight:'500',textAlign:'center',fontSize:14}});
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","View","Text","StyleSheet","moment","SystemMessage","memo","props","styles","container","containerStyle","date","dateToStringFunc","createdAt","calendar","undefined","lastDay","sameDay","nextDay","lastWeek","nextWeek","sameElse","text","create","paddingHor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AAS,CAAE,QAHN,CAILC,QAAQ,CAAE,EAJL,CAV0B,CAAlB,CAAf","sourcesContent":["import React from 'react'\nimport { View, Text, StyleSheet } from 'react-native'\nimport moment from 'moment'\nimport { SystemMessageProps } from '../types'\n\nconst SystemMessage = React.memo((props: SystemMessageProps) => {\n\treturn (\n\t\t<View style={[styles.container, props.containerStyle]}>\n\t\t\t<Text style={styles.date}>\n\t\t\t\t{props.dateToStringFunc\n\t\t\t\t\t? props.dateToStringFunc(props.createdAt)\n\t\t\t\t\t: moment(props.createdAt).calendar(undefined, {\n\t\t\t\t\t\t\tlastDay: '[Yesterday]',\n\t\t\t\t\t\t\tsameDay: 'LT',\n\t\t\t\t\t\t\tnextDay: '[Tomorrow at] LT',\n\t\t\t\t\t\t\tlastWeek: 'dddd',\n\t\t\t\t\t\t\tnextWeek: '[Next] dddd',\n\t\t\t\t\t\t\tsameElse: 'L'\n\t\t\t\t\t })}\n\t\t\t</Text>\n\t\t\t<Text style={styles.text}>{props.text}</Text>\n\t\t</View>\n\t)\n})\n\nexport default SystemMessage\n\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\tpaddingHorizontal: 10,\n\t\tpaddingVertical: 5\n\t},\n\tdate: {\n\t\tcolor: 'gray',\n\t\ttextAlign: 'center',\n\t\tfontSize: 14\n\t},\n\ttext: {\n\t\tcolor: 'gray',\n\t\tfontWeight: '500',\n\t\ttextAlign: 'center',\n\t\tfontSize: 14\n\t}\n})\n"]}
@@ -1,2 +0,0 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";import _extends from"@babel/runtime/helpers/extends";var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/Chat-Old/index.tsx";function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly)symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;});keys.push.apply(keys,symbols);}return keys;}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};if(i%2){ownKeys(Object(source),true).forEach(function(key){_defineProperty(target,key,source[key]);});}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source));}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key));});}}return target;}import React,{useMemo,useRef,useEffect,useCallback}from'react';import{SafeAreaView,View,StyleSheet,Animated}from'react-native';import{Transitioning,Transition}from'react-native-reanimated';import Message from'./Message';import Composer from'./Composer';import SystemMessage from'./SystemMessage';function Chat(props,ref){var inputRef=useRef();var flatListRef=useRef();var componentRef=useRef();if(!componentRef.current){componentRef.current={focusInput:function focusInput(){return inputRef.current&&inputRef.current.focus();},blurInput:function blurInput(){return inputRef.current&&inputRef.current.blur();},scrollToEnd:function scrollToEnd(){return flatListRef.current&&flatListRef.current.scrollToEnd();},scrollToIndex:function scrollToIndex(params){return flatListRef.current&&flatListRef.current.scrollToIndex(params);},scrollToItem:function scrollToItem(params){return flatListRef.current&&flatListRef.current.scrollToItem(params);},scrollToOffset:function scrollToOffset(params){return flatListRef.current&&flatListRef.current.scrollToOffset(params);}};if(ref)ref.current=componentRef.current;}var transitionRef=useRef(null);var mounted=useRef(false);var scrollY=useMemo(function(){return props.animatedScrollNode||new Animated.Value(0);},[props.animatedScrollNode]);var onScroll=Animated.event([{nativeEvent:{contentOffset:{y:scrollY}}}],{useNativeDriver:true});useEffect(function(){if(flatListRef.current){var iSentLastMessage=props.messages[0]&&props.messages[0].user&&props.messages[0].user.id===props.user.id;if(iSentLastMessage&&!props.disableScrollToBottomOnSend)flatListRef.current.scrollToOffset({offset:0});else if(props.scrollToBottomOnAllNewMessages)flatListRef.current.scrollToOffset({offset:0});}},[props.disableScrollToBottomOnSend,props.scrollToBottomOnAllNewMessages,props.messages,props.user.id]);var onViewableItemsChangedRef=useRef(props.onViewableItemsChanged);var onViewMessagesRef=useRef(props.onViewMessages);var messagesRef=useRef(props.messages);useEffect(function(){onViewableItemsChangedRef.current=props.onViewableItemsChanged;onViewMessagesRef.current=props.onViewMessages;messagesRef.current=props.messages;},[props.onViewableItemsChanged,props.onViewMessages,props.messages]);var onViewableItemsChanged=useCallback(function(info){if(onViewableItemsChangedRef.current)onViewableItemsChangedRef.current(info);if(onViewMessagesRef.current){var visibleMessages=info.viewableItems.filter(function(i){return i.isViewable;}).map(function(i){return i.item;});var latestMessageId=messagesRef.current&&messagesRef.current[0]&&messagesRef.current[0].id;onViewMessagesRef.current({visibleMessages:visibleMessages,latestMessageId:latestMessageId});}},[]);useEffect(function(){if(!props.disableTransitions&&(mounted.current||!props.disableTransitionOnMount)&&transitionRef.current)transitionRef.current.animateNextTransition();else mounted.current=true;},[props.disableTransitionOnMount,props.namesOfUsersTyping,props.messages,props.disableTransitions]);var renderItem=function renderItem(info){if(props.renderItem)return props.renderItem(info);if(props.renderMessage===null)return null;var message=info.item,index=info.index;if(message.system){var systemProps={text:message.text,createdAt:message.createdAt,textStyle:props.systemMessageTextStyle,containerStyle:props.systemMessageContainerStyle,dateToStringFunc:props.systemMessageDateToStringFunc,dateStyle:props.systemMessageDateStyle};if(props.renderSystemMessage===null)return null;if(props.renderSystemMessage)return props.renderSystemMessage(systemProps);return React.createElement(SystemMessage,_extends({},systemProps,{__source:{fileName:_jsxFileName,lineNumber:174}}));}var isMe=message.user.id===props.user.id;var messageCreatesNewBunch=!(props.messages[index+1]&&props.messages[index+1].user&&props.messages[index+1].user.id===(props.user&&props.user.id));var showName=!isMe&&messageCreatesNewBunch;var showAvatar=props.showAvatarForEveryMessage||messageCreatesNewBunch;if(isMe&&props.hideMyAvatar)showAvatar=false;var bubbleStyle=props.bubbleStyle&&props.bubbleStyle[isMe?'me':'others'];var messageContainerStyle=props.messageContainerStyle&&props.messageContainerStyle[isMe?'me':'others'];var bubbleTextStyle=props.bubbleTextStyle&&props.bubbleTextStyle[isMe?'me':'others'];var messageWrapperStyle=props.messageWrapperStyle&&props.messageWrapperStyle[isMe?'me':'others'];var messageProps={messageContainerStyle:messageContainerStyle,bubbleStyle:bubbleStyle,bubbleTextStyle:bubbleTextStyle,messageWrapperStyle:messageWrapperStyle,delivered:true,isMe:message.user.id===props.user.id,renderFooter:props.renderMessageFooter,imageProps:props.imageProps,media:message.media,name:message.user.name,system:message.system,text:message.text,read:true,renderMedia:props.renderMessageMedia,onLongPress:props.onLongPressMessage,onPress:props.onPressMessage,pressType:props.messagePressType||'double',doubleTapDelay:props.messageDoubleTapDelay,disableSwipeActions:props.disableSwipeActions,swipeActions:props.swipeActions,longPressDelay:props.messageLongPressDelay,id:message.id,showName:showName,avatar:message.user.avatar,avatarImageProps:props.avatarImageProps,avatarSize:props.avatarSize,renderAvatar:props.renderAvatar,showAvatar:showAvatar,initialsBackgroundColor:props.initialsBackgroundColor,initialsTextColor:props.initialsTextColor,renderInitials:props.renderInitials};if(props.renderMessage)return props.renderMessage(messageProps);return React.createElement(Message,_extends({},messageProps,{__source:{fileName:_jsxFileName,lineNumber:240}}));};var keyExtractor=useMemo(function(){return props.keyExtractor||function(_ref){var id=_ref.id;return id;};},[props.keyExtractor]);var renderList=function renderList(){return React.createElement(Animated.FlatList,_extends({},props.flatListProps,{ref:flatListRef,data:props.messages,keyExtractor:keyExtractor,renderItem:renderItem,extraData:props.extraData,ListHeaderComponent:props.ListFooterComponent,inverted:true,onScroll:onScroll,onViewableItemsChanged:onViewableItemsChanged,keyboardShouldPeristTaps:props.keyboardShouldPersistTaps||'handled',keyboardDismissMode:props.keyboardDismissMode||'interactive',contentContainerStyle:_objectSpread({},styles.contentContainer,{},props.contentContainerStyle||{}),__source:{fileName:_jsxFileName,lineNumber:250}}));};var renderHeader=function renderHeader(){if(props.renderHeader)return props.renderHeader();return null;};var renderFooter=function renderFooter(){if(props.renderFooter)return props.renderFooter();return null;};var renderComposer=function renderComposer(){if(props.renderComposer===null)return null;var composerProps={onInputTextChanged:props.onInputTextChanged,text:props.text,initialText:props.initialText,placeholderColor:props.placeholderColor,placeholderText:props.placeholderText,renderSendButton:props.renderSendButton,renderTextInput:props.renderTextInput,textInputProps:props.textInputProps,media:props.media,onChangeMedia:props.onChangeMedia,user:props.user,onSend:props.onSend,sendButtonMode:props.sendButtonMode,containerStyle:props.composerContainerStyle,inputContainerStyle:props.inputContainerStyle,inputStyle:props.inputStyle,tintColor:props.tintColor,inputRef:inputRef};if(props.renderComposer)return props.renderComposer(composerProps);return React.createElement(Composer,_extends({},composerProps,{__source:{fileName:_jsxFileName,lineNumber:303}}));};var Container=props.ContainerComponent||(props.safeArea?SafeAreaView:View);var transition=useMemo(function(){return props.transitionConfig||React.createElement(Transition.Sequence,{__source:{fileName:_jsxFileName,lineNumber:314}},React.createElement(Transition.Together,{__source:{fileName:_jsxFileName,lineNumber:315}},React.createElement(Transition.Out,{type:"fade",__source:{fileName:_jsxFileName,lineNumber:316}}),React.createElement(Transition.Change,{interpolation:"easeOut",__source:{fileName:_jsxFileName,lineNumber:317}})),React.createElement(Transition.In,{type:"fade",__source:{fileName:_jsxFileName,lineNumber:319}}));},[props.transitionConfig]);var containerStyle=useMemo(function(){return _objectSpread({},styles.container,{},props.containerStyle);},[props.containerStyle]);return React.createElement(Transitioning.View,{ref:transitionRef,transition:transition,style:containerStyle,__source:{fileName:_jsxFileName,lineNumber:332}},React.createElement(Container,{style:containerStyle,__source:{fileName:_jsxFileName,lineNumber:337}},renderHeader(),renderList(),renderFooter(),renderComposer()));}export default Chat;var styles=StyleSheet.create({container:{flex:1},contentContainer:{flexGrow:1}});
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","useMemo","useRef","useEffect","useCallback","SafeAreaView","View","StyleSheet","Animated","Transitioning","Transition","Message","Composer","SystemMessage","Chat","props","ref","inputRef","flatListRef","componentRef","current","focusInput","focus","blurInput","blur","scrollToEnd","scrollToIndex","params","scrollToItem","scrollToOffset","transitionRef","mounted","scrollY","animatedScrollNode","Value","onScroll","event","nativeEvent","contentOffset","y","useNativeDriver","iSentLastMessage","messages","user","id","disableScrollToBottomOnSend","offset","scrollToBottomOnAllNewMessages","onViewableItemsChangedRef","onViewableItemsChanged","onViewMessagesRef","onViewMessages","messagesRef","info","visibleMessages","viewableItems","filter","i","isViewable","map","item","latestMessageId","disableTransitions","disableTransitionOnMount","animateNextTransition","namesOfUsersTyping","renderItem","renderMessage","message","index","system","systemProps","text","createdAt","textStyle","systemMessageTextStyle","containerStyle","systemMessageContainerStyle","dateToStringFunc","systemMessageDateToStringFunc","dateStyle","systemMessageDateStyle","renderSystemMessage","isMe","messageCreatesNewBunch","showName","showAvatar","showAvatarForEveryMessage","hideMyAvatar","bubbleStyle","messageContainerStyle","bubbleTextStyle","messageWrapperStyle","messageProps","delivered","renderFooter","renderMessageFooter","imageProps","media","name","read","renderMedia","renderMessageMedia","onLongPress","onLongPressMessage","onPress","onPressMessage","pressType","messagePressType","doubleTapDelay","messageDoubleTapDelay","disableSwipeActions","swipeActions","longPressDelay","messageLongPressDelay","avatar","avatarImageProps","avatarSize","renderAvatar","initialsBackgroundColor","initialsTextColor","renderInitials","keyExtractor","renderList","flatListProps","extraData","ListFooterComponent","keyboardShouldPersistTaps","keyboardDismissMode","styles","contentContainer","contentContainerStyle","renderHeader","renderComposer","composerProps","onInputTextChanged","initialText","placeholderColor","placeholderText","renderSendButton","renderTextInput","textInputProps","onChangeMedia","onSend","sendButtonMode","composerContainerStyle","inputContainerStyle","inputStyle","tintColor","Container","ContainerComponent","safeArea","transition","transitionConfig","container","create","flex","flexGrow"],"mappings":"0/BAAA,MAAOA,CAAAA,KAAP,EACCC,OADD,CAECC,MAFD,CAGCC,SAHD,CAICC,WAJD,KAMO,OANP,CAOA,OAGCC,YAHD,CAICC,IAJD,CAKCC,UALD,CAMCC,QAND,KASO,cATP,CAUA,OACCC,aADD,CAECC,UAFD,KAIO,yBAJP,CAKA,MAAOC,CAAAA,OAAP,KAAoB,WAApB,CASA,MAAOC,CAA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CAAE,CACVE,IAAI,CAAE,CADI,CADqB,CAIhC1B,gBAAgB,CAAE,CACjB2B,QAAQ,CAAE,CADO,CAJc,CAAlB,CAAf","sourcesContent":["import React, {\n\tuseMemo,\n\tuseRef,\n\tuseEffect,\n\tuseCallback,\n\tMutableRefObject\n} from 'react'\nimport {\n\tFlatList,\n\tListRenderItemInfo,\n\tSafeAreaView,\n\tView,\n\tStyleSheet,\n\tAnimated,\n\tViewToken,\n\tTextInput\n} from 'react-native'\nimport {\n\tTransitioning,\n\tTransition,\n\tTransitioningView\n} from 'react-native-reanimated'\nimport Message from './Message'\nimport {\n\tChatProps,\n\tMessageProps,\n\tComposerProps,\n\tSystemMessageProps,\n\tChatRef\n} from './types'\nimport { NewMessageModel } from '../../classes/Message/types'\nimport Composer from './Composer'\nimport SystemMessage from './SystemMessage'\n\nfunction Chat<MessageModel extends NewMessageModel = NewMessageModel>(\n\tprops: ChatProps<MessageModel>,\n\tref: MutableRefObject<ChatRef<MessageModel>>\n) {\n\t// \"constructor\" variables\n\n\tconst inputRef = useRef<TextInput>()\n\tconst flatListRef = useRef<FlatList<MessageModel>>()\n\tconst componentRef = useRef<ChatRef<MessageModel>>()\n\n\tif (!componentRef.current) {\n\t\tcomponentRef.current = {\n\t\t\tfocusInput: () => inputRef.current && inputRef.current.focus(),\n\t\t\tblurInput: () => inputRef.current && inputRef.current.blur(),\n\t\t\tscrollToEnd: () =>\n\t\t\t\tflatListRef.current && flatListRef.current.scrollToEnd(),\n\t\t\tscrollToIndex: params =>\n\t\t\t\tflatListRef.current && flatListRef.current.scrollToIndex(params),\n\t\t\tscrollToItem: params =>\n\t\t\t\tflatListRef.current && flatListRef.current.scrollToItem(params),\n\t\t\tscrollToOffset: params =>\n\t\t\t\tflatListRef.current && flatListRef.current.scrollToOffset(params)\n\t\t}\n\t\tif (ref) ref.current = componentRef.current\n\t}\n\n\t// used to shuffle/transition the inbox when it changes\n\tconst transitionRef = useRef<TransitioningView>(null)\n\tconst mounted = useRef(false)\n\n\t// track animated position of scroll\n\tconst scrollY: Animated.Value = useMemo(\n\t\t() => props.animatedScrollNode || new Animated.Value(0),\n\t\t[props.animatedScrollNode]\n\t)\n\n\t// upate position of scroll variable\n\tconst onScroll = Animated.event(\n\t\t[{ nativeEvent: { contentOffset: { y: scrollY } } }],\n\t\t{ useNativeDriver: true }\n\t)\n\n\t// effect to handle new messages coming in / scrolling to bottom\n\t// TODO we may have to use getNode() for the animated flatlist, right?\n\tuseEffect(() => {\n\t\tif (flatListRef.current) {\n\t\t\tconst iSentLastMessage =\n\t\t\t\tprops.messages[0] &&\n\t\t\t\tprops.messages[0].user &&\n\t\t\t\tprops.messages[0].user.id === props.user.id\n\t\t\tif (iSentLastMessage && !props.disableScrollToBottomOnSend)\n\t\t\t\tflatListRef.current.scrollToOffset({ offset: 0 })\n\t\t\telse if (props.scrollToBottomOnAllNewMessages)\n\t\t\t\tflatListRef.current.scrollToOffset({ offset: 0 })\n\t\t}\n\t}, [\n\t\tprops.disableScrollToBottomOnSend,\n\t\tprops.scrollToBottomOnAllNewMessages,\n\t\tprops.messages,\n\t\tprops.user.id\n\t])\n\n\t// 💩 a super way of handling viewable items not on the fly. (easy way to track viewed messages)\n\t// TODO abstract this to a different custom hook.\n\tconst onViewableItemsChangedRef = useRef(props.onViewableItemsChanged)\n\tconst onViewMessagesRef = useRef(props.onViewMessages)\n\tconst messagesRef = useRef(props.messages)\n\t// ...onto the effect 😅\n\tuseEffect(() => {\n\t\t// make updated methods available to onviewable items changed\n\t\tonViewableItemsChangedRef.current = props.onViewableItemsChanged\n\t\tonViewMessagesRef.current = props.onViewMessages\n\t\tmessagesRef.current = props.messages\n\t}, [props.onViewableItemsChanged, props.onViewMessages, props.messages])\n\n\tconst onViewableItemsChanged: FlatList<\n\t\tMessageModel\n\t>['props']['onViewableItemsChanged'] = useCallback(\n\t\t(info: { viewableItems: ViewToken[]; changed: ViewToken[] }) => {\n\t\t\tif (onViewableItemsChangedRef.current)\n\t\t\t\tonViewableItemsChangedRef.current(info)\n\n\t\t\tif (onViewMessagesRef.current) {\n\t\t\t\tconst visibleMessages = info.viewableItems\n\t\t\t\t\t.filter(i => i.isViewable)\n\t\t\t\t\t.map(i => i.item)\n\t\t\t\tconst latestMessageId =\n\t\t\t\t\tmessagesRef.current &&\n\t\t\t\t\tmessagesRef.current[0] &&\n\t\t\t\t\tmessagesRef.current[0].id\n\t\t\t\tonViewMessagesRef.current({\n\t\t\t\t\tvisibleMessages,\n\t\t\t\t\tlatestMessageId\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\t\t[]\n\t)\n\t// END OF THAT 💩\n\n\t// effect to handle animating the screen if the messages changed or people typing just changed\n\tuseEffect(() => {\n\t\tif (\n\t\t\t!props.disableTransitions &&\n\t\t\t// if we've already mounted, or we want to transition even if we haven't...\n\t\t\t(mounted.current || !props.disableTransitionOnMount) &&\n\t\t\t// and assuming the transition component is initialized...\n\t\t\ttransitionRef.current\n\t\t)\n\t\t\t// animate\n\t\t\ttransitionRef.current.animateNextTransition()\n\t\telse mounted.current = true\n\t}, [\n\t\tprops.disableTransitionOnMount,\n\t\tprops.namesOfUsersTyping,\n\t\tprops.messages,\n\t\tprops.disableTransitions\n\t])\n\n\tconst renderItem = (info: ListRenderItemInfo<MessageModel>) => {\n\t\tif (props.renderItem) return props.renderItem(info)\n\t\tif (props.renderMessage === null) return null\n\n\t\tconst { item: message, index } = info\n\n\t\tif (message.system) {\n\t\t\tconst systemProps: SystemMessageProps = {\n\t\t\t\ttext: message.text,\n\t\t\t\tcreatedAt: message.createdAt,\n\t\t\t\ttextStyle: props.systemMessageTextStyle,\n\t\t\t\tcontainerStyle: props.systemMessageContainerStyle,\n\t\t\t\tdateToStringFunc: props.systemMessageDateToStringFunc,\n\t\t\t\tdateStyle: props.systemMessageDateStyle\n\t\t\t}\n\n\t\t\tif (props.renderSystemMessage === null) return null\n\t\t\tif (props.renderSystemMessage)\n\t\t\t\treturn props.renderSystemMessage(systemProps)\n\n\t\t\treturn <SystemMessage {...systemProps} />\n\t\t}\n\n\t\tconst isMe = message.user.id === props.user.id\n\n\t\t// indicates that the previous message was sent by someone else, so this starts a new bunch\n\t\tconst messageCreatesNewBunch = !(\n\t\t\tprops.messages[index + 1] &&\n\t\t\tprops.messages[index + 1].user &&\n\t\t\tprops.messages[index + 1].user.id === (props.user && props.user.id)\n\t\t)\n\n\t\t// show name if the previous message was sent by someone else\n\t\tconst showName = !isMe && messageCreatesNewBunch\n\n\t\t// by default, only show avatar for a the bottom of a bunch\n\t\tlet showAvatar = props.showAvatarForEveryMessage || messageCreatesNewBunch\n\t\t// and we hide the avatar if we say to\n\t\tif (isMe && props.hideMyAvatar) showAvatar = false\n\n\t\tconst bubbleStyle =\n\t\t\tprops.bubbleStyle && props.bubbleStyle[isMe ? 'me' : 'others']\n\t\tconst messageContainerStyle =\n\t\t\tprops.messageContainerStyle &&\n\t\t\tprops.messageContainerStyle[isMe ? 'me' : 'others']\n\t\tconst bubbleTextStyle =\n\t\t\tprops.bubbleTextStyle && props.bubbleTextStyle[isMe ? 'me' : 'others']\n\t\tconst messageWrapperStyle =\n\t\t\tprops.messageWrapperStyle &&\n\t\t\tprops.messageWrapperStyle[isMe ? 'me' : 'others']\n\n\t\tconst messageProps: MessageProps = {\n\t\t\tmessageContainerStyle,\n\t\t\tbubbleStyle,\n\t\t\tbubbleTextStyle,\n\t\t\tmessageWrapperStyle,\n\t\t\tdelivered: true,\n\t\t\tisMe: message.user.id === props.user.id,\n\t\t\trenderFooter: props.renderMessageFooter,\n\t\t\timageProps: props.imageProps,\n\t\t\tmedia: message.media,\n\t\t\tname: message.user.name,\n\t\t\tsystem: message.system,\n\t\t\ttext: message.text,\n\t\t\tread: true,\n\t\t\trenderMedia: props.renderMessageMedia,\n\t\t\tonLongPress: props.onLongPressMessage,\n\t\t\tonPress: props.onPressMessage,\n\t\t\tpressType: props.messagePressType || 'double',\n\t\t\tdoubleTapDelay: props.messageDoubleTapDelay,\n\t\t\tdisableSwipeActions: props.disableSwipeActions,\n\t\t\tswipeActions: props.swipeActions,\n\t\t\tlongPressDelay: props.messageLongPressDelay,\n\t\t\tid: message.id,\n\t\t\tshowName,\n\t\t\tavatar: message.user.avatar,\n\t\t\tavatarImageProps: props.avatarImageProps,\n\t\t\tavatarSize: props.avatarSize,\n\t\t\trenderAvatar: props.renderAvatar,\n\t\t\tshowAvatar,\n\t\t\tinitialsBackgroundColor: props.initialsBackgroundColor,\n\t\t\tinitialsTextColor: props.initialsTextColor,\n\t\t\trenderInitials: props.renderInitials\n\t\t}\n\n\t\tif (props.renderMessage) return props.renderMessage(messageProps)\n\t\treturn <Message {...messageProps} />\n\t}\n\n\tconst keyExtractor = useMemo(\n\t\t() => props.keyExtractor || (({ id }: MessageModel) => id),\n\t\t[props.keyExtractor]\n\t)\n\n\tconst renderList = () => {\n\t\treturn (\n\t\t\t<Animated.FlatList\n\t\t\t\t{...props.flatListProps}\n\t\t\t\tref={flatListRef as MutableRefObject<FlatList<MessageModel>>}\n\t\t\t\tdata={props.messages}\n\t\t\t\tkeyExtractor={keyExtractor}\n\t\t\t\trenderItem={renderItem}\n\t\t\t\textraData={props.extraData}\n\t\t\t\tListHeaderComponent={props.ListFooterComponent}\n\t\t\t\tinverted\n\t\t\t\tonScroll={onScroll}\n\t\t\t\tonViewableItemsChanged={onViewableItemsChanged}\n\t\t\t\tkeyboardShouldPeristTaps={props.keyboardShouldPersistTaps || 'handled'}\n\t\t\t\tkeyboardDismissMode={props.keyboardDismissMode || 'interactive'}\n\t\t\t\tcontentContainerStyle={{\n\t\t\t\t\t...styles.contentContainer,\n\t\t\t\t\t...(props.contentContainerStyle || {})\n\t\t\t\t}}\n\t\t\t/>\n\t\t)\n\t}\n\tconst renderHeader = () => {\n\t\tif (props.renderHeader) return props.renderHeader()\n\t\treturn null\n\t}\n\tconst renderFooter = () => {\n\t\tif (props.renderFooter) return props.renderFooter()\n\t\treturn null\n\t}\n\tconst renderComposer = () => {\n\t\tif (props.renderComposer === null) return null\n\n\t\tconst composerProps: ComposerProps = {\n\t\t\tonInputTextChanged: props.onInputTextChanged,\n\t\t\ttext: props.text,\n\t\t\tinitialText: props.initialText,\n\t\t\tplaceholderColor: props.placeholderColor,\n\t\t\tplaceholderText: props.placeholderText,\n\t\t\trenderSendButton: props.renderSendButton,\n\t\t\trenderTextInput: props.renderTextInput,\n\t\t\ttextInputProps: props.textInputProps,\n\t\t\tmedia: props.media,\n\t\t\tonChangeMedia: props.onChangeMedia,\n\t\t\tuser: props.user,\n\t\t\tonSend: props.onSend,\n\t\t\tsendButtonMode: props.sendButtonMode,\n\t\t\tcontainerStyle: props.composerContainerStyle,\n\t\t\tinputContainerStyle: props.inputContainerStyle,\n\t\t\tinputStyle: props.inputStyle,\n\t\t\ttintColor: props.tintColor,\n\t\t\tinputRef: inputRef as MutableRefObject<TextInput>\n\t\t}\n\t\tif (props.renderComposer) return props.renderComposer(composerProps)\n\n\t\treturn <Composer {...composerProps} />\n\t}\n\n\t// now, onto the actual render code\n\tconst Container =\n\t\tprops.ContainerComponent || (props.safeArea ? SafeAreaView : View)\n\n\t// reanimated transition\n\tconst transition = useMemo(\n\t\t() =>\n\t\t\tprops.transitionConfig || (\n\t\t\t\t<Transition.Sequence>\n\t\t\t\t\t<Transition.Together>\n\t\t\t\t\t\t<Transition.Out type=\"fade\" />\n\t\t\t\t\t\t<Transition.Change interpolation=\"easeOut\" />\n\t\t\t\t\t</Transition.Together>\n\t\t\t\t\t<Transition.In type=\"fade\" />\n\t\t\t\t</Transition.Sequence>\n\t\t\t),\n\t\t[props.transitionConfig]\n\t)\n\tconst containerStyle = useMemo(\n\t\t() => ({\n\t\t\t...styles.container,\n\t\t\t...props.containerStyle\n\t\t}),\n\t\t[props.containerStyle]\n\t)\n\treturn (\n\t\t<Transitioning.View\n\t\t\tref={transitionRef}\n\t\t\ttransition={transition}\n\t\t\tstyle={containerStyle}\n\t\t>\n\t\t\t<Container style={containerStyle}>\n\t\t\t\t{renderHeader()}\n\t\t\t\t{renderList()}\n\t\t\t\t{renderFooter()}\n\t\t\t\t{renderComposer()}\n\t\t\t</Container>\n\t\t</Transitioning.View>\n\t)\n}\n\nexport default Chat\n\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\tflex: 1\n\t},\n\tcontentContainer: {\n\t\tflexGrow: 1\n\t}\n})\n"]}
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -1,2 +0,0 @@
1
- var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/ChatProvider/index.tsx";import React from'react';import{FuegoProvider}from'@nandorojo/fuego';import ChatContext from'../../ChatContext';import Chat from'../../classes/Chat/index';export var fuego;export var chat;export var setFuego=function setFuego(f){return fuego=f;};export var setChat=function setChat(c){return chat=c;};var Provider=function Provider(_ref){var children=_ref.children,FuegoInstance=_ref.fuego,_ref$chat=_ref.chat,ChatInstance=_ref$chat===void 0?new Chat({}):_ref$chat;setFuego(FuegoInstance);setChat(ChatInstance);return React.createElement(FuegoProvider,{fuego:fuego,__source:{fileName:_jsxFileName,lineNumber:25}},React.createElement(ChatContext.Provider,{__source:{fileName:_jsxFileName,lineNumber:26}},children));};export default Provider;
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","FuegoProvider","ChatContext","Chat","fuego","chat","setFuego","f","setChat","c","Provider","children","FuegoInstance","ChatInstance"],"mappings":"0GAAA,MAAOA,CAAAA,KAAP,KAAyC,OAAzC,CACA,OAASC,aAAT,KAAqC,kBAArC,CACA,MAAOC,CAAAA,WAAP,KAAwB,mBAAxB,CAEA,MAAOC,CAAAA,IAAP,KAAiB,0BAAjB,CAEA,MAAO,IAAIC,CAAAA,KAAJ,CACP,MAAO,IAAIC,CAAAA,IAAJ,CAGP,MAAO,IAAMC,CAAAA,QAAQ,CAAG,QAAXA,CAAAA,QAAW,CAACC,CAAD,QAAeH,CAAAA,KAAK,CAAGG,CAAvB,EAAjB,CACP,MAAO,IAAMC,CAAAA,OAAO,CAAG,QAAVA,CAAAA,OAAU,CAACC,CAAD,QAAcJ,CAAAA,IAAI,CAAGI,CAArB,EAAhB,CAEP,GAAMC,CAAAA,QAA8C,CAAG,QAAjDA,CAAAA,QAAiD,MAIjD,IAHLC,CAAAA,QAGK,MAHLA,QAGK,CAFEC,aAEF,MAFLR,KAEK,gBADLC,IACK,CADCQ,YACD,oBADgB,GAAIV,CAAAA,IAAJ,CAAS,EAAT,CAChB,WACLG,QAAQ,CAACM,aAAD,CAAR,CACAJ,OAAO,CAACK,YAAD,CAAP,CAIA,MACC,qBAAC,aAAD,EAAe,KAAK,CAAET,KAAtB,iDACC,oBAAC,WAAD,CAAa,QAAb,kDAAuBO,QAAvB,CADD,CADD,CAKA,CAfD,CAiBA,cAAeD,CAAAA,QAAf","sourcesContent":["import React, { FunctionComponent } from 'react'\nimport { FuegoProvider, Fuego } from '@nandorojo/fuego'\nimport ChatContext from '../../ChatContext'\nimport { ChatProviderProps } from './types'\nimport Chat from '../../classes/Chat/index'\n\nexport let fuego: Fuego\nexport let chat: Chat\n\n// useful for non-react projects that need to use this var too.\nexport const setFuego = (f: Fuego) => (fuego = f)\nexport const setChat = (c: Chat) => (chat = c)\n\nconst Provider: FunctionComponent<ChatProviderProps> = ({\n\tchildren,\n\tfuego: FuegoInstance,\n\tchat: ChatInstance = new Chat({})\n}) => {\n\tsetFuego(FuegoInstance)\n\tsetChat(ChatInstance)\n\t// fuego = FuegoInstance\n\t// chat = ChatInstance\n\n\treturn (\n\t\t<FuegoProvider fuego={fuego}>\n\t\t\t<ChatContext.Provider>{children}</ChatContext.Provider>\n\t\t</FuegoProvider>\n\t)\n}\n\nexport default Provider\n"]}
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -1,2 +0,0 @@
1
- var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/Inbox/Item/Circle/index.tsx";import React from'react';import{View,StyleSheet}from'react-native';var Circle=function Circle(props){var size=props.size;var height=props.height||size;var width=props.width||size;var borderWidth=props.borderWidth||0;var borderRadius=props.borderRadius||size/2;var innerSize=size-borderWidth*2;var innerBorderRadius=innerSize/2;return React.createElement(View,{style:[styles.container,{height:height,width:width,borderRadius:borderRadius,backgroundColor:props.borderColor}],__source:{fileName:_jsxFileName,lineNumber:15}},React.createElement(View,{style:[styles.wrapper,{height:innerSize,width:innerSize,borderRadius:innerBorderRadius}],__source:{fileName:_jsxFileName,lineNumber:21}},props.children));};export default Circle;var styles=StyleSheet.create({container:{justifyContent:'center',alignItems:'center'},wrapper:{overflow:'hidden'}});
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","View","StyleSheet","Circle","props","size","height","width","borderWidth","borderRadius","innerSize","innerBorderRadius","styles","container","backgroundColor","borderColor","wrapper","children","create","justifyContent","alignItems","overflow"],"mappings":"+GAAA,MAAOA,CAAAA,KAAP,KAAyC,OAAzC,CAEA,OAASC,IAAT,CAAeC,UAAf,KAAiC,cAAjC,CAEA,GAAMC,CAAAA,MAAsC,CAAG,QAAzCA,CAAAA,MAAyC,CAAAC,KAAK,CAAI,CACvD,GAAMC,CAAAA,IAAI,CAAGD,KAAK,CAACC,IAAnB,CACA,GAAMC,CAAAA,MAAM,CAAGF,KAAK,CAACE,MAAN,EAAgBD,IAA/B,CACA,GAAME,CAAAA,KAAK,CAAGH,KAAK,CAACG,KAAN,EAAeF,IAA7B,CACA,GAAMG,CAAAA,WAAW,CAAGJ,KAAK,CAACI,WAAN,EAAqB,CAAzC,CACA,GAAMC,CAAAA,YAAY,CAAGL,KAAK,CAACK,YAAN,EAAsBJ,IAAI,CAAG,CAAlD,CAEA,GAAMK,CAAAA,SAAS,CAAGL,IAAI,CAAGG,WAAW,CAAG,CAAvC,CACA,GAAMG,CAAAA,iBAAiB,CAAGD,SAAS,CAAG,CAAtC,CACA,MACC,qBAAC,IAAD,EACC,KAAK,CAAE,CACNE,MAAM,CAACC,SADD,CAEN,CAAEP,MAAM,CAANA,MAAF,CAAUC,KAAK,CAALA,KAAV,CAAiBE,YAAY,CAAZA,YAAjB,CAA+BK,eAAe,CAAEV,KAAK,CAACW,WAAtD,CAFM,CADR,iDAMC,oBAAC,IAAD,EACC,KAAK,CAAE,CACNH,MAAM,CAACI,OADD,CAEN,CACCV,MAAM,CAAEI,SADT,CAECH,KAAK,CAAEG,SAFR,CAGCD,YAAY,CAAEE,iBAHf,CAFM,CADR,iDAUEP,KAAK,CAACa,QAVR,CAND,CADD,CAqBA,CA9BD,CAgCA,cAAed,CAAAA,MAAf,CAEA,GAAMS,CAAAA,MAAM,CAAGV,UAAU,CAACgB,MAAX,CAAkB,CAChCL,SAAS,CAAE,CACVM,cAAc,CAAE,QADN,CAEVC,UAAU,CAAE,QAFF,CADqB,CAKhCJ,OAAO,CAAE,CACRK,QAAQ,CAAE,QADF,CALuB,CAAlB,CAAf","sourcesContent":["import React, { FunctionComponent } from 'react'\nimport { CircleProps } from './types'\nimport { View, StyleSheet } from 'react-native'\n\nconst Circle: FunctionComponent<CircleProps> = props => {\n\tconst size = props.size\n\tconst height = props.height || size\n\tconst width = props.width || size\n\tconst borderWidth = props.borderWidth || 0\n\tconst borderRadius = props.borderRadius || size / 2\n\n\tconst innerSize = size - borderWidth * 2\n\tconst innerBorderRadius = innerSize / 2\n\treturn (\n\t\t<View\n\t\t\tstyle={[\n\t\t\t\tstyles.container,\n\t\t\t\t{ height, width, borderRadius, backgroundColor: props.borderColor }\n\t\t\t]}\n\t\t>\n\t\t\t<View\n\t\t\t\tstyle={[\n\t\t\t\t\tstyles.wrapper,\n\t\t\t\t\t{\n\t\t\t\t\t\theight: innerSize,\n\t\t\t\t\t\twidth: innerSize,\n\t\t\t\t\t\tborderRadius: innerBorderRadius\n\t\t\t\t\t}\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{props.children}\n\t\t\t</View>\n\t\t</View>\n\t)\n}\n\nexport default Circle\n\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\tjustifyContent: 'center',\n\t\talignItems: 'center'\n\t},\n\twrapper: {\n\t\toverflow: 'hidden'\n\t}\n})\n"]}
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -1,2 +0,0 @@
1
- var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/Inbox/Item/Initials/index.tsx";import React from'react';import{Text,StyleSheet,View}from'react-native';export default React.memo(function(props){var borderRadius=props.size/2;var fontSize=props.size/2.5;return React.createElement(View,{style:[styles.container,props.containerStyle?props.containerStyle:{},props.backgroundColor?{backgroundColor:props.backgroundColor}:{},{borderRadius:borderRadius,height:props.size,width:props.size}],__source:{fileName:_jsxFileName,lineNumber:9}},React.createElement(Text,{style:[styles.text,{fontSize:fontSize},props.textStyle?props.textStyle:{},props.textColor?{color:props.textColor}:{}],__source:{fileName:_jsxFileName,lineNumber:17}},props.initials.toUpperCase()));});var styles=StyleSheet.create({container:{backgroundColor:'lightblue',alignItems:'center',justifyContent:'center'},text:{color:'white',fontWeight:'bold'}});
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","Text","StyleSheet","View","memo","props","borderRadius","size","fontSize","styles","container","containerStyle","backgroundColor","height","width","text","textStyle","textColor","color","initials","toUpperCase","create","alignItems","justifyContent","fontWeight"],"mappings":"iHAAA,MAAOA,CAAAA,KAAP,KAAkB,OAAlB,CACA,OAASC,IAAT,CAAeC,UAAf,CAA2BC,IAA3B,KAAuC,cAAvC,CAGA,cAAeH,CAAAA,KAAK,CAACI,IAAN,CAAW,SAACC,KAAD,CAA0B,CACnD,GAAMC,CAAAA,YAAY,CAAGD,KAAK,CAACE,IAAN,CAAa,CAAlC,CACA,GAAMC,CAAAA,QAAQ,CAAGH,KAAK,CAACE,IAAN,CAAa,GAA9B,CACA,MACC,qBAAC,IAAD,EACC,KAAK,CAAE,CACNE,MAAM,CAACC,SADD,CAENL,KAAK,CAACM,cAAN,CAAuBN,KAAK,CAACM,cAA7B,CAA8C,EAFxC,CAGNN,KAAK,CAACO,eAAN,CAAwB,CAAEA,eAAe,CAAEP,KAAK,CAACO,eAAzB,CAAxB,CAAqE,EAH/D,CAIN,CAAEN,YAAY,CAAZA,YAAF,CAAgBO,MAAM,CAAER,KAAK,CAACE,IAA9B,CAAoCO,KAAK,CAAET,KAAK,CAACE,IAAjD,CAJM,CADR,gDAQC,oBAAC,IAAD,EACC,KAAK,CAAE,CACNE,MAAM,CAACM,IADD,CAEN,CAAEP,QAAQ,CAARA,QAAF,CAFM,CAGNH,KAAK,CAACW,SAAN,CAAkBX,KAAK,CAACW,SAAxB,CAAoC,EAH9B,CAINX,KAAK,CAACY,SAAN,CAAkB,CAAEC,KAAK,CAAEb,KAAK,CAACY,SAAf,CAAlB,CAA+C,EAJzC,CADR,iDAQEZ,KAAK,CAACc,QAAN,CAAeC,WAAf,EARF,CARD,CADD,CAqBA,CAxBc,CAAf,CA0BA,GAAMX,CAAAA,MAAM,CAAGP,UAAU,CAACmB,MAAX,CAAkB,CAChCX,SAAS,CAAE,CACVE,eAAe,CAAE,WADP,CAEVU,UAAU,CAAE,QAFF,CAGVC,cAAc,CAAE,QAHN,CADqB,CAMhCR,IAAI,CAAE,CACLG,KAAK,CAAE,OADF,CAELM,UAAU,CAAE,MAFP,CAN0B,CAAlB,CAAf","sourcesContent":["import React from 'react'\nimport { Text, StyleSheet, View } from 'react-native'\nimport { InitialsProps } from '../../types'\n\nexport default React.memo((props: InitialsProps) => {\n\tconst borderRadius = props.size / 2\n\tconst fontSize = props.size / 2.5\n\treturn (\n\t\t<View\n\t\t\tstyle={[\n\t\t\t\tstyles.container,\n\t\t\t\tprops.containerStyle ? props.containerStyle : {},\n\t\t\t\tprops.backgroundColor ? { backgroundColor: props.backgroundColor } : {},\n\t\t\t\t{ borderRadius, height: props.size, width: props.size }\n\t\t\t]}\n\t\t>\n\t\t\t<Text\n\t\t\t\tstyle={[\n\t\t\t\t\tstyles.text,\n\t\t\t\t\t{ fontSize },\n\t\t\t\t\tprops.textStyle ? props.textStyle : {},\n\t\t\t\t\tprops.textColor ? { color: props.textColor } : {}\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{props.initials.toUpperCase()}\n\t\t\t</Text>\n\t\t</View>\n\t)\n})\n\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\tbackgroundColor: 'lightblue',\n\t\talignItems: 'center',\n\t\tjustifyContent: 'center'\n\t},\n\ttext: {\n\t\tcolor: 'white',\n\t\tfontWeight: 'bold'\n\t}\n})\n"]}
@@ -1,2 +0,0 @@
1
- var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/Inbox/Item/ItemDate/index.tsx";import React from'react';import{Text,StyleSheet}from'react-native';import moment from'moment';export default(function(props){var text=props.dateToStringFunc?props.dateToStringFunc(props.date):moment(props.date).calendar(undefined,{lastDay:'[Yesterday]',sameDay:'LT',nextDay:'[Tomorrow at] LT',lastWeek:'dddd',nextWeek:'[Next] dddd',sameElse:'L'});return React.createElement(Text,{style:[styles.text,props.style],__source:{fileName:_jsxFileName,lineNumber:18}},text);});var styles=StyleSheet.create({text:{color:'gray',paddingLeft:5}});
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","Text","StyleSheet","moment","props","text","dateToStringFunc","date","calendar","undefined","lastDay","sameDay","nextDay","lastWeek","nextWeek","sameElse","styles","style","create","color","paddingLeft"],"mappings":"iHAAA,MAAOA,CAAAA,KAAP,KAAkB,OAAlB,CACA,OAASC,IAAT,CAAeC,UAAf,KAAiC,cAAjC,CACA,MAAOC,CAAAA,MAAP,KAAmB,QAAnB,CAGA,eAAe,SAACC,KAAD,CAAsB,CACpC,GAAMC,CAAAA,IAAI,CAAGD,KAAK,CAACE,gBAAN,CACVF,KAAK,CAACE,gBAAN,CAAuBF,KAAK,CAACG,IAA7B,CADU,CAEVJ,MAAM,CAACC,KAAK,CAACG,IAAP,CAAN,CAAmBC,QAAnB,CAA4BC,SAA5B,CAAuC,CACvCC,OAAO,CAAE,aAD8B,CAEvCC,OAAO,CAAE,IAF8B,CAGvCC,OAAO,CAAE,kBAH8B,CAIvCC,QAAQ,CAAE,MAJ6B,CAKvCC,QAAQ,CAAE,aAL6B,CAMvCC,QAAQ,CAAE,GAN6B,CAAvC,CAFH,CAWA,MAAO,qBAAC,IAAD,EAAM,KAAK,CAAE,CAACC,MAAM,CAACX,IAAR,CAAcD,KAAK,CAACa,KAApB,CAAb,iDAA0CZ,IAA1C,CAAP,CACA,CAbD,EAeA,GAAMW,CAAAA,MAAM,CAAGd,UAAU,CAACgB,MAAX,CAAkB,CAChCb,IAAI,CAAE,CACLc,KAAK,CAAE,MADF,CAELC,WAAW,CAAE,CAFR,CAD0B,CAAlB,CAAf","sourcesContent":["import React from 'react'\nimport { Text, StyleSheet } from 'react-native'\nimport moment from 'moment'\nimport { DateProps } from '../../types'\n\nexport default (props: DateProps) => {\n\tconst text = props.dateToStringFunc\n\t\t? props.dateToStringFunc(props.date)\n\t\t: moment(props.date).calendar(undefined, {\n\t\t\t\tlastDay: '[Yesterday]',\n\t\t\t\tsameDay: 'LT',\n\t\t\t\tnextDay: '[Tomorrow at] LT',\n\t\t\t\tlastWeek: 'dddd',\n\t\t\t\tnextWeek: '[Next] dddd',\n\t\t\t\tsameElse: 'L'\n\t\t })\n\n\treturn <Text style={[styles.text, props.style]}>{text}</Text>\n}\n\nconst styles = StyleSheet.create({\n\ttext: {\n\t\tcolor: 'gray',\n\t\tpaddingLeft: 5\n\t}\n})\n"]}
@@ -1,2 +0,0 @@
1
- var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/Inbox/Item/Separator/index.tsx";import React from'react';import{View}from'react-native';export default(function(props){return React.createElement(View,{style:{backgroundColor:props.color||'lightgray',height:props.size||0.75},__source:{fileName:_jsxFileName,lineNumber:6}});});
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","View","props","backgroundColor","color","height","size"],"mappings":"kHAAA,MAAOA,CAAAA,KAAP,KAAkB,OAAlB,CACA,OAASC,IAAT,KAAqB,cAArB,CAEA,eAAe,SAACC,KAAD,CAA8C,CAC5D,MACC,qBAAC,IAAD,EACC,KAAK,CAAE,CACNC,eAAe,CAAED,KAAK,CAACE,KAAN,EAAe,WAD1B,CAENC,MAAM,CAAEH,KAAK,CAACI,IAAN,EAAc,IAFhB,CADR,gDADD,CAQA,CATD","sourcesContent":["import React from 'react'\nimport { View } from 'react-native'\n\nexport default (props: { color?: string; size?: number }) => {\n\treturn (\n\t\t<View\n\t\t\tstyle={{\n\t\t\t\tbackgroundColor: props.color || 'lightgray',\n\t\t\t\theight: props.size || 0.75\n\t\t\t}}\n\t\t/>\n\t)\n}\n"]}
@@ -1,2 +0,0 @@
1
- var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/Inbox/Item/Subtitle/index.tsx";import React from'react';import{Text,StyleSheet}from'react-native';export default function(props){var lastMessageText=props.lastMessageText,_props$textStyle=props.textStyle,textStyle=_props$textStyle===void 0?{}:_props$textStyle;return React.createElement(Text,{style:[styles.text,textStyle],numberOfLines:2,ellipsizeMode:'tail',__source:{fileName:_jsxFileName,lineNumber:8}},lastMessageText);}var styles=StyleSheet.create({text:{color:'gray',marginTop:5}});
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","Text","StyleSheet","props","lastMessageText","textStyle","styles","text","create","color","marginTop"],"mappings":"iHAAA,MAAOA,CAAAA,KAAP,KAAkB,OAAlB,CACA,OAASC,IAAT,CAAeC,UAAf,KAAiC,cAAjC,CAGA,cAAe,UAASC,KAAT,CAAwC,IAC9CC,CAAAA,eAD8C,CACVD,KADU,CAC9CC,eAD8C,kBACVD,KADU,CAC7BE,SAD6B,CAC7BA,SAD6B,2BACjB,EADiB,kBAEtD,MACC,qBAAC,IAAD,EACC,KAAK,CAAE,CAACC,MAAM,CAACC,IAAR,CAAcF,SAAd,CADR,CAEC,aAAa,CAAE,CAFhB,CAGC,aAAa,CAAE,MAHhB,gDAKED,eALF,CADD,CASA,CAED,GAAME,CAAAA,MAAM,CAAGJ,UAAU,CAACM,MAAX,CAAkB,CAChCD,IAAI,CAAE,CACLE,KAAK,CAAE,MADF,CAELC,SAAS,CAAE,CAFN,CAD0B,CAAlB,CAAf","sourcesContent":["import React from 'react'\nimport { Text, StyleSheet } from 'react-native'\nimport { InboxItemSubtitleProps } from '../../types'\n\nexport default function(props: InboxItemSubtitleProps) {\n\tconst { lastMessageText, textStyle = {} } = props\n\treturn (\n\t\t<Text\n\t\t\tstyle={[styles.text, textStyle]}\n\t\t\tnumberOfLines={2}\n\t\t\tellipsizeMode={'tail'}\n\t\t>\n\t\t\t{lastMessageText}\n\t\t</Text>\n\t)\n}\n\nconst styles = StyleSheet.create({\n\ttext: {\n\t\tcolor: 'gray',\n\t\tmarginTop: 5\n\t}\n})\n"]}
@@ -1,2 +0,0 @@
1
- import _extends from"@babel/runtime/helpers/extends";var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/Inbox/Item/Swipeable/index.tsx";import React,{useRef}from'react';import Swipes from'react-native-gesture-handler/Swipeable';import{Animated,Text,View,StyleSheet}from'react-native';import{RectButton}from'react-native-gesture-handler';var Swipeable=function Swipeable(props){var actionItemWidth=props.actionWidth||64;var swipeableRowRef=useRef(null);function renderAction(action,index,progress,drag,side,numberOfActions){if(props.renderAction)return props.renderAction(action,index,progress,drag,side);if(props.renderAction===null)return null;var outputRange=side==='right'?[(numberOfActions-index)*actionItemWidth,0]:[-index*actionItemWidth,0];var translateX=progress.interpolate({inputRange:[0,1],outputRange:outputRange});function onPress(){if(swipeableRowRef.current)swipeableRowRef.current.close();if(action.onPress)action.onPress(props.id);}return React.createElement(Animated.View,{key:JSON.stringify(action+(""+Math.random())),style:{flex:1,transform:[{translateX:translateX}]},__source:{fileName:_jsxFileName,lineNumber:39}},React.createElement(RectButton,{style:[styles.action,{backgroundColor:action.backgroundColor}],onPress:onPress,__source:{fileName:_jsxFileName,lineNumber:43}},action.renderIcon&&action.renderIcon(progress,drag),React.createElement(Text,{style:[styles.actionText,{color:action.color},props.textStyle],__source:{fileName:_jsxFileName,lineNumber:48}},action.text)));}function renderRightActions(progress,drag){var actions=props.rightActions||[];if(props.renderRightActions)return props.renderRightActions(actions,progress,drag);if(props.renderRightActions===null)return null;return renderActionList(actions,progress,drag,'right');}function renderLeftActions(progress,drag){var actions=props.leftActions||[];if(props.renderLeftActions)return props.renderLeftActions(actions,progress,drag);if(props.renderLeftActions===null)return null;return renderActionList(actions,progress,drag,'left');}function renderActionList(actions,progress,drag,side){return React.createElement(View,{style:[styles.actionList,{width:actionItemWidth*actions.length}],__source:{fileName:_jsxFileName,lineNumber:102}},actions.map(function(action,index){return renderAction(action,index,progress,drag,side,actions.length);}));}return React.createElement(Swipes,_extends({friction:2,leftThreshold:30,rightThreshold:40,renderLeftActions:renderLeftActions,renderRightActions:renderRightActions,ref:swipeableRowRef},props.gestureHandlerProps||{},{__source:{fileName:_jsxFileName,lineNumber:112}}),props.children);};export default React.memo(Swipeable);var styles=StyleSheet.create({actionList:{flexDirection:'row'},action:{alignItems:'center',justifyContent:'center',flex:1},actionText:{padding:10}});
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","useRef","Swipes","Animated","Text","View","StyleSheet","RectButton","Swipeable","props","actionItemWidth","actionWidth","swipeableRowRef","renderAction","action","index","progress","drag","side","numberOfActions","outputRange","translateX","interpolate","inputRange","onPress","current","close","id","JSON","stringify","Math","random","flex","transform","styles","backgroundColor","renderIcon","actionText","color","textStyle","text","renderRightActions","actions","rightActions","renderActionList","renderLeftActions","leftActions","actionList","width","length","map","gestureHandlerProps","children","memo","create","flexDirection","alignItems","justifyContent","padding"],"mappings":"uKAAA,MAAOA,CAAAA,KAAP,EAAmCC,MAAnC,KAAiD,OAAjD,CACA,MAAOC,CAAAA,MAAP,KAAmB,wCAAnB,CACA,OAASC,QAAT,CAAmBC,IAAnB,CAAyBC,IAAzB,CAA+BC,UAA/B,KAAiD,cAAjD,CAEA,OAASC,UAAT,KAA2B,8BAA3B,CAEA,GAAMC,CAAAA,SAA4C,CAAG,QAA/CA,CAAAA,SAA+C,CAAAC,KAAK,CAAI,CAC7D,GAAMC,CAAAA,eAAe,CAAGD,KAAK,CAACE,WAAN,EAAqB,EAA7C,CACA,GAAMC,CAAAA,eAAe,CAAGX,MAAM,CAAS,IAAT,CAA9B,CAEA,QAASY,CAAAA,YAAT,CACCC,MADD,CAECC,KAFD,CAGCC,QAHD,CAICC,IAJD,CAKCC,IALD,CAMCC,eAND,CAOE,CACD,GAAIV,KAAK,CAACI,YAAV,CACC,MAAOJ,CAAAA,KAAK,CAACI,YAAN,CAAmBC,MAAnB,CAA2BC,KAA3B,CAAkCC,QAAlC,CAA4CC,IAA5C,CAAkDC,IAAlD,CAAP,CACD,GAAIT,KAAK,CAACI,YAAN,GAAuB,IAA3B,CAAiC,MAAO,KAAP,CAEjC,GAAMO,CAAAA,WAAW,CAChBF,IAAI,GAAK,OAAT,CACG,CAAC,CAACC,eAAe,CAAGJ,KAAnB,EAA4BL,eAA7B,CAA8C,CAA9C,CADH,CAEG,CAAC,CAACK,KAAD,CAASL,eAAV,CAA2B,CAA3B,CAHJ,CAKA,GAAMW,CAAAA,UAAU,CAAGL,QAAQ,CAACM,WAAT,CAAqB,CACvCC,UAAU,CAAE,CAAC,CAAD,CAAI,CAAJ,CAD2B,CAEvCH,WAAW,CAAXA,WAFuC,CAArB,CAAnB,CAKA,QAASI,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AN,CAAW7C,SAAX,CAAf,CAKA,GAAM0B,CAAAA,MAAM,CAAG5B,UAAU,CAACgD,MAAX,CAAkB,CAChCP,UAAU,CAAE,CACXQ,aAAa,CAAE,KADJ,CADoB,CAIhCzC,MAAM,CAAE,CACP0C,UAAU,CAAE,QADL,CAEPC,cAAc,CAAE,QAFT,CAGPzB,IAAI,CAAE,CAHC,CAJwB,CAShCK,UAAU,CAAE,CACXqB,OAAO,CAAE,EADE,CAToB,CAAlB,CAAf","sourcesContent":["import React, { FunctionComponent, useRef } from 'react'\nimport Swipes from 'react-native-gesture-handler/Swipeable'\nimport { Animated, Text, View, StyleSheet } from 'react-native'\nimport { SwipeableProps, SwipeableAction } from '../../types'\nimport { RectButton } from 'react-native-gesture-handler'\n\nconst Swipeable: FunctionComponent<SwipeableProps> = props => {\n\tconst actionItemWidth = props.actionWidth || 64\n\tconst swipeableRowRef = useRef<Swipes>(null)\n\n\tfunction renderAction(\n\t\taction: SwipeableAction,\n\t\tindex: number,\n\t\tprogress: Progress,\n\t\tdrag: Drag,\n\t\tside: 'left' | 'right',\n\t\tnumberOfActions: number\n\t) {\n\t\tif (props.renderAction)\n\t\t\treturn props.renderAction(action, index, progress, drag, side)\n\t\tif (props.renderAction === null) return null\n\n\t\tconst outputRange =\n\t\t\tside === 'right'\n\t\t\t\t? [(numberOfActions - index) * actionItemWidth, 0]\n\t\t\t\t: [-index * actionItemWidth, 0]\n\n\t\tconst translateX = progress.interpolate({\n\t\t\tinputRange: [0, 1],\n\t\t\toutputRange\n\t\t})\n\n\t\tfunction onPress() {\n\t\t\tif (swipeableRowRef.current) swipeableRowRef.current.close()\n\t\t\tif (action.onPress) action.onPress(props.id)\n\t\t}\n\n\t\treturn (\n\t\t\t<Animated.View\n\t\t\t\tkey={JSON.stringify(action + `${Math.random()}`)}\n\t\t\t\tstyle={{ flex: 1, transform: [{ translateX }] }}\n\t\t\t>\n\t\t\t\t<RectButton\n\t\t\t\t\tstyle={[styles.action, { backgroundColor: action.backgroundColor }]}\n\t\t\t\t\tonPress={onPress}\n\t\t\t\t>\n\t\t\t\t\t{action.renderIcon && action.renderIcon(progress, drag)}\n\t\t\t\t\t<Text\n\t\t\t\t\t\tstyle={[\n\t\t\t\t\t\t\tstyles.actionText,\n\t\t\t\t\t\t\t{ color: action.color },\n\t\t\t\t\t\t\tprops.textStyle\n\t\t\t\t\t\t]}\n\t\t\t\t\t>\n\t\t\t\t\t\t{action.text}\n\t\t\t\t\t</Text>\n\t\t\t\t</RectButton>\n\t\t\t</Animated.View>\n\t\t)\n\t}\n\tfunction renderRightActions(progress: Progress, drag: Drag) {\n\t\tconst actions =\n\t\t\tprops.rightActions ||\n\t\t\t[\n\t\t\t\t// {\n\t\t\t\t// \tcolor: 'white',\n\t\t\t\t// \tbackgroundColor: 'purple',\n\t\t\t\t// \tIconNode: null,\n\t\t\t\t// \ttext: 'Test'\n\t\t\t\t// }\n\t\t\t]\n\t\tif (props.renderRightActions)\n\t\t\treturn props.renderRightActions(actions, progress, drag)\n\t\tif (props.renderRightActions === null) return null\n\n\t\treturn renderActionList(actions, progress, drag, 'right')\n\t}\n\tfunction renderLeftActions(progress: Progress, drag: Drag) {\n\t\tconst actions =\n\t\t\tprops.leftActions ||\n\t\t\t[\n\t\t\t\t// {\n\t\t\t\t// \tcolor: 'white',\n\t\t\t\t// \tbackgroundColor: 'blue',\n\t\t\t\t// \tIconNode: null,\n\t\t\t\t// \ttext: 'Scripture monkey'\n\t\t\t\t// }\n\t\t\t]\n\t\tif (props.renderLeftActions)\n\t\t\treturn props.renderLeftActions(actions, progress, drag)\n\t\tif (props.renderLeftActions === null) return null\n\n\t\treturn renderActionList(actions, progress, drag, 'left')\n\t}\n\tfunction renderActionList(\n\t\tactions: SwipeableAction[],\n\t\tprogress: Progress,\n\t\tdrag: Drag,\n\t\tside: 'left' | 'right'\n\t) {\n\t\treturn (\n\t\t\t<View\n\t\t\t\tstyle={[styles.actionList, { width: actionItemWidth * actions.length }]}\n\t\t\t>\n\t\t\t\t{actions.map((action, index) =>\n\t\t\t\t\trenderAction(action, index, progress, drag, side, actions.length)\n\t\t\t\t)}\n\t\t\t</View>\n\t\t)\n\t}\n\treturn (\n\t\t<Swipes\n\t\t\tfriction={2}\n\t\t\tleftThreshold={30}\n\t\t\trightThreshold={40}\n\t\t\trenderLeftActions={renderLeftActions}\n\t\t\trenderRightActions={renderRightActions}\n\t\t\tref={swipeableRowRef}\n\t\t\t{...(props.gestureHandlerProps || {})}\n\t\t>\n\t\t\t{props.children}\n\t\t</Swipes>\n\t)\n}\n\nexport default React.memo(Swipeable)\n\ntype Progress = Animated.Value | Animated.AnimatedInterpolation\ntype Drag = Animated.AnimatedInterpolation\n\nconst styles = StyleSheet.create({\n\tactionList: {\n\t\tflexDirection: 'row'\n\t},\n\taction: {\n\t\talignItems: 'center',\n\t\tjustifyContent: 'center',\n\t\tflex: 1\n\t},\n\tactionText: {\n\t\tpadding: 10\n\t}\n})\n"]}
@@ -1,2 +0,0 @@
1
- var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/Inbox/Item/Title/index.tsx";import React from'react';import{Text,StyleSheet,View}from'react-native';export default function(_ref){var title=_ref.title,style=_ref.style,containerStyle=_ref.containerStyle;return React.createElement(View,{style:[styles.container,containerStyle],__source:{fileName:_jsxFileName,lineNumber:7}},React.createElement(Text,{numberOfLines:1,ellipsizeMode:"tail",style:[styles.text,style],__source:{fileName:_jsxFileName,lineNumber:8}},title));}var styles=StyleSheet.create({container:{flex:1},text:{fontWeight:'600',fontSize:17}});
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","Text","StyleSheet","View","title","style","containerStyle","styles","container","text","create","flex","fontWeight","fontSize"],"mappings":"8GAAA,MAAOA,CAAAA,KAAP,KAAkB,OAAlB,CACA,OAASC,IAAT,CAAeC,UAAf,CAA2BC,IAA3B,KAAuC,cAAvC,CAGA,cAAe,eAAgE,IAArDC,CAAAA,KAAqD,MAArDA,KAAqD,CAA9CC,KAA8C,MAA9CA,KAA8C,CAAvCC,cAAuC,MAAvCA,cAAuC,CAC9E,MACC,qBAAC,IAAD,EAAM,KAAK,CAAE,CAACC,MAAM,CAACC,SAAR,CAAmBF,cAAnB,CAAb,gDACC,oBAAC,IAAD,EAAM,aAAa,CAAE,CAArB,CAAwB,aAAa,CAAC,MAAtC,CAA6C,KAAK,CAAE,CAACC,MAAM,CAACE,IAAR,CAAcJ,KAAd,CAApD,gDACED,KADF,CADD,CADD,CAOA,CAED,GAAMG,CAAAA,MAAM,CAAGL,UAAU,CAACQ,MAAX,CAAkB,CAChCF,SAAS,CAAE,CACVG,IAAI,CAAE,CADI,CADqB,CAIhCF,IAAI,CAAE,CACLG,UAAU,CAAE,KADP,CAELC,QAAQ,CAAE,EAFL,CAJ0B,CAAlB,CAAf","sourcesContent":["import React from 'react'\nimport { Text, StyleSheet, View } from 'react-native'\nimport { InboxItemTitleProps } from '../../types'\n\nexport default function({ title, style, containerStyle }: InboxItemTitleProps) {\n\treturn (\n\t\t<View style={[styles.container, containerStyle]}>\n\t\t\t<Text numberOfLines={1} ellipsizeMode=\"tail\" style={[styles.text, style]}>\n\t\t\t\t{title}\n\t\t\t</Text>\n\t\t</View>\n\t)\n}\n\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\tflex: 1\n\t},\n\ttext: {\n\t\tfontWeight: '600',\n\t\tfontSize: 17\n\t}\n})\n"]}
@@ -1,2 +0,0 @@
1
- import _extends from"@babel/runtime/helpers/extends";var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/Inbox/Item/UnreadIndicator/index.tsx";import React from'react';import{View,Text,StyleSheet}from'react-native';import{LinearGradient}from'expo-linear-gradient';var Indicator=function Indicator(props){if(!props.show)return null;var size=props.size||(props.showCount?20:15);var justifyContent='center';if(props.position==='bottom')justifyContent='flex-end';if(props.position==='top')justifyContent='flex-start';var characterCount=props.unreadCount&&props.unreadCount.toString().length||1;var width=size;if(props.showCount&&characterCount===2)width=size*1.1;else if(props.showCount&&characterCount===3)width=size*1.5;var opacity=props.unreadCount?1:0;var BackgroundComponent=props.type==='gradient'?LinearGradient:View;return React.createElement(View,{style:[styles.container,{justifyContent:justifyContent,width:props.showCount?size*1.5:size,opacity:opacity}],__source:{fileName:_jsxFileName,lineNumber:31}},React.createElement(BackgroundComponent,_extends({style:[styles.background,{backgroundColor:props.backgroundColor,width:width,height:size,borderRadius:size/2},props.backgroundStyle||{}]},props.gradientProps||{colors:['red','blue']},{__source:{fileName:_jsxFileName,lineNumber:41}}),React.createElement(Text,{style:[styles.text,props.textStyle||{},props.textColor?{color:props.textColor}:{}],__source:{fileName:_jsxFileName,lineNumber:56}},!!props.showCount&&(props.unreadCount||''))));};var styles=StyleSheet.create({container:{alignItems:'center'},background:{overflow:'hidden',alignItems:'center',justifyContent:'center',backgroundColor:'blue'},text:{color:'white'}});export default React.memo(Indicator);
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.tsx"],"names":["React","View","Text","StyleSheet","LinearGradient","Indicator","props","show","size","showCount","justifyContent","position","characterCount","unreadCount","toString","length","width","opacity","BackgroundComponent","type","styles","container","background","backgroundColor","height","borderRadius","backgroundStyle","gradientProps","colors","text","textStyle","textColor","color","create","alignItems","overflow","memo"],"mappings":"6KAAA,MAAOA,CAAAA,KAAP,KAAkB,OAAlB,CACA,OAASC,IAAT,CAAeC,IAAf,CAAqBC,UAArB,KAAkD,cAAlD,CAEA,OAASC,cAAT,KAA+B,sBAA/B,CAEA,GAAMC,CAAAA,SAAS,CAAG,QAAZA,CAAAA,SAAY,CAACC,KAAD,CAAiC,CAClD,GAAI,CAACA,KAAK,CAACC,IAAX,CAAiB,MAAO,KAAP,CAEjB,GAAIC,CAAAA,IAAI,CAAGF,KAAK,CAACE,IAAN,GAAeF,KAAK,CAACG,SAAN,CAAkB,EAAlB,CAAuB,EAAtC,CAAX,CAGA,GAAIC,CAAAA,cAAc,CAAG,Q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CAAQ,MAAR,CADmB,CAX7B,mDAeC,oBAAC,IAAD,EACC,KAAK,CAAE,CACNR,MAAM,CAACS,IADD,CAENvB,KAAK,CAACwB,SAAN,EAAmB,EAFb,CAGNxB,KAAK,CAACyB,SAAN,CAAkB,CAAEC,KAAK,CAAE1B,KAAK,CAACyB,SAAf,CAAlB,CAA+C,EAHzC,CADR,iDAOE,CAAC,CAACzB,KAAK,CAACG,SAAR,GAAsBH,KAAK,CAACO,WAAN,EAAqB,EAA3C,CAPF,CAfD,CAVD,CADD,CAsCA,CA9DD,CA+DA,GAAMO,CAAAA,MAAM,CAAGjB,UAAU,CAAC8B,MAAX,CAAkB,CAChCZ,SAAS,CAAE,CACVa,UAAU,CAAE,QADF,CADqB,CAIhCZ,UAAU,CAAE,CACXa,QAAQ,CAAE,QADC,CAEXD,UAAU,CAAE,QAFD,CAGXxB,cAAc,CAAE,QAHL,CAIXa,eAAe,CAAE,MAJN,CAJoB,CAUhCM,IAAI,CAAE,CACLG,KAAK,CAAE,OADF,CAV0B,CAAlB,CAAf,CAeA,cAAehC,CAAAA,KAAK,CAACoC,IAAN,CAAW/B,SAAX,CAAf","sourcesContent":["import React from 'react'\nimport { View, Text, StyleSheet, ViewStyle } from 'react-native'\nimport { UnreadIndicatorProps } from '../../types'\nimport { LinearGradient } from 'expo-linear-gradient'\n\nconst Indicator = (props: UnreadIndicatorProps) => {\n\tif (!props.show) return null\n\n\tlet size = props.size || (props.showCount ? 20 : 15)\n\n\t// set vertical position\n\tlet justifyContent = 'center'\n\tif (props.position === 'bottom') justifyContent = 'flex-end'\n\tif (props.position === 'top') justifyContent = 'flex-start'\n\n\t// determine width\n\tconst characterCount =\n\t\t(props.unreadCount && props.unreadCount.toString().length) || 1\n\n\tlet width = size\n\tif (props.showCount && characterCount === 2) width = size * 1.1\n\telse if (props.showCount && characterCount === 3) width = size * 1.5\n\n\t// indicator should be invisible if the count is 0, no?\n\tconst opacity = props.unreadCount ? 1 : 0\n\n\t// if it's a gradient, set the gradient as the component\n\tconst BackgroundComponent = props.type === 'gradient' ? LinearGradient : View\n\n\treturn (\n\t\t<View\n\t\t\tstyle={[\n\t\t\t\tstyles.container,\n\t\t\t\t{\n\t\t\t\t\tjustifyContent,\n\t\t\t\t\twidth: props.showCount ? size * 1.5 : size,\n\t\t\t\t\topacity\n\t\t\t\t} as ViewStyle\n\t\t\t]}\n\t\t>\n\t\t\t<BackgroundComponent\n\t\t\t\tstyle={[\n\t\t\t\t\tstyles.background,\n\t\t\t\t\t{\n\t\t\t\t\t\tbackgroundColor: props.backgroundColor,\n\t\t\t\t\t\twidth,\n\t\t\t\t\t\theight: size,\n\t\t\t\t\t\tborderRadius: size / 2\n\t\t\t\t\t},\n\t\t\t\t\tprops.backgroundStyle || {}\n\t\t\t\t]}\n\t\t\t\t{...(props.gradientProps || {\n\t\t\t\t\tcolors: ['red', 'blue']\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t<Text\n\t\t\t\t\tstyle={[\n\t\t\t\t\t\tstyles.text,\n\t\t\t\t\t\tprops.textStyle || {},\n\t\t\t\t\t\tprops.textColor ? { color: props.textColor } : {}\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t{!!props.showCount && (props.unreadCount || '')}\n\t\t\t\t</Text>\n\t\t\t</BackgroundComponent>\n\t\t</View>\n\t)\n}\nconst styles = StyleSheet.create({\n\tcontainer: {\n\t\talignItems: 'center'\n\t},\n\tbackground: {\n\t\toverflow: 'hidden',\n\t\talignItems: 'center',\n\t\tjustifyContent: 'center',\n\t\tbackgroundColor: 'blue'\n\t},\n\ttext: {\n\t\tcolor: 'white'\n\t}\n})\n\nexport default React.memo(Indicator)\n"]}
@@ -1,2 +0,0 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";import _extends from"@babel/runtime/helpers/extends";var _jsxFileName="/Users/Fernando/Developer/Learning Babel/usechat/src/components/Inbox/Item/index.tsx";function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly)symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;});keys.push.apply(keys,symbols);}return keys;}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};if(i%2){ownKeys(Object(source),true).forEach(function(key){_defineProperty(target,key,source[key]);});}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source));}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key));});}}return target;}import React,{useCallback,useRef}from'react';import{RectButton}from'react-native-gesture-handler';import{View,StyleSheet}from'react-native';import Title from'./Title';import ItemDate from'./ItemDate';import UnreadIndicator from'./UnreadIndicator';import Subtitle from'./Subtitle';import Avatar from'../../Avatar';import Initials from'./Initials';import Swipeable from'./Swipeable/index';import TypingIndicator from'../../TypingIndicator';function Item(props){var renderCount=useRef(1);renderCount.current++;function renderTitle(){if(props.renderTitle)return props.renderTitle(props.name);if(props.renderTitle===null)return null;var TitleComponent=props.TitleComponent||Title;return React.createElement(TitleComponent,{title:props.name,style:props.titleStyle,containerStyle:props.titleContainerStyle,__source:{fileName:_jsxFileName,lineNumber:32}});}function renderDate(){if(props.renderDate)return props.renderDate(props.lastMessageCreatedAt);if(props.renderDate===null)return null;var DateComponent=props.DateComponent||ItemDate;return React.createElement(DateComponent,{dateToStringFunc:props.dateToStringFunc,date:props.lastMessageCreatedAt,style:props.dateStyle,__source:{fileName:_jsxFileName,lineNumber:46}});}function renderUnreadIndicator(){if(!props.showUnreadIndicator)return null;var position='center';if(props.unreadIndicatorPosition&&props.unreadIndicatorPosition.includes('-')){position=props.unreadIndicatorPosition.split('-')[0];}var backgroundColor=props.unreadIndicatorColor||'blue';var indicatorProps={unreadCount:props.unreadCount,textColor:props.unreadTextColor,showCount:props.showUnreadIndicatorCount,backgroundStyle:props.unreadIndicatorStyle,textStyle:props.unreadIndicatorTextStyle,position:position,backgroundColor:backgroundColor,type:props.unreadIndicatorType||'gradient',gradientProps:props.unreadIndicatorGradientProps||{colors:['red','blue']},show:props.showUnreadIndicator,size:props.unreadIndicatorSize};if(props.renderUnreadIndicator)return props.renderUnreadIndicator(indicatorProps);if(props.renderUnreadIndicator===null)return null;var UnreadIndicatorComponent=props.UnreadIndicatorComponent||UnreadIndicator;return React.createElement(UnreadIndicatorComponent,_extends({},indicatorProps,{__source:{fileName:_jsxFileName,lineNumber:93}}));}function renderSubtitle(){if(props.renderSubtitle===null)return null;if(props.showTypingIndicator&&props.numberOfPeopleTyping)return renderTypingIndicator();if(props.renderSubtitle)return props.renderSubtitle(props.lastMessageText);var SubtitleComponent=props.SubtitleComponent||Subtitle;return React.createElement(SubtitleComponent,{textStyle:props.subtitleTextStyle,lastMessageText:props.lastMessageText,__source:{fileName:_jsxFileName,lineNumber:105}});}function renderAvatarOrInitials(){if(props.disableAvatar)return null;var avatar=props.avatar;var initials=props.initials;var prioritizeAvatar=props.prioritizeAvatarOverInitials!==false;var size=props.avatarSize||55;var imageProps=props.avatarImageProps;var textStyle=props.initialsTextStyle;var initialsContainerStyle=props.initialsContainerStyle;var InitialsComponent=props.InitialsComponent||Initials;var AvatarComponent=props.AvatarComponent||Avatar;if(Array.isArray(avatar)){size/=2;return React.createElement(React.Fragment,null,avatar.map(function(member,i){if(member.avatar&&prioritizeAvatar){var avatarProps={imageProps:imageProps,size:size,avatar:member.avatar};if(props.renderAvatar)return props.renderAvatar(avatarProps);if(props.renderAvatar===null)return null;return React.createElement(AvatarComponent,_extends({},avatarProps,{__source:{fileName:_jsxFileName,lineNumber:159}}));}var initialsProps={textStyle:textStyle,containerStyle:initialsContainerStyle,initials:initials,size:size,textColor:props.initialsTextColor,backgroundColor:props.initialsBackgroundColor};if(props.renderInitials)return props.renderInitials(initialProps);if(props.renderInitials===null)return null;return React.createElement(InitialsComponent,_extends({key:initials+i.toString()},initialsProps,{__source:{fileName:_jsxFileName,lineNumber:175}}));}));}if(avatar&&prioritizeAvatar){var avatarProps={imageProps:imageProps,size:size,avatar:avatar};if(props.renderAvatar)return props.renderAvatar(avatarProps);if(props.renderAvatar===null)return null;return React.createElement(AvatarComponent,_extends({},avatarProps,{__source:{fileName:_jsxFileName,lineNumber:194}}));}var initialProps={initials:initials,size:size,textStyle:textStyle,containerStyle:initialsContainerStyle,textColor:props.initialsTextColor,backgroundColor:props.initialsBackgroundColor};if(props.renderInitials)return props.renderInitials(initialProps);if(props.renderInitials===null)return null;return React.createElement(InitialsComponent,_extends({},initialProps,{__source:{fileName:_jsxFileName,lineNumber:209}}));}function typingIndicator(){if(props.renderTypingIndicator)return props.renderTypingIndicator();if(props.renderTypingIndicator===null)return null;return React.createElement(View,{style:{marginTop:5},__source:{fileName:_jsxFileName,lineNumber:217}},React.createElement(TypingIndicator,{__source:{fileName:_jsxFileName,lineNumber:218}}));}var renderTypingIndicator=useCallback(typingIndicator,[props.renderTypingIndicator]);var unreadIndicatorIsOnRight=!!(props.showTypingIndicator&&props.unreadIndicatorPosition&&props.unreadIndicatorPosition.includes('right'));var flexDirection=unreadIndicatorIsOnRight?'row-reverse':'row';var paddingLeft=props.showUnreadIndicator?5:10;var swipeableProps={id:props.id,rightActions:props.swipeRightActions,leftActions:props.swipeLeftActions,renderAction:props.renderSwipeAction,actionWidth:props.swipeActionWidth,gestureHandlerProps:props.swipeableRowProps,renderLeftActions:props.renderLeftActions,renderRightActions:props.renderRightActions,textStyle:props.actionTextStyle};var ContainerComponent=props.swipeable?Swipeable:View;return React.createElement(ContainerComponent,_extends({},swipeableProps,{__source:{fileName:_jsxFileName,lineNumber:253}}),React.createElement(RectButton,{onPress:props.onPress,style:{backgroundColor:props.backgroundColor},__source:{fileName:_jsxFileName,lineNumber:254}},React.createElement(View,{style:[_objectSpread({paddingLeft:paddingLeft},styles.container,{},props.containerStyle||{}),{flexDirection:flexDirection}],__source:{fileName:_jsxFileName,lineNumber:258}},renderUnreadIndicator(),React.createElement(View,{style:[styles.wrapper],__source:{fileName:_jsxFileName,lineNumber:269}},renderAvatarOrInitials(),React.createElement(View,{style:styles.inner,__source:{fileName:_jsxFileName,lineNumber:271}},React.createElement(View,{style:styles.content,__source:{fileName:_jsxFileName,lineNumber:272}},renderTitle(),renderDate()),renderSubtitle())))));}export default React.memo(Item);var styles=StyleSheet.create({container:{flexDirection:'row',paddingVertical:10,justifyContent:'center',marginBottom:5,paddingRight:10},wrapper:{flex:1,flexDirection:'row'},content:{flexDirection:'row',justifyContent:'space-between'},inner:{flex:1,paddingLeft:10}});
2
- //# sourceMappingURL=index.js.map