@sendbird/uikit-react-native 2.5.0 → 3.0.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (313) hide show
  1. package/README.md +6 -1
  2. package/lib/commonjs/components/{MessageRenderer/MessageTime.js → ChannelInput/AttachmentsButton.js} +20 -17
  3. package/lib/commonjs/components/ChannelInput/AttachmentsButton.js.map +1 -0
  4. package/lib/commonjs/components/ChannelInput/EditInput.js +10 -18
  5. package/lib/commonjs/components/ChannelInput/EditInput.js.map +1 -1
  6. package/lib/commonjs/components/ChannelInput/SendInput.js +220 -163
  7. package/lib/commonjs/components/ChannelInput/SendInput.js.map +1 -1
  8. package/lib/commonjs/components/ChannelInput/index.js +5 -3
  9. package/lib/commonjs/components/ChannelInput/index.js.map +1 -1
  10. package/lib/commonjs/components/ChannelMessageList/index.js +27 -27
  11. package/lib/commonjs/components/ChannelMessageList/index.js.map +1 -1
  12. package/lib/commonjs/components/ChatFlatList.js +18 -6
  13. package/lib/commonjs/components/ChatFlatList.js.map +1 -1
  14. package/lib/commonjs/components/{MessageRenderer/MessageDateSeparator.js → GroupChannelMessageRenderer/GroupChannelMessageDateSeparator.js} +3 -3
  15. package/lib/commonjs/components/GroupChannelMessageRenderer/GroupChannelMessageDateSeparator.js.map +1 -0
  16. package/lib/commonjs/components/GroupChannelMessageRenderer/GroupChannelMessageFocusAnimation.js +47 -0
  17. package/lib/commonjs/components/GroupChannelMessageRenderer/GroupChannelMessageFocusAnimation.js.map +1 -0
  18. package/lib/commonjs/components/{MessageRenderer/MessageOutgoingStatus.js → GroupChannelMessageRenderer/GroupChannelMessageOutgoingStatus.js} +11 -14
  19. package/lib/commonjs/components/GroupChannelMessageRenderer/GroupChannelMessageOutgoingStatus.js.map +1 -0
  20. package/lib/commonjs/components/GroupChannelMessageRenderer/index.js +204 -0
  21. package/lib/commonjs/components/GroupChannelMessageRenderer/index.js.map +1 -0
  22. package/lib/commonjs/components/MessageSearchResultItem.js +3 -2
  23. package/lib/commonjs/components/MessageSearchResultItem.js.map +1 -1
  24. package/lib/commonjs/components/OpenChannelMessageRenderer/index.js +15 -9
  25. package/lib/commonjs/components/OpenChannelMessageRenderer/index.js.map +1 -1
  26. package/lib/commonjs/constants.js +1 -7
  27. package/lib/commonjs/constants.js.map +1 -1
  28. package/lib/commonjs/containers/GroupChannelPreviewContainer.js +13 -13
  29. package/lib/commonjs/containers/GroupChannelPreviewContainer.js.map +1 -1
  30. package/lib/commonjs/containers/SendbirdUIKitContainer.js +29 -19
  31. package/lib/commonjs/containers/SendbirdUIKitContainer.js.map +1 -1
  32. package/lib/commonjs/contexts/SendbirdChatCtx.js +17 -14
  33. package/lib/commonjs/contexts/SendbirdChatCtx.js.map +1 -1
  34. package/lib/commonjs/contexts/UserProfileCtx.js +6 -4
  35. package/lib/commonjs/contexts/UserProfileCtx.js.map +1 -1
  36. package/lib/commonjs/domain/groupChannel/component/GroupChannelInput.js +4 -13
  37. package/lib/commonjs/domain/groupChannel/component/GroupChannelInput.js.map +1 -1
  38. package/lib/commonjs/domain/groupChannel/types.js.map +1 -1
  39. package/lib/commonjs/domain/groupChannelList/component/GroupChannelListList.js +10 -6
  40. package/lib/commonjs/domain/groupChannelList/component/GroupChannelListList.js.map +1 -1
  41. package/lib/commonjs/domain/groupChannelList/component/GroupChannelListTypeSelector.js +3 -3
  42. package/lib/commonjs/domain/groupChannelList/component/GroupChannelListTypeSelector.js.map +1 -1
  43. package/lib/commonjs/domain/groupChannelList/types.js.map +1 -1
  44. package/lib/commonjs/domain/groupChannelSettings/component/GroupChannelSettingsMenu.js +11 -10
  45. package/lib/commonjs/domain/groupChannelSettings/component/GroupChannelSettingsMenu.js.map +1 -1
  46. package/lib/commonjs/domain/openChannel/component/OpenChannelInput.js +4 -8
  47. package/lib/commonjs/domain/openChannel/component/OpenChannelInput.js.map +1 -1
  48. package/lib/commonjs/domain/openChannel/types.js.map +1 -1
  49. package/lib/commonjs/domain/openChannelList/component/OpenChannelListList.js +3 -1
  50. package/lib/commonjs/domain/openChannelList/component/OpenChannelListList.js.map +1 -1
  51. package/lib/commonjs/domain/openChannelList/types.js.map +1 -1
  52. package/lib/commonjs/fragments/createGroupChannelCreateFragment.js +1 -1
  53. package/lib/commonjs/fragments/createGroupChannelCreateFragment.js.map +1 -1
  54. package/lib/commonjs/fragments/createGroupChannelFragment.js +22 -100
  55. package/lib/commonjs/fragments/createGroupChannelFragment.js.map +1 -1
  56. package/lib/commonjs/fragments/createGroupChannelInviteFragment.js +1 -1
  57. package/lib/commonjs/fragments/createGroupChannelInviteFragment.js.map +1 -1
  58. package/lib/commonjs/fragments/createGroupChannelListFragment.js +8 -13
  59. package/lib/commonjs/fragments/createGroupChannelListFragment.js.map +1 -1
  60. package/lib/commonjs/fragments/createMessageSearchFragment.js +2 -2
  61. package/lib/commonjs/fragments/createMessageSearchFragment.js.map +1 -1
  62. package/lib/commonjs/fragments/createOpenChannelFragment.js +1 -7
  63. package/lib/commonjs/fragments/createOpenChannelFragment.js.map +1 -1
  64. package/lib/commonjs/fragments/createOpenChannelListFragment.js +2 -1
  65. package/lib/commonjs/fragments/createOpenChannelListFragment.js.map +1 -1
  66. package/lib/commonjs/hooks/useConnection.js +11 -7
  67. package/lib/commonjs/hooks/useConnection.js.map +1 -1
  68. package/lib/commonjs/hooks/useMentionTextInput.js +3 -2
  69. package/lib/commonjs/hooks/useMentionTextInput.js.map +1 -1
  70. package/lib/commonjs/index.js +20 -4
  71. package/lib/commonjs/index.js.map +1 -1
  72. package/lib/commonjs/libs/MentionManager.js +8 -9
  73. package/lib/commonjs/libs/MentionManager.js.map +1 -1
  74. package/lib/commonjs/libs/SBUUtils.js +7 -3
  75. package/lib/commonjs/libs/SBUUtils.js.map +1 -1
  76. package/lib/commonjs/localization/StringSet.type.js.map +1 -1
  77. package/lib/commonjs/localization/createBaseStringSet.js +20 -62
  78. package/lib/commonjs/localization/createBaseStringSet.js.map +1 -1
  79. package/lib/module/components/ChannelInput/AttachmentsButton.js +29 -0
  80. package/lib/module/components/ChannelInput/AttachmentsButton.js.map +1 -0
  81. package/lib/module/components/ChannelInput/EditInput.js +10 -18
  82. package/lib/module/components/ChannelInput/EditInput.js.map +1 -1
  83. package/lib/module/components/ChannelInput/SendInput.js +221 -164
  84. package/lib/module/components/ChannelInput/SendInput.js.map +1 -1
  85. package/lib/module/components/ChannelInput/index.js +5 -3
  86. package/lib/module/components/ChannelInput/index.js.map +1 -1
  87. package/lib/module/components/ChannelMessageList/index.js +28 -28
  88. package/lib/module/components/ChannelMessageList/index.js.map +1 -1
  89. package/lib/module/components/ChatFlatList.js +17 -5
  90. package/lib/module/components/ChatFlatList.js.map +1 -1
  91. package/lib/module/components/{MessageRenderer/MessageDateSeparator.js → GroupChannelMessageRenderer/GroupChannelMessageDateSeparator.js} +3 -3
  92. package/lib/module/components/GroupChannelMessageRenderer/GroupChannelMessageDateSeparator.js.map +1 -0
  93. package/lib/module/components/GroupChannelMessageRenderer/GroupChannelMessageFocusAnimation.js +38 -0
  94. package/lib/module/components/GroupChannelMessageRenderer/GroupChannelMessageFocusAnimation.js.map +1 -0
  95. package/lib/module/components/{MessageRenderer/MessageOutgoingStatus.js → GroupChannelMessageRenderer/GroupChannelMessageOutgoingStatus.js} +12 -15
  96. package/lib/module/components/GroupChannelMessageRenderer/GroupChannelMessageOutgoingStatus.js.map +1 -0
  97. package/lib/module/components/GroupChannelMessageRenderer/index.js +196 -0
  98. package/lib/module/components/GroupChannelMessageRenderer/index.js.map +1 -0
  99. package/lib/module/components/MessageSearchResultItem.js +2 -1
  100. package/lib/module/components/MessageSearchResultItem.js.map +1 -1
  101. package/lib/module/components/OpenChannelMessageRenderer/index.js +16 -10
  102. package/lib/module/components/OpenChannelMessageRenderer/index.js.map +1 -1
  103. package/lib/module/constants.js +0 -5
  104. package/lib/module/constants.js.map +1 -1
  105. package/lib/module/containers/GroupChannelPreviewContainer.js +13 -13
  106. package/lib/module/containers/GroupChannelPreviewContainer.js.map +1 -1
  107. package/lib/module/containers/SendbirdUIKitContainer.js +29 -19
  108. package/lib/module/containers/SendbirdUIKitContainer.js.map +1 -1
  109. package/lib/module/contexts/SendbirdChatCtx.js +17 -14
  110. package/lib/module/contexts/SendbirdChatCtx.js.map +1 -1
  111. package/lib/module/contexts/UserProfileCtx.js +6 -4
  112. package/lib/module/contexts/UserProfileCtx.js.map +1 -1
  113. package/lib/module/domain/groupChannel/component/GroupChannelInput.js +4 -13
  114. package/lib/module/domain/groupChannel/component/GroupChannelInput.js.map +1 -1
  115. package/lib/module/domain/groupChannel/types.js.map +1 -1
  116. package/lib/module/domain/groupChannelList/component/GroupChannelListList.js +9 -4
  117. package/lib/module/domain/groupChannelList/component/GroupChannelListList.js.map +1 -1
  118. package/lib/module/domain/groupChannelList/component/GroupChannelListTypeSelector.js +3 -3
  119. package/lib/module/domain/groupChannelList/component/GroupChannelListTypeSelector.js.map +1 -1
  120. package/lib/module/domain/groupChannelList/types.js.map +1 -1
  121. package/lib/module/domain/groupChannelSettings/component/GroupChannelSettingsMenu.js +11 -10
  122. package/lib/module/domain/groupChannelSettings/component/GroupChannelSettingsMenu.js.map +1 -1
  123. package/lib/module/domain/openChannel/component/OpenChannelInput.js +4 -8
  124. package/lib/module/domain/openChannel/component/OpenChannelInput.js.map +1 -1
  125. package/lib/module/domain/openChannel/types.js.map +1 -1
  126. package/lib/module/domain/openChannelList/component/OpenChannelListList.js +3 -1
  127. package/lib/module/domain/openChannelList/component/OpenChannelListList.js.map +1 -1
  128. package/lib/module/domain/openChannelList/types.js.map +1 -1
  129. package/lib/module/fragments/createGroupChannelCreateFragment.js +1 -1
  130. package/lib/module/fragments/createGroupChannelCreateFragment.js.map +1 -1
  131. package/lib/module/fragments/createGroupChannelFragment.js +24 -102
  132. package/lib/module/fragments/createGroupChannelFragment.js.map +1 -1
  133. package/lib/module/fragments/createGroupChannelInviteFragment.js +1 -1
  134. package/lib/module/fragments/createGroupChannelInviteFragment.js.map +1 -1
  135. package/lib/module/fragments/createGroupChannelListFragment.js +8 -13
  136. package/lib/module/fragments/createGroupChannelListFragment.js.map +1 -1
  137. package/lib/module/fragments/createMessageSearchFragment.js +1 -1
  138. package/lib/module/fragments/createMessageSearchFragment.js.map +1 -1
  139. package/lib/module/fragments/createOpenChannelFragment.js +2 -8
  140. package/lib/module/fragments/createOpenChannelFragment.js.map +1 -1
  141. package/lib/module/fragments/createOpenChannelListFragment.js +2 -1
  142. package/lib/module/fragments/createOpenChannelListFragment.js.map +1 -1
  143. package/lib/module/hooks/useConnection.js +11 -7
  144. package/lib/module/hooks/useConnection.js.map +1 -1
  145. package/lib/module/hooks/useMentionTextInput.js +3 -2
  146. package/lib/module/hooks/useMentionTextInput.js.map +1 -1
  147. package/lib/module/index.js +5 -2
  148. package/lib/module/index.js.map +1 -1
  149. package/lib/module/libs/MentionManager.js +8 -9
  150. package/lib/module/libs/MentionManager.js.map +1 -1
  151. package/lib/module/libs/SBUUtils.js +7 -3
  152. package/lib/module/libs/SBUUtils.js.map +1 -1
  153. package/lib/module/localization/StringSet.type.js.map +1 -1
  154. package/lib/module/localization/createBaseStringSet.js +20 -62
  155. package/lib/module/localization/createBaseStringSet.js.map +1 -1
  156. package/lib/typescript/src/components/ChannelInput/AttachmentsButton.d.ts +6 -0
  157. package/lib/typescript/src/components/ChannelInput/index.d.ts +2 -14
  158. package/lib/typescript/src/components/ChannelMessageList/index.d.ts +2 -4
  159. package/lib/typescript/src/components/ChatFlatList.d.ts +1 -5
  160. package/lib/typescript/src/components/GroupChannelMessageRenderer/GroupChannelMessageDateSeparator.d.ts +6 -0
  161. package/lib/typescript/src/components/GroupChannelMessageRenderer/GroupChannelMessageFocusAnimation.d.ts +5 -0
  162. package/lib/typescript/src/components/{MessageRenderer/MessageOutgoingStatus.d.ts → GroupChannelMessageRenderer/GroupChannelMessageOutgoingStatus.d.ts} +3 -1
  163. package/lib/typescript/src/components/{MessageRenderer → GroupChannelMessageRenderer}/index.d.ts +2 -13
  164. package/lib/typescript/src/components/MessageSearchResultItem.d.ts +2 -1
  165. package/lib/typescript/src/components/OpenChannelMessageRenderer/index.d.ts +1 -1
  166. package/lib/typescript/src/constants.d.ts +0 -5
  167. package/lib/typescript/src/containers/SendbirdUIKitContainer.d.ts +15 -10
  168. package/lib/typescript/src/contexts/SendbirdChatCtx.d.ts +33 -19
  169. package/lib/typescript/src/domain/groupChannel/component/GroupChannelInput.d.ts +1 -1
  170. package/lib/typescript/src/domain/groupChannel/component/GroupChannelMessageList.d.ts +1 -4
  171. package/lib/typescript/src/domain/groupChannel/types.d.ts +2 -9
  172. package/lib/typescript/src/domain/groupChannelList/component/GroupChannelListList.d.ts +1 -1
  173. package/lib/typescript/src/domain/groupChannelList/types.d.ts +8 -23
  174. package/lib/typescript/src/domain/openChannel/component/OpenChannelHeader.d.ts +1 -1
  175. package/lib/typescript/src/domain/openChannel/component/OpenChannelInput.d.ts +1 -1
  176. package/lib/typescript/src/domain/openChannel/component/OpenChannelMessageList.d.ts +1 -1
  177. package/lib/typescript/src/domain/openChannel/types.d.ts +2 -2
  178. package/lib/typescript/src/domain/openChannelList/component/OpenChannelListList.d.ts +1 -1
  179. package/lib/typescript/src/domain/openChannelList/types.d.ts +3 -12
  180. package/lib/typescript/src/index.d.ts +4 -1
  181. package/lib/typescript/src/libs/MentionManager.d.ts +4 -5
  182. package/lib/typescript/src/libs/SBUUtils.d.ts +1 -1
  183. package/lib/typescript/src/localization/StringSet.type.d.ts +2 -43
  184. package/package.json +13 -10
  185. package/src/components/ChannelInput/AttachmentsButton.tsx +32 -0
  186. package/src/components/ChannelInput/EditInput.tsx +17 -18
  187. package/src/components/ChannelInput/SendInput.tsx +237 -181
  188. package/src/components/ChannelInput/index.tsx +8 -21
  189. package/src/components/ChannelMessageList/index.tsx +33 -41
  190. package/src/components/ChatFlatList.tsx +39 -13
  191. package/src/components/{MessageRenderer/MessageDateSeparator.tsx → GroupChannelMessageRenderer/GroupChannelMessageDateSeparator.tsx} +7 -5
  192. package/src/components/GroupChannelMessageRenderer/GroupChannelMessageFocusAnimation.tsx +29 -0
  193. package/src/components/{MessageRenderer/MessageOutgoingStatus.tsx → GroupChannelMessageRenderer/GroupChannelMessageOutgoingStatus.tsx} +15 -15
  194. package/src/components/GroupChannelMessageRenderer/index.tsx +203 -0
  195. package/src/components/MessageSearchResultItem.tsx +3 -1
  196. package/src/components/OpenChannelMessageRenderer/index.tsx +10 -5
  197. package/src/constants.ts +0 -5
  198. package/src/containers/GroupChannelPreviewContainer.tsx +14 -13
  199. package/src/containers/SendbirdUIKitContainer.tsx +98 -90
  200. package/src/contexts/SendbirdChatCtx.tsx +49 -36
  201. package/src/contexts/UserProfileCtx.tsx +10 -5
  202. package/src/domain/groupChannel/component/GroupChannelInput.tsx +1 -10
  203. package/src/domain/groupChannel/types.ts +1 -14
  204. package/src/domain/groupChannelList/component/GroupChannelListList.tsx +8 -4
  205. package/src/domain/groupChannelList/component/GroupChannelListTypeSelector.tsx +3 -3
  206. package/src/domain/groupChannelList/types.ts +8 -30
  207. package/src/domain/groupChannelSettings/component/GroupChannelSettingsMenu.tsx +22 -10
  208. package/src/domain/openChannel/component/OpenChannelInput.tsx +1 -5
  209. package/src/domain/openChannel/types.ts +1 -1
  210. package/src/domain/openChannelList/component/OpenChannelListList.tsx +2 -1
  211. package/src/domain/openChannelList/types.ts +6 -13
  212. package/src/fragments/createGroupChannelCreateFragment.tsx +1 -1
  213. package/src/fragments/createGroupChannelFragment.tsx +21 -97
  214. package/src/fragments/createGroupChannelInviteFragment.tsx +1 -1
  215. package/src/fragments/createGroupChannelListFragment.tsx +9 -15
  216. package/src/fragments/createMessageSearchFragment.tsx +1 -1
  217. package/src/fragments/createOpenChannelFragment.tsx +2 -3
  218. package/src/fragments/createOpenChannelListFragment.tsx +2 -1
  219. package/src/hooks/useConnection.ts +9 -7
  220. package/src/hooks/useMentionTextInput.ts +7 -2
  221. package/src/index.ts +4 -2
  222. package/src/libs/MentionManager.tsx +8 -7
  223. package/src/libs/SBUUtils.ts +7 -3
  224. package/src/localization/StringSet.type.ts +2 -46
  225. package/src/localization/createBaseStringSet.ts +19 -71
  226. package/src/version.ts +1 -1
  227. package/lib/commonjs/components/MessageRenderer/AdminMessage/index.js +0 -46
  228. package/lib/commonjs/components/MessageRenderer/AdminMessage/index.js.map +0 -1
  229. package/lib/commonjs/components/MessageRenderer/FileMessage/BaseFileMessage.js +0 -73
  230. package/lib/commonjs/components/MessageRenderer/FileMessage/BaseFileMessage.js.map +0 -1
  231. package/lib/commonjs/components/MessageRenderer/FileMessage/ImageFileMessage.js +0 -93
  232. package/lib/commonjs/components/MessageRenderer/FileMessage/ImageFileMessage.js.map +0 -1
  233. package/lib/commonjs/components/MessageRenderer/FileMessage/VideoFileMessage.js +0 -132
  234. package/lib/commonjs/components/MessageRenderer/FileMessage/VideoFileMessage.js.map +0 -1
  235. package/lib/commonjs/components/MessageRenderer/FileMessage/index.js +0 -24
  236. package/lib/commonjs/components/MessageRenderer/FileMessage/index.js.map +0 -1
  237. package/lib/commonjs/components/MessageRenderer/MessageContainer.js +0 -27
  238. package/lib/commonjs/components/MessageRenderer/MessageContainer.js.map +0 -1
  239. package/lib/commonjs/components/MessageRenderer/MessageDateSeparator.js.map +0 -1
  240. package/lib/commonjs/components/MessageRenderer/MessageIncomingAvatar.js +0 -41
  241. package/lib/commonjs/components/MessageRenderer/MessageIncomingAvatar.js.map +0 -1
  242. package/lib/commonjs/components/MessageRenderer/MessageIncomingSenderName.js +0 -41
  243. package/lib/commonjs/components/MessageRenderer/MessageIncomingSenderName.js.map +0 -1
  244. package/lib/commonjs/components/MessageRenderer/MessageOutgoingStatus.js.map +0 -1
  245. package/lib/commonjs/components/MessageRenderer/MessageTime.js.map +0 -1
  246. package/lib/commonjs/components/MessageRenderer/UnknownMessage/index.js +0 -46
  247. package/lib/commonjs/components/MessageRenderer/UnknownMessage/index.js.map +0 -1
  248. package/lib/commonjs/components/MessageRenderer/UserMessage/BaseUserMessage.js +0 -113
  249. package/lib/commonjs/components/MessageRenderer/UserMessage/BaseUserMessage.js.map +0 -1
  250. package/lib/commonjs/components/MessageRenderer/UserMessage/OpenGraphUserMessage.js +0 -200
  251. package/lib/commonjs/components/MessageRenderer/UserMessage/OpenGraphUserMessage.js.map +0 -1
  252. package/lib/commonjs/components/MessageRenderer/UserMessage/index.js +0 -22
  253. package/lib/commonjs/components/MessageRenderer/UserMessage/index.js.map +0 -1
  254. package/lib/commonjs/components/MessageRenderer/index.js +0 -186
  255. package/lib/commonjs/components/MessageRenderer/index.js.map +0 -1
  256. package/lib/module/components/MessageRenderer/AdminMessage/index.js +0 -38
  257. package/lib/module/components/MessageRenderer/AdminMessage/index.js.map +0 -1
  258. package/lib/module/components/MessageRenderer/FileMessage/BaseFileMessage.js +0 -65
  259. package/lib/module/components/MessageRenderer/FileMessage/BaseFileMessage.js.map +0 -1
  260. package/lib/module/components/MessageRenderer/FileMessage/ImageFileMessage.js +0 -84
  261. package/lib/module/components/MessageRenderer/FileMessage/ImageFileMessage.js.map +0 -1
  262. package/lib/module/components/MessageRenderer/FileMessage/VideoFileMessage.js +0 -123
  263. package/lib/module/components/MessageRenderer/FileMessage/VideoFileMessage.js.map +0 -1
  264. package/lib/module/components/MessageRenderer/FileMessage/index.js +0 -16
  265. package/lib/module/components/MessageRenderer/FileMessage/index.js.map +0 -1
  266. package/lib/module/components/MessageRenderer/MessageContainer.js +0 -19
  267. package/lib/module/components/MessageRenderer/MessageContainer.js.map +0 -1
  268. package/lib/module/components/MessageRenderer/MessageDateSeparator.js.map +0 -1
  269. package/lib/module/components/MessageRenderer/MessageIncomingAvatar.js +0 -33
  270. package/lib/module/components/MessageRenderer/MessageIncomingAvatar.js.map +0 -1
  271. package/lib/module/components/MessageRenderer/MessageIncomingSenderName.js +0 -33
  272. package/lib/module/components/MessageRenderer/MessageIncomingSenderName.js.map +0 -1
  273. package/lib/module/components/MessageRenderer/MessageOutgoingStatus.js.map +0 -1
  274. package/lib/module/components/MessageRenderer/MessageTime.js +0 -26
  275. package/lib/module/components/MessageRenderer/MessageTime.js.map +0 -1
  276. package/lib/module/components/MessageRenderer/UnknownMessage/index.js +0 -38
  277. package/lib/module/components/MessageRenderer/UnknownMessage/index.js.map +0 -1
  278. package/lib/module/components/MessageRenderer/UserMessage/BaseUserMessage.js +0 -105
  279. package/lib/module/components/MessageRenderer/UserMessage/BaseUserMessage.js.map +0 -1
  280. package/lib/module/components/MessageRenderer/UserMessage/OpenGraphUserMessage.js +0 -190
  281. package/lib/module/components/MessageRenderer/UserMessage/OpenGraphUserMessage.js.map +0 -1
  282. package/lib/module/components/MessageRenderer/UserMessage/index.js +0 -14
  283. package/lib/module/components/MessageRenderer/UserMessage/index.js.map +0 -1
  284. package/lib/module/components/MessageRenderer/index.js +0 -178
  285. package/lib/module/components/MessageRenderer/index.js.map +0 -1
  286. package/lib/typescript/src/components/MessageRenderer/AdminMessage/index.d.ts +0 -5
  287. package/lib/typescript/src/components/MessageRenderer/FileMessage/BaseFileMessage.d.ts +0 -6
  288. package/lib/typescript/src/components/MessageRenderer/FileMessage/ImageFileMessage.d.ts +0 -3
  289. package/lib/typescript/src/components/MessageRenderer/FileMessage/VideoFileMessage.d.ts +0 -3
  290. package/lib/typescript/src/components/MessageRenderer/FileMessage/index.d.ts +0 -15
  291. package/lib/typescript/src/components/MessageRenderer/MessageContainer.d.ts +0 -3
  292. package/lib/typescript/src/components/MessageRenderer/MessageDateSeparator.d.ts +0 -7
  293. package/lib/typescript/src/components/MessageRenderer/MessageIncomingAvatar.d.ts +0 -7
  294. package/lib/typescript/src/components/MessageRenderer/MessageIncomingSenderName.d.ts +0 -7
  295. package/lib/typescript/src/components/MessageRenderer/MessageTime.d.ts +0 -9
  296. package/lib/typescript/src/components/MessageRenderer/UnknownMessage/index.d.ts +0 -4
  297. package/lib/typescript/src/components/MessageRenderer/UserMessage/BaseUserMessage.d.ts +0 -3
  298. package/lib/typescript/src/components/MessageRenderer/UserMessage/OpenGraphUserMessage.d.ts +0 -7
  299. package/lib/typescript/src/components/MessageRenderer/UserMessage/index.d.ts +0 -9
  300. package/src/components/MessageRenderer/AdminMessage/index.tsx +0 -40
  301. package/src/components/MessageRenderer/FileMessage/BaseFileMessage.tsx +0 -51
  302. package/src/components/MessageRenderer/FileMessage/ImageFileMessage.tsx +0 -98
  303. package/src/components/MessageRenderer/FileMessage/VideoFileMessage.tsx +0 -113
  304. package/src/components/MessageRenderer/FileMessage/index.tsx +0 -20
  305. package/src/components/MessageRenderer/MessageContainer.tsx +0 -17
  306. package/src/components/MessageRenderer/MessageIncomingAvatar.tsx +0 -34
  307. package/src/components/MessageRenderer/MessageIncomingSenderName.tsx +0 -36
  308. package/src/components/MessageRenderer/MessageTime.tsx +0 -28
  309. package/src/components/MessageRenderer/UnknownMessage/index.tsx +0 -34
  310. package/src/components/MessageRenderer/UserMessage/BaseUserMessage.tsx +0 -102
  311. package/src/components/MessageRenderer/UserMessage/OpenGraphUserMessage.tsx +0 -188
  312. package/src/components/MessageRenderer/UserMessage/index.tsx +0 -24
  313. package/src/components/MessageRenderer/index.tsx +0 -198
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNativeSafeAreaContext","_uikitReactNativeFoundation","_uikitUtils","_LocalizationCtx","_SendbirdChatCtx","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","WARN_onCreateChannel","UserProfileContext","React","createContext","exports","UserProfileProvider","_ref","children","onCreateChannel","onBeforeCreateChannel","PASS","statusBarTranslucent","chatContext","useContext","SendbirdChatContext","localizationContext","LocalizationContext","Error","__DEV__","Logger","warn","bottom","left","right","useSafeAreaInsets","user","setUser","useState","visible","setVisible","hideMessageButton","setHideMessageButton","show","useCallback","options","Boolean","hide","onDismiss","undefined","userProfileButton","useIIFE","isMe","currentUser","userId","onPressMessageButton","_chatContext$currentU","params","getDefaultGroupChannelCreateParams","invitedUserIds","currentUserId","processedParams","channel","sdk","groupChannel","createChannel","createElement","OutlinedButton","onPress","STRINGS","PROFILE_CARD","BUTTON_MESSAGE","Provider","value","Modal","type","onClose","backgroundStyle","styles","modal","ProfileCard","containerStyle","profileCardContainer","paddingLeft","paddingRight","paddingBottom","uri","profileUrl","username","nickname","LABELS","USER_NO_NAME","bodyLabel","BODY_LABEL","body","BODY","button","createStyleSheet","justifyContent","borderTopLeftRadius","borderTopRightRadius"],"sources":["UserProfileCtx.tsx"],"sourcesContent":["import React, { useCallback, useContext, useState } from 'react';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport { Modal, OutlinedButton, ProfileCard, createStyleSheet } from '@sendbird/uikit-react-native-foundation';\nimport type {\n SendbirdGroupChannel,\n SendbirdGroupChannelCreateParams,\n SendbirdMember,\n SendbirdUser,\n} from '@sendbird/uikit-utils';\nimport { Logger, PASS, getDefaultGroupChannelCreateParams, useIIFE } from '@sendbird/uikit-utils';\n\nimport { LocalizationContext } from '../contexts/LocalizationCtx';\nimport { SendbirdChatContext } from '../contexts/SendbirdChatCtx';\n\ntype OnCreateChannel = (channel: SendbirdGroupChannel) => void;\ntype OnBeforeCreateChannel = (\n channelParams: SendbirdGroupChannelCreateParams,\n users: SendbirdUser[] | SendbirdMember[],\n) => SendbirdGroupChannelCreateParams | Promise<SendbirdGroupChannelCreateParams>;\n\ntype ShowOptions = {\n hideMessageButton?: boolean;\n};\n\nexport type UserProfileContextType = {\n show(user: SendbirdUser | SendbirdMember, options?: ShowOptions): void;\n hide(): void;\n};\n\ntype Props = React.PropsWithChildren<{\n onCreateChannel?: OnCreateChannel;\n onBeforeCreateChannel?: OnBeforeCreateChannel;\n statusBarTranslucent?: boolean;\n}>;\n\nlet WARN_onCreateChannel = false;\n\nexport const UserProfileContext = React.createContext<UserProfileContextType | null>(null);\nexport const UserProfileProvider = ({\n children,\n onCreateChannel,\n onBeforeCreateChannel = PASS,\n statusBarTranslucent = true,\n}: Props) => {\n const chatContext = useContext(SendbirdChatContext);\n const localizationContext = useContext(LocalizationContext);\n\n if (!chatContext) throw new Error('SendbirdChatContext is not provided');\n if (!localizationContext) throw new Error('LocalizationContext is not provided');\n\n if (__DEV__ && !WARN_onCreateChannel && !onCreateChannel) {\n Logger.warn(\n 'You should pass `userProfile.onCreateChannel` prop to SendbirdUIKitContainer if want to use message in a user profile',\n );\n WARN_onCreateChannel = true;\n }\n\n const { bottom, left, right } = useSafeAreaInsets();\n\n const [user, setUser] = useState<SendbirdUser | SendbirdMember>();\n const [visible, setVisible] = useState(false);\n const [hideMessageButton, setHideMessageButton] = useState(false);\n\n const show: UserProfileContextType['show'] = useCallback((user, options) => {\n setUser(user);\n setVisible(true);\n setHideMessageButton(Boolean(options?.hideMessageButton));\n }, []);\n\n const hide: UserProfileContextType['hide'] = useCallback(() => {\n setVisible(false);\n }, []);\n\n const onDismiss = () => {\n setUser(undefined);\n setHideMessageButton(false);\n };\n\n const userProfileButton = useIIFE(() => {\n const isMe = chatContext.currentUser && user?.userId === chatContext.currentUser.userId;\n if (isMe) return undefined;\n if (hideMessageButton) return undefined;\n\n const onPressMessageButton = async () => {\n if (user) {\n const params = getDefaultGroupChannelCreateParams({\n invitedUserIds: [user.userId],\n currentUserId: chatContext.currentUser?.userId,\n });\n\n const processedParams = await onBeforeCreateChannel(params, [user]);\n hide();\n const channel = await chatContext.sdk.groupChannel.createChannel(processedParams);\n\n if (onCreateChannel) {\n onCreateChannel(channel);\n } else {\n Logger.warn(\n 'Please set `onCreateChannel` before message to user from profile card, see `userProfile` prop in the `SendbirdUIKitContainer` props',\n );\n }\n }\n };\n\n return (\n <OutlinedButton onPress={onPressMessageButton}>\n {localizationContext.STRINGS.PROFILE_CARD.BUTTON_MESSAGE}\n </OutlinedButton>\n );\n });\n\n return (\n <UserProfileContext.Provider value={{ show, hide }}>\n {children}\n <Modal\n type={'slide'}\n onClose={hide}\n onDismiss={onDismiss}\n visible={visible && Boolean(user)}\n backgroundStyle={styles.modal}\n statusBarTranslucent={statusBarTranslucent}\n >\n {user && (\n <ProfileCard\n containerStyle={[\n styles.profileCardContainer,\n { paddingLeft: left, paddingRight: right, paddingBottom: bottom },\n ]}\n uri={user.profileUrl}\n username={user.nickname || localizationContext.STRINGS.LABELS.USER_NO_NAME}\n bodyLabel={localizationContext.STRINGS.PROFILE_CARD.BODY_LABEL}\n body={localizationContext.STRINGS.PROFILE_CARD.BODY(user)}\n button={userProfileButton}\n />\n )}\n </Modal>\n </UserProfileContext.Provider>\n );\n};\n\nconst styles = createStyleSheet({\n modal: {\n justifyContent: 'flex-end',\n },\n profileCardContainer: {\n borderTopLeftRadius: 8,\n borderTopRightRadius: 8,\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,2BAAA,GAAAD,OAAA;AAEA,IAAAE,2BAAA,GAAAF,OAAA;AAOA,IAAAG,WAAA,GAAAH,OAAA;AAEA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AAAkE,SAAAM,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAR,wBAAAY,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAA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,CAACjF,2BAAA,CAAA+F,WAAW;IACVC,cAAc,EAAE,CACdH,MAAM,CAACI,oBAAoB,EAC3B;MAAEC,WAAW,EAAElD,IAAI;MAAEmD,YAAY,EAAElD,KAAK;MAAEmD,aAAa,EAAErD;IAAO,CAAC,CACjE;IACFsD,GAAG,EAAElD,IAAI,CAACmD,UAAW;IACrBC,QAAQ,EAAEpD,IAAI,CAACqD,QAAQ,IAAI/D,mBAAmB,CAAC2C,OAAO,CAACqB,MAAM,CAACC,YAAa;IAC3EC,SAAS,EAAElE,mBAAmB,CAAC2C,OAAO,CAACC,YAAY,CAACuB,UAAW;IAC/DC,IAAI,EAAEpE,mBAAmB,CAAC2C,OAAO,CAACC,YAAY,CAACyB,IAAI,CAAC3D,IAAI,CAAE;IAC1D4D,MAAM,EAAE9C;EAAkB,EAE7B,CACK,CACoB;AAElC,CAAC;AAACnC,OAAA,CAAAC,mBAAA,GAAAA,mBAAA;AAEF,MAAM8D,MAAM,GAAG,IAAAmB,4CAAgB,EAAC;EAC9BlB,KAAK,EAAE;IACLmB,cAAc,EAAE;EAClB,CAAC;EACDhB,oBAAoB,EAAE;IACpBiB,mBAAmB,EAAE,CAAC;IACtBC,oBAAoB,EAAE;EACxB;AACF,CAAC,CAAC"}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNativeSafeAreaContext","_uikitReactNativeFoundation","_uikitUtils","_LocalizationCtx","_SendbirdChatCtx","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","WARN_onCreateChannel","UserProfileContext","React","createContext","exports","UserProfileProvider","_ref","children","onCreateChannel","onBeforeCreateChannel","PASS","statusBarTranslucent","chatContext","useContext","SendbirdChatContext","localizationContext","LocalizationContext","Error","__DEV__","Logger","warn","bottom","left","right","useSafeAreaInsets","user","setUser","useState","visible","setVisible","hideMessageButton","setHideMessageButton","show","useCallback","options","sbOptions","uikit","common","enableUsingDefaultUserProfile","Boolean","hide","onDismiss","undefined","userProfileButton","useIIFE","isMe","currentUser","userId","onPressMessageButton","_chatContext$currentU","params","getDefaultGroupChannelCreateParams","invitedUserIds","currentUserId","processedParams","channel","sdk","groupChannel","createChannel","createElement","OutlinedButton","onPress","STRINGS","PROFILE_CARD","BUTTON_MESSAGE","Provider","value","Modal","type","onClose","backgroundStyle","styles","modal","ProfileCard","containerStyle","profileCardContainer","paddingLeft","paddingRight","paddingBottom","uri","profileUrl","username","nickname","LABELS","USER_NO_NAME","bodyLabel","BODY_LABEL","body","BODY","button","createStyleSheet","justifyContent","borderTopLeftRadius","borderTopRightRadius"],"sources":["UserProfileCtx.tsx"],"sourcesContent":["import React, { useCallback, useContext, useState } from 'react';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport { Modal, OutlinedButton, ProfileCard, createStyleSheet } from '@sendbird/uikit-react-native-foundation';\nimport type {\n SendbirdGroupChannel,\n SendbirdGroupChannelCreateParams,\n SendbirdMember,\n SendbirdUser,\n} from '@sendbird/uikit-utils';\nimport { Logger, PASS, getDefaultGroupChannelCreateParams, useIIFE } from '@sendbird/uikit-utils';\n\nimport { LocalizationContext } from '../contexts/LocalizationCtx';\nimport { SendbirdChatContext } from '../contexts/SendbirdChatCtx';\n\ntype OnCreateChannel = (channel: SendbirdGroupChannel) => void;\ntype OnBeforeCreateChannel = (\n channelParams: SendbirdGroupChannelCreateParams,\n users: SendbirdUser[] | SendbirdMember[],\n) => SendbirdGroupChannelCreateParams | Promise<SendbirdGroupChannelCreateParams>;\n\ntype ShowOptions = {\n hideMessageButton?: boolean;\n};\n\nexport type UserProfileContextType = {\n show(user: SendbirdUser | SendbirdMember, options?: ShowOptions): void;\n hide(): void;\n};\n\ntype Props = React.PropsWithChildren<{\n onCreateChannel?: OnCreateChannel;\n onBeforeCreateChannel?: OnBeforeCreateChannel;\n statusBarTranslucent?: boolean;\n}>;\n\nlet WARN_onCreateChannel = false;\n\nexport const UserProfileContext = React.createContext<UserProfileContextType | null>(null);\nexport const UserProfileProvider = ({\n children,\n onCreateChannel,\n onBeforeCreateChannel = PASS,\n statusBarTranslucent = true,\n}: Props) => {\n const chatContext = useContext(SendbirdChatContext);\n const localizationContext = useContext(LocalizationContext);\n\n if (!chatContext) throw new Error('SendbirdChatContext is not provided');\n if (!localizationContext) throw new Error('LocalizationContext is not provided');\n\n if (__DEV__ && !WARN_onCreateChannel && !onCreateChannel) {\n Logger.warn(\n 'You should pass `userProfile.onCreateChannel` prop to SendbirdUIKitContainer if want to use message in a user profile',\n );\n WARN_onCreateChannel = true;\n }\n\n const { bottom, left, right } = useSafeAreaInsets();\n\n const [user, setUser] = useState<SendbirdUser | SendbirdMember>();\n const [visible, setVisible] = useState(false);\n const [hideMessageButton, setHideMessageButton] = useState(false);\n\n const show: UserProfileContextType['show'] = useCallback(\n (user, options) => {\n if (chatContext.sbOptions.uikit.common.enableUsingDefaultUserProfile) {\n setUser(user);\n setVisible(true);\n setHideMessageButton(Boolean(options?.hideMessageButton));\n }\n },\n [chatContext.sbOptions.uikit.common.enableUsingDefaultUserProfile],\n );\n\n const hide: UserProfileContextType['hide'] = useCallback(() => {\n setVisible(false);\n }, []);\n\n const onDismiss = () => {\n setUser(undefined);\n setHideMessageButton(false);\n };\n\n const userProfileButton = useIIFE(() => {\n const isMe = chatContext.currentUser && user?.userId === chatContext.currentUser.userId;\n if (isMe) return undefined;\n if (hideMessageButton) return undefined;\n\n const onPressMessageButton = async () => {\n if (user) {\n const params = getDefaultGroupChannelCreateParams({\n invitedUserIds: [user.userId],\n currentUserId: chatContext.currentUser?.userId,\n });\n\n const processedParams = await onBeforeCreateChannel(params, [user]);\n hide();\n const channel = await chatContext.sdk.groupChannel.createChannel(processedParams);\n\n if (onCreateChannel) {\n onCreateChannel(channel);\n } else {\n Logger.warn(\n 'Please set `onCreateChannel` before message to user from profile card, see `userProfile` prop in the `SendbirdUIKitContainer` props',\n );\n }\n }\n };\n\n return (\n <OutlinedButton onPress={onPressMessageButton}>\n {localizationContext.STRINGS.PROFILE_CARD.BUTTON_MESSAGE}\n </OutlinedButton>\n );\n });\n\n return (\n <UserProfileContext.Provider value={{ show, hide }}>\n {children}\n <Modal\n type={'slide'}\n onClose={hide}\n onDismiss={onDismiss}\n visible={visible && Boolean(user)}\n backgroundStyle={styles.modal}\n statusBarTranslucent={statusBarTranslucent}\n >\n {user && (\n <ProfileCard\n containerStyle={[\n styles.profileCardContainer,\n { paddingLeft: left, paddingRight: right, paddingBottom: bottom },\n ]}\n uri={user.profileUrl}\n username={user.nickname || localizationContext.STRINGS.LABELS.USER_NO_NAME}\n bodyLabel={localizationContext.STRINGS.PROFILE_CARD.BODY_LABEL}\n body={localizationContext.STRINGS.PROFILE_CARD.BODY(user)}\n button={userProfileButton}\n />\n )}\n </Modal>\n </UserProfileContext.Provider>\n );\n};\n\nconst styles = createStyleSheet({\n modal: {\n justifyContent: 'flex-end',\n },\n profileCardContainer: {\n borderTopLeftRadius: 8,\n borderTopRightRadius: 8,\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,2BAAA,GAAAD,OAAA;AAEA,IAAAE,2BAAA,GAAAF,OAAA;AAOA,IAAAG,WAAA,GAAAH,OAAA;AAEA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AAAkE,SAAAM,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAR,wBAAAY,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,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IAAI;MAAEQ;IAAK;EAAE,GAChDjC,QAAQ,eACTrC,MAAA,CAAAe,OAAA,CAAA0E,aAAA,CAACrF,2BAAA,CAAA6F,KAAK;IACJC,IAAI,EAAE,OAAQ;IACdC,OAAO,EAAE7B,IAAK;IACdC,SAAS,EAAEA,SAAU;IACrBb,OAAO,EAAEA,OAAO,IAAIW,OAAO,CAACd,IAAI,CAAE;IAClC6C,eAAe,EAAEC,MAAM,CAACC,KAAM;IAC9B7D,oBAAoB,EAAEA;EAAqB,GAE1Cc,IAAI,iBACHvD,MAAA,CAAAe,OAAA,CAAA0E,aAAA,CAACrF,2BAAA,CAAAmG,WAAW;IACVC,cAAc,EAAE,CACdH,MAAM,CAACI,oBAAoB,EAC3B;MAAEC,WAAW,EAAEtD,IAAI;MAAEuD,YAAY,EAAEtD,KAAK;MAAEuD,aAAa,EAAEzD;IAAO,CAAC,CACjE;IACF0D,GAAG,EAAEtD,IAAI,CAACuD,UAAW;IACrBC,QAAQ,EAAExD,IAAI,CAACyD,QAAQ,IAAInE,mBAAmB,CAAC+C,OAAO,CAACqB,MAAM,CAACC,YAAa;IAC3EC,SAAS,EAAEtE,mBAAmB,CAAC+C,OAAO,CAACC,YAAY,CAACuB,UAAW;IAC/DC,IAAI,EAAExE,mBAAmB,CAAC+C,OAAO,CAACC,YAAY,CAACyB,IAAI,CAAC/D,IAAI,CAAE;IAC1DgE,MAAM,EAAE9C;EAAkB,EAE7B,CACK,CACoB;AAElC,CAAC;AAACvC,OAAA,CAAAC,mBAAA,GAAAA,mBAAA;AAEF,MAAMkE,MAAM,GAAG,IAAAmB,4CAAgB,EAAC;EAC9BlB,KAAK,EAAE;IACLmB,cAAc,EAAE;EAClB,CAAC;EACDhB,oBAAoB,EAAE;IACpBiB,mBAAmB,EAAE,CAAC;IACtBC,oBAAoB,EAAE;EACxB;AACF,CAAC,CAAC"}
@@ -11,6 +11,7 @@ var _moduleContext = require("../module/moduleContext");
11
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
12
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
13
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
14
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
14
15
  const GroupChannelInput = props => {
15
16
  const {
16
17
  channel,
@@ -19,25 +20,15 @@ const GroupChannelInput = props => {
19
20
  keyboardAvoidOffset = 0
20
21
  } = (0, _react.useContext)(_moduleContext.GroupChannelContexts.Fragment);
21
22
  const chatAvailableState = (0, _uikitUtils.getGroupChannelChatAvailableState)(channel);
22
- return /*#__PURE__*/_react.default.createElement(_ChannelInput.default, {
23
+ return /*#__PURE__*/_react.default.createElement(_ChannelInput.default, _extends({
23
24
  channel: channel,
24
25
  messageToEdit: messageToEdit,
25
26
  setMessageToEdit: setMessageToEdit,
26
27
  inputMuted: chatAvailableState.muted,
27
28
  inputFrozen: chatAvailableState.frozen,
28
29
  inputDisabled: chatAvailableState.disabled,
29
- keyboardAvoidOffset: keyboardAvoidOffset,
30
- shouldRenderInput: props.shouldRenderInput,
31
- onPressSendUserMessage: props.onPressSendUserMessage,
32
- onPressSendFileMessage: props.onPressSendFileMessage,
33
- onPressUpdateUserMessage: props.onPressUpdateUserMessage,
34
- onPressUpdateFileMessage: props.onPressUpdateFileMessage,
35
- SuggestedMentionList: props.SuggestedMentionList,
36
- onSendFileMessage: props.onSendFileMessage,
37
- onSendUserMessage: props.onSendUserMessage,
38
- onUpdateFileMessage: props.onUpdateFileMessage,
39
- onUpdateUserMessage: props.onUpdateUserMessage
40
- });
30
+ keyboardAvoidOffset: keyboardAvoidOffset
31
+ }, props));
41
32
  };
42
33
  var _default = /*#__PURE__*/_react.default.memo(GroupChannelInput);
43
34
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_uikitUtils","_ChannelInput","_interopRequireDefault","_moduleContext","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","GroupChannelInput","props","channel","messageToEdit","setMessageToEdit","keyboardAvoidOffset","useContext","GroupChannelContexts","Fragment","chatAvailableState","getGroupChannelChatAvailableState","createElement","inputMuted","muted","inputFrozen","frozen","inputDisabled","disabled","shouldRenderInput","onPressSendUserMessage","onPressSendFileMessage","onPressUpdateUserMessage","onPressUpdateFileMessage","SuggestedMentionList","onSendFileMessage","onSendUserMessage","onUpdateFileMessage","onUpdateUserMessage","_default","React","memo","exports"],"sources":["GroupChannelInput.tsx"],"sourcesContent":["import React, { useContext } from 'react';\n\nimport { getGroupChannelChatAvailableState } from '@sendbird/uikit-utils';\n\nimport ChannelInput from '../../../components/ChannelInput';\nimport { GroupChannelContexts } from '../module/moduleContext';\nimport type { GroupChannelProps } from '../types';\n\nconst GroupChannelInput = (props: GroupChannelProps['Input']) => {\n const {\n channel,\n messageToEdit,\n setMessageToEdit,\n keyboardAvoidOffset = 0,\n } = useContext(GroupChannelContexts.Fragment);\n\n const chatAvailableState = getGroupChannelChatAvailableState(channel);\n\n return (\n <ChannelInput\n channel={channel}\n messageToEdit={messageToEdit}\n setMessageToEdit={setMessageToEdit}\n inputMuted={chatAvailableState.muted}\n inputFrozen={chatAvailableState.frozen}\n inputDisabled={chatAvailableState.disabled}\n keyboardAvoidOffset={keyboardAvoidOffset}\n shouldRenderInput={props.shouldRenderInput}\n onPressSendUserMessage={props.onPressSendUserMessage}\n onPressSendFileMessage={props.onPressSendFileMessage}\n onPressUpdateUserMessage={props.onPressUpdateUserMessage}\n onPressUpdateFileMessage={props.onPressUpdateFileMessage}\n SuggestedMentionList={props.SuggestedMentionList}\n onSendFileMessage={props.onSendFileMessage}\n onSendUserMessage={props.onSendUserMessage}\n onUpdateFileMessage={props.onUpdateFileMessage}\n onUpdateUserMessage={props.onUpdateUserMessage}\n />\n );\n};\n\nexport default React.memo(GroupChannelInput);\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,aAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AAA+D,SAAAG,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAV,wBAAAM,GAAA,EAAAI,WAAA,SAAAA,WAAA,IAAAJ,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAA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AkB,CAACI,KAAM;IACrCC,WAAW,EAAEL,kBAAkB,CAACM,MAAO;IACvCC,aAAa,EAAEP,kBAAkB,CAACQ,QAAS;IAC3CZ,mBAAmB,EAAEA,mBAAoB;IACzCa,iBAAiB,EAAEjB,KAAK,CAACiB,iBAAkB;IAC3CC,sBAAsB,EAAElB,KAAK,CAACkB,sBAAuB;IACrDC,sBAAsB,EAAEnB,KAAK,CAACmB,sBAAuB;IACrDC,wBAAwB,EAAEpB,KAAK,CAACoB,wBAAyB;IACzDC,wBAAwB,EAAErB,KAAK,CAACqB,wBAAyB;IACzDC,oBAAoB,EAAEtB,KAAK,CAACsB,oBAAqB;IACjDC,iBAAiB,EAAEvB,KAAK,CAACuB,iBAAkB;IAC3CC,iBAAiB,EAAExB,KAAK,CAACwB,iBAAkB;IAC3CC,mBAAmB,EAAEzB,KAAK,CAACyB,mBAAoB;IAC/CC,mBAAmB,EAAE1B,KAAK,CAAC0B;EAAoB,EAC/C;AAEN,CAAC;AAAC,IAAAC,QAAA,gBAEaC,cAAK,CAACC,IAAI,CAAC9B,iBAAiB,CAAC;AAAA+B,OAAA,CAAAnD,OAAA,GAAAgD,QAAA"}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_uikitUtils","_ChannelInput","_interopRequireDefault","_moduleContext","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","GroupChannelInput","props","channel","messageToEdit","setMessageToEdit","keyboardAvoidOffset","useContext","GroupChannelContexts","Fragment","chatAvailableState","getGroupChannelChatAvailableState","createElement","inputMuted","muted","inputFrozen","frozen","inputDisabled","disabled","_default","React","memo","exports"],"sources":["GroupChannelInput.tsx"],"sourcesContent":["import React, { useContext } from 'react';\n\nimport { getGroupChannelChatAvailableState } from '@sendbird/uikit-utils';\n\nimport ChannelInput from '../../../components/ChannelInput';\nimport { GroupChannelContexts } from '../module/moduleContext';\nimport type { GroupChannelProps } from '../types';\n\nconst GroupChannelInput = (props: GroupChannelProps['Input']) => {\n const {\n channel,\n messageToEdit,\n setMessageToEdit,\n keyboardAvoidOffset = 0,\n } = useContext(GroupChannelContexts.Fragment);\n\n const chatAvailableState = getGroupChannelChatAvailableState(channel);\n\n return (\n <ChannelInput\n channel={channel}\n messageToEdit={messageToEdit}\n setMessageToEdit={setMessageToEdit}\n inputMuted={chatAvailableState.muted}\n inputFrozen={chatAvailableState.frozen}\n inputDisabled={chatAvailableState.disabled}\n keyboardAvoidOffset={keyboardAvoidOffset}\n {...props}\n />\n );\n};\n\nexport default React.memo(GroupChannelInput);\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,aAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AAA+D,SAAAG,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAV,wBAAAM,GAAA,EAAAI,WAAA,SAAAA,WAAA,IAAAJ,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAQ,KAAA,GAAAL,wBAAA,CAAAC,WAAA,OAAAI,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAT,GAAA,YAAAQ,KAAA,CAAAE,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;EAE7C,MAAMC,kBAAkB,GAAG,IAAAC,6CAAiC,EAACR,OAAO,CAAC;EAErE,oBACExC,MAAA,CAAAS,OAAA,CAAAwC,aAAA,CAAC7C,aAAA,CAAAK,OAAY,EAAAoB,QAAA;IACXW,OAAO,EAAEA,OAAQ;IACjBC,aAAa,EAAEA,aAAc;IAC7BC,gBAAgB,EAAEA,gBAAiB;IACnCQ,UAAU,EAAEH,kBAAkB,CAACI,KAAM;IACrCC,WAAW,EAAEL,kBAAkB,CAACM,MAAO;IACvCC,aAAa,EAAEP,kBAAkB,CAACQ,QAAS;IAC3CZ,mBAAmB,EAAEA;EAAoB,GACrCJ,KAAK,EACT;AAEN,CAAC;AAAC,IAAAiB,QAAA,gBAEaC,cAAK,CAACC,IAAI,CAACpB,iBAAiB,CAAC;AAAAqB,OAAA,CAAAlD,OAAA,GAAA+C,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type React from 'react';\n\nimport type { UseGroupChannelMessagesOptions } from '@sendbird/uikit-chat-hooks';\nimport type {\n OnBeforeHandler,\n SendbirdFileMessage,\n SendbirdFileMessageCreateParams,\n SendbirdFileMessageUpdateParams,\n SendbirdGroupChannel,\n SendbirdMessage,\n SendbirdUser,\n SendbirdUserMessage,\n SendbirdUserMessageCreateParams,\n SendbirdUserMessageUpdateParams,\n} from '@sendbird/uikit-utils';\n\nimport type { ChannelInputProps, SuggestedMentionListProps } from '../../components/ChannelInput';\nimport type { ChannelMessageListProps } from '../../components/ChannelMessageList';\nimport type { CommonComponent } from '../../types';\nimport type { PubSub } from '../../utils/pubsub';\n\nexport interface GroupChannelProps {\n Fragment: {\n channel: SendbirdGroupChannel;\n onChannelDeleted: () => void;\n onPressHeaderLeft: GroupChannelProps['Header']['onPressHeaderLeft'];\n onPressHeaderRight: GroupChannelProps['Header']['onPressHeaderRight'];\n onPressMediaMessage?: GroupChannelProps['MessageList']['onPressMediaMessage'];\n\n onBeforeSendUserMessage?: OnBeforeHandler<SendbirdUserMessageCreateParams>;\n onBeforeSendFileMessage?: OnBeforeHandler<SendbirdFileMessageCreateParams>;\n onBeforeUpdateUserMessage?: OnBeforeHandler<SendbirdUserMessageUpdateParams>;\n onBeforeUpdateFileMessage?: OnBeforeHandler<SendbirdFileMessageUpdateParams>;\n\n renderMessage?: GroupChannelProps['MessageList']['renderMessage'];\n renderNewMessagesButton?: GroupChannelProps['MessageList']['renderNewMessagesButton'];\n renderScrollToBottomButton?: GroupChannelProps['MessageList']['renderScrollToBottomButton'];\n\n enableTypingIndicator?: GroupChannelProps['Provider']['enableTypingIndicator'];\n enableMessageGrouping?: GroupChannelProps['MessageList']['enableMessageGrouping'];\n\n keyboardAvoidOffset?: GroupChannelProps['Provider']['keyboardAvoidOffset'];\n flatListProps?: GroupChannelProps['MessageList']['flatListProps'];\n sortComparator?: UseGroupChannelMessagesOptions['sortComparator'];\n collectionCreator?: UseGroupChannelMessagesOptions['collectionCreator'];\n queryCreator?: UseGroupChannelMessagesOptions['queryCreator'];\n\n searchItem?: GroupChannelProps['MessageList']['searchItem'];\n\n /** @deprecated Please use `onPressMediaMessage` instead **/\n onPressImageMessage?: GroupChannelProps['MessageList']['onPressImageMessage'];\n };\n Header: {\n shouldHideRight: () => boolean;\n onPressHeaderLeft: () => void;\n onPressHeaderRight: () => void;\n };\n MessageList: Pick<\n ChannelMessageListProps<SendbirdGroupChannel>,\n | 'enableMessageGrouping'\n | 'currentUserId'\n | 'channel'\n | 'messages'\n | 'newMessages'\n | 'scrolledAwayFromBottom'\n | 'onScrolledAwayFromBottom'\n | 'onTopReached'\n | 'onBottomReached'\n | 'onResendFailedMessage'\n | 'onDeleteMessage'\n | 'onPressMediaMessage'\n | 'renderMessage'\n | 'renderNewMessagesButton'\n | 'renderScrollToBottomButton'\n | 'flatListProps'\n | 'onPressImageMessage'\n | 'hasNext'\n | 'searchItem'\n > & {\n onResetMessageList: (callback?: () => void) => void;\n\n /** @deprecated Please use `newMessages` instead */\n newMessagesFromMembers: SendbirdMessage[];\n /** @deprecated Please use `newMessages` instead */\n nextMessages: SendbirdMessage[];\n };\n Input: Pick<\n ChannelInputProps,\n | 'shouldRenderInput'\n | 'onPressSendUserMessage'\n | 'onPressSendFileMessage'\n | 'onPressUpdateUserMessage'\n | 'onPressUpdateFileMessage'\n | 'SuggestedMentionList'\n | 'onSendFileMessage'\n | 'onSendUserMessage'\n | 'onUpdateFileMessage'\n | 'onUpdateUserMessage'\n >;\n\n SuggestedMentionList: SuggestedMentionListProps;\n Provider: {\n channel: SendbirdGroupChannel;\n enableTypingIndicator: boolean;\n keyboardAvoidOffset?: number;\n groupChannelPubSub: PubSub<GroupChannelPubSubContextPayload>;\n };\n}\n\n/**\n * Internal context for GroupChannel\n * For example, the developer can create a custom header\n * with getting data from the domain context\n * */\nexport interface GroupChannelContextsType {\n Fragment: React.Context<{\n headerTitle: string;\n channel: SendbirdGroupChannel;\n messageToEdit?: SendbirdUserMessage | SendbirdFileMessage;\n setMessageToEdit: (msg?: SendbirdUserMessage | SendbirdFileMessage) => void;\n keyboardAvoidOffset?: number;\n }>;\n TypingIndicator: React.Context<{\n typingUsers: SendbirdUser[];\n }>;\n PubSub: React.Context<PubSub<GroupChannelPubSubContextPayload>>;\n}\nexport interface GroupChannelModule {\n Provider: CommonComponent<GroupChannelProps['Provider']>;\n Header: CommonComponent<GroupChannelProps['Header']>;\n MessageList: CommonComponent<GroupChannelProps['MessageList']>;\n Input: CommonComponent<GroupChannelProps['Input']>;\n SuggestedMentionList: CommonComponent<GroupChannelProps['SuggestedMentionList']>;\n StatusEmpty: CommonComponent;\n StatusLoading: CommonComponent;\n}\n\nexport type GroupChannelFragment = CommonComponent<GroupChannelProps['Fragment']>;\n\nexport type GroupChannelPubSubContextPayload =\n | {\n type: 'MESSAGE_SENT_PENDING' | 'MESSAGE_SENT_SUCCESS';\n data: {\n message: SendbirdUserMessage | SendbirdFileMessage;\n };\n }\n | {\n type: 'MESSAGES_RECEIVED';\n data: {\n messages: SendbirdMessage[];\n };\n };\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type React from 'react';\n\nimport type { UseGroupChannelMessagesOptions } from '@sendbird/uikit-chat-hooks';\nimport type {\n OnBeforeHandler,\n SendbirdFileMessage,\n SendbirdFileMessageCreateParams,\n SendbirdFileMessageUpdateParams,\n SendbirdGroupChannel,\n SendbirdMessage,\n SendbirdUser,\n SendbirdUserMessage,\n SendbirdUserMessageCreateParams,\n SendbirdUserMessageUpdateParams,\n} from '@sendbird/uikit-utils';\n\nimport type { ChannelInputProps, SuggestedMentionListProps } from '../../components/ChannelInput';\nimport type { ChannelMessageListProps } from '../../components/ChannelMessageList';\nimport type { CommonComponent } from '../../types';\nimport type { PubSub } from '../../utils/pubsub';\n\nexport interface GroupChannelProps {\n Fragment: {\n channel: SendbirdGroupChannel;\n onChannelDeleted: () => void;\n onPressHeaderLeft: GroupChannelProps['Header']['onPressHeaderLeft'];\n onPressHeaderRight: GroupChannelProps['Header']['onPressHeaderRight'];\n onPressMediaMessage?: GroupChannelProps['MessageList']['onPressMediaMessage'];\n\n onBeforeSendUserMessage?: OnBeforeHandler<SendbirdUserMessageCreateParams>;\n onBeforeSendFileMessage?: OnBeforeHandler<SendbirdFileMessageCreateParams>;\n onBeforeUpdateUserMessage?: OnBeforeHandler<SendbirdUserMessageUpdateParams>;\n onBeforeUpdateFileMessage?: OnBeforeHandler<SendbirdFileMessageUpdateParams>;\n\n renderMessage?: GroupChannelProps['MessageList']['renderMessage'];\n renderNewMessagesButton?: GroupChannelProps['MessageList']['renderNewMessagesButton'];\n renderScrollToBottomButton?: GroupChannelProps['MessageList']['renderScrollToBottomButton'];\n\n enableTypingIndicator?: GroupChannelProps['Provider']['enableTypingIndicator'];\n enableMessageGrouping?: GroupChannelProps['MessageList']['enableMessageGrouping'];\n\n keyboardAvoidOffset?: GroupChannelProps['Provider']['keyboardAvoidOffset'];\n flatListProps?: GroupChannelProps['MessageList']['flatListProps'];\n sortComparator?: UseGroupChannelMessagesOptions['sortComparator'];\n collectionCreator?: UseGroupChannelMessagesOptions['collectionCreator'];\n\n searchItem?: GroupChannelProps['MessageList']['searchItem'];\n };\n Header: {\n shouldHideRight: () => boolean;\n onPressHeaderLeft: () => void;\n onPressHeaderRight: () => void;\n };\n MessageList: Pick<\n ChannelMessageListProps<SendbirdGroupChannel>,\n | 'enableMessageGrouping'\n | 'currentUserId'\n | 'channel'\n | 'messages'\n | 'newMessages'\n | 'scrolledAwayFromBottom'\n | 'onScrolledAwayFromBottom'\n | 'onTopReached'\n | 'onBottomReached'\n | 'onResendFailedMessage'\n | 'onDeleteMessage'\n | 'onPressMediaMessage'\n | 'renderMessage'\n | 'renderNewMessagesButton'\n | 'renderScrollToBottomButton'\n | 'flatListProps'\n | 'hasNext'\n | 'searchItem'\n > & {\n onResetMessageList: (callback?: () => void) => void;\n };\n Input: Pick<\n ChannelInputProps,\n | 'shouldRenderInput'\n | 'onPressSendUserMessage'\n | 'onPressSendFileMessage'\n | 'onPressUpdateUserMessage'\n | 'onPressUpdateFileMessage'\n | 'SuggestedMentionList'\n | 'AttachmentsButton'\n >;\n\n SuggestedMentionList: SuggestedMentionListProps;\n Provider: {\n channel: SendbirdGroupChannel;\n enableTypingIndicator: boolean;\n keyboardAvoidOffset?: number;\n groupChannelPubSub: PubSub<GroupChannelPubSubContextPayload>;\n };\n}\n\n/**\n * Internal context for GroupChannel\n * For example, the developer can create a custom header\n * with getting data from the domain context\n * */\nexport interface GroupChannelContextsType {\n Fragment: React.Context<{\n headerTitle: string;\n channel: SendbirdGroupChannel;\n messageToEdit?: SendbirdUserMessage | SendbirdFileMessage;\n setMessageToEdit: (msg?: SendbirdUserMessage | SendbirdFileMessage) => void;\n keyboardAvoidOffset?: number;\n }>;\n TypingIndicator: React.Context<{\n typingUsers: SendbirdUser[];\n }>;\n PubSub: React.Context<PubSub<GroupChannelPubSubContextPayload>>;\n}\nexport interface GroupChannelModule {\n Provider: CommonComponent<GroupChannelProps['Provider']>;\n Header: CommonComponent<GroupChannelProps['Header']>;\n MessageList: CommonComponent<GroupChannelProps['MessageList']>;\n Input: CommonComponent<GroupChannelProps['Input']>;\n SuggestedMentionList: CommonComponent<GroupChannelProps['SuggestedMentionList']>;\n StatusEmpty: CommonComponent;\n StatusLoading: CommonComponent;\n}\n\nexport type GroupChannelFragment = CommonComponent<GroupChannelProps['Fragment']>;\n\nexport type GroupChannelPubSubContextPayload =\n | {\n type: 'MESSAGE_SENT_PENDING' | 'MESSAGE_SENT_SUCCESS';\n data: {\n message: SendbirdUserMessage | SendbirdFileMessage;\n };\n }\n | {\n type: 'MESSAGES_RECEIVED';\n data: {\n messages: SendbirdMessage[];\n };\n };\n"],"mappings":""}
@@ -4,18 +4,18 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
7
+ var _react = _interopRequireDefault(require("react"));
8
8
  var _reactNative = require("react-native");
9
9
  var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
10
10
  var _chat = require("@sendbird/chat");
11
11
  var _uikitReactNativeFoundation = require("@sendbird/uikit-react-native-foundation");
12
12
  var _uikitUtils = require("@sendbird/uikit-utils");
13
13
  var _useContext = require("../../../hooks/useContext");
14
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
15
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
17
16
  const GroupChannelListList = _ref => {
18
17
  let {
18
+ onPressChannel,
19
19
  renderGroupChannelPreview,
20
20
  groupChannels,
21
21
  onLoadNext,
@@ -59,12 +59,16 @@ const GroupChannelListList = _ref => {
59
59
  });
60
60
  openMenu(menuItem);
61
61
  });
62
- const renderItem = (0, _react.useCallback)(_ref2 => {
62
+ const renderItem = (0, _uikitUtils.useFreshCallback)(_ref2 => {
63
63
  let {
64
64
  item
65
65
  } = _ref2;
66
- return renderGroupChannelPreview === null || renderGroupChannelPreview === void 0 ? void 0 : renderGroupChannelPreview(item, () => onLongPress(item));
67
- }, [renderGroupChannelPreview, onLongPress]);
66
+ return renderGroupChannelPreview === null || renderGroupChannelPreview === void 0 ? void 0 : renderGroupChannelPreview({
67
+ channel: item,
68
+ onPress: () => onPressChannel(item),
69
+ onLongPress: () => onLongPress(item)
70
+ });
71
+ });
68
72
  const {
69
73
  left,
70
74
  right
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeSafeAreaContext","_chat","_uikitReactNativeFoundation","_uikitUtils","_useContext","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","GroupChannelListList","_ref","renderGroupChannelPreview","groupChannels","onLoadNext","flatListProps","menuItemCreator","PASS","toast","useToast","openMenu","useActionMenu","STRINGS","useLocalization","sdk","currentUser","useSendbirdChat","onLongPress","useFreshCallback","channel","action","myPushTriggerOption","menuItem","title","GROUP_CHANNEL_LIST","DIALOG_CHANNEL_TITLE","userId","menuItems","DIALOG_CHANNEL_NOTIFICATION","onPress","setMyPushTriggerOption","PushTriggerOption","DEFAULT","OFF","onError","show","TOAST","TURN_ON_NOTIFICATIONS_ERROR","TURN_OFF_NOTIFICATIONS_ERROR","DIALOG_CHANNEL_LEAVE","leave","then","clearCachedMessages","url","catch","NOOP","LEAVE_CHANNEL_ERROR","renderItem","useCallback","_ref2","item","left","right","useSafeAreaInsets","createElement","FlatList","bounces","data","onEndReached","contentContainerStyle","paddingLeft","paddingRight","keyExtractor","getChannelUniqId","_default","exports"],"sources":["GroupChannelListList.tsx"],"sourcesContent":["import React, { useCallback } from 'react';\nimport { FlatList, ListRenderItem } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport { PushTriggerOption } from '@sendbird/chat';\nimport { useActionMenu, useToast } from '@sendbird/uikit-react-native-foundation';\nimport { NOOP, PASS, SendbirdGroupChannel, getChannelUniqId, useFreshCallback } from '@sendbird/uikit-utils';\n\nimport { useLocalization, useSendbirdChat } from '../../../hooks/useContext';\nimport type { GroupChannelListProps } from '../types';\n\nconst GroupChannelListList = ({\n renderGroupChannelPreview,\n groupChannels,\n onLoadNext,\n flatListProps,\n menuItemCreator = PASS,\n}: GroupChannelListProps['List']) => {\n const toast = useToast();\n const { openMenu } = useActionMenu();\n const { STRINGS } = useLocalization();\n const { sdk, currentUser } = useSendbirdChat();\n\n const onLongPress = useFreshCallback((channel: SendbirdGroupChannel) => {\n const action = channel.myPushTriggerOption === 'off' ? 'on' : 'off';\n const menuItem = menuItemCreator({\n title: STRINGS.GROUP_CHANNEL_LIST.DIALOG_CHANNEL_TITLE(currentUser?.userId ?? '', channel),\n menuItems: [\n {\n title: STRINGS.GROUP_CHANNEL_LIST.DIALOG_CHANNEL_NOTIFICATION(channel),\n onPress: async () => {\n if (action === 'on') {\n await channel.setMyPushTriggerOption(PushTriggerOption.DEFAULT);\n } else {\n await channel.setMyPushTriggerOption(PushTriggerOption.OFF);\n }\n },\n onError: () => {\n toast.show(\n action === 'on' ? STRINGS.TOAST.TURN_ON_NOTIFICATIONS_ERROR : STRINGS.TOAST.TURN_OFF_NOTIFICATIONS_ERROR,\n 'error',\n );\n },\n },\n {\n title: STRINGS.GROUP_CHANNEL_LIST.DIALOG_CHANNEL_LEAVE,\n onPress: async () => {\n channel.leave().then(() => sdk.clearCachedMessages([channel.url]).catch(NOOP));\n },\n onError: () => toast.show(STRINGS.TOAST.LEAVE_CHANNEL_ERROR, 'error'),\n },\n ],\n });\n\n openMenu(menuItem);\n });\n\n const renderItem: ListRenderItem<SendbirdGroupChannel> = useCallback(\n ({ item }) => renderGroupChannelPreview?.(item, () => onLongPress(item)),\n [renderGroupChannelPreview, onLongPress],\n );\n\n const { left, right } = useSafeAreaInsets();\n return (\n <FlatList\n bounces={false}\n data={groupChannels}\n renderItem={renderItem}\n onEndReached={onLoadNext}\n {...flatListProps}\n contentContainerStyle={[flatListProps?.contentContainerStyle, { paddingLeft: left, paddingRight: right }]}\n keyExtractor={getChannelUniqId}\n />\n );\n};\n\nexport default GroupChannelListList;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,2BAAA,GAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,2BAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAEA,IAAAM,WAAA,GAAAN,OAAA;AAA6E,SAAAO,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAA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AAY,EAAEtD;EAAW,GACrBC,aAAa;IACjBsD,qBAAqB,EAAE,CAACtD,aAAa,aAAbA,aAAa,uBAAbA,aAAa,CAAEsD,qBAAqB,EAAE;MAAEC,WAAW,EAAET,IAAI;MAAEU,YAAY,EAAET;IAAM,CAAC,CAAE;IAC1GU,YAAY,EAAEC;EAAiB,GAC/B;AAEN,CAAC;AAAC,IAAAC,QAAA,GAEahE,oBAAoB;AAAAiE,OAAA,CAAAzF,OAAA,GAAAwF,QAAA"}
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_reactNativeSafeAreaContext","_chat","_uikitReactNativeFoundation","_uikitUtils","_useContext","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","GroupChannelListList","_ref","onPressChannel","renderGroupChannelPreview","groupChannels","onLoadNext","flatListProps","menuItemCreator","PASS","toast","useToast","openMenu","useActionMenu","STRINGS","useLocalization","sdk","currentUser","useSendbirdChat","onLongPress","useFreshCallback","channel","action","myPushTriggerOption","menuItem","title","GROUP_CHANNEL_LIST","DIALOG_CHANNEL_TITLE","userId","menuItems","DIALOG_CHANNEL_NOTIFICATION","onPress","setMyPushTriggerOption","PushTriggerOption","DEFAULT","OFF","onError","show","TOAST","TURN_ON_NOTIFICATIONS_ERROR","TURN_OFF_NOTIFICATIONS_ERROR","DIALOG_CHANNEL_LEAVE","leave","then","clearCachedMessages","url","catch","NOOP","LEAVE_CHANNEL_ERROR","renderItem","_ref2","item","left","right","useSafeAreaInsets","createElement","FlatList","bounces","data","onEndReached","contentContainerStyle","paddingLeft","paddingRight","keyExtractor","getChannelUniqId","_default","exports"],"sources":["GroupChannelListList.tsx"],"sourcesContent":["import React from 'react';\nimport { FlatList, ListRenderItem } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport { PushTriggerOption } from '@sendbird/chat';\nimport { useActionMenu, useToast } from '@sendbird/uikit-react-native-foundation';\nimport { NOOP, PASS, SendbirdGroupChannel, getChannelUniqId, useFreshCallback } from '@sendbird/uikit-utils';\n\nimport { useLocalization, useSendbirdChat } from '../../../hooks/useContext';\nimport type { GroupChannelListProps } from '../types';\n\nconst GroupChannelListList = ({\n onPressChannel,\n renderGroupChannelPreview,\n groupChannels,\n onLoadNext,\n flatListProps,\n menuItemCreator = PASS,\n}: GroupChannelListProps['List']) => {\n const toast = useToast();\n const { openMenu } = useActionMenu();\n const { STRINGS } = useLocalization();\n const { sdk, currentUser } = useSendbirdChat();\n\n const onLongPress = useFreshCallback((channel: SendbirdGroupChannel) => {\n const action = channel.myPushTriggerOption === 'off' ? 'on' : 'off';\n const menuItem = menuItemCreator({\n title: STRINGS.GROUP_CHANNEL_LIST.DIALOG_CHANNEL_TITLE(currentUser?.userId ?? '', channel),\n menuItems: [\n {\n title: STRINGS.GROUP_CHANNEL_LIST.DIALOG_CHANNEL_NOTIFICATION(channel),\n onPress: async () => {\n if (action === 'on') {\n await channel.setMyPushTriggerOption(PushTriggerOption.DEFAULT);\n } else {\n await channel.setMyPushTriggerOption(PushTriggerOption.OFF);\n }\n },\n onError: () => {\n toast.show(\n action === 'on' ? STRINGS.TOAST.TURN_ON_NOTIFICATIONS_ERROR : STRINGS.TOAST.TURN_OFF_NOTIFICATIONS_ERROR,\n 'error',\n );\n },\n },\n {\n title: STRINGS.GROUP_CHANNEL_LIST.DIALOG_CHANNEL_LEAVE,\n onPress: async () => {\n channel.leave().then(() => sdk.clearCachedMessages([channel.url]).catch(NOOP));\n },\n onError: () => toast.show(STRINGS.TOAST.LEAVE_CHANNEL_ERROR, 'error'),\n },\n ],\n });\n\n openMenu(menuItem);\n });\n\n const renderItem: ListRenderItem<SendbirdGroupChannel> = useFreshCallback(({ item }) =>\n renderGroupChannelPreview?.({\n channel: item,\n onPress: () => onPressChannel(item),\n onLongPress: () => onLongPress(item),\n }),\n );\n\n const { left, right } = useSafeAreaInsets();\n return (\n <FlatList\n bounces={false}\n data={groupChannels}\n renderItem={renderItem}\n onEndReached={onLoadNext}\n {...flatListProps}\n contentContainerStyle={[flatListProps?.contentContainerStyle, { paddingLeft: left, paddingRight: right }]}\n keyExtractor={getChannelUniqId}\n />\n );\n};\n\nexport default GroupChannelListList;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,2BAAA,GAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,2BAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAEA,IAAAM,WAAA,GAAAN,OAAA;AAA6E,SAAAD,uBAAAQ,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,SAAA,IAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,GAAAF,SAAA,CAAAD,CAAA,YAAAI,GAAA,IAAAD,MAAA,QAAAP,MAAA,CAAAS,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAJ,MAAA,EAAAC,GAAA,KAAAL,MAAA,CAAAK,GAAA,IAAAD,MAAA,CAAAC,GAAA,gBAAAL,MAAA,YAAAJ,QAAA,CAAAa,KAAA,OAAAP,SAAA;AAG7E,MAAMQ,oBAAoB,GAAGC,IAAA,IAOQ;EAAA,IAPP;IAC5BC,cAAc;IACdC,yBAAyB;IACzBC,aAAa;IACbC,UAAU;IACVC,aAAa;IACbC,eAAe,GAAGC;EACW,CAAC,GAAAP,IAAA;EAC9B,MAAMQ,KAAK,GAAG,IAAAC,oCAAQ,GAAE;EACxB,MAAM;IAAEC;EAAS,CAAC,GAAG,IAAAC,yCAAa,GAAE;EACpC,MAAM;IAAEC;EA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I,CAAC,CAAC;QAChF,CAAC;QACDX,OAAO,EAAEA,CAAA,KAAM1B,KAAK,CAAC2B,IAAI,CAACvB,OAAO,CAACwB,KAAK,CAACU,mBAAmB,EAAE,OAAO;MACtE,CAAC;IAEL,CAAC,CAAC;IAEFpC,QAAQ,CAACY,QAAQ,CAAC;EACpB,CAAC,CAAC;EAEF,MAAMyB,UAAgD,GAAG,IAAA7B,4BAAgB,EAAC8B,KAAA;IAAA,IAAC;MAAEC;IAAK,CAAC,GAAAD,KAAA;IAAA,OACjF9C,yBAAyB,aAAzBA,yBAAyB,uBAAzBA,yBAAyB,CAAG;MAC1BiB,OAAO,EAAE8B,IAAI;MACbpB,OAAO,EAAEA,CAAA,KAAM5B,cAAc,CAACgD,IAAI,CAAC;MACnChC,WAAW,EAAEA,CAAA,KAAMA,WAAW,CAACgC,IAAI;IACrC,CAAC,CAAC;EAAA,EACH;EAED,MAAM;IAAEC,IAAI;IAAEC;EAAM,CAAC,GAAG,IAAAC,6CAAiB,GAAE;EAC3C,oBACE/E,MAAA,CAAAW,OAAA,CAAAqE,aAAA,CAAC7E,YAAA,CAAA8E,QAAQ,EAAArE,QAAA;IACPsE,OAAO,EAAE,KAAM;IACfC,IAAI,EAAErD,aAAc;IACpB4C,UAAU,EAAEA,UAAW;IACvBU,YAAY,EAAErD;EAAW,GACrBC,aAAa;IACjBqD,qBAAqB,EAAE,CAACrD,aAAa,aAAbA,aAAa,uBAAbA,aAAa,CAAEqD,qBAAqB,EAAE;MAAEC,WAAW,EAAET,IAAI;MAAEU,YAAY,EAAET;IAAM,CAAC,CAAE;IAC1GU,YAAY,EAAEC;EAAiB,GAC/B;AAEN,CAAC;AAAC,IAAAC,QAAA,GAEahE,oBAAoB;AAAAiE,OAAA,CAAAhF,OAAA,GAAA+E,QAAA"}
@@ -34,7 +34,7 @@ const GroupChannelListTypeSelector = _ref => {
34
34
  colors
35
35
  } = (0, _uikitReactNativeFoundation.useUIKitTheme)();
36
36
  const {
37
- features
37
+ sbOptions
38
38
  } = (0, _useContext.useSendbirdChat)();
39
39
  const typeSelector = (0, _react.useContext)(_moduleContext.GroupChannelListContexts.TypeSelector);
40
40
  const {
@@ -64,10 +64,10 @@ const GroupChannelListTypeSelector = _ref => {
64
64
  }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
65
65
  style: styles.buttonArea
66
66
  }, TYPES.map(type => {
67
- if (type === 'SUPER_GROUP' && !features.superGroupChannelEnabled) {
67
+ if (type === 'SUPER_GROUP' && !sbOptions.appInfo.superGroupChannelEnabled) {
68
68
  return null;
69
69
  }
70
- if (type === 'BROADCAST' && !features.broadcastChannelEnabled) {
70
+ if (type === 'BROADCAST' && !sbOptions.appInfo.broadcastChannelEnabled) {
71
71
  return null;
72
72
  }
73
73
  return /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_uikitReactNativeFoundation","_useContext","_moduleContext","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","TYPES","TYPE_ICONS","STATUS_BAR_TOP_INSET_AS","Platform","select","android","GroupChannelListTypeSelector","_ref","skipTypeSelection","onSelectType","statusBarTranslucent","HeaderComponent","useHeaderStyle","colors","useUIKitTheme","features","useSendbirdChat","typeSelector","useContext","GroupChannelListContexts","TypeSelector","visible","hide","createOnPressType","type","useEffect","createElement","Modal","onClose","title","headerTitle","right","Icon","icon","color","onBackground01","onPressRight","statusBarTopInsetAs","View","style","styles","buttonArea","map","superGroupChannelEnabled","broadcastChannelEnabled","TouchableOpacity","activeOpacity","onPress","typeButton","DefaultTypeIcon","DefaultTypeText","_ref2","size","containerStyle","_ref3","STRINGS","useLocalization","Text","caption2","GROUP_CHANNEL_LIST","createStyleSheet","flexDirection","paddingVertical","flex","alignItems","justifyContent","marginBottom","_default","exports"],"sources":["GroupChannelListTypeSelector.tsx"],"sourcesContent":["import React, { useContext, useEffect } from 'react';\nimport { Platform, TouchableOpacity, View } from 'react-native';\n\nimport {\n Icon,\n Modal,\n Text,\n createStyleSheet,\n useHeaderStyle,\n useUIKitTheme,\n} from '@sendbird/uikit-react-native-foundation';\n\nimport { useLocalization, useSendbirdChat } from '../../../hooks/useContext';\nimport { GroupChannelListContexts } from '../module/moduleContext';\nimport type { GroupChannelListProps, GroupChannelType } from '../types';\n\nconst TYPES: GroupChannelType[] = ['GROUP', 'SUPER_GROUP', 'BROADCAST'];\nconst TYPE_ICONS: Record<GroupChannelType, keyof typeof Icon.Assets> = {\n 'GROUP': 'chat',\n 'SUPER_GROUP': 'supergroup',\n 'BROADCAST': 'broadcast',\n};\nconst STATUS_BAR_TOP_INSET_AS: 'margin' | 'padding' = Platform.select({ android: 'margin', default: 'padding' });\n\nconst GroupChannelListTypeSelector = ({ skipTypeSelection, onSelectType }: GroupChannelListProps['TypeSelector']) => {\n const { statusBarTranslucent, HeaderComponent } = useHeaderStyle();\n const { colors } = useUIKitTheme();\n const { features } = useSendbirdChat();\n const typeSelector = useContext(GroupChannelListContexts.TypeSelector);\n const { visible, hide } = typeSelector;\n\n const createOnPressType = (type: GroupChannelType) => () => {\n hide();\n onSelectType(type);\n };\n\n useEffect(() => {\n if (skipTypeSelection && visible) createOnPressType('GROUP')();\n }, [skipTypeSelection, visible]);\n\n if (skipTypeSelection) return null;\n\n return (\n <Modal visible={visible} onClose={hide} statusBarTranslucent={statusBarTranslucent}>\n <HeaderComponent\n title={typeSelector.headerTitle}\n right={<Icon icon={'close'} color={colors.onBackground01} />}\n onPressRight={typeSelector.hide}\n statusBarTopInsetAs={STATUS_BAR_TOP_INSET_AS}\n >\n <View style={styles.buttonArea}>\n {TYPES.map((type) => {\n if (type === 'SUPER_GROUP' && !features.superGroupChannelEnabled) {\n return null;\n }\n\n if (type === 'BROADCAST' && !features.broadcastChannelEnabled) {\n return null;\n }\n\n return (\n <TouchableOpacity\n key={type}\n activeOpacity={0.6}\n onPress={createOnPressType(type)}\n style={styles.typeButton}\n >\n <DefaultTypeIcon type={type} />\n <DefaultTypeText type={type} />\n </TouchableOpacity>\n );\n })}\n </View>\n </HeaderComponent>\n </Modal>\n );\n};\n\nconst DefaultTypeIcon = ({ type }: { type: GroupChannelType }) => {\n return <Icon size={24} icon={TYPE_ICONS[type]} containerStyle={styles.icon} />;\n};\n\nconst DefaultTypeText = ({ type }: { type: GroupChannelType }) => {\n const { STRINGS } = useLocalization();\n const { colors } = useUIKitTheme();\n return (\n <Text caption2 color={colors.onBackground01}>\n {STRINGS.GROUP_CHANNEL_LIST[`TYPE_SELECTOR_${type}`]}\n </Text>\n );\n};\n\nconst styles = createStyleSheet({\n buttonArea: {\n flexDirection: 'row',\n },\n typeButton: {\n paddingVertical: 24,\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n },\n icon: {\n marginBottom: 8,\n },\n});\n\nexport default GroupChannelListTypeSelector;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,2BAAA,GAAAF,OAAA;AASA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AAAmE,SAAAK,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAP,wBAAAW,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,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K,EAAC,CAAC,CAC/C;AAEX,CAAC;AAED,MAAMgB,MAAM,GAAG,IAAAoB,4CAAgB,EAAC;EAC9BnB,UAAU,EAAE;IACVoB,aAAa,EAAE;EACjB,CAAC;EACDb,UAAU,EAAE;IACVc,eAAe,EAAE,EAAE;IACnBC,IAAI,EAAE,CAAC;IACPC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDhC,IAAI,EAAE;IACJiC,YAAY,EAAE;EAChB;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAEY7D,4BAA4B;AAAA8D,OAAA,CAAAnF,OAAA,GAAAkF,QAAA"}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_uikitReactNativeFoundation","_useContext","_moduleContext","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","TYPES","TYPE_ICONS","STATUS_BAR_TOP_INSET_AS","Platform","select","android","GroupChannelListTypeSelector","_ref","skipTypeSelection","onSelectType","statusBarTranslucent","HeaderComponent","useHeaderStyle","colors","useUIKitTheme","sbOptions","useSendbirdChat","typeSelector","useContext","GroupChannelListContexts","TypeSelector","visible","hide","createOnPressType","type","useEffect","createElement","Modal","onClose","title","headerTitle","right","Icon","icon","color","onBackground01","onPressRight","statusBarTopInsetAs","View","style","styles","buttonArea","map","appInfo","superGroupChannelEnabled","broadcastChannelEnabled","TouchableOpacity","activeOpacity","onPress","typeButton","DefaultTypeIcon","DefaultTypeText","_ref2","size","containerStyle","_ref3","STRINGS","useLocalization","Text","caption2","GROUP_CHANNEL_LIST","createStyleSheet","flexDirection","paddingVertical","flex","alignItems","justifyContent","marginBottom","_default","exports"],"sources":["GroupChannelListTypeSelector.tsx"],"sourcesContent":["import React, { useContext, useEffect } from 'react';\nimport { Platform, TouchableOpacity, View } from 'react-native';\n\nimport {\n Icon,\n Modal,\n Text,\n createStyleSheet,\n useHeaderStyle,\n useUIKitTheme,\n} from '@sendbird/uikit-react-native-foundation';\n\nimport { useLocalization, useSendbirdChat } from '../../../hooks/useContext';\nimport { GroupChannelListContexts } from '../module/moduleContext';\nimport type { GroupChannelListProps, GroupChannelType } from '../types';\n\nconst TYPES: GroupChannelType[] = ['GROUP', 'SUPER_GROUP', 'BROADCAST'];\nconst TYPE_ICONS: Record<GroupChannelType, keyof typeof Icon.Assets> = {\n 'GROUP': 'chat',\n 'SUPER_GROUP': 'supergroup',\n 'BROADCAST': 'broadcast',\n};\nconst STATUS_BAR_TOP_INSET_AS: 'margin' | 'padding' = Platform.select({ android: 'margin', default: 'padding' });\n\nconst GroupChannelListTypeSelector = ({ skipTypeSelection, onSelectType }: GroupChannelListProps['TypeSelector']) => {\n const { statusBarTranslucent, HeaderComponent } = useHeaderStyle();\n const { colors } = useUIKitTheme();\n const { sbOptions } = useSendbirdChat();\n const typeSelector = useContext(GroupChannelListContexts.TypeSelector);\n const { visible, hide } = typeSelector;\n\n const createOnPressType = (type: GroupChannelType) => () => {\n hide();\n onSelectType(type);\n };\n\n useEffect(() => {\n if (skipTypeSelection && visible) createOnPressType('GROUP')();\n }, [skipTypeSelection, visible]);\n\n if (skipTypeSelection) return null;\n\n return (\n <Modal visible={visible} onClose={hide} statusBarTranslucent={statusBarTranslucent}>\n <HeaderComponent\n title={typeSelector.headerTitle}\n right={<Icon icon={'close'} color={colors.onBackground01} />}\n onPressRight={typeSelector.hide}\n statusBarTopInsetAs={STATUS_BAR_TOP_INSET_AS}\n >\n <View style={styles.buttonArea}>\n {TYPES.map((type) => {\n if (type === 'SUPER_GROUP' && !sbOptions.appInfo.superGroupChannelEnabled) {\n return null;\n }\n\n if (type === 'BROADCAST' && !sbOptions.appInfo.broadcastChannelEnabled) {\n return null;\n }\n\n return (\n <TouchableOpacity\n key={type}\n activeOpacity={0.6}\n onPress={createOnPressType(type)}\n style={styles.typeButton}\n >\n <DefaultTypeIcon type={type} />\n <DefaultTypeText type={type} />\n </TouchableOpacity>\n );\n })}\n </View>\n </HeaderComponent>\n </Modal>\n );\n};\n\nconst DefaultTypeIcon = ({ type }: { type: GroupChannelType }) => {\n return <Icon size={24} icon={TYPE_ICONS[type]} containerStyle={styles.icon} />;\n};\n\nconst DefaultTypeText = ({ type }: { type: GroupChannelType }) => {\n const { STRINGS } = useLocalization();\n const { colors } = useUIKitTheme();\n return (\n <Text caption2 color={colors.onBackground01}>\n {STRINGS.GROUP_CHANNEL_LIST[`TYPE_SELECTOR_${type}`]}\n </Text>\n );\n};\n\nconst styles = createStyleSheet({\n buttonArea: {\n flexDirection: 'row',\n },\n typeButton: {\n paddingVertical: 24,\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n },\n icon: {\n marginBottom: 8,\n },\n});\n\nexport default GroupChannelListTypeSelector;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,2BAAA,GAAAF,OAAA;AASA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AAAmE,SAAAK,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAP,wBAAAW,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,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AgB,EAAC;EAC9BpB,UAAU,EAAE;IACVqB,aAAa,EAAE;EACjB,CAAC;EACDb,UAAU,EAAE;IACVc,eAAe,EAAE,EAAE;IACnBC,IAAI,EAAE,CAAC;IACPC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDjC,IAAI,EAAE;IACJkC,YAAY,EAAE;EAChB;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAEY9D,4BAA4B;AAAA+D,OAAA,CAAApF,OAAA,GAAAmF,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type React from 'react';\nimport type { FlatListProps } from 'react-native';\n\nimport type { UseGroupChannelListOptions } from '@sendbird/uikit-chat-hooks';\nimport type { ActionMenuItem } from '@sendbird/uikit-react-native-foundation';\nimport type { SendbirdGroupChannel } from '@sendbird/uikit-utils';\n\nimport type { CommonComponent } from '../../types';\n\nexport interface GroupChannelListProps {\n /** Props for `GroupChannelListFragment` **/\n Fragment: {\n /** Navigate to GroupChannelFragment **/\n onPressChannel: (channel: SendbirdGroupChannel) => void;\n /** Navigate to GroupChannelCreateFragment **/\n onPressCreateChannel: (channelType: GroupChannelType) => void;\n /** Method to render GroupChannel preview **/\n renderGroupChannelPreview?: (\n channel: SendbirdGroupChannel,\n onLongPressChannel: () => void,\n ) => React.ReactElement | null;\n /** Skip type selection, When this is set to true 'channelType' only receive 'GROUP' type **/\n skipTypeSelection?: boolean;\n /** Custom Query creator for channels query **/\n queryCreator?: UseGroupChannelListOptions['queryCreator'];\n /** Custom Collection creator for group channel collection **/\n collectionCreator?: UseGroupChannelListOptions['collectionCreator'];\n /** FlatList props for GroupChannelList.List **/\n flatListProps?: GroupChannelListProps['List']['flatListProps'];\n /** Action menu item creator for onLongPress **/\n menuItemCreator?: GroupChannelListProps['List']['menuItemCreator'];\n };\n /** Props for `GroupChannelListModule.Header` **/\n Header: {};\n /** Props for `GroupChannelListModule.List` **/\n List: {\n /** GroupChannels from SendbirdChat SDK **/\n groupChannels: SendbirdGroupChannel[];\n /** Method to render GroupChannel preview **/\n renderGroupChannelPreview: (\n // FIXME/BREAKING: Changed to props object\n channel: SendbirdGroupChannel,\n onLongPressChannel: () => void,\n ) => React.ReactElement | null;\n /** Method to load more data, called with onEndReached of FlatList **/\n onLoadNext: () => Promise<void>;\n /** Prop from Fragment **/\n flatListProps?: Omit<FlatListProps<SendbirdGroupChannel>, 'data' | 'renderItem'>;\n /** Prop from Fragment **/\n menuItemCreator?: (defaultMenuItem: ActionMenuItem) => ActionMenuItem;\n };\n /** Props for `GroupChannelListModule.TypeSelector` **/\n TypeSelector: {\n /** Prop from Fragment `Fragment.skipTypeSelection` **/\n skipTypeSelection: boolean;\n /** Method called when type is selected, call `Fragment.onPressCreateChannel` **/\n onSelectType: (type: GroupChannelType) => void;\n };\n}\n\n/**\n * Internal context for GroupChannelList\n * For example, the developer can create a custom header\n * with getting data from the domain context\n * */\nexport interface GroupChannelListContextsType {\n Fragment: React.Context<{\n headerTitle: string;\n }>;\n TypeSelector: React.Context<{\n visible: boolean;\n show: () => void;\n hide: () => void;\n headerTitle: string;\n }>;\n}\nexport interface GroupChannelListModule {\n Provider: CommonComponent;\n Header: CommonComponent<GroupChannelListProps['Header']>;\n List: CommonComponent<GroupChannelListProps['List']>;\n TypeSelector: CommonComponent<GroupChannelListProps['TypeSelector']>;\n StatusEmpty: CommonComponent;\n StatusLoading: CommonComponent;\n}\n\nexport type GroupChannelListFragment = CommonComponent<GroupChannelListProps['Fragment']>;\nexport type GroupChannelType = 'GROUP' | 'SUPER_GROUP' | 'BROADCAST';\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type React from 'react';\nimport type { FlatListProps } from 'react-native';\n\nimport type { UseGroupChannelListOptions } from '@sendbird/uikit-chat-hooks';\nimport type { ActionMenuItem } from '@sendbird/uikit-react-native-foundation';\nimport type { SendbirdGroupChannel } from '@sendbird/uikit-utils';\n\nimport type { CommonComponent } from '../../types';\n\nexport interface GroupChannelListProps {\n Fragment: {\n onPressChannel: GroupChannelListProps['List']['onPressChannel'];\n onPressCreateChannel: (channelType: GroupChannelType) => void;\n renderGroupChannelPreview?: GroupChannelListProps['List']['renderGroupChannelPreview'];\n skipTypeSelection?: boolean;\n collectionCreator?: UseGroupChannelListOptions['collectionCreator'];\n flatListProps?: GroupChannelListProps['List']['flatListProps'];\n menuItemCreator?: GroupChannelListProps['List']['menuItemCreator'];\n };\n Header: {};\n List: {\n onPressChannel: (channel: SendbirdGroupChannel) => void;\n groupChannels: SendbirdGroupChannel[];\n renderGroupChannelPreview: (props: {\n channel: SendbirdGroupChannel;\n onPress: () => void;\n onLongPress: () => void;\n }) => React.ReactElement | null;\n onLoadNext: () => Promise<void>;\n flatListProps?: Omit<FlatListProps<SendbirdGroupChannel>, 'data' | 'renderItem'>;\n menuItemCreator?: (defaultMenuItem: ActionMenuItem) => ActionMenuItem;\n };\n TypeSelector: {\n skipTypeSelection: boolean;\n onSelectType: (type: GroupChannelType) => void;\n };\n}\n\n/**\n * Internal context for GroupChannelList\n * For example, the developer can create a custom header\n * with getting data from the domain context\n * */\nexport interface GroupChannelListContextsType {\n Fragment: React.Context<{\n headerTitle: string;\n }>;\n TypeSelector: React.Context<{\n visible: boolean;\n show: () => void;\n hide: () => void;\n headerTitle: string;\n }>;\n}\nexport interface GroupChannelListModule {\n Provider: CommonComponent;\n Header: CommonComponent<GroupChannelListProps['Header']>;\n List: CommonComponent<GroupChannelListProps['List']>;\n TypeSelector: CommonComponent<GroupChannelListProps['TypeSelector']>;\n StatusEmpty: CommonComponent;\n StatusLoading: CommonComponent;\n}\n\nexport type GroupChannelListFragment = CommonComponent<GroupChannelListProps['Fragment']>;\nexport type GroupChannelType = 'GROUP' | 'SUPER_GROUP' | 'BROADCAST';\n"],"mappings":""}
@@ -26,7 +26,7 @@ const GroupChannelSettingsMenu = _ref => {
26
26
  } = _ref;
27
27
  const {
28
28
  sdk,
29
- features
29
+ sbOptions
30
30
  } = (0, _useContext.useSendbirdChat)();
31
31
  const {
32
32
  channel
@@ -37,11 +37,11 @@ const GroupChannelSettingsMenu = _ref => {
37
37
  const {
38
38
  colors
39
39
  } = (0, _uikitReactNativeFoundation.useUIKitTheme)();
40
- if (__DEV__ && !WARN_onPressMenuNotification && !onPressMenuNotification && features.userMentionEnabled) {
40
+ if (__DEV__ && !WARN_onPressMenuNotification && !onPressMenuNotification && sbOptions.uikit.groupChannel.channel.enableMention) {
41
41
  _uikitUtils.Logger.warn('If you are using mention, make sure to pass the `onPressMenuNotification` prop');
42
42
  WARN_onPressMenuNotification = true;
43
43
  }
44
- if (__DEV__ && !WARN_onPressMenuSearchInChannel && !onPressMenuSearchInChannel && features.messageSearchEnabled) {
44
+ if (__DEV__ && !WARN_onPressMenuSearchInChannel && !onPressMenuSearchInChannel && sbOptions.uikitWithAppInfo.groupChannel.setting.enableMessageSearch) {
45
45
  _uikitUtils.Logger.warn('If you are using message search, make sure to pass the `onPressMenuSearchInChannel` prop');
46
46
  WARN_onPressMenuSearchInChannel = true;
47
47
  }
@@ -70,7 +70,7 @@ const GroupChannelSettingsMenu = _ref => {
70
70
  };
71
71
  return {
72
72
  actionLabelNotificationMenu: getNotificationsLabel(),
73
- actionItemNotificationMenu: (0, _uikitUtils.conditionChaining)([features.userMentionEnabled], [/*#__PURE__*/_react.default.createElement(_uikitReactNativeFoundation.Icon, {
73
+ actionItemNotificationMenu: (0, _uikitUtils.conditionChaining)([sbOptions.uikit.groupChannel.channel.enableMention], [/*#__PURE__*/_react.default.createElement(_uikitReactNativeFoundation.Icon, {
74
74
  icon: 'chevron-right',
75
75
  color: colors.onBackground01
76
76
  }), /*#__PURE__*/_react.default.createElement(_uikitReactNativeFoundation.Switch, {
@@ -78,11 +78,11 @@ const GroupChannelSettingsMenu = _ref => {
78
78
  onChangeValue: toggleNotification
79
79
  })]),
80
80
  onPressNotificationMenu: () => {
81
- if (features.userMentionEnabled) onPressMenuNotification === null || onPressMenuNotification === void 0 ? void 0 : onPressMenuNotification();else toggleNotification();
81
+ if (sbOptions.uikit.groupChannel.channel.enableMention) onPressMenuNotification === null || onPressMenuNotification === void 0 ? void 0 : onPressMenuNotification();else toggleNotification();
82
82
  }
83
83
  };
84
84
  });
85
- const menuItems = menuItemsCreator([{
85
+ const defaultMenuItems = [{
86
86
  icon: 'moderation',
87
87
  visible: channel.myRole === 'operator',
88
88
  name: STRINGS.GROUP_CHANNEL_SETTINGS.MENU_MODERATION,
@@ -106,15 +106,15 @@ const GroupChannelSettingsMenu = _ref => {
106
106
  icon: 'chevron-right',
107
107
  color: colors.onBackground01
108
108
  })
109
- }]);
110
- if (features.messageSearchEnabled) {
111
- menuItems.push({
109
+ }];
110
+ if (sbOptions.uikitWithAppInfo.groupChannel.setting.enableMessageSearch && !channel.isEphemeral) {
111
+ defaultMenuItems.push({
112
112
  icon: 'search',
113
113
  name: STRINGS.GROUP_CHANNEL_SETTINGS.MENU_SEARCH,
114
114
  onPress: () => onPressMenuSearchInChannel === null || onPressMenuSearchInChannel === void 0 ? void 0 : onPressMenuSearchInChannel()
115
115
  });
116
116
  }
117
- menuItems.push({
117
+ defaultMenuItems.push({
118
118
  icon: 'leave',
119
119
  iconColor: colors.error,
120
120
  name: STRINGS.GROUP_CHANNEL_SETTINGS.MENU_LEAVE_CHANNEL,
@@ -125,6 +125,7 @@ const GroupChannelSettingsMenu = _ref => {
125
125
  });
126
126
  }
127
127
  });
128
+ const menuItems = menuItemsCreator(defaultMenuItems);
128
129
  return /*#__PURE__*/_react.default.createElement(_reactNative.View, null, menuItems.map(menu => {
129
130
  return /*#__PURE__*/_react.default.createElement(_uikitReactNativeFoundation.MenuBar, {
130
131
  key: menu.name,
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_chat","_uikitReactNativeFoundation","_uikitUtils","_useContext","_moduleContext","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","WARN_onPressMenuNotification","WARN_onPressMenuSearchInChannel","GroupChannelSettingsMenu","_ref","onPressMenuModeration","onPressMenuMembers","onPressMenuSearchInChannel","onPressMenuLeaveChannel","onPressMenuNotification","menuItemsCreator","menu","sdk","features","useSendbirdChat","channel","useContext","GroupChannelSettingsContexts","Fragment","STRINGS","useLocalization","colors","useUIKitTheme","__DEV__","userMentionEnabled","Logger","warn","messageSearchEnabled","toggleNotification","myPushTriggerOption","setMyPushTriggerOption","PushTriggerOption","DEFAULT","OFF","onPressNotificationMenu","actionLabelNotificationMenu","actionItemNotificationMenu","useIIFE","getNotificationsLabel","ALL","GROUP_CHANNEL_SETTINGS","MENU_NOTIFICATION_LABEL_ON","MENU_NOTIFICATION_LABEL_OFF","MENTION_ONLY","MENU_NOTIFICATION_LABEL_MENTION_ONLY","conditionChaining","createElement","Icon","icon","color","onBackground01","Switch","value","onChangeValue","menuItems","visible","myRole","name","MENU_MODERATION","onPress","actionItem","MENU_NOTIFICATION","actionLabel","MENU_MEMBERS","String","memberCount","push","MENU_SEARCH","iconColor","error","MENU_LEAVE_CHANNEL","leave","then","clearCachedMessages","url","catch","View","map","MenuBar","disabled","iconBackgroundColor","_default","exports"],"sources":["GroupChannelSettingsMenu.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport { View } from 'react-native';\n\nimport { PushTriggerOption } from '@sendbird/chat';\nimport type { MenuBarProps } from '@sendbird/uikit-react-native-foundation';\nimport { Icon, MenuBar, Switch, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';\nimport { Logger, conditionChaining, useIIFE } from '@sendbird/uikit-utils';\n\nimport { useLocalization, useSendbirdChat } from '../../../hooks/useContext';\nimport { GroupChannelSettingsContexts } from '../module/moduleContext';\nimport type { GroupChannelSettingsProps } from '../types';\n\nlet WARN_onPressMenuNotification = false;\nlet WARN_onPressMenuSearchInChannel = false;\n\nconst GroupChannelSettingsMenu = ({\n onPressMenuModeration,\n onPressMenuMembers,\n onPressMenuSearchInChannel,\n onPressMenuLeaveChannel,\n onPressMenuNotification,\n menuItemsCreator = (menu) => menu,\n}: GroupChannelSettingsProps['Menu']) => {\n const { sdk, features } = useSendbirdChat();\n const { channel } = useContext(GroupChannelSettingsContexts.Fragment);\n const { STRINGS } = useLocalization();\n const { colors } = useUIKitTheme();\n\n if (__DEV__ && !WARN_onPressMenuNotification && !onPressMenuNotification && features.userMentionEnabled) {\n Logger.warn('If you are using mention, make sure to pass the `onPressMenuNotification` prop');\n WARN_onPressMenuNotification = true;\n }\n\n if (__DEV__ && !WARN_onPressMenuSearchInChannel && !onPressMenuSearchInChannel && features.messageSearchEnabled) {\n Logger.warn('If you are using message search, make sure to pass the `onPressMenuSearchInChannel` prop');\n WARN_onPressMenuSearchInChannel = true;\n }\n\n const toggleNotification = async () => {\n if (channel.myPushTriggerOption === 'off') {\n await channel.setMyPushTriggerOption(PushTriggerOption.DEFAULT);\n } else {\n await channel.setMyPushTriggerOption(PushTriggerOption.OFF);\n }\n };\n\n const { onPressNotificationMenu, actionLabelNotificationMenu, actionItemNotificationMenu } = useIIFE(() => {\n const getNotificationsLabel = () => {\n switch (channel.myPushTriggerOption) {\n case PushTriggerOption.ALL:\n case PushTriggerOption.DEFAULT:\n return STRINGS.GROUP_CHANNEL_SETTINGS.MENU_NOTIFICATION_LABEL_ON;\n case PushTriggerOption.OFF:\n return STRINGS.GROUP_CHANNEL_SETTINGS.MENU_NOTIFICATION_LABEL_OFF;\n case PushTriggerOption.MENTION_ONLY:\n return STRINGS.GROUP_CHANNEL_SETTINGS.MENU_NOTIFICATION_LABEL_MENTION_ONLY;\n }\n };\n\n return {\n actionLabelNotificationMenu: getNotificationsLabel(),\n actionItemNotificationMenu: conditionChaining(\n [features.userMentionEnabled],\n [\n <Icon icon={'chevron-right'} color={colors.onBackground01} />,\n <Switch value={channel.myPushTriggerOption !== 'off'} onChangeValue={toggleNotification} />,\n ],\n ),\n onPressNotificationMenu: () => {\n if (features.userMentionEnabled) onPressMenuNotification?.();\n else toggleNotification();\n },\n };\n });\n\n const menuItems: MenuBarProps[] = menuItemsCreator([\n {\n icon: 'moderation',\n visible: channel.myRole === 'operator',\n name: STRINGS.GROUP_CHANNEL_SETTINGS.MENU_MODERATION,\n onPress: () => onPressMenuModeration(),\n actionItem: <Icon icon={'chevron-right'} color={colors.onBackground01} />,\n },\n {\n icon: 'notifications',\n name: STRINGS.GROUP_CHANNEL_SETTINGS.MENU_NOTIFICATION,\n onPress: onPressNotificationMenu,\n actionLabel: actionLabelNotificationMenu,\n actionItem: actionItemNotificationMenu,\n },\n {\n icon: 'members',\n name: STRINGS.GROUP_CHANNEL_SETTINGS.MENU_MEMBERS,\n onPress: () => onPressMenuMembers(),\n actionLabel: String(channel.memberCount),\n actionItem: <Icon icon={'chevron-right'} color={colors.onBackground01} />,\n },\n ]);\n\n if (features.messageSearchEnabled) {\n menuItems.push({\n icon: 'search',\n name: STRINGS.GROUP_CHANNEL_SETTINGS.MENU_SEARCH,\n onPress: () => onPressMenuSearchInChannel?.(),\n });\n }\n\n menuItems.push({\n icon: 'leave',\n iconColor: colors.error,\n name: STRINGS.GROUP_CHANNEL_SETTINGS.MENU_LEAVE_CHANNEL,\n onPress: () => {\n channel.leave().then(() => {\n onPressMenuLeaveChannel();\n sdk.clearCachedMessages([channel.url]).catch();\n });\n },\n });\n\n return (\n <View>\n {menuItems.map((menu) => {\n return (\n <MenuBar\n key={menu.name}\n onPress={menu.onPress}\n name={menu.name}\n disabled={menu.disabled}\n visible={menu.visible}\n icon={menu.icon}\n iconColor={menu.iconColor}\n iconBackgroundColor={menu.iconBackgroundColor}\n actionLabel={menu.actionLabel}\n actionItem={menu.actionItem}\n />\n );\n })}\n </View>\n );\n};\n\nexport default GroupChannelSettingsMenu;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA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,OAAO,EAAEA,CAAA,KAAM;MACb5C,OAAO,CAACwD,KAAK,EAAE,CAACC,IAAI,CAAC,MAAM;QACzBhE,uBAAuB,EAAE;QACzBI,GAAG,CAAC6D,mBAAmB,CAAC,CAAC1D,OAAO,CAAC2D,GAAG,CAAC,CAAC,CAACC,KAAK,EAAE;MAChD,CAAC,CAAC;IACJ;EACF,CAAC,CAAC;EAEF,oBACEzG,MAAA,CAAAgB,OAAA,CAAA4D,aAAA,CAACzE,YAAA,CAAAuG,IAAI,QACFtB,SAAS,CAACuB,GAAG,CAAElE,IAAI,IAAK;IACvB,oBACEzC,MAAA,CAAAgB,OAAA,CAAA4D,aAAA,CAACvE,2BAAA,CAAAuG,OAAO;MACNnF,GAAG,EAAEgB,IAAI,CAAC8C,IAAK;MACfE,OAAO,EAAEhD,IAAI,CAACgD,OAAQ;MACtBF,IAAI,EAAE9C,IAAI,CAAC8C,IAAK;MAChBsB,QAAQ,EAAEpE,IAAI,CAACoE,QAAS;MACxBxB,OAAO,EAAE5C,IAAI,CAAC4C,OAAQ;MACtBP,IAAI,EAAErC,IAAI,CAACqC,IAAK;MAChBoB,SAAS,EAAEzD,IAAI,CAACyD,SAAU;MAC1BY,mBAAmB,EAAErE,IAAI,CAACqE,mBAAoB;MAC9ClB,WAAW,EAAEnD,IAAI,CAACmD,WAAY;MAC9BF,UAAU,EAAEjD,IAAI,CAACiD;IAAW,EAC5B;EAEN,CAAC,CAAC,CACG;AAEX,CAAC;AAAC,IAAAqB,QAAA,GAEa9E,wBAAwB;AAAA+E,OAAA,CAAAhG,OAAA,GAAA+F,QAAA"}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_chat","_uikitReactNativeFoundation","_uikitUtils","_useContext","_moduleContext","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","WARN_onPressMenuNotification","WARN_onPressMenuSearchInChannel","GroupChannelSettingsMenu","_ref","onPressMenuModeration","onPressMenuMembers","onPressMenuSearchInChannel","onPressMenuLeaveChannel","onPressMenuNotification","menuItemsCreator","menu","sdk","sbOptions","useSendbirdChat","channel","useContext","GroupChannelSettingsContexts","Fragment","STRINGS","useLocalization","colors","useUIKitTheme","__DEV__","uikit","groupChannel","enableMention","Logger","warn","uikitWithAppInfo","setting","enableMessageSearch","toggleNotification","myPushTriggerOption","setMyPushTriggerOption","PushTriggerOption","DEFAULT","OFF","onPressNotificationMenu","actionLabelNotificationMenu","actionItemNotificationMenu","useIIFE","getNotificationsLabel","ALL","GROUP_CHANNEL_SETTINGS","MENU_NOTIFICATION_LABEL_ON","MENU_NOTIFICATION_LABEL_OFF","MENTION_ONLY","MENU_NOTIFICATION_LABEL_MENTION_ONLY","conditionChaining","createElement","Icon","icon","color","onBackground01","Switch","value","onChangeValue","defaultMenuItems","visible","myRole","name","MENU_MODERATION","onPress","actionItem","MENU_NOTIFICATION","actionLabel","MENU_MEMBERS","String","memberCount","isEphemeral","push","MENU_SEARCH","iconColor","error","MENU_LEAVE_CHANNEL","leave","then","clearCachedMessages","url","catch","menuItems","View","map","MenuBar","disabled","iconBackgroundColor","_default","exports"],"sources":["GroupChannelSettingsMenu.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport { View } from 'react-native';\n\nimport { PushTriggerOption } from '@sendbird/chat';\nimport type { MenuBarProps } from '@sendbird/uikit-react-native-foundation';\nimport { Icon, MenuBar, Switch, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';\nimport { Logger, conditionChaining, useIIFE } from '@sendbird/uikit-utils';\n\nimport { useLocalization, useSendbirdChat } from '../../../hooks/useContext';\nimport { GroupChannelSettingsContexts } from '../module/moduleContext';\nimport type { GroupChannelSettingsProps } from '../types';\n\nlet WARN_onPressMenuNotification = false;\nlet WARN_onPressMenuSearchInChannel = false;\n\nconst GroupChannelSettingsMenu = ({\n onPressMenuModeration,\n onPressMenuMembers,\n onPressMenuSearchInChannel,\n onPressMenuLeaveChannel,\n onPressMenuNotification,\n menuItemsCreator = (menu) => menu,\n}: GroupChannelSettingsProps['Menu']) => {\n const { sdk, sbOptions } = useSendbirdChat();\n const { channel } = useContext(GroupChannelSettingsContexts.Fragment);\n const { STRINGS } = useLocalization();\n const { colors } = useUIKitTheme();\n\n if (\n __DEV__ &&\n !WARN_onPressMenuNotification &&\n !onPressMenuNotification &&\n sbOptions.uikit.groupChannel.channel.enableMention\n ) {\n Logger.warn('If you are using mention, make sure to pass the `onPressMenuNotification` prop');\n WARN_onPressMenuNotification = true;\n }\n\n if (\n __DEV__ &&\n !WARN_onPressMenuSearchInChannel &&\n !onPressMenuSearchInChannel &&\n sbOptions.uikitWithAppInfo.groupChannel.setting.enableMessageSearch\n ) {\n Logger.warn('If you are using message search, make sure to pass the `onPressMenuSearchInChannel` prop');\n WARN_onPressMenuSearchInChannel = true;\n }\n\n const toggleNotification = async () => {\n if (channel.myPushTriggerOption === 'off') {\n await channel.setMyPushTriggerOption(PushTriggerOption.DEFAULT);\n } else {\n await channel.setMyPushTriggerOption(PushTriggerOption.OFF);\n }\n };\n\n const { onPressNotificationMenu, actionLabelNotificationMenu, actionItemNotificationMenu } = useIIFE(() => {\n const getNotificationsLabel = () => {\n switch (channel.myPushTriggerOption) {\n case PushTriggerOption.ALL:\n case PushTriggerOption.DEFAULT:\n return STRINGS.GROUP_CHANNEL_SETTINGS.MENU_NOTIFICATION_LABEL_ON;\n case PushTriggerOption.OFF:\n return STRINGS.GROUP_CHANNEL_SETTINGS.MENU_NOTIFICATION_LABEL_OFF;\n case PushTriggerOption.MENTION_ONLY:\n return STRINGS.GROUP_CHANNEL_SETTINGS.MENU_NOTIFICATION_LABEL_MENTION_ONLY;\n }\n };\n\n return {\n actionLabelNotificationMenu: getNotificationsLabel(),\n actionItemNotificationMenu: conditionChaining(\n [sbOptions.uikit.groupChannel.channel.enableMention],\n [\n <Icon icon={'chevron-right'} color={colors.onBackground01} />,\n <Switch value={channel.myPushTriggerOption !== 'off'} onChangeValue={toggleNotification} />,\n ],\n ),\n onPressNotificationMenu: () => {\n if (sbOptions.uikit.groupChannel.channel.enableMention) onPressMenuNotification?.();\n else toggleNotification();\n },\n };\n });\n\n const defaultMenuItems: MenuBarProps[] = [\n {\n icon: 'moderation',\n visible: channel.myRole === 'operator',\n name: STRINGS.GROUP_CHANNEL_SETTINGS.MENU_MODERATION,\n onPress: () => onPressMenuModeration(),\n actionItem: <Icon icon={'chevron-right'} color={colors.onBackground01} />,\n },\n {\n icon: 'notifications',\n name: STRINGS.GROUP_CHANNEL_SETTINGS.MENU_NOTIFICATION,\n onPress: onPressNotificationMenu,\n actionLabel: actionLabelNotificationMenu,\n actionItem: actionItemNotificationMenu,\n },\n {\n icon: 'members',\n name: STRINGS.GROUP_CHANNEL_SETTINGS.MENU_MEMBERS,\n onPress: () => onPressMenuMembers(),\n actionLabel: String(channel.memberCount),\n actionItem: <Icon icon={'chevron-right'} color={colors.onBackground01} />,\n },\n ];\n\n if (sbOptions.uikitWithAppInfo.groupChannel.setting.enableMessageSearch && !channel.isEphemeral) {\n defaultMenuItems.push({\n icon: 'search',\n name: STRINGS.GROUP_CHANNEL_SETTINGS.MENU_SEARCH,\n onPress: () => onPressMenuSearchInChannel?.(),\n });\n }\n\n defaultMenuItems.push({\n icon: 'leave',\n iconColor: colors.error,\n name: STRINGS.GROUP_CHANNEL_SETTINGS.MENU_LEAVE_CHANNEL,\n onPress: () => {\n channel.leave().then(() => {\n onPressMenuLeaveChannel();\n sdk.clearCachedMessages([channel.url]).catch();\n });\n },\n });\n\n const menuItems = menuItemsCreator(defaultMenuItems);\n\n return (\n <View>\n {menuItems.map((menu) => {\n return (\n <MenuBar\n key={menu.name}\n onPress={menu.onPress}\n name={menu.name}\n disabled={menu.disabled}\n visible={menu.visible}\n icon={menu.icon}\n iconColor={menu.iconColor}\n iconBackgroundColor={menu.iconBackgroundColor}\n actionLabel={menu.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D,IAAI,CAACuD,WAAY;MAC9BF,UAAU,EAAErD,IAAI,CAACqD;IAAW,EAC5B;EAEN,CAAC,CAAC,CACG;AAEX,CAAC;AAAC,IAAAuB,QAAA,GAEapF,wBAAwB;AAAAqF,OAAA,CAAAtG,OAAA,GAAAqG,QAAA"}
@@ -14,6 +14,7 @@ var _moduleContext = require("../module/moduleContext");
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
15
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
16
16
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
17
18
  const OpenChannelInput = props => {
18
19
  const {
19
20
  sdk,
@@ -57,20 +58,15 @@ const OpenChannelInput = props => {
57
58
  updateChatAvailableState(channel);
58
59
  }
59
60
  }, 'open');
60
- return /*#__PURE__*/_react.default.createElement(_ChannelInput.default, {
61
+ return /*#__PURE__*/_react.default.createElement(_ChannelInput.default, _extends({
61
62
  channel: channel,
62
63
  messageToEdit: messageToEdit,
63
64
  setMessageToEdit: setMessageToEdit,
64
65
  inputMuted: chatAvailableState.muted,
65
66
  inputFrozen: channel.isFrozen,
66
67
  inputDisabled: chatAvailableState.disabled,
67
- keyboardAvoidOffset: keyboardAvoidOffset,
68
- shouldRenderInput: props.shouldRenderInput,
69
- onPressSendUserMessage: props.onPressSendUserMessage,
70
- onPressSendFileMessage: props.onPressSendFileMessage,
71
- onPressUpdateUserMessage: props.onPressUpdateUserMessage,
72
- onPressUpdateFileMessage: props.onPressUpdateFileMessage
73
- });
68
+ keyboardAvoidOffset: keyboardAvoidOffset
69
+ }, props));
74
70
  };
75
71
  var _default = /*#__PURE__*/_react.default.memo(OpenChannelInput);
76
72
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_uikitChatHooks","_uikitUtils","_ChannelInput","_interopRequireDefault","_constants","_useContext","_moduleContext","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","OpenChannelInput","props","sdk","currentUser","useSendbirdChat","channel","messageToEdit","setMessageToEdit","keyboardAvoidOffset","useContext","OpenChannelContexts","Fragment","chatAvailableState","setChatAvailableState","useState","frozen","muted","disabled","updateChatAvailableState","useCallback","baseChannel","isOpenChannel","userId","UNKNOWN_USER_ID","getOpenChannelChatAvailableState","then","useEffect","handlerId","useUniqHandlerId","useChannelHandler","onChannelFrozen","onChannelUnfrozen","onUserMuted","onUserUnmuted","onOperatorUpdated","createElement","inputMuted","inputFrozen","isFrozen","inputDisabled","shouldRenderInput","onPressSendUserMessage","onPressSendFileMessage","onPressUpdateUserMessage","onPressUpdateFileMessage","_default","React","memo","exports"],"sources":["OpenChannelInput.tsx"],"sourcesContent":["import React, { useCallback, useContext, useEffect, useState } from 'react';\n\nimport { useChannelHandler } from '@sendbird/uikit-chat-hooks';\nimport { SendbirdBaseChannel, getOpenChannelChatAvailableState, useUniqHandlerId } from '@sendbird/uikit-utils';\n\nimport ChannelInput from '../../../components/ChannelInput';\nimport { UNKNOWN_USER_ID } from '../../../constants';\nimport { useSendbirdChat } from '../../../hooks/useContext';\nimport { OpenChannelContexts } from '../module/moduleContext';\nimport type { OpenChannelProps } from '../types';\n\nconst OpenChannelInput = (props: OpenChannelProps['Input']) => {\n const { sdk, currentUser } = useSendbirdChat();\n\n const {\n channel,\n messageToEdit,\n setMessageToEdit,\n keyboardAvoidOffset = 0,\n } = useContext(OpenChannelContexts.Fragment);\n\n const [chatAvailableState, setChatAvailableState] = useState({ frozen: false, muted: false, disabled: false });\n\n const updateChatAvailableState = useCallback(\n (baseChannel: SendbirdBaseChannel) => {\n if (baseChannel.isOpenChannel()) {\n const userId = currentUser?.userId ?? UNKNOWN_USER_ID;\n getOpenChannelChatAvailableState(baseChannel, userId).then(setChatAvailableState);\n }\n },\n [currentUser?.userId],\n );\n\n useEffect(() => {\n updateChatAvailableState(channel);\n }, [channel, updateChatAvailableState]);\n\n const handlerId = useUniqHandlerId('OpenChannelInput');\n useChannelHandler(\n sdk,\n handlerId,\n {\n onChannelFrozen(channel) {\n updateChatAvailableState(channel);\n },\n onChannelUnfrozen(channel) {\n updateChatAvailableState(channel);\n },\n onUserMuted(channel) {\n updateChatAvailableState(channel);\n },\n onUserUnmuted(channel) {\n updateChatAvailableState(channel);\n },\n onOperatorUpdated(channel) {\n updateChatAvailableState(channel);\n },\n },\n 'open',\n );\n\n return (\n <ChannelInput\n channel={channel}\n messageToEdit={messageToEdit}\n setMessageToEdit={setMessageToEdit}\n inputMuted={chatAvailableState.muted}\n inputFrozen={channel.isFrozen}\n inputDisabled={chatAvailableState.disabled}\n keyboardAvoidOffset={keyboardAvoidOffset}\n shouldRenderInput={props.shouldRenderInput}\n onPressSendUserMessage={props.onPressSendUserMessage}\n onPressSendFileMessage={props.onPressSendFileMessage}\n onPressUpdateUserMessage={props.onPressUpdateUserMessage}\n onPressUpdateFileMessage={props.onPressUpdateFileMessage}\n />\n );\n};\n\nexport default React.memo(OpenChannelInput);\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAEA,IAAAG,aAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,cAAA,GAAAP,OAAA;AAA8D,SAAAI,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAb,wBAAAS,GAAA,EAAAI,WAAA,SAAAA,WAAA,IAAAJ,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAQ,KAAA,GAAAL,wBAAA,CAAAC,WAAA,OAAAI,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAT,GAAA,YAAAQ,KAAA,CAAAE,GAAA,CAAAV,GAAA,SAAAW,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAhB,GAAA,QAAAgB,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAnB,GAAA,EAAAgB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CAACC,IAAI,CAAC/C,gBAAgB,CAAC;AAAAgD,OAAA,CAAApE,OAAA,GAAAiE,QAAA"}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_uikitChatHooks","_uikitUtils","_ChannelInput","_interopRequireDefault","_constants","_useContext","_moduleContext","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","OpenChannelInput","props","sdk","currentUser","useSendbirdChat","channel","messageToEdit","setMessageToEdit","keyboardAvoidOffset","useContext","OpenChannelContexts","Fragment","chatAvailableState","setChatAvailableState","useState","frozen","muted","disabled","updateChatAvailableState","useCallback","baseChannel","isOpenChannel","userId","UNKNOWN_USER_ID","getOpenChannelChatAvailableState","then","useEffect","handlerId","useUniqHandlerId","useChannelHandler","onChannelFrozen","onChannelUnfrozen","onUserMuted","onUserUnmuted","onOperatorUpdated","createElement","inputMuted","inputFrozen","isFrozen","inputDisabled","_default","React","memo","exports"],"sources":["OpenChannelInput.tsx"],"sourcesContent":["import React, { useCallback, useContext, useEffect, useState } from 'react';\n\nimport { useChannelHandler } from '@sendbird/uikit-chat-hooks';\nimport { SendbirdBaseChannel, getOpenChannelChatAvailableState, useUniqHandlerId } from '@sendbird/uikit-utils';\n\nimport ChannelInput from '../../../components/ChannelInput';\nimport { UNKNOWN_USER_ID } from '../../../constants';\nimport { useSendbirdChat } from '../../../hooks/useContext';\nimport { OpenChannelContexts } from '../module/moduleContext';\nimport type { OpenChannelProps } from '../types';\n\nconst OpenChannelInput = (props: OpenChannelProps['Input']) => {\n const { sdk, currentUser } = useSendbirdChat();\n\n const {\n channel,\n messageToEdit,\n setMessageToEdit,\n keyboardAvoidOffset = 0,\n } = useContext(OpenChannelContexts.Fragment);\n\n const [chatAvailableState, setChatAvailableState] = useState({ frozen: false, muted: false, disabled: false });\n\n const updateChatAvailableState = useCallback(\n (baseChannel: SendbirdBaseChannel) => {\n if (baseChannel.isOpenChannel()) {\n const userId = currentUser?.userId ?? UNKNOWN_USER_ID;\n getOpenChannelChatAvailableState(baseChannel, userId).then(setChatAvailableState);\n }\n },\n [currentUser?.userId],\n );\n\n useEffect(() => {\n updateChatAvailableState(channel);\n }, [channel, updateChatAvailableState]);\n\n const handlerId = useUniqHandlerId('OpenChannelInput');\n useChannelHandler(\n sdk,\n handlerId,\n {\n onChannelFrozen(channel) {\n updateChatAvailableState(channel);\n },\n onChannelUnfrozen(channel) {\n updateChatAvailableState(channel);\n },\n onUserMuted(channel) {\n updateChatAvailableState(channel);\n },\n onUserUnmuted(channel) {\n updateChatAvailableState(channel);\n },\n onOperatorUpdated(channel) {\n updateChatAvailableState(channel);\n },\n },\n 'open',\n );\n\n return (\n <ChannelInput\n channel={channel}\n messageToEdit={messageToEdit}\n setMessageToEdit={setMessageToEdit}\n inputMuted={chatAvailableState.muted}\n inputFrozen={channel.isFrozen}\n inputDisabled={chatAvailableState.disabled}\n keyboardAvoidOffset={keyboardAvoidOffset}\n {...props}\n />\n );\n};\n\nexport default React.memo(OpenChannelInput);\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAEA,IAAAG,aAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,cAAA,GAAAP,OAAA;AAA8D,SAAAI,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YA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AeA,CAACzB,OAAO,EAAE;MACvBa,wBAAwB,CAACb,OAAO,CAAC;IACnC,CAAC;IACD0B,iBAAiBA,CAAC1B,OAAO,EAAE;MACzBa,wBAAwB,CAACb,OAAO,CAAC;IACnC,CAAC;IACD2B,WAAWA,CAAC3B,OAAO,EAAE;MACnBa,wBAAwB,CAACb,OAAO,CAAC;IACnC,CAAC;IACD4B,aAAaA,CAAC5B,OAAO,EAAE;MACrBa,wBAAwB,CAACb,OAAO,CAAC;IACnC,CAAC;IACD6B,iBAAiBA,CAAC7B,OAAO,EAAE;MACzBa,wBAAwB,CAACb,OAAO,CAAC;IACnC;EACF,CAAC,EACD,MAAM,CACP;EAED,oBACE9C,MAAA,CAAAY,OAAA,CAAAgE,aAAA,CAACvE,aAAA,CAAAO,OAAY,EAAAoB,QAAA;IACXc,OAAO,EAAEA,OAAQ;IACjBC,aAAa,EAAEA,aAAc;IAC7BC,gBAAgB,EAAEA,gBAAiB;IACnC6B,UAAU,EAAExB,kBAAkB,CAACI,KAAM;IACrCqB,WAAW,EAAEhC,OAAO,CAACiC,QAAS;IAC9BC,aAAa,EAAE3B,kBAAkB,CAACK,QAAS;IAC3CT,mBAAmB,EAAEA;EAAoB,GACrCP,KAAK,EACT;AAEN,CAAC;AAAC,IAAAuC,QAAA,gBAEaC,cAAK,CAACC,IAAI,CAAC1C,gBAAgB,CAAC;AAAA2C,OAAA,CAAAxE,OAAA,GAAAqE,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type React from 'react';\n\nimport type { UseOpenChannelMessagesOptions } from '@sendbird/uikit-chat-hooks';\nimport type { Icon } from '@sendbird/uikit-react-native-foundation';\nimport type {\n OnBeforeHandler,\n SendbirdFileMessage,\n SendbirdFileMessageCreateParams,\n SendbirdFileMessageUpdateParams,\n SendbirdMessage,\n SendbirdOpenChannel,\n SendbirdUserMessage,\n SendbirdUserMessageCreateParams,\n SendbirdUserMessageUpdateParams,\n} from '@sendbird/uikit-utils';\n\nimport type { ChannelInputProps } from '../../components/ChannelInput';\nimport type { ChannelMessageListProps } from '../../components/ChannelMessageList';\nimport type { CommonComponent } from '../../types';\nimport type { PubSub } from '../../utils/pubsub';\nimport type { GroupChannelPubSubContextPayload } from '../groupChannel/types';\n\nexport type OpenChannelProps = {\n Fragment: {\n channel: SendbirdOpenChannel;\n onChannelDeleted: () => void;\n onPressHeaderLeft: OpenChannelProps['Header']['onPressHeaderLeft'];\n onPressHeaderRightWithSettings: OpenChannelProps['Header']['onPressHeaderRight'];\n onPressHeaderRightWithParticipants: OpenChannelProps['Header']['onPressHeaderRight'];\n onPressMediaMessage?: OpenChannelProps['MessageList']['onPressMediaMessage'];\n\n onBeforeSendUserMessage?: OnBeforeHandler<SendbirdUserMessageCreateParams>;\n onBeforeSendFileMessage?: OnBeforeHandler<SendbirdFileMessageCreateParams>;\n onBeforeUpdateUserMessage?: OnBeforeHandler<SendbirdUserMessageUpdateParams>;\n onBeforeUpdateFileMessage?: OnBeforeHandler<SendbirdFileMessageUpdateParams>;\n\n renderMessage?: OpenChannelProps['MessageList']['renderMessage'];\n renderNewMessagesButton?: OpenChannelProps['MessageList']['renderNewMessagesButton'];\n renderScrollToBottomButton?: OpenChannelProps['MessageList']['renderScrollToBottomButton'];\n\n enableMessageGrouping?: OpenChannelProps['MessageList']['enableMessageGrouping'];\n\n keyboardAvoidOffset?: OpenChannelProps['Provider']['keyboardAvoidOffset'];\n flatListProps?: OpenChannelProps['MessageList']['flatListProps'];\n sortComparator?: UseOpenChannelMessagesOptions['sortComparator'];\n queryCreator?: UseOpenChannelMessagesOptions['queryCreator'];\n };\n Header: {\n rightIconName: keyof typeof Icon.Assets;\n onPressHeaderLeft: () => void;\n onPressHeaderRight: () => void;\n };\n\n MessageList: Pick<\n ChannelMessageListProps<SendbirdOpenChannel>,\n | 'enableMessageGrouping'\n | 'currentUserId'\n | 'channel'\n | 'messages'\n | 'newMessages'\n | 'scrolledAwayFromBottom'\n | 'onScrolledAwayFromBottom'\n | 'onTopReached'\n | 'onBottomReached'\n | 'onResendFailedMessage'\n | 'onDeleteMessage'\n | 'onPressMediaMessage'\n | 'renderMessage'\n | 'renderNewMessagesButton'\n | 'renderScrollToBottomButton'\n | 'flatListProps'\n | 'onPressImageMessage'\n | 'hasNext'\n >;\n Input: Pick<\n ChannelInputProps,\n | 'shouldRenderInput'\n | 'onPressSendUserMessage'\n | 'onPressSendFileMessage'\n | 'onPressUpdateUserMessage'\n | 'onPressUpdateFileMessage'\n >;\n\n Provider: {\n channel: SendbirdOpenChannel;\n keyboardAvoidOffset?: number;\n openChannelPubSub: PubSub<OpenChannelPubSubContextPayload>;\n };\n};\n\n/**\n * Internal context for OpenChannel\n * For example, the developer can create a custom header\n * with getting data from the domain context\n * */\nexport type OpenChannelContextsType = {\n Fragment: React.Context<{\n headerTitle: string;\n channel: SendbirdOpenChannel;\n messageToEdit?: SendbirdUserMessage | SendbirdFileMessage;\n setMessageToEdit: (msg?: SendbirdUserMessage | SendbirdFileMessage) => void;\n keyboardAvoidOffset?: number;\n }>;\n PubSub: React.Context<PubSub<GroupChannelPubSubContextPayload>>;\n};\nexport interface OpenChannelModule {\n Provider: CommonComponent<OpenChannelProps['Provider']>;\n Header: CommonComponent<OpenChannelProps['Header']>;\n MessageList: CommonComponent<OpenChannelProps['MessageList']>;\n Input: CommonComponent<OpenChannelProps['Input']>;\n StatusEmpty: CommonComponent;\n StatusLoading: CommonComponent;\n}\n\nexport type OpenChannelFragment = CommonComponent<OpenChannelProps['Fragment']>;\n\nexport type OpenChannelPubSubContextPayload =\n | {\n type: 'MESSAGE_SENT_PENDING' | 'MESSAGE_SENT_SUCCESS';\n data: {\n message: SendbirdUserMessage | SendbirdFileMessage;\n };\n }\n | {\n type: 'MESSAGES_RECEIVED';\n data: {\n messages: SendbirdMessage[];\n };\n };\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type React from 'react';\n\nimport type { UseOpenChannelMessagesOptions } from '@sendbird/uikit-chat-hooks';\nimport type { Icon } from '@sendbird/uikit-react-native-foundation';\nimport type {\n OnBeforeHandler,\n SendbirdFileMessage,\n SendbirdFileMessageCreateParams,\n SendbirdFileMessageUpdateParams,\n SendbirdMessage,\n SendbirdOpenChannel,\n SendbirdUserMessage,\n SendbirdUserMessageCreateParams,\n SendbirdUserMessageUpdateParams,\n} from '@sendbird/uikit-utils';\n\nimport type { ChannelInputProps } from '../../components/ChannelInput';\nimport type { ChannelMessageListProps } from '../../components/ChannelMessageList';\nimport type { CommonComponent } from '../../types';\nimport type { PubSub } from '../../utils/pubsub';\nimport type { GroupChannelPubSubContextPayload } from '../groupChannel/types';\n\nexport type OpenChannelProps = {\n Fragment: {\n channel: SendbirdOpenChannel;\n onChannelDeleted: () => void;\n onPressHeaderLeft: OpenChannelProps['Header']['onPressHeaderLeft'];\n onPressHeaderRightWithSettings: OpenChannelProps['Header']['onPressHeaderRight'];\n onPressHeaderRightWithParticipants: OpenChannelProps['Header']['onPressHeaderRight'];\n onPressMediaMessage?: OpenChannelProps['MessageList']['onPressMediaMessage'];\n\n onBeforeSendUserMessage?: OnBeforeHandler<SendbirdUserMessageCreateParams>;\n onBeforeSendFileMessage?: OnBeforeHandler<SendbirdFileMessageCreateParams>;\n onBeforeUpdateUserMessage?: OnBeforeHandler<SendbirdUserMessageUpdateParams>;\n onBeforeUpdateFileMessage?: OnBeforeHandler<SendbirdFileMessageUpdateParams>;\n\n renderMessage?: OpenChannelProps['MessageList']['renderMessage'];\n renderNewMessagesButton?: OpenChannelProps['MessageList']['renderNewMessagesButton'];\n renderScrollToBottomButton?: OpenChannelProps['MessageList']['renderScrollToBottomButton'];\n\n enableMessageGrouping?: OpenChannelProps['MessageList']['enableMessageGrouping'];\n\n keyboardAvoidOffset?: OpenChannelProps['Provider']['keyboardAvoidOffset'];\n flatListProps?: OpenChannelProps['MessageList']['flatListProps'];\n sortComparator?: UseOpenChannelMessagesOptions['sortComparator'];\n queryCreator?: UseOpenChannelMessagesOptions['queryCreator'];\n };\n Header: {\n rightIconName: keyof typeof Icon.Assets;\n onPressHeaderLeft: () => void;\n onPressHeaderRight: () => void;\n };\n\n MessageList: Pick<\n ChannelMessageListProps<SendbirdOpenChannel>,\n | 'enableMessageGrouping'\n | 'currentUserId'\n | 'channel'\n | 'messages'\n | 'newMessages'\n | 'scrolledAwayFromBottom'\n | 'onScrolledAwayFromBottom'\n | 'onTopReached'\n | 'onBottomReached'\n | 'onResendFailedMessage'\n | 'onDeleteMessage'\n | 'onPressMediaMessage'\n | 'renderMessage'\n | 'renderNewMessagesButton'\n | 'renderScrollToBottomButton'\n | 'flatListProps'\n | 'hasNext'\n >;\n Input: Pick<\n ChannelInputProps,\n | 'shouldRenderInput'\n | 'onPressSendUserMessage'\n | 'onPressSendFileMessage'\n | 'onPressUpdateUserMessage'\n | 'onPressUpdateFileMessage'\n | 'AttachmentsButton'\n >;\n\n Provider: {\n channel: SendbirdOpenChannel;\n keyboardAvoidOffset?: number;\n openChannelPubSub: PubSub<OpenChannelPubSubContextPayload>;\n };\n};\n\n/**\n * Internal context for OpenChannel\n * For example, the developer can create a custom header\n * with getting data from the domain context\n * */\nexport type OpenChannelContextsType = {\n Fragment: React.Context<{\n headerTitle: string;\n channel: SendbirdOpenChannel;\n messageToEdit?: SendbirdUserMessage | SendbirdFileMessage;\n setMessageToEdit: (msg?: SendbirdUserMessage | SendbirdFileMessage) => void;\n keyboardAvoidOffset?: number;\n }>;\n PubSub: React.Context<PubSub<GroupChannelPubSubContextPayload>>;\n};\nexport interface OpenChannelModule {\n Provider: CommonComponent<OpenChannelProps['Provider']>;\n Header: CommonComponent<OpenChannelProps['Header']>;\n MessageList: CommonComponent<OpenChannelProps['MessageList']>;\n Input: CommonComponent<OpenChannelProps['Input']>;\n StatusEmpty: CommonComponent;\n StatusLoading: CommonComponent;\n}\n\nexport type OpenChannelFragment = CommonComponent<OpenChannelProps['Fragment']>;\n\nexport type OpenChannelPubSubContextPayload =\n | {\n type: 'MESSAGE_SENT_PENDING' | 'MESSAGE_SENT_SUCCESS';\n data: {\n message: SendbirdUserMessage | SendbirdFileMessage;\n };\n }\n | {\n type: 'MESSAGES_RECEIVED';\n data: {\n messages: SendbirdMessage[];\n };\n };\n"],"mappings":""}