@sendbird/uikit-react 3.17.3 → 3.17.4

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 (874) hide show
  1. package/App.js +89 -89
  2. package/CHANGELOG.md +13 -0
  3. package/Channel/components/ChannelHeader.js +33 -33
  4. package/Channel/components/ChannelUI.js +68 -68
  5. package/Channel/components/FileViewer.js +31 -31
  6. package/Channel/components/FrozenNotification.js +6 -6
  7. package/Channel/components/Message.js +57 -57
  8. package/Channel/components/MessageInput.js +44 -44
  9. package/Channel/components/MessageInputWrapper.js +44 -44
  10. package/Channel/components/MessageList.js +61 -61
  11. package/Channel/components/RemoveMessageModal.js +30 -30
  12. package/Channel/components/SuggestedMentionList.js +30 -30
  13. package/Channel/components/TypingIndicator.js +9 -9
  14. package/Channel/components/UnreadCount.js +8 -8
  15. package/Channel/context.js +24 -24
  16. package/Channel/hooks/useHandleUploadFiles.js +18 -18
  17. package/Channel/hooks/useInitialMessagesFetch.js +8 -8
  18. package/Channel/utils/compareMessagesForGrouping.js +8 -8
  19. package/Channel/utils/getMessagePartsInfo.js +9 -9
  20. package/Channel.js +68 -68
  21. package/ChannelList/components/AddChannel.js +89 -89
  22. package/ChannelList/components/ChannelListHeader.js +13 -13
  23. package/ChannelList/components/ChannelListUI.js +89 -89
  24. package/ChannelList/components/ChannelPreview.js +32 -32
  25. package/ChannelList/components/ChannelPreviewAction.js +17 -17
  26. package/ChannelList/context.js +14 -14
  27. package/ChannelList.js +89 -89
  28. package/ChannelSettings/components/ChannelProfile.js +23 -23
  29. package/ChannelSettings/components/ChannelSettingMenuList.js +14 -14
  30. package/ChannelSettings/components/ChannelSettingsHeader.js +11 -11
  31. package/ChannelSettings/components/ChannelSettingsMenuItem.js +2 -2
  32. package/ChannelSettings/components/ChannelSettingsUI.js +31 -31
  33. package/ChannelSettings/components/EditDetailsModal.js +19 -19
  34. package/ChannelSettings/components/LeaveChannel.js +20 -20
  35. package/ChannelSettings/components/ModerationPanel.js +29 -29
  36. package/ChannelSettings/components/UserListItem.js +19 -19
  37. package/ChannelSettings/components/UserPanel.js +28 -28
  38. package/ChannelSettings/context.js +9 -9
  39. package/ChannelSettings/hooks/useMenuList.js +29 -29
  40. package/ChannelSettings.js +31 -31
  41. package/CreateChannel/components/CreateChannelUI.js +89 -89
  42. package/CreateChannel/components/InviteUsers.js +89 -89
  43. package/CreateChannel/components/SelectChannelType.js +89 -89
  44. package/CreateChannel/context.js +89 -89
  45. package/CreateChannel.js +89 -89
  46. package/CreateOpenChannel/components/CreateOpenChannelUI.js +15 -15
  47. package/CreateOpenChannel/context.js +4 -4
  48. package/CreateOpenChannel.js +15 -15
  49. package/EditUserProfile/components/EditUserProfileUI.js +15 -15
  50. package/EditUserProfile/context.js +1 -1
  51. package/EditUserProfile.js +15 -15
  52. package/GroupChannel/components/FileViewer.js +28 -28
  53. package/GroupChannel/components/FrozenNotification.js +6 -6
  54. package/GroupChannel/components/GroupChannelHeader.js +29 -29
  55. package/GroupChannel/components/GroupChannelUI.js +63 -63
  56. package/GroupChannel/components/Message.js +54 -54
  57. package/GroupChannel/components/MessageInputWrapper.js +41 -41
  58. package/GroupChannel/components/MessageList.js +56 -56
  59. package/GroupChannel/components/RemoveMessageModal.js +27 -27
  60. package/GroupChannel/components/SuggestedMentionList.js +15 -15
  61. package/GroupChannel/components/TypingIndicator.js +9 -9
  62. package/GroupChannel/components/UnreadCount.js +8 -8
  63. package/GroupChannel/context.js +15 -15
  64. package/GroupChannel.js +63 -63
  65. package/GroupChannelList/components/AddGroupChannel.js +89 -89
  66. package/GroupChannelList/components/GroupChannelListHeader.js +13 -13
  67. package/GroupChannelList/components/GroupChannelListItem.js +32 -32
  68. package/GroupChannelList/components/GroupChannelListUI.js +89 -89
  69. package/GroupChannelList/components/GroupChannelPreviewAction.js +17 -17
  70. package/GroupChannelList/context.js +10 -10
  71. package/GroupChannelList.js +89 -89
  72. package/MessageSearch/components/MessageSearchUI.js +20 -20
  73. package/MessageSearch/context.js +6 -6
  74. package/MessageSearch.js +22 -22
  75. package/OpenChannel/components/FrozenChannelNotification.js +5 -5
  76. package/OpenChannel/components/OpenChannelHeader.js +20 -20
  77. package/OpenChannel/components/OpenChannelInput.js +29 -29
  78. package/OpenChannel/components/OpenChannelMessage.js +39 -39
  79. package/OpenChannel/components/OpenChannelMessageList.js +43 -43
  80. package/OpenChannel/components/OpenChannelUI.js +43 -43
  81. package/OpenChannel/context.js +19 -19
  82. package/OpenChannel.js +43 -43
  83. package/OpenChannelList/components/OpenChannelListUI.js +17 -17
  84. package/OpenChannelList/components/OpenChannelPreview.js +6 -6
  85. package/OpenChannelList/context.js +6 -6
  86. package/OpenChannelList.js +17 -17
  87. package/OpenChannelSettings/components/EditDetailsModal.js +18 -18
  88. package/OpenChannelSettings/components/OpenChannelProfile.js +18 -18
  89. package/OpenChannelSettings/components/OpenChannelSettingsUI.js +24 -24
  90. package/OpenChannelSettings/components/OperatorUI.js +24 -24
  91. package/OpenChannelSettings/components/ParticipantUI.js +22 -22
  92. package/OpenChannelSettings/context.js +6 -6
  93. package/OpenChannelSettings.js +24 -24
  94. package/SendbirdProvider.js +25 -37
  95. package/SendbirdProvider.js.map +1 -1
  96. package/Thread/components/ParentMessageInfo.js +49 -49
  97. package/Thread/components/ParentMessageInfoItem.js +34 -34
  98. package/Thread/components/ThreadHeader.js +8 -8
  99. package/Thread/components/ThreadList.js +56 -56
  100. package/Thread/components/ThreadListItem.js +56 -56
  101. package/Thread/components/ThreadMessageInput.js +46 -46
  102. package/Thread/components/ThreadUI.js +62 -62
  103. package/Thread/context.js +15 -15
  104. package/Thread.js +62 -62
  105. package/VoicePlayer/context.js +6 -6
  106. package/VoicePlayer/useVoicePlayer.js +14 -14
  107. package/VoiceRecorder/context.js +13 -13
  108. package/VoiceRecorder/useVoiceRecorder.js +12 -12
  109. package/chunks/{bundle-Vy-gCopV.js → bundle--Sz7RXuz.js} +4 -4
  110. package/chunks/bundle--Sz7RXuz.js.map +1 -0
  111. package/chunks/{bundle-CS_zfDpT.js → bundle--jIqJVDq.js} +2 -2
  112. package/chunks/bundle--jIqJVDq.js.map +1 -0
  113. package/chunks/{bundle-QNC758GX.js → bundle-0DrqmBzE.js} +1 -1
  114. package/chunks/bundle-0DrqmBzE.js.map +1 -0
  115. package/chunks/{bundle-BKE9GWOw.js → bundle-3npZm9P2.js} +8 -8
  116. package/chunks/{bundle-BKE9GWOw.js.map → bundle-3npZm9P2.js.map} +1 -1
  117. package/chunks/{bundle-D1G8sq-4.js → bundle-9BktfNFn.js} +3 -3
  118. package/chunks/{bundle-D1G8sq-4.js.map → bundle-9BktfNFn.js.map} +1 -1
  119. package/chunks/{bundle-BI-ujVyJ.js → bundle-B-0NnLOm.js} +2 -2
  120. package/chunks/{bundle-BI-ujVyJ.js.map → bundle-B-0NnLOm.js.map} +1 -1
  121. package/chunks/{bundle-C9TQA43p.js → bundle-BEcHyg20.js} +5 -5
  122. package/chunks/bundle-BEcHyg20.js.map +1 -0
  123. package/chunks/{bundle-yCvBYPzY.js → bundle-BGJm9kMZ.js} +8 -8
  124. package/chunks/bundle-BGJm9kMZ.js.map +1 -0
  125. package/chunks/{bundle-BtrLIwe9.js → bundle-BGUnfEeP.js} +6 -6
  126. package/chunks/{bundle-BtrLIwe9.js.map → bundle-BGUnfEeP.js.map} +1 -1
  127. package/chunks/{bundle-Cu1scdm7.js → bundle-BJOl_h3C.js} +1 -1
  128. package/chunks/bundle-BJOl_h3C.js.map +1 -0
  129. package/chunks/{bundle-DAYo2mkS.js → bundle-BKRfSnQL.js} +1 -1
  130. package/chunks/bundle-BKRfSnQL.js.map +1 -0
  131. package/chunks/{bundle-fjYZUavu.js → bundle-BMDlBkMY.js} +2 -2
  132. package/chunks/bundle-BMDlBkMY.js.map +1 -0
  133. package/chunks/{bundle-9YecU3PU.js → bundle-BMV5F47t.js} +1 -1
  134. package/chunks/bundle-BMV5F47t.js.map +1 -0
  135. package/chunks/{bundle-8TDNINAX.js → bundle-BPlQDgVJ.js} +1 -1
  136. package/chunks/bundle-BPlQDgVJ.js.map +1 -0
  137. package/chunks/bundle-BRbBe6zP.js +25 -0
  138. package/chunks/bundle-BRbBe6zP.js.map +1 -0
  139. package/chunks/{bundle-CLQGIPMv.js → bundle-BRuJjI60.js} +11 -8
  140. package/chunks/{bundle-CLQGIPMv.js.map → bundle-BRuJjI60.js.map} +1 -1
  141. package/chunks/{bundle-DMcf5OHL.js → bundle-BRyFfKhh.js} +4 -4
  142. package/chunks/bundle-BRyFfKhh.js.map +1 -0
  143. package/chunks/{bundle-CCOWK_6D.js → bundle-BVI9Z3mE.js} +12 -12
  144. package/chunks/{bundle-CCOWK_6D.js.map → bundle-BVI9Z3mE.js.map} +1 -1
  145. package/chunks/{bundle-DwPUcSH_.js → bundle-BY63oX3Q.js} +14 -14
  146. package/chunks/{bundle-DwPUcSH_.js.map → bundle-BY63oX3Q.js.map} +1 -1
  147. package/chunks/{bundle-Lsd9GvqK.js → bundle-B_xf4FTs.js} +1 -1
  148. package/chunks/bundle-B_xf4FTs.js.map +1 -0
  149. package/chunks/{bundle-DkAvIH82.js → bundle-BdU8Ifxp.js} +10 -10
  150. package/chunks/bundle-BdU8Ifxp.js.map +1 -0
  151. package/chunks/{bundle-D2-HOzgX.js → bundle-BiThSbiF.js} +3 -3
  152. package/chunks/bundle-BiThSbiF.js.map +1 -0
  153. package/chunks/{bundle-CQgJrna5.js → bundle-BlIA910H.js} +1 -1
  154. package/chunks/{bundle-CQgJrna5.js.map → bundle-BlIA910H.js.map} +1 -1
  155. package/chunks/{bundle-yd76uvgx.js → bundle-BmsBidSB.js} +1 -1
  156. package/chunks/bundle-BmsBidSB.js.map +1 -0
  157. package/chunks/{bundle-BlL-p6Zz.js → bundle-BryieZDo.js} +1 -1
  158. package/chunks/bundle-BryieZDo.js.map +1 -0
  159. package/chunks/{bundle-CTo5rr_w.js → bundle-Bsy6hKbm.js} +4 -4
  160. package/chunks/bundle-Bsy6hKbm.js.map +1 -0
  161. package/chunks/{bundle-BRRgVYI5.js → bundle-BsyrNhZs.js} +3 -3
  162. package/chunks/{bundle-BRRgVYI5.js.map → bundle-BsyrNhZs.js.map} +1 -1
  163. package/chunks/{bundle-DfThYlSD.js → bundle-C1WYjzC2.js} +1 -1
  164. package/chunks/bundle-C1WYjzC2.js.map +1 -0
  165. package/chunks/{bundle-BZ_07PG_.js → bundle-C4BYk9ql.js} +5 -5
  166. package/chunks/{bundle-BZ_07PG_.js.map → bundle-C4BYk9ql.js.map} +1 -1
  167. package/chunks/{bundle-B-s0FWL1.js → bundle-C8Jm3THq.js} +1 -1
  168. package/chunks/bundle-C8Jm3THq.js.map +1 -0
  169. package/chunks/{bundle-Rkg87QeA.js → bundle-CDt2YO6x.js} +1 -1
  170. package/chunks/bundle-CDt2YO6x.js.map +1 -0
  171. package/chunks/{bundle-CxH8o_kz.js → bundle-CEGR8YMs.js} +4 -4
  172. package/chunks/{bundle-fOezMcaU.js.map → bundle-CEGR8YMs.js.map} +1 -1
  173. package/chunks/{bundle-DzxB2rkD.js → bundle-CIYZ9f01.js} +4 -4
  174. package/chunks/{bundle-DzxB2rkD.js.map → bundle-CIYZ9f01.js.map} +1 -1
  175. package/chunks/{bundle-DYC6yyN-.js → bundle-CIsTqZWz.js} +3 -3
  176. package/chunks/bundle-CIsTqZWz.js.map +1 -0
  177. package/chunks/{bundle-DTPVMi5x.js → bundle-CVyzdvX9.js} +3 -3
  178. package/chunks/{bundle-DTPVMi5x.js.map → bundle-CVyzdvX9.js.map} +1 -1
  179. package/chunks/{bundle-fOezMcaU.js → bundle-CY5T73qM.js} +5 -5
  180. package/chunks/{bundle-CxH8o_kz.js.map → bundle-CY5T73qM.js.map} +1 -1
  181. package/chunks/{bundle-Bc7Qfnu1.js → bundle-CZkmOxj6.js} +2 -2
  182. package/chunks/{bundle-Bc7Qfnu1.js.map → bundle-CZkmOxj6.js.map} +1 -1
  183. package/chunks/{bundle-B9rAKDjm.js → bundle-C_Vez3Fa.js} +7 -7
  184. package/chunks/{bundle-B9rAKDjm.js.map → bundle-C_Vez3Fa.js.map} +1 -1
  185. package/chunks/{bundle-Do5Tg9CE.js → bundle-ChBQTryS.js} +1 -1
  186. package/chunks/bundle-ChBQTryS.js.map +1 -0
  187. package/chunks/{bundle-DaX34W07.js → bundle-Cjj-S0bl.js} +3 -3
  188. package/chunks/bundle-Cjj-S0bl.js.map +1 -0
  189. package/chunks/{bundle-CJ_hA_3S.js → bundle-CkTNOTMo.js} +2 -2
  190. package/chunks/bundle-CkTNOTMo.js.map +1 -0
  191. package/chunks/{bundle-Ddhvn_a7.js → bundle-CmXRAHD9.js} +33 -33
  192. package/chunks/{bundle-Ddhvn_a7.js.map → bundle-CmXRAHD9.js.map} +1 -1
  193. package/chunks/{bundle-CAE5bDSW.js → bundle-CoGwS7Mb.js} +1 -1
  194. package/chunks/bundle-CoGwS7Mb.js.map +1 -0
  195. package/chunks/{bundle-xix2tXY6.js → bundle-Cv2la_lu.js} +2 -2
  196. package/chunks/bundle-Cv2la_lu.js.map +1 -0
  197. package/chunks/{bundle-aQHWk7qF.js → bundle-CzVo31Pn.js} +9 -9
  198. package/chunks/{bundle-aQHWk7qF.js.map → bundle-CzVo31Pn.js.map} +1 -1
  199. package/chunks/{bundle-D2cr3zBl.js → bundle-D0Elh6NU.js} +10 -10
  200. package/chunks/{bundle-D2cr3zBl.js.map → bundle-D0Elh6NU.js.map} +1 -1
  201. package/chunks/{bundle-CgQaz0Nj.js → bundle-D2VSxItc.js} +1 -1
  202. package/chunks/bundle-D2VSxItc.js.map +1 -0
  203. package/chunks/{bundle-ua_cRehb.js → bundle-D32PsH6z.js} +3 -3
  204. package/chunks/bundle-D32PsH6z.js.map +1 -0
  205. package/chunks/{bundle-HnotAMvV.js → bundle-DAHfpZkx.js} +1 -1
  206. package/chunks/bundle-DAHfpZkx.js.map +1 -0
  207. package/chunks/{bundle-CtAmTXUa.js → bundle-DBgwi1cE.js} +1 -1
  208. package/chunks/bundle-DBgwi1cE.js.map +1 -0
  209. package/chunks/{bundle-C0tTOdr-.js → bundle-DFbXkkgs.js} +4 -4
  210. package/chunks/bundle-DFbXkkgs.js.map +1 -0
  211. package/chunks/{bundle-BOcsG7ba.js → bundle-DKUTKvwE.js} +4 -4
  212. package/chunks/bundle-DKUTKvwE.js.map +1 -0
  213. package/chunks/{bundle-BzRpqUsC.js → bundle-DKszPydP.js} +1 -1
  214. package/chunks/{bundle-BzRpqUsC.js.map → bundle-DKszPydP.js.map} +1 -1
  215. package/chunks/{bundle-Bw_RT7A_.js → bundle-DL3OLcNk.js} +1 -1
  216. package/chunks/{bundle-Bw_RT7A_.js.map → bundle-DL3OLcNk.js.map} +1 -1
  217. package/chunks/{bundle-CE3h0MW9.js → bundle-DN2z2JNq.js} +15 -15
  218. package/chunks/{bundle-CE3h0MW9.js.map → bundle-DN2z2JNq.js.map} +1 -1
  219. package/chunks/{bundle-C_EuInqG.js → bundle-DTJsSOC-.js} +1 -1
  220. package/chunks/bundle-DTJsSOC-.js.map +1 -0
  221. package/chunks/{bundle-BM_aDlmb.js → bundle-DWmNNvNj.js} +11 -11
  222. package/chunks/{bundle-BM_aDlmb.js.map → bundle-DWmNNvNj.js.map} +1 -1
  223. package/chunks/{bundle-Cc-szMmt.js → bundle-DYuSz-AU.js} +1 -1
  224. package/chunks/bundle-DYuSz-AU.js.map +1 -0
  225. package/chunks/{bundle-BVuZyMl8.js → bundle-DZTb5JPU.js} +5 -5
  226. package/chunks/{bundle-BVuZyMl8.js.map → bundle-DZTb5JPU.js.map} +1 -1
  227. package/chunks/{bundle-C9fKVNGa.js → bundle-D_Uq5DGe.js} +12 -12
  228. package/chunks/{bundle-C9fKVNGa.js.map → bundle-D_Uq5DGe.js.map} +1 -1
  229. package/chunks/{bundle-CDMPjLP0.js → bundle-DbaLrmgZ.js} +8 -8
  230. package/chunks/{bundle-CDMPjLP0.js.map → bundle-DbaLrmgZ.js.map} +1 -1
  231. package/chunks/{bundle-ByqSKxfa.js → bundle-Dg-YjKZ9.js} +8 -8
  232. package/chunks/{bundle-ByqSKxfa.js.map → bundle-Dg-YjKZ9.js.map} +1 -1
  233. package/chunks/{bundle-CJemq6cX.js → bundle-Dh1TZ15-.js} +2 -2
  234. package/chunks/bundle-Dh1TZ15-.js.map +1 -0
  235. package/chunks/{bundle-DmYFHm_s.js → bundle-DhYiP1-A.js} +1 -1
  236. package/chunks/bundle-DhYiP1-A.js.map +1 -0
  237. package/chunks/{bundle-CUnmeLF6.js → bundle-DlMteKWB.js} +1 -1
  238. package/chunks/bundle-DlMteKWB.js.map +1 -0
  239. package/chunks/{bundle-BTpGKOuy.js → bundle-DnDOkHAj.js} +1 -1
  240. package/chunks/bundle-DnDOkHAj.js.map +1 -0
  241. package/chunks/{bundle-DpmW9A4U.js → bundle-DouvXxgX.js} +4 -4
  242. package/chunks/bundle-DouvXxgX.js.map +1 -0
  243. package/chunks/{bundle-B1ARVsV8.js → bundle-DwPa2TQl.js} +6 -6
  244. package/chunks/bundle-DwPa2TQl.js.map +1 -0
  245. package/chunks/{bundle-DD2MMoZ3.js → bundle-DzE3HOwl.js} +13 -13
  246. package/chunks/bundle-DzE3HOwl.js.map +1 -0
  247. package/chunks/{bundle-CzBQNSmE.js → bundle-Fs1rDz4P.js} +1 -1
  248. package/chunks/{bundle-CzBQNSmE.js.map → bundle-Fs1rDz4P.js.map} +1 -1
  249. package/chunks/{bundle-BststcQu.js → bundle-Gpv20NNO.js} +7 -7
  250. package/chunks/bundle-Gpv20NNO.js.map +1 -0
  251. package/chunks/{bundle-e4e9u3jP.js → bundle-LSjP4UWz.js} +6 -6
  252. package/chunks/bundle-LSjP4UWz.js.map +1 -0
  253. package/chunks/{bundle-Br24ZBms.js → bundle-NRV-gv1e.js} +4 -4
  254. package/chunks/{bundle-Br24ZBms.js.map → bundle-NRV-gv1e.js.map} +1 -1
  255. package/chunks/{bundle-BiqO1upP.js → bundle-NYWLy13i.js} +4 -4
  256. package/chunks/bundle-NYWLy13i.js.map +1 -0
  257. package/chunks/{bundle-BcF21Ma7.js → bundle-OGT22p-k.js} +7 -7
  258. package/chunks/{bundle-BcF21Ma7.js.map → bundle-OGT22p-k.js.map} +1 -1
  259. package/chunks/{bundle-pN4x95Un.js → bundle-OZw0fjH_.js} +12 -12
  260. package/chunks/{bundle-pN4x95Un.js.map → bundle-OZw0fjH_.js.map} +1 -1
  261. package/chunks/{bundle-DPduJzw9.js → bundle-PFmHN7Jy.js} +3 -3
  262. package/chunks/bundle-PFmHN7Jy.js.map +1 -0
  263. package/chunks/{bundle-LBf6CphS.js → bundle-S8iPYCSA.js} +3 -3
  264. package/chunks/bundle-S8iPYCSA.js.map +1 -0
  265. package/chunks/{bundle-CdOYsaX9.js → bundle-UvB7bADv.js} +1 -1
  266. package/chunks/bundle-UvB7bADv.js.map +1 -0
  267. package/chunks/{bundle-DO80aKFO.js → bundle-V-9Qd25h.js} +1 -1
  268. package/chunks/bundle-V-9Qd25h.js.map +1 -0
  269. package/chunks/{bundle-rNmE31HG.js → bundle-XfyVGKnP.js} +1 -1
  270. package/chunks/{bundle-rNmE31HG.js.map → bundle-XfyVGKnP.js.map} +1 -1
  271. package/chunks/{bundle-BHOQ9WOd.js → bundle-XsV26VlN.js} +14 -14
  272. package/chunks/{bundle-BHOQ9WOd.js.map → bundle-XsV26VlN.js.map} +1 -1
  273. package/chunks/{bundle-Bq-Lo_oj.js → bundle-_OBfDye7.js} +3 -3
  274. package/chunks/{bundle-Bq-Lo_oj.js.map → bundle-_OBfDye7.js.map} +1 -1
  275. package/chunks/{bundle-Cxa3LJW8.js → bundle-_a6gAil7.js} +4 -4
  276. package/chunks/{bundle-Cxa3LJW8.js.map → bundle-_a6gAil7.js.map} +1 -1
  277. package/chunks/{bundle-BFal76OU.js → bundle-_bSKasth.js} +5 -5
  278. package/chunks/{bundle-BFal76OU.js.map → bundle-_bSKasth.js.map} +1 -1
  279. package/chunks/{bundle-zJKoxW9b.js → bundle-gHhQTuPR.js} +9 -9
  280. package/chunks/bundle-gHhQTuPR.js.map +1 -0
  281. package/chunks/{bundle-Dpu4ZOmf.js → bundle-gZKU5nBj.js} +5 -5
  282. package/chunks/{bundle-Dpu4ZOmf.js.map → bundle-gZKU5nBj.js.map} +1 -1
  283. package/chunks/{bundle-CikfJU8T.js → bundle-qYHiUYZu.js} +2 -2
  284. package/{cjs/chunks/bundle-BgT1C26q.js.map → chunks/bundle-qYHiUYZu.js.map} +1 -1
  285. package/chunks/{bundle-CrUM933U.js → bundle-sqC3xa1V.js} +12 -12
  286. package/chunks/{bundle-CrUM933U.js.map → bundle-sqC3xa1V.js.map} +1 -1
  287. package/chunks/{bundle-86Kzva8M.js → bundle-wBnda9SZ.js} +1 -1
  288. package/chunks/{bundle-86Kzva8M.js.map → bundle-wBnda9SZ.js.map} +1 -1
  289. package/chunks/{bundle-CY7euRvz.js → bundle-wXiJmfh6.js} +1 -1
  290. package/chunks/bundle-wXiJmfh6.js.map +1 -0
  291. package/chunks/{bundle-C4wKOeqt.js → bundle-z5vWj8Ty.js} +7 -7
  292. package/chunks/bundle-z5vWj8Ty.js.map +1 -0
  293. package/cjs/App.js +89 -89
  294. package/cjs/Channel/components/ChannelHeader.js +33 -33
  295. package/cjs/Channel/components/ChannelUI.js +68 -68
  296. package/cjs/Channel/components/FileViewer.js +31 -31
  297. package/cjs/Channel/components/FrozenNotification.js +6 -6
  298. package/cjs/Channel/components/Message.js +57 -57
  299. package/cjs/Channel/components/MessageInput.js +44 -44
  300. package/cjs/Channel/components/MessageInputWrapper.js +44 -44
  301. package/cjs/Channel/components/MessageList.js +61 -61
  302. package/cjs/Channel/components/RemoveMessageModal.js +30 -30
  303. package/cjs/Channel/components/SuggestedMentionList.js +30 -30
  304. package/cjs/Channel/components/TypingIndicator.js +9 -9
  305. package/cjs/Channel/components/UnreadCount.js +8 -8
  306. package/cjs/Channel/context.js +24 -24
  307. package/cjs/Channel/hooks/useHandleUploadFiles.js +18 -18
  308. package/cjs/Channel/hooks/useInitialMessagesFetch.js +8 -8
  309. package/cjs/Channel/utils/compareMessagesForGrouping.js +8 -8
  310. package/cjs/Channel/utils/getMessagePartsInfo.js +9 -9
  311. package/cjs/Channel.js +68 -68
  312. package/cjs/ChannelList/components/AddChannel.js +89 -89
  313. package/cjs/ChannelList/components/ChannelListHeader.js +13 -13
  314. package/cjs/ChannelList/components/ChannelListUI.js +89 -89
  315. package/cjs/ChannelList/components/ChannelPreview.js +32 -32
  316. package/cjs/ChannelList/components/ChannelPreviewAction.js +17 -17
  317. package/cjs/ChannelList/context.js +14 -14
  318. package/cjs/ChannelList.js +89 -89
  319. package/cjs/ChannelSettings/components/ChannelProfile.js +23 -23
  320. package/cjs/ChannelSettings/components/ChannelSettingMenuList.js +14 -14
  321. package/cjs/ChannelSettings/components/ChannelSettingsHeader.js +11 -11
  322. package/cjs/ChannelSettings/components/ChannelSettingsMenuItem.js +2 -2
  323. package/cjs/ChannelSettings/components/ChannelSettingsUI.js +31 -31
  324. package/cjs/ChannelSettings/components/EditDetailsModal.js +19 -19
  325. package/cjs/ChannelSettings/components/LeaveChannel.js +20 -20
  326. package/cjs/ChannelSettings/components/ModerationPanel.js +29 -29
  327. package/cjs/ChannelSettings/components/UserListItem.js +19 -19
  328. package/cjs/ChannelSettings/components/UserPanel.js +28 -28
  329. package/cjs/ChannelSettings/context.js +9 -9
  330. package/cjs/ChannelSettings/hooks/useMenuList.js +29 -29
  331. package/cjs/ChannelSettings.js +31 -31
  332. package/cjs/CreateChannel/components/CreateChannelUI.js +89 -89
  333. package/cjs/CreateChannel/components/InviteUsers.js +89 -89
  334. package/cjs/CreateChannel/components/SelectChannelType.js +89 -89
  335. package/cjs/CreateChannel/context.js +89 -89
  336. package/cjs/CreateChannel.js +89 -89
  337. package/cjs/CreateOpenChannel/components/CreateOpenChannelUI.js +15 -15
  338. package/cjs/CreateOpenChannel/context.js +4 -4
  339. package/cjs/CreateOpenChannel.js +15 -15
  340. package/cjs/EditUserProfile/components/EditUserProfileUI.js +15 -15
  341. package/cjs/EditUserProfile/context.js +1 -1
  342. package/cjs/EditUserProfile.js +15 -15
  343. package/cjs/GroupChannel/components/FileViewer.js +28 -28
  344. package/cjs/GroupChannel/components/FrozenNotification.js +6 -6
  345. package/cjs/GroupChannel/components/GroupChannelHeader.js +29 -29
  346. package/cjs/GroupChannel/components/GroupChannelUI.js +63 -63
  347. package/cjs/GroupChannel/components/Message.js +54 -54
  348. package/cjs/GroupChannel/components/MessageInputWrapper.js +40 -40
  349. package/cjs/GroupChannel/components/MessageList.js +56 -56
  350. package/cjs/GroupChannel/components/RemoveMessageModal.js +27 -27
  351. package/cjs/GroupChannel/components/SuggestedMentionList.js +15 -15
  352. package/cjs/GroupChannel/components/TypingIndicator.js +9 -9
  353. package/cjs/GroupChannel/components/UnreadCount.js +8 -8
  354. package/cjs/GroupChannel/context.js +15 -15
  355. package/cjs/GroupChannel.js +63 -63
  356. package/cjs/GroupChannelList/components/AddGroupChannel.js +89 -89
  357. package/cjs/GroupChannelList/components/GroupChannelListHeader.js +13 -13
  358. package/cjs/GroupChannelList/components/GroupChannelListItem.js +32 -32
  359. package/cjs/GroupChannelList/components/GroupChannelListUI.js +89 -89
  360. package/cjs/GroupChannelList/components/GroupChannelPreviewAction.js +17 -17
  361. package/cjs/GroupChannelList/context.js +10 -10
  362. package/cjs/GroupChannelList.js +89 -89
  363. package/cjs/MessageSearch/components/MessageSearchUI.js +20 -20
  364. package/cjs/MessageSearch/context.js +6 -6
  365. package/cjs/MessageSearch.js +22 -22
  366. package/cjs/OpenChannel/components/FrozenChannelNotification.js +5 -5
  367. package/cjs/OpenChannel/components/OpenChannelHeader.js +20 -20
  368. package/cjs/OpenChannel/components/OpenChannelInput.js +29 -29
  369. package/cjs/OpenChannel/components/OpenChannelMessage.js +39 -39
  370. package/cjs/OpenChannel/components/OpenChannelMessageList.js +43 -43
  371. package/cjs/OpenChannel/components/OpenChannelUI.js +43 -43
  372. package/cjs/OpenChannel/context.js +19 -19
  373. package/cjs/OpenChannel.js +43 -43
  374. package/cjs/OpenChannelList/components/OpenChannelListUI.js +17 -17
  375. package/cjs/OpenChannelList/components/OpenChannelPreview.js +6 -6
  376. package/cjs/OpenChannelList/context.js +6 -6
  377. package/cjs/OpenChannelList.js +17 -17
  378. package/cjs/OpenChannelSettings/components/EditDetailsModal.js +18 -18
  379. package/cjs/OpenChannelSettings/components/OpenChannelProfile.js +18 -18
  380. package/cjs/OpenChannelSettings/components/OpenChannelSettingsUI.js +24 -24
  381. package/cjs/OpenChannelSettings/components/OperatorUI.js +24 -24
  382. package/cjs/OpenChannelSettings/components/ParticipantUI.js +22 -22
  383. package/cjs/OpenChannelSettings/context.js +6 -6
  384. package/cjs/OpenChannelSettings.js +24 -24
  385. package/cjs/SendbirdProvider.js +25 -37
  386. package/cjs/SendbirdProvider.js.map +1 -1
  387. package/cjs/Thread/components/ParentMessageInfo.js +49 -49
  388. package/cjs/Thread/components/ParentMessageInfoItem.js +34 -34
  389. package/cjs/Thread/components/ThreadHeader.js +8 -8
  390. package/cjs/Thread/components/ThreadList.js +56 -56
  391. package/cjs/Thread/components/ThreadListItem.js +56 -56
  392. package/cjs/Thread/components/ThreadMessageInput.js +46 -46
  393. package/cjs/Thread/components/ThreadUI.js +62 -62
  394. package/cjs/Thread/context.js +15 -15
  395. package/cjs/Thread.js +62 -62
  396. package/cjs/VoicePlayer/context.js +6 -6
  397. package/cjs/VoicePlayer/useVoicePlayer.js +14 -14
  398. package/cjs/VoiceRecorder/context.js +13 -13
  399. package/cjs/VoiceRecorder/useVoiceRecorder.js +12 -12
  400. package/cjs/chunks/{bundle-BqgN4h9B.js → bundle-3nGXbnX_.js} +3 -3
  401. package/cjs/chunks/bundle-3nGXbnX_.js.map +1 -0
  402. package/cjs/chunks/{bundle-C1jZykh9.js → bundle-3v0pwJ9H.js} +8 -8
  403. package/cjs/chunks/{bundle-C1jZykh9.js.map → bundle-3v0pwJ9H.js.map} +1 -1
  404. package/cjs/chunks/{bundle-B7bbaMpC.js → bundle-5jlfy1Ow.js} +1 -1
  405. package/cjs/chunks/bundle-5jlfy1Ow.js.map +1 -0
  406. package/cjs/chunks/{bundle-Ne7pjPPs.js → bundle-ANdi3dSr.js} +12 -12
  407. package/cjs/chunks/bundle-ANdi3dSr.js.map +1 -0
  408. package/cjs/chunks/{bundle-DtKfhoNI.js → bundle-B-KfKK9I.js} +12 -12
  409. package/cjs/chunks/{bundle-DtKfhoNI.js.map → bundle-B-KfKK9I.js.map} +1 -1
  410. package/cjs/chunks/{bundle-DY525lGK.js → bundle-B2IxWnYD.js} +1 -1
  411. package/cjs/chunks/bundle-B2IxWnYD.js.map +1 -0
  412. package/cjs/chunks/{bundle-BqeTS099.js → bundle-B2alsqqW.js} +5 -5
  413. package/cjs/chunks/{bundle-BqeTS099.js.map → bundle-B2alsqqW.js.map} +1 -1
  414. package/cjs/chunks/{bundle-mRK_Qp0Z.js → bundle-B5ka_Awd.js} +5 -5
  415. package/cjs/chunks/bundle-B5ka_Awd.js.map +1 -0
  416. package/cjs/chunks/{bundle-Djt2ii_2.js → bundle-B60m32Xw.js} +4 -4
  417. package/cjs/chunks/bundle-B60m32Xw.js.map +1 -0
  418. package/cjs/chunks/{bundle-6h1n2P_q.js → bundle-B9-_x93L.js} +1 -1
  419. package/cjs/chunks/bundle-B9-_x93L.js.map +1 -0
  420. package/cjs/chunks/{bundle-DTYp1_IX.js → bundle-BFC91Brx.js} +3 -3
  421. package/cjs/chunks/{bundle-DTYp1_IX.js.map → bundle-BFC91Brx.js.map} +1 -1
  422. package/cjs/chunks/{bundle-fRoCW5cU.js → bundle-BHWIGgxj.js} +1 -1
  423. package/cjs/chunks/bundle-BHWIGgxj.js.map +1 -0
  424. package/cjs/chunks/{bundle-DPg-KiSF.js → bundle-BIc5sJq4.js} +1 -1
  425. package/cjs/chunks/bundle-BIc5sJq4.js.map +1 -0
  426. package/cjs/chunks/{bundle-aQwLLVXR.js → bundle-BIrJktBj.js} +6 -6
  427. package/cjs/chunks/{bundle-aQwLLVXR.js.map → bundle-BIrJktBj.js.map} +1 -1
  428. package/cjs/chunks/{bundle-CfC9vNIM.js → bundle-BJTLq5Qc.js} +3 -3
  429. package/cjs/chunks/bundle-BJTLq5Qc.js.map +1 -0
  430. package/cjs/chunks/{bundle-DF8tN35T.js → bundle-BOXscfXF.js} +1 -1
  431. package/cjs/chunks/bundle-BOXscfXF.js.map +1 -0
  432. package/cjs/chunks/{bundle-B6DOYjpt.js → bundle-BP4TYvv9.js} +2 -2
  433. package/cjs/chunks/bundle-BP4TYvv9.js.map +1 -0
  434. package/cjs/chunks/{bundle-C8Fgcgjn.js → bundle-BPU8mjJt.js} +1 -1
  435. package/cjs/chunks/bundle-BPU8mjJt.js.map +1 -0
  436. package/cjs/chunks/{bundle-p5wnzqdt.js → bundle-BPpTAdQ0.js} +1 -1
  437. package/cjs/chunks/bundle-BPpTAdQ0.js.map +1 -0
  438. package/cjs/chunks/{bundle-Dllqvr6j.js → bundle-BQleL0j9.js} +9 -9
  439. package/cjs/chunks/{bundle-Dllqvr6j.js.map → bundle-BQleL0j9.js.map} +1 -1
  440. package/cjs/chunks/{bundle-DbNQ7IWL.js → bundle-BUUiEWpE.js} +1 -1
  441. package/cjs/chunks/bundle-BUUiEWpE.js.map +1 -0
  442. package/cjs/chunks/{bundle-u6t53pJ7.js → bundle-BVql4NX6.js} +1 -1
  443. package/cjs/chunks/bundle-BVql4NX6.js.map +1 -0
  444. package/cjs/chunks/{bundle-DL4YS1iF.js → bundle-BWp2X_eQ.js} +3 -3
  445. package/cjs/chunks/bundle-BWp2X_eQ.js.map +1 -0
  446. package/cjs/chunks/{bundle-D0A68Lb-.js → bundle-BZ1V9b9g.js} +3 -3
  447. package/cjs/chunks/bundle-BZ1V9b9g.js.map +1 -0
  448. package/cjs/chunks/{bundle-BlzC5XMH.js → bundle-BeQVnmH2.js} +2 -2
  449. package/cjs/chunks/bundle-BeQVnmH2.js.map +1 -0
  450. package/cjs/chunks/{bundle-DvZwobio.js → bundle-BgvfZZPM.js} +5 -5
  451. package/cjs/chunks/{bundle-DvZwobio.js.map → bundle-BgvfZZPM.js.map} +1 -1
  452. package/cjs/chunks/{bundle-tJAqAz2U.js → bundle-BjmGIkhj.js} +4 -4
  453. package/cjs/chunks/bundle-BjmGIkhj.js.map +1 -0
  454. package/cjs/chunks/{bundle-DaoO1rsa.js → bundle-Bk9VYI5o.js} +7 -7
  455. package/cjs/chunks/bundle-Bk9VYI5o.js.map +1 -0
  456. package/cjs/chunks/{bundle-LiYKIg2T.js → bundle-BmRxveyV.js} +1 -1
  457. package/cjs/chunks/bundle-BmRxveyV.js.map +1 -0
  458. package/cjs/chunks/{bundle-DAHO_FCU.js → bundle-Bo7hpkHl.js} +4 -4
  459. package/cjs/chunks/bundle-Bo7hpkHl.js.map +1 -0
  460. package/cjs/chunks/{bundle-CYEbG-9z.js → bundle-Bq2Z8KaT.js} +5 -5
  461. package/cjs/chunks/{bundle-CYEbG-9z.js.map → bundle-Bq2Z8KaT.js.map} +1 -1
  462. package/cjs/chunks/{bundle-BeLL2cvz.js → bundle-Bvv5CPc1.js} +4 -4
  463. package/cjs/chunks/bundle-Bvv5CPc1.js.map +1 -0
  464. package/cjs/chunks/{bundle-DOxcYysl.js → bundle-C-cKMVK5.js} +3 -3
  465. package/cjs/chunks/{bundle-DOxcYysl.js.map → bundle-C-cKMVK5.js.map} +1 -1
  466. package/cjs/chunks/{bundle-B1poi8ky.js → bundle-C0tjOrov.js} +3 -3
  467. package/cjs/chunks/bundle-C0tjOrov.js.map +1 -0
  468. package/cjs/chunks/{bundle-BcRWZrLE.js → bundle-C2IX5TkS.js} +8 -8
  469. package/cjs/chunks/bundle-C2IX5TkS.js.map +1 -0
  470. package/cjs/chunks/{bundle-COZD0vRV.js → bundle-C3KlPyot.js} +1 -1
  471. package/cjs/chunks/bundle-C3KlPyot.js.map +1 -0
  472. package/cjs/chunks/{bundle-DV8dQrKP.js → bundle-C4QGWug2.js} +4 -4
  473. package/cjs/chunks/{bundle-DV8dQrKP.js.map → bundle-C4QGWug2.js.map} +1 -1
  474. package/cjs/chunks/{bundle-C5RSlOUR.js → bundle-C6KW6xda.js} +1 -1
  475. package/cjs/chunks/{bundle-C5RSlOUR.js.map → bundle-C6KW6xda.js.map} +1 -1
  476. package/cjs/chunks/{bundle-Bi3W488p.js → bundle-CDN8qW7X.js} +1 -1
  477. package/cjs/chunks/bundle-CDN8qW7X.js.map +1 -0
  478. package/cjs/chunks/{bundle-WJ_dqeos.js → bundle-CEZgsFmJ.js} +2 -2
  479. package/cjs/chunks/bundle-CEZgsFmJ.js.map +1 -0
  480. package/cjs/chunks/{bundle-CCDpYveR.js → bundle-CEyLNVvS.js} +2 -2
  481. package/cjs/chunks/bundle-CEyLNVvS.js.map +1 -0
  482. package/cjs/chunks/{bundle-j_su1OuA.js → bundle-CIKnkotk.js} +1 -1
  483. package/cjs/chunks/bundle-CIKnkotk.js.map +1 -0
  484. package/cjs/chunks/{bundle-Dx2wbjLq.js → bundle-CLuHDUOQ.js} +10 -10
  485. package/cjs/chunks/bundle-CLuHDUOQ.js.map +1 -0
  486. package/cjs/chunks/{bundle-_ucvBhL3.js → bundle-CM1ECWyg.js} +4 -4
  487. package/cjs/chunks/bundle-CM1ECWyg.js.map +1 -0
  488. package/cjs/chunks/{bundle-Dddf40n9.js → bundle-CSZcx-m7.js} +6 -6
  489. package/cjs/chunks/bundle-CSZcx-m7.js.map +1 -0
  490. package/cjs/chunks/{bundle-x7dezfHH.js → bundle-CTOCmxIS.js} +5 -5
  491. package/cjs/chunks/{bundle-x7dezfHH.js.map → bundle-CTOCmxIS.js.map} +1 -1
  492. package/cjs/chunks/{bundle-CC2uYZNe.js → bundle-CWhEqpIO.js} +13 -13
  493. package/cjs/chunks/bundle-CWhEqpIO.js.map +1 -0
  494. package/cjs/chunks/{bundle-UyGdKK2c.js → bundle-CY-mROcZ.js} +1 -1
  495. package/cjs/chunks/bundle-CY-mROcZ.js.map +1 -0
  496. package/cjs/chunks/{bundle-CqtILdGL.js → bundle-CYK_lspp.js} +2 -2
  497. package/cjs/chunks/bundle-CYK_lspp.js.map +1 -0
  498. package/cjs/chunks/{bundle-D83uWzVs.js → bundle-CZYADtQm.js} +12 -12
  499. package/cjs/chunks/{bundle-D83uWzVs.js.map → bundle-CZYADtQm.js.map} +1 -1
  500. package/cjs/chunks/{bundle-D1FpWSQm.js → bundle-CapDmj2N.js} +7 -7
  501. package/cjs/chunks/bundle-CapDmj2N.js.map +1 -0
  502. package/cjs/chunks/{bundle-D2XAcu9j.js → bundle-Ci9Z8Gx1.js} +1 -1
  503. package/cjs/chunks/bundle-Ci9Z8Gx1.js.map +1 -0
  504. package/cjs/chunks/{bundle-DeGDoBu7.js → bundle-CieeZY6s.js} +4 -4
  505. package/cjs/chunks/bundle-CieeZY6s.js.map +1 -0
  506. package/cjs/chunks/{bundle-CJAFRCBd.js → bundle-Cio3geXX.js} +3 -3
  507. package/cjs/chunks/bundle-Cio3geXX.js.map +1 -0
  508. package/cjs/chunks/{bundle-BaVeAHy2.js → bundle-Cjvq2ZOT.js} +1 -1
  509. package/cjs/chunks/bundle-Cjvq2ZOT.js.map +1 -0
  510. package/cjs/chunks/{bundle-CdGGt1a7.js → bundle-CoT59Mpu.js} +33 -33
  511. package/cjs/chunks/{bundle-CdGGt1a7.js.map → bundle-CoT59Mpu.js.map} +1 -1
  512. package/cjs/chunks/{bundle-DscV88BB.js → bundle-CrB7AETR.js} +11 -11
  513. package/cjs/chunks/{bundle-DscV88BB.js.map → bundle-CrB7AETR.js.map} +1 -1
  514. package/cjs/chunks/{bundle-DZmcEu-b.js → bundle-CtpWAlqw.js} +1 -1
  515. package/cjs/chunks/bundle-CtpWAlqw.js.map +1 -0
  516. package/cjs/chunks/{bundle-CZPePc2t.js → bundle-D9VNRYiT.js} +1 -1
  517. package/cjs/chunks/{bundle-CZPePc2t.js.map → bundle-D9VNRYiT.js.map} +1 -1
  518. package/cjs/chunks/{bundle-DNQGVWnV.js → bundle-DDvS9HEb.js} +10 -10
  519. package/cjs/chunks/{bundle-DNQGVWnV.js.map → bundle-DDvS9HEb.js.map} +1 -1
  520. package/cjs/chunks/{bundle-BMGmNFp0.js → bundle-DH-nEckd.js} +1 -1
  521. package/cjs/chunks/bundle-DH-nEckd.js.map +1 -0
  522. package/cjs/chunks/{bundle-BB3usWy-.js → bundle-DWK3fan8.js} +3 -3
  523. package/cjs/chunks/{bundle-BB3usWy-.js.map → bundle-DWK3fan8.js.map} +1 -1
  524. package/cjs/chunks/{bundle-CkZtFq6q.js → bundle-DYREwheh.js} +1 -1
  525. package/cjs/chunks/bundle-DYREwheh.js.map +1 -0
  526. package/cjs/chunks/{bundle-Su0VDNtk.js → bundle-DZLiR5dN.js} +7 -7
  527. package/cjs/chunks/{bundle-Su0VDNtk.js.map → bundle-DZLiR5dN.js.map} +1 -1
  528. package/cjs/chunks/{bundle-D1BBuUkr.js → bundle-DbbuwUMm.js} +8 -8
  529. package/cjs/chunks/bundle-DbbuwUMm.js.map +1 -0
  530. package/cjs/chunks/{bundle-D9GnZ-f4.js → bundle-DeaZ2PrP.js} +4 -4
  531. package/cjs/chunks/bundle-DeaZ2PrP.js.map +1 -0
  532. package/cjs/chunks/{bundle-xP7D-eUo.js → bundle-DfqFZ2kQ.js} +14 -14
  533. package/cjs/chunks/bundle-DfqFZ2kQ.js.map +1 -0
  534. package/cjs/chunks/{bundle-CYwuwOrD.js → bundle-Dg48fEl9.js} +1 -1
  535. package/cjs/chunks/bundle-Dg48fEl9.js.map +1 -0
  536. package/cjs/chunks/{bundle-CBCMnAvc.js → bundle-Dg8Ui-Gg.js} +1 -1
  537. package/cjs/chunks/bundle-Dg8Ui-Gg.js.map +1 -0
  538. package/cjs/chunks/{bundle-Cdi-R4pl.js → bundle-DjmBE7_s.js} +4 -4
  539. package/cjs/chunks/bundle-DjmBE7_s.js.map +1 -0
  540. package/cjs/chunks/{bundle-DTK7beSk.js → bundle-DmcomVs0.js} +4 -4
  541. package/cjs/chunks/bundle-DmcomVs0.js.map +1 -0
  542. package/cjs/chunks/{bundle-DzHgX6fh.js → bundle-DnJDR4u5.js} +14 -14
  543. package/cjs/chunks/{bundle-DzHgX6fh.js.map → bundle-DnJDR4u5.js.map} +1 -1
  544. package/cjs/chunks/{bundle-BrM1-UXm.js → bundle-DoIfqfcV.js} +15 -15
  545. package/cjs/chunks/{bundle-BrM1-UXm.js.map → bundle-DoIfqfcV.js.map} +1 -1
  546. package/cjs/chunks/{bundle-Dl3S38Mg.js → bundle-DqXYRRO7.js} +1 -1
  547. package/cjs/chunks/bundle-DqXYRRO7.js.map +1 -0
  548. package/cjs/chunks/{bundle-DRBMbyrb.js → bundle-Du3meFk3.js} +5 -5
  549. package/cjs/chunks/bundle-Du3meFk3.js.map +1 -0
  550. package/cjs/chunks/{bundle-BCNbuTSQ.js → bundle-DvPryEJn.js} +3 -3
  551. package/cjs/chunks/bundle-DvPryEJn.js.map +1 -0
  552. package/cjs/chunks/{bundle-Ek9yNmPl.js → bundle-DxCwRDJR.js} +6 -6
  553. package/cjs/chunks/bundle-DxCwRDJR.js.map +1 -0
  554. package/cjs/chunks/{bundle-DI_0Husc.js → bundle-DzXjLE21.js} +11 -8
  555. package/cjs/chunks/bundle-DzXjLE21.js.map +1 -0
  556. package/cjs/chunks/{bundle-2bQLJ54p.js → bundle-EMsvSkjF.js} +1 -1
  557. package/cjs/chunks/{bundle-2bQLJ54p.js.map → bundle-EMsvSkjF.js.map} +1 -1
  558. package/cjs/chunks/{bundle-CrMI4ALf.js → bundle-KIOZb3ks.js} +1 -1
  559. package/cjs/chunks/bundle-KIOZb3ks.js.map +1 -0
  560. package/cjs/chunks/{bundle-BgT1C26q.js → bundle-LKI8DB23.js} +7 -7
  561. package/{chunks/bundle-CikfJU8T.js.map → cjs/chunks/bundle-LKI8DB23.js.map} +1 -1
  562. package/cjs/chunks/{bundle-B3q-UFsa.js → bundle-LgVwQzf4.js} +1 -1
  563. package/cjs/chunks/bundle-LgVwQzf4.js.map +1 -0
  564. package/cjs/chunks/{bundle-BZypscj-.js → bundle-QrcqdsaB.js} +2 -2
  565. package/cjs/chunks/{bundle-BZypscj-.js.map → bundle-QrcqdsaB.js.map} +1 -1
  566. package/cjs/chunks/{bundle-DhFMhR5E.js → bundle-SAAHguUX.js} +9 -9
  567. package/cjs/chunks/{bundle-DhFMhR5E.js.map → bundle-SAAHguUX.js.map} +1 -1
  568. package/cjs/chunks/{bundle-CwNK2SSQ.js → bundle-b-GMoXo9.js} +8 -8
  569. package/cjs/chunks/bundle-b-GMoXo9.js.map +1 -0
  570. package/cjs/chunks/{bundle-DUysGFFA.js → bundle-eL933_es.js} +4 -4
  571. package/cjs/chunks/bundle-eL933_es.js.map +1 -0
  572. package/cjs/chunks/{bundle-DZj11iNX.js → bundle-kN_YmX6K.js} +12 -12
  573. package/cjs/chunks/{bundle-DZj11iNX.js.map → bundle-kN_YmX6K.js.map} +1 -1
  574. package/cjs/chunks/{bundle-C_LglGAg.js → bundle-mDwFNnD9.js} +2 -2
  575. package/cjs/chunks/bundle-mDwFNnD9.js.map +1 -0
  576. package/cjs/chunks/{bundle-DmwC4AYU.js → bundle-rBcfDSMC.js} +1 -1
  577. package/cjs/chunks/bundle-rBcfDSMC.js.map +1 -0
  578. package/cjs/chunks/bundle-rpg5uLhA.js +32 -0
  579. package/cjs/chunks/bundle-rpg5uLhA.js.map +1 -0
  580. package/cjs/chunks/{bundle-DdZ6TH50.js → bundle-yeJtF1C-.js} +1 -1
  581. package/cjs/chunks/bundle-yeJtF1C-.js.map +1 -0
  582. package/cjs/chunks/{bundle-CB1pVlp0.js → bundle-yj3Q8bOY.js} +2 -2
  583. package/cjs/chunks/bundle-yj3Q8bOY.js.map +1 -0
  584. package/cjs/hooks/useConnectionState.js +5 -5
  585. package/cjs/hooks/useLocalization.js +4 -4
  586. package/cjs/hooks/useModal.js +13 -13
  587. package/cjs/index.js +90 -90
  588. package/cjs/pubSub/topics.js +1 -1
  589. package/cjs/sendbirdSelectors.js +2 -2
  590. package/cjs/ui/Accordion.js +2 -2
  591. package/cjs/ui/AccordionGroup.js +1 -1
  592. package/cjs/ui/AdminMessage.js +3 -3
  593. package/cjs/ui/Avatar.js +4 -4
  594. package/cjs/ui/Badge.js +5 -5
  595. package/cjs/ui/BottomSheet.js +13 -13
  596. package/cjs/ui/Button.js +3 -3
  597. package/cjs/ui/ChannelAvatar.js +5 -5
  598. package/cjs/ui/ConnectionStatus.js +6 -6
  599. package/cjs/ui/ContextMenu.js +14 -14
  600. package/cjs/ui/DateSeparator.js +4 -4
  601. package/cjs/ui/EmojiReactions.js +23 -23
  602. package/cjs/ui/FallbackTemplateMessageItemBody.tsx.js +10 -10
  603. package/cjs/ui/FileMessageItemBody.js +13 -13
  604. package/cjs/ui/FileViewer.js +19 -19
  605. package/cjs/ui/Header.js +6 -6
  606. package/cjs/ui/Icon.js +2 -2
  607. package/cjs/ui/IconButton.js +1 -1
  608. package/cjs/ui/ImageRenderer.js +2 -2
  609. package/cjs/ui/Input.js +3 -3
  610. package/cjs/ui/Label.js +3 -3
  611. package/cjs/ui/LinkLabel.js +4 -4
  612. package/cjs/ui/Loader.js +2 -2
  613. package/cjs/ui/LoadingTemplateMessageItemBody.tsx.js +2 -2
  614. package/cjs/ui/MentionLabel.js +19 -19
  615. package/cjs/ui/MentionUserLabel.js +2 -2
  616. package/cjs/ui/MessageContent.js +42 -42
  617. package/cjs/ui/MessageFeedbackFailedModal.js +13 -13
  618. package/cjs/ui/MessageFeedbackModal.js +13 -13
  619. package/cjs/ui/MessageInput/hooks/usePaste.js +7 -7
  620. package/cjs/ui/MessageInput.js +23 -21
  621. package/cjs/ui/MessageInput.js.map +1 -1
  622. package/cjs/ui/MessageItemMenu.js +15 -15
  623. package/cjs/ui/MessageItemReactionMenu.js +16 -16
  624. package/cjs/ui/MessageMenu.js +16 -16
  625. package/cjs/ui/MessageSearchFileItem.js +17 -17
  626. package/cjs/ui/MessageSearchItem.js +12 -12
  627. package/cjs/ui/MessageStatus.js +15 -15
  628. package/cjs/ui/MessageTemplate.js +1 -1
  629. package/cjs/ui/MobileFeedbackMenu.js +13 -13
  630. package/cjs/ui/MobileMenu.js +18 -18
  631. package/cjs/ui/Modal.js +12 -12
  632. package/cjs/ui/MutedAvatarOverlay.js +2 -2
  633. package/cjs/ui/OGMessageItemBody.js +23 -23
  634. package/cjs/ui/OpenChannelAdminMessage.js +3 -3
  635. package/cjs/ui/OpenChannelAvatar.js +8 -8
  636. package/cjs/ui/OpenchannelConversationHeader.js +8 -8
  637. package/cjs/ui/OpenchannelFileMessage.js +24 -24
  638. package/cjs/ui/OpenchannelOGMessage.js +26 -26
  639. package/cjs/ui/OpenchannelThumbnailMessage.js +23 -23
  640. package/cjs/ui/OpenchannelUserMessage.js +24 -24
  641. package/cjs/ui/PlaceHolder.js +6 -6
  642. package/cjs/ui/PlaybackTime.js +3 -3
  643. package/cjs/ui/ProgressBar.js +1 -1
  644. package/cjs/ui/QuoteMessage.js +12 -12
  645. package/cjs/ui/QuoteMessageInput.js +12 -12
  646. package/cjs/ui/ReactionBadge.js +3 -3
  647. package/cjs/ui/ReactionButton.js +4 -4
  648. package/cjs/ui/SortByRow.js +2 -2
  649. package/cjs/ui/TemplateMessageItemBody.js +15 -15
  650. package/cjs/ui/TextButton.js +2 -2
  651. package/cjs/ui/TextMessageItemBody.js +22 -22
  652. package/cjs/ui/ThreadReplies.js +8 -8
  653. package/cjs/ui/ThumbnailMessageItemBody.js +10 -10
  654. package/cjs/ui/Toggle.js +4 -4
  655. package/cjs/ui/Tooltip.js +3 -3
  656. package/cjs/ui/TooltipWrapper.js +1 -1
  657. package/cjs/ui/TypingIndicatorBubble.js +4 -4
  658. package/cjs/ui/UnknownMessageItemBody.js +10 -10
  659. package/cjs/ui/UserListItem.js +19 -19
  660. package/cjs/ui/UserListItemMenu.js +16 -16
  661. package/cjs/ui/UserProfile.js +13 -13
  662. package/cjs/ui/VoiceMessageInput.js +9 -9
  663. package/cjs/ui/VoiceMessageItemBody.js +14 -14
  664. package/cjs/ui/Word.js +19 -19
  665. package/cjs/useSendbirdStateContext.js +4 -4
  666. package/cjs/utils/message/isVoiceMessage.js +6 -6
  667. package/cjs/withSendbird.js +24 -24
  668. package/dist/index.css +0 -96
  669. package/hooks/useConnectionState.js +5 -5
  670. package/hooks/useLocalization.js +4 -4
  671. package/hooks/useModal.js +14 -14
  672. package/index.js +90 -90
  673. package/package.json +4 -4
  674. package/pubSub/topics.js +1 -1
  675. package/sendbirdSelectors.js +2 -2
  676. package/types/ui/MessageInput/utils.d.ts +1 -0
  677. package/ui/Accordion.js +2 -2
  678. package/ui/AccordionGroup.js +1 -1
  679. package/ui/AdminMessage.js +3 -3
  680. package/ui/Avatar.js +4 -4
  681. package/ui/Badge.js +5 -5
  682. package/ui/BottomSheet.js +13 -13
  683. package/ui/Button.js +3 -3
  684. package/ui/ChannelAvatar.js +5 -5
  685. package/ui/ConnectionStatus.js +6 -6
  686. package/ui/ContextMenu.js +14 -14
  687. package/ui/DateSeparator.js +4 -4
  688. package/ui/EmojiReactions.js +23 -23
  689. package/ui/FallbackTemplateMessageItemBody.tsx.js +10 -10
  690. package/ui/FileMessageItemBody.js +13 -13
  691. package/ui/FileViewer.js +19 -19
  692. package/ui/Header.js +6 -6
  693. package/ui/Icon.js +2 -2
  694. package/ui/IconButton.js +1 -1
  695. package/ui/ImageRenderer.js +2 -2
  696. package/ui/Input.js +3 -3
  697. package/ui/Label.js +3 -3
  698. package/ui/LinkLabel.js +4 -4
  699. package/ui/Loader.js +2 -2
  700. package/ui/LoadingTemplateMessageItemBody.tsx.js +2 -2
  701. package/ui/MentionLabel.js +19 -19
  702. package/ui/MentionUserLabel.js +2 -2
  703. package/ui/MessageContent.js +42 -42
  704. package/ui/MessageFeedbackFailedModal.js +13 -13
  705. package/ui/MessageFeedbackModal.js +13 -13
  706. package/ui/MessageInput/hooks/usePaste.js +7 -7
  707. package/ui/MessageInput.js +23 -21
  708. package/ui/MessageInput.js.map +1 -1
  709. package/ui/MessageItemMenu.js +15 -15
  710. package/ui/MessageItemReactionMenu.js +16 -16
  711. package/ui/MessageMenu.js +16 -16
  712. package/ui/MessageSearchFileItem.js +17 -17
  713. package/ui/MessageSearchItem.js +12 -12
  714. package/ui/MessageStatus.js +15 -15
  715. package/ui/MessageTemplate.js +1 -1
  716. package/ui/MobileFeedbackMenu.js +13 -13
  717. package/ui/MobileMenu.js +18 -18
  718. package/ui/Modal.js +12 -12
  719. package/ui/MutedAvatarOverlay.js +2 -2
  720. package/ui/OGMessageItemBody.js +23 -23
  721. package/ui/OpenChannelAdminMessage.js +3 -3
  722. package/ui/OpenChannelAvatar.js +8 -8
  723. package/ui/OpenchannelConversationHeader.js +8 -8
  724. package/ui/OpenchannelFileMessage.js +24 -24
  725. package/ui/OpenchannelOGMessage.js +26 -26
  726. package/ui/OpenchannelThumbnailMessage.js +23 -23
  727. package/ui/OpenchannelUserMessage.js +24 -24
  728. package/ui/PlaceHolder.js +6 -6
  729. package/ui/PlaybackTime.js +3 -3
  730. package/ui/ProgressBar.js +1 -1
  731. package/ui/QuoteMessage.js +12 -12
  732. package/ui/QuoteMessageInput.js +12 -12
  733. package/ui/ReactionBadge.js +3 -3
  734. package/ui/ReactionButton.js +4 -4
  735. package/ui/SortByRow.js +2 -2
  736. package/ui/TemplateMessageItemBody.js +15 -15
  737. package/ui/TextButton.js +2 -2
  738. package/ui/TextMessageItemBody.js +22 -22
  739. package/ui/ThreadReplies.js +8 -8
  740. package/ui/ThumbnailMessageItemBody.js +10 -10
  741. package/ui/Toggle.js +4 -4
  742. package/ui/Tooltip.js +3 -3
  743. package/ui/TooltipWrapper.js +1 -1
  744. package/ui/TypingIndicatorBubble.js +4 -4
  745. package/ui/UnknownMessageItemBody.js +10 -10
  746. package/ui/UserListItem.js +19 -19
  747. package/ui/UserListItemMenu.js +17 -17
  748. package/ui/UserProfile.js +13 -13
  749. package/ui/VoiceMessageInput.js +9 -9
  750. package/ui/VoiceMessageItemBody.js +14 -14
  751. package/ui/Word.js +19 -19
  752. package/useSendbirdStateContext.js +4 -4
  753. package/utils/message/isVoiceMessage.js +6 -6
  754. package/withSendbird.js +24 -24
  755. package/chunks/bundle-8TDNINAX.js.map +0 -1
  756. package/chunks/bundle-9YecU3PU.js.map +0 -1
  757. package/chunks/bundle-B-s0FWL1.js.map +0 -1
  758. package/chunks/bundle-B1ARVsV8.js.map +0 -1
  759. package/chunks/bundle-BOcsG7ba.js.map +0 -1
  760. package/chunks/bundle-BTpGKOuy.js.map +0 -1
  761. package/chunks/bundle-BiqO1upP.js.map +0 -1
  762. package/chunks/bundle-BlL-p6Zz.js.map +0 -1
  763. package/chunks/bundle-BststcQu.js.map +0 -1
  764. package/chunks/bundle-Bw9LhfR9.js +0 -2342
  765. package/chunks/bundle-Bw9LhfR9.js.map +0 -1
  766. package/chunks/bundle-C0tTOdr-.js.map +0 -1
  767. package/chunks/bundle-C4wKOeqt.js.map +0 -1
  768. package/chunks/bundle-C9TQA43p.js.map +0 -1
  769. package/chunks/bundle-CAE5bDSW.js.map +0 -1
  770. package/chunks/bundle-CJ_hA_3S.js.map +0 -1
  771. package/chunks/bundle-CJemq6cX.js.map +0 -1
  772. package/chunks/bundle-CS_zfDpT.js.map +0 -1
  773. package/chunks/bundle-CTo5rr_w.js.map +0 -1
  774. package/chunks/bundle-CUnmeLF6.js.map +0 -1
  775. package/chunks/bundle-CY7euRvz.js.map +0 -1
  776. package/chunks/bundle-C_EuInqG.js.map +0 -1
  777. package/chunks/bundle-Cc-szMmt.js.map +0 -1
  778. package/chunks/bundle-CdOYsaX9.js.map +0 -1
  779. package/chunks/bundle-CgQaz0Nj.js.map +0 -1
  780. package/chunks/bundle-CtAmTXUa.js.map +0 -1
  781. package/chunks/bundle-Cu1scdm7.js.map +0 -1
  782. package/chunks/bundle-D2-HOzgX.js.map +0 -1
  783. package/chunks/bundle-DAYo2mkS.js.map +0 -1
  784. package/chunks/bundle-DD2MMoZ3.js.map +0 -1
  785. package/chunks/bundle-DMcf5OHL.js.map +0 -1
  786. package/chunks/bundle-DO80aKFO.js.map +0 -1
  787. package/chunks/bundle-DPduJzw9.js.map +0 -1
  788. package/chunks/bundle-DYC6yyN-.js.map +0 -1
  789. package/chunks/bundle-DaX34W07.js.map +0 -1
  790. package/chunks/bundle-DfThYlSD.js.map +0 -1
  791. package/chunks/bundle-DkAvIH82.js.map +0 -1
  792. package/chunks/bundle-DmYFHm_s.js.map +0 -1
  793. package/chunks/bundle-Do5Tg9CE.js.map +0 -1
  794. package/chunks/bundle-DpmW9A4U.js.map +0 -1
  795. package/chunks/bundle-HnotAMvV.js.map +0 -1
  796. package/chunks/bundle-LBf6CphS.js.map +0 -1
  797. package/chunks/bundle-Lsd9GvqK.js.map +0 -1
  798. package/chunks/bundle-QNC758GX.js.map +0 -1
  799. package/chunks/bundle-Rkg87QeA.js.map +0 -1
  800. package/chunks/bundle-Vy-gCopV.js.map +0 -1
  801. package/chunks/bundle-e4e9u3jP.js.map +0 -1
  802. package/chunks/bundle-fjYZUavu.js.map +0 -1
  803. package/chunks/bundle-ua_cRehb.js.map +0 -1
  804. package/chunks/bundle-xix2tXY6.js.map +0 -1
  805. package/chunks/bundle-yCvBYPzY.js.map +0 -1
  806. package/chunks/bundle-yd76uvgx.js.map +0 -1
  807. package/chunks/bundle-zJKoxW9b.js.map +0 -1
  808. package/cjs/chunks/bundle-6h1n2P_q.js.map +0 -1
  809. package/cjs/chunks/bundle-B1poi8ky.js.map +0 -1
  810. package/cjs/chunks/bundle-B3q-UFsa.js.map +0 -1
  811. package/cjs/chunks/bundle-B6DOYjpt.js.map +0 -1
  812. package/cjs/chunks/bundle-B7bbaMpC.js.map +0 -1
  813. package/cjs/chunks/bundle-BCNbuTSQ.js.map +0 -1
  814. package/cjs/chunks/bundle-BMGmNFp0.js.map +0 -1
  815. package/cjs/chunks/bundle-BaVeAHy2.js.map +0 -1
  816. package/cjs/chunks/bundle-BcRWZrLE.js.map +0 -1
  817. package/cjs/chunks/bundle-BeLL2cvz.js.map +0 -1
  818. package/cjs/chunks/bundle-Bi3W488p.js.map +0 -1
  819. package/cjs/chunks/bundle-BlzC5XMH.js.map +0 -1
  820. package/cjs/chunks/bundle-BqgN4h9B.js.map +0 -1
  821. package/cjs/chunks/bundle-BsQpzivE.js +0 -2349
  822. package/cjs/chunks/bundle-BsQpzivE.js.map +0 -1
  823. package/cjs/chunks/bundle-C8Fgcgjn.js.map +0 -1
  824. package/cjs/chunks/bundle-CB1pVlp0.js.map +0 -1
  825. package/cjs/chunks/bundle-CBCMnAvc.js.map +0 -1
  826. package/cjs/chunks/bundle-CC2uYZNe.js.map +0 -1
  827. package/cjs/chunks/bundle-CCDpYveR.js.map +0 -1
  828. package/cjs/chunks/bundle-CJAFRCBd.js.map +0 -1
  829. package/cjs/chunks/bundle-COZD0vRV.js.map +0 -1
  830. package/cjs/chunks/bundle-CYwuwOrD.js.map +0 -1
  831. package/cjs/chunks/bundle-C_LglGAg.js.map +0 -1
  832. package/cjs/chunks/bundle-Cdi-R4pl.js.map +0 -1
  833. package/cjs/chunks/bundle-CfC9vNIM.js.map +0 -1
  834. package/cjs/chunks/bundle-CkZtFq6q.js.map +0 -1
  835. package/cjs/chunks/bundle-CqtILdGL.js.map +0 -1
  836. package/cjs/chunks/bundle-CrMI4ALf.js.map +0 -1
  837. package/cjs/chunks/bundle-CwNK2SSQ.js.map +0 -1
  838. package/cjs/chunks/bundle-D0A68Lb-.js.map +0 -1
  839. package/cjs/chunks/bundle-D1BBuUkr.js.map +0 -1
  840. package/cjs/chunks/bundle-D1FpWSQm.js.map +0 -1
  841. package/cjs/chunks/bundle-D2XAcu9j.js.map +0 -1
  842. package/cjs/chunks/bundle-D9GnZ-f4.js.map +0 -1
  843. package/cjs/chunks/bundle-DAHO_FCU.js.map +0 -1
  844. package/cjs/chunks/bundle-DF8tN35T.js.map +0 -1
  845. package/cjs/chunks/bundle-DI_0Husc.js.map +0 -1
  846. package/cjs/chunks/bundle-DL4YS1iF.js.map +0 -1
  847. package/cjs/chunks/bundle-DPg-KiSF.js.map +0 -1
  848. package/cjs/chunks/bundle-DRBMbyrb.js.map +0 -1
  849. package/cjs/chunks/bundle-DTK7beSk.js.map +0 -1
  850. package/cjs/chunks/bundle-DUysGFFA.js.map +0 -1
  851. package/cjs/chunks/bundle-DY525lGK.js.map +0 -1
  852. package/cjs/chunks/bundle-DZmcEu-b.js.map +0 -1
  853. package/cjs/chunks/bundle-DaoO1rsa.js.map +0 -1
  854. package/cjs/chunks/bundle-DbNQ7IWL.js.map +0 -1
  855. package/cjs/chunks/bundle-DdZ6TH50.js.map +0 -1
  856. package/cjs/chunks/bundle-Dddf40n9.js.map +0 -1
  857. package/cjs/chunks/bundle-DeGDoBu7.js.map +0 -1
  858. package/cjs/chunks/bundle-Djt2ii_2.js.map +0 -1
  859. package/cjs/chunks/bundle-Dl3S38Mg.js.map +0 -1
  860. package/cjs/chunks/bundle-DmwC4AYU.js.map +0 -1
  861. package/cjs/chunks/bundle-Dx2wbjLq.js.map +0 -1
  862. package/cjs/chunks/bundle-Ek9yNmPl.js.map +0 -1
  863. package/cjs/chunks/bundle-LiYKIg2T.js.map +0 -1
  864. package/cjs/chunks/bundle-Ne7pjPPs.js.map +0 -1
  865. package/cjs/chunks/bundle-UyGdKK2c.js.map +0 -1
  866. package/cjs/chunks/bundle-WJ_dqeos.js.map +0 -1
  867. package/cjs/chunks/bundle-_ucvBhL3.js.map +0 -1
  868. package/cjs/chunks/bundle-fRoCW5cU.js.map +0 -1
  869. package/cjs/chunks/bundle-j_su1OuA.js.map +0 -1
  870. package/cjs/chunks/bundle-mRK_Qp0Z.js.map +0 -1
  871. package/cjs/chunks/bundle-p5wnzqdt.js.map +0 -1
  872. package/cjs/chunks/bundle-tJAqAz2U.js.map +0 -1
  873. package/cjs/chunks/bundle-u6t53pJ7.js.map +0 -1
  874. package/cjs/chunks/bundle-xP7D-eUo.js.map +0 -1
@@ -1,2349 +0,0 @@
1
- 'use strict';
2
-
3
- var React = require('react');
4
-
5
- function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
6
-
7
- var React__default = /*#__PURE__*/_interopDefaultCompat(React);
8
-
9
- var ComponentType;
10
- (function (ComponentType) {
11
- ComponentType["Box"] = "box";
12
- ComponentType["Text"] = "text";
13
- ComponentType["Image"] = "image";
14
- ComponentType["TextButton"] = "textButton";
15
- ComponentType["ImageButton"] = "imageButton";
16
- ComponentType["Carousel"] = "carouselView";
17
- ComponentType["Cascade"] = "cascadeView";
18
- })(ComponentType || (ComponentType = {}));
19
-
20
- const outSingle$1 = (key, obj) => {
21
- if (typeof obj[key] !== 'string')
22
- return {};
23
- return { [key]: argbToRgba(obj[key]) };
24
- };
25
- function argbToRgba(string) {
26
- if (!string.startsWith('#')) {
27
- return string;
28
- }
29
- if (string.length === 9) {
30
- return `#${string.slice(3)}${string[1]}${string[2]}`;
31
- }
32
- if (string.length === 5) {
33
- return `#${string.slice(2)}${string[1]}`;
34
- }
35
- return string;
36
- }
37
- const outViewStyle$1 = (viewStyle) => {
38
- if (!viewStyle)
39
- return {};
40
- return {
41
- viewStyle: Object.assign(Object.assign(Object.assign({}, viewStyle), outSingle$1('backgroundColor', viewStyle)), outSingle$1('borderColor', viewStyle)),
42
- };
43
- };
44
- const outTextStyle$1 = (textStyle) => {
45
- if (!textStyle)
46
- return {};
47
- return {
48
- textStyle: Object.assign(Object.assign({}, textStyle), outSingle$1('color', textStyle)),
49
- };
50
- };
51
- const outImageStyle = (imageStyle) => {
52
- if (!imageStyle)
53
- return {};
54
- return {
55
- imageStyle: Object.assign(Object.assign({}, imageStyle), outSingle$1('tintColor', imageStyle)),
56
- };
57
- };
58
- const colorTransform = {
59
- run(prop) {
60
- if (prop.type === ComponentType.Text || prop.type === ComponentType.TextButton) {
61
- return Object.assign(Object.assign(Object.assign({}, prop), outViewStyle$1(prop.viewStyle)), outTextStyle$1(prop.textStyle));
62
- }
63
- if (prop.type === ComponentType.ImageButton || prop.type === ComponentType.Image) {
64
- return Object.assign(Object.assign(Object.assign({}, prop), outViewStyle$1(prop.viewStyle)), outImageStyle(prop.imageStyle));
65
- }
66
- return Object.assign(Object.assign({}, prop), outViewStyle$1(prop.viewStyle));
67
- },
68
- };
69
-
70
- const isNumber = (val) => {
71
- if (typeof val === 'string') {
72
- return !Number.isNaN(Number(val));
73
- }
74
- return typeof val === 'number' && !Number.isNaN(val);
75
- };
76
- const outSingle = (key, obj) => {
77
- if (obj[key] === undefined || obj[key] === null)
78
- return {};
79
- return isNumber(obj[key]) ? { [key]: Number(obj[key]) } : {};
80
- };
81
- const outSpacing = (key, spacing) => {
82
- if (!spacing)
83
- return {};
84
- return {
85
- [key]: {
86
- left: isNumber(spacing.left) ? Number(spacing.left) : spacing.left,
87
- right: isNumber(spacing.right) ? Number(spacing.right) : spacing.right,
88
- top: isNumber(spacing.top) ? Number(spacing.top) : spacing.top,
89
- bottom: isNumber(spacing.bottom) ? Number(spacing.bottom) : spacing.bottom,
90
- },
91
- };
92
- };
93
- const outSize = (key, size) => {
94
- if (!size)
95
- return {};
96
- return {
97
- [key]: {
98
- type: size.type,
99
- value: isNumber(size.value) ? Number(size.value) : size.value,
100
- },
101
- };
102
- };
103
- const outMetadata = (metaData) => {
104
- if (!metaData)
105
- return {};
106
- return {
107
- metaData: {
108
- pixelWidth: isNumber(metaData.pixelWidth) ? Number(metaData.pixelWidth) : metaData.pixelWidth,
109
- pixelHeight: isNumber(metaData.pixelHeight) ? Number(metaData.pixelHeight) : metaData.pixelHeight,
110
- },
111
- };
112
- };
113
- const outViewStyle = (viewStyle) => {
114
- if (!viewStyle)
115
- return {};
116
- return {
117
- viewStyle: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, viewStyle), outSingle('borderWidth', viewStyle)), outSingle('radius', viewStyle)), outSpacing('margin', viewStyle.margin)), outSpacing('padding', viewStyle.padding)),
118
- };
119
- };
120
- const outTextStyle = (textStyle) => {
121
- if (!textStyle)
122
- return {};
123
- return {
124
- textStyle: Object.assign(Object.assign(Object.assign({}, textStyle), outSingle('size', textStyle)), outSingle('weight', textStyle)),
125
- };
126
- };
127
- const outCarouselStyle = (carouselstyle) => {
128
- if (!carouselstyle)
129
- return {};
130
- return {
131
- carouselStyle: Object.assign(Object.assign(Object.assign({}, carouselstyle), outSingle('spacing', carouselstyle)), outSingle('maxChildWidth', carouselstyle)),
132
- };
133
- };
134
- const outCascadeStyle = (cascadeStyle) => {
135
- if (!cascadeStyle)
136
- return {};
137
- return {
138
- cascadeStyle: Object.assign(Object.assign({}, cascadeStyle), outSingle('spacing', cascadeStyle)),
139
- };
140
- };
141
- const outViewProps = (view) => {
142
- return Object.assign(Object.assign(Object.assign({}, outSize('width', view.width)), outSize('height', view.height)), outViewStyle(view.viewStyle));
143
- };
144
- const outTextProps = (text) => {
145
- return Object.assign(Object.assign(Object.assign({}, outViewProps(text)), outTextStyle(text.textStyle)), outSingle('maxTextLines', text));
146
- };
147
- const outImageProps = (image) => {
148
- return Object.assign(Object.assign({}, outViewProps(image)), outMetadata(image.metaData));
149
- };
150
- const outCarouselProps = (carousel) => {
151
- return Object.assign(Object.assign(Object.assign({}, outViewProps(carousel)), outCarouselStyle(carousel.carouselStyle)), {
152
- // Convert only top-level items to find has fill width values.
153
- items: carousel.items.map((item) => (Object.assign(Object.assign({}, item), { body: Object.assign(Object.assign({}, item.body), { items: item.body.items.map((it) => numberTransform.run(it)) }) }))) });
154
- };
155
- const outCascadeProps = (cascade) => {
156
- return Object.assign(Object.assign(Object.assign({}, outViewProps(cascade)), outCascadeStyle(cascade.cascadeStyle)), {
157
- // Convert only top-level items to find has fill width values.
158
- items: cascade.items.map((item) => (Object.assign(Object.assign({}, item), { body: Object.assign(Object.assign({}, item.body), { items: item.body.items.map((it) => numberTransform.run(it)) }) }))) });
159
- };
160
- const numberTransform = {
161
- run(prop) {
162
- if (prop.type === ComponentType.Text || prop.type === ComponentType.TextButton) {
163
- return Object.assign(Object.assign({}, prop), outTextProps(prop));
164
- }
165
- if (prop.type === ComponentType.ImageButton || prop.type === ComponentType.Image) {
166
- return Object.assign(Object.assign({}, prop), outImageProps(prop));
167
- }
168
- if (prop.type === ComponentType.Carousel) {
169
- return Object.assign(Object.assign({}, prop), outCarouselProps(prop));
170
- }
171
- if (prop.type === ComponentType.Cascade) {
172
- return Object.assign(Object.assign({}, prop), outCascadeProps(prop));
173
- }
174
- return Object.assign(Object.assign({}, prop), outViewProps(prop));
175
- },
176
- };
177
-
178
- // -------- Set property mapper
179
- const MAPPER = () => undefined;
180
- const createParser = (params) => {
181
- var _a;
182
- const defaultMapper = (params === null || params === void 0 ? void 0 : params.defaultMapper) || MAPPER;
183
- const mapper = {
184
- defaultMapper,
185
- mapBoxProps: (params === null || params === void 0 ? void 0 : params.mapBoxProps) || defaultMapper,
186
- mapTextProps: (params === null || params === void 0 ? void 0 : params.mapTextProps) || defaultMapper,
187
- mapImageProps: (params === null || params === void 0 ? void 0 : params.mapImageProps) || defaultMapper,
188
- mapTextButtonProps: (params === null || params === void 0 ? void 0 : params.mapTextButtonProps) || defaultMapper,
189
- mapImageButtonProps: (params === null || params === void 0 ? void 0 : params.mapImageButtonProps) || defaultMapper,
190
- mapCarouselProps: (params === null || params === void 0 ? void 0 : params.mapCarouselProps) || defaultMapper,
191
- mapCascadeProps: (params === null || params === void 0 ? void 0 : params.mapCascadeProps) || defaultMapper,
192
- };
193
- const transforms = [colorTransform, numberTransform, ...((_a = params === null || params === void 0 ? void 0 : params.transforms) !== null && _a !== void 0 ? _a : [])];
194
- return {
195
- setTransforms(newTransforms) {
196
- transforms.length = 0;
197
- transforms.push(...newTransforms);
198
- },
199
- addTransforms(newTransforms) {
200
- transforms.push(...newTransforms);
201
- },
202
- parse(rawItem, options) {
203
- const item = transforms.reduce((it, transform) => transform.run(it), rawItem);
204
- switch (item.type) {
205
- case ComponentType.Box: {
206
- return { transformed: item, properties: mapper.mapBoxProps(item, options) };
207
- }
208
- case ComponentType.Text: {
209
- return { transformed: item, properties: mapper.mapTextProps(item, options) };
210
- }
211
- case ComponentType.Image: {
212
- return { transformed: item, properties: mapper.mapImageProps(item, options) };
213
- }
214
- case ComponentType.TextButton: {
215
- return { transformed: item, properties: mapper.mapTextButtonProps(item, options) };
216
- }
217
- case ComponentType.ImageButton: {
218
- return { transformed: item, properties: mapper.mapImageButtonProps(item, options) };
219
- }
220
- case ComponentType.Carousel: {
221
- return { transformed: item, properties: mapper.mapCarouselProps(item, options) };
222
- }
223
- case ComponentType.Cascade: {
224
- return { transformed: item, properties: mapper.mapCascadeProps(item, options) };
225
- }
226
- default:
227
- return { transformed: item, properties: undefined };
228
- }
229
- },
230
- };
231
- };
232
-
233
- const FRAGMENT = ({ children }) => React__default.default.createElement(React__default.default.Fragment, null, children);
234
- function createRenderer(params) {
235
- var _a, _b, _c, _d, _e, _f, _g;
236
- return {
237
- box: ((_a = params === null || params === void 0 ? void 0 : params.views) === null || _a === void 0 ? void 0 : _a.box) || FRAGMENT,
238
- text: ((_b = params === null || params === void 0 ? void 0 : params.views) === null || _b === void 0 ? void 0 : _b.text) || FRAGMENT,
239
- image: ((_c = params === null || params === void 0 ? void 0 : params.views) === null || _c === void 0 ? void 0 : _c.image) || FRAGMENT,
240
- imageButton: ((_d = params === null || params === void 0 ? void 0 : params.views) === null || _d === void 0 ? void 0 : _d.imageButton) || FRAGMENT,
241
- textButton: ((_e = params === null || params === void 0 ? void 0 : params.views) === null || _e === void 0 ? void 0 : _e.textButton) || FRAGMENT,
242
- carouselView: ((_f = params === null || params === void 0 ? void 0 : params.views) === null || _f === void 0 ? void 0 : _f.carouselView) || FRAGMENT,
243
- cascadeView: ((_g = params === null || params === void 0 ? void 0 : params.views) === null || _g === void 0 ? void 0 : _g.cascadeView) || FRAGMENT,
244
- };
245
- }
246
-
247
- var __rest$5 = (undefined && undefined.__rest) || function (s, e) {
248
- var t = {};
249
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
250
- t[p] = s[p];
251
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
252
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
253
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
254
- t[p[i]] = s[p[i]];
255
- }
256
- return t;
257
- };
258
- const SizeContext = React.createContext({
259
- sizes: {},
260
- updateSize: () => { },
261
- });
262
- const SizeContextProvider = ({ children }) => {
263
- const [sizes, setSizes] = React.useState({});
264
- const updateSize = React.useCallback((_a) => {
265
- var { id } = _a, rest = __rest$5(_a, ["id"]);
266
- if (id) {
267
- setSizes((prevSizes) => (Object.assign(Object.assign({}, prevSizes), { [id]: rest })));
268
- }
269
- }, []);
270
- return React__default.default.createElement(SizeContext.Provider, { value: { sizes, updateSize } }, children);
271
- };
272
- const useSizeContext = () => React.useContext(SizeContext);
273
-
274
- var Layout;
275
- (function (Layout) {
276
- Layout["Row"] = "row";
277
- Layout["Column"] = "column";
278
- })(Layout || (Layout = {}));
279
- var AlignValue;
280
- (function (AlignValue) {
281
- AlignValue["Center"] = "center";
282
- AlignValue["Left"] = "left";
283
- AlignValue["Right"] = "right";
284
- AlignValue["Top"] = "top";
285
- AlignValue["Bottom"] = "bottom";
286
- })(AlignValue || (AlignValue = {}));
287
- /**
288
- * @description
289
- * Caution: Numbers are passed as string types in the message template builder.
290
- * Use `==` comparison instead of `===` comparison when using a regular enum instead of a string enum.
291
- */
292
- var FlexSizeSpecValue;
293
- (function (FlexSizeSpecValue) {
294
- FlexSizeSpecValue[FlexSizeSpecValue["FillParent"] = 0] = "FillParent";
295
- FlexSizeSpecValue[FlexSizeSpecValue["WrapContent"] = 1] = "WrapContent";
296
- })(FlexSizeSpecValue || (FlexSizeSpecValue = {}));
297
- var FontWeight;
298
- (function (FontWeight) {
299
- FontWeight["Normal"] = "normal";
300
- FontWeight["Bold"] = "bold";
301
- })(FontWeight || (FontWeight = {}));
302
- var MediaContentMode;
303
- (function (MediaContentMode) {
304
- MediaContentMode["AspectFit"] = "aspectFit";
305
- MediaContentMode["AspectFill"] = "aspectFill";
306
- MediaContentMode["ScalesToFill"] = "scalesToFill";
307
- })(MediaContentMode || (MediaContentMode = {}));
308
-
309
- const SUPPORTED_TEMPLATE_VERSIONS = [
310
- 1,
311
- 2, // Composite templates: Carousel
312
- ];
313
- const alignInFlex = (align) => {
314
- switch (align) {
315
- case AlignValue.Right:
316
- case AlignValue.Bottom:
317
- return 'flex-end';
318
- case AlignValue.Center:
319
- return 'center';
320
- case AlignValue.Left:
321
- case AlignValue.Top:
322
- default:
323
- return 'flex-start';
324
- }
325
- };
326
- const isTemplateVersionSupported = (templateVersion) => {
327
- if (!templateVersion)
328
- return true;
329
- return SUPPORTED_TEMPLATE_VERSIONS.includes(Number(templateVersion));
330
- };
331
-
332
- const memoize = (fn) => {
333
- const cache = new Map();
334
- const cached = function (val) {
335
- return cache.has(val) ? cache.get(val) : cache.set(val, fn.call(this, val)) && cache.get(val);
336
- };
337
- cached.cache = cache;
338
- return cached;
339
- };
340
- /**
341
- * Generate each item's id by each item's array depth
342
- */
343
- const setTemplateItemId = memoize((data) => {
344
- const addIdRecursively = (item, id) => {
345
- if ('items' in item && (item === null || item === void 0 ? void 0 : item.items) != null) {
346
- item.items.forEach((subItem, subIdx) => {
347
- const subId = `${id}-${subIdx}`;
348
- subItem.id = subId;
349
- addIdRecursively(subItem, subId);
350
- });
351
- }
352
- };
353
- data.forEach((item, idx) => {
354
- const id = `${idx}`;
355
- item.id = id;
356
- addIdRecursively(item, id);
357
- });
358
- return data;
359
- });
360
-
361
- const defaultProperties = {
362
- rootLayout: Layout.Column,
363
- view: {
364
- size: {
365
- width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
366
- height: { type: 'flex', value: FlexSizeSpecValue.WrapContent },
367
- },
368
- },
369
- box: {
370
- layout: Layout.Row,
371
- align: { vertical: AlignValue.Top, horizontal: AlignValue.Left },
372
- },
373
- textButton: {
374
- maxTextLines: 1,
375
- },
376
- carousel: {
377
- style: {
378
- spacing: 10,
379
- maxChildWidth: 240,
380
- },
381
- },
382
- cascade: {
383
- layout: Layout.Column,
384
- style: {
385
- spacing: 10,
386
- },
387
- },
388
- };
389
-
390
- const createMessageTemplate = (opts) => {
391
- const Container = opts.Container || React__default.default.Fragment;
392
- const UnknownMessage = opts.UnknownMessage || (() => null);
393
- const parser = opts.parser || createParser();
394
- const renderer = opts.renderer || createRenderer();
395
- const MessageTemplateBase = ({ templateItems, templateVersion, parentLayout = defaultProperties.box.layout, depth = 0, }) => {
396
- if (!isTemplateVersionSupported(templateVersion)) {
397
- throw new Error(`Cannot parse template item due to unsupported template version: ${templateVersion}, ${SUPPORTED_TEMPLATE_VERSIONS}`);
398
- }
399
- return (React__default.default.createElement(React__default.default.Fragment, null, templateItems.map((rawProperties, index, siblings) => {
400
- const result = parser.parse(rawProperties, { parentLayout, depth, elemIdx: index, siblings });
401
- const item = result.transformed;
402
- const rendererProps = {
403
- key: index,
404
- siblings,
405
- parentLayout,
406
- parsedProperties: result.properties,
407
- rawProperties,
408
- };
409
- switch (item.type) {
410
- case ComponentType.Carousel: {
411
- if (!Array.isArray(item.items)) {
412
- throw new Error('Cannot parse template item as Carousel if carousel has no items.');
413
- }
414
- return (React__default.default.createElement(renderer.carouselView, Object.assign({}, item, rendererProps), item.items.map((template, index) => (React__default.default.createElement(MessageTemplateBase, { key: index, templateItems: template.body.items || [], depth: depth + 1, templateVersion: template.version })))));
415
- }
416
- case ComponentType.Cascade: {
417
- if (!Array.isArray(item.items)) {
418
- throw new Error('Cannot parse template item as Cascade if cascade has no items.');
419
- }
420
- return (React__default.default.createElement(renderer.cascadeView, Object.assign({}, item, rendererProps), item.items.map((template, index) => (React__default.default.createElement(MessageTemplateBase, { key: index, templateItems: template.body.items || [], depth: depth + 1, templateVersion: template.version })))));
421
- }
422
- case ComponentType.Box: {
423
- return (React__default.default.createElement(renderer.box, Object.assign({}, item, rendererProps),
424
- React__default.default.createElement(MessageTemplateBase, { templateItems: item.items || [], parentLayout: item.layout, depth: depth + 1, templateVersion: templateVersion })));
425
- }
426
- case ComponentType.Text: {
427
- return React__default.default.createElement(renderer.text, Object.assign({}, item, rendererProps));
428
- }
429
- case ComponentType.Image: {
430
- return React__default.default.createElement(renderer.image, Object.assign({}, item, rendererProps));
431
- }
432
- case ComponentType.TextButton: {
433
- return React__default.default.createElement(renderer.textButton, Object.assign({}, item, rendererProps));
434
- }
435
- case ComponentType.ImageButton: {
436
- return React__default.default.createElement(renderer.imageButton, Object.assign({}, item, rendererProps));
437
- }
438
- default: {
439
- // or throw new Error('Cannot parse template item')
440
- return React__default.default.createElement(UnknownMessage, { item: item });
441
- }
442
- }
443
- })));
444
- };
445
- return {
446
- MessageTemplate: ({ templateVersion, templateItems, parentLayout = defaultProperties.rootLayout, }) => {
447
- const items = setTemplateItemId(templateItems);
448
- return (React__default.default.createElement(SizeContextProvider, null,
449
- React__default.default.createElement(Container, { className: 'sb-message-template__parent' },
450
- React__default.default.createElement(MessageTemplateBase, { isRoot: true, parentLayout: parentLayout, templateItems: items, templateVersion: templateVersion }))));
451
- },
452
- MessageTemplateBase,
453
- };
454
- };
455
-
456
- var ActionType;
457
- (function (ActionType) {
458
- ActionType["Web"] = "web";
459
- ActionType["Custom"] = "custom";
460
- ActionType["UIKit"] = "uikit";
461
- ActionType["Internal"] = "internal";
462
- })(ActionType || (ActionType = {}));
463
-
464
- ({
465
- version: 1,
466
- body: {
467
- items: [
468
- {
469
- type: ComponentType.Image,
470
- action: { type: ActionType.Web, data: 'https://docs.sendbird.com' },
471
- height: { type: 'fixed', value: 236 },
472
- viewStyle: {
473
- padding: {
474
- left: 4,
475
- right: 4,
476
- top: 4,
477
- bottom: 4,
478
- },
479
- },
480
- imageUrl: 'https://cdn.pixabay.com/photo/2022/10/12/10/45/bird-7516219_1280.jpg',
481
- imageStyle: { contentMode: MediaContentMode.AspectFill },
482
- },
483
- {
484
- type: ComponentType.Box,
485
- layout: Layout.Column,
486
- width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
487
- height: { type: 'fixed', value: 200 },
488
- items: [
489
- {
490
- type: ComponentType.Box,
491
- width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
492
- height: { type: 'flex', value: FlexSizeSpecValue.FillParent },
493
- viewStyle: { backgroundColor: '#fa6464' },
494
- },
495
- {
496
- type: ComponentType.Box,
497
- layout: Layout.Column,
498
- width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
499
- height: { type: 'flex', value: FlexSizeSpecValue.WrapContent },
500
- viewStyle: { backgroundColor: '#ffaf5c' },
501
- items: [
502
- {
503
- type: ComponentType.Text,
504
- text: 'Message',
505
- align: { horizontal: AlignValue.Center, vertical: AlignValue.Center },
506
- width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
507
- height: { type: 'fixed', value: 50 },
508
- },
509
- {
510
- type: ComponentType.Image,
511
- action: { type: ActionType.Web, data: 'https://docs.sendbird.com' },
512
- width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
513
- height: { type: 'fixed', value: 50 },
514
- imageUrl: 'https://cdn.pixabay.com/photo/2022/10/12/10/45/bird-7516219_1280.jpg',
515
- imageStyle: { contentMode: MediaContentMode.AspectFill },
516
- },
517
- ],
518
- },
519
- {
520
- type: ComponentType.Box,
521
- width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
522
- height: { type: 'fixed', value: 20 },
523
- viewStyle: { backgroundColor: '#ffe450' },
524
- },
525
- {
526
- type: ComponentType.Box,
527
- width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
528
- height: { type: 'flex', value: FlexSizeSpecValue.FillParent },
529
- viewStyle: { backgroundColor: '#329a1b' },
530
- },
531
- ],
532
- },
533
- {
534
- type: ComponentType.Box,
535
- viewStyle: { padding: { top: 12, bottom: 12, left: 12, right: 12 } },
536
- layout: Layout.Column,
537
- items: [
538
- {
539
- type: ComponentType.Box,
540
- align: { horizontal: AlignValue.Left, vertical: AlignValue.Center },
541
- layout: Layout.Row,
542
- viewStyle: {
543
- borderWidth: 1,
544
- borderColor: '#72723f',
545
- },
546
- width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
547
- height: { type: 'fixed', value: 150 },
548
- items: [
549
- {
550
- type: ComponentType.Text,
551
- width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
552
- height: { type: 'fixed', value: 50 },
553
- text: 'Sample1 text',
554
- maxTextLines: 1,
555
- align: { vertical: AlignValue.Center, horizontal: AlignValue.Left },
556
- viewStyle: {
557
- backgroundColor: '#cc4400',
558
- },
559
- textStyle: {
560
- size: 16,
561
- color: '#f8f8f8',
562
- weight: FontWeight.Bold,
563
- },
564
- },
565
- {
566
- type: ComponentType.ImageButton,
567
- action: { type: ActionType.UIKit, data: 'uikit://delete' },
568
- width: { type: 'fixed', value: 20 },
569
- height: { type: 'fixed', value: 20 },
570
- imageUrl: 'https://file-ap-1.sendbird.com/5b5379aa73fd460da22ffaf9a61d0d7f.png',
571
- imageStyle: { contentMode: MediaContentMode.AspectFit },
572
- },
573
- ],
574
- },
575
- {
576
- type: ComponentType.Text,
577
- viewStyle: { padding: { top: 6, bottom: 12, left: 0, right: 0 } },
578
- 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.',
579
- maxTextLines: 2,
580
- textStyle: { size: 14, color: '#e10000' },
581
- width: { type: 'fixed', value: 200 },
582
- height: { type: 'fixed', value: 50 },
583
- },
584
- {
585
- type: ComponentType.TextButton,
586
- action: { type: ActionType.Web, data: 'https://www.daum.net' },
587
- text: 'Button 3',
588
- textStyle: { size: 14, color: '#742ddd', weight: FontWeight.Bold },
589
- },
590
- ],
591
- },
592
- ],
593
- },
594
- });
595
- ({
596
- 'version': 1,
597
- 'body': {
598
- 'items': [
599
- {
600
- 'type': ComponentType.Image,
601
- 'action': { 'type': ActionType.Web, 'data': 'https://www.naver.com/' },
602
- 'height': { 'type': 'fixed', 'value': 136 },
603
- 'imageUrl': 'https://cdn.pixabay.com/photo/2022/10/12/10/45/bird-7516219_1280.jpg',
604
- 'imageStyle': { 'contentMode': MediaContentMode.AspectFill },
605
- },
606
- {
607
- 'type': ComponentType.Box,
608
- 'viewStyle': { 'padding': { 'top': 12, 'bottom': 12, 'left': 12, 'right': 12 }, backgroundColor: '#cccccc' },
609
- 'layout': Layout.Column,
610
- width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
611
- 'items': [
612
- {
613
- 'type': ComponentType.Box,
614
- width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
615
- 'layout': Layout.Row,
616
- 'items': [
617
- {
618
- 'type': ComponentType.TextButton,
619
- 'action': { 'type': ActionType.Web, 'data': 'https://www.daum.net' },
620
- width: { type: 'fixed', value: 150 },
621
- 'viewStyle': { 'margin': { 'top': 0, 'bottom': 0, 'left': 0, 'right': 4 } },
622
- 'text': 'Button 2',
623
- 'textStyle': { 'size': 14, 'weight': FontWeight.Bold },
624
- },
625
- {
626
- 'type': ComponentType.TextButton,
627
- 'action': { 'type': ActionType.Web, 'data': 'https://www.daum.net' },
628
- width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
629
- 'viewStyle': { 'margin': { 'top': 0, 'bottom': 0, 'left': 4, 'right': 0 } },
630
- 'text': 'Button 3',
631
- 'textStyle': { 'size': 14, 'weight': FontWeight.Bold },
632
- },
633
- ],
634
- },
635
- {
636
- 'type': ComponentType.Box,
637
- width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
638
- 'layout': Layout.Row,
639
- 'items': [
640
- {
641
- 'type': ComponentType.Text,
642
- 'text': 'Sample2 text',
643
- 'width': { 'type': 'flex', 'value': FlexSizeSpecValue.FillParent },
644
- 'maxTextLines': 1,
645
- 'textStyle': { 'size': 16, 'weight': FontWeight.Bold },
646
- },
647
- {
648
- 'type': ComponentType.ImageButton,
649
- 'action': { 'type': ActionType.UIKit, 'data': 'uikit://delete' },
650
- 'width': { 'type': 'fixed', 'value': 20 },
651
- 'height': { 'type': 'fixed', 'value': 20 },
652
- 'imageUrl': 'https://file-ap-1.sendbird.com/5b5379aa73fd460da22ffaf9a61d0d7f.png',
653
- 'imageStyle': { 'contentMode': MediaContentMode.AspectFit },
654
- },
655
- ],
656
- },
657
- {
658
- 'type': ComponentType.Text,
659
- 'viewStyle': { 'padding': { 'top': 6, 'bottom': 12, 'left': 0, 'right': 0 } },
660
- 'text': 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aui',
661
- 'textStyle': { 'size': 14 },
662
- },
663
- ],
664
- },
665
- ],
666
- },
667
- });
668
- ({
669
- 'version': 1,
670
- 'body': {
671
- 'items': [
672
- {
673
- 'type': ComponentType.Box,
674
- 'viewStyle': { 'backgroundColor': '#ffffff', 'borderWidth': 1, 'borderColor': '#eeeeee', 'radius': 16 },
675
- 'layout': Layout.Column,
676
- 'items': [
677
- {
678
- 'type': ComponentType.Image,
679
- 'height': { 'type': 'fixed', 'value': 200 },
680
- 'imageUrl': 'https://img.freepik.com/free-vector/cartoon-happy-hours-background_52683-81243.jpg?w=2000&t=st=1666689198~exp=1666689798~hmac=23109d44ba03deee7aee069cbeebfcb48fa27f85e53c1cafc5d5d7345f1a2041',
681
- 'imageStyle': { 'contentMode': MediaContentMode.AspectFill },
682
- },
683
- {
684
- 'type': ComponentType.Box,
685
- 'viewStyle': { 'padding': { 'top': 15, 'bottom': 15, 'left': 15, 'right': 15 } },
686
- 'layout': Layout.Column,
687
- 'items': [
688
- {
689
- 'type': ComponentType.Text,
690
- 'text': "Don't miss these deals today",
691
- 'maxTextLines': 1,
692
- 'textStyle': { 'size': 20, 'color': '#e10000', 'weight': FontWeight.Bold },
693
- },
694
- {
695
- 'type': ComponentType.Text,
696
- 'viewStyle': { 'margin': { 'top': 5, 'bottom': 0, 'left': 0, 'right': 0 } },
697
- 'text': 'Pay with Maya and get cashback!',
698
- 'maxTextLines': 1,
699
- 'textStyle': { 'size': 14, 'color': '#e10000' },
700
- },
701
- {
702
- 'type': ComponentType.Box,
703
- 'align': { 'horizontal': AlignValue.Left, 'vertical': AlignValue.Center },
704
- 'viewStyle': { 'margin': { 'top': 10, 'bottom': 0, 'left': 0, 'right': 0 } },
705
- 'layout': Layout.Row,
706
- 'items': [
707
- {
708
- 'type': ComponentType.Image,
709
- 'width': { 'type': 'fixed', 'value': 50 },
710
- 'height': { 'type': 'fixed', 'value': 50 },
711
- 'viewStyle': {
712
- 'backgroundColor': '#ffffff',
713
- 'borderWidth': 1,
714
- 'borderColor': '#eeeeee',
715
- 'radius': 25,
716
- },
717
- 'imageUrl': 'https://yt3.ggpht.com/ytc/AMLnZu8Kg89ymE7qt5bsS9vMqi9h2aHiN6m9ID-IgxR6-Q=s900-c-k-c0x00ffffff-no-rj',
718
- 'imageStyle': { 'contentMode': MediaContentMode.AspectFill },
719
- },
720
- {
721
- 'type': ComponentType.Box,
722
- 'align': { 'horizontal': AlignValue.Left, 'vertical': AlignValue.Center },
723
- 'viewStyle': { 'margin': { 'top': 0, 'bottom': 0, 'left': 15, 'right': 0 } },
724
- 'layout': Layout.Column,
725
- 'items': [
726
- {
727
- 'type': ComponentType.Text,
728
- 'text': 'Meralco',
729
- 'maxTextLines': 1,
730
- 'textStyle': { 'size': 16, 'color': '#e10000', 'weight': FontWeight.Bold },
731
- },
732
- {
733
- 'type': ComponentType.Text,
734
- 'viewStyle': { 'margin': { 'top': 3, 'bottom': 0, 'left': 0, 'right': 0 } },
735
- 'text': '30% cashback, P300 min spend',
736
- 'maxTextLines': 1,
737
- 'textStyle': { 'size': 12, 'color': '#610000', 'weight': FontWeight.Bold },
738
- },
739
- ],
740
- },
741
- ],
742
- },
743
- {
744
- 'type': ComponentType.Box,
745
- 'align': { 'horizontal': AlignValue.Left, 'vertical': AlignValue.Center },
746
- 'viewStyle': { 'margin': { 'top': 10, 'bottom': 0, 'left': 0, 'right': 0 } },
747
- 'layout': Layout.Row,
748
- 'items': [
749
- {
750
- 'type': ComponentType.Image,
751
- 'width': { 'type': 'fixed', 'value': 50 },
752
- 'height': { 'type': 'fixed', 'value': 50 },
753
- 'viewStyle': {
754
- 'backgroundColor': '#ffffff',
755
- 'borderWidth': 1,
756
- 'borderColor': '#eeeeee',
757
- 'radius': 25,
758
- },
759
- 'imageUrl': 'https://1000logos.net/wp-content/uploads/2021/12/Globe-Telecom-logo.png',
760
- 'imageStyle': { 'contentMode': MediaContentMode.AspectFill, tintColor: '#a49a9a' },
761
- },
762
- {
763
- 'type': ComponentType.Box,
764
- 'align': { 'horizontal': AlignValue.Left, 'vertical': AlignValue.Center },
765
- 'viewStyle': { 'margin': { 'top': 0, 'bottom': 0, 'left': 15, 'right': 0 } },
766
- 'layout': Layout.Column,
767
- 'items': [
768
- {
769
- 'type': ComponentType.Text,
770
- 'text': 'Globe',
771
- 'maxTextLines': 1,
772
- 'textStyle': { 'size': 16, 'color': '#e10000', 'weight': FontWeight.Bold },
773
- },
774
- {
775
- 'type': ComponentType.Text,
776
- 'viewStyle': { 'margin': { 'top': 3, 'bottom': 0, 'left': 0, 'right': 0 } },
777
- 'text': '30% cashback, P300 min spend',
778
- 'maxTextLines': 1,
779
- 'textStyle': { 'size': 12, 'color': '#610000', 'weight': FontWeight.Bold },
780
- },
781
- ],
782
- },
783
- ],
784
- },
785
- {
786
- 'type': ComponentType.Box,
787
- 'align': { 'horizontal': AlignValue.Left, 'vertical': AlignValue.Center },
788
- 'viewStyle': { 'margin': { 'top': 10, 'bottom': 0, 'left': 0, 'right': 0 } },
789
- 'layout': Layout.Row,
790
- 'items': [
791
- {
792
- 'type': ComponentType.Image,
793
- 'width': { 'type': 'fixed', 'value': 50 },
794
- 'height': { 'type': 'fixed', 'value': 50 },
795
- 'viewStyle': {
796
- 'backgroundColor': '#ffffff',
797
- 'borderWidth': 1,
798
- 'borderColor': '#eeeeee',
799
- 'radius': 25,
800
- },
801
- 'imageUrl': 'https://upload.wikimedia.org/wikipedia/commons/thumb/4/41/Cignal.svg/640px-Cignal.svg.png',
802
- 'imageStyle': { 'contentMode': MediaContentMode.AspectFill },
803
- },
804
- {
805
- 'type': ComponentType.Box,
806
- 'align': { 'horizontal': AlignValue.Left, 'vertical': AlignValue.Center },
807
- 'viewStyle': { 'margin': { 'top': 0, 'bottom': 0, 'left': 15, 'right': 0 } },
808
- 'layout': Layout.Column,
809
- 'items': [
810
- {
811
- 'type': ComponentType.Text,
812
- 'text': 'Cignal',
813
- 'maxTextLines': 1,
814
- 'textStyle': { 'size': 16, 'color': '#e10000', 'weight': FontWeight.Bold },
815
- },
816
- {
817
- 'type': ComponentType.Text,
818
- 'viewStyle': { 'margin': { 'top': 3, 'bottom': 0, 'left': 0, 'right': 0 } },
819
- 'text': '30% cashback, P300 min spend',
820
- 'maxTextLines': 1,
821
- 'textStyle': { 'size': 12, 'color': '#610000', 'weight': FontWeight.Bold },
822
- },
823
- ],
824
- },
825
- ],
826
- },
827
- {
828
- 'type': ComponentType.Box,
829
- 'align': { 'horizontal': AlignValue.Left, 'vertical': AlignValue.Center },
830
- 'viewStyle': { 'margin': { 'top': 10, 'bottom': 0, 'left': 0, 'right': 0 } },
831
- 'layout': Layout.Row,
832
- 'items': [
833
- {
834
- 'type': ComponentType.TextButton,
835
- 'action': { 'type': ActionType.Web, 'data': 'https://www.daum.net' },
836
- 'viewStyle': {
837
- 'backgroundColor': '#e0e0e0',
838
- 'radius': 16,
839
- 'margin': { 'top': 0, 'bottom': 0, 'left': 0, 'right': 4 },
840
- 'padding': { 'top': 12, 'bottom': 12, 'left': 12, 'right': 12 },
841
- },
842
- 'text': 'Learn more',
843
- 'textStyle': { 'size': 15, 'color': '#e10000', 'weight': FontWeight.Bold },
844
- },
845
- {
846
- 'type': ComponentType.TextButton,
847
- 'action': { 'type': ActionType.Web, 'data': 'https://www.daum.net' },
848
- 'viewStyle': {
849
- 'backgroundColor': '#e10000',
850
- 'radius': 16,
851
- 'margin': { 'top': 0, 'bottom': 0, 'left': 4, 'right': 0 },
852
- 'padding': { 'top': 12, 'bottom': 12, 'left': 12, 'right': 12 },
853
- },
854
- 'text': 'Pay now',
855
- 'textStyle': { 'size': 15, 'color': '#ffffff', 'weight': FontWeight.Bold },
856
- },
857
- ],
858
- },
859
- ],
860
- },
861
- ],
862
- },
863
- ],
864
- },
865
- });
866
- ({
867
- 'version': 1,
868
- 'body': {
869
- 'items': [
870
- {
871
- 'type': ComponentType.Box,
872
- 'layout': Layout.Column,
873
- 'items': [
874
- {
875
- 'type': ComponentType.Image,
876
- 'imageUrl': 'https://static.sendbird.com/sample/profiles/profile_40_512px.png',
877
- 'metaData': {
878
- 'pixelWidth': 512,
879
- 'pixelHeight': 512,
880
- },
881
- 'imageStyle': {
882
- 'tintColor': '#44ff1188',
883
- },
884
- viewStyle: {
885
- 'padding': {
886
- 'top': 12,
887
- 'right': 12,
888
- 'bottom': 12,
889
- 'left': 12,
890
- },
891
- },
892
- },
893
- {
894
- 'type': ComponentType.Box,
895
- 'viewStyle': {
896
- 'padding': {
897
- 'top': 12,
898
- 'right': 12,
899
- 'bottom': 12,
900
- 'left': 12,
901
- },
902
- },
903
- 'layout': Layout.Column,
904
- 'items': [
905
- {
906
- 'type': ComponentType.Box,
907
- 'layout': Layout.Row,
908
- 'items': [
909
- {
910
- 'type': ComponentType.Box,
911
- 'layout': Layout.Column,
912
- 'items': [
913
- {
914
- 'type': ComponentType.Text,
915
- 'text': 'hi',
916
- 'maxTextLines': 3,
917
- 'viewStyle': {
918
- 'padding': {
919
- 'top': 0,
920
- 'bottom': 6,
921
- 'left': 0,
922
- 'right': 0,
923
- },
924
- },
925
- 'textStyle': {
926
- 'size': 16,
927
- 'weight': FontWeight.Bold,
928
- },
929
- },
930
- {
931
- 'type': ComponentType.Text,
932
- 'text': 'bye',
933
- 'maxTextLines': 10,
934
- 'textStyle': {
935
- 'size': 14,
936
- },
937
- },
938
- ],
939
- },
940
- {
941
- 'type': ComponentType.ImageButton,
942
- 'action': {
943
- 'type': ActionType.UIKit,
944
- 'data': 'sendbirduikit://delete',
945
- },
946
- 'width': {
947
- 'type': 'fixed',
948
- 'value': 20,
949
- },
950
- 'height': {
951
- 'type': 'fixed',
952
- 'value': 20,
953
- },
954
- 'metaData': {
955
- 'pixelWidth': 60,
956
- 'pixelHeight': 60,
957
- },
958
- 'imageUrl': 'https://dxstmhyqfqr1o.cloudfront.net/sendbird-message-builder/icon-more.png',
959
- 'imageStyle': {
960
- 'tintColor': '#ff8d5a',
961
- },
962
- },
963
- ],
964
- },
965
- {
966
- 'type': ComponentType.Box,
967
- 'layout': Layout.Column,
968
- 'items': [
969
- {
970
- 'type': ComponentType.Box,
971
- 'viewStyle': {
972
- 'margin': {
973
- 'top': 16,
974
- 'bottom': 0,
975
- 'left': 0,
976
- 'right': 0,
977
- },
978
- },
979
- 'align': {
980
- 'horizontal': AlignValue.Left,
981
- 'vertical': AlignValue.Center,
982
- },
983
- 'layout': Layout.Row,
984
- 'items': [
985
- {
986
- 'type': ComponentType.Image,
987
- 'imageUrl': 'https://ca.slack-edge.com/T0ADCTNEL-ULE240VNV-83fd5776e78e-512',
988
- 'width': {
989
- 'type': 'fixed',
990
- 'value': 40,
991
- },
992
- 'height': {
993
- 'type': 'fixed',
994
- 'value': 40,
995
- },
996
- 'metaData': {
997
- 'pixelWidth': 512,
998
- 'pixelHeight': 512,
999
- },
1000
- 'viewStyle': {
1001
- 'backgroundColor': '#BDBDBD',
1002
- 'radius': 20,
1003
- },
1004
- 'imageStyle': {
1005
- 'contentMode': MediaContentMode.AspectFill,
1006
- },
1007
- },
1008
- {
1009
- 'type': ComponentType.Box,
1010
- 'viewStyle': {
1011
- 'margin': {
1012
- 'top': 0,
1013
- 'bottom': 0,
1014
- 'left': 12,
1015
- 'right': 0,
1016
- },
1017
- },
1018
- 'layout': Layout.Column,
1019
- 'items': [
1020
- {
1021
- 'type': ComponentType.Text,
1022
- 'text': 'Chongbu',
1023
- 'maxTextLines': 1,
1024
- 'textStyle': {
1025
- 'size': 16,
1026
- 'weight': FontWeight.Bold,
1027
- },
1028
- },
1029
- {
1030
- 'type': ComponentType.Text,
1031
- 'viewStyle': {
1032
- 'margin': {
1033
- 'top': 4,
1034
- 'bottom': 0,
1035
- 'left': 0,
1036
- 'right': 0,
1037
- },
1038
- },
1039
- 'text': ' ',
1040
- 'maxTextLines': 1,
1041
- 'textStyle': {
1042
- 'size': 14,
1043
- },
1044
- },
1045
- ],
1046
- },
1047
- ],
1048
- },
1049
- {
1050
- 'type': ComponentType.Box,
1051
- 'viewStyle': {
1052
- 'margin': {
1053
- 'top': 16,
1054
- 'bottom': 0,
1055
- 'left': 0,
1056
- 'right': 0,
1057
- },
1058
- },
1059
- 'align': {
1060
- 'horizontal': AlignValue.Left,
1061
- 'vertical': AlignValue.Center,
1062
- },
1063
- 'layout': Layout.Row,
1064
- 'items': [
1065
- {
1066
- 'type': ComponentType.Image,
1067
- 'imageUrl': 'https://ca.slack-edge.com/T0ADCTNEL-U02LA25KY8J-d41a3e8c7554-512',
1068
- 'width': {
1069
- 'type': 'fixed',
1070
- 'value': 40,
1071
- },
1072
- 'height': {
1073
- 'type': 'fixed',
1074
- 'value': 40,
1075
- },
1076
- 'metaData': {
1077
- 'pixelWidth': 512,
1078
- 'pixelHeight': 512,
1079
- },
1080
- 'viewStyle': {
1081
- 'backgroundColor': '#BDBDBD',
1082
- 'radius': 20,
1083
- },
1084
- 'imageStyle': {
1085
- 'contentMode': MediaContentMode.AspectFill,
1086
- },
1087
- },
1088
- {
1089
- 'type': ComponentType.Box,
1090
- 'viewStyle': {
1091
- 'margin': {
1092
- 'top': 0,
1093
- 'bottom': 0,
1094
- 'left': 12,
1095
- 'right': 0,
1096
- },
1097
- },
1098
- 'layout': Layout.Column,
1099
- 'items': [
1100
- {
1101
- 'type': ComponentType.Text,
1102
- 'text': 'Amanda',
1103
- 'maxTextLines': 1,
1104
- 'textStyle': {
1105
- 'size': 16,
1106
- 'weight': FontWeight.Bold,
1107
- },
1108
- },
1109
- {
1110
- 'type': ComponentType.Text,
1111
- 'viewStyle': {
1112
- 'margin': {
1113
- 'top': 4,
1114
- 'bottom': 0,
1115
- 'left': 0,
1116
- 'right': 0,
1117
- },
1118
- },
1119
- 'text': 'This is title message',
1120
- 'maxTextLines': 1,
1121
- 'textStyle': {
1122
- 'size': 14,
1123
- },
1124
- },
1125
- ],
1126
- },
1127
- ],
1128
- },
1129
- ],
1130
- },
1131
- ],
1132
- },
1133
- ],
1134
- },
1135
- ],
1136
- },
1137
- });
1138
- ({
1139
- 'version': '1',
1140
- 'body': {
1141
- 'items': [
1142
- {
1143
- 'type': 'box',
1144
- 'layout': 'column',
1145
- height: { type: 'fixed', value: 600 },
1146
- 'items': [
1147
- {
1148
- 'type': 'box',
1149
- 'layout': 'column',
1150
- 'viewStyle': { 'radius': '8', 'padding': { 'top': '12', 'bottom': '12', 'left': '12', 'right': '12' } },
1151
- 'items': [
1152
- {
1153
- 'type': 'text',
1154
- 'text': 'Title text',
1155
- 'textStyle': { 'color': '#E0000000', 'size': '16', 'weight': 'bold' },
1156
- 'maxTextLines': '5',
1157
- 'viewStyle': {},
1158
- 'action': { 'data': 'www.naver.com' },
1159
- },
1160
- {
1161
- 'type': 'text',
1162
- 'viewStyle': { 'margin': { 'top': '8', 'right': '0', 'bottom': '0', 'left': '0' } },
1163
- 'text': 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aui',
1164
- 'textStyle': { 'color': '#E0000000', 'size': '14', 'weight': 'normal' },
1165
- 'maxTextLines': '5',
1166
- 'action': { 'data': 'https://www.naver.com' },
1167
- },
1168
- {
1169
- 'type': 'box',
1170
- 'layout': 'row',
1171
- 'viewStyle': { 'margin': { 'top': '12', 'right': '0', 'bottom': '0', 'left': '0' } },
1172
- 'items': [
1173
- {
1174
- 'type': 'textButton',
1175
- 'viewStyle': {
1176
- 'backgroundColor': '#E0E0E0',
1177
- 'padding': { 'top': '10', 'bottom': '10', 'left': '20', 'right': '20' },
1178
- },
1179
- 'text': 'Button 1',
1180
- 'textStyle': { 'color': '#742DDD', 'size': '14', 'weight': 'bold' },
1181
- 'maxTextLines': '5',
1182
- 'action': { 'data': 'www.naver.com' },
1183
- },
1184
- {
1185
- 'type': 'textButton',
1186
- 'viewStyle': {
1187
- 'backgroundColor': '#E0E0E0',
1188
- 'padding': { 'top': '10', 'bottom': '10', 'left': '20', 'right': '20' },
1189
- 'margin': { 'left': '8', 'right': '0', 'top': '0', 'bottom': '0' },
1190
- },
1191
- 'text': 'Button 2',
1192
- 'textStyle': { 'color': '#742DDD', 'size': '14', 'weight': 'bold' },
1193
- 'maxTextLines': '5',
1194
- 'action': { 'data': 'https://www.naver.com' },
1195
- },
1196
- ],
1197
- },
1198
- ],
1199
- 'action': { 'data': 'https://www.naver.com' },
1200
- },
1201
- {
1202
- 'type': 'image',
1203
- 'viewStyle': {},
1204
- 'width': { 'type': 'flex', 'value': FlexSizeSpecValue.FillParent },
1205
- 'height': { 'type': 'flex', 'value': FlexSizeSpecValue.FillParent },
1206
- 'imageStyle': { 'contentMode': 'aspectFill' },
1207
- 'imageUrl': 'https://file-preprod.sendbird.com/d03c08bb3f9041a88c1207b6bbf15ab8.png',
1208
- 'metaData': { 'pixelWidth': '1062', 'pixelHeight': '1070' },
1209
- },
1210
- {
1211
- 'type': 'textButton',
1212
- 'viewStyle': {
1213
- 'backgroundColor': '#E0E0E0',
1214
- 'padding': { 'top': '10', 'bottom': '10', 'left': '20', 'right': '20' },
1215
- },
1216
- 'width': { 'type': 'flex', 'value': FlexSizeSpecValue.FillParent },
1217
- 'height': { 'type': 'flex', 'value': FlexSizeSpecValue.FillParent },
1218
- 'text': 'Button',
1219
- 'textStyle': { 'color': '#742DDD', 'size': '16', 'weight': 'normal' },
1220
- 'maxTextLines': '5',
1221
- 'action': { 'data': 'www.naver.com' },
1222
- },
1223
- {
1224
- 'type': 'imageButton',
1225
- 'viewStyle': {},
1226
- 'width': { 'type': 'flex', 'value': FlexSizeSpecValue.FillParent },
1227
- 'height': { 'type': 'flex', 'value': FlexSizeSpecValue.FillParent },
1228
- 'imageUrl': 'https://file-preprod.sendbird.com/38fdf5c1056f42b89a44b38155cc4b49.jpg',
1229
- 'imageStyle': { 'contentMode': 'aspectFill' },
1230
- 'metaData': { 'pixelWidth': '1080', 'pixelHeight': '2640' },
1231
- 'action': { 'data': 'www.naver.com' },
1232
- },
1233
- ],
1234
- 'viewStyle': {},
1235
- },
1236
- ],
1237
- },
1238
- });
1239
- ({
1240
- 'version': 1,
1241
- 'body': {
1242
- 'items': [
1243
- {
1244
- 'elementId': 'root',
1245
- 'type': 'box',
1246
- 'layout': 'column',
1247
- 'width': {
1248
- 'type': 'flex',
1249
- 'value': FlexSizeSpecValue.FillParent,
1250
- },
1251
- 'height': {
1252
- 'type': 'flex',
1253
- 'value': FlexSizeSpecValue.WrapContent,
1254
- },
1255
- 'items': [
1256
- {
1257
- 'type': 'text',
1258
- 'viewStyle': {
1259
- 'backgroundColor': '#a0c0ffff',
1260
- 'margin': {
1261
- 'top': 16,
1262
- 'bottom': 16,
1263
- 'left': 16,
1264
- 'right': 16,
1265
- },
1266
- 'padding': {
1267
- 'top': 16,
1268
- 'bottom': 16,
1269
- 'left': 16,
1270
- 'right': 16,
1271
- },
1272
- },
1273
- 'text': 'Wrap Wrap Wrap Wrap Wrap Wrap Wrap Wrap Wrap Wrap ',
1274
- 'textStyle': {
1275
- 'size': 14,
1276
- 'color': '#222121e0',
1277
- 'weight': 'normal',
1278
- },
1279
- 'maxTextLines': 5,
1280
- 'width': {
1281
- 'type': 'flex',
1282
- 'value': FlexSizeSpecValue.FillParent,
1283
- },
1284
- 'height': {
1285
- 'type': 'flex',
1286
- 'value': 1,
1287
- },
1288
- 'align': {
1289
- 'horizontal': 'left',
1290
- 'vertical': 'top',
1291
- },
1292
- 'elementId': 'c0e15878-4984-408d-abaa-4b495c2e3872',
1293
- },
1294
- {
1295
- 'type': 'imageButton',
1296
- 'viewStyle': {
1297
- margin: {
1298
- left: 24,
1299
- right: 12,
1300
- },
1301
- },
1302
- 'width': { 'type': 'flex', 'value': FlexSizeSpecValue.FillParent },
1303
- 'height': { 'type': 'fixed', 'value': 250 },
1304
- 'imageUrl': 'https://cdn.pixabay.com/photo/2022/10/12/10/45/bird-7516219_1280.jpg',
1305
- 'imageStyle': { 'contentMode': 'aspectFill' },
1306
- 'metaData': { 'pixelWidth': '1080', 'pixelHeight': '2640' },
1307
- 'action': { 'data': 'www.naver.com' },
1308
- },
1309
- ],
1310
- },
1311
- ],
1312
- },
1313
- });
1314
-
1315
- function isWrappedText(view) {
1316
- var _a;
1317
- return view.type === ComponentType.Text && ((_a = view.width) === null || _a === void 0 ? void 0 : _a.value) == FlexSizeSpecValue.WrapContent;
1318
- }
1319
- // Compares the size spec to the option and returns whether they are equal or not.
1320
- const isSizeCompatibleWithOption = ({ size, option, }) => {
1321
- if (option === 'wrap') {
1322
- return size.type === 'flex' && size.value == FlexSizeSpecValue.WrapContent;
1323
- }
1324
- if (option === 'fill') {
1325
- return size.type === 'flex' && size.value == FlexSizeSpecValue.FillParent;
1326
- }
1327
- return size.type === 'fixed';
1328
- };
1329
- const isGif = (url) => {
1330
- var _a;
1331
- if (typeof url !== 'string')
1332
- return false;
1333
- const extension = (_a = url.split('.').pop()) === null || _a === void 0 ? void 0 : _a.toLowerCase();
1334
- return extension === 'gif';
1335
- };
1336
- const clx = (...names) => {
1337
- return names.filter((it) => !!it).join(' ');
1338
- };
1339
- const hasValidURLProtocol = (url = '') => {
1340
- return ['http://', 'https://', 'ftp://'].some((protocol) => url.startsWith(protocol));
1341
- };
1342
- /**
1343
- * @param url - url to be checked
1344
- * @returns url with http:// protocol if it doesn't have any protocol
1345
- * @example
1346
- * returnUrl('www.sendbird.com') // returns 'http://www.sendbird.com'
1347
- * returnUrl('https://www.sendbird.com') // returns 'https://www.sendbird.com'
1348
- * returnUrl('ftp://www.sendbird.com') // returns 'ftp://www.sendbird.com'
1349
- * returnUrl('sendbird.com') // returns 'https://sendbird.com'
1350
- **/
1351
- const getValidURL = (url = '') => {
1352
- if (hasValidURLProtocol(url))
1353
- return url;
1354
- return `https://${url}`;
1355
- };
1356
-
1357
- function getDefaultStyles(overrides) {
1358
- return Object.assign({ display: 'flex', overflow: 'hidden', boxSizing: 'border-box' }, overrides);
1359
- }
1360
- function setViewProps(styles, props, options) {
1361
- setViewSize(styles, props, options);
1362
- setViewStyle(styles, props);
1363
- }
1364
- function setBorderStyle(styles, borderWidth, borderColor, radius) {
1365
- if (borderWidth) {
1366
- styles['--border-width'] = `${borderWidth}px`;
1367
- styles['--border-color'] = borderColor || 'transparent';
1368
- }
1369
- if (radius) {
1370
- styles['borderRadius'] = radius;
1371
- styles['--border-radius'] = `${radius}px`;
1372
- }
1373
- }
1374
- function setViewStyle(styles, props) {
1375
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
1376
- const { viewStyle } = props;
1377
- styles['paddingBlockStart'] = (_a = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.padding) === null || _a === void 0 ? void 0 : _a.top;
1378
- styles['paddingBlockEnd'] = (_b = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.padding) === null || _b === void 0 ? void 0 : _b.bottom;
1379
- styles['paddingInlineStart'] = (_c = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.padding) === null || _c === void 0 ? void 0 : _c.left;
1380
- styles['paddingInlineEnd'] = (_d = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.padding) === null || _d === void 0 ? void 0 : _d.right;
1381
- styles['marginBlockStart'] = (_e = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.margin) === null || _e === void 0 ? void 0 : _e.top;
1382
- styles['marginBlockEnd'] = (_f = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.margin) === null || _f === void 0 ? void 0 : _f.bottom;
1383
- styles['marginInlineStart'] = (_g = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.margin) === null || _g === void 0 ? void 0 : _g.left;
1384
- styles['marginInlineEnd'] = (_h = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.margin) === null || _h === void 0 ? void 0 : _h.right;
1385
- const marginHorizontal = ((_k = (_j = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.margin) === null || _j === void 0 ? void 0 : _j.left) !== null && _k !== void 0 ? _k : 0) + ((_m = (_l = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.margin) === null || _l === void 0 ? void 0 : _l.right) !== null && _m !== void 0 ? _m : 0);
1386
- if (marginHorizontal > 0 && styles.width === '100%')
1387
- styles.width = `calc(100% - ${marginHorizontal}px)`;
1388
- if (viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.backgroundColor)
1389
- styles['backgroundColor'] = viewStyle.backgroundColor;
1390
- // use JSON.stringify to escape special characters in image URL
1391
- if (viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.backgroundImageUrl) {
1392
- styles['backgroundImage'] = `url(${JSON.stringify(viewStyle.backgroundImageUrl)})`;
1393
- styles['backgroundSize'] = '100% 100%';
1394
- styles['backgroundPosition'] = 'center';
1395
- }
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 === 'flex' && width.value == FlexSizeSpecValue.WrapContent) {
1407
- style['width'] = 'fit-content';
1408
- if (parentLayout === Layout.Row) {
1409
- style['flexShrink'] = 0;
1410
- }
1411
- }
1412
- else if (width.type === 'fixed' && width.value >= 0) {
1413
- style['width'] = width.value;
1414
- if (parentLayout === Layout.Row) {
1415
- style['flexShrink'] = 0;
1416
- }
1417
- }
1418
- if (height.type === 'flex' && height.value == FlexSizeSpecValue.FillParent) {
1419
- style['height'] = '100%';
1420
- if (parentLayout === Layout.Column) {
1421
- style['flex'] = 1;
1422
- }
1423
- }
1424
- else if (height.type === 'flex' && height.value == FlexSizeSpecValue.WrapContent) {
1425
- style['height'] = 'fit-content';
1426
- if (parentLayout === Layout.Column) {
1427
- style['flexShrink'] = 0;
1428
- }
1429
- }
1430
- else if (height.type === 'fixed' && height.value >= 0) {
1431
- style['height'] = height.value;
1432
- if (parentLayout === Layout.Column) {
1433
- style['flexShrink'] = 0;
1434
- }
1435
- }
1436
- return style;
1437
- }
1438
- function setViewSize(styles, props, options) {
1439
- var _a, _b;
1440
- const { width: defaultWidth, height: defaultHeight } = defaultProperties.view.size;
1441
- const { parentLayout } = options;
1442
- const sizeStyle = getViewSizeStyle((_a = props.width) !== null && _a !== void 0 ? _a : defaultWidth, (_b = props.height) !== null && _b !== void 0 ? _b : defaultHeight, parentLayout);
1443
- Object.assign(styles, sizeStyle);
1444
- }
1445
- function setAlign(styles, layout = defaultProperties.box.layout, align = defaultProperties.box.align) {
1446
- if (layout === Layout.Row) {
1447
- styles['flexDirection'] = 'row';
1448
- styles['alignItems'] = alignInFlex(align.vertical);
1449
- styles['justifyContent'] = alignInFlex(align.horizontal);
1450
- }
1451
- if (layout === Layout.Column) {
1452
- styles['flexDirection'] = 'column';
1453
- styles['alignItems'] = alignInFlex(align.horizontal);
1454
- styles['justifyContent'] = alignInFlex(align.vertical);
1455
- }
1456
- }
1457
- function setTextAlign(styles, align = defaultProperties.box.align.horizontal) {
1458
- switch (align) {
1459
- case AlignValue.Left:
1460
- styles.textAlign = 'start';
1461
- break;
1462
- case AlignValue.Right:
1463
- styles.textAlign = 'end';
1464
- break;
1465
- case AlignValue.Center:
1466
- styles.textAlign = 'center';
1467
- break;
1468
- default:
1469
- styles.textAlign = 'start';
1470
- break;
1471
- }
1472
- }
1473
- function setImageStyle(styles, imageStyle) {
1474
- const { contentMode = MediaContentMode.AspectFit } = imageStyle || {};
1475
- if (contentMode) {
1476
- switch (contentMode) {
1477
- case MediaContentMode.AspectFill:
1478
- styles['objectFit'] = 'cover';
1479
- break;
1480
- case MediaContentMode.AspectFit:
1481
- styles['objectFit'] = 'contain';
1482
- break;
1483
- case MediaContentMode.ScalesToFill:
1484
- styles['objectFit'] = 'fill';
1485
- break;
1486
- }
1487
- }
1488
- }
1489
- // uses image meta-data to render images that doesn't break the UI
1490
- // https://sendbird.atlassian.net/wiki/spaces/UK/pages/2008220608/Message+template+-+Image+policy
1491
- function setImageAspectRatio(styles, props) {
1492
- var _a, _b, _c, _d;
1493
- const imageMetaData = props === null || props === void 0 ? void 0 : props.metaData;
1494
- if (!(imageMetaData === null || imageMetaData === void 0 ? void 0 : imageMetaData.pixelHeight) || !(imageMetaData === null || imageMetaData === void 0 ? void 0 : imageMetaData.pixelWidth)) {
1495
- return;
1496
- }
1497
- 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') {
1498
- return;
1499
- }
1500
- 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}`;
1501
- }
1502
- function webkitLineClampStyles(numberOfLines) {
1503
- return {
1504
- WebkitLineClamp: numberOfLines,
1505
- WebkitBoxOrient: 'vertical',
1506
- display: '-webkit-box',
1507
- overflow: 'hidden',
1508
- overflowWrap: 'anywhere',
1509
- flex: 1,
1510
- };
1511
- }
1512
- function setTextStyle(styles, props, options) {
1513
- const { textStyle, width } = props;
1514
- // TODO: Change default as design
1515
- const { size, color, weight } = textStyle || {};
1516
- if (size)
1517
- styles['fontSize'] = size;
1518
- if (color)
1519
- styles['color'] = color;
1520
- if (weight)
1521
- styles['fontWeight'] = weight;
1522
- if ((width === null || width === void 0 ? void 0 : width.type) === 'flex' && (width === null || width === void 0 ? void 0 : width.value) == FlexSizeSpecValue.WrapContent) {
1523
- styles['width'] = 'fit-content';
1524
- styles['maxWidth'] = '100%';
1525
- }
1526
- if (props.type === ComponentType.Text) {
1527
- const { siblings, elemIdx } = options;
1528
- // To push out any subsequent components from the container,
1529
- // if a prior one is long enough to occupy an entire line
1530
- // @link https://sendbird.atlassian.net/browse/NOTI-709
1531
- if (siblings != null && siblings.length >= 2 && siblings.every(isWrappedText)) {
1532
- styles.flexShrink = siblings.length - 1 === elemIdx ? 1 : 0;
1533
- }
1534
- }
1535
- }
1536
-
1537
- const parser = createParser({
1538
- mapBoxProps(props, options) {
1539
- const styles = getDefaultStyles();
1540
- setViewProps(styles, props, options);
1541
- setAlign(styles, props.layout, props.align);
1542
- return styles;
1543
- },
1544
- mapTextProps(props, options) {
1545
- var _a;
1546
- const styles = getDefaultStyles({ whiteSpace: 'pre-line', wordBreak: 'break-word' });
1547
- // Better not set flex 1 to text
1548
- setViewProps(styles, props, options);
1549
- setTextStyle(styles, props, options);
1550
- setAlign(styles, Layout.Row, props.align);
1551
- setTextAlign(styles, (_a = props.align) === null || _a === void 0 ? void 0 : _a.horizontal);
1552
- return styles;
1553
- },
1554
- mapImageProps(props, options) {
1555
- const styles = getDefaultStyles();
1556
- setViewProps(styles, props, options);
1557
- setImageStyle(styles, props.imageStyle);
1558
- setImageAspectRatio(styles, props);
1559
- return styles;
1560
- },
1561
- mapTextButtonProps(props, options) {
1562
- const styles = getDefaultStyles({ whiteSpace: 'pre-line', alignItems: 'center', justifyContent: 'center' });
1563
- setViewProps(styles, props, options);
1564
- setTextStyle(styles, props, options);
1565
- return styles;
1566
- },
1567
- mapImageButtonProps(props, options) {
1568
- const styles = getDefaultStyles();
1569
- setViewProps(styles, props, options);
1570
- setImageStyle(styles, props.imageStyle);
1571
- setImageAspectRatio(styles, props);
1572
- return styles;
1573
- },
1574
- mapCarouselProps(props, options) {
1575
- const styles = getDefaultStyles();
1576
- setViewProps(styles, props, options);
1577
- return styles;
1578
- },
1579
- mapCascadeProps(props, options) {
1580
- var _a, _b;
1581
- const styles = getDefaultStyles();
1582
- setViewProps(styles, props, options);
1583
- setAlign(styles, defaultProperties.cascade.layout);
1584
- styles['gap'] = (_b = (_a = props.cascadeStyle) === null || _a === void 0 ? void 0 : _a.spacing) !== null && _b !== void 0 ? _b : defaultProperties.cascade.style.spacing;
1585
- return styles;
1586
- },
1587
- });
1588
-
1589
- const SWIPE_THRESHOLD = 24;
1590
- const CLICK_THRESHOLD = 5;
1591
- function useCarousel({ spacing, childrenLength, paddingInlineStart, paddingInlineEnd }) {
1592
- const carouselRef = React.useRef(null);
1593
- const childrenRefs = React.useRef(Array.from({ length: childrenLength }, () => React__default.default.createRef()));
1594
- const isDragging = React.useRef(false);
1595
- const isScrolling = React.useRef(false);
1596
- const animationFrame = React.useRef(null);
1597
- const drag = React.useRef({
1598
- sx: null,
1599
- sy: null,
1600
- offset: 0,
1601
- translateX: 0,
1602
- currentIndex: 0,
1603
- didMove: false,
1604
- });
1605
- const [childWidths, setChildWidths] = React.useState(() => childrenRefs.current.map(() => 0));
1606
- const [isRTL, setIsRTL] = React.useState(false);
1607
- const directionMultiplier = isRTL ? -1 : 1;
1608
- const itemPositions = React.useMemo(() => {
1609
- let currentPosition = paddingInlineStart;
1610
- return childWidths.map((width, i) => {
1611
- const spacingOffset = i > 0 ? spacing : 0;
1612
- const start = currentPosition - spacingOffset;
1613
- const end = start - width;
1614
- currentPosition = end;
1615
- return { start, end };
1616
- });
1617
- }, [childWidths, spacing, paddingInlineStart]);
1618
- const totalContentWidth = React.useMemo(() => {
1619
- const totalItemWidth = childWidths.reduce((acc, width) => acc + width, 0);
1620
- const totalSpacing = spacing * (childrenLength - 1);
1621
- return totalItemWidth + totalSpacing;
1622
- }, [childWidths, spacing, childrenLength]);
1623
- React.useLayoutEffect(() => {
1624
- if (carouselRef.current) {
1625
- const dir = getComputedStyle(carouselRef.current).direction;
1626
- setIsRTL(dir === 'rtl');
1627
- }
1628
- }, []);
1629
- React.useLayoutEffect(() => {
1630
- setChildWidths(childrenRefs.current.map((ref) => { var _a, _b; return (_b = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.clientWidth) !== null && _b !== void 0 ? _b : 0; }));
1631
- }, [childrenLength]);
1632
- React.useLayoutEffect(() => {
1633
- if (itemPositions.length > 0) {
1634
- drag.current.translateX = itemPositions[0].start;
1635
- animate();
1636
- }
1637
- }, [itemPositions]);
1638
- const dragStart = () => {
1639
- if (!carouselRef.current)
1640
- return;
1641
- isDragging.current = true;
1642
- carouselRef.current.style.cursor = 'grabbing';
1643
- carouselRef.current.style.transition = 'none';
1644
- animationFrame.current = requestAnimationFrame(animate);
1645
- };
1646
- const dragStop = () => {
1647
- if (!carouselRef.current)
1648
- return;
1649
- isDragging.current = false;
1650
- carouselRef.current.style.cursor = 'grab';
1651
- carouselRef.current.style.transition = 'transform 0.5s ease';
1652
- if (animationFrame.current) {
1653
- cancelAnimationFrame(animationFrame.current);
1654
- animationFrame.current = null;
1655
- }
1656
- };
1657
- const dragRelease = () => {
1658
- const { offset, currentIndex } = drag.current;
1659
- const thresholdExceeded = Math.abs(offset) >= SWIPE_THRESHOLD;
1660
- const swipeToNext = offset < 0 && currentIndex < childrenLength - 1;
1661
- const swipeToPrev = offset > 0 && currentIndex > 0;
1662
- let newIndex = currentIndex;
1663
- if (thresholdExceeded && swipeToNext) {
1664
- newIndex = currentIndex + 1;
1665
- }
1666
- else if (thresholdExceeded && swipeToPrev) {
1667
- newIndex = currentIndex - 1;
1668
- }
1669
- function clampTranslateX(translateX) {
1670
- var _a, _b;
1671
- const containerWidth = (_b = (_a = carouselRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth) !== null && _b !== void 0 ? _b : 0;
1672
- const start = paddingInlineStart;
1673
- const end = Math.min(0, containerWidth - totalContentWidth) - paddingInlineEnd;
1674
- return Math.min(start, Math.max(translateX, end));
1675
- }
1676
- drag.current.currentIndex = newIndex;
1677
- drag.current.translateX = clampTranslateX(itemPositions[newIndex].start);
1678
- drag.current.offset = 0;
1679
- };
1680
- const scrollStart = () => {
1681
- isScrolling.current = true;
1682
- };
1683
- const scrollStop = () => {
1684
- isScrolling.current = false;
1685
- };
1686
- const animate = () => {
1687
- if (carouselRef.current) {
1688
- const tx = (drag.current.translateX + drag.current.offset) * directionMultiplier;
1689
- carouselRef.current.style.transform = `translateX(${tx}px)`;
1690
- }
1691
- if (animationFrame.current) {
1692
- animationFrame.current = requestAnimationFrame(animate);
1693
- }
1694
- };
1695
- const blockScroll = () => {
1696
- if (carouselRef.current) {
1697
- carouselRef.current.style.touchAction = 'pan-x';
1698
- }
1699
- };
1700
- const unblockScroll = () => {
1701
- if (carouselRef.current) {
1702
- carouselRef.current.style.touchAction = 'pan-y';
1703
- }
1704
- };
1705
- const onMouseDown = (event) => {
1706
- dragStart();
1707
- scrollStop();
1708
- drag.current.sx = event.clientX;
1709
- drag.current.sy = event.clientY;
1710
- drag.current.offset = 0;
1711
- drag.current.didMove = false;
1712
- animationFrame.current = requestAnimationFrame(animate);
1713
- };
1714
- const onMouseMove = (event) => {
1715
- if (!isDragging.current || drag.current.sx === null)
1716
- return;
1717
- drag.current.offset = (event.clientX - drag.current.sx) * directionMultiplier;
1718
- if (Math.abs(drag.current.offset) > CLICK_THRESHOLD) {
1719
- drag.current.didMove = true;
1720
- }
1721
- };
1722
- const onMouseUp = (event) => {
1723
- if (!isDragging.current)
1724
- return;
1725
- scrollStop();
1726
- dragRelease();
1727
- dragStop();
1728
- if (drag.current.didMove) {
1729
- event.preventDefault();
1730
- event.stopPropagation();
1731
- }
1732
- };
1733
- const onMouseLeave = (event) => {
1734
- if (!isDragging.current)
1735
- return;
1736
- scrollStop();
1737
- dragRelease();
1738
- dragStop();
1739
- if (drag.current.didMove) {
1740
- event.preventDefault();
1741
- event.stopPropagation();
1742
- }
1743
- };
1744
- const onTouchStart = (event) => {
1745
- scrollStop();
1746
- dragStop();
1747
- const touch = event.touches[0];
1748
- drag.current.sx = touch.clientX;
1749
- drag.current.sy = touch.clientY;
1750
- drag.current.offset = 0;
1751
- drag.current.didMove = false;
1752
- animationFrame.current = requestAnimationFrame(animate);
1753
- };
1754
- const onTouchMove = (event) => {
1755
- if (drag.current.sx === null || drag.current.sy === null || isScrolling.current)
1756
- return;
1757
- const { clientX, clientY } = event.touches[0];
1758
- const { sx, sy } = drag.current;
1759
- if (isDragging.current) {
1760
- drag.current.offset = (clientX - sx) * directionMultiplier;
1761
- if (Math.abs(drag.current.offset) > CLICK_THRESHOLD) {
1762
- drag.current.didMove = true;
1763
- }
1764
- return;
1765
- }
1766
- const isVerticalScroll = Math.abs(clientY - sy) > Math.abs(clientX - sx);
1767
- if (isVerticalScroll) {
1768
- scrollStart();
1769
- }
1770
- else {
1771
- drag.current.offset = (clientX - sx) * directionMultiplier;
1772
- blockScroll();
1773
- dragStart();
1774
- }
1775
- };
1776
- const onTouchEnd = (event) => {
1777
- unblockScroll();
1778
- scrollStop();
1779
- dragRelease();
1780
- dragStop();
1781
- if (drag.current.didMove) {
1782
- event.preventDefault();
1783
- event.stopPropagation();
1784
- }
1785
- };
1786
- const onClickCapture = (event) => {
1787
- if (drag.current.didMove) {
1788
- event.preventDefault();
1789
- event.stopPropagation();
1790
- }
1791
- };
1792
- return {
1793
- carouselRef,
1794
- childrenRefs,
1795
- handlers: {
1796
- onMouseDown,
1797
- onMouseMove,
1798
- onMouseUp,
1799
- onMouseLeave,
1800
- onTouchStart,
1801
- onTouchMove,
1802
- onTouchEnd,
1803
- onClickCapture,
1804
- },
1805
- };
1806
- }
1807
-
1808
- var __rest$4 = (undefined && undefined.__rest) || function (s, e) {
1809
- var t = {};
1810
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1811
- t[p] = s[p];
1812
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
1813
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1814
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
1815
- t[p[i]] = s[p[i]];
1816
- }
1817
- return t;
1818
- };
1819
- const RMTCarousel = (_a) => {
1820
- var { children, style, spacing = defaultProperties.carousel.style.spacing, maxChildWidth = defaultProperties.carousel.style.maxChildWidth, inlineStyle } = _a, props = __rest$4(_a, ["children", "style", "spacing", "maxChildWidth", "inlineStyle"]);
1821
- const _b = style !== null && style !== void 0 ? style : {}, { paddingInlineStart = 0, paddingInlineEnd = 0 } = _b, restStyle = __rest$4(_b, ["paddingInlineStart", "paddingInlineEnd"]);
1822
- const { carouselRef, childrenRefs, handlers } = useCarousel({
1823
- spacing,
1824
- childrenLength: children.length,
1825
- paddingInlineStart: Number(paddingInlineStart),
1826
- paddingInlineEnd: Number(paddingInlineEnd),
1827
- });
1828
- return (React__default.default.createElement("div", Object.assign({}, handlers, { ref: carouselRef, style: Object.assign(Object.assign(Object.assign({}, restStyle), { gap: spacing, width: '100%', overflow: 'visible' }), inlineStyle) }, props), children.map((item, index) => (React__default.default.createElement(RMTCarouselChild, { ref: childrenRefs.current[index], key: index, maxChildWidth: maxChildWidth }, item)))));
1829
- };
1830
- const RMTCarouselChild = React__default.default.forwardRef(function CarouselChild({ maxChildWidth, children }, ref) {
1831
- const maxWidth = shouldSetMaxChildWidth(children.props, maxChildWidth) ? maxChildWidth : 'fit-content';
1832
- return (React__default.default.createElement("div", { ref: ref, style: { maxWidth, width: '100%', flexShrink: 0, overflow: 'hidden', userSelect: 'none' } }, children));
1833
- });
1834
- // Note: Set the maxChildWidth because it's impossible to determine the maximum width of items in the Carousel Child template when they have FillParent
1835
- function shouldSetMaxChildWidth(props, maxChildWidth) {
1836
- return !!props.templateItems.find((it) => {
1837
- var _a;
1838
- const width = (_a = it.width) !== null && _a !== void 0 ? _a : defaultProperties.view.size.width;
1839
- const hasFillWidth = width.type === 'flex' && width.value === FlexSizeSpecValue.FillParent;
1840
- const overMaxChildWidth = width.type === 'fixed' && width.value >= maxChildWidth;
1841
- return hasFillWidth || overMaxChildWidth;
1842
- });
1843
- }
1844
-
1845
- var __rest$3 = (undefined && undefined.__rest) || function (s, e) {
1846
- var t = {};
1847
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1848
- t[p] = s[p];
1849
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
1850
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1851
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
1852
- t[p[i]] = s[p[i]];
1853
- }
1854
- return t;
1855
- };
1856
- const RMTImageCanvas = (props) => {
1857
- const { imageSize, canvasRef, canvasProps } = useCanvasMessageTemplateImage(props);
1858
- return (React__default.default.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 })));
1859
- };
1860
- const useCanvasMessageTemplateImage = (_a) => {
1861
- var { metaData, tintColor } = _a, props = __rest$3(_a, ["metaData", "tintColor"]);
1862
- const canvasRef = React.useRef(null);
1863
- const [fallbackImageSize, setFallbackImageSize] = React.useState();
1864
- const imageSize = React.useMemo(() => {
1865
- if ((metaData === null || metaData === void 0 ? void 0 : metaData.pixelHeight) && (metaData === null || metaData === void 0 ? void 0 : metaData.pixelWidth)) {
1866
- return { width: metaData.pixelWidth, height: metaData.pixelHeight };
1867
- }
1868
- return fallbackImageSize;
1869
- }, [fallbackImageSize, metaData === null || metaData === void 0 ? void 0 : metaData.pixelHeight, metaData === null || metaData === void 0 ? void 0 : metaData.pixelWidth]);
1870
- React.useEffect(() => {
1871
- if (imageSize == null) {
1872
- if (canvasRef.current) {
1873
- canvasRef.current.style.width = '100%';
1874
- canvasRef.current.style.height = '100%';
1875
- const containerSize = canvasRef.current.getBoundingClientRect();
1876
- setFallbackImageSize(containerSize);
1877
- }
1878
- }
1879
- }, [imageSize]);
1880
- React.useEffect(() => {
1881
- if (props.src) {
1882
- const img = new Image();
1883
- const onImageLoad = () => {
1884
- if (canvasRef.current && tintColor && imageSize) {
1885
- const ctx = canvasRef.current.getContext('2d');
1886
- if (ctx) {
1887
- const { width: imageWidth, height: imageHeight } = imageSize;
1888
- // reset context before draw, consider `.save()` and `.restore()` api
1889
- ctx.clearRect(0, 0, imageWidth, imageHeight);
1890
- ctx.beginPath();
1891
- ctx.globalCompositeOperation = 'source-over';
1892
- ctx.fillStyle = '#000';
1893
- // draw
1894
- ctx.drawImage(img, 0, 0, imageWidth, imageHeight);
1895
- ctx.globalCompositeOperation = 'source-atop';
1896
- ctx.fillStyle = tintColor;
1897
- ctx.fillRect(0, 0, imageWidth, imageHeight);
1898
- }
1899
- }
1900
- };
1901
- const onImageError = (event) => {
1902
- var _a;
1903
- // @ts-ignore
1904
- (_a = props.onError) === null || _a === void 0 ? void 0 : _a.call(props, event);
1905
- };
1906
- img.addEventListener('load', onImageLoad);
1907
- img.addEventListener('error', onImageError);
1908
- img.src = props.src;
1909
- return () => {
1910
- img.removeEventListener('load', onImageLoad);
1911
- img.removeEventListener('error', onImageError);
1912
- };
1913
- }
1914
- return;
1915
- }, [props.src, imageSize, tintColor]);
1916
- return {
1917
- canvasRef,
1918
- canvasProps: props,
1919
- imageSize,
1920
- };
1921
- };
1922
-
1923
- const RMTImageDefault = (props) => {
1924
- return React__default.default.createElement("img", Object.assign({}, props, { onError: props.onError, draggable: false, referrerPolicy: "no-referrer" }));
1925
- };
1926
-
1927
- const RMTImagePlaceholder = (props) => {
1928
- return React__default.default.createElement("div", { style: Object.assign(Object.assign({}, props.style), { backgroundColor: 'transparent' }) });
1929
- };
1930
-
1931
- var __rest$2 = (undefined && undefined.__rest) || function (s, e) {
1932
- var t = {};
1933
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1934
- t[p] = s[p];
1935
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
1936
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1937
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
1938
- t[p[i]] = s[p[i]];
1939
- }
1940
- return t;
1941
- };
1942
- const RMTImage = (_a) => {
1943
- var { tintColor, metaData } = _a, props = __rest$2(_a, ["tintColor", "metaData"]);
1944
- const { hasError, onError } = useImageLoadError(props.src);
1945
- if (props.onError)
1946
- console.warn('`onError` is intercepted and not executed in the ReactMessageTemplateImage.');
1947
- if (hasError) {
1948
- return React__default.default.createElement(RMTImagePlaceholder, Object.assign({}, props));
1949
- }
1950
- else if (tintColor && !isGif(props.src)) {
1951
- return React__default.default.createElement(RMTImageCanvas, Object.assign({}, props, { onError: onError, tintColor: tintColor, metaData: metaData }));
1952
- }
1953
- else {
1954
- return React__default.default.createElement(RMTImageDefault, Object.assign({}, props, { onError: onError }));
1955
- }
1956
- };
1957
- const useImageLoadError = (source) => {
1958
- const [hasError, setHasError] = React.useState(false);
1959
- React.useEffect(() => setHasError(false), [source]);
1960
- return {
1961
- hasError,
1962
- onError: React.useCallback(() => setHasError(true), []),
1963
- };
1964
- };
1965
-
1966
- const MessageContext = React__default.default.createContext(null);
1967
- const MessageProvider = ({ handleWebAction, handleCustomAction, handleUIKitAction, handleInternalAction, highlight, children, }) => {
1968
- return (React__default.default.createElement(MessageContext.Provider, { value: {
1969
- handleWebAction,
1970
- handleCustomAction,
1971
- handleUIKitAction,
1972
- handleInternalAction,
1973
- highlight,
1974
- } }, children));
1975
- };
1976
- const useMessageContext = () => {
1977
- const context = React__default.default.useContext(MessageContext);
1978
- if (!context) {
1979
- throw new Error('useMessageContext must be used within a MessageProvider');
1980
- }
1981
- return context;
1982
- };
1983
-
1984
- /**
1985
- * This hook is used to highlight each item in the message template by extending its style.
1986
- * */
1987
- function useHighlightStyle(raw) {
1988
- const { highlight } = useMessageContext();
1989
- return {
1990
- className: (highlight === null || highlight === void 0 ? void 0 : highlight.getContainerClassName) ? highlight.getContainerClassName(raw) : undefined,
1991
- style: (highlight === null || highlight === void 0 ? void 0 : highlight.getContainerInlineStyle) ? highlight.getContainerInlineStyle(raw) : undefined,
1992
- renderText: (highlight === null || highlight === void 0 ? void 0 : highlight.renderText) ? highlight.renderText : (it) => it,
1993
- };
1994
- }
1995
-
1996
- /**
1997
- * Preserves a reference to the given callback function as an argument while the component is mounted.
1998
- * Wraps the given callback in React's Ref to preserve the reference.
1999
- * @param callback want to be preserved
2000
- */
2001
- function usePreservedCallback(callback) {
2002
- const callbackRef = React.useRef(callback);
2003
- React.useEffect(() => {
2004
- callbackRef.current = callback;
2005
- }, [callback]);
2006
- return React.useCallback((...args) => {
2007
- return callbackRef.current(...args);
2008
- }, [callbackRef]);
2009
- }
2010
-
2011
- /**
2012
- * This hook can be used when you want to safely effect the value stored in useRef
2013
- * Got this idea from https://github.com/facebook/react/issues/15176
2014
- * @param callback
2015
- * @param deps
2016
- * @returns effect callback
2017
- */
2018
- function useRefEffect(callback, deps) {
2019
- const preservedCallback = usePreservedCallback(callback);
2020
- const disposeRef = React.useRef(noop);
2021
- const effect = React.useCallback((element) => {
2022
- disposeRef.current();
2023
- disposeRef.current = noop;
2024
- if (element != null) {
2025
- const cleanup = callback(element);
2026
- if (typeof cleanup === 'function') {
2027
- disposeRef.current = cleanup;
2028
- }
2029
- }
2030
- }, [preservedCallback, ...deps]);
2031
- return effect;
2032
- }
2033
- function noop() { }
2034
-
2035
- /**
2036
- * Subscribes to ResizeObserver on the component exposing the Ref,
2037
- * to detect changes in the size of DOM elements.
2038
- * The ResizeObserver API is required.
2039
- * If you are targeting browsers that do not support that API, probably need to add appropriate polyfill too.
2040
- * @param onResize
2041
- * @returns ref
2042
- */
2043
- function useResizeObserver(onResize) {
2044
- const resizeCallback = usePreservedCallback(onResize);
2045
- const ref = useRefEffect((elem) => {
2046
- const observer = new ResizeObserver((entries) => {
2047
- if (entries[0] != null) {
2048
- resizeCallback(entries[0]);
2049
- }
2050
- });
2051
- observer.observe(elem);
2052
- return () => {
2053
- observer.unobserve(elem);
2054
- };
2055
- }, [resizeCallback]);
2056
- return ref;
2057
- }
2058
-
2059
- /**
2060
- * @returns an element's width / height observed by IntersectionObserver,
2061
- * and ref to detect its resize event
2062
- */
2063
- function useElementSize() {
2064
- const [width, setWidth] = React.useState(-1);
2065
- const [height, setHeight] = React.useState(-1);
2066
- const [contentWidth, setContentWidth] = React.useState(-1);
2067
- const [contentHeight, setContentHeight] = React.useState(-1);
2068
- const [paddingWidth, setPaddingWidth] = React.useState(-1);
2069
- const [paddingHeight, setPaddingHeight] = React.useState(-1);
2070
- const ref = useResizeObserver((entry) => {
2071
- // contentRect: content size only
2072
- const { width: contentWidth, height: contentHeight } = entry.contentRect;
2073
- // target: content + padding + border size
2074
- const target = entry.target;
2075
- const { width, height } = target.getBoundingClientRect();
2076
- setWidth(width);
2077
- setHeight(height);
2078
- setContentWidth(contentWidth);
2079
- setContentHeight(contentHeight);
2080
- setPaddingWidth(width - contentWidth);
2081
- setPaddingHeight(height - contentHeight);
2082
- });
2083
- return { ref, width, height, contentWidth, contentHeight, paddingWidth, paddingHeight };
2084
- }
2085
-
2086
- var __rest$1 = (undefined && undefined.__rest) || function (s, e) {
2087
- var t = {};
2088
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
2089
- t[p] = s[p];
2090
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
2091
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
2092
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
2093
- t[p[i]] = s[p[i]];
2094
- }
2095
- return t;
2096
- };
2097
- function isViewCompatibleWithSizeOption({ width = defaultProperties.view.size.width, height = defaultProperties.view.size.height, parentLayout = defaultProperties.box.layout, option, }) {
2098
- if (parentLayout === Layout.Row) {
2099
- return isSizeCompatibleWithOption({
2100
- size: width,
2101
- option,
2102
- });
2103
- }
2104
- return isSizeCompatibleWithOption({
2105
- size: height,
2106
- option,
2107
- });
2108
- }
2109
- function useRecalculateWidth(params) {
2110
- const { style, props } = params;
2111
- const _a = useElementSize(), { ref: elemRef } = _a, size = __rest$1(_a, ["ref"]);
2112
- const { updateSize, sizes } = useSizeContext();
2113
- const { id, siblings, parentLayout } = props;
2114
- const { width, height, paddingWidth, paddingHeight, contentWidth, contentHeight } = size;
2115
- React.useEffect(() => {
2116
- updateSize({
2117
- id: props.id,
2118
- width,
2119
- height,
2120
- paddingWidth,
2121
- paddingHeight,
2122
- contentWidth,
2123
- contentHeight,
2124
- });
2125
- }, [props.id, width, height, paddingWidth, paddingHeight, contentWidth, contentHeight, updateSize]);
2126
- const currentStyle = React.useMemo(() => {
2127
- const sumViewSize = (acc = 0, view) => {
2128
- var _a, _b, _c, _d;
2129
- if (parentLayout === Layout.Row) {
2130
- return acc + ((_b = (_a = sizes[view.id]) === null || _a === void 0 ? void 0 : _a.contentWidth) !== null && _b !== void 0 ? _b : 0);
2131
- }
2132
- return acc + ((_d = (_c = sizes[view.id]) === null || _c === void 0 ? void 0 : _c.contentHeight) !== null && _d !== void 0 ? _d : 0);
2133
- };
2134
- const hasFillOption = isViewCompatibleWithSizeOption({
2135
- width: props.width,
2136
- height: props.height,
2137
- parentLayout,
2138
- option: 'fill',
2139
- });
2140
- if (hasFillOption) {
2141
- const wrapSiblingsSize = siblings
2142
- .filter(({ width, height }) => !isViewCompatibleWithSizeOption({
2143
- width: width,
2144
- height: height,
2145
- parentLayout,
2146
- option: 'fill',
2147
- }))
2148
- .reduce(sumViewSize, 0);
2149
- const fillSiblingCount = siblings.filter(({ width, height }) => isViewCompatibleWithSizeOption({
2150
- width: width,
2151
- height: height,
2152
- parentLayout,
2153
- option: 'fill',
2154
- })).length;
2155
- const maxSizeOption = (() => {
2156
- if (parentLayout === Layout.Row) {
2157
- return {
2158
- maxWidth: `calc((100% - ${wrapSiblingsSize}px) / ${fillSiblingCount})`,
2159
- };
2160
- }
2161
- return {
2162
- maxHeight: `calc((100% - ${wrapSiblingsSize}px) / ${fillSiblingCount})`,
2163
- };
2164
- })();
2165
- return Object.assign(Object.assign(Object.assign({}, style), maxSizeOption), (width == 0 && { height: 0 }));
2166
- }
2167
- else {
2168
- const currentElemIdx = siblings.findIndex((sibling) => sibling.id === id);
2169
- const forwardSiblingsSize = siblings
2170
- .slice(0, currentElemIdx)
2171
- .filter(({ width, height }) => isViewCompatibleWithSizeOption({
2172
- width: width,
2173
- height: height,
2174
- parentLayout,
2175
- option: 'wrap',
2176
- }))
2177
- .reduce(sumViewSize, 0);
2178
- return Object.assign(Object.assign(Object.assign({}, style), (width === 0 && { height: 0 })), (parentLayout === Layout.Row
2179
- ? {
2180
- maxWidth: `calc(100% - ${forwardSiblingsSize}px)`,
2181
- }
2182
- : {
2183
- maxHeight: `calc(100% - ${forwardSiblingsSize}px)`,
2184
- }));
2185
- }
2186
- }, [props.width, props.height, parentLayout, sizes, siblings, style, width, id]);
2187
- return { recalculatedStyle: currentStyle, elemRef };
2188
- }
2189
-
2190
- var __rest = (undefined && undefined.__rest) || function (s, e) {
2191
- var t = {};
2192
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
2193
- t[p] = s[p];
2194
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
2195
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
2196
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
2197
- t[p[i]] = s[p[i]];
2198
- }
2199
- return t;
2200
- };
2201
- // todo: semantic html here is not perfect, need to revisit. Same for Button
2202
- const ActionHandler = ({ children, props, className, style, inlineStyle }) => {
2203
- var _a;
2204
- const _b = style !== null && style !== void 0 ? style : {}, { paddingBlockStart, paddingBlockEnd, paddingInlineStart, paddingInlineEnd } = _b, restStyle = __rest(_b, ["paddingBlockStart", "paddingBlockEnd", "paddingInlineStart", "paddingInlineEnd"]);
2205
- const { recalculatedStyle, elemRef } = useRecalculateWidth({ style: restStyle, props });
2206
- const { handleWebAction, handleCustomAction, handleUIKitAction, handleInternalAction } = useMessageContext();
2207
- const borderClass = ((_a = props.viewStyle) === null || _a === void 0 ? void 0 : _a.borderWidth) ? 'sb-message-template__border' : '';
2208
- const actionClass = props.action ? 'sb-message-template__action' : '';
2209
- const onClick = (e) => {
2210
- var _a, _b, _c, _d, _e, _f, _g, _h;
2211
- if (((_a = props.action) === null || _a === void 0 ? void 0 : _a.type) === 'web') {
2212
- if (handleWebAction) {
2213
- handleWebAction(e, props.action);
2214
- }
2215
- else {
2216
- (_c = window === null || window === void 0 ? void 0 : window.open(getValidURL((_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();
2217
- }
2218
- }
2219
- else if (((_d = props.action) === null || _d === void 0 ? void 0 : _d.type) === 'custom') {
2220
- if (handleCustomAction) {
2221
- handleCustomAction(e, props.action);
2222
- }
2223
- else {
2224
- (_f = window === null || window === void 0 ? void 0 : window.open(getValidURL((_e = props === null || props === void 0 ? void 0 : props.action) === null || _e === void 0 ? void 0 : _e.data), '_blank', 'noopener noreferrer')) === null || _f === void 0 ? void 0 : _f.focus();
2225
- }
2226
- }
2227
- else if (((_g = props.action) === null || _g === void 0 ? void 0 : _g.type) === 'uikit') {
2228
- handleUIKitAction === null || handleUIKitAction === void 0 ? void 0 : handleUIKitAction(e, props.action);
2229
- }
2230
- else if (((_h = props.action) === null || _h === void 0 ? void 0 : _h.type) === 'internal') {
2231
- handleInternalAction === null || handleInternalAction === void 0 ? void 0 : handleInternalAction(e, props.action);
2232
- }
2233
- };
2234
- if (props.type === ComponentType.TextButton) {
2235
- return (React__default.default.createElement("button", { className: clx(className, borderClass, actionClass), "data-sb-template-id": props.elementId, style: Object.assign(Object.assign({}, style), inlineStyle), onClick: onClick }, children));
2236
- }
2237
- const { display, flexDirection, justifyContent, alignItems, objectFit } = recalculatedStyle, wrapperStyles = __rest(recalculatedStyle, ["display", "flexDirection", "justifyContent", "alignItems", "objectFit"]);
2238
- return (React__default.default.createElement("div", { ref: elemRef, className: clx(className, borderClass, actionClass), "data-sb-template-id": props.elementId, style: Object.assign(Object.assign({}, wrapperStyles), inlineStyle), onClick: onClick },
2239
- React__default.default.createElement("div", { style: {
2240
- display,
2241
- flexDirection,
2242
- justifyContent,
2243
- alignItems,
2244
- objectFit,
2245
- width: '100%',
2246
- height: '100%',
2247
- paddingBlockStart,
2248
- paddingBlockEnd,
2249
- paddingInlineStart,
2250
- paddingInlineEnd,
2251
- gap: style === null || style === void 0 ? void 0 : style.gap,
2252
- } }, children)));
2253
- };
2254
-
2255
- const renderer = createRenderer({
2256
- views: {
2257
- box(props) {
2258
- const highlight = useHighlightStyle(props.rawProperties);
2259
- return (React__default.default.createElement(ActionHandler, { className: clx('sb-message-template__box', highlight.className), inlineStyle: highlight.style, elementId: props.elementId, style: props.parsedProperties, props: props }, props.children));
2260
- },
2261
- text(props) {
2262
- const highlight = useHighlightStyle(props.rawProperties);
2263
- return (React__default.default.createElement(ActionHandler, { className: clx('sb-message-template__text', highlight.className), inlineStyle: highlight.style, elementId: props.elementId, style: props.parsedProperties, props: props }, renderText(props, highlight.renderText)));
2264
- },
2265
- image(props) {
2266
- var _a;
2267
- const highlight = useHighlightStyle(props.rawProperties);
2268
- // todo: add image backup
2269
- return (React__default.default.createElement(ActionHandler, { className: clx('sb-message-template__image-container', highlight.className), inlineStyle: highlight.style, elementId: props.elementId, style: props.parsedProperties, props: props },
2270
- React__default.default.createElement(RMTImage, { 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 })));
2271
- },
2272
- textButton(props) {
2273
- const highlight = useHighlightStyle(props.rawProperties);
2274
- return (React__default.default.createElement(ActionHandler, { className: clx('sb-message-template__text-button', highlight.className), inlineStyle: highlight.style, elementId: props.elementId, style: props.parsedProperties, props: props }, renderText(Object.assign({ maxTextLines: defaultProperties.textButton.maxTextLines }, props), highlight.renderText)));
2275
- },
2276
- imageButton(props) {
2277
- var _a;
2278
- const highlight = useHighlightStyle(props.rawProperties);
2279
- return (React__default.default.createElement(ActionHandler, { className: clx('sb-message-template__image-container', 'sb-message-template__image-button', highlight.className), inlineStyle: highlight.style, elementId: props.elementId, style: props.parsedProperties, props: props },
2280
- React__default.default.createElement(RMTImage, { 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 })));
2281
- },
2282
- carouselView(props) {
2283
- var _a, _b;
2284
- const highlight = useHighlightStyle(props.rawProperties);
2285
- return (React__default.default.createElement(RMTCarousel, { className: clx('sb-message-template__carousel', highlight.className), inlineStyle: highlight.style, maxChildWidth: (_a = props.carouselStyle) === null || _a === void 0 ? void 0 : _a.maxChildWidth, spacing: (_b = props.carouselStyle) === null || _b === void 0 ? void 0 : _b.spacing, style: props.parsedProperties }, props.children));
2286
- },
2287
- cascadeView(props) {
2288
- const highlight = useHighlightStyle(props.rawProperties);
2289
- return (React__default.default.createElement(ActionHandler, { className: clx('sb-message-template__cascade', highlight.className), inlineStyle: highlight.style, elementId: props.elementId, style: props.parsedProperties, props: props }, props.children));
2290
- },
2291
- },
2292
- });
2293
- function convertNewlinesToBr(text, highlightText) {
2294
- return text.split('\n').map((line, index) => (React__default.default.createElement(React__default.default.Fragment, { key: index },
2295
- highlightText(line),
2296
- React__default.default.createElement("br", null))));
2297
- }
2298
- function renderText(view, highlightText) {
2299
- const { text, maxTextLines } = view;
2300
- const isToBeWrapped = isFixedOrFill(view);
2301
- const hasMaxLines = typeof maxTextLines === 'number' && maxTextLines > 0;
2302
- const convertedText = convertNewlinesToBr(text, highlightText);
2303
- if (hasMaxLines || isToBeWrapped) {
2304
- const wrapperStyling = Object.assign(Object.assign({}, ((hasMaxLines || isToBeWrapped) && { maxWidth: '100%' })), (isToBeWrapped && { maxHeight: '100%', overflow: 'hidden' }));
2305
- return (React__default.default.createElement("div", { style: wrapperStyling }, hasMaxLines ? React__default.default.createElement("div", { style: webkitLineClampStyles(maxTextLines) }, convertedText) : convertedText));
2306
- }
2307
- return hasMaxLines ? React__default.default.createElement("div", { style: webkitLineClampStyles(maxTextLines) }, convertedText) : convertedText;
2308
- }
2309
- /**
2310
- * Text that is fixed or fill parent should be wrapped in a div with max-width: 100% and max-height: 100%
2311
- * This is to prevent text from overflowing the padding of the container
2312
- */
2313
- function isFixedOrFill(view) {
2314
- var _a, _b, _c, _d;
2315
- const heightType = (_a = view === null || view === void 0 ? void 0 : view.height) === null || _a === void 0 ? void 0 : _a.type;
2316
- const widthType = (_b = view === null || view === void 0 ? void 0 : view.width) === null || _b === void 0 ? void 0 : _b.type;
2317
- const isFixedDimension = heightType === 'fixed' || widthType === 'fixed';
2318
- const isFill = (heightType === 'flex' && ((_c = view === null || view === void 0 ? void 0 : view.height) === null || _c === void 0 ? void 0 : _c.value) === FlexSizeSpecValue.FillParent) ||
2319
- (widthType === 'flex' && ((_d = view === null || view === void 0 ? void 0 : view.width) === null || _d === void 0 ? void 0 : _d.value) === FlexSizeSpecValue.FillParent);
2320
- return isFixedDimension || isFill;
2321
- }
2322
-
2323
- createMessageTemplate({
2324
- renderer,
2325
- parser,
2326
- Container: ({ children, className }) => {
2327
- return (React__default.default.createElement("div", { className: `sb-message-template__parent ${className}`, style: { display: 'flex', flexDirection: 'column', maxWidth: 400, marginBlockEnd: 24 } }, children));
2328
- },
2329
- });
2330
-
2331
- var CustomTemplate = createMessageTemplate({
2332
- parser: parser,
2333
- renderer: renderer,
2334
- Container: function (_a) {
2335
- var children = _a.children, className = _a.className;
2336
- return (React__default.default.createElement("div", { className: [
2337
- "sb-message-template__parent ".concat(className),
2338
- 'sendbird-message-template__root',
2339
- ].join(' ') }, children));
2340
- },
2341
- }).MessageTemplate;
2342
- function MessageTemplate(_a) {
2343
- var templateItems = _a.templateItems, templateVersion = _a.templateVersion;
2344
- return React__default.default.createElement(CustomTemplate, { templateItems: templateItems, templateVersion: templateVersion });
2345
- }
2346
-
2347
- exports.MessageProvider = MessageProvider;
2348
- exports.MessageTemplate = MessageTemplate;
2349
- //# sourceMappingURL=bundle-BsQpzivE.js.map