@sendbird/uikit-react 3.17.3 → 3.17.5

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