@sendbird/uikit-react 3.12.0 → 3.13.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 (900) hide show
  1. package/App.js +79 -75
  2. package/App.js.map +1 -1
  3. package/CHANGELOG.md +98 -1
  4. package/Channel/components/ChannelHeader.js +29 -29
  5. package/Channel/components/ChannelUI.js +67 -63
  6. package/Channel/components/ChannelUI.js.map +1 -1
  7. package/Channel/components/FileViewer.js +28 -28
  8. package/Channel/components/FrozenNotification.js +5 -5
  9. package/Channel/components/Message.js +64 -58
  10. package/Channel/components/Message.js.map +1 -1
  11. package/Channel/components/MessageFeedbackModal.js +9 -9
  12. package/Channel/components/MessageInput.js +41 -41
  13. package/Channel/components/MessageInputWrapper.js +41 -41
  14. package/Channel/components/MessageList.js +78 -83
  15. package/Channel/components/MessageList.js.map +1 -1
  16. package/Channel/components/RemoveMessageModal.js +27 -27
  17. package/Channel/components/SuggestedMentionList.js +27 -27
  18. package/Channel/components/TypingIndicator.js +6 -6
  19. package/Channel/components/UnreadCount.js +7 -7
  20. package/Channel/context.js +20 -20
  21. package/Channel/hooks/useHandleUploadFiles.js +13 -13
  22. package/Channel/hooks/useInitialMessagesFetch.js +8 -97
  23. package/Channel/hooks/useInitialMessagesFetch.js.map +1 -1
  24. package/Channel/utils/compareMessagesForGrouping.js +5 -5
  25. package/Channel/utils/getMessagePartsInfo.js +6 -6
  26. package/Channel.js +67 -63
  27. package/Channel.js.map +1 -1
  28. package/ChannelList/components/AddChannel.js +20 -20
  29. package/ChannelList/components/ChannelListHeader.js +8 -8
  30. package/ChannelList/components/ChannelListUI.js +34 -34
  31. package/ChannelList/components/ChannelPreview.js +27 -27
  32. package/ChannelList/components/ChannelPreviewAction.js +11 -11
  33. package/ChannelList/context.js +10 -10
  34. package/ChannelList.js +34 -34
  35. package/ChannelSettings/components/ChannelProfile.js +14 -14
  36. package/ChannelSettings/components/ChannelSettingsUI.js +49 -54
  37. package/ChannelSettings/components/ChannelSettingsUI.js.map +1 -1
  38. package/ChannelSettings/components/EditDetailsModal.js +14 -14
  39. package/ChannelSettings/components/LeaveChannel.js +11 -11
  40. package/ChannelSettings/components/ModerationPanel.js +21 -21
  41. package/ChannelSettings/components/UserListItem.js +13 -13
  42. package/ChannelSettings/components/UserPanel.js +20 -20
  43. package/ChannelSettings/context.js +89 -43
  44. package/ChannelSettings/context.js.map +1 -1
  45. package/ChannelSettings.js +23 -23
  46. package/CreateChannel/components/CreateChannelUI.js +16 -16
  47. package/CreateChannel/components/InviteUsers.js +16 -16
  48. package/CreateChannel/components/SelectChannelType.js +10 -10
  49. package/CreateChannel/context.js +4 -4
  50. package/CreateChannel.js +16 -16
  51. package/CreateOpenChannel/components/CreateOpenChannelUI.js +11 -11
  52. package/CreateOpenChannel/context.js +1 -1
  53. package/CreateOpenChannel.js +11 -11
  54. package/EditUserProfile/components/EditUserProfileUI.js +12 -12
  55. package/EditUserProfile.js +12 -12
  56. package/GroupChannel/components/FileViewer.js +23 -23
  57. package/GroupChannel/components/FrozenNotification.js +5 -5
  58. package/GroupChannel/components/GroupChannelHeader.js +22 -22
  59. package/GroupChannel/components/GroupChannelUI.js +62 -58
  60. package/GroupChannel/components/GroupChannelUI.js.map +1 -1
  61. package/GroupChannel/components/Message.js +63 -54
  62. package/GroupChannel/components/Message.js.map +1 -1
  63. package/GroupChannel/components/MessageInputWrapper.js +38 -38
  64. package/GroupChannel/components/MessageList.js +73 -67
  65. package/GroupChannel/components/MessageList.js.map +1 -1
  66. package/GroupChannel/components/RemoveMessageModal.js +22 -22
  67. package/GroupChannel/components/SuggestedMentionList.js +12 -11
  68. package/GroupChannel/components/SuggestedMentionList.js.map +1 -1
  69. package/GroupChannel/components/SuggestedReplies.js +1 -1
  70. package/GroupChannel/components/TypingIndicator.js +6 -6
  71. package/GroupChannel/components/UnreadCount.js +7 -7
  72. package/GroupChannel/context.js +15 -15
  73. package/GroupChannel.js +62 -58
  74. package/GroupChannel.js.map +1 -1
  75. package/GroupChannelList/components/AddGroupChannel.js +18 -18
  76. package/GroupChannelList/components/GroupChannelListHeader.js +8 -8
  77. package/GroupChannelList/components/GroupChannelListItem.js +24 -24
  78. package/GroupChannelList/components/GroupChannelListUI.js +33 -33
  79. package/GroupChannelList/components/GroupChannelPreviewAction.js +11 -11
  80. package/GroupChannelList/context.js +5 -5
  81. package/GroupChannelList.js +33 -33
  82. package/MessageSearch/components/MessageSearchUI.js +14 -14
  83. package/MessageSearch/context.js +1 -1
  84. package/MessageSearch.js +14 -14
  85. package/OpenChannel/components/FrozenChannelNotification.js +5 -5
  86. package/OpenChannel/components/OpenChannelHeader.js +18 -18
  87. package/OpenChannel/components/OpenChannelInput.js +25 -25
  88. package/OpenChannel/components/OpenChannelMessage.js +35 -35
  89. package/OpenChannel/components/OpenChannelMessageList.js +39 -39
  90. package/OpenChannel/components/OpenChannelUI.js +39 -39
  91. package/OpenChannel/context.js +17 -17
  92. package/OpenChannel.js +39 -39
  93. package/OpenChannelList/components/OpenChannelListUI.js +14 -14
  94. package/OpenChannelList/components/OpenChannelPreview.js +6 -6
  95. package/OpenChannelList/context.js +3 -3
  96. package/OpenChannelList.js +14 -14
  97. package/OpenChannelSettings/components/EditDetailsModal.js +15 -15
  98. package/OpenChannelSettings/components/OpenChannelProfile.js +15 -15
  99. package/OpenChannelSettings/components/OpenChannelSettingsUI.js +19 -19
  100. package/OpenChannelSettings/components/OperatorUI.js +19 -19
  101. package/OpenChannelSettings/components/ParticipantUI.js +17 -17
  102. package/OpenChannelSettings/context.js +3 -3
  103. package/OpenChannelSettings.js +19 -19
  104. package/SendbirdProvider.js +360 -83
  105. package/SendbirdProvider.js.map +1 -1
  106. package/Thread/components/ParentMessageInfo.js +42 -42
  107. package/Thread/components/ParentMessageInfoItem.js +28 -28
  108. package/Thread/components/ThreadHeader.js +7 -7
  109. package/Thread/components/ThreadList.js +46 -46
  110. package/Thread/components/ThreadListItem.js +46 -46
  111. package/Thread/components/ThreadMessageInput.js +49 -48
  112. package/Thread/components/ThreadMessageInput.js.map +1 -1
  113. package/Thread/components/ThreadUI.js +56 -56
  114. package/Thread/context.js +9 -9
  115. package/Thread.js +56 -56
  116. package/VoicePlayer/context.js +3 -3
  117. package/VoicePlayer/useVoicePlayer.js +10 -10
  118. package/VoiceRecorder/context.js +10 -10
  119. package/VoiceRecorder/useVoiceRecorder.js +9 -9
  120. package/chunks/{bundle-Mj9lwGep.js → bundle--GxLwo7q.js} +4 -4
  121. package/chunks/{bundle-Mj9lwGep.js.map → bundle--GxLwo7q.js.map} +1 -1
  122. package/chunks/{bundle-TWhlUSzV.js → bundle--WETJA_c.js} +6 -6
  123. package/chunks/bundle--WETJA_c.js.map +1 -0
  124. package/chunks/{bundle-NRvvlX8r.js → bundle-0DTNrbOf.js} +1 -1
  125. package/chunks/bundle-0DTNrbOf.js.map +1 -0
  126. package/chunks/{bundle-jnJfrZ-B.js → bundle-0QDb7-Y_.js} +1 -1
  127. package/chunks/{bundle-jnJfrZ-B.js.map → bundle-0QDb7-Y_.js.map} +1 -1
  128. package/chunks/{bundle-ThaFnyA3.js → bundle-0Vur_TKy.js} +1 -1
  129. package/chunks/bundle-0Vur_TKy.js.map +1 -0
  130. package/chunks/{bundle-Yc91ktUe.js → bundle-2194oWZc.js} +1 -1
  131. package/chunks/bundle-2194oWZc.js.map +1 -0
  132. package/chunks/{bundle-hwjo__1w.js → bundle-22Jw6ztq.js} +6 -6
  133. package/chunks/bundle-22Jw6ztq.js.map +1 -0
  134. package/chunks/{bundle-FMptIFTe.js → bundle-2AR3a1T9.js} +3 -3
  135. package/chunks/bundle-2AR3a1T9.js.map +1 -0
  136. package/chunks/{bundle-5qVfPYXm.js → bundle-39Y3yv8j.js} +1 -1
  137. package/chunks/bundle-39Y3yv8j.js.map +1 -0
  138. package/chunks/{bundle-29ZwEQCB.js → bundle-3E-IANjq.js} +1 -1
  139. package/chunks/bundle-3E-IANjq.js.map +1 -0
  140. package/chunks/{bundle-mbVaGxy-.js → bundle-4gcxTdvH.js} +1 -1
  141. package/chunks/bundle-4gcxTdvH.js.map +1 -0
  142. package/chunks/bundle-6KFri-1A.js +1689 -0
  143. package/chunks/bundle-6KFri-1A.js.map +1 -0
  144. package/chunks/{bundle-8msIvFyl.js → bundle-6_zAh1Y3.js} +10 -10
  145. package/chunks/{bundle-8msIvFyl.js.map → bundle-6_zAh1Y3.js.map} +1 -1
  146. package/chunks/{bundle-laqNvtHc.js → bundle-6ruK1Zgw.js} +2 -2
  147. package/chunks/bundle-6ruK1Zgw.js.map +1 -0
  148. package/chunks/{bundle-ammXYCNc.js → bundle-6yzuMtzi.js} +1 -1
  149. package/chunks/bundle-6yzuMtzi.js.map +1 -0
  150. package/chunks/{bundle-B3ETdLpu.js → bundle-6zdlkf2J.js} +1 -1
  151. package/chunks/bundle-6zdlkf2J.js.map +1 -0
  152. package/chunks/{bundle-WJ0Rx9Vt.js → bundle-7Mx2MtAL.js} +2 -2
  153. package/chunks/bundle-7Mx2MtAL.js.map +1 -0
  154. package/chunks/{bundle--bzcDcV7.js → bundle-85rk09Bx.js} +1 -1
  155. package/chunks/bundle-85rk09Bx.js.map +1 -0
  156. package/chunks/{bundle-YK6gNh-t.js → bundle-9C7b_-hs.js} +1 -1
  157. package/chunks/bundle-9C7b_-hs.js.map +1 -0
  158. package/chunks/{bundle-mah5uoR7.js → bundle-9QigDxkR.js} +1 -1
  159. package/chunks/{bundle-mah5uoR7.js.map → bundle-9QigDxkR.js.map} +1 -1
  160. package/chunks/{bundle-YcH_HSha.js → bundle-9c5vLDe9.js} +7 -3
  161. package/chunks/bundle-9c5vLDe9.js.map +1 -0
  162. package/chunks/{bundle-iRd3nywJ.js → bundle-AaDwp4eU.js} +1 -1
  163. package/chunks/bundle-AaDwp4eU.js.map +1 -0
  164. package/chunks/{bundle-WJbfhl8B.js → bundle-Aqr_4BjO.js} +6 -6
  165. package/chunks/bundle-Aqr_4BjO.js.map +1 -0
  166. package/chunks/{bundle-z995fH4M.js → bundle-BMZkoBS_.js} +1 -1
  167. package/chunks/bundle-BMZkoBS_.js.map +1 -0
  168. package/chunks/{bundle-PXF29EwZ.js → bundle-BiPw1Sub.js} +4 -4
  169. package/chunks/bundle-BiPw1Sub.js.map +1 -0
  170. package/chunks/{bundle-yMF6_bQS.js → bundle-C-Q3OKQW.js} +1 -1
  171. package/chunks/bundle-C-Q3OKQW.js.map +1 -0
  172. package/chunks/{bundle-CBZRgcMe.js → bundle-DHw1C5gJ.js} +1 -1
  173. package/chunks/bundle-DHw1C5gJ.js.map +1 -0
  174. package/chunks/{bundle-kPmyq9ap.js → bundle-DbZW44FD.js} +17 -17
  175. package/chunks/{bundle-kPmyq9ap.js.map → bundle-DbZW44FD.js.map} +1 -1
  176. package/chunks/{bundle-zr28rXX0.js → bundle-Drmg8_dh.js} +1 -1
  177. package/chunks/bundle-Drmg8_dh.js.map +1 -0
  178. package/chunks/{bundle-VTgol5b8.js → bundle-IH2e-Hbm.js} +1 -1
  179. package/chunks/bundle-IH2e-Hbm.js.map +1 -0
  180. package/chunks/{bundle-0wv5nxcS.js → bundle-JyjLgYxl.js} +2 -2
  181. package/chunks/{bundle-0wv5nxcS.js.map → bundle-JyjLgYxl.js.map} +1 -1
  182. package/chunks/{bundle-s7Jm-nQL.js → bundle-KIf79auh.js} +1 -1
  183. package/{cjs/chunks/bundle-CQGJhJYV.js.map → chunks/bundle-KIf79auh.js.map} +1 -1
  184. package/chunks/{bundle-gb0MSpDp.js → bundle-LQlIikHo.js} +11 -11
  185. package/chunks/{bundle-gb0MSpDp.js.map → bundle-LQlIikHo.js.map} +1 -1
  186. package/chunks/{bundle-aAXpX7Sl.js → bundle-LTiCF37t.js} +8 -4
  187. package/chunks/{bundle-aAXpX7Sl.js.map → bundle-LTiCF37t.js.map} +1 -1
  188. package/chunks/{bundle-sPCqUzdP.js → bundle-LjoHDFFW.js} +1 -1
  189. package/chunks/bundle-LjoHDFFW.js.map +1 -0
  190. package/chunks/{bundle-_jLAjElr.js → bundle-MSFA1dPT.js} +10 -10
  191. package/chunks/{bundle-_jLAjElr.js.map → bundle-MSFA1dPT.js.map} +1 -1
  192. package/chunks/{bundle-W5PUqymk.js → bundle-NQDEdVJA.js} +3 -3
  193. package/chunks/{bundle-W5PUqymk.js.map → bundle-NQDEdVJA.js.map} +1 -1
  194. package/chunks/{bundle-ZOw_iEjI.js → bundle-NntyZyeL.js} +9 -17
  195. package/{cjs/chunks/bundle-nZsWuDxZ.js.map → chunks/bundle-NntyZyeL.js.map} +1 -1
  196. package/chunks/{bundle-VeP4ZGTy.js → bundle-NwEKq2eQ.js} +4 -4
  197. package/chunks/{bundle-VeP4ZGTy.js.map → bundle-NwEKq2eQ.js.map} +1 -1
  198. package/chunks/{bundle-Eiortw-P.js → bundle-O7xTFAHP.js} +8 -8
  199. package/chunks/{bundle-Eiortw-P.js.map → bundle-O7xTFAHP.js.map} +1 -1
  200. package/chunks/{bundle-y9OFIxWO.js → bundle-PTiTVbcu.js} +3 -3
  201. package/chunks/{bundle-y9OFIxWO.js.map → bundle-PTiTVbcu.js.map} +1 -1
  202. package/chunks/{bundle-OdLkkyEZ.js → bundle-PYv4lPO3.js} +2 -2
  203. package/chunks/{bundle-OdLkkyEZ.js.map → bundle-PYv4lPO3.js.map} +1 -1
  204. package/chunks/{bundle-OGLIDsv0.js → bundle-PdtvfqJT.js} +1 -1
  205. package/chunks/bundle-PdtvfqJT.js.map +1 -0
  206. package/chunks/{bundle-S3i59_HU.js → bundle-Sl-oiala.js} +1 -1
  207. package/chunks/bundle-Sl-oiala.js.map +1 -0
  208. package/chunks/{bundle-fdlrWGps.js → bundle-Sm0-7tTm.js} +2 -2
  209. package/chunks/bundle-Sm0-7tTm.js.map +1 -0
  210. package/chunks/{bundle-aU9DrOs1.js → bundle-Ueye8-sz.js} +4 -4
  211. package/chunks/bundle-Ueye8-sz.js.map +1 -0
  212. package/chunks/{bundle-hTd1NizA.js → bundle-X7gl5vNX.js} +1 -1
  213. package/chunks/bundle-X7gl5vNX.js.map +1 -0
  214. package/chunks/{bundle-FS7VoABk.js → bundle-XDy3Cf54.js} +4 -1
  215. package/chunks/{bundle-bXxgZ3h3.js.map → bundle-XDy3Cf54.js.map} +1 -1
  216. package/chunks/{bundle-HIwSRGfa.js → bundle-XjJUjhN1.js} +3 -3
  217. package/chunks/bundle-XjJUjhN1.js.map +1 -0
  218. package/chunks/{bundle-R_8mFuwU.js → bundle-Y3ZVN9yF.js} +1 -1
  219. package/chunks/bundle-Y3ZVN9yF.js.map +1 -0
  220. package/chunks/{bundle-7-k9ar1S.js → bundle-_hGurAcC.js} +1 -1
  221. package/chunks/bundle-_hGurAcC.js.map +1 -0
  222. package/chunks/{bundle-bXxgZ3h3.js → bundle-a73hFmUC.js} +64 -86
  223. package/chunks/{bundle-B2cNVPIG.js.map → bundle-a73hFmUC.js.map} +1 -1
  224. package/chunks/{bundle-JVFq7QiY.js → bundle-b2jLXyrm.js} +3 -3
  225. package/chunks/bundle-b2jLXyrm.js.map +1 -0
  226. package/chunks/{bundle-5waczf_5.js → bundle-bg3dRlK7.js} +3 -3
  227. package/chunks/{bundle-5waczf_5.js.map → bundle-bg3dRlK7.js.map} +1 -1
  228. package/chunks/{bundle-c-m52z_J.js → bundle-bgVMRm8v.js} +4 -4
  229. package/chunks/{bundle-c-m52z_J.js.map → bundle-bgVMRm8v.js.map} +1 -1
  230. package/chunks/{bundle-IGjDRlEq.js → bundle-cilkeUXQ.js} +5 -5
  231. package/chunks/bundle-cilkeUXQ.js.map +1 -0
  232. package/chunks/{bundle-7gmFtphc.js → bundle-dUPYt-qi.js} +2 -2
  233. package/chunks/bundle-dUPYt-qi.js.map +1 -0
  234. package/chunks/{bundle-H1vLRvsQ.js → bundle-da60Z7l5.js} +5 -5
  235. package/chunks/bundle-da60Z7l5.js.map +1 -0
  236. package/chunks/{bundle-lS2bdzD_.js → bundle-eC1SRuX3.js} +2 -2
  237. package/chunks/{bundle-lS2bdzD_.js.map → bundle-eC1SRuX3.js.map} +1 -1
  238. package/chunks/{bundle-MVZc-WX7.js → bundle-fgpwMbpA.js} +10 -10
  239. package/chunks/bundle-fgpwMbpA.js.map +1 -0
  240. package/chunks/{bundle-ZrmeY8rp.js → bundle-gMH6Z6oi.js} +2 -2
  241. package/chunks/bundle-gMH6Z6oi.js.map +1 -0
  242. package/chunks/{bundle-e_hMfMVC.js → bundle-gQwzebOn.js} +3 -3
  243. package/chunks/bundle-gQwzebOn.js.map +1 -0
  244. package/chunks/{bundle-PrPMpr0d.js → bundle-hAyHXo9f.js} +4 -4
  245. package/chunks/bundle-hAyHXo9f.js.map +1 -0
  246. package/chunks/{bundle-mXxUWu6C.js → bundle-hjFxrcMW.js} +1 -1
  247. package/chunks/bundle-hjFxrcMW.js.map +1 -0
  248. package/chunks/{bundle-5cA2H0cQ.js → bundle-jqQY8n8G.js} +1 -1
  249. package/chunks/bundle-jqQY8n8G.js.map +1 -0
  250. package/chunks/{bundle-WkSXViPf.js → bundle-jzjtmtps.js} +2 -2
  251. package/chunks/bundle-jzjtmtps.js.map +1 -0
  252. package/chunks/{bundle-XC9KBi8e.js → bundle-kLlb2TJ8.js} +3 -3
  253. package/chunks/{bundle-XC9KBi8e.js.map → bundle-kLlb2TJ8.js.map} +1 -1
  254. package/chunks/{bundle-zftI06HH.js → bundle-lZq_XDzb.js} +3 -3
  255. package/chunks/bundle-lZq_XDzb.js.map +1 -0
  256. package/chunks/{bundle-jIsbkecD.js → bundle-n2BmCgGV.js} +1 -1
  257. package/chunks/bundle-n2BmCgGV.js.map +1 -0
  258. package/chunks/bundle-nXMckOlK.js +102 -0
  259. package/chunks/{bundle-s7Jm-nQL.js.map → bundle-nXMckOlK.js.map} +1 -1
  260. package/chunks/{bundle-fIf1YwSi.js → bundle-npMrmwG6.js} +1 -1
  261. package/chunks/bundle-npMrmwG6.js.map +1 -0
  262. package/chunks/{bundle-InXDhFjw.js → bundle-qouYngqR.js} +10 -7
  263. package/chunks/bundle-qouYngqR.js.map +1 -0
  264. package/chunks/{bundle-nuPs9AqY.js → bundle-rjBwVkDc.js} +10 -10
  265. package/chunks/{bundle-nuPs9AqY.js.map → bundle-rjBwVkDc.js.map} +1 -1
  266. package/chunks/{bundle-RFQg3r1K.js → bundle-ubVU4exZ.js} +3 -3
  267. package/chunks/{bundle-RFQg3r1K.js.map → bundle-ubVU4exZ.js.map} +1 -1
  268. package/chunks/{bundle-dPtRdKjv.js → bundle-v3VMB7al.js} +1 -1
  269. package/chunks/bundle-v3VMB7al.js.map +1 -0
  270. package/chunks/{bundle-Cl9FF01U.js → bundle-wWnN6K3w.js} +1 -1
  271. package/chunks/{bundle-Cl9FF01U.js.map → bundle-wWnN6K3w.js.map} +1 -1
  272. package/chunks/{bundle-QDjzCG-h.js → bundle-wpc1Fted.js} +3 -3
  273. package/chunks/bundle-wpc1Fted.js.map +1 -0
  274. package/chunks/{bundle-42MD-_6f.js → bundle-xC7o7NLR.js} +7 -3
  275. package/chunks/bundle-xC7o7NLR.js.map +1 -0
  276. package/chunks/{bundle-GMuoHJM5.js → bundle-y909vBn9.js} +3 -3
  277. package/chunks/{bundle-GMuoHJM5.js.map → bundle-y909vBn9.js.map} +1 -1
  278. package/chunks/{bundle-2ZdAkcAR.js → bundle-y9VJsc3H.js} +5 -5
  279. package/chunks/{bundle-2ZdAkcAR.js.map → bundle-y9VJsc3H.js.map} +1 -1
  280. package/chunks/{bundle-1Wok5yjx.js → bundle-yIputEl7.js} +4 -4
  281. package/chunks/bundle-yIputEl7.js.map +1 -0
  282. package/chunks/{bundle-B2cNVPIG.js → bundle-zy69cX9t.js} +40 -6
  283. package/chunks/bundle-zy69cX9t.js.map +1 -0
  284. package/cjs/App.js +79 -75
  285. package/cjs/App.js.map +1 -1
  286. package/cjs/Channel/components/ChannelHeader.js +29 -29
  287. package/cjs/Channel/components/ChannelUI.js +67 -63
  288. package/cjs/Channel/components/ChannelUI.js.map +1 -1
  289. package/cjs/Channel/components/FileViewer.js +28 -28
  290. package/cjs/Channel/components/FrozenNotification.js +5 -5
  291. package/cjs/Channel/components/Message.js +64 -58
  292. package/cjs/Channel/components/Message.js.map +1 -1
  293. package/cjs/Channel/components/MessageFeedbackModal.js +9 -9
  294. package/cjs/Channel/components/MessageInput.js +41 -41
  295. package/cjs/Channel/components/MessageInputWrapper.js +41 -41
  296. package/cjs/Channel/components/MessageList.js +78 -83
  297. package/cjs/Channel/components/MessageList.js.map +1 -1
  298. package/cjs/Channel/components/RemoveMessageModal.js +27 -27
  299. package/cjs/Channel/components/SuggestedMentionList.js +27 -27
  300. package/cjs/Channel/components/TypingIndicator.js +6 -6
  301. package/cjs/Channel/components/UnreadCount.js +7 -7
  302. package/cjs/Channel/context.js +27 -27
  303. package/cjs/Channel/hooks/useHandleUploadFiles.js +13 -13
  304. package/cjs/Channel/hooks/useInitialMessagesFetch.js +10 -95
  305. package/cjs/Channel/hooks/useInitialMessagesFetch.js.map +1 -1
  306. package/cjs/Channel/utils/compareMessagesForGrouping.js +5 -5
  307. package/cjs/Channel/utils/getMessagePartsInfo.js +6 -6
  308. package/cjs/Channel.js +67 -63
  309. package/cjs/Channel.js.map +1 -1
  310. package/cjs/ChannelList/components/AddChannel.js +20 -20
  311. package/cjs/ChannelList/components/ChannelListHeader.js +8 -8
  312. package/cjs/ChannelList/components/ChannelListUI.js +34 -34
  313. package/cjs/ChannelList/components/ChannelPreview.js +27 -27
  314. package/cjs/ChannelList/components/ChannelPreviewAction.js +11 -11
  315. package/cjs/ChannelList/context.js +10 -10
  316. package/cjs/ChannelList.js +34 -34
  317. package/cjs/ChannelSettings/components/ChannelProfile.js +14 -14
  318. package/cjs/ChannelSettings/components/ChannelSettingsUI.js +49 -54
  319. package/cjs/ChannelSettings/components/ChannelSettingsUI.js.map +1 -1
  320. package/cjs/ChannelSettings/components/EditDetailsModal.js +14 -14
  321. package/cjs/ChannelSettings/components/LeaveChannel.js +11 -11
  322. package/cjs/ChannelSettings/components/ModerationPanel.js +21 -21
  323. package/cjs/ChannelSettings/components/UserListItem.js +13 -13
  324. package/cjs/ChannelSettings/components/UserPanel.js +20 -20
  325. package/cjs/ChannelSettings/context.js +89 -43
  326. package/cjs/ChannelSettings/context.js.map +1 -1
  327. package/cjs/ChannelSettings.js +23 -23
  328. package/cjs/CreateChannel/components/CreateChannelUI.js +16 -16
  329. package/cjs/CreateChannel/components/InviteUsers.js +16 -16
  330. package/cjs/CreateChannel/components/SelectChannelType.js +10 -10
  331. package/cjs/CreateChannel/context.js +4 -4
  332. package/cjs/CreateChannel.js +16 -16
  333. package/cjs/CreateOpenChannel/components/CreateOpenChannelUI.js +11 -11
  334. package/cjs/CreateOpenChannel/context.js +1 -1
  335. package/cjs/CreateOpenChannel.js +11 -11
  336. package/cjs/EditUserProfile/components/EditUserProfileUI.js +12 -12
  337. package/cjs/EditUserProfile.js +12 -12
  338. package/cjs/GroupChannel/components/FileViewer.js +23 -23
  339. package/cjs/GroupChannel/components/FrozenNotification.js +5 -5
  340. package/cjs/GroupChannel/components/GroupChannelHeader.js +22 -22
  341. package/cjs/GroupChannel/components/GroupChannelUI.js +62 -58
  342. package/cjs/GroupChannel/components/GroupChannelUI.js.map +1 -1
  343. package/cjs/GroupChannel/components/Message.js +63 -54
  344. package/cjs/GroupChannel/components/Message.js.map +1 -1
  345. package/cjs/GroupChannel/components/MessageInputWrapper.js +37 -37
  346. package/cjs/GroupChannel/components/MessageList.js +73 -67
  347. package/cjs/GroupChannel/components/MessageList.js.map +1 -1
  348. package/cjs/GroupChannel/components/RemoveMessageModal.js +22 -22
  349. package/cjs/GroupChannel/components/SuggestedMentionList.js +12 -11
  350. package/cjs/GroupChannel/components/SuggestedMentionList.js.map +1 -1
  351. package/cjs/GroupChannel/components/SuggestedReplies.js +1 -4
  352. package/cjs/GroupChannel/components/SuggestedReplies.js.map +1 -1
  353. package/cjs/GroupChannel/components/TypingIndicator.js +6 -6
  354. package/cjs/GroupChannel/components/UnreadCount.js +7 -7
  355. package/cjs/GroupChannel/context.js +15 -15
  356. package/cjs/GroupChannel.js +62 -58
  357. package/cjs/GroupChannel.js.map +1 -1
  358. package/cjs/GroupChannelList/components/AddGroupChannel.js +18 -18
  359. package/cjs/GroupChannelList/components/GroupChannelListHeader.js +8 -8
  360. package/cjs/GroupChannelList/components/GroupChannelListItem.js +24 -24
  361. package/cjs/GroupChannelList/components/GroupChannelListUI.js +33 -33
  362. package/cjs/GroupChannelList/components/GroupChannelPreviewAction.js +11 -11
  363. package/cjs/GroupChannelList/context.js +5 -5
  364. package/cjs/GroupChannelList.js +33 -33
  365. package/cjs/MessageSearch/components/MessageSearchUI.js +14 -14
  366. package/cjs/MessageSearch/context.js +1 -1
  367. package/cjs/MessageSearch.js +14 -14
  368. package/cjs/OpenChannel/components/FrozenChannelNotification.js +5 -5
  369. package/cjs/OpenChannel/components/OpenChannelHeader.js +18 -18
  370. package/cjs/OpenChannel/components/OpenChannelInput.js +25 -25
  371. package/cjs/OpenChannel/components/OpenChannelMessage.js +35 -35
  372. package/cjs/OpenChannel/components/OpenChannelMessageList.js +39 -39
  373. package/cjs/OpenChannel/components/OpenChannelUI.js +39 -39
  374. package/cjs/OpenChannel/context.js +17 -17
  375. package/cjs/OpenChannel.js +39 -39
  376. package/cjs/OpenChannelList/components/OpenChannelListUI.js +14 -14
  377. package/cjs/OpenChannelList/components/OpenChannelPreview.js +6 -6
  378. package/cjs/OpenChannelList/context.js +3 -3
  379. package/cjs/OpenChannelList.js +14 -14
  380. package/cjs/OpenChannelSettings/components/EditDetailsModal.js +15 -15
  381. package/cjs/OpenChannelSettings/components/OpenChannelProfile.js +15 -15
  382. package/cjs/OpenChannelSettings/components/OpenChannelSettingsUI.js +19 -19
  383. package/cjs/OpenChannelSettings/components/OperatorUI.js +19 -19
  384. package/cjs/OpenChannelSettings/components/ParticipantUI.js +17 -17
  385. package/cjs/OpenChannelSettings/context.js +3 -3
  386. package/cjs/OpenChannelSettings.js +19 -19
  387. package/cjs/SendbirdProvider.js +360 -83
  388. package/cjs/SendbirdProvider.js.map +1 -1
  389. package/cjs/Thread/components/ParentMessageInfo.js +42 -42
  390. package/cjs/Thread/components/ParentMessageInfoItem.js +28 -28
  391. package/cjs/Thread/components/ThreadHeader.js +7 -7
  392. package/cjs/Thread/components/ThreadList.js +46 -46
  393. package/cjs/Thread/components/ThreadListItem.js +46 -46
  394. package/cjs/Thread/components/ThreadMessageInput.js +49 -48
  395. package/cjs/Thread/components/ThreadMessageInput.js.map +1 -1
  396. package/cjs/Thread/components/ThreadUI.js +56 -56
  397. package/cjs/Thread/context.js +9 -9
  398. package/cjs/Thread.js +56 -56
  399. package/cjs/VoicePlayer/context.js +3 -3
  400. package/cjs/VoicePlayer/useVoicePlayer.js +10 -10
  401. package/cjs/VoiceRecorder/context.js +10 -10
  402. package/cjs/VoiceRecorder/useVoiceRecorder.js +9 -9
  403. package/cjs/chunks/{bundle-6Ucv_cXK.js → bundle-0FJbDLYK.js} +1 -1
  404. package/cjs/chunks/bundle-0FJbDLYK.js.map +1 -0
  405. package/cjs/chunks/{bundle-xn7dyz1d.js → bundle-0Io7rZH6.js} +3 -3
  406. package/cjs/chunks/bundle-0Io7rZH6.js.map +1 -0
  407. package/cjs/chunks/{bundle-HmF0Kwa_.js → bundle-0RoC5AKT.js} +4 -4
  408. package/cjs/chunks/bundle-0RoC5AKT.js.map +1 -0
  409. package/cjs/chunks/{bundle-6JAbouBn.js → bundle-0SKvTM5F.js} +1 -1
  410. package/cjs/chunks/bundle-0SKvTM5F.js.map +1 -0
  411. package/cjs/chunks/{bundle-bc3_Ej1J.js → bundle-0X7q6NtR.js} +5 -5
  412. package/cjs/chunks/bundle-0X7q6NtR.js.map +1 -0
  413. package/cjs/chunks/{bundle-2QTmv8Qr.js → bundle-1BET8ZYY.js} +1 -1
  414. package/cjs/chunks/bundle-1BET8ZYY.js.map +1 -0
  415. package/cjs/chunks/{bundle-UAlBT2_3.js → bundle-2-AYfw-C.js} +10 -7
  416. package/cjs/chunks/bundle-2-AYfw-C.js.map +1 -0
  417. package/cjs/chunks/{bundle-oK2GZVsW.js → bundle-2dTv415Y.js} +3 -3
  418. package/cjs/chunks/bundle-2dTv415Y.js.map +1 -0
  419. package/cjs/chunks/{bundle-hyQekvQu.js → bundle-3uSGqV8n.js} +1 -1
  420. package/cjs/chunks/bundle-3uSGqV8n.js.map +1 -0
  421. package/cjs/chunks/{bundle-vDdmiX8M.js → bundle-4jhVxof3.js} +10 -10
  422. package/cjs/chunks/{bundle-vDdmiX8M.js.map → bundle-4jhVxof3.js.map} +1 -1
  423. package/cjs/chunks/{bundle-B3jNx9nI.js → bundle-5_1l38DN.js} +2 -2
  424. package/cjs/chunks/bundle-5_1l38DN.js.map +1 -0
  425. package/cjs/chunks/{bundle-Y6oHbdhN.js → bundle-5i9-ntZ5.js} +7 -3
  426. package/cjs/chunks/bundle-5i9-ntZ5.js.map +1 -0
  427. package/cjs/chunks/{bundle-fWvwYg6I.js → bundle-5zZ25-q8.js} +1 -1
  428. package/cjs/chunks/bundle-5zZ25-q8.js.map +1 -0
  429. package/cjs/chunks/{bundle-aLKN26Lx.js → bundle-8JrMDacP.js} +3 -3
  430. package/cjs/chunks/bundle-8JrMDacP.js.map +1 -0
  431. package/cjs/chunks/{bundle-l9rAnwws.js → bundle-9l41IWgC.js} +1 -1
  432. package/cjs/chunks/bundle-9l41IWgC.js.map +1 -0
  433. package/cjs/chunks/bundle-9oVHmbyo.js +106 -0
  434. package/cjs/chunks/bundle-9oVHmbyo.js.map +1 -0
  435. package/cjs/chunks/{bundle-ZIC4K68f.js → bundle-A45IMFSi.js} +1 -1
  436. package/cjs/chunks/bundle-A45IMFSi.js.map +1 -0
  437. package/cjs/chunks/{bundle-nZsWuDxZ.js → bundle-AjEjAHAy.js} +4 -4
  438. package/{chunks/bundle-ZOw_iEjI.js.map → cjs/chunks/bundle-AjEjAHAy.js.map} +1 -1
  439. package/cjs/chunks/{bundle-XpwayjqP.js → bundle-BdWL3kB4.js} +1 -1
  440. package/cjs/chunks/bundle-BdWL3kB4.js.map +1 -0
  441. package/cjs/chunks/{bundle-YTPSevv5.js → bundle-DKAurwqI.js} +4 -4
  442. package/cjs/chunks/{bundle-YTPSevv5.js.map → bundle-DKAurwqI.js.map} +1 -1
  443. package/cjs/chunks/{bundle-POnqXMLV.js → bundle-DsdDiOQc.js} +2 -2
  444. package/cjs/chunks/{bundle-POnqXMLV.js.map → bundle-DsdDiOQc.js.map} +1 -1
  445. package/cjs/chunks/{bundle-v-P7N839.js → bundle-EIBGC5ds.js} +3 -3
  446. package/cjs/chunks/bundle-EIBGC5ds.js.map +1 -0
  447. package/cjs/chunks/{bundle-j2b4bxU3.js → bundle-EPgJPeP5.js} +2 -2
  448. package/cjs/chunks/bundle-EPgJPeP5.js.map +1 -0
  449. package/cjs/chunks/{bundle-gKpM7okd.js → bundle-FYiANS7I.js} +1 -1
  450. package/cjs/chunks/bundle-FYiANS7I.js.map +1 -0
  451. package/cjs/chunks/{bundle-JutD2hKN.js → bundle-Gw-7KmmG.js} +8 -3
  452. package/cjs/chunks/{bundle-JutD2hKN.js.map → bundle-Gw-7KmmG.js.map} +1 -1
  453. package/cjs/chunks/{bundle-7S9cQ7Sp.js → bundle-HdAqAQmQ.js} +2 -2
  454. package/cjs/chunks/bundle-HdAqAQmQ.js.map +1 -0
  455. package/cjs/chunks/{bundle-fE1EYcSx.js → bundle-JuSRYTO4.js} +1 -1
  456. package/cjs/chunks/bundle-JuSRYTO4.js.map +1 -0
  457. package/cjs/chunks/{bundle-hCnt57_4.js → bundle-KEItFRlq.js} +8 -8
  458. package/cjs/chunks/{bundle-hCnt57_4.js.map → bundle-KEItFRlq.js.map} +1 -1
  459. package/cjs/chunks/{bundle-JllM1Vt3.js → bundle-M7S2ba5_.js} +10 -10
  460. package/cjs/chunks/bundle-M7S2ba5_.js.map +1 -0
  461. package/cjs/chunks/{bundle-lqO2HtRG.js → bundle-Myh0hGtf.js} +6 -6
  462. package/cjs/chunks/bundle-Myh0hGtf.js.map +1 -0
  463. package/cjs/chunks/{bundle-FnDHXB2d.js → bundle-NSfuzonk.js} +10 -20
  464. package/cjs/chunks/{bundle-FnDHXB2d.js.map → bundle-NSfuzonk.js.map} +1 -1
  465. package/cjs/chunks/{bundle-j5InjWst.js → bundle-OypRlCX4.js} +1 -1
  466. package/cjs/chunks/bundle-OypRlCX4.js.map +1 -0
  467. package/cjs/chunks/{bundle-d1u7R12O.js → bundle-PXqEjKnZ.js} +1 -1
  468. package/cjs/chunks/bundle-PXqEjKnZ.js.map +1 -0
  469. package/cjs/chunks/{bundle-Ulv5XabQ.js → bundle-QvRptclZ.js} +2 -2
  470. package/cjs/chunks/bundle-QvRptclZ.js.map +1 -0
  471. package/cjs/chunks/{bundle-rGIlrKQw.js → bundle-RK7_ZCh1.js} +1 -1
  472. package/cjs/chunks/bundle-RK7_ZCh1.js.map +1 -0
  473. package/cjs/chunks/{bundle-jjYDBqPB.js → bundle-RceCnDam.js} +4 -4
  474. package/cjs/chunks/{bundle-jjYDBqPB.js.map → bundle-RceCnDam.js.map} +1 -1
  475. package/cjs/chunks/{bundle-19RYdLTI.js → bundle-RngV4SHM.js} +3 -3
  476. package/cjs/chunks/{bundle-19RYdLTI.js.map → bundle-RngV4SHM.js.map} +1 -1
  477. package/cjs/chunks/{bundle-LZMOuc2b.js → bundle-SWOq3kxG.js} +1 -1
  478. package/cjs/chunks/{bundle-LZMOuc2b.js.map → bundle-SWOq3kxG.js.map} +1 -1
  479. package/cjs/chunks/{bundle-g3vASPp8.js → bundle-Sk9Qqzuj.js} +2 -2
  480. package/cjs/chunks/bundle-Sk9Qqzuj.js.map +1 -0
  481. package/cjs/chunks/{bundle-lZm_4ToV.js → bundle-Sxjv83JD.js} +3 -3
  482. package/cjs/chunks/bundle-Sxjv83JD.js.map +1 -0
  483. package/cjs/chunks/{bundle-eg639gtv.js → bundle-UOOPIGjG.js} +1 -1
  484. package/cjs/chunks/bundle-UOOPIGjG.js.map +1 -0
  485. package/cjs/chunks/{bundle-65WXfVqV.js → bundle-VBjH2Gyx.js} +2 -2
  486. package/cjs/chunks/{bundle-65WXfVqV.js.map → bundle-VBjH2Gyx.js.map} +1 -1
  487. package/cjs/chunks/{bundle-D_9GebqZ.js → bundle-Vsy2G1YZ.js} +1 -1
  488. package/cjs/chunks/bundle-Vsy2G1YZ.js.map +1 -0
  489. package/cjs/chunks/{bundle-w1sEa7O0.js → bundle-W4lK9aC2.js} +1 -1
  490. package/cjs/chunks/bundle-W4lK9aC2.js.map +1 -0
  491. package/cjs/chunks/{bundle-CQGJhJYV.js → bundle-WALfBkn-.js} +2 -2
  492. package/cjs/chunks/bundle-WALfBkn-.js.map +1 -0
  493. package/cjs/chunks/{bundle-Z9uYBAUt.js → bundle-ZFhZ9UyN.js} +3 -3
  494. package/cjs/chunks/bundle-ZFhZ9UyN.js.map +1 -0
  495. package/cjs/chunks/{bundle-yyOx7Krk.js → bundle-_1OqWxYy.js} +4 -4
  496. package/cjs/chunks/bundle-_1OqWxYy.js.map +1 -0
  497. package/cjs/chunks/{bundle-8sRp5L6V.js → bundle-_Hwf9prH.js} +1 -1
  498. package/cjs/chunks/bundle-_Hwf9prH.js.map +1 -0
  499. package/cjs/chunks/{bundle-M_3VvtOr.js → bundle-aCCpTlSC.js} +10 -10
  500. package/cjs/chunks/bundle-aCCpTlSC.js.map +1 -0
  501. package/cjs/chunks/{bundle-RHwdkbbz.js → bundle-aggH3_MP.js} +1 -1
  502. package/cjs/chunks/bundle-aggH3_MP.js.map +1 -0
  503. package/cjs/chunks/{bundle-6D2HDCsi.js → bundle-b3QK79hX.js} +4 -4
  504. package/cjs/chunks/bundle-b3QK79hX.js.map +1 -0
  505. package/cjs/chunks/{bundle-bSoYSPA5.js → bundle-bOij3dXU.js} +1 -1
  506. package/cjs/chunks/bundle-bOij3dXU.js.map +1 -0
  507. package/cjs/chunks/bundle-csbD2FCX.js +1692 -0
  508. package/cjs/chunks/bundle-csbD2FCX.js.map +1 -0
  509. package/cjs/chunks/{bundle-WQOvDsOP.js → bundle-ctM9C4Ol.js} +1 -1
  510. package/cjs/chunks/bundle-ctM9C4Ol.js.map +1 -0
  511. package/cjs/chunks/{bundle-ivu3uDBu.js → bundle-eVmdXbX4.js} +3 -3
  512. package/cjs/chunks/bundle-eVmdXbX4.js.map +1 -0
  513. package/cjs/chunks/{bundle-L3zb8Cu_.js → bundle-gaTYF6lz.js} +3 -3
  514. package/cjs/chunks/bundle-gaTYF6lz.js.map +1 -0
  515. package/cjs/chunks/{bundle-yzN-MQRB.js → bundle-hfoBchbF.js} +1 -1
  516. package/cjs/chunks/bundle-hfoBchbF.js.map +1 -0
  517. package/cjs/chunks/{bundle-uQ09rpIX.js → bundle-infYodZG.js} +10 -10
  518. package/{chunks/bundle-FS7VoABk.js.map → cjs/chunks/bundle-infYodZG.js.map} +1 -1
  519. package/cjs/chunks/{bundle-OayM7MBH.js → bundle-lREr-1Hy.js} +68 -90
  520. package/cjs/chunks/bundle-lREr-1Hy.js.map +1 -0
  521. package/cjs/chunks/{bundle-8gAAE7I3.js → bundle-nNgkSlET.js} +1 -1
  522. package/cjs/chunks/bundle-nNgkSlET.js.map +1 -0
  523. package/cjs/chunks/{bundle-lVg2xbe0.js → bundle-nR3C0oIw.js} +2 -2
  524. package/cjs/chunks/bundle-nR3C0oIw.js.map +1 -0
  525. package/cjs/chunks/{bundle-v6rdnF1q.js → bundle-nTv4XhjL.js} +1 -1
  526. package/cjs/chunks/bundle-nTv4XhjL.js.map +1 -0
  527. package/cjs/chunks/{bundle-O3DZBV2p.js → bundle-nvUhM4Jt.js} +1 -1
  528. package/cjs/chunks/bundle-nvUhM4Jt.js.map +1 -0
  529. package/cjs/chunks/{bundle-hdKCnGri.js → bundle-pc4CZYj5.js} +3 -3
  530. package/cjs/chunks/{bundle-hdKCnGri.js.map → bundle-pc4CZYj5.js.map} +1 -1
  531. package/cjs/chunks/{bundle-_N5y1qEg.js → bundle-qD5w2tyR.js} +8 -2
  532. package/cjs/chunks/bundle-qD5w2tyR.js.map +1 -0
  533. package/cjs/chunks/{bundle-HQUEIVST.js → bundle-qYN98FNj.js} +1 -1
  534. package/cjs/chunks/{bundle-HQUEIVST.js.map → bundle-qYN98FNj.js.map} +1 -1
  535. package/cjs/chunks/{bundle-qlTSWGy9.js → bundle-rdAhtJum.js} +40 -5
  536. package/cjs/chunks/bundle-rdAhtJum.js.map +1 -0
  537. package/cjs/chunks/{bundle-tCIy9Pcv.js → bundle-sYYqa58y.js} +17 -17
  538. package/cjs/chunks/{bundle-tCIy9Pcv.js.map → bundle-sYYqa58y.js.map} +1 -1
  539. package/cjs/chunks/{bundle-OLmZ2fUV.js → bundle-tBuSzzHI.js} +2 -2
  540. package/{chunks/bundle-InXDhFjw.js.map → cjs/chunks/bundle-tBuSzzHI.js.map} +1 -1
  541. package/cjs/chunks/{bundle-GYpm7RtY.js → bundle-tMR11mG8.js} +1 -1
  542. package/cjs/chunks/bundle-tMR11mG8.js.map +1 -0
  543. package/cjs/chunks/{bundle-G4olPx81.js → bundle-unTPt0Np.js} +1 -1
  544. package/cjs/chunks/bundle-unTPt0Np.js.map +1 -0
  545. package/cjs/chunks/{bundle-EmZI0-j-.js → bundle-uyvcZB8I.js} +1 -1
  546. package/cjs/chunks/bundle-uyvcZB8I.js.map +1 -0
  547. package/cjs/chunks/{bundle-y0sGF4RD.js → bundle-vj7Nj0B0.js} +6 -6
  548. package/cjs/chunks/bundle-vj7Nj0B0.js.map +1 -0
  549. package/cjs/chunks/{bundle-THKiylQP.js → bundle-wbFvXCMi.js} +5 -5
  550. package/cjs/chunks/bundle-wbFvXCMi.js.map +1 -0
  551. package/cjs/chunks/{bundle-dibCo5Mv.js → bundle-xNnngzve.js} +5 -5
  552. package/cjs/chunks/bundle-xNnngzve.js.map +1 -0
  553. package/cjs/chunks/{bundle-jI4fSOuZ.js → bundle-xbuS1NJI.js} +1 -1
  554. package/cjs/chunks/bundle-xbuS1NJI.js.map +1 -0
  555. package/cjs/chunks/{bundle-apUHizVu.js → bundle-xe1wuNko.js} +3 -3
  556. package/cjs/chunks/bundle-xe1wuNko.js.map +1 -0
  557. package/cjs/chunks/{bundle-him8B6lQ.js → bundle-xhP3_T1A.js} +6 -6
  558. package/cjs/chunks/bundle-xhP3_T1A.js.map +1 -0
  559. package/cjs/chunks/{bundle-do_4Y2S_.js → bundle-xtUT3duD.js} +4 -1
  560. package/cjs/chunks/bundle-xtUT3duD.js.map +1 -0
  561. package/cjs/chunks/{bundle-XSrDHwxE.js → bundle-yQR_oAnV.js} +1 -1
  562. package/cjs/chunks/bundle-yQR_oAnV.js.map +1 -0
  563. package/cjs/chunks/{bundle-0Ju2qhN6.js → bundle-zhrtSnPT.js} +11 -11
  564. package/cjs/chunks/{bundle-0Ju2qhN6.js.map → bundle-zhrtSnPT.js.map} +1 -1
  565. package/cjs/chunks/{bundle-pNPHZO_X.js → bundle-zkMvSSgq.js} +5 -5
  566. package/cjs/chunks/bundle-zkMvSSgq.js.map +1 -0
  567. package/cjs/hooks/useModal.js +9 -9
  568. package/cjs/index.js +83 -79
  569. package/cjs/index.js.map +1 -1
  570. package/cjs/pubSub/topics.js +1 -1
  571. package/cjs/sendbirdSelectors.js +2 -2
  572. package/cjs/ui/Accordion.js +3 -3
  573. package/cjs/ui/AccordionGroup.js +2 -2
  574. package/cjs/ui/AdminMessage.js +3 -3
  575. package/cjs/ui/Avatar.js +4 -4
  576. package/cjs/ui/Badge.js +5 -5
  577. package/cjs/ui/BottomSheet.js +9 -9
  578. package/cjs/ui/Button.js +3 -3
  579. package/cjs/ui/ChannelAvatar.js +5 -5
  580. package/cjs/ui/ConnectionStatus.js +6 -6
  581. package/cjs/ui/ContextMenu.js +6 -6
  582. package/cjs/ui/DateSeparator.js +4 -4
  583. package/cjs/ui/EmojiReactions.js +16 -16
  584. package/cjs/ui/FallbackTemplateMessageItemBody.tsx.js +34 -0
  585. package/cjs/ui/FallbackTemplateMessageItemBody.tsx.js.map +1 -0
  586. package/cjs/ui/FileMessageItemBody.js +8 -8
  587. package/cjs/ui/FileViewer.js +15 -15
  588. package/cjs/ui/Icon.js +4 -2
  589. package/cjs/ui/Icon.js.map +1 -1
  590. package/cjs/ui/IconButton.js +1 -1
  591. package/cjs/ui/ImageRenderer.js +10 -15
  592. package/cjs/ui/ImageRenderer.js.map +1 -1
  593. package/cjs/ui/Input.js +3 -3
  594. package/cjs/ui/Label.js +3 -3
  595. package/cjs/ui/LinkLabel.js +3 -3
  596. package/cjs/ui/Loader.js +2 -2
  597. package/cjs/ui/LoadingTemplateMessageItemBody.tsx.js +29 -0
  598. package/cjs/ui/LoadingTemplateMessageItemBody.tsx.js.map +1 -0
  599. package/cjs/ui/MentionLabel.js +13 -13
  600. package/cjs/ui/MentionUserLabel.js +1 -1
  601. package/cjs/ui/MessageContent.js +93 -50
  602. package/cjs/ui/MessageContent.js.map +1 -1
  603. package/cjs/ui/MessageInput/hooks/usePaste.js +7 -5
  604. package/cjs/ui/MessageInput/hooks/usePaste.js.map +1 -1
  605. package/cjs/ui/MessageInput.js +32 -68
  606. package/cjs/ui/MessageInput.js.map +1 -1
  607. package/cjs/ui/MessageItemMenu.js +10 -10
  608. package/cjs/ui/MessageItemReactionMenu.js +9 -9
  609. package/cjs/ui/MessageSearchFileItem.js +14 -14
  610. package/cjs/ui/MessageSearchItem.js +11 -11
  611. package/cjs/ui/MessageStatus.js +12 -12
  612. package/cjs/ui/MessageTemplate.js +12 -0
  613. package/cjs/ui/MessageTemplate.js.map +1 -0
  614. package/cjs/ui/MobileFeedbackMenu.js +9 -9
  615. package/cjs/ui/Modal.js +8 -8
  616. package/cjs/ui/MutedAvatarOverlay.js +2 -2
  617. package/cjs/ui/OGMessageItemBody.js +16 -16
  618. package/cjs/ui/OpenChannelAdminMessage.js +3 -3
  619. package/cjs/ui/OpenChannelAvatar.js +8 -8
  620. package/cjs/ui/OpenchannelConversationHeader.js +8 -8
  621. package/cjs/ui/OpenchannelFileMessage.js +18 -18
  622. package/cjs/ui/OpenchannelOGMessage.js +20 -20
  623. package/cjs/ui/OpenchannelThumbnailMessage.js +17 -17
  624. package/cjs/ui/OpenchannelUserMessage.js +18 -18
  625. package/cjs/ui/PlaceHolder.js +6 -6
  626. package/cjs/ui/PlaybackTime.js +3 -3
  627. package/cjs/ui/QuoteMessage.js +9 -9
  628. package/cjs/ui/QuoteMessageInput.js +9 -9
  629. package/cjs/ui/ReactionBadge.js +3 -3
  630. package/cjs/ui/ReactionButton.js +4 -4
  631. package/cjs/ui/SortByRow.js +2 -2
  632. package/cjs/ui/TemplateMessageItemBody.js +245 -0
  633. package/cjs/ui/TemplateMessageItemBody.js.map +1 -0
  634. package/cjs/ui/TextButton.js +2 -2
  635. package/cjs/ui/TextMessageItemBody.js +16 -16
  636. package/cjs/ui/ThreadReplies.js +8 -8
  637. package/cjs/ui/ThumbnailMessageItemBody.js +7 -7
  638. package/cjs/ui/Toggle.js +1 -1
  639. package/cjs/ui/Tooltip.js +3 -3
  640. package/cjs/ui/TooltipWrapper.js +1 -1
  641. package/cjs/ui/TypingIndicatorBubble.js +4 -4
  642. package/cjs/ui/UnknownMessageItemBody.js +7 -7
  643. package/cjs/ui/UserListItem.js +13 -13
  644. package/cjs/ui/UserProfile.js +10 -10
  645. package/cjs/ui/VoiceMessageInput.js +9 -9
  646. package/cjs/ui/VoiceMessageItemBody.js +10 -10
  647. package/cjs/ui/Word.js +13 -13
  648. package/cjs/useSendbirdStateContext.js +1 -1
  649. package/cjs/utils/message/isVoiceMessage.js +3 -3
  650. package/cjs/withSendbird.js +1 -1
  651. package/dist/index.css +207 -62
  652. package/dist/index.css.map +1 -1
  653. package/hooks/useModal.js +10 -10
  654. package/index.js +83 -79
  655. package/index.js.map +1 -1
  656. package/package.json +41 -4
  657. package/pubSub/topics.js +1 -1
  658. package/sendbirdSelectors.js +2 -2
  659. package/types/hooks/useAsyncRequest.d.ts +20 -0
  660. package/types/lib/dux/appInfo/actionTypes.d.ts +25 -0
  661. package/types/lib/dux/appInfo/initialState.d.ts +22 -0
  662. package/types/lib/dux/appInfo/reducers.d.ts +3 -0
  663. package/types/lib/dux/appInfo/utils.d.ts +7 -0
  664. package/types/lib/hooks/useConnect/__test__/data.mocks.d.ts +3 -2
  665. package/types/lib/hooks/useConnect/connect.d.ts +1 -1
  666. package/types/lib/hooks/useConnect/setupConnection.d.ts +1 -1
  667. package/types/lib/hooks/useConnect/types.d.ts +6 -3
  668. package/types/lib/hooks/useMessageTemplateUtils.d.ts +18 -0
  669. package/types/lib/types.d.ts +14 -0
  670. package/types/modules/Channel/components/ChannelUI/index.d.ts +4 -0
  671. package/types/modules/Channel/components/MessageInputWrapper/index.d.ts +4 -3
  672. package/types/modules/Channel/components/MessageList/index.d.ts +8 -2
  673. package/types/modules/Channel/context/ChannelProvider.d.ts +7 -15
  674. package/types/modules/Channel/context/const.d.ts +1 -7
  675. package/types/modules/Channel/context/dux/actionTypes.d.ts +6 -7
  676. package/types/modules/ChannelSettings/components/ChannelSettingsUI/index.d.ts +2 -1
  677. package/types/modules/ChannelSettings/context/ChannelSettingsProvider.d.ts +5 -5
  678. package/types/modules/GroupChannel/components/GroupChannelUI/GroupChannelUIView.d.ts +47 -0
  679. package/types/modules/GroupChannel/components/Message/MessageView.d.ts +23 -1
  680. package/types/modules/GroupChannel/components/MessageInputWrapper/index.d.ts +5 -3
  681. package/types/modules/GroupChannel/components/MessageList/index.d.ts +30 -9
  682. package/types/modules/GroupChannel/components/MessageTemplateWrapper/index.d.ts +8 -0
  683. package/types/modules/GroupChannel/components/SuggestedReplies/index.d.ts +4 -2
  684. package/types/modules/GroupChannel/context/GroupChannelProvider.d.ts +1 -1
  685. package/types/types.d.ts +1 -0
  686. package/types/ui/Icon/colors.d.ts +2 -0
  687. package/types/ui/Icon/index.d.ts +1 -0
  688. package/types/ui/Label/index.d.ts +2 -0
  689. package/types/ui/Label/stringSet.d.ts +3 -0
  690. package/types/ui/Label/types.d.ts +2 -0
  691. package/types/ui/Label/utils.d.ts +1 -1
  692. package/types/ui/LinkLabel/index.d.ts +2 -0
  693. package/types/ui/MessageContent/index.d.ts +3 -1
  694. package/types/ui/MessageInput/index.d.ts +1 -0
  695. package/types/ui/MessageInput/utils.d.ts +4 -0
  696. package/types/ui/MessageTemplate/index.d.ts +8 -0
  697. package/types/ui/TemplateMessageItemBody/FallbackTemplateMessageItemBody.d.ts +9 -0
  698. package/types/ui/TemplateMessageItemBody/LoadingTemplateMessageItemBody.d.ts +7 -0
  699. package/types/ui/TemplateMessageItemBody/index.d.ts +12 -0
  700. package/types/ui/TemplateMessageItemBody/types.d.ts +96 -0
  701. package/types/ui/TemplateMessageItemBody/utils/flattenObject.d.ts +7 -0
  702. package/types/ui/TemplateMessageItemBody/utils/mapData.d.ts +7 -0
  703. package/types/ui/TemplateMessageItemBody/utils/restoreNumbersFromMessageTemplateObject.d.ts +1 -0
  704. package/types/ui/TemplateMessageItemBody/utils/selectColorVariablesByTheme.d.ts +6 -0
  705. package/types/utils/consts.d.ts +2 -0
  706. package/types/utils/index.d.ts +1 -0
  707. package/ui/Accordion.js +3 -3
  708. package/ui/AccordionGroup.js +2 -2
  709. package/ui/AdminMessage.js +3 -3
  710. package/ui/Avatar.js +4 -4
  711. package/ui/Badge.js +5 -5
  712. package/ui/BottomSheet.js +9 -9
  713. package/ui/Button.js +3 -3
  714. package/ui/ChannelAvatar.js +5 -5
  715. package/ui/ConnectionStatus.js +6 -6
  716. package/ui/ContextMenu.js +6 -6
  717. package/ui/DateSeparator.js +4 -4
  718. package/ui/EmojiReactions.js +16 -16
  719. package/ui/FallbackTemplateMessageItemBody.tsx.js +29 -0
  720. package/ui/FallbackTemplateMessageItemBody.tsx.js.map +1 -0
  721. package/ui/FileMessageItemBody.js +8 -8
  722. package/ui/FileViewer.js +15 -15
  723. package/ui/Icon.js +4 -2
  724. package/ui/Icon.js.map +1 -1
  725. package/ui/IconButton.js +1 -1
  726. package/ui/ImageRenderer.js +10 -15
  727. package/ui/ImageRenderer.js.map +1 -1
  728. package/ui/Input.js +3 -3
  729. package/ui/Label.js +3 -3
  730. package/ui/LinkLabel.js +3 -3
  731. package/ui/Loader.js +2 -2
  732. package/ui/LoadingTemplateMessageItemBody.tsx.js +24 -0
  733. package/ui/LoadingTemplateMessageItemBody.tsx.js.map +1 -0
  734. package/ui/MentionLabel.js +13 -13
  735. package/ui/MentionUserLabel.js +1 -1
  736. package/ui/MessageContent.js +93 -50
  737. package/ui/MessageContent.js.map +1 -1
  738. package/ui/MessageInput/hooks/usePaste.js +7 -5
  739. package/ui/MessageInput/hooks/usePaste.js.map +1 -1
  740. package/ui/MessageInput.js +32 -68
  741. package/ui/MessageInput.js.map +1 -1
  742. package/ui/MessageItemMenu.js +10 -10
  743. package/ui/MessageItemReactionMenu.js +9 -9
  744. package/ui/MessageSearchFileItem.js +14 -14
  745. package/ui/MessageSearchItem.js +11 -11
  746. package/ui/MessageStatus.js +12 -12
  747. package/ui/MessageTemplate.js +3 -0
  748. package/ui/MessageTemplate.js.map +1 -0
  749. package/ui/MobileFeedbackMenu.js +9 -9
  750. package/ui/Modal.js +8 -8
  751. package/ui/MutedAvatarOverlay.js +2 -2
  752. package/ui/OGMessageItemBody.js +16 -16
  753. package/ui/OpenChannelAdminMessage.js +3 -3
  754. package/ui/OpenChannelAvatar.js +8 -8
  755. package/ui/OpenchannelConversationHeader.js +8 -8
  756. package/ui/OpenchannelFileMessage.js +18 -18
  757. package/ui/OpenchannelOGMessage.js +20 -20
  758. package/ui/OpenchannelThumbnailMessage.js +17 -17
  759. package/ui/OpenchannelUserMessage.js +18 -18
  760. package/ui/PlaceHolder.js +6 -6
  761. package/ui/PlaybackTime.js +3 -3
  762. package/ui/QuoteMessage.js +9 -9
  763. package/ui/QuoteMessageInput.js +9 -9
  764. package/ui/ReactionBadge.js +3 -3
  765. package/ui/ReactionButton.js +4 -4
  766. package/ui/SortByRow.js +2 -2
  767. package/ui/TemplateMessageItemBody.js +240 -0
  768. package/ui/TemplateMessageItemBody.js.map +1 -0
  769. package/ui/TextButton.js +2 -2
  770. package/ui/TextMessageItemBody.js +16 -16
  771. package/ui/ThreadReplies.js +8 -8
  772. package/ui/ThumbnailMessageItemBody.js +7 -7
  773. package/ui/Toggle.js +1 -1
  774. package/ui/Tooltip.js +3 -3
  775. package/ui/TooltipWrapper.js +1 -1
  776. package/ui/TypingIndicatorBubble.js +4 -4
  777. package/ui/UnknownMessageItemBody.js +7 -7
  778. package/ui/UserListItem.js +13 -13
  779. package/ui/UserProfile.js +10 -10
  780. package/ui/VoiceMessageInput.js +9 -9
  781. package/ui/VoiceMessageItemBody.js +10 -10
  782. package/ui/Word.js +13 -13
  783. package/useSendbirdStateContext.js +1 -1
  784. package/utils/message/isVoiceMessage.js +3 -3
  785. package/withSendbird.js +1 -1
  786. package/chunks/bundle--bzcDcV7.js.map +0 -1
  787. package/chunks/bundle-1Wok5yjx.js.map +0 -1
  788. package/chunks/bundle-29ZwEQCB.js.map +0 -1
  789. package/chunks/bundle-42MD-_6f.js.map +0 -1
  790. package/chunks/bundle-5cA2H0cQ.js.map +0 -1
  791. package/chunks/bundle-5qVfPYXm.js.map +0 -1
  792. package/chunks/bundle-7-k9ar1S.js.map +0 -1
  793. package/chunks/bundle-7gmFtphc.js.map +0 -1
  794. package/chunks/bundle-B3ETdLpu.js.map +0 -1
  795. package/chunks/bundle-CBZRgcMe.js.map +0 -1
  796. package/chunks/bundle-FMptIFTe.js.map +0 -1
  797. package/chunks/bundle-H1vLRvsQ.js.map +0 -1
  798. package/chunks/bundle-HIwSRGfa.js.map +0 -1
  799. package/chunks/bundle-IGjDRlEq.js.map +0 -1
  800. package/chunks/bundle-JVFq7QiY.js.map +0 -1
  801. package/chunks/bundle-MVZc-WX7.js.map +0 -1
  802. package/chunks/bundle-NRvvlX8r.js.map +0 -1
  803. package/chunks/bundle-OGLIDsv0.js.map +0 -1
  804. package/chunks/bundle-PXF29EwZ.js.map +0 -1
  805. package/chunks/bundle-PrPMpr0d.js.map +0 -1
  806. package/chunks/bundle-QDjzCG-h.js.map +0 -1
  807. package/chunks/bundle-R_8mFuwU.js.map +0 -1
  808. package/chunks/bundle-S3i59_HU.js.map +0 -1
  809. package/chunks/bundle-TWhlUSzV.js.map +0 -1
  810. package/chunks/bundle-ThaFnyA3.js.map +0 -1
  811. package/chunks/bundle-VTgol5b8.js.map +0 -1
  812. package/chunks/bundle-WJ0Rx9Vt.js.map +0 -1
  813. package/chunks/bundle-WJbfhl8B.js.map +0 -1
  814. package/chunks/bundle-WkSXViPf.js.map +0 -1
  815. package/chunks/bundle-YK6gNh-t.js.map +0 -1
  816. package/chunks/bundle-Yc91ktUe.js.map +0 -1
  817. package/chunks/bundle-YcH_HSha.js.map +0 -1
  818. package/chunks/bundle-ZrmeY8rp.js.map +0 -1
  819. package/chunks/bundle-aU9DrOs1.js.map +0 -1
  820. package/chunks/bundle-ammXYCNc.js.map +0 -1
  821. package/chunks/bundle-dPtRdKjv.js.map +0 -1
  822. package/chunks/bundle-e_hMfMVC.js.map +0 -1
  823. package/chunks/bundle-fIf1YwSi.js.map +0 -1
  824. package/chunks/bundle-fdlrWGps.js.map +0 -1
  825. package/chunks/bundle-hTd1NizA.js.map +0 -1
  826. package/chunks/bundle-hwjo__1w.js.map +0 -1
  827. package/chunks/bundle-iRd3nywJ.js.map +0 -1
  828. package/chunks/bundle-jIsbkecD.js.map +0 -1
  829. package/chunks/bundle-laqNvtHc.js.map +0 -1
  830. package/chunks/bundle-mXxUWu6C.js.map +0 -1
  831. package/chunks/bundle-mbVaGxy-.js.map +0 -1
  832. package/chunks/bundle-sPCqUzdP.js.map +0 -1
  833. package/chunks/bundle-yMF6_bQS.js.map +0 -1
  834. package/chunks/bundle-z995fH4M.js.map +0 -1
  835. package/chunks/bundle-zftI06HH.js.map +0 -1
  836. package/chunks/bundle-zr28rXX0.js.map +0 -1
  837. package/cjs/chunks/bundle-2QTmv8Qr.js.map +0 -1
  838. package/cjs/chunks/bundle-6D2HDCsi.js.map +0 -1
  839. package/cjs/chunks/bundle-6JAbouBn.js.map +0 -1
  840. package/cjs/chunks/bundle-6Ucv_cXK.js.map +0 -1
  841. package/cjs/chunks/bundle-7S9cQ7Sp.js.map +0 -1
  842. package/cjs/chunks/bundle-8gAAE7I3.js.map +0 -1
  843. package/cjs/chunks/bundle-8sRp5L6V.js.map +0 -1
  844. package/cjs/chunks/bundle-B3jNx9nI.js.map +0 -1
  845. package/cjs/chunks/bundle-D_9GebqZ.js.map +0 -1
  846. package/cjs/chunks/bundle-EmZI0-j-.js.map +0 -1
  847. package/cjs/chunks/bundle-G4olPx81.js.map +0 -1
  848. package/cjs/chunks/bundle-GYpm7RtY.js.map +0 -1
  849. package/cjs/chunks/bundle-HmF0Kwa_.js.map +0 -1
  850. package/cjs/chunks/bundle-JllM1Vt3.js.map +0 -1
  851. package/cjs/chunks/bundle-L3zb8Cu_.js.map +0 -1
  852. package/cjs/chunks/bundle-M_3VvtOr.js.map +0 -1
  853. package/cjs/chunks/bundle-O3DZBV2p.js.map +0 -1
  854. package/cjs/chunks/bundle-OLmZ2fUV.js.map +0 -1
  855. package/cjs/chunks/bundle-OayM7MBH.js.map +0 -1
  856. package/cjs/chunks/bundle-RHwdkbbz.js.map +0 -1
  857. package/cjs/chunks/bundle-THKiylQP.js.map +0 -1
  858. package/cjs/chunks/bundle-UAlBT2_3.js.map +0 -1
  859. package/cjs/chunks/bundle-Ulv5XabQ.js.map +0 -1
  860. package/cjs/chunks/bundle-WQOvDsOP.js.map +0 -1
  861. package/cjs/chunks/bundle-XSrDHwxE.js.map +0 -1
  862. package/cjs/chunks/bundle-XpwayjqP.js.map +0 -1
  863. package/cjs/chunks/bundle-Y6oHbdhN.js.map +0 -1
  864. package/cjs/chunks/bundle-Z9uYBAUt.js.map +0 -1
  865. package/cjs/chunks/bundle-ZIC4K68f.js.map +0 -1
  866. package/cjs/chunks/bundle-_N5y1qEg.js.map +0 -1
  867. package/cjs/chunks/bundle-aLKN26Lx.js.map +0 -1
  868. package/cjs/chunks/bundle-apUHizVu.js.map +0 -1
  869. package/cjs/chunks/bundle-bSoYSPA5.js.map +0 -1
  870. package/cjs/chunks/bundle-bc3_Ej1J.js.map +0 -1
  871. package/cjs/chunks/bundle-d1u7R12O.js.map +0 -1
  872. package/cjs/chunks/bundle-dibCo5Mv.js.map +0 -1
  873. package/cjs/chunks/bundle-do_4Y2S_.js.map +0 -1
  874. package/cjs/chunks/bundle-eg639gtv.js.map +0 -1
  875. package/cjs/chunks/bundle-fE1EYcSx.js.map +0 -1
  876. package/cjs/chunks/bundle-fWvwYg6I.js.map +0 -1
  877. package/cjs/chunks/bundle-g3vASPp8.js.map +0 -1
  878. package/cjs/chunks/bundle-gKpM7okd.js.map +0 -1
  879. package/cjs/chunks/bundle-him8B6lQ.js.map +0 -1
  880. package/cjs/chunks/bundle-hyQekvQu.js.map +0 -1
  881. package/cjs/chunks/bundle-ivu3uDBu.js.map +0 -1
  882. package/cjs/chunks/bundle-j2b4bxU3.js.map +0 -1
  883. package/cjs/chunks/bundle-j5InjWst.js.map +0 -1
  884. package/cjs/chunks/bundle-jI4fSOuZ.js.map +0 -1
  885. package/cjs/chunks/bundle-l9rAnwws.js.map +0 -1
  886. package/cjs/chunks/bundle-lVg2xbe0.js.map +0 -1
  887. package/cjs/chunks/bundle-lZm_4ToV.js.map +0 -1
  888. package/cjs/chunks/bundle-lqO2HtRG.js.map +0 -1
  889. package/cjs/chunks/bundle-oK2GZVsW.js.map +0 -1
  890. package/cjs/chunks/bundle-pNPHZO_X.js.map +0 -1
  891. package/cjs/chunks/bundle-qlTSWGy9.js.map +0 -1
  892. package/cjs/chunks/bundle-rGIlrKQw.js.map +0 -1
  893. package/cjs/chunks/bundle-uQ09rpIX.js.map +0 -1
  894. package/cjs/chunks/bundle-v-P7N839.js.map +0 -1
  895. package/cjs/chunks/bundle-v6rdnF1q.js.map +0 -1
  896. package/cjs/chunks/bundle-w1sEa7O0.js.map +0 -1
  897. package/cjs/chunks/bundle-xn7dyz1d.js.map +0 -1
  898. package/cjs/chunks/bundle-y0sGF4RD.js.map +0 -1
  899. package/cjs/chunks/bundle-yyOx7Krk.js.map +0 -1
  900. package/cjs/chunks/bundle-yzN-MQRB.js.map +0 -1
@@ -0,0 +1,1692 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+
5
+ var ComponentType;
6
+ (function (ComponentType) {
7
+ ComponentType["Box"] = "box";
8
+ ComponentType["Text"] = "text";
9
+ ComponentType["Image"] = "image";
10
+ ComponentType["TextButton"] = "textButton";
11
+ ComponentType["ImageButton"] = "imageButton";
12
+ })(ComponentType || (ComponentType = {}));
13
+
14
+ // -------- Set property mapper
15
+ const MAPPER = () => undefined;
16
+ const createParser = (params) => {
17
+ const defaultMapper = (params === null || params === void 0 ? void 0 : params.defaultMapper) || MAPPER;
18
+ const mapper = {
19
+ defaultMapper,
20
+ mapBoxProps: (params === null || params === void 0 ? void 0 : params.mapBoxProps) || defaultMapper,
21
+ mapTextProps: (params === null || params === void 0 ? void 0 : params.mapTextProps) || defaultMapper,
22
+ mapImageProps: (params === null || params === void 0 ? void 0 : params.mapImageProps) || defaultMapper,
23
+ mapTextButtonProps: (params === null || params === void 0 ? void 0 : params.mapTextButtonProps) || defaultMapper,
24
+ mapImageButtonProps: (params === null || params === void 0 ? void 0 : params.mapImageButtonProps) || defaultMapper,
25
+ };
26
+ return {
27
+ parse(item, options) {
28
+ switch (item.type) {
29
+ case ComponentType.Box: {
30
+ return { properties: mapper.mapBoxProps(item, options) };
31
+ }
32
+ case ComponentType.Text: {
33
+ return { properties: mapper.mapTextProps(item, options) };
34
+ }
35
+ case ComponentType.Image: {
36
+ return { properties: mapper.mapImageProps(item, options) };
37
+ }
38
+ case ComponentType.TextButton: {
39
+ return { properties: mapper.mapTextButtonProps(item, options) };
40
+ }
41
+ case ComponentType.ImageButton: {
42
+ return { properties: mapper.mapImageButtonProps(item, options) };
43
+ }
44
+ default:
45
+ return { properties: undefined };
46
+ }
47
+ },
48
+ };
49
+ };
50
+
51
+ const FRAGMENT = ({ children }) => React.createElement(React.Fragment, null, children);
52
+ function createRenderer(params) {
53
+ var _a, _b, _c, _d, _e;
54
+ return {
55
+ box: ((_a = params === null || params === void 0 ? void 0 : params.views) === null || _a === void 0 ? void 0 : _a.box) || FRAGMENT,
56
+ text: ((_b = params === null || params === void 0 ? void 0 : params.views) === null || _b === void 0 ? void 0 : _b.text) || FRAGMENT,
57
+ image: ((_c = params === null || params === void 0 ? void 0 : params.views) === null || _c === void 0 ? void 0 : _c.image) || FRAGMENT,
58
+ imageButton: ((_d = params === null || params === void 0 ? void 0 : params.views) === null || _d === void 0 ? void 0 : _d.imageButton) || FRAGMENT,
59
+ textButton: ((_e = params === null || params === void 0 ? void 0 : params.views) === null || _e === void 0 ? void 0 : _e.textButton) || FRAGMENT,
60
+ };
61
+ }
62
+
63
+ var __rest$4 = (undefined && undefined.__rest) || function (s, e) {
64
+ var t = {};
65
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
66
+ t[p] = s[p];
67
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
68
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
69
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
70
+ t[p[i]] = s[p[i]];
71
+ }
72
+ return t;
73
+ };
74
+ const SizeContext = React.createContext({
75
+ sizes: {},
76
+ updateSize: () => { },
77
+ });
78
+ const SizeContextProvider = ({ children }) => {
79
+ const [sizes, setSizes] = React.useState({});
80
+ const updateSize = React.useCallback((_a) => {
81
+ var { id } = _a, rest = __rest$4(_a, ["id"]);
82
+ if (id) {
83
+ setSizes((prevSizes) => (Object.assign(Object.assign({}, prevSizes), { [id]: rest })));
84
+ }
85
+ }, []);
86
+ return React.createElement(SizeContext.Provider, { value: { sizes, updateSize } }, children);
87
+ };
88
+ const useSizeContext = () => React.useContext(SizeContext);
89
+
90
+ const memoize = (fn) => {
91
+ const cache = new Map();
92
+ const cached = function (val) {
93
+ return cache.has(val) ? cache.get(val) : cache.set(val, fn.call(this, val)) && cache.get(val);
94
+ };
95
+ cached.cache = cache;
96
+ return cached;
97
+ };
98
+ /**
99
+ * Generate each item's id by each item's array depth
100
+ */
101
+ const setTemplateItemId = memoize((data) => {
102
+ const addIdRecursively = (item, id) => {
103
+ if ('items' in item && (item === null || item === void 0 ? void 0 : item.items) != null) {
104
+ item.items.forEach((subItem, subIdx) => {
105
+ const subId = `${id}-${subIdx}`;
106
+ subItem.id = subId;
107
+ addIdRecursively(subItem, subId);
108
+ });
109
+ }
110
+ };
111
+ data.forEach((item, idx) => {
112
+ const id = `${idx}`;
113
+ item.id = id;
114
+ addIdRecursively(item, id);
115
+ });
116
+ return data;
117
+ });
118
+
119
+ var Layout;
120
+ (function (Layout) {
121
+ Layout["Row"] = "row";
122
+ Layout["Column"] = "column";
123
+ })(Layout || (Layout = {}));
124
+ var AlignValue;
125
+ (function (AlignValue) {
126
+ AlignValue["Center"] = "center";
127
+ AlignValue["Left"] = "left";
128
+ AlignValue["Right"] = "right";
129
+ AlignValue["Top"] = "top";
130
+ AlignValue["Bottom"] = "bottom";
131
+ })(AlignValue || (AlignValue = {}));
132
+ /**
133
+ * @description
134
+ * Caution: Numbers are passed as string types in the message template builder.
135
+ * Use `==` comparison instead of `===` comparison when using a regular enum instead of a string enum.
136
+ */
137
+ var FlexSizeSpecValue;
138
+ (function (FlexSizeSpecValue) {
139
+ FlexSizeSpecValue[FlexSizeSpecValue["FillParent"] = 0] = "FillParent";
140
+ FlexSizeSpecValue[FlexSizeSpecValue["WrapContent"] = 1] = "WrapContent";
141
+ })(FlexSizeSpecValue || (FlexSizeSpecValue = {}));
142
+ var FontWeight;
143
+ (function (FontWeight) {
144
+ FontWeight["Normal"] = "normal";
145
+ FontWeight["Bold"] = "bold";
146
+ })(FontWeight || (FontWeight = {}));
147
+ var MediaContentMode;
148
+ (function (MediaContentMode) {
149
+ MediaContentMode["AspectFit"] = "aspectFit";
150
+ MediaContentMode["AspectFill"] = "aspectFill";
151
+ MediaContentMode["ScalesToFill"] = "scalesToFill";
152
+ })(MediaContentMode || (MediaContentMode = {}));
153
+
154
+ const defaultProperties = {
155
+ rootLayout: Layout.Column,
156
+ view: {
157
+ size: {
158
+ width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
159
+ height: { type: 'flex', value: FlexSizeSpecValue.WrapContent },
160
+ },
161
+ },
162
+ box: {
163
+ layout: Layout.Row,
164
+ align: { vertical: AlignValue.Top, horizontal: AlignValue.Left },
165
+ },
166
+ };
167
+
168
+ const createMessageTemplate = (opts) => {
169
+ const Container = opts.Container || React.Fragment;
170
+ const UnknownMessage = opts.UnknownMessage || (() => null);
171
+ const parser = opts.parser || createParser();
172
+ const renderer = opts.renderer || createRenderer();
173
+ const MessageTemplateBase = (props) => {
174
+ var _a;
175
+ const renderItems = props.templateItems;
176
+ const parentLayout = (_a = props.parentLayout) !== null && _a !== void 0 ? _a : defaultProperties.box.layout;
177
+ return (React.createElement(React.Fragment, null, renderItems.map((item, index, siblings) => {
178
+ const { properties } = parser.parse(item, { parentLayout, elemIdx: index, siblings });
179
+ const props = {
180
+ key: index,
181
+ parentLayout,
182
+ parsedProperties: properties,
183
+ siblings,
184
+ };
185
+ switch (item.type) {
186
+ case ComponentType.Box: {
187
+ return (React.createElement(renderer.box, Object.assign({}, item, props),
188
+ React.createElement(MessageTemplateBase, { templateItems: item.items || [], parentLayout: item.layout })));
189
+ }
190
+ case ComponentType.Text: {
191
+ return React.createElement(renderer.text, Object.assign({}, item, props));
192
+ }
193
+ case ComponentType.Image: {
194
+ return React.createElement(renderer.image, Object.assign({}, item, props));
195
+ }
196
+ case ComponentType.TextButton: {
197
+ return React.createElement(renderer.textButton, Object.assign({}, item, props));
198
+ }
199
+ case ComponentType.ImageButton: {
200
+ return React.createElement(renderer.imageButton, Object.assign({}, item, props));
201
+ }
202
+ default: {
203
+ // or throw new Error('Cannot parse template item')
204
+ return React.createElement(UnknownMessage, { item: item });
205
+ }
206
+ }
207
+ })));
208
+ };
209
+ return {
210
+ MessageTemplate: ({ parentLayout = defaultProperties.rootLayout, templateItems }) => {
211
+ const items = setTemplateItemId(templateItems);
212
+ return (React.createElement(SizeContextProvider, null,
213
+ React.createElement(Container, null,
214
+ React.createElement(MessageTemplateBase, { parentLayout: parentLayout, templateItems: items }))));
215
+ },
216
+ MessageTemplateBase,
217
+ };
218
+ };
219
+
220
+ var ActionType;
221
+ (function (ActionType) {
222
+ ActionType["Web"] = "web";
223
+ ActionType["Custom"] = "custom";
224
+ ActionType["UIKit"] = "uikit";
225
+ })(ActionType || (ActionType = {}));
226
+
227
+ const alignInFlex = (align) => {
228
+ switch (align) {
229
+ case AlignValue.Right:
230
+ case AlignValue.Bottom:
231
+ return 'flex-end';
232
+ case AlignValue.Center:
233
+ return 'center';
234
+ case AlignValue.Left:
235
+ case AlignValue.Top:
236
+ default:
237
+ return 'flex-start';
238
+ }
239
+ };
240
+
241
+ ({
242
+ version: 1,
243
+ body: {
244
+ items: [
245
+ {
246
+ type: ComponentType.Image,
247
+ action: { type: ActionType.Web, data: 'https://docs.sendbird.com' },
248
+ height: { type: 'fixed', value: 236 },
249
+ viewStyle: {
250
+ padding: {
251
+ left: 4,
252
+ right: 4,
253
+ top: 4,
254
+ bottom: 4,
255
+ },
256
+ },
257
+ imageUrl: 'https://cdn.pixabay.com/photo/2022/10/12/10/45/bird-7516219_1280.jpg',
258
+ imageStyle: { contentMode: MediaContentMode.AspectFill },
259
+ },
260
+ {
261
+ type: ComponentType.Box,
262
+ layout: Layout.Column,
263
+ width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
264
+ height: { type: 'fixed', value: 200 },
265
+ items: [
266
+ {
267
+ type: ComponentType.Box,
268
+ width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
269
+ height: { type: 'flex', value: FlexSizeSpecValue.FillParent },
270
+ viewStyle: { backgroundColor: '#fa6464' },
271
+ },
272
+ {
273
+ type: ComponentType.Box,
274
+ layout: Layout.Column,
275
+ width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
276
+ height: { type: 'flex', value: FlexSizeSpecValue.WrapContent },
277
+ viewStyle: { backgroundColor: '#ffaf5c' },
278
+ items: [
279
+ {
280
+ type: ComponentType.Text,
281
+ text: 'Message',
282
+ align: { horizontal: AlignValue.Center, vertical: AlignValue.Center },
283
+ width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
284
+ height: { type: 'fixed', value: 50 },
285
+ },
286
+ {
287
+ type: ComponentType.Image,
288
+ action: { type: ActionType.Web, data: 'https://docs.sendbird.com' },
289
+ width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
290
+ height: { type: 'fixed', value: 50 },
291
+ imageUrl: 'https://cdn.pixabay.com/photo/2022/10/12/10/45/bird-7516219_1280.jpg',
292
+ imageStyle: { contentMode: MediaContentMode.AspectFill },
293
+ },
294
+ ],
295
+ },
296
+ {
297
+ type: ComponentType.Box,
298
+ width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
299
+ height: { type: 'fixed', value: 20 },
300
+ viewStyle: { backgroundColor: '#ffe450' },
301
+ },
302
+ {
303
+ type: ComponentType.Box,
304
+ width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
305
+ height: { type: 'flex', value: FlexSizeSpecValue.FillParent },
306
+ viewStyle: { backgroundColor: '#329a1b' },
307
+ },
308
+ ],
309
+ },
310
+ {
311
+ type: ComponentType.Box,
312
+ viewStyle: { padding: { top: 12, bottom: 12, left: 12, right: 12 } },
313
+ layout: Layout.Column,
314
+ items: [
315
+ {
316
+ type: ComponentType.Box,
317
+ align: { horizontal: AlignValue.Left, vertical: AlignValue.Center },
318
+ layout: Layout.Row,
319
+ viewStyle: {
320
+ borderWidth: 1,
321
+ borderColor: '#72723f',
322
+ },
323
+ width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
324
+ height: { type: 'fixed', value: 150 },
325
+ items: [
326
+ {
327
+ type: ComponentType.Text,
328
+ width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
329
+ height: { type: 'fixed', value: 50 },
330
+ text: 'Sample1 text',
331
+ maxTextLines: 1,
332
+ align: { vertical: AlignValue.Center, horizontal: AlignValue.Left },
333
+ viewStyle: {
334
+ backgroundColor: '#cc4400',
335
+ },
336
+ textStyle: {
337
+ size: 16,
338
+ color: '#f8f8f8',
339
+ weight: FontWeight.Bold,
340
+ },
341
+ },
342
+ {
343
+ type: ComponentType.ImageButton,
344
+ action: { type: ActionType.UIKit, data: 'uikit://delete' },
345
+ width: { type: 'fixed', value: 20 },
346
+ height: { type: 'fixed', value: 20 },
347
+ imageUrl: 'https://file-ap-1.sendbird.com/5b5379aa73fd460da22ffaf9a61d0d7f.png',
348
+ imageStyle: { contentMode: MediaContentMode.AspectFit },
349
+ },
350
+ ],
351
+ },
352
+ {
353
+ type: ComponentType.Text,
354
+ viewStyle: { padding: { top: 6, bottom: 12, left: 0, right: 0 } },
355
+ text: 'Esse eu esse duis ipsum et dolor eu ut sit amet consectetur cillum velit officia. Ex adipisicing elit quis ea sit. Occaecat in eu aliqua nulla magna id ut excepteur minim.',
356
+ maxTextLines: 2,
357
+ textStyle: { size: 14, color: '#e10000' },
358
+ width: { type: 'fixed', value: 200 },
359
+ height: { type: 'fixed', value: 50 },
360
+ },
361
+ {
362
+ type: ComponentType.TextButton,
363
+ action: { type: ActionType.Web, data: 'https://www.daum.net' },
364
+ text: 'Button 3',
365
+ textStyle: { size: 14, color: '#742ddd', weight: FontWeight.Bold },
366
+ },
367
+ ],
368
+ },
369
+ ],
370
+ },
371
+ });
372
+ ({
373
+ 'version': 1,
374
+ 'body': {
375
+ 'items': [
376
+ {
377
+ 'type': ComponentType.Image,
378
+ 'action': { 'type': ActionType.Web, 'data': 'https://www.naver.com/' },
379
+ 'height': { 'type': 'fixed', 'value': 136 },
380
+ 'imageUrl': 'https://cdn.pixabay.com/photo/2022/10/12/10/45/bird-7516219_1280.jpg',
381
+ 'imageStyle': { 'contentMode': MediaContentMode.AspectFill },
382
+ },
383
+ {
384
+ 'type': ComponentType.Box,
385
+ 'viewStyle': { 'padding': { 'top': 12, 'bottom': 12, 'left': 12, 'right': 12 }, backgroundColor: '#cccccc' },
386
+ 'layout': Layout.Column,
387
+ width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
388
+ 'items': [
389
+ {
390
+ 'type': ComponentType.Box,
391
+ width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
392
+ 'layout': Layout.Row,
393
+ 'items': [
394
+ {
395
+ 'type': ComponentType.TextButton,
396
+ 'action': { 'type': ActionType.Web, 'data': 'https://www.daum.net' },
397
+ width: { type: 'fixed', value: 150 },
398
+ 'viewStyle': { 'margin': { 'top': 0, 'bottom': 0, 'left': 0, 'right': 4 } },
399
+ 'text': 'Button 2',
400
+ 'textStyle': { 'size': 14, 'weight': FontWeight.Bold },
401
+ },
402
+ {
403
+ 'type': ComponentType.TextButton,
404
+ 'action': { 'type': ActionType.Web, 'data': 'https://www.daum.net' },
405
+ width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
406
+ 'viewStyle': { 'margin': { 'top': 0, 'bottom': 0, 'left': 4, 'right': 0 } },
407
+ 'text': 'Button 3',
408
+ 'textStyle': { 'size': 14, 'weight': FontWeight.Bold },
409
+ },
410
+ ],
411
+ },
412
+ {
413
+ 'type': ComponentType.Box,
414
+ width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
415
+ 'layout': Layout.Row,
416
+ 'items': [
417
+ {
418
+ 'type': ComponentType.Text,
419
+ 'text': 'Sample2 text',
420
+ 'width': { 'type': 'flex', 'value': FlexSizeSpecValue.FillParent },
421
+ 'maxTextLines': 1,
422
+ 'textStyle': { 'size': 16, 'weight': FontWeight.Bold },
423
+ },
424
+ {
425
+ 'type': ComponentType.ImageButton,
426
+ 'action': { 'type': ActionType.UIKit, 'data': 'uikit://delete' },
427
+ 'width': { 'type': 'fixed', 'value': 20 },
428
+ 'height': { 'type': 'fixed', 'value': 20 },
429
+ 'imageUrl': 'https://file-ap-1.sendbird.com/5b5379aa73fd460da22ffaf9a61d0d7f.png',
430
+ 'imageStyle': { 'contentMode': MediaContentMode.AspectFit },
431
+ },
432
+ ],
433
+ },
434
+ {
435
+ 'type': ComponentType.Text,
436
+ 'viewStyle': { 'padding': { 'top': 6, 'bottom': 12, 'left': 0, 'right': 0 } },
437
+ 'text': 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aui',
438
+ 'textStyle': { 'size': 14 },
439
+ },
440
+ ],
441
+ },
442
+ ],
443
+ },
444
+ });
445
+ ({
446
+ 'version': 1,
447
+ 'body': {
448
+ 'items': [
449
+ {
450
+ 'type': ComponentType.Box,
451
+ 'viewStyle': { 'backgroundColor': '#ffffff', 'borderWidth': 1, 'borderColor': '#eeeeee', 'radius': 16 },
452
+ 'layout': Layout.Column,
453
+ 'items': [
454
+ {
455
+ 'type': ComponentType.Image,
456
+ 'height': { 'type': 'fixed', 'value': 200 },
457
+ 'imageUrl': 'https://img.freepik.com/free-vector/cartoon-happy-hours-background_52683-81243.jpg?w=2000&t=st=1666689198~exp=1666689798~hmac=23109d44ba03deee7aee069cbeebfcb48fa27f85e53c1cafc5d5d7345f1a2041',
458
+ 'imageStyle': { 'contentMode': MediaContentMode.AspectFill },
459
+ },
460
+ {
461
+ 'type': ComponentType.Box,
462
+ 'viewStyle': { 'padding': { 'top': 15, 'bottom': 15, 'left': 15, 'right': 15 } },
463
+ 'layout': Layout.Column,
464
+ 'items': [
465
+ {
466
+ 'type': ComponentType.Text,
467
+ 'text': "Don't miss these deals today",
468
+ 'maxTextLines': 1,
469
+ 'textStyle': { 'size': 20, 'color': '#e10000', 'weight': FontWeight.Bold },
470
+ },
471
+ {
472
+ 'type': ComponentType.Text,
473
+ 'viewStyle': { 'margin': { 'top': 5, 'bottom': 0, 'left': 0, 'right': 0 } },
474
+ 'text': 'Pay with Maya and get cashback!',
475
+ 'maxTextLines': 1,
476
+ 'textStyle': { 'size': 14, 'color': '#e10000' },
477
+ },
478
+ {
479
+ 'type': ComponentType.Box,
480
+ 'align': { 'horizontal': AlignValue.Left, 'vertical': AlignValue.Center },
481
+ 'viewStyle': { 'margin': { 'top': 10, 'bottom': 0, 'left': 0, 'right': 0 } },
482
+ 'layout': Layout.Row,
483
+ 'items': [
484
+ {
485
+ 'type': ComponentType.Image,
486
+ 'width': { 'type': 'fixed', 'value': 50 },
487
+ 'height': { 'type': 'fixed', 'value': 50 },
488
+ 'viewStyle': {
489
+ 'backgroundColor': '#ffffff',
490
+ 'borderWidth': 1,
491
+ 'borderColor': '#eeeeee',
492
+ 'radius': 25,
493
+ },
494
+ 'imageUrl': 'https://yt3.ggpht.com/ytc/AMLnZu8Kg89ymE7qt5bsS9vMqi9h2aHiN6m9ID-IgxR6-Q=s900-c-k-c0x00ffffff-no-rj',
495
+ 'imageStyle': { 'contentMode': MediaContentMode.AspectFill },
496
+ },
497
+ {
498
+ 'type': ComponentType.Box,
499
+ 'align': { 'horizontal': AlignValue.Left, 'vertical': AlignValue.Center },
500
+ 'viewStyle': { 'margin': { 'top': 0, 'bottom': 0, 'left': 15, 'right': 0 } },
501
+ 'layout': Layout.Column,
502
+ 'items': [
503
+ {
504
+ 'type': ComponentType.Text,
505
+ 'text': 'Meralco',
506
+ 'maxTextLines': 1,
507
+ 'textStyle': { 'size': 16, 'color': '#e10000', 'weight': FontWeight.Bold },
508
+ },
509
+ {
510
+ 'type': ComponentType.Text,
511
+ 'viewStyle': { 'margin': { 'top': 3, 'bottom': 0, 'left': 0, 'right': 0 } },
512
+ 'text': '30% cashback, P300 min spend',
513
+ 'maxTextLines': 1,
514
+ 'textStyle': { 'size': 12, 'color': '#610000', 'weight': FontWeight.Bold },
515
+ },
516
+ ],
517
+ },
518
+ ],
519
+ },
520
+ {
521
+ 'type': ComponentType.Box,
522
+ 'align': { 'horizontal': AlignValue.Left, 'vertical': AlignValue.Center },
523
+ 'viewStyle': { 'margin': { 'top': 10, 'bottom': 0, 'left': 0, 'right': 0 } },
524
+ 'layout': Layout.Row,
525
+ 'items': [
526
+ {
527
+ 'type': ComponentType.Image,
528
+ 'width': { 'type': 'fixed', 'value': 50 },
529
+ 'height': { 'type': 'fixed', 'value': 50 },
530
+ 'viewStyle': {
531
+ 'backgroundColor': '#ffffff',
532
+ 'borderWidth': 1,
533
+ 'borderColor': '#eeeeee',
534
+ 'radius': 25,
535
+ },
536
+ 'imageUrl': 'https://1000logos.net/wp-content/uploads/2021/12/Globe-Telecom-logo.png',
537
+ 'imageStyle': { 'contentMode': MediaContentMode.AspectFill, tintColor: '#a49a9a' },
538
+ },
539
+ {
540
+ 'type': ComponentType.Box,
541
+ 'align': { 'horizontal': AlignValue.Left, 'vertical': AlignValue.Center },
542
+ 'viewStyle': { 'margin': { 'top': 0, 'bottom': 0, 'left': 15, 'right': 0 } },
543
+ 'layout': Layout.Column,
544
+ 'items': [
545
+ {
546
+ 'type': ComponentType.Text,
547
+ 'text': 'Globe',
548
+ 'maxTextLines': 1,
549
+ 'textStyle': { 'size': 16, 'color': '#e10000', 'weight': FontWeight.Bold },
550
+ },
551
+ {
552
+ 'type': ComponentType.Text,
553
+ 'viewStyle': { 'margin': { 'top': 3, 'bottom': 0, 'left': 0, 'right': 0 } },
554
+ 'text': '30% cashback, P300 min spend',
555
+ 'maxTextLines': 1,
556
+ 'textStyle': { 'size': 12, 'color': '#610000', 'weight': FontWeight.Bold },
557
+ },
558
+ ],
559
+ },
560
+ ],
561
+ },
562
+ {
563
+ 'type': ComponentType.Box,
564
+ 'align': { 'horizontal': AlignValue.Left, 'vertical': AlignValue.Center },
565
+ 'viewStyle': { 'margin': { 'top': 10, 'bottom': 0, 'left': 0, 'right': 0 } },
566
+ 'layout': Layout.Row,
567
+ 'items': [
568
+ {
569
+ 'type': ComponentType.Image,
570
+ 'width': { 'type': 'fixed', 'value': 50 },
571
+ 'height': { 'type': 'fixed', 'value': 50 },
572
+ 'viewStyle': {
573
+ 'backgroundColor': '#ffffff',
574
+ 'borderWidth': 1,
575
+ 'borderColor': '#eeeeee',
576
+ 'radius': 25,
577
+ },
578
+ 'imageUrl': 'https://upload.wikimedia.org/wikipedia/commons/thumb/4/41/Cignal.svg/640px-Cignal.svg.png',
579
+ 'imageStyle': { 'contentMode': MediaContentMode.AspectFill },
580
+ },
581
+ {
582
+ 'type': ComponentType.Box,
583
+ 'align': { 'horizontal': AlignValue.Left, 'vertical': AlignValue.Center },
584
+ 'viewStyle': { 'margin': { 'top': 0, 'bottom': 0, 'left': 15, 'right': 0 } },
585
+ 'layout': Layout.Column,
586
+ 'items': [
587
+ {
588
+ 'type': ComponentType.Text,
589
+ 'text': 'Cignal',
590
+ 'maxTextLines': 1,
591
+ 'textStyle': { 'size': 16, 'color': '#e10000', 'weight': FontWeight.Bold },
592
+ },
593
+ {
594
+ 'type': ComponentType.Text,
595
+ 'viewStyle': { 'margin': { 'top': 3, 'bottom': 0, 'left': 0, 'right': 0 } },
596
+ 'text': '30% cashback, P300 min spend',
597
+ 'maxTextLines': 1,
598
+ 'textStyle': { 'size': 12, 'color': '#610000', 'weight': FontWeight.Bold },
599
+ },
600
+ ],
601
+ },
602
+ ],
603
+ },
604
+ {
605
+ 'type': ComponentType.Box,
606
+ 'align': { 'horizontal': AlignValue.Left, 'vertical': AlignValue.Center },
607
+ 'viewStyle': { 'margin': { 'top': 10, 'bottom': 0, 'left': 0, 'right': 0 } },
608
+ 'layout': Layout.Row,
609
+ 'items': [
610
+ {
611
+ 'type': ComponentType.TextButton,
612
+ 'action': { 'type': ActionType.Web, 'data': 'https://www.daum.net' },
613
+ 'viewStyle': {
614
+ 'backgroundColor': '#e0e0e0',
615
+ 'radius': 16,
616
+ 'margin': { 'top': 0, 'bottom': 0, 'left': 0, 'right': 4 },
617
+ 'padding': { 'top': 12, 'bottom': 12, 'left': 12, 'right': 12 },
618
+ },
619
+ 'text': 'Learn more',
620
+ 'textStyle': { 'size': 15, 'color': '#e10000', 'weight': FontWeight.Bold },
621
+ },
622
+ {
623
+ 'type': ComponentType.TextButton,
624
+ 'action': { 'type': ActionType.Web, 'data': 'https://www.daum.net' },
625
+ 'viewStyle': {
626
+ 'backgroundColor': '#e10000',
627
+ 'radius': 16,
628
+ 'margin': { 'top': 0, 'bottom': 0, 'left': 4, 'right': 0 },
629
+ 'padding': { 'top': 12, 'bottom': 12, 'left': 12, 'right': 12 },
630
+ },
631
+ 'text': 'Pay now',
632
+ 'textStyle': { 'size': 15, 'color': '#ffffff', 'weight': FontWeight.Bold },
633
+ },
634
+ ],
635
+ },
636
+ ],
637
+ },
638
+ ],
639
+ },
640
+ ],
641
+ },
642
+ });
643
+ ({
644
+ 'version': 1,
645
+ 'body': {
646
+ 'items': [
647
+ {
648
+ 'type': ComponentType.Box,
649
+ 'layout': Layout.Column,
650
+ 'items': [
651
+ {
652
+ 'type': ComponentType.Image,
653
+ 'imageUrl': 'https://static.sendbird.com/sample/profiles/profile_40_512px.png',
654
+ 'metaData': {
655
+ 'pixelWidth': 512,
656
+ 'pixelHeight': 512,
657
+ },
658
+ 'imageStyle': {
659
+ 'tintColor': '#44ff1188',
660
+ },
661
+ viewStyle: {
662
+ 'padding': {
663
+ 'top': 12,
664
+ 'right': 12,
665
+ 'bottom': 12,
666
+ 'left': 12,
667
+ },
668
+ },
669
+ },
670
+ {
671
+ 'type': ComponentType.Box,
672
+ 'viewStyle': {
673
+ 'padding': {
674
+ 'top': 12,
675
+ 'right': 12,
676
+ 'bottom': 12,
677
+ 'left': 12,
678
+ },
679
+ },
680
+ 'layout': Layout.Column,
681
+ 'items': [
682
+ {
683
+ 'type': ComponentType.Box,
684
+ 'layout': Layout.Row,
685
+ 'items': [
686
+ {
687
+ 'type': ComponentType.Box,
688
+ 'layout': Layout.Column,
689
+ 'items': [
690
+ {
691
+ 'type': ComponentType.Text,
692
+ 'text': 'hi',
693
+ 'maxTextLines': 3,
694
+ 'viewStyle': {
695
+ 'padding': {
696
+ 'top': 0,
697
+ 'bottom': 6,
698
+ 'left': 0,
699
+ 'right': 0,
700
+ },
701
+ },
702
+ 'textStyle': {
703
+ 'size': 16,
704
+ 'weight': FontWeight.Bold,
705
+ },
706
+ },
707
+ {
708
+ 'type': ComponentType.Text,
709
+ 'text': 'bye',
710
+ 'maxTextLines': 10,
711
+ 'textStyle': {
712
+ 'size': 14,
713
+ },
714
+ },
715
+ ],
716
+ },
717
+ {
718
+ 'type': ComponentType.ImageButton,
719
+ 'action': {
720
+ 'type': ActionType.UIKit,
721
+ 'data': 'sendbirduikit://delete',
722
+ },
723
+ 'width': {
724
+ 'type': 'fixed',
725
+ 'value': 20,
726
+ },
727
+ 'height': {
728
+ 'type': 'fixed',
729
+ 'value': 20,
730
+ },
731
+ 'metaData': {
732
+ 'pixelWidth': 60,
733
+ 'pixelHeight': 60,
734
+ },
735
+ 'imageUrl': 'https://dxstmhyqfqr1o.cloudfront.net/sendbird-message-builder/icon-more.png',
736
+ 'imageStyle': {
737
+ 'tintColor': '#ff8d5a',
738
+ },
739
+ },
740
+ ],
741
+ },
742
+ {
743
+ 'type': ComponentType.Box,
744
+ 'layout': Layout.Column,
745
+ 'items': [
746
+ {
747
+ 'type': ComponentType.Box,
748
+ 'viewStyle': {
749
+ 'margin': {
750
+ 'top': 16,
751
+ 'bottom': 0,
752
+ 'left': 0,
753
+ 'right': 0,
754
+ },
755
+ },
756
+ 'align': {
757
+ 'horizontal': AlignValue.Left,
758
+ 'vertical': AlignValue.Center,
759
+ },
760
+ 'layout': Layout.Row,
761
+ 'items': [
762
+ {
763
+ 'type': ComponentType.Image,
764
+ 'imageUrl': 'https://ca.slack-edge.com/T0ADCTNEL-ULE240VNV-83fd5776e78e-512',
765
+ 'width': {
766
+ 'type': 'fixed',
767
+ 'value': 40,
768
+ },
769
+ 'height': {
770
+ 'type': 'fixed',
771
+ 'value': 40,
772
+ },
773
+ 'metaData': {
774
+ 'pixelWidth': 512,
775
+ 'pixelHeight': 512,
776
+ },
777
+ 'viewStyle': {
778
+ 'backgroundColor': '#BDBDBD',
779
+ 'radius': 20,
780
+ },
781
+ 'imageStyle': {
782
+ 'contentMode': MediaContentMode.AspectFill,
783
+ },
784
+ },
785
+ {
786
+ 'type': ComponentType.Box,
787
+ 'viewStyle': {
788
+ 'margin': {
789
+ 'top': 0,
790
+ 'bottom': 0,
791
+ 'left': 12,
792
+ 'right': 0,
793
+ },
794
+ },
795
+ 'layout': Layout.Column,
796
+ 'items': [
797
+ {
798
+ 'type': ComponentType.Text,
799
+ 'text': 'Chongbu',
800
+ 'maxTextLines': 1,
801
+ 'textStyle': {
802
+ 'size': 16,
803
+ 'weight': FontWeight.Bold,
804
+ },
805
+ },
806
+ {
807
+ 'type': ComponentType.Text,
808
+ 'viewStyle': {
809
+ 'margin': {
810
+ 'top': 4,
811
+ 'bottom': 0,
812
+ 'left': 0,
813
+ 'right': 0,
814
+ },
815
+ },
816
+ 'text': ' ',
817
+ 'maxTextLines': 1,
818
+ 'textStyle': {
819
+ 'size': 14,
820
+ },
821
+ },
822
+ ],
823
+ },
824
+ ],
825
+ },
826
+ {
827
+ 'type': ComponentType.Box,
828
+ 'viewStyle': {
829
+ 'margin': {
830
+ 'top': 16,
831
+ 'bottom': 0,
832
+ 'left': 0,
833
+ 'right': 0,
834
+ },
835
+ },
836
+ 'align': {
837
+ 'horizontal': AlignValue.Left,
838
+ 'vertical': AlignValue.Center,
839
+ },
840
+ 'layout': Layout.Row,
841
+ 'items': [
842
+ {
843
+ 'type': ComponentType.Image,
844
+ 'imageUrl': 'https://ca.slack-edge.com/T0ADCTNEL-U02LA25KY8J-d41a3e8c7554-512',
845
+ 'width': {
846
+ 'type': 'fixed',
847
+ 'value': 40,
848
+ },
849
+ 'height': {
850
+ 'type': 'fixed',
851
+ 'value': 40,
852
+ },
853
+ 'metaData': {
854
+ 'pixelWidth': 512,
855
+ 'pixelHeight': 512,
856
+ },
857
+ 'viewStyle': {
858
+ 'backgroundColor': '#BDBDBD',
859
+ 'radius': 20,
860
+ },
861
+ 'imageStyle': {
862
+ 'contentMode': MediaContentMode.AspectFill,
863
+ },
864
+ },
865
+ {
866
+ 'type': ComponentType.Box,
867
+ 'viewStyle': {
868
+ 'margin': {
869
+ 'top': 0,
870
+ 'bottom': 0,
871
+ 'left': 12,
872
+ 'right': 0,
873
+ },
874
+ },
875
+ 'layout': Layout.Column,
876
+ 'items': [
877
+ {
878
+ 'type': ComponentType.Text,
879
+ 'text': 'Amanda',
880
+ 'maxTextLines': 1,
881
+ 'textStyle': {
882
+ 'size': 16,
883
+ 'weight': FontWeight.Bold,
884
+ },
885
+ },
886
+ {
887
+ 'type': ComponentType.Text,
888
+ 'viewStyle': {
889
+ 'margin': {
890
+ 'top': 4,
891
+ 'bottom': 0,
892
+ 'left': 0,
893
+ 'right': 0,
894
+ },
895
+ },
896
+ 'text': 'This is title message',
897
+ 'maxTextLines': 1,
898
+ 'textStyle': {
899
+ 'size': 14,
900
+ },
901
+ },
902
+ ],
903
+ },
904
+ ],
905
+ },
906
+ ],
907
+ },
908
+ ],
909
+ },
910
+ ],
911
+ },
912
+ ],
913
+ },
914
+ });
915
+ ({
916
+ 'version': '1',
917
+ 'body': {
918
+ 'items': [
919
+ {
920
+ 'type': 'box',
921
+ 'layout': 'column',
922
+ height: { type: 'fixed', value: 600 },
923
+ 'items': [
924
+ {
925
+ 'type': 'box',
926
+ 'layout': 'column',
927
+ 'viewStyle': { 'radius': '8', 'padding': { 'top': '12', 'bottom': '12', 'left': '12', 'right': '12' } },
928
+ 'items': [
929
+ {
930
+ 'type': 'text',
931
+ 'text': 'Title text',
932
+ 'textStyle': { 'color': '#E0000000', 'size': '16', 'weight': 'bold' },
933
+ 'maxTextLines': '5',
934
+ 'viewStyle': {},
935
+ 'action': { 'data': 'www.naver.com' },
936
+ },
937
+ {
938
+ 'type': 'text',
939
+ 'viewStyle': { 'margin': { 'top': '8', 'right': '0', 'bottom': '0', 'left': '0' } },
940
+ 'text': 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aui',
941
+ 'textStyle': { 'color': '#E0000000', 'size': '14', 'weight': 'normal' },
942
+ 'maxTextLines': '5',
943
+ 'action': { 'data': 'https://www.naver.com' },
944
+ },
945
+ {
946
+ 'type': 'box',
947
+ 'layout': 'row',
948
+ 'viewStyle': { 'margin': { 'top': '12', 'right': '0', 'bottom': '0', 'left': '0' } },
949
+ 'items': [
950
+ {
951
+ 'type': 'textButton',
952
+ 'viewStyle': {
953
+ 'backgroundColor': '#E0E0E0',
954
+ 'padding': { 'top': '10', 'bottom': '10', 'left': '20', 'right': '20' },
955
+ },
956
+ 'text': 'Button 1',
957
+ 'textStyle': { 'color': '#742DDD', 'size': '14', 'weight': 'bold' },
958
+ 'maxTextLines': '5',
959
+ 'action': { 'data': 'www.naver.com' },
960
+ },
961
+ {
962
+ 'type': 'textButton',
963
+ 'viewStyle': {
964
+ 'backgroundColor': '#E0E0E0',
965
+ 'padding': { 'top': '10', 'bottom': '10', 'left': '20', 'right': '20' },
966
+ 'margin': { 'left': '8', 'right': '0', 'top': '0', 'bottom': '0' },
967
+ },
968
+ 'text': 'Button 2',
969
+ 'textStyle': { 'color': '#742DDD', 'size': '14', 'weight': 'bold' },
970
+ 'maxTextLines': '5',
971
+ 'action': { 'data': 'https://www.naver.com' },
972
+ },
973
+ ],
974
+ },
975
+ ],
976
+ 'action': { 'data': 'https://www.naver.com' },
977
+ },
978
+ {
979
+ 'type': 'image',
980
+ 'viewStyle': {},
981
+ 'width': { 'type': 'flex', 'value': FlexSizeSpecValue.FillParent },
982
+ 'height': { 'type': 'flex', 'value': FlexSizeSpecValue.FillParent },
983
+ 'imageStyle': { 'contentMode': 'aspectFill' },
984
+ 'imageUrl': 'https://file-preprod.sendbird.com/d03c08bb3f9041a88c1207b6bbf15ab8.png',
985
+ 'metaData': { 'pixelWidth': '1062', 'pixelHeight': '1070' },
986
+ },
987
+ {
988
+ 'type': 'textButton',
989
+ 'viewStyle': {
990
+ 'backgroundColor': '#E0E0E0',
991
+ 'padding': { 'top': '10', 'bottom': '10', 'left': '20', 'right': '20' },
992
+ },
993
+ 'width': { 'type': 'flex', 'value': FlexSizeSpecValue.FillParent },
994
+ 'height': { 'type': 'flex', 'value': FlexSizeSpecValue.FillParent },
995
+ 'text': 'Button',
996
+ 'textStyle': { 'color': '#742DDD', 'size': '16', 'weight': 'normal' },
997
+ 'maxTextLines': '5',
998
+ 'action': { 'data': 'www.naver.com' },
999
+ },
1000
+ {
1001
+ 'type': 'imageButton',
1002
+ 'viewStyle': {},
1003
+ 'width': { 'type': 'flex', 'value': FlexSizeSpecValue.FillParent },
1004
+ 'height': { 'type': 'flex', 'value': FlexSizeSpecValue.FillParent },
1005
+ 'imageUrl': 'https://file-preprod.sendbird.com/38fdf5c1056f42b89a44b38155cc4b49.jpg',
1006
+ 'imageStyle': { 'contentMode': 'aspectFill' },
1007
+ 'metaData': { 'pixelWidth': '1080', 'pixelHeight': '2640' },
1008
+ 'action': { 'data': 'www.naver.com' },
1009
+ },
1010
+ ],
1011
+ 'viewStyle': {},
1012
+ },
1013
+ ],
1014
+ },
1015
+ });
1016
+
1017
+ var __rest$3 = (undefined && undefined.__rest) || function (s, e) {
1018
+ var t = {};
1019
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1020
+ t[p] = s[p];
1021
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
1022
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1023
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
1024
+ t[p[i]] = s[p[i]];
1025
+ }
1026
+ return t;
1027
+ };
1028
+ const CanvasReactMessageTemplateImage = (props) => {
1029
+ const { imageSize, canvasRef, canvasProps } = useCanvasMessageTemplateImage(props);
1030
+ return (React.createElement("canvas", Object.assign({}, canvasProps, { ref: canvasRef, width: imageSize === null || imageSize === void 0 ? void 0 : imageSize.width, height: imageSize === null || imageSize === void 0 ? void 0 : imageSize.height, onError: props.onError })));
1031
+ };
1032
+ const useCanvasMessageTemplateImage = (_a) => {
1033
+ var { metaData, tintColor } = _a, props = __rest$3(_a, ["metaData", "tintColor"]);
1034
+ const canvasRef = React.useRef(null);
1035
+ const [fallbackImageSize, setFallbackImageSize] = React.useState();
1036
+ const imageSize = React.useMemo(() => {
1037
+ if ((metaData === null || metaData === void 0 ? void 0 : metaData.pixelHeight) && (metaData === null || metaData === void 0 ? void 0 : metaData.pixelWidth)) {
1038
+ return { width: metaData.pixelWidth, height: metaData.pixelHeight };
1039
+ }
1040
+ return fallbackImageSize;
1041
+ }, [fallbackImageSize, metaData === null || metaData === void 0 ? void 0 : metaData.pixelHeight, metaData === null || metaData === void 0 ? void 0 : metaData.pixelWidth]);
1042
+ React.useEffect(() => {
1043
+ if (imageSize == null) {
1044
+ console.log('Canvas_ReactMessageTemplateImage: no metaData, render fit to container');
1045
+ if (canvasRef.current) {
1046
+ canvasRef.current.style.width = '100%';
1047
+ canvasRef.current.style.height = '100%';
1048
+ const containerSize = canvasRef.current.getBoundingClientRect();
1049
+ setFallbackImageSize(containerSize);
1050
+ }
1051
+ }
1052
+ }, [imageSize]);
1053
+ React.useEffect(() => {
1054
+ if (props.src) {
1055
+ const img = new Image();
1056
+ const onImageLoad = () => {
1057
+ if (canvasRef.current && tintColor && imageSize) {
1058
+ const ctx = canvasRef.current.getContext('2d');
1059
+ if (ctx) {
1060
+ const { width: imageWidth, height: imageHeight } = imageSize;
1061
+ // reset context before draw, consider `.save()` and `.restore()` api
1062
+ ctx.clearRect(0, 0, imageWidth, imageHeight);
1063
+ ctx.beginPath();
1064
+ ctx.globalCompositeOperation = 'source-over';
1065
+ ctx.fillStyle = '#000';
1066
+ // draw
1067
+ ctx.drawImage(img, 0, 0, imageWidth, imageHeight);
1068
+ ctx.globalCompositeOperation = 'source-atop';
1069
+ ctx.fillStyle = tintColor;
1070
+ ctx.fillRect(0, 0, imageWidth, imageHeight);
1071
+ }
1072
+ }
1073
+ };
1074
+ const onImageError = (event) => {
1075
+ var _a;
1076
+ // @ts-ignore
1077
+ (_a = props.onError) === null || _a === void 0 ? void 0 : _a.call(props, event);
1078
+ };
1079
+ img.addEventListener('load', onImageLoad);
1080
+ img.addEventListener('error', onImageError);
1081
+ img.src = props.src;
1082
+ return () => {
1083
+ img.removeEventListener('load', onImageLoad);
1084
+ img.removeEventListener('error', onImageError);
1085
+ };
1086
+ }
1087
+ return;
1088
+ }, [props.src, imageSize, tintColor]);
1089
+ return {
1090
+ canvasRef,
1091
+ canvasProps: props,
1092
+ imageSize,
1093
+ };
1094
+ };
1095
+
1096
+ const ImgReactMessageTemplateImage = (props) => {
1097
+ return React.createElement("img", Object.assign({}, props, { onError: props.onError, referrerPolicy: "no-referrer" }));
1098
+ };
1099
+
1100
+ const PlaceholderReactMessageTemplateImage = (props) => {
1101
+ return React.createElement("div", { style: Object.assign(Object.assign({}, props.style), { backgroundColor: 'transparent' }) });
1102
+ };
1103
+
1104
+ var __rest$2 = (undefined && undefined.__rest) || function (s, e) {
1105
+ var t = {};
1106
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1107
+ t[p] = s[p];
1108
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
1109
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1110
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
1111
+ t[p[i]] = s[p[i]];
1112
+ }
1113
+ return t;
1114
+ };
1115
+ const ReactMessageTemplateImage = (_a) => {
1116
+ var { tintColor, metaData } = _a, props = __rest$2(_a, ["tintColor", "metaData"]);
1117
+ const { hasError, onError } = useImageLoadError(props.src);
1118
+ if (props.onError)
1119
+ console.warn('`onError` is intercepted and not executed in the ReactMessageTemplateImage.');
1120
+ if (hasError) {
1121
+ return React.createElement(PlaceholderReactMessageTemplateImage, Object.assign({}, props));
1122
+ }
1123
+ else if (tintColor) {
1124
+ return React.createElement(CanvasReactMessageTemplateImage, Object.assign({}, props, { onError: onError, tintColor: tintColor, metaData: metaData }));
1125
+ }
1126
+ else {
1127
+ return React.createElement(ImgReactMessageTemplateImage, Object.assign({}, props, { onError: onError }));
1128
+ }
1129
+ };
1130
+ const useImageLoadError = (source) => {
1131
+ const [hasError, setHasError] = React.useState(false);
1132
+ React.useEffect(() => setHasError(false), [source]);
1133
+ return {
1134
+ hasError,
1135
+ onError: React.useCallback(() => setHasError(true), []),
1136
+ };
1137
+ };
1138
+
1139
+ // create a context provider for MessageComponent
1140
+ // - this is a wrapper for MessageComponent
1141
+ const MessageContext = React.createContext(null);
1142
+ const MessageProvider = (props) => {
1143
+ const { message, handleWebAction, handleCustomAction, handlePredefinedAction, children } = props;
1144
+ const value = React.useMemo(() => ({
1145
+ message,
1146
+ handleWebAction,
1147
+ handleCustomAction,
1148
+ handlePredefinedAction,
1149
+ }), [message === null || message === void 0 ? void 0 : message.updatedAt]);
1150
+ return React.createElement(MessageContext.Provider, { value: value }, children);
1151
+ };
1152
+ const useMessageContext = () => React.useContext(MessageContext);
1153
+
1154
+ function isWrappedText(view) {
1155
+ var _a;
1156
+ return view.type === ComponentType.Text && ((_a = view.width) === null || _a === void 0 ? void 0 : _a.value) == FlexSizeSpecValue.WrapContent;
1157
+ }
1158
+ // Compares the size spec to the option and returns whether they are equal or not.
1159
+ const isSizeCompatibleWithOption = ({ size, option, }) => {
1160
+ if (option === 'wrap') {
1161
+ return size.type === 'flex' && size.value == FlexSizeSpecValue.WrapContent;
1162
+ }
1163
+ if (option === 'fill') {
1164
+ return size.type === 'flex' && size.value == FlexSizeSpecValue.FillParent;
1165
+ }
1166
+ return size.type === 'fixed';
1167
+ };
1168
+
1169
+ /**
1170
+ * Preserves a reference to the given callback function as an argument while the component is mounted.
1171
+ * Wraps the given callback in React's Ref to preserve the reference.
1172
+ * @param callback want to be preserved
1173
+ */
1174
+ function usePreservedCallback(callback) {
1175
+ const callbackRef = React.useRef(callback);
1176
+ React.useEffect(() => {
1177
+ callbackRef.current = callback;
1178
+ }, [callback]);
1179
+ return React.useCallback((...args) => {
1180
+ return callbackRef.current(...args);
1181
+ }, [callbackRef]);
1182
+ }
1183
+
1184
+ /**
1185
+ * This hook can be used when you want to safely effect the value stored in useRef
1186
+ * Got this idea from https://github.com/facebook/react/issues/15176
1187
+ * @param callback
1188
+ * @param deps
1189
+ * @returns effect callback
1190
+ */
1191
+ function useRefEffect(callback, deps) {
1192
+ const preservedCallback = usePreservedCallback(callback);
1193
+ const disposeRef = React.useRef(noop);
1194
+ const effect = React.useCallback((element) => {
1195
+ disposeRef.current();
1196
+ disposeRef.current = noop;
1197
+ if (element != null) {
1198
+ const cleanup = callback(element);
1199
+ if (typeof cleanup === 'function') {
1200
+ disposeRef.current = cleanup;
1201
+ }
1202
+ }
1203
+ }, [preservedCallback, ...deps]);
1204
+ return effect;
1205
+ }
1206
+ function noop() { }
1207
+
1208
+ /**
1209
+ * Subscribes to ResizeObserver on the component exposing the Ref,
1210
+ * to detect changes in the size of DOM elements.
1211
+ * The ResizeObserver API is required.
1212
+ * If you are targeting browsers that do not support that API, probably need to add appropriate polyfill too.
1213
+ * @param onResize
1214
+ * @returns ref
1215
+ */
1216
+ function useResizeObserver(onResize) {
1217
+ const resizeCallback = usePreservedCallback(onResize);
1218
+ const ref = useRefEffect((elem) => {
1219
+ const observer = new ResizeObserver((entries) => {
1220
+ if (entries[0] != null) {
1221
+ resizeCallback(entries[0]);
1222
+ }
1223
+ });
1224
+ observer.observe(elem);
1225
+ return () => {
1226
+ observer.unobserve(elem);
1227
+ };
1228
+ }, [resizeCallback]);
1229
+ return ref;
1230
+ }
1231
+
1232
+ /**
1233
+ * @returns an element's width / height observed by IntersectionObserver,
1234
+ * and ref to detect its resize event
1235
+ */
1236
+ function useElementSize() {
1237
+ const [width, setWidth] = React.useState(-1);
1238
+ const [height, setHeight] = React.useState(-1);
1239
+ const [contentWidth, setContentWidth] = React.useState(-1);
1240
+ const [contentHeight, setContentHeight] = React.useState(-1);
1241
+ const [paddingWidth, setPaddingWidth] = React.useState(-1);
1242
+ const [paddingHeight, setPaddingHeight] = React.useState(-1);
1243
+ const ref = useResizeObserver((entry) => {
1244
+ // contentRect: content size only
1245
+ const { width: contentWidth, height: contentHeight } = entry.contentRect;
1246
+ // target: content + padding + border size
1247
+ const target = entry.target;
1248
+ const { width, height } = target.getBoundingClientRect();
1249
+ setWidth(width);
1250
+ setHeight(height);
1251
+ setContentWidth(contentWidth);
1252
+ setContentHeight(contentHeight);
1253
+ setPaddingWidth(width - contentWidth);
1254
+ setPaddingHeight(height - contentHeight);
1255
+ });
1256
+ return { ref, width, height, contentWidth, contentHeight, paddingWidth, paddingHeight };
1257
+ }
1258
+
1259
+ var __rest$1 = (undefined && undefined.__rest) || function (s, e) {
1260
+ var t = {};
1261
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1262
+ t[p] = s[p];
1263
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
1264
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1265
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
1266
+ t[p[i]] = s[p[i]];
1267
+ }
1268
+ return t;
1269
+ };
1270
+ function isViewCompatibleWithSizeOption({ width = defaultProperties.view.size.width, height = defaultProperties.view.size.height, parentLayout = defaultProperties.box.layout, option, }) {
1271
+ if (parentLayout === Layout.Row) {
1272
+ return isSizeCompatibleWithOption({
1273
+ size: width,
1274
+ option,
1275
+ });
1276
+ }
1277
+ return isSizeCompatibleWithOption({
1278
+ size: height,
1279
+ option,
1280
+ });
1281
+ }
1282
+ function useRecalculateWidth(params) {
1283
+ const { style, props } = params;
1284
+ const _a = useElementSize(), { ref: elemRef } = _a, size = __rest$1(_a, ["ref"]);
1285
+ const { updateSize, sizes } = useSizeContext();
1286
+ const { id, siblings, parentLayout } = props;
1287
+ const { width, height, paddingWidth, paddingHeight, contentWidth, contentHeight } = size;
1288
+ React.useEffect(() => {
1289
+ updateSize({
1290
+ id: props.id,
1291
+ width,
1292
+ height,
1293
+ paddingWidth,
1294
+ paddingHeight,
1295
+ contentWidth,
1296
+ contentHeight,
1297
+ });
1298
+ }, [props.id, width, height, paddingWidth, paddingHeight, contentWidth, contentHeight, updateSize]);
1299
+ const currentStyle = React.useMemo(() => {
1300
+ const sumViewSize = (acc = 0, view) => {
1301
+ var _a, _b, _c, _d;
1302
+ if (parentLayout === Layout.Row) {
1303
+ return acc + ((_b = (_a = sizes[view.id]) === null || _a === void 0 ? void 0 : _a.contentWidth) !== null && _b !== void 0 ? _b : 0);
1304
+ }
1305
+ return acc + ((_d = (_c = sizes[view.id]) === null || _c === void 0 ? void 0 : _c.contentHeight) !== null && _d !== void 0 ? _d : 0);
1306
+ };
1307
+ const hasFillOption = isViewCompatibleWithSizeOption({
1308
+ width: props.width,
1309
+ height: props.height,
1310
+ parentLayout,
1311
+ option: 'fill',
1312
+ });
1313
+ if (hasFillOption) {
1314
+ const wrapSiblingsSize = siblings
1315
+ .filter(({ width, height }) => !isViewCompatibleWithSizeOption({
1316
+ width: width,
1317
+ height: height,
1318
+ parentLayout,
1319
+ option: 'fill',
1320
+ }))
1321
+ .reduce(sumViewSize, 0);
1322
+ const fillSiblingCount = siblings.filter(({ width, height }) => isViewCompatibleWithSizeOption({
1323
+ width: width,
1324
+ height: height,
1325
+ parentLayout,
1326
+ option: 'fill',
1327
+ })).length;
1328
+ const maxSizeOption = (() => {
1329
+ if (parentLayout === Layout.Row) {
1330
+ return {
1331
+ maxWidth: `calc((100% - ${wrapSiblingsSize}px) / ${fillSiblingCount})`,
1332
+ };
1333
+ }
1334
+ return {
1335
+ maxHeight: `calc((100% - ${wrapSiblingsSize}px) / ${fillSiblingCount})`,
1336
+ };
1337
+ })();
1338
+ return Object.assign(Object.assign(Object.assign({}, style), maxSizeOption), (width == 0 && { height: 0 }));
1339
+ }
1340
+ else {
1341
+ const currentElemIdx = siblings.findIndex((sibling) => sibling.id === id);
1342
+ const forwardSiblingsSize = siblings
1343
+ .slice(0, currentElemIdx)
1344
+ .filter(({ width, height }) => isViewCompatibleWithSizeOption({
1345
+ width: width,
1346
+ height: height,
1347
+ parentLayout,
1348
+ option: 'wrap',
1349
+ }))
1350
+ .reduce(sumViewSize, 0);
1351
+ return Object.assign(Object.assign(Object.assign({}, style), (width === 0 && { height: 0 })), (parentLayout === Layout.Row
1352
+ ? {
1353
+ maxWidth: `calc(100% - ${forwardSiblingsSize}px)`,
1354
+ }
1355
+ : {
1356
+ maxHeight: `calc(100% - ${forwardSiblingsSize}px)`,
1357
+ }));
1358
+ }
1359
+ }, [props.width, props.height, parentLayout, sizes, siblings, style, width, id]);
1360
+ return { recalculatedStyle: currentStyle, elemRef };
1361
+ }
1362
+
1363
+ function getDefaultStyles(overrides) {
1364
+ return Object.assign({ display: 'flex', overflow: 'hidden', boxSizing: 'border-box' }, overrides);
1365
+ }
1366
+ function setViewProps(styles, props, options) {
1367
+ setViewSize(styles, props, options);
1368
+ setViewStyle(styles, props);
1369
+ }
1370
+ function setBorderStyle(styles, borderWidth, borderColor, radius) {
1371
+ if (borderWidth) {
1372
+ styles['--border-width'] = `${borderWidth}px`;
1373
+ styles['--border-color'] = borderColor || 'transparent';
1374
+ }
1375
+ if (radius) {
1376
+ styles['borderRadius'] = Number(radius);
1377
+ styles['--border-radius'] = `${radius}px`;
1378
+ }
1379
+ }
1380
+ function setViewStyle(styles, props) {
1381
+ var _a, _b, _c, _d;
1382
+ const { viewStyle } = props;
1383
+ if ((_a = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.margin) === null || _a === void 0 ? void 0 : _a.top)
1384
+ styles['marginTop'] = Number(viewStyle.margin.top);
1385
+ if ((_b = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.margin) === null || _b === void 0 ? void 0 : _b.bottom)
1386
+ styles['marginBottom'] = Number(viewStyle.margin.bottom);
1387
+ if ((_c = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.margin) === null || _c === void 0 ? void 0 : _c.left)
1388
+ styles['marginLeft'] = Number(viewStyle.margin.left);
1389
+ if ((_d = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.margin) === null || _d === void 0 ? void 0 : _d.right)
1390
+ styles['marginRight'] = Number(viewStyle.margin.right);
1391
+ if (viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.backgroundColor)
1392
+ styles['backgroundColor'] = viewStyle.backgroundColor;
1393
+ // use JSON.stringify to escape special characters in image URL
1394
+ if (viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.backgroundImageUrl)
1395
+ styles['backgroundImage'] = `url(${JSON.stringify(viewStyle.backgroundImageUrl)})`;
1396
+ setBorderStyle(styles, viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.borderWidth, viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.borderColor, viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.radius);
1397
+ }
1398
+ function getViewSizeStyle(width, height, parentLayout) {
1399
+ const style = {};
1400
+ if (width.type === 'flex' && width.value == FlexSizeSpecValue.FillParent) {
1401
+ style['width'] = '100%';
1402
+ if (parentLayout === Layout.Row) {
1403
+ style['flex'] = 1;
1404
+ }
1405
+ }
1406
+ else if (width.type === 'fixed' && width.value >= 0) {
1407
+ style['width'] = Number(width.value);
1408
+ }
1409
+ if (height.type === 'flex' && height.value == FlexSizeSpecValue.FillParent) {
1410
+ style['height'] = '100%';
1411
+ if (parentLayout === Layout.Column) {
1412
+ style['flex'] = 1;
1413
+ }
1414
+ }
1415
+ else if (height.type === 'fixed' && height.value >= 0) {
1416
+ style['height'] = Number(height.value);
1417
+ }
1418
+ return style;
1419
+ }
1420
+ function setViewSize(styles, props, options) {
1421
+ var _a, _b;
1422
+ const { width: defaultWidth, height: defaultHeight } = defaultProperties.view.size;
1423
+ const { parentLayout } = options;
1424
+ const sizeStyle = getViewSizeStyle((_a = props.width) !== null && _a !== void 0 ? _a : defaultWidth, (_b = props.height) !== null && _b !== void 0 ? _b : defaultHeight, parentLayout);
1425
+ Object.assign(styles, sizeStyle);
1426
+ }
1427
+ function setAlign(styles, layout = defaultProperties.box.layout, align = defaultProperties.box.align) {
1428
+ if (layout === Layout.Row) {
1429
+ styles['flexDirection'] = 'row';
1430
+ styles['alignItems'] = alignInFlex(align.vertical);
1431
+ styles['justifyContent'] = alignInFlex(align.horizontal);
1432
+ }
1433
+ if (layout === Layout.Column) {
1434
+ styles['flexDirection'] = 'column';
1435
+ styles['alignItems'] = alignInFlex(align.horizontal);
1436
+ styles['justifyContent'] = alignInFlex(align.vertical);
1437
+ }
1438
+ }
1439
+ function setTextAlign(styles, align = defaultProperties.box.align.horizontal) {
1440
+ styles.textAlign = align;
1441
+ }
1442
+ function setImageStyle(styles, imageStyle) {
1443
+ const { contentMode = MediaContentMode.AspectFit } = imageStyle || {};
1444
+ if (contentMode) {
1445
+ switch (contentMode) {
1446
+ case MediaContentMode.AspectFill:
1447
+ styles['objectFit'] = 'cover';
1448
+ break;
1449
+ case MediaContentMode.AspectFit:
1450
+ styles['objectFit'] = 'contain';
1451
+ break;
1452
+ case MediaContentMode.ScalesToFill:
1453
+ styles['objectFit'] = 'fill';
1454
+ break;
1455
+ }
1456
+ }
1457
+ }
1458
+ // uses image meta-data to render images that doesn't break the UI
1459
+ // https://sendbird.atlassian.net/wiki/spaces/UK/pages/2008220608/Message+template+-+Image+policy
1460
+ function setImageAspectRatio(styles, props) {
1461
+ var _a, _b, _c, _d;
1462
+ const imageMetaData = props === null || props === void 0 ? void 0 : props.metaData;
1463
+ if (!(imageMetaData === null || imageMetaData === void 0 ? void 0 : imageMetaData.pixelHeight) || !(imageMetaData === null || imageMetaData === void 0 ? void 0 : imageMetaData.pixelWidth)) {
1464
+ return;
1465
+ }
1466
+ if (((_a = props === null || props === void 0 ? void 0 : props.width) === null || _a === void 0 ? void 0 : _a.type) === 'fixed' || ((_b = props === null || props === void 0 ? void 0 : props.height) === null || _b === void 0 ? void 0 : _b.type) === 'fixed') {
1467
+ return;
1468
+ }
1469
+ styles['aspectRatio'] = `${(_c = props === null || props === void 0 ? void 0 : props.metaData) === null || _c === void 0 ? void 0 : _c.pixelWidth} / ${(_d = props === null || props === void 0 ? void 0 : props.metaData) === null || _d === void 0 ? void 0 : _d.pixelHeight}`;
1470
+ }
1471
+ function webkitLineClampStyles(numberOfLines) {
1472
+ return {
1473
+ WebkitLineClamp: numberOfLines,
1474
+ WebkitBoxOrient: 'vertical',
1475
+ display: '-webkit-box',
1476
+ overflow: 'hidden',
1477
+ overflowWrap: 'anywhere',
1478
+ flex: 1,
1479
+ };
1480
+ }
1481
+ function setTextStyle(styles, props, options) {
1482
+ const { textStyle, width } = props;
1483
+ // TODO: Change default as design
1484
+ const { size, color, weight = 'normal' } = textStyle || {};
1485
+ if (size)
1486
+ styles['fontSize'] = Number(size);
1487
+ if (color)
1488
+ styles['color'] = color;
1489
+ if (weight)
1490
+ styles['fontWeight'] = weight;
1491
+ if ((width === null || width === void 0 ? void 0 : width.value) == FlexSizeSpecValue.WrapContent) {
1492
+ styles['maxWidth'] = '100%';
1493
+ }
1494
+ if (props.type === ComponentType.Text) {
1495
+ const { siblings, elemIdx } = options;
1496
+ // To push out any subsequent components from the container,
1497
+ // if a prior one is long enough to occupy an entire line
1498
+ // @link https://sendbird.atlassian.net/browse/NOTI-709
1499
+ if (siblings != null && siblings.length >= 2 && siblings.every(isWrappedText)) {
1500
+ styles.flexShrink = siblings.length - 1 === elemIdx ? 1 : 0;
1501
+ }
1502
+ }
1503
+ }
1504
+
1505
+ var __rest = (undefined && undefined.__rest) || function (s, e) {
1506
+ var t = {};
1507
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1508
+ t[p] = s[p];
1509
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
1510
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1511
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
1512
+ t[p[i]] = s[p[i]];
1513
+ }
1514
+ return t;
1515
+ };
1516
+ const hasValidUrlProtocol = (url = '') => ['http://', 'https://', 'ftp://'].some((protocol) => url.startsWith(protocol));
1517
+ /**
1518
+ * @param url - url to be checked
1519
+ * @returns url with http:// protocol if it doesn't have any protocol
1520
+ * @example
1521
+ * returnUrl('www.sendbird.com') // returns 'http://www.sendbird.com'
1522
+ * returnUrl('https://www.sendbird.com') // returns 'https://www.sendbird.com'
1523
+ * returnUrl('ftp://www.sendbird.com') // returns 'ftp://www.sendbird.com'
1524
+ * returnUrl('sendbird.com') // returns 'https://sendbird.com'
1525
+ **/
1526
+ const returnUrl = (url = '') => {
1527
+ if (hasValidUrlProtocol(url)) {
1528
+ return url;
1529
+ }
1530
+ return `https://${url}`;
1531
+ };
1532
+ // todo: semantic html here is not perfect, need to revisit. Same for Button
1533
+ const ActionHandler = ({ className = '', style, children, props }) => {
1534
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
1535
+ const { recalculatedStyle, elemRef } = useRecalculateWidth({ style, props });
1536
+ const { message, handleWebAction, handleCustomAction, handlePredefinedAction } = useMessageContext();
1537
+ const onClick = (e) => {
1538
+ var _a, _b, _c, _d, _e;
1539
+ if (((_a = props === null || props === void 0 ? void 0 : props.action) === null || _a === void 0 ? void 0 : _a.type) === 'web') {
1540
+ if (handleWebAction) {
1541
+ handleWebAction === null || handleWebAction === void 0 ? void 0 : handleWebAction(e, props.action, message);
1542
+ }
1543
+ else {
1544
+ (_c = window === null || window === void 0 ? void 0 : window.open(returnUrl((_b = props === null || props === void 0 ? void 0 : props.action) === null || _b === void 0 ? void 0 : _b.data), '_blank', 'noopener noreferrer')) === null || _c === void 0 ? void 0 : _c.focus();
1545
+ }
1546
+ }
1547
+ if (((_d = props === null || props === void 0 ? void 0 : props.action) === null || _d === void 0 ? void 0 : _d.type) === 'custom') {
1548
+ handleCustomAction === null || handleCustomAction === void 0 ? void 0 : handleCustomAction(e, props.action, message);
1549
+ }
1550
+ if (((_e = props === null || props === void 0 ? void 0 : props.action) === null || _e === void 0 ? void 0 : _e.type) === 'uikit') {
1551
+ handlePredefinedAction === null || handlePredefinedAction === void 0 ? void 0 : handlePredefinedAction(e, props.action, message);
1552
+ }
1553
+ };
1554
+ const borderClass = ((_a = props.viewStyle) === null || _a === void 0 ? void 0 : _a.borderWidth) ? ' sb-message-template__border' : '';
1555
+ if (className === 'sb-message-template__text-button') {
1556
+ return (React.createElement("button", { className: `${className}${borderClass}`, "data-sb-template-id": props.elementId, style: Object.assign(Object.assign({}, style), { paddingTop: (_c = (_b = props.viewStyle) === null || _b === void 0 ? void 0 : _b.padding) === null || _c === void 0 ? void 0 : _c.top, paddingRight: (_e = (_d = props.viewStyle) === null || _d === void 0 ? void 0 : _d.padding) === null || _e === void 0 ? void 0 : _e.right, paddingBottom: (_g = (_f = props.viewStyle) === null || _f === void 0 ? void 0 : _f.padding) === null || _g === void 0 ? void 0 : _g.bottom, paddingLeft: (_j = (_h = props.viewStyle) === null || _h === void 0 ? void 0 : _h.padding) === null || _j === void 0 ? void 0 : _j.left }), onClick: onClick }, children));
1557
+ }
1558
+ const { display, flexDirection, justifyContent, alignItems, objectFit } = recalculatedStyle, wrapperStyles = __rest(recalculatedStyle, ["display", "flexDirection", "justifyContent", "alignItems", "objectFit"]);
1559
+ return (React.createElement("div", { ref: elemRef, className: `${className}${borderClass} ${(props === null || props === void 0 ? void 0 : props.action) ? 'sb-message-template__action' : ''}`, "data-sb-template-id": props.elementId, style: wrapperStyles, onClick: onClick },
1560
+ React.createElement("div", { style: {
1561
+ display,
1562
+ flexDirection,
1563
+ justifyContent,
1564
+ alignItems,
1565
+ objectFit,
1566
+ width: '100%',
1567
+ height: '100%',
1568
+ paddingTop: (_l = (_k = props.viewStyle) === null || _k === void 0 ? void 0 : _k.padding) === null || _l === void 0 ? void 0 : _l.top,
1569
+ paddingRight: (_o = (_m = props.viewStyle) === null || _m === void 0 ? void 0 : _m.padding) === null || _o === void 0 ? void 0 : _o.right,
1570
+ paddingBottom: (_q = (_p = props.viewStyle) === null || _p === void 0 ? void 0 : _p.padding) === null || _q === void 0 ? void 0 : _q.bottom,
1571
+ paddingLeft: (_s = (_r = props.viewStyle) === null || _r === void 0 ? void 0 : _r.padding) === null || _s === void 0 ? void 0 : _s.left,
1572
+ } }, children)));
1573
+ };
1574
+ /**
1575
+ * Text that is fixed or fill parent should be wrapped in a div with max-width: 100% and max-height: 100%
1576
+ * This is to prevent text from overflowing the padding of the container
1577
+ */
1578
+ function isFixedOrFill(view) {
1579
+ var _a, _b, _c, _d;
1580
+ const heightType = (_a = view === null || view === void 0 ? void 0 : view.height) === null || _a === void 0 ? void 0 : _a.type;
1581
+ const widthType = (_b = view === null || view === void 0 ? void 0 : view.width) === null || _b === void 0 ? void 0 : _b.type;
1582
+ const isFixedDiamension = heightType === 'fixed' || widthType === 'fixed';
1583
+ const isFill = (heightType === 'flex' && ((_c = view === null || view === void 0 ? void 0 : view.height) === null || _c === void 0 ? void 0 : _c.value) === FlexSizeSpecValue.FillParent) ||
1584
+ (widthType === 'flex' && ((_d = view === null || view === void 0 ? void 0 : view.width) === null || _d === void 0 ? void 0 : _d.value) === FlexSizeSpecValue.FillParent);
1585
+ return isFixedDiamension || isFill;
1586
+ }
1587
+ function renderText(view) {
1588
+ const { text, maxTextLines } = view;
1589
+ const isToBeWrapped = isFixedOrFill(view);
1590
+ const isMultiLine = maxTextLines != null && maxTextLines > 0;
1591
+ if (isMultiLine || isToBeWrapped) {
1592
+ const wrapperStyling = Object.assign(Object.assign({}, ((isMultiLine || isToBeWrapped) && { maxWidth: '100%' })), (isToBeWrapped && { maxHeight: '100%', overflow: 'hidden' }));
1593
+ return (React.createElement("div", { style: wrapperStyling }, isMultiLine ? React.createElement("div", { style: webkitLineClampStyles(maxTextLines) }, text) : text));
1594
+ }
1595
+ return text;
1596
+ }
1597
+ const renderer = createRenderer({
1598
+ views: {
1599
+ box(props) {
1600
+ return (React.createElement(ActionHandler, { className: "sb-message-template__box", elementId: props.elementId, style: props.parsedProperties, props: props }, props.children));
1601
+ },
1602
+ text(props) {
1603
+ return (React.createElement(ActionHandler, { className: "sb-message-template__text", elementId: props.elementId, style: props.parsedProperties, props: props }, renderText(props)));
1604
+ },
1605
+ image(props) {
1606
+ var _a;
1607
+ // todo: add image backup
1608
+ return (React.createElement(ActionHandler, { className: "sb-message-template__image-container", elementId: props.elementId, style: props.parsedProperties, props: props },
1609
+ React.createElement(ReactMessageTemplateImage, { className: "sb-message-template__image", alt: "image", src: props.imageUrl, style: { width: '100%', height: '100%', aspectRatio: 'inherit', objectFit: 'inherit' }, tintColor: (_a = props.imageStyle) === null || _a === void 0 ? void 0 : _a.tintColor, metaData: props.metaData })));
1610
+ },
1611
+ textButton(props) {
1612
+ return (React.createElement(ActionHandler, { className: "sb-message-template__text-button", elementId: props.elementId, style: props.parsedProperties, props: props }, renderText(props)));
1613
+ },
1614
+ imageButton(props) {
1615
+ var _a;
1616
+ return (React.createElement(ActionHandler, { className: "sb-message-template__image-container sb-message-template__image-button", elementId: props.elementId, style: props.parsedProperties, props: props },
1617
+ React.createElement(ReactMessageTemplateImage, { className: "sb-message-template__image", alt: "image-button", src: props.imageUrl, style: { width: '100%', height: '100%', aspectRatio: 'inherit', objectFit: 'inherit' }, tintColor: (_a = props.imageStyle) === null || _a === void 0 ? void 0 : _a.tintColor, metaData: props.metaData })));
1618
+ },
1619
+ },
1620
+ });
1621
+ const parser = createParser({
1622
+ mapBoxProps(props, options) {
1623
+ const styles = getDefaultStyles();
1624
+ setViewProps(styles, props, options);
1625
+ setAlign(styles, props.layout, props.align);
1626
+ return styles;
1627
+ },
1628
+ mapTextProps(props, options) {
1629
+ var _a;
1630
+ const styles = getDefaultStyles({ whiteSpace: 'pre-line' });
1631
+ // Better not set flex 1 to text
1632
+ setViewProps(styles, props, options);
1633
+ setTextStyle(styles, props, options);
1634
+ setAlign(styles, Layout.Row, props.align);
1635
+ setTextAlign(styles, (_a = props.align) === null || _a === void 0 ? void 0 : _a.horizontal);
1636
+ return styles;
1637
+ },
1638
+ mapImageProps(props, options) {
1639
+ const styles = getDefaultStyles();
1640
+ setViewProps(styles, props, options);
1641
+ setImageStyle(styles, props.imageStyle);
1642
+ setImageAspectRatio(styles, props);
1643
+ return styles;
1644
+ },
1645
+ mapTextButtonProps(props, options) {
1646
+ const styles = getDefaultStyles({ whiteSpace: 'pre-line', alignItems: 'center', justifyContent: 'center' });
1647
+ setViewProps(styles, props, options);
1648
+ setTextStyle(styles, Object.assign(Object.assign({}, props), { textStyle: Object.assign({ weight: 500 }, props.textStyle) }), options);
1649
+ return styles;
1650
+ },
1651
+ mapImageButtonProps(props, options) {
1652
+ const styles = getDefaultStyles();
1653
+ setViewProps(styles, props, options);
1654
+ setImageStyle(styles, props.imageStyle);
1655
+ setImageAspectRatio(styles, props);
1656
+ return styles;
1657
+ },
1658
+ });
1659
+ createMessageTemplate({
1660
+ renderer,
1661
+ parser,
1662
+ Container: ({ children }) => {
1663
+ return (React.createElement("div", { className: "sb-message-template__parent", style: {
1664
+ display: 'flex',
1665
+ flexDirection: 'column',
1666
+ maxWidth: 400,
1667
+ backgroundColor: '#cecece',
1668
+ marginBottom: 24,
1669
+ borderRadius: '8px',
1670
+ } }, children));
1671
+ },
1672
+ });
1673
+
1674
+ var CustomTemplate = createMessageTemplate({
1675
+ parser: parser,
1676
+ renderer: renderer,
1677
+ Container: function (_a) {
1678
+ var children = _a.children;
1679
+ return (React.createElement("div", { className: [
1680
+ 'sb-message-template__parent',
1681
+ 'sendbird-message-template__root',
1682
+ ].join(' ') }, children));
1683
+ },
1684
+ }).MessageTemplate;
1685
+ function MessageTemplate(_a) {
1686
+ var templateItems = _a.templateItems;
1687
+ return React.createElement(CustomTemplate, { templateItems: templateItems });
1688
+ }
1689
+
1690
+ exports.MessageProvider = MessageProvider;
1691
+ exports.MessageTemplate = MessageTemplate;
1692
+ //# sourceMappingURL=bundle-csbD2FCX.js.map