@sendbird/uikit-react 3.14.3-rc.1 → 3.14.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/App.js +377 -378
- package/App.js.map +1 -1
- package/CHANGELOG.md +38 -2
- package/Channel/components/ChannelHeader.js +36 -34
- package/Channel/components/ChannelHeader.js.map +1 -1
- package/Channel/components/ChannelUI.js +74 -74
- package/Channel/components/FileViewer.js +37 -33
- package/Channel/components/FileViewer.js.map +1 -1
- package/Channel/components/FrozenNotification.js +5 -5
- package/Channel/components/Message.js +80 -81
- package/Channel/components/Message.js.map +1 -1
- package/Channel/components/MessageInput.js +72 -70
- package/Channel/components/MessageInput.js.map +1 -1
- package/Channel/components/MessageInputWrapper.js +45 -43
- package/Channel/components/MessageInputWrapper.js.map +1 -1
- package/Channel/components/MessageList.js +249 -250
- package/Channel/components/MessageList.js.map +1 -1
- package/Channel/components/RemoveMessageModal.js +38 -33
- package/Channel/components/RemoveMessageModal.js.map +1 -1
- package/Channel/components/SuggestedMentionList.js +29 -30
- package/Channel/components/SuggestedMentionList.js.map +1 -1
- package/Channel/components/TypingIndicator.js +6 -6
- package/Channel/components/UnreadCount.js +7 -7
- package/Channel/context.js +1453 -1453
- package/Channel/hooks/useHandleUploadFiles.js +125 -120
- package/Channel/hooks/useHandleUploadFiles.js.map +1 -1
- package/Channel/hooks/useInitialMessagesFetch.js +6 -6
- package/Channel/utils/compareMessagesForGrouping.js +50 -51
- package/Channel/utils/compareMessagesForGrouping.js.map +1 -1
- package/Channel/utils/getMessagePartsInfo.js +26 -27
- package/Channel/utils/getMessagePartsInfo.js.map +1 -1
- package/Channel.js +71 -71
- package/ChannelList/components/AddChannel.js +29 -26
- package/ChannelList/components/AddChannel.js.map +1 -1
- package/ChannelList/components/ChannelListHeader.js +13 -8
- package/ChannelList/components/ChannelListHeader.js.map +1 -1
- package/ChannelList/components/ChannelListUI.js +109 -106
- package/ChannelList/components/ChannelListUI.js.map +1 -1
- package/ChannelList/components/ChannelPreview.js +43 -38
- package/ChannelList/components/ChannelPreview.js.map +1 -1
- package/ChannelList/components/ChannelPreviewAction.js +16 -12
- package/ChannelList/components/ChannelPreviewAction.js.map +1 -1
- package/ChannelList/context.js +9 -10
- package/ChannelList/context.js.map +1 -1
- package/ChannelList.js +43 -40
- package/ChannelList.js.map +1 -1
- package/ChannelSettings/components/ChannelProfile.js +57 -47
- package/ChannelSettings/components/ChannelProfile.js.map +1 -1
- package/ChannelSettings/components/ChannelSettingsHeader.js +24 -21
- package/ChannelSettings/components/ChannelSettingsHeader.js.map +1 -1
- package/ChannelSettings/components/ChannelSettingsUI.js +78 -75
- package/ChannelSettings/components/ChannelSettingsUI.js.map +1 -1
- package/ChannelSettings/components/EditDetailsModal.js +90 -80
- package/ChannelSettings/components/EditDetailsModal.js.map +1 -1
- package/ChannelSettings/components/LeaveChannel.js +63 -53
- package/ChannelSettings/components/LeaveChannel.js.map +1 -1
- package/ChannelSettings/components/ModerationPanel.js +447 -445
- package/ChannelSettings/components/ModerationPanel.js.map +1 -1
- package/ChannelSettings/components/UserListItem.js +49 -49
- package/ChannelSettings/components/UserPanel.js +47 -45
- package/ChannelSettings/components/UserPanel.js.map +1 -1
- package/ChannelSettings/context.js +105 -105
- package/ChannelSettings.js +35 -32
- package/ChannelSettings.js.map +1 -1
- package/CreateChannel/components/CreateChannelUI.js +33 -29
- package/CreateChannel/components/CreateChannelUI.js.map +1 -1
- package/CreateChannel/components/InviteUsers.js +143 -139
- package/CreateChannel/components/InviteUsers.js.map +1 -1
- package/CreateChannel/components/SelectChannelType.js +76 -65
- package/CreateChannel/components/SelectChannelType.js.map +1 -1
- package/CreateChannel/context.js +4 -4
- package/CreateChannel.js +27 -23
- package/CreateChannel.js.map +1 -1
- package/CreateOpenChannel/components/CreateOpenChannelUI.js +63 -52
- package/CreateOpenChannel/components/CreateOpenChannelUI.js.map +1 -1
- package/CreateOpenChannel/context.js +41 -41
- package/CreateOpenChannel.js +28 -17
- package/CreateOpenChannel.js.map +1 -1
- package/EditUserProfile/components/EditUserProfileUI.js +110 -99
- package/EditUserProfile/components/EditUserProfileUI.js.map +1 -1
- package/EditUserProfile/context.js +12 -12
- package/EditUserProfile.js +27 -16
- package/EditUserProfile.js.map +1 -1
- package/GroupChannel/components/FileViewer.js +62 -58
- package/GroupChannel/components/FileViewer.js.map +1 -1
- package/GroupChannel/components/FrozenNotification.js +10 -10
- package/GroupChannel/components/GroupChannelHeader.js +30 -28
- package/GroupChannel/components/GroupChannelHeader.js.map +1 -1
- package/GroupChannel/components/GroupChannelUI.js +68 -68
- package/GroupChannel/components/Message.js +66 -77
- package/GroupChannel/components/Message.js.map +1 -1
- package/GroupChannel/components/MessageInputWrapper.js +63 -62
- package/GroupChannel/components/MessageInputWrapper.js.map +1 -1
- package/GroupChannel/components/MessageList.js +154 -155
- package/GroupChannel/components/MessageList.js.map +1 -1
- package/GroupChannel/components/RemoveMessageModal.js +32 -27
- package/GroupChannel/components/RemoveMessageModal.js.map +1 -1
- package/GroupChannel/components/SuggestedMentionList.js +14 -14
- package/GroupChannel/components/SuggestedReplies.js +15 -14
- package/GroupChannel/components/SuggestedReplies.js.map +1 -1
- package/GroupChannel/components/TypingIndicator.js +59 -59
- package/GroupChannel/components/UnreadCount.js +26 -26
- package/GroupChannel/context.js +568 -568
- package/GroupChannel.js +65 -65
- package/GroupChannelList/components/AddGroupChannel.js +30 -27
- package/GroupChannelList/components/AddGroupChannel.js.map +1 -1
- package/GroupChannelList/components/GroupChannelListHeader.js +34 -28
- package/GroupChannelList/components/GroupChannelListHeader.js.map +1 -1
- package/GroupChannelList/components/GroupChannelListItem.js +39 -35
- package/GroupChannelList/components/GroupChannelListItem.js.map +1 -1
- package/GroupChannelList/components/GroupChannelListUI.js +86 -83
- package/GroupChannelList/components/GroupChannelListUI.js.map +1 -1
- package/GroupChannelList/components/GroupChannelPreviewAction.js +48 -44
- package/GroupChannelList/components/GroupChannelPreviewAction.js.map +1 -1
- package/GroupChannelList/context.js +81 -97
- package/GroupChannelList/context.js.map +1 -1
- package/GroupChannelList.js +43 -40
- package/GroupChannelList.js.map +1 -1
- package/Message/context.js +21 -21
- package/Message/hooks/useDirtyGetMentions.js +52 -52
- package/MessageSearch/components/MessageSearchUI.js +71 -72
- package/MessageSearch/components/MessageSearchUI.js.map +1 -1
- package/MessageSearch/context.js +247 -247
- package/MessageSearch.js +59 -59
- package/OpenChannel/components/FrozenChannelNotification.js +9 -9
- package/OpenChannel/components/OpenChannelHeader.js +43 -38
- package/OpenChannel/components/OpenChannelHeader.js.map +1 -1
- package/OpenChannel/components/OpenChannelInput.js +47 -45
- package/OpenChannel/components/OpenChannelInput.js.map +1 -1
- package/OpenChannel/components/OpenChannelMessage.js +158 -157
- package/OpenChannel/components/OpenChannelMessage.js.map +1 -1
- package/OpenChannel/components/OpenChannelMessageList.js +95 -94
- package/OpenChannel/components/OpenChannelMessageList.js.map +1 -1
- package/OpenChannel/components/OpenChannelUI.js +71 -70
- package/OpenChannel/components/OpenChannelUI.js.map +1 -1
- package/OpenChannel/context.js +23 -18
- package/OpenChannel/context.js.map +1 -1
- package/OpenChannel.js +44 -43
- package/OpenChannel.js.map +1 -1
- package/OpenChannelList/components/OpenChannelListUI.js +102 -92
- package/OpenChannelList/components/OpenChannelListUI.js.map +1 -1
- package/OpenChannelList/components/OpenChannelPreview.js +20 -20
- package/OpenChannelList/context.js +3 -3
- package/OpenChannelList.js +34 -24
- package/OpenChannelList.js.map +1 -1
- package/OpenChannelSettings/components/EditDetailsModal.js +82 -73
- package/OpenChannelSettings/components/EditDetailsModal.js.map +1 -1
- package/OpenChannelSettings/components/OpenChannelProfile.js +47 -38
- package/OpenChannelSettings/components/OpenChannelProfile.js.map +1 -1
- package/OpenChannelSettings/components/OpenChannelSettingsUI.js +61 -57
- package/OpenChannelSettings/components/OpenChannelSettingsUI.js.map +1 -1
- package/OpenChannelSettings/components/OperatorUI.js +454 -450
- package/OpenChannelSettings/components/OperatorUI.js.map +1 -1
- package/OpenChannelSettings/components/ParticipantUI.js +21 -17
- package/OpenChannelSettings/components/ParticipantUI.js.map +1 -1
- package/OpenChannelSettings/context.js +114 -114
- package/OpenChannelSettings.js +29 -25
- package/OpenChannelSettings.js.map +1 -1
- package/README.md +2 -13
- package/SendbirdProvider.js +1139 -1183
- package/SendbirdProvider.js.map +1 -1
- package/Thread/components/ParentMessageInfo.js +240 -239
- package/Thread/components/ParentMessageInfo.js.map +1 -1
- package/Thread/components/ParentMessageInfoItem.js +148 -148
- package/Thread/components/ThreadHeader.js +23 -26
- package/Thread/components/ThreadHeader.js.map +1 -1
- package/Thread/components/ThreadList.js +122 -122
- package/Thread/components/ThreadListItem.js +341 -340
- package/Thread/components/ThreadListItem.js.map +1 -1
- package/Thread/components/ThreadMessageInput.js +167 -165
- package/Thread/components/ThreadMessageInput.js.map +1 -1
- package/Thread/components/ThreadUI.js +207 -207
- package/Thread/context/types.js +21 -21
- package/Thread/context.js +1283 -1281
- package/Thread/context.js.map +1 -1
- package/Thread.js +73 -73
- package/VoicePlayer/context.js +3 -3
- package/VoicePlayer/useVoicePlayer.js +68 -60
- package/VoicePlayer/useVoicePlayer.js.map +1 -1
- package/VoiceRecorder/context.js +21 -127
- package/VoiceRecorder/context.js.map +1 -1
- package/VoiceRecorder/useVoiceRecorder.js +105 -96
- package/VoiceRecorder/useVoiceRecorder.js.map +1 -1
- package/chunks/{bundle-CNVxTIOs.js → bundle--nVHk3fx.js} +161 -162
- package/chunks/{bundle-CNVxTIOs.js.map → bundle--nVHk3fx.js.map} +1 -1
- package/chunks/{bundle-BRaG5EHs.js → bundle-2uJIsyo2.js} +27 -27
- package/chunks/bundle-2uJIsyo2.js.map +1 -0
- package/chunks/bundle-3amhHjNa.js +120 -0
- package/chunks/bundle-3amhHjNa.js.map +1 -0
- package/chunks/{bundle-Dd7yWAzk.js → bundle-7oF7KbGv.js} +2 -2
- package/chunks/{bundle-Dd7yWAzk.js.map → bundle-7oF7KbGv.js.map} +1 -1
- package/chunks/{bundle-DVDuILQh.js → bundle-9MhshueU.js} +21 -21
- package/chunks/bundle-9MhshueU.js.map +1 -0
- package/chunks/{bundle-BRt6gbIr.js → bundle-B5N2u5f-.js} +1 -1
- package/chunks/bundle-B5N2u5f-.js.map +1 -0
- package/chunks/{bundle-BZt7yK_Y.js → bundle-B7barEsR.js} +19 -19
- package/chunks/bundle-B7barEsR.js.map +1 -0
- package/chunks/{bundle-DX0g6QGP.js → bundle-B8gKMDtp.js} +28 -28
- package/chunks/bundle-B8gKMDtp.js.map +1 -0
- package/chunks/{bundle-JfMKdEOr.js → bundle-BAvMd_j0.js} +45 -46
- package/chunks/bundle-BAvMd_j0.js.map +1 -0
- package/chunks/{bundle-CpmDD_qj.js → bundle-BHn3F_OF.js} +17 -17
- package/chunks/bundle-BHn3F_OF.js.map +1 -0
- package/chunks/{bundle-D7HxTsM2.js → bundle-BJ46V6XQ.js} +10 -10
- package/chunks/bundle-BJ46V6XQ.js.map +1 -0
- package/chunks/{bundle-E_q9aH_b.js → bundle-BKho3Uub.js} +11 -11
- package/chunks/bundle-BKho3Uub.js.map +1 -0
- package/chunks/{bundle-1Vgo9VWV.js → bundle-BOSnopxk.js} +8 -8
- package/chunks/bundle-BOSnopxk.js.map +1 -0
- package/chunks/{bundle-zd7rBmLl.js → bundle-BTD0sBED.js} +89 -89
- package/chunks/{bundle-zd7rBmLl.js.map → bundle-BTD0sBED.js.map} +1 -1
- package/chunks/{bundle-Dh8TY5YU.js → bundle-BTkRy0wv.js} +94 -94
- package/chunks/{bundle-Dh8TY5YU.js.map → bundle-BTkRy0wv.js.map} +1 -1
- package/chunks/{bundle-Cgpa9xMh.js → bundle-BWCGFXhj.js} +732 -731
- package/chunks/bundle-BWCGFXhj.js.map +1 -0
- package/chunks/{bundle-DtHyIHaJ.js → bundle-BWuyd0AD.js} +37 -37
- package/chunks/bundle-BWuyd0AD.js.map +1 -0
- package/chunks/{bundle-DCzxcNn2.js → bundle-BZd5IHBF.js} +83 -83
- package/chunks/{bundle-DCzxcNn2.js.map → bundle-BZd5IHBF.js.map} +1 -1
- package/chunks/{bundle-P4HvWTGS.js → bundle-B__zC9zD.js} +131 -132
- package/chunks/bundle-B__zC9zD.js.map +1 -0
- package/chunks/bundle-BbWD2VuS.js +93 -0
- package/chunks/bundle-BbWD2VuS.js.map +1 -0
- package/chunks/{bundle-Dkj6zqd4.js → bundle-Bi8Wfc2I.js} +1326 -1327
- package/chunks/{bundle-Dkj6zqd4.js.map → bundle-Bi8Wfc2I.js.map} +1 -1
- package/chunks/{bundle-Dgyb-yNN.js → bundle-BjrRhdgd.js} +258 -258
- package/chunks/{bundle-Dgyb-yNN.js.map → bundle-BjrRhdgd.js.map} +1 -1
- package/chunks/{bundle-D_MTREEI.js → bundle-BmTGlIgs.js} +920 -923
- package/chunks/{bundle-D_MTREEI.js.map → bundle-BmTGlIgs.js.map} +1 -1
- package/chunks/{bundle-D_o_gdug.js → bundle-BtY8jyVv.js} +26 -26
- package/chunks/{bundle-D_o_gdug.js.map → bundle-BtY8jyVv.js.map} +1 -1
- package/chunks/{bundle-HHlRp7vF.js → bundle-BvG71y_P.js} +31 -31
- package/chunks/bundle-BvG71y_P.js.map +1 -0
- package/chunks/{bundle-BADg8JRM.js → bundle-BvaqGh4L.js} +5 -5
- package/chunks/bundle-BvaqGh4L.js.map +1 -0
- package/chunks/{bundle-DW4HEvvh.js → bundle-Bx5vhTbU.js} +11 -11
- package/chunks/bundle-Bx5vhTbU.js.map +1 -0
- package/chunks/{bundle-Du8hBYjM.js → bundle-Byig85JJ.js} +185 -185
- package/chunks/{bundle-Du8hBYjM.js.map → bundle-Byig85JJ.js.map} +1 -1
- package/chunks/bundle-BymWz1lX.js +30 -0
- package/chunks/bundle-BymWz1lX.js.map +1 -0
- package/chunks/{bundle-ByTQtdFM.js → bundle-ByvmbZD0.js} +36 -29
- package/chunks/bundle-ByvmbZD0.js.map +1 -0
- package/chunks/{bundle-BCAy5wyj.js → bundle-C040958G.js} +2 -2
- package/chunks/{bundle-BCAy5wyj.js.map → bundle-C040958G.js.map} +1 -1
- package/chunks/{bundle-DD0CjCiu.js → bundle-C1ds4cil.js} +1 -1
- package/chunks/{bundle-DD0CjCiu.js.map → bundle-C1ds4cil.js.map} +1 -1
- package/chunks/{bundle-BnTt0CCZ.js → bundle-C1hw1sij.js} +26 -26
- package/chunks/bundle-C1hw1sij.js.map +1 -0
- package/chunks/bundle-C4Z-NWqF.js +279 -0
- package/chunks/bundle-C4Z-NWqF.js.map +1 -0
- package/chunks/{bundle-CwG4pj5M.js → bundle-C8im5l9B.js} +234 -234
- package/chunks/{bundle-CwG4pj5M.js.map → bundle-C8im5l9B.js.map} +1 -1
- package/chunks/{bundle-B7UQ7Txq.js → bundle-CD9AzC6s.js} +35 -35
- package/chunks/bundle-CD9AzC6s.js.map +1 -0
- package/chunks/{bundle-DnhvGgBr.js → bundle-CDwtSJbC.js} +210 -206
- package/chunks/{bundle-CJPOd0Zo.js.map → bundle-CDwtSJbC.js.map} +1 -1
- package/chunks/{bundle-Bs4dcOTC.js → bundle-CIwVkd-E.js} +234 -234
- package/chunks/{bundle-Bs4dcOTC.js.map → bundle-CIwVkd-E.js.map} +1 -1
- package/chunks/{bundle-oKpBi3n1.js → bundle-CJk_QDUV.js} +58 -58
- package/chunks/bundle-CJk_QDUV.js.map +1 -0
- package/chunks/{bundle-BeTPrbXl.js → bundle-CNJMLyGJ.js} +61 -61
- package/chunks/bundle-CNJMLyGJ.js.map +1 -0
- package/chunks/{bundle-BCL7kk-0.js → bundle-CT8ZXUi2.js} +12 -12
- package/chunks/bundle-CT8ZXUi2.js.map +1 -0
- package/chunks/{bundle-BV-Kx6li.js → bundle-C_Vyt_ii.js} +25 -25
- package/chunks/bundle-C_Vyt_ii.js.map +1 -0
- package/chunks/{bundle-DFyJYJtg.js → bundle-CaaUNO3F.js} +2 -2
- package/chunks/{bundle-DFyJYJtg.js.map → bundle-CaaUNO3F.js.map} +1 -1
- package/chunks/{bundle-CWegwbZe.js → bundle-Ci146LvO.js} +370 -368
- package/chunks/{bundle-CWegwbZe.js.map → bundle-Ci146LvO.js.map} +1 -1
- package/chunks/{bundle-DcJtM5WL.js → bundle-Clhqc2C_.js} +6 -6
- package/chunks/bundle-Clhqc2C_.js.map +1 -0
- package/chunks/{bundle-gMq6CHjL.js → bundle-D2i2ti1U.js} +36 -36
- package/chunks/bundle-D2i2ti1U.js.map +1 -0
- package/chunks/{bundle-C0EFwuDi.js → bundle-DDhhxSv0.js} +64 -65
- package/chunks/bundle-DDhhxSv0.js.map +1 -0
- package/chunks/{bundle-BP5nTWqh.js → bundle-DDkUg3Os.js} +118 -118
- package/chunks/{bundle-BP5nTWqh.js.map → bundle-DDkUg3Os.js.map} +1 -1
- package/chunks/{bundle-COdy8feS.js → bundle-DJTSztr0.js} +124 -124
- package/chunks/{bundle-COdy8feS.js.map → bundle-DJTSztr0.js.map} +1 -1
- package/chunks/{bundle-Bv_BYOoN.js → bundle-DNMURwG9.js} +120 -120
- package/chunks/{bundle-Bv_BYOoN.js.map → bundle-DNMURwG9.js.map} +1 -1
- package/chunks/{bundle-DhnGzV1K.js → bundle-DO1vNias.js} +244 -244
- package/chunks/{bundle-DhnGzV1K.js.map → bundle-DO1vNias.js.map} +1 -1
- package/chunks/{bundle-BlRZqe8T.js → bundle-DQ2q-zNM.js} +1 -1
- package/chunks/bundle-DQ2q-zNM.js.map +1 -0
- package/chunks/{bundle-DKHcEPfr.js → bundle-DQFIz2Zf.js} +11 -11
- package/chunks/bundle-DQFIz2Zf.js.map +1 -0
- package/chunks/{bundle-BDxgzOKZ.js → bundle-DSOf9RKe.js} +1 -1
- package/chunks/bundle-DSOf9RKe.js.map +1 -0
- package/chunks/{bundle-Cl6qrizD.js → bundle-DThbnyZd.js} +25 -25
- package/chunks/bundle-DThbnyZd.js.map +1 -0
- package/chunks/{bundle-CJPOd0Zo.js → bundle-DXCQovsu.js} +213 -213
- package/{cjs/chunks/bundle-V3DBpR8B.js.map → chunks/bundle-DXCQovsu.js.map} +1 -1
- package/chunks/{bundle-DvPYXQcP.js → bundle-D_eJq5Xk.js} +12 -12
- package/chunks/bundle-D_eJq5Xk.js.map +1 -0
- package/chunks/{bundle-BqkgxfCT.js → bundle-DaAoUDJk.js} +164 -164
- package/chunks/{bundle-BqkgxfCT.js.map → bundle-DaAoUDJk.js.map} +1 -1
- package/chunks/{bundle-C5KSa4Q_.js → bundle-DaoHZIZy.js} +51 -51
- package/chunks/bundle-DaoHZIZy.js.map +1 -0
- package/chunks/{bundle-BrPQ1xtW.js → bundle-Diqj6For.js} +71 -71
- package/chunks/bundle-Diqj6For.js.map +1 -0
- package/chunks/{bundle-fQ4S7LIZ.js → bundle-DlfN5GTa.js} +160 -160
- package/chunks/{bundle-fQ4S7LIZ.js.map → bundle-DlfN5GTa.js.map} +1 -1
- package/chunks/{bundle-Chv9JypP.js → bundle-DmYqVYeD.js} +6 -6
- package/chunks/bundle-DmYqVYeD.js.map +1 -0
- package/chunks/{bundle-DLIFpzrP.js → bundle-DpGWywZ5.js} +138 -138
- package/chunks/bundle-DpGWywZ5.js.map +1 -0
- package/chunks/{bundle-CQt1ONzj.js → bundle-DzxiMlgV.js} +11 -12
- package/chunks/bundle-DzxiMlgV.js.map +1 -0
- package/chunks/{bundle-DChZSw0N.js → bundle-Gx0ryc_f.js} +72 -72
- package/chunks/bundle-Gx0ryc_f.js.map +1 -0
- package/chunks/{bundle-Vk50O4-7.js → bundle-HoQqraNc.js} +23 -23
- package/chunks/bundle-HoQqraNc.js.map +1 -0
- package/chunks/{bundle-BvcFQzve.js → bundle-IGQYX_K1.js} +152 -1079
- package/chunks/bundle-IGQYX_K1.js.map +1 -0
- package/chunks/{bundle-B0WDmdBo.js → bundle-Jir4hfa9.js} +13 -13
- package/chunks/bundle-Jir4hfa9.js.map +1 -0
- package/chunks/{bundle-DjFflxR1.js → bundle-LYAWKk4n.js} +78 -79
- package/chunks/bundle-LYAWKk4n.js.map +1 -0
- package/chunks/{bundle-C2qp06Ad.js → bundle-QxUVt4Ms.js} +15 -15
- package/chunks/bundle-QxUVt4Ms.js.map +1 -0
- package/chunks/{bundle-BhZQFEcG.js → bundle-ZsYMd8JA.js} +192 -185
- package/chunks/{bundle-BhZQFEcG.js.map → bundle-ZsYMd8JA.js.map} +1 -1
- package/chunks/{bundle-D0Atuq2W.js → bundle-_-vntp1z.js} +28 -28
- package/chunks/bundle-_-vntp1z.js.map +1 -0
- package/chunks/{bundle-BQcc_8oI.js → bundle-afCfXO2C.js} +22 -22
- package/chunks/bundle-afCfXO2C.js.map +1 -0
- package/chunks/{bundle-BL0tKclB.js → bundle-dC3DwujZ.js} +18 -18
- package/chunks/bundle-dC3DwujZ.js.map +1 -0
- package/chunks/{bundle-BuRpKo8a.js → bundle-fRP_rTVb.js} +75 -74
- package/chunks/bundle-fRP_rTVb.js.map +1 -0
- package/chunks/{bundle-Cf0JIqFR.js → bundle-h3a36twH.js} +48 -48
- package/chunks/bundle-h3a36twH.js.map +1 -0
- package/chunks/{bundle-C4kW5GHa.js → bundle-k3XccyCm.js} +333 -333
- package/chunks/{bundle-C4kW5GHa.js.map → bundle-k3XccyCm.js.map} +1 -1
- package/chunks/{bundle-DSw2Wyv5.js → bundle-oCSRGy9i.js} +29 -29
- package/chunks/bundle-oCSRGy9i.js.map +1 -0
- package/chunks/{bundle-DvRNa17t.js → bundle-uBJzoaNT.js} +82 -82
- package/chunks/bundle-uBJzoaNT.js.map +1 -0
- package/chunks/{bundle-8xJ-Z5vU.js → bundle-yZ1rqvSQ.js} +3 -3
- package/chunks/{bundle-8xJ-Z5vU.js.map → bundle-yZ1rqvSQ.js.map} +1 -1
- package/cjs/App.js +377 -378
- package/cjs/App.js.map +1 -1
- package/cjs/Channel/components/ChannelHeader.js +36 -34
- package/cjs/Channel/components/ChannelHeader.js.map +1 -1
- package/cjs/Channel/components/ChannelUI.js +74 -74
- package/cjs/Channel/components/FileViewer.js +37 -33
- package/cjs/Channel/components/FileViewer.js.map +1 -1
- package/cjs/Channel/components/FrozenNotification.js +5 -5
- package/cjs/Channel/components/Message.js +80 -81
- package/cjs/Channel/components/Message.js.map +1 -1
- package/cjs/Channel/components/MessageInput.js +72 -70
- package/cjs/Channel/components/MessageInput.js.map +1 -1
- package/cjs/Channel/components/MessageInputWrapper.js +45 -43
- package/cjs/Channel/components/MessageInputWrapper.js.map +1 -1
- package/cjs/Channel/components/MessageList.js +249 -250
- package/cjs/Channel/components/MessageList.js.map +1 -1
- package/cjs/Channel/components/RemoveMessageModal.js +38 -33
- package/cjs/Channel/components/RemoveMessageModal.js.map +1 -1
- package/cjs/Channel/components/SuggestedMentionList.js +29 -30
- package/cjs/Channel/components/SuggestedMentionList.js.map +1 -1
- package/cjs/Channel/components/TypingIndicator.js +6 -6
- package/cjs/Channel/components/UnreadCount.js +7 -7
- package/cjs/Channel/context.js +1453 -1453
- package/cjs/Channel/hooks/useHandleUploadFiles.js +125 -120
- package/cjs/Channel/hooks/useHandleUploadFiles.js.map +1 -1
- package/cjs/Channel/hooks/useInitialMessagesFetch.js +6 -6
- package/cjs/Channel/utils/compareMessagesForGrouping.js +50 -51
- package/cjs/Channel/utils/compareMessagesForGrouping.js.map +1 -1
- package/cjs/Channel/utils/getMessagePartsInfo.js +26 -27
- package/cjs/Channel/utils/getMessagePartsInfo.js.map +1 -1
- package/cjs/Channel.js +71 -71
- package/cjs/ChannelList/components/AddChannel.js +29 -26
- package/cjs/ChannelList/components/AddChannel.js.map +1 -1
- package/cjs/ChannelList/components/ChannelListHeader.js +13 -8
- package/cjs/ChannelList/components/ChannelListHeader.js.map +1 -1
- package/cjs/ChannelList/components/ChannelListUI.js +109 -106
- package/cjs/ChannelList/components/ChannelListUI.js.map +1 -1
- package/cjs/ChannelList/components/ChannelPreview.js +43 -38
- package/cjs/ChannelList/components/ChannelPreview.js.map +1 -1
- package/cjs/ChannelList/components/ChannelPreviewAction.js +16 -12
- package/cjs/ChannelList/components/ChannelPreviewAction.js.map +1 -1
- package/cjs/ChannelList/context.js +9 -10
- package/cjs/ChannelList/context.js.map +1 -1
- package/cjs/ChannelList.js +43 -40
- package/cjs/ChannelList.js.map +1 -1
- package/cjs/ChannelSettings/components/ChannelProfile.js +57 -47
- package/cjs/ChannelSettings/components/ChannelProfile.js.map +1 -1
- package/cjs/ChannelSettings/components/ChannelSettingsHeader.js +23 -20
- package/cjs/ChannelSettings/components/ChannelSettingsHeader.js.map +1 -1
- package/cjs/ChannelSettings/components/ChannelSettingsUI.js +78 -75
- package/cjs/ChannelSettings/components/ChannelSettingsUI.js.map +1 -1
- package/cjs/ChannelSettings/components/EditDetailsModal.js +90 -80
- package/cjs/ChannelSettings/components/EditDetailsModal.js.map +1 -1
- package/cjs/ChannelSettings/components/LeaveChannel.js +63 -53
- package/cjs/ChannelSettings/components/LeaveChannel.js.map +1 -1
- package/cjs/ChannelSettings/components/ModerationPanel.js +447 -445
- package/cjs/ChannelSettings/components/ModerationPanel.js.map +1 -1
- package/cjs/ChannelSettings/components/UserListItem.js +49 -49
- package/cjs/ChannelSettings/components/UserPanel.js +47 -45
- package/cjs/ChannelSettings/components/UserPanel.js.map +1 -1
- package/cjs/ChannelSettings/context.js +105 -105
- package/cjs/ChannelSettings.js +35 -32
- package/cjs/ChannelSettings.js.map +1 -1
- package/cjs/CreateChannel/components/CreateChannelUI.js +33 -29
- package/cjs/CreateChannel/components/CreateChannelUI.js.map +1 -1
- package/cjs/CreateChannel/components/InviteUsers.js +143 -139
- package/cjs/CreateChannel/components/InviteUsers.js.map +1 -1
- package/cjs/CreateChannel/components/SelectChannelType.js +76 -65
- package/cjs/CreateChannel/components/SelectChannelType.js.map +1 -1
- package/cjs/CreateChannel/context.js +4 -4
- package/cjs/CreateChannel.js +27 -23
- package/cjs/CreateChannel.js.map +1 -1
- package/cjs/CreateOpenChannel/components/CreateOpenChannelUI.js +63 -52
- package/cjs/CreateOpenChannel/components/CreateOpenChannelUI.js.map +1 -1
- package/cjs/CreateOpenChannel/context.js +41 -41
- package/cjs/CreateOpenChannel.js +28 -17
- package/cjs/CreateOpenChannel.js.map +1 -1
- package/cjs/EditUserProfile/components/EditUserProfileUI.js +110 -99
- package/cjs/EditUserProfile/components/EditUserProfileUI.js.map +1 -1
- package/cjs/EditUserProfile/context.js +12 -12
- package/cjs/EditUserProfile.js +27 -16
- package/cjs/EditUserProfile.js.map +1 -1
- package/cjs/GroupChannel/components/FileViewer.js +62 -58
- package/cjs/GroupChannel/components/FileViewer.js.map +1 -1
- package/cjs/GroupChannel/components/FrozenNotification.js +10 -10
- package/cjs/GroupChannel/components/GroupChannelHeader.js +30 -28
- package/cjs/GroupChannel/components/GroupChannelHeader.js.map +1 -1
- package/cjs/GroupChannel/components/GroupChannelUI.js +68 -68
- package/cjs/GroupChannel/components/Message.js +66 -77
- package/cjs/GroupChannel/components/Message.js.map +1 -1
- package/cjs/GroupChannel/components/MessageInputWrapper.js +62 -61
- package/cjs/GroupChannel/components/MessageInputWrapper.js.map +1 -1
- package/cjs/GroupChannel/components/MessageList.js +154 -155
- package/cjs/GroupChannel/components/MessageList.js.map +1 -1
- package/cjs/GroupChannel/components/RemoveMessageModal.js +32 -27
- package/cjs/GroupChannel/components/RemoveMessageModal.js.map +1 -1
- package/cjs/GroupChannel/components/SuggestedMentionList.js +14 -14
- package/cjs/GroupChannel/components/SuggestedReplies.js +15 -14
- package/cjs/GroupChannel/components/SuggestedReplies.js.map +1 -1
- package/cjs/GroupChannel/components/TypingIndicator.js +59 -59
- package/cjs/GroupChannel/components/UnreadCount.js +26 -26
- package/cjs/GroupChannel/context.js +568 -568
- package/cjs/GroupChannel.js +65 -65
- package/cjs/GroupChannelList/components/AddGroupChannel.js +30 -27
- package/cjs/GroupChannelList/components/AddGroupChannel.js.map +1 -1
- package/cjs/GroupChannelList/components/GroupChannelListHeader.js +34 -28
- package/cjs/GroupChannelList/components/GroupChannelListHeader.js.map +1 -1
- package/cjs/GroupChannelList/components/GroupChannelListItem.js +39 -35
- package/cjs/GroupChannelList/components/GroupChannelListItem.js.map +1 -1
- package/cjs/GroupChannelList/components/GroupChannelListUI.js +86 -83
- package/cjs/GroupChannelList/components/GroupChannelListUI.js.map +1 -1
- package/cjs/GroupChannelList/components/GroupChannelPreviewAction.js +48 -44
- package/cjs/GroupChannelList/components/GroupChannelPreviewAction.js.map +1 -1
- package/cjs/GroupChannelList/context.js +81 -97
- package/cjs/GroupChannelList/context.js.map +1 -1
- package/cjs/GroupChannelList.js +43 -40
- package/cjs/GroupChannelList.js.map +1 -1
- package/cjs/Message/context.js +21 -21
- package/cjs/Message/hooks/useDirtyGetMentions.js +52 -52
- package/cjs/MessageSearch/components/MessageSearchUI.js +71 -72
- package/cjs/MessageSearch/components/MessageSearchUI.js.map +1 -1
- package/cjs/MessageSearch/context.js +247 -247
- package/cjs/MessageSearch.js +59 -59
- package/cjs/OpenChannel/components/FrozenChannelNotification.js +9 -9
- package/cjs/OpenChannel/components/OpenChannelHeader.js +43 -38
- package/cjs/OpenChannel/components/OpenChannelHeader.js.map +1 -1
- package/cjs/OpenChannel/components/OpenChannelInput.js +47 -45
- package/cjs/OpenChannel/components/OpenChannelInput.js.map +1 -1
- package/cjs/OpenChannel/components/OpenChannelMessage.js +158 -157
- package/cjs/OpenChannel/components/OpenChannelMessage.js.map +1 -1
- package/cjs/OpenChannel/components/OpenChannelMessageList.js +95 -94
- package/cjs/OpenChannel/components/OpenChannelMessageList.js.map +1 -1
- package/cjs/OpenChannel/components/OpenChannelUI.js +71 -70
- package/cjs/OpenChannel/components/OpenChannelUI.js.map +1 -1
- package/cjs/OpenChannel/context.js +23 -18
- package/cjs/OpenChannel/context.js.map +1 -1
- package/cjs/OpenChannel.js +44 -43
- package/cjs/OpenChannel.js.map +1 -1
- package/cjs/OpenChannelList/components/OpenChannelListUI.js +102 -92
- package/cjs/OpenChannelList/components/OpenChannelListUI.js.map +1 -1
- package/cjs/OpenChannelList/components/OpenChannelPreview.js +20 -20
- package/cjs/OpenChannelList/context.js +3 -3
- package/cjs/OpenChannelList.js +34 -24
- package/cjs/OpenChannelList.js.map +1 -1
- package/cjs/OpenChannelSettings/components/EditDetailsModal.js +82 -73
- package/cjs/OpenChannelSettings/components/EditDetailsModal.js.map +1 -1
- package/cjs/OpenChannelSettings/components/OpenChannelProfile.js +47 -38
- package/cjs/OpenChannelSettings/components/OpenChannelProfile.js.map +1 -1
- package/cjs/OpenChannelSettings/components/OpenChannelSettingsUI.js +61 -57
- package/cjs/OpenChannelSettings/components/OpenChannelSettingsUI.js.map +1 -1
- package/cjs/OpenChannelSettings/components/OperatorUI.js +454 -450
- package/cjs/OpenChannelSettings/components/OperatorUI.js.map +1 -1
- package/cjs/OpenChannelSettings/components/ParticipantUI.js +21 -17
- package/cjs/OpenChannelSettings/components/ParticipantUI.js.map +1 -1
- package/cjs/OpenChannelSettings/context.js +114 -114
- package/cjs/OpenChannelSettings.js +29 -25
- package/cjs/OpenChannelSettings.js.map +1 -1
- package/cjs/SendbirdProvider.js +1139 -1183
- package/cjs/SendbirdProvider.js.map +1 -1
- package/cjs/Thread/components/ParentMessageInfo.js +240 -239
- package/cjs/Thread/components/ParentMessageInfo.js.map +1 -1
- package/cjs/Thread/components/ParentMessageInfoItem.js +148 -148
- package/cjs/Thread/components/ThreadHeader.js +22 -25
- package/cjs/Thread/components/ThreadHeader.js.map +1 -1
- package/cjs/Thread/components/ThreadList.js +122 -122
- package/cjs/Thread/components/ThreadListItem.js +341 -340
- package/cjs/Thread/components/ThreadListItem.js.map +1 -1
- package/cjs/Thread/components/ThreadMessageInput.js +167 -165
- package/cjs/Thread/components/ThreadMessageInput.js.map +1 -1
- package/cjs/Thread/components/ThreadUI.js +207 -207
- package/cjs/Thread/context/types.js +21 -21
- package/cjs/Thread/context.js +1283 -1281
- package/cjs/Thread/context.js.map +1 -1
- package/cjs/Thread.js +73 -73
- package/cjs/VoicePlayer/context.js +3 -3
- package/cjs/VoicePlayer/useVoicePlayer.js +68 -60
- package/cjs/VoicePlayer/useVoicePlayer.js.map +1 -1
- package/cjs/VoiceRecorder/context.js +25 -127
- package/cjs/VoiceRecorder/context.js.map +1 -1
- package/cjs/VoiceRecorder/useVoiceRecorder.js +105 -96
- package/cjs/VoiceRecorder/useVoiceRecorder.js.map +1 -1
- package/cjs/chunks/{bundle-B0Cl8cKp.js → bundle-1XtsxT8L.js} +10 -10
- package/cjs/chunks/bundle-1XtsxT8L.js.map +1 -0
- package/cjs/chunks/{bundle-BGhSB8RW.js → bundle-4vdy6J5u.js} +17 -17
- package/cjs/chunks/bundle-4vdy6J5u.js.map +1 -0
- package/cjs/chunks/{bundle-Cm_quRwQ.js → bundle-5_kPn4wU.js} +77 -79
- package/cjs/chunks/bundle-5_kPn4wU.js.map +1 -0
- package/cjs/chunks/{bundle-DhgoVGKx.js → bundle-7UHC8ujA.js} +94 -94
- package/cjs/chunks/{bundle-DhgoVGKx.js.map → bundle-7UHC8ujA.js.map} +1 -1
- package/cjs/chunks/{bundle-DpiYQ60c.js → bundle-8VyIP0TE.js} +1 -1
- package/cjs/chunks/bundle-8VyIP0TE.js.map +1 -0
- package/cjs/chunks/{bundle-DiTafQuL.js → bundle-B-olJv7b.js} +1326 -1327
- package/cjs/chunks/{bundle-DiTafQuL.js.map → bundle-B-olJv7b.js.map} +1 -1
- package/cjs/chunks/{bundle-BeCXSzTg.js → bundle-B31bbem0.js} +192 -185
- package/cjs/chunks/bundle-B31bbem0.js.map +1 -0
- package/cjs/chunks/{bundle-ROscI12S.js → bundle-BBoPpUMg.js} +22 -22
- package/cjs/chunks/bundle-BBoPpUMg.js.map +1 -0
- package/cjs/chunks/{bundle-DTZwXpbk.js → bundle-BLc7P6Sp.js} +244 -244
- package/cjs/chunks/bundle-BLc7P6Sp.js.map +1 -0
- package/cjs/chunks/{bundle-BZcKIqEO.js → bundle-BOkZUm8a.js} +27 -27
- package/cjs/chunks/bundle-BOkZUm8a.js.map +1 -0
- package/cjs/chunks/{bundle-CMhCS1lF.js → bundle-BSAWCcb_.js} +920 -923
- package/cjs/chunks/{bundle-CMhCS1lF.js.map → bundle-BSAWCcb_.js.map} +1 -1
- package/cjs/chunks/bundle-BTU876jx.js +95 -0
- package/cjs/chunks/{bundle-xeBPrPlZ.js.map → bundle-BTU876jx.js.map} +1 -1
- package/cjs/chunks/{bundle-xeBPrPlZ.js → bundle-BTod-EOk.js} +83 -83
- package/cjs/chunks/bundle-BTod-EOk.js.map +1 -0
- package/cjs/chunks/{bundle-XPPVGabQ.js → bundle-BWGOXLHb.js} +1 -1
- package/cjs/chunks/{bundle-XPPVGabQ.js.map → bundle-BWGOXLHb.js.map} +1 -1
- package/cjs/chunks/{bundle-BVXtMOiP.js → bundle-BXEGf4g2.js} +164 -164
- package/cjs/chunks/{bundle-BVXtMOiP.js.map → bundle-BXEGf4g2.js.map} +1 -1
- package/cjs/chunks/{bundle-tVtQpJ4n.js → bundle-B_51Svr9.js} +3 -3
- package/cjs/chunks/{bundle-tVtQpJ4n.js.map → bundle-B_51Svr9.js.map} +1 -1
- package/cjs/chunks/{bundle-B5nh0Mif.js → bundle-BaAUvjl9.js} +6 -6
- package/cjs/chunks/bundle-BaAUvjl9.js.map +1 -0
- package/cjs/chunks/{bundle-tBlsssMV.js → bundle-BaM5Ed34.js} +160 -160
- package/cjs/chunks/{bundle-tBlsssMV.js.map → bundle-BaM5Ed34.js.map} +1 -1
- package/cjs/chunks/{bundle-DTzDEbe0.js → bundle-BaQc9oOW.js} +29 -29
- package/cjs/chunks/bundle-BaQc9oOW.js.map +1 -0
- package/cjs/chunks/{bundle-BrrYIsp-.js → bundle-BhCAlWKP.js} +11 -11
- package/cjs/chunks/bundle-BhCAlWKP.js.map +1 -0
- package/cjs/chunks/{bundle-DEOaRh_m.js → bundle-Bi-soOXA.js} +258 -258
- package/cjs/chunks/bundle-Bi-soOXA.js.map +1 -0
- package/cjs/chunks/{bundle-CYFSAQ2T.js → bundle-BjgfoBVC.js} +26 -26
- package/cjs/chunks/bundle-BjgfoBVC.js.map +1 -0
- package/cjs/chunks/{bundle-_VH8bxGE.js → bundle-BoLhr7Ko.js} +36 -28
- package/cjs/chunks/bundle-BoLhr7Ko.js.map +1 -0
- package/cjs/chunks/{bundle-DZl6cYvA.js → bundle-BrNoc2XZ.js} +185 -185
- package/cjs/chunks/bundle-BrNoc2XZ.js.map +1 -0
- package/cjs/chunks/{bundle-xpQ8gY1k.js → bundle-BwQ4BJif.js} +71 -71
- package/cjs/chunks/bundle-BwQ4BJif.js.map +1 -0
- package/cjs/chunks/{bundle-DYU6eNDJ.js → bundle-ByyccRIt.js} +210 -206
- package/cjs/chunks/{bundle-DXrpp6AJ.js.map → bundle-ByyccRIt.js.map} +1 -1
- package/cjs/chunks/{bundle-Dc_hFK8U.js → bundle-C1XVsHlE.js} +51 -51
- package/cjs/chunks/bundle-C1XVsHlE.js.map +1 -0
- package/cjs/chunks/{bundle-Dfqk1zRa.js → bundle-C3DKUT4Q.js} +26 -26
- package/cjs/chunks/bundle-C3DKUT4Q.js.map +1 -0
- package/cjs/chunks/{bundle-B2K8d_Kr.js → bundle-C3RFfU6_.js} +89 -89
- package/cjs/chunks/bundle-C3RFfU6_.js.map +1 -0
- package/cjs/chunks/{bundle-CFpokORf.js → bundle-C51HeaX4.js} +25 -25
- package/cjs/chunks/bundle-C51HeaX4.js.map +1 -0
- package/cjs/chunks/{bundle-DYdwn7HI.js → bundle-C6a-umLQ.js} +131 -132
- package/cjs/chunks/bundle-C6a-umLQ.js.map +1 -0
- package/cjs/chunks/{bundle-D1gE5kRR.js → bundle-C93-onMF.js} +12 -12
- package/cjs/chunks/bundle-C93-onMF.js.map +1 -0
- package/cjs/chunks/{bundle-CT33owD4.js → bundle-CAUMYdVU.js} +19 -19
- package/cjs/chunks/bundle-CAUMYdVU.js.map +1 -0
- package/cjs/chunks/{bundle-COwRojr8.js → bundle-CDIVI7bT.js} +146 -1073
- package/cjs/chunks/bundle-CDIVI7bT.js.map +1 -0
- package/cjs/chunks/{bundle-oEFvi6H_.js → bundle-CE6bFQmu.js} +118 -118
- package/cjs/chunks/bundle-CE6bFQmu.js.map +1 -0
- package/cjs/chunks/{bundle-DF9nQRmT.js → bundle-CLOaQmX9.js} +138 -138
- package/cjs/chunks/bundle-CLOaQmX9.js.map +1 -0
- package/cjs/chunks/{bundle-DRneqmmM.js → bundle-CQ34zxiR.js} +36 -36
- package/cjs/chunks/bundle-CQ34zxiR.js.map +1 -0
- package/cjs/chunks/{bundle-CUue3xhm.js → bundle-CR04Yhbr.js} +8 -8
- package/cjs/chunks/bundle-CR04Yhbr.js.map +1 -0
- package/cjs/chunks/bundle-CZfcXYaX.js +292 -0
- package/cjs/chunks/bundle-CZfcXYaX.js.map +1 -0
- package/cjs/chunks/{bundle-V3DBpR8B.js → bundle-Cgl5e8xs.js} +213 -213
- package/cjs/chunks/bundle-Cgl5e8xs.js.map +1 -0
- package/cjs/chunks/{bundle-xkYrx6pX.js → bundle-CmpLg1_S.js} +15 -15
- package/cjs/chunks/bundle-CmpLg1_S.js.map +1 -0
- package/cjs/chunks/{bundle-DxeOzVdw.js → bundle-Com-Z-XI.js} +82 -82
- package/cjs/chunks/bundle-Com-Z-XI.js.map +1 -0
- package/cjs/chunks/{bundle-ZtEjNaVg.js → bundle-CsJKON_3.js} +120 -120
- package/cjs/chunks/bundle-CsJKON_3.js.map +1 -0
- package/cjs/chunks/{bundle-C1XDY35t.js → bundle-D-qAbZhp.js} +48 -48
- package/cjs/chunks/bundle-D-qAbZhp.js.map +1 -0
- package/cjs/chunks/{bundle-BSV6l3PT.js → bundle-D4aDRH9m.js} +1 -1
- package/cjs/chunks/bundle-D4aDRH9m.js.map +1 -0
- package/cjs/chunks/{bundle-ADOJwNcx.js → bundle-D6E8Fmnl.js} +333 -333
- package/cjs/chunks/{bundle-ADOJwNcx.js.map → bundle-D6E8Fmnl.js.map} +1 -1
- package/cjs/chunks/{bundle-Bcgo-8Wz.js → bundle-D8gia2Hg.js} +11 -12
- package/cjs/chunks/bundle-D8gia2Hg.js.map +1 -0
- package/cjs/chunks/{bundle-DiMvAbrw.js → bundle-DAIf7fWo.js} +28 -28
- package/cjs/chunks/bundle-DAIf7fWo.js.map +1 -0
- package/cjs/chunks/{bundle-BEDFWZBT.js → bundle-DAj-1QVM.js} +2 -2
- package/cjs/chunks/{bundle-BEDFWZBT.js.map → bundle-DAj-1QVM.js.map} +1 -1
- package/cjs/chunks/{bundle-Bu7SLdLc.js → bundle-DAxedY0T.js} +23 -23
- package/cjs/chunks/bundle-DAxedY0T.js.map +1 -0
- package/cjs/chunks/{bundle-CFZ-HdZV.js → bundle-DMGpM9Ye.js} +370 -368
- package/cjs/chunks/{bundle-CFZ-HdZV.js.map → bundle-DMGpM9Ye.js.map} +1 -1
- package/cjs/chunks/{bundle-BWtc6aAL.js → bundle-DQy218lT.js} +31 -31
- package/cjs/chunks/bundle-DQy218lT.js.map +1 -0
- package/cjs/chunks/{bundle-CGNRfqfQ.js → bundle-DRp9IuV2.js} +28 -28
- package/cjs/chunks/bundle-DRp9IuV2.js.map +1 -0
- package/cjs/chunks/{bundle-C-sGYQWV.js → bundle-DRy7eNJ0.js} +11 -11
- package/cjs/chunks/bundle-DRy7eNJ0.js.map +1 -0
- package/cjs/chunks/{bundle-waMogQH7.js → bundle-DTCz0BH1.js} +161 -162
- package/cjs/chunks/bundle-DTCz0BH1.js.map +1 -0
- package/cjs/chunks/{bundle-Amd_tEFX.js → bundle-DcSTnNI0.js} +64 -65
- package/cjs/chunks/bundle-DcSTnNI0.js.map +1 -0
- package/cjs/chunks/{bundle-eHc2IloF.js → bundle-DdxJqNSP.js} +1 -1
- package/cjs/chunks/bundle-DdxJqNSP.js.map +1 -0
- package/cjs/chunks/{bundle-Vfq24KlC.js → bundle-DeQZn8GZ.js} +75 -74
- package/cjs/chunks/bundle-DeQZn8GZ.js.map +1 -0
- package/cjs/chunks/{bundle-CqfYJ2-A.js → bundle-Dehhi1FZ.js} +37 -37
- package/cjs/chunks/bundle-Dehhi1FZ.js.map +1 -0
- package/cjs/chunks/{bundle-BgJJI84U.js → bundle-DfcEln0Z.js} +34 -34
- package/cjs/chunks/bundle-DfcEln0Z.js.map +1 -0
- package/cjs/chunks/bundle-DmX69_-l.js +32 -0
- package/cjs/chunks/bundle-DmX69_-l.js.map +1 -0
- package/cjs/chunks/{bundle-Chvgl0tl.js → bundle-Dnq2YP_l.js} +6 -6
- package/cjs/chunks/bundle-Dnq2YP_l.js.map +1 -0
- package/cjs/chunks/{bundle-DU2DrCMu.js → bundle-Dww6fCVQ.js} +13 -13
- package/cjs/chunks/bundle-Dww6fCVQ.js.map +1 -0
- package/cjs/chunks/{bundle-BjHWj0YM.js → bundle-DxSB9NRz.js} +61 -61
- package/cjs/chunks/bundle-DxSB9NRz.js.map +1 -0
- package/cjs/chunks/{bundle-BwzMNAFs.js → bundle-HGbi-rCv.js} +1 -1
- package/cjs/chunks/bundle-HGbi-rCv.js.map +1 -0
- package/cjs/chunks/{bundle-CRtD-LF2.js → bundle-JtgSY0zB.js} +58 -58
- package/cjs/chunks/bundle-JtgSY0zB.js.map +1 -0
- package/cjs/chunks/{bundle-CZ-C_W9P.js → bundle-L3FEqZsK.js} +234 -234
- package/cjs/chunks/{bundle-CZ-C_W9P.js.map → bundle-L3FEqZsK.js.map} +1 -1
- package/cjs/chunks/{bundle-Dnrc5q_J.js → bundle-N_CwOE5a.js} +124 -124
- package/cjs/chunks/bundle-N_CwOE5a.js.map +1 -0
- package/cjs/chunks/bundle-Q4icQ1qH.js +122 -0
- package/cjs/chunks/bundle-Q4icQ1qH.js.map +1 -0
- package/cjs/chunks/{bundle-CkBOTPET.js → bundle-T4lp5F85.js} +25 -25
- package/cjs/chunks/bundle-T4lp5F85.js.map +1 -0
- package/cjs/chunks/{bundle-LJi0Ftvu.js → bundle-Tjx9wNAv.js} +21 -21
- package/cjs/chunks/bundle-Tjx9wNAv.js.map +1 -0
- package/cjs/chunks/{bundle-COM-Vp38.js → bundle-X03vJTEw.js} +45 -46
- package/cjs/chunks/bundle-X03vJTEw.js.map +1 -0
- package/cjs/chunks/{bundle-DhB9bJf0.js → bundle-_ekaw3iI.js} +18 -18
- package/cjs/chunks/bundle-_ekaw3iI.js.map +1 -0
- package/cjs/chunks/{bundle-B1UxSAT6.js → bundle-bqRlVm3u.js} +12 -12
- package/cjs/chunks/bundle-bqRlVm3u.js.map +1 -0
- package/cjs/chunks/{bundle-DXrpp6AJ.js → bundle-gtkPlUrw.js} +234 -234
- package/cjs/chunks/bundle-gtkPlUrw.js.map +1 -0
- package/cjs/chunks/{bundle-C0Gtok_c.js → bundle-miB6ue8g.js} +72 -72
- package/cjs/chunks/bundle-miB6ue8g.js.map +1 -0
- package/cjs/chunks/{bundle-Cg6exdly.js → bundle-oeWNUdCB.js} +11 -11
- package/cjs/chunks/bundle-oeWNUdCB.js.map +1 -0
- package/cjs/chunks/{bundle-BACbqv7X.js → bundle-qI5gnScC.js} +5 -5
- package/cjs/chunks/bundle-qI5gnScC.js.map +1 -0
- package/cjs/chunks/{bundle-m2yaPSNj.js → bundle-wMKhbE3c.js} +2 -2
- package/cjs/chunks/{bundle-m2yaPSNj.js.map → bundle-wMKhbE3c.js.map} +1 -1
- package/cjs/chunks/{bundle-BTEk9dhT.js → bundle-wl1uuzU7.js} +733 -730
- package/cjs/chunks/bundle-wl1uuzU7.js.map +1 -0
- package/cjs/handlers/OpenChannelHandler.js +2 -2
- package/cjs/handlers/SessionHandler.js +2 -2
- package/cjs/hooks/useModal.js +25 -48
- package/cjs/hooks/useModal.js.map +1 -1
- package/cjs/index.js +80 -81
- package/cjs/index.js.map +1 -1
- package/cjs/pubSub/topics.js +1 -1
- package/cjs/sendbirdSelectors.js +550 -550
- package/cjs/ui/Accordion.js +25 -25
- package/cjs/ui/AccordionGroup.js +40 -40
- package/cjs/ui/AdminMessage.js +13 -13
- package/cjs/ui/Avatar.js +4 -4
- package/cjs/ui/Badge.js +18 -18
- package/cjs/ui/BottomSheet.js +40 -26
- package/cjs/ui/BottomSheet.js.map +1 -1
- package/cjs/ui/Button.js +41 -41
- package/cjs/ui/ChannelAvatar.js +21 -21
- package/cjs/ui/Checkbox.js +15 -15
- package/cjs/ui/ConnectionStatus.js +11 -11
- package/cjs/ui/ContextMenu.js +180 -267
- package/cjs/ui/ContextMenu.js.map +1 -1
- package/cjs/ui/DateSeparator.js +13 -13
- package/cjs/ui/EmojiReactions.js +167 -164
- package/cjs/ui/EmojiReactions.js.map +1 -1
- package/cjs/ui/FallbackTemplateMessageItemBody.tsx.js +20 -21
- package/cjs/ui/FallbackTemplateMessageItemBody.tsx.js.map +1 -1
- package/cjs/ui/FeedbackIconButton.js +14 -14
- package/cjs/ui/FileMessageItemBody.js +65 -66
- package/cjs/ui/FileMessageItemBody.js.map +1 -1
- package/cjs/ui/FileViewer.js +23 -17
- package/cjs/ui/FileViewer.js.map +1 -1
- package/cjs/ui/Header.js +53 -0
- package/cjs/ui/Header.js.map +1 -0
- package/cjs/ui/Icon.js +844 -964
- package/cjs/ui/Icon.js.map +1 -1
- package/cjs/ui/IconButton.js +18 -18
- package/cjs/ui/ImageRenderer.js +151 -151
- package/cjs/ui/Input.js +15 -15
- package/cjs/ui/Label.js +4 -4
- package/cjs/ui/LinkLabel.js +21 -21
- package/cjs/ui/Loader.js +11 -11
- package/cjs/ui/LoadingTemplateMessageItemBody.tsx.js +13 -14
- package/cjs/ui/LoadingTemplateMessageItemBody.tsx.js.map +1 -1
- package/cjs/ui/MentionLabel.js +50 -50
- package/cjs/ui/MentionUserLabel.js +4 -4
- package/cjs/ui/MessageContent.js +586 -581
- package/cjs/ui/MessageContent.js.map +1 -1
- package/cjs/ui/MessageFeedbackFailedModal.js +34 -22
- package/cjs/ui/MessageFeedbackFailedModal.js.map +1 -1
- package/cjs/ui/MessageFeedbackModal.js +66 -54
- package/cjs/ui/MessageFeedbackModal.js.map +1 -1
- package/cjs/ui/MessageInput/hooks/usePaste.js +7 -7
- package/cjs/ui/MessageInput.js +423 -424
- package/cjs/ui/MessageInput.js.map +1 -1
- package/cjs/ui/MessageItemMenu.js +134 -134
- package/cjs/ui/MessageItemReactionMenu.js +42 -42
- package/cjs/ui/MessageSearchFileItem.js +77 -78
- package/cjs/ui/MessageSearchFileItem.js.map +1 -1
- package/cjs/ui/MessageSearchItem.js +50 -50
- package/cjs/ui/MessageStatus.js +11 -12
- package/cjs/ui/MessageStatus.js.map +1 -1
- package/cjs/ui/MessageTemplate.js +1 -2
- package/cjs/ui/MessageTemplate.js.map +1 -1
- package/cjs/ui/MobileFeedbackMenu.js +36 -25
- package/cjs/ui/MobileFeedbackMenu.js.map +1 -1
- package/cjs/ui/Modal.js +21 -8
- package/cjs/ui/Modal.js.map +1 -1
- package/cjs/ui/MutedAvatarOverlay.js +14 -14
- package/cjs/ui/OGMessageItemBody.js +76 -76
- package/cjs/ui/OpenChannelAdminMessage.js +9 -9
- package/cjs/ui/OpenChannelAvatar.js +15 -15
- package/cjs/ui/OpenchannelConversationHeader.js +22 -22
- package/cjs/ui/OpenchannelFileMessage.js +117 -117
- package/cjs/ui/OpenchannelOGMessage.js +146 -146
- package/cjs/ui/OpenchannelThumbnailMessage.js +155 -155
- package/cjs/ui/OpenchannelUserMessage.js +128 -128
- package/cjs/ui/PlaceHolder.js +45 -45
- package/cjs/ui/PlaybackTime.js +11 -11
- package/cjs/ui/ProgressBar.js +12 -12
- package/cjs/ui/QuoteMessage.js +69 -70
- package/cjs/ui/QuoteMessage.js.map +1 -1
- package/cjs/ui/QuoteMessageInput.js +66 -67
- package/cjs/ui/QuoteMessageInput.js.map +1 -1
- package/cjs/ui/ReactionBadge.js +20 -20
- package/cjs/ui/ReactionButton.js +17 -17
- package/cjs/ui/SortByRow.js +23 -23
- package/cjs/ui/TemplateMessageItemBody.js +423 -424
- package/cjs/ui/TemplateMessageItemBody.js.map +1 -1
- package/cjs/ui/TextButton.js +9 -9
- package/cjs/ui/TextMessageItemBody.js +44 -44
- package/cjs/ui/ThreadReplies.js +34 -34
- package/cjs/ui/ThumbnailMessageItemBody.js +36 -37
- package/cjs/ui/ThumbnailMessageItemBody.js.map +1 -1
- package/cjs/ui/Toggle.js +110 -110
- package/cjs/ui/Tooltip.js +9 -9
- package/cjs/ui/TooltipWrapper.js +13 -13
- package/cjs/ui/TypingIndicatorBubble.js +56 -56
- package/cjs/ui/UnknownMessageItemBody.js +19 -20
- package/cjs/ui/UnknownMessageItemBody.js.map +1 -1
- package/cjs/ui/UserListItem.js +56 -56
- package/cjs/ui/UserProfile.js +45 -45
- package/cjs/ui/VoiceMessageInput.js +9 -9
- package/cjs/ui/VoiceMessageItemBody.js +62 -54
- package/cjs/ui/VoiceMessageItemBody.js.map +1 -1
- package/cjs/ui/Word.js +41 -41
- package/cjs/useSendbirdStateContext.js +15 -15
- package/cjs/utils/message/getOutgoingMessageState.js +32 -32
- package/cjs/utils/message/isVoiceMessage.js +2 -3
- package/cjs/utils/message/isVoiceMessage.js.map +1 -1
- package/cjs/withSendbird.js +17 -17
- package/dist/index.css +195 -169
- package/dist/index.css.map +1 -1
- package/handlers/OpenChannelHandler.js +2 -2
- package/handlers/SessionHandler.js +2 -2
- package/hooks/useModal.js +22 -50
- package/hooks/useModal.js.map +1 -1
- package/index.js +80 -81
- package/index.js.map +1 -1
- package/package.json +13 -5
- package/pubSub/topics.js +1 -1
- package/sendbirdSelectors.js +550 -550
- package/types/lib/pubSub/topics.d.ts +2 -2
- package/types/lib/types.d.ts +50 -15
- package/types/modules/App/index.d.ts +17 -10
- package/types/modules/Channel/context/ChannelProvider.d.ts +1 -4
- package/types/modules/ChannelList/components/ChannelPreviewAction.d.ts +2 -2
- package/types/modules/ChannelSettings/components/ChannelSettingsUI/ChannelSettingsHeader.d.ts +4 -3
- package/types/modules/GroupChannel/components/FileViewer/FileViewerView.d.ts +2 -2
- package/types/modules/GroupChannel/components/GroupChannelHeader/GroupChannelHeaderView.d.ts +3 -2
- package/types/modules/GroupChannel/components/GroupChannelHeader/index.d.ts +3 -2
- package/types/modules/GroupChannel/components/MessageInputWrapper/MessageInputWrapperView.d.ts +1 -1
- package/types/modules/GroupChannel/components/MessageInputWrapper/VoiceMessageInputWrapper.d.ts +2 -2
- package/types/modules/GroupChannel/components/MessageInputWrapper/index.d.ts +1 -1
- package/types/modules/GroupChannel/components/SuggestedReplies/index.d.ts +3 -1
- package/types/modules/GroupChannelList/components/GroupChannelListHeader/index.d.ts +4 -2
- package/types/modules/MessageSearch/context/MessageSearchProvider.d.ts +1 -1
- package/types/modules/OpenChannelApp/index.d.ts +3 -3
- package/types/modules/Thread/components/ThreadHeader/index.d.ts +2 -2
- package/types/ui/Header/index.d.ts +45 -0
- package/types/ui/Icon/index.d.ts +2 -3
- package/types/ui/Label/index.d.ts +3 -4
- package/types/ui/MessageInput/hooks/usePaste/consts.d.ts +1 -1
- package/types/ui/Modal/index.d.ts +2 -4
- package/types/ui/TextButton/index.d.ts +1 -1
- package/types/ui/Toggle/ToggleContainer.d.ts +2 -1
- package/types/utils/index.d.ts +0 -1
- package/types/utils/utils.d.ts +2 -0
- package/ui/Accordion.js +25 -25
- package/ui/AccordionGroup.js +40 -40
- package/ui/AdminMessage.js +13 -13
- package/ui/Avatar.js +4 -4
- package/ui/Badge.js +18 -18
- package/ui/BottomSheet.js +40 -26
- package/ui/BottomSheet.js.map +1 -1
- package/ui/Button.js +41 -41
- package/ui/ChannelAvatar.js +21 -21
- package/ui/Checkbox.js +15 -15
- package/ui/ConnectionStatus.js +11 -11
- package/ui/ContextMenu.js +180 -267
- package/ui/ContextMenu.js.map +1 -1
- package/ui/DateSeparator.js +13 -13
- package/ui/EmojiReactions.js +167 -164
- package/ui/EmojiReactions.js.map +1 -1
- package/ui/FallbackTemplateMessageItemBody.tsx.js +20 -21
- package/ui/FallbackTemplateMessageItemBody.tsx.js.map +1 -1
- package/ui/FeedbackIconButton.js +14 -14
- package/ui/FileMessageItemBody.js +65 -66
- package/ui/FileMessageItemBody.js.map +1 -1
- package/ui/FileViewer.js +23 -17
- package/ui/FileViewer.js.map +1 -1
- package/ui/Header.js +45 -0
- package/ui/Header.js.map +1 -0
- package/ui/Icon.js +845 -965
- package/ui/Icon.js.map +1 -1
- package/ui/IconButton.js +18 -18
- package/ui/ImageRenderer.js +151 -151
- package/ui/Input.js +15 -15
- package/ui/Label.js +3 -3
- package/ui/LinkLabel.js +21 -21
- package/ui/Loader.js +11 -11
- package/ui/LoadingTemplateMessageItemBody.tsx.js +13 -14
- package/ui/LoadingTemplateMessageItemBody.tsx.js.map +1 -1
- package/ui/MentionLabel.js +50 -50
- package/ui/MentionUserLabel.js +4 -4
- package/ui/MessageContent.js +586 -581
- package/ui/MessageContent.js.map +1 -1
- package/ui/MessageFeedbackFailedModal.js +34 -22
- package/ui/MessageFeedbackFailedModal.js.map +1 -1
- package/ui/MessageFeedbackModal.js +66 -54
- package/ui/MessageFeedbackModal.js.map +1 -1
- package/ui/MessageInput/hooks/usePaste.js +7 -7
- package/ui/MessageInput.js +423 -424
- package/ui/MessageInput.js.map +1 -1
- package/ui/MessageItemMenu.js +134 -134
- package/ui/MessageItemReactionMenu.js +42 -42
- package/ui/MessageSearchFileItem.js +77 -78
- package/ui/MessageSearchFileItem.js.map +1 -1
- package/ui/MessageSearchItem.js +50 -50
- package/ui/MessageStatus.js +11 -12
- package/ui/MessageStatus.js.map +1 -1
- package/ui/MessageTemplate.js +1 -2
- package/ui/MessageTemplate.js.map +1 -1
- package/ui/MobileFeedbackMenu.js +36 -25
- package/ui/MobileFeedbackMenu.js.map +1 -1
- package/ui/Modal.js +21 -8
- package/ui/Modal.js.map +1 -1
- package/ui/MutedAvatarOverlay.js +14 -14
- package/ui/OGMessageItemBody.js +76 -76
- package/ui/OpenChannelAdminMessage.js +9 -9
- package/ui/OpenChannelAvatar.js +15 -15
- package/ui/OpenchannelConversationHeader.js +22 -22
- package/ui/OpenchannelFileMessage.js +117 -117
- package/ui/OpenchannelOGMessage.js +146 -146
- package/ui/OpenchannelThumbnailMessage.js +155 -155
- package/ui/OpenchannelUserMessage.js +128 -128
- package/ui/PlaceHolder.js +45 -45
- package/ui/PlaybackTime.js +11 -11
- package/ui/ProgressBar.js +12 -12
- package/ui/QuoteMessage.js +69 -70
- package/ui/QuoteMessage.js.map +1 -1
- package/ui/QuoteMessageInput.js +66 -67
- package/ui/QuoteMessageInput.js.map +1 -1
- package/ui/ReactionBadge.js +20 -20
- package/ui/ReactionButton.js +17 -17
- package/ui/SortByRow.js +23 -23
- package/ui/TemplateMessageItemBody.js +423 -424
- package/ui/TemplateMessageItemBody.js.map +1 -1
- package/ui/TextButton.js +9 -9
- package/ui/TextMessageItemBody.js +44 -44
- package/ui/ThreadReplies.js +34 -34
- package/ui/ThumbnailMessageItemBody.js +36 -37
- package/ui/ThumbnailMessageItemBody.js.map +1 -1
- package/ui/Toggle.js +110 -110
- package/ui/Tooltip.js +9 -9
- package/ui/TooltipWrapper.js +13 -13
- package/ui/TypingIndicatorBubble.js +56 -56
- package/ui/UnknownMessageItemBody.js +19 -20
- package/ui/UnknownMessageItemBody.js.map +1 -1
- package/ui/UserListItem.js +56 -56
- package/ui/UserProfile.js +45 -45
- package/ui/VoiceMessageInput.js +9 -9
- package/ui/VoiceMessageItemBody.js +62 -54
- package/ui/VoiceMessageItemBody.js.map +1 -1
- package/ui/Word.js +41 -41
- package/useSendbirdStateContext.js +15 -15
- package/utils/message/getOutgoingMessageState.js +32 -32
- package/utils/message/isVoiceMessage.js +2 -3
- package/utils/message/isVoiceMessage.js.map +1 -1
- package/withSendbird.js +17 -17
- package/chunks/bundle-1Vgo9VWV.js.map +0 -1
- package/chunks/bundle-58U1RLA2.js +0 -4
- package/chunks/bundle-58U1RLA2.js.map +0 -1
- package/chunks/bundle-B0WDmdBo.js.map +0 -1
- package/chunks/bundle-B7UQ7Txq.js.map +0 -1
- package/chunks/bundle-BADg8JRM.js.map +0 -1
- package/chunks/bundle-BCL7kk-0.js.map +0 -1
- package/chunks/bundle-BDxgzOKZ.js.map +0 -1
- package/chunks/bundle-BL0tKclB.js.map +0 -1
- package/chunks/bundle-BQcc_8oI.js.map +0 -1
- package/chunks/bundle-BRaG5EHs.js.map +0 -1
- package/chunks/bundle-BRt6gbIr.js.map +0 -1
- package/chunks/bundle-BV-Kx6li.js.map +0 -1
- package/chunks/bundle-BZt7yK_Y.js.map +0 -1
- package/chunks/bundle-BeTPrbXl.js.map +0 -1
- package/chunks/bundle-BlRZqe8T.js.map +0 -1
- package/chunks/bundle-BnTt0CCZ.js.map +0 -1
- package/chunks/bundle-BrPQ1xtW.js.map +0 -1
- package/chunks/bundle-BuRpKo8a.js.map +0 -1
- package/chunks/bundle-BvcFQzve.js.map +0 -1
- package/chunks/bundle-ByTQtdFM.js.map +0 -1
- package/chunks/bundle-C0EFwuDi.js.map +0 -1
- package/chunks/bundle-C2qp06Ad.js.map +0 -1
- package/chunks/bundle-C5KSa4Q_.js.map +0 -1
- package/chunks/bundle-CQt1ONzj.js.map +0 -1
- package/chunks/bundle-Cf0JIqFR.js.map +0 -1
- package/chunks/bundle-Cgpa9xMh.js.map +0 -1
- package/chunks/bundle-Chv9JypP.js.map +0 -1
- package/chunks/bundle-Cl6qrizD.js.map +0 -1
- package/chunks/bundle-CpmDD_qj.js.map +0 -1
- package/chunks/bundle-D0Atuq2W.js.map +0 -1
- package/chunks/bundle-D7HxTsM2.js.map +0 -1
- package/chunks/bundle-DChZSw0N.js.map +0 -1
- package/chunks/bundle-DKHcEPfr.js.map +0 -1
- package/chunks/bundle-DLIFpzrP.js.map +0 -1
- package/chunks/bundle-DSw2Wyv5.js.map +0 -1
- package/chunks/bundle-DVDuILQh.js.map +0 -1
- package/chunks/bundle-DW4HEvvh.js.map +0 -1
- package/chunks/bundle-DX0g6QGP.js.map +0 -1
- package/chunks/bundle-DcJtM5WL.js.map +0 -1
- package/chunks/bundle-DjFflxR1.js.map +0 -1
- package/chunks/bundle-DnhvGgBr.js.map +0 -1
- package/chunks/bundle-DtHyIHaJ.js.map +0 -1
- package/chunks/bundle-DvPYXQcP.js.map +0 -1
- package/chunks/bundle-DvRNa17t.js.map +0 -1
- package/chunks/bundle-E_q9aH_b.js.map +0 -1
- package/chunks/bundle-HHlRp7vF.js.map +0 -1
- package/chunks/bundle-JfMKdEOr.js.map +0 -1
- package/chunks/bundle-P4HvWTGS.js.map +0 -1
- package/chunks/bundle-Vk50O4-7.js.map +0 -1
- package/chunks/bundle-bTVomhqp.js +0 -65
- package/chunks/bundle-bTVomhqp.js.map +0 -1
- package/chunks/bundle-cldHLNQX.js +0 -36
- package/chunks/bundle-cldHLNQX.js.map +0 -1
- package/chunks/bundle-gMq6CHjL.js.map +0 -1
- package/chunks/bundle-iSiw-_HL.js +0 -129
- package/chunks/bundle-iSiw-_HL.js.map +0 -1
- package/chunks/bundle-oKpBi3n1.js.map +0 -1
- package/cjs/chunks/bundle-Amd_tEFX.js.map +0 -1
- package/cjs/chunks/bundle-B0Cl8cKp.js.map +0 -1
- package/cjs/chunks/bundle-B1UxSAT6.js.map +0 -1
- package/cjs/chunks/bundle-B2K8d_Kr.js.map +0 -1
- package/cjs/chunks/bundle-B5nh0Mif.js.map +0 -1
- package/cjs/chunks/bundle-BACbqv7X.js.map +0 -1
- package/cjs/chunks/bundle-BGhSB8RW.js.map +0 -1
- package/cjs/chunks/bundle-BSV6l3PT.js.map +0 -1
- package/cjs/chunks/bundle-BTEk9dhT.js.map +0 -1
- package/cjs/chunks/bundle-BWtc6aAL.js.map +0 -1
- package/cjs/chunks/bundle-BZcKIqEO.js.map +0 -1
- package/cjs/chunks/bundle-Bcgo-8Wz.js.map +0 -1
- package/cjs/chunks/bundle-BeCXSzTg.js.map +0 -1
- package/cjs/chunks/bundle-BgJJI84U.js.map +0 -1
- package/cjs/chunks/bundle-BhbVr0qd.js +0 -72
- package/cjs/chunks/bundle-BhbVr0qd.js.map +0 -1
- package/cjs/chunks/bundle-BjHWj0YM.js.map +0 -1
- package/cjs/chunks/bundle-BrrYIsp-.js.map +0 -1
- package/cjs/chunks/bundle-Bu7SLdLc.js.map +0 -1
- package/cjs/chunks/bundle-BwzMNAFs.js.map +0 -1
- package/cjs/chunks/bundle-C-sGYQWV.js.map +0 -1
- package/cjs/chunks/bundle-C0Gtok_c.js.map +0 -1
- package/cjs/chunks/bundle-C1XDY35t.js.map +0 -1
- package/cjs/chunks/bundle-CFpokORf.js.map +0 -1
- package/cjs/chunks/bundle-CGKSHSXZ.js +0 -131
- package/cjs/chunks/bundle-CGKSHSXZ.js.map +0 -1
- package/cjs/chunks/bundle-CGNRfqfQ.js.map +0 -1
- package/cjs/chunks/bundle-CN-HA7zS.js +0 -7
- package/cjs/chunks/bundle-CN-HA7zS.js.map +0 -1
- package/cjs/chunks/bundle-COM-Vp38.js.map +0 -1
- package/cjs/chunks/bundle-COwRojr8.js.map +0 -1
- package/cjs/chunks/bundle-CRtD-LF2.js.map +0 -1
- package/cjs/chunks/bundle-CT33owD4.js.map +0 -1
- package/cjs/chunks/bundle-CUue3xhm.js.map +0 -1
- package/cjs/chunks/bundle-CYFSAQ2T.js.map +0 -1
- package/cjs/chunks/bundle-Cc053_Sp.js +0 -38
- package/cjs/chunks/bundle-Cc053_Sp.js.map +0 -1
- package/cjs/chunks/bundle-Cg6exdly.js.map +0 -1
- package/cjs/chunks/bundle-Chvgl0tl.js.map +0 -1
- package/cjs/chunks/bundle-CkBOTPET.js.map +0 -1
- package/cjs/chunks/bundle-Cm_quRwQ.js.map +0 -1
- package/cjs/chunks/bundle-CqfYJ2-A.js.map +0 -1
- package/cjs/chunks/bundle-D1gE5kRR.js.map +0 -1
- package/cjs/chunks/bundle-DEOaRh_m.js.map +0 -1
- package/cjs/chunks/bundle-DF9nQRmT.js.map +0 -1
- package/cjs/chunks/bundle-DRneqmmM.js.map +0 -1
- package/cjs/chunks/bundle-DTZwXpbk.js.map +0 -1
- package/cjs/chunks/bundle-DTzDEbe0.js.map +0 -1
- package/cjs/chunks/bundle-DU2DrCMu.js.map +0 -1
- package/cjs/chunks/bundle-DYU6eNDJ.js.map +0 -1
- package/cjs/chunks/bundle-DYdwn7HI.js.map +0 -1
- package/cjs/chunks/bundle-DZl6cYvA.js.map +0 -1
- package/cjs/chunks/bundle-Dc_hFK8U.js.map +0 -1
- package/cjs/chunks/bundle-Dfqk1zRa.js.map +0 -1
- package/cjs/chunks/bundle-DhB9bJf0.js.map +0 -1
- package/cjs/chunks/bundle-DiMvAbrw.js.map +0 -1
- package/cjs/chunks/bundle-Dnrc5q_J.js.map +0 -1
- package/cjs/chunks/bundle-DpiYQ60c.js.map +0 -1
- package/cjs/chunks/bundle-DxeOzVdw.js.map +0 -1
- package/cjs/chunks/bundle-LJi0Ftvu.js.map +0 -1
- package/cjs/chunks/bundle-ROscI12S.js.map +0 -1
- package/cjs/chunks/bundle-Vfq24KlC.js.map +0 -1
- package/cjs/chunks/bundle-ZtEjNaVg.js.map +0 -1
- package/cjs/chunks/bundle-_VH8bxGE.js.map +0 -1
- package/cjs/chunks/bundle-eHc2IloF.js.map +0 -1
- package/cjs/chunks/bundle-oEFvi6H_.js.map +0 -1
- package/cjs/chunks/bundle-waMogQH7.js.map +0 -1
- package/cjs/chunks/bundle-xkYrx6pX.js.map +0 -1
- package/cjs/chunks/bundle-xpQ8gY1k.js.map +0 -1
- package/types/modules/OpenChannelApp/stories/utils.d.ts +0 -6
package/GroupChannel/context.js
CHANGED
|
@@ -1,584 +1,584 @@
|
|
|
1
|
-
import { _ as __assign, a as __awaiter, b as __generator } from '../chunks/bundle-
|
|
1
|
+
import { _ as __assign, a as __awaiter, b as __generator } from '../chunks/bundle-7oF7KbGv.js';
|
|
2
2
|
import React__default, { useRef, useState, useLayoutEffect, useCallback, useMemo, useEffect, useContext } from 'react';
|
|
3
3
|
import { MessageMetaArray, ReplyType } from '@sendbird/chat/message';
|
|
4
4
|
import { MessageFilter } from '@sendbird/chat/groupChannel';
|
|
5
5
|
import { useIIFE, useGroupChannelMessages, useAsyncEffect, useAsyncLayoutEffect, usePreservedCallback } from '@sendbird/uikit-tools';
|
|
6
|
-
import { U as UserProfileProvider } from '../chunks/bundle-
|
|
6
|
+
import { U as UserProfileProvider } from '../chunks/bundle-B7barEsR.js';
|
|
7
7
|
import { useSendbirdStateContext } from '../useSendbirdStateContext.js';
|
|
8
|
-
import { u as useToggleReactionCallback } from '../chunks/bundle-
|
|
9
|
-
import { g as getCaseResolvedReplyType, a as getCaseResolvedThreadReplySelectType } from '../chunks/bundle-
|
|
10
|
-
import { b as isContextMenuClosed, c as getMessageTopOffset } from '../chunks/bundle-
|
|
11
|
-
import { a as useOnScrollPositionChangeDetectorWithRef } from '../chunks/bundle-
|
|
12
|
-
import { p as pubSubFactory } from '../chunks/bundle-
|
|
13
|
-
import { p as pubSubTopics } from '../chunks/bundle-
|
|
14
|
-
import {
|
|
15
|
-
import { g as getIsReactionEnabled } from '../chunks/bundle-
|
|
8
|
+
import { u as useToggleReactionCallback } from '../chunks/bundle-oCSRGy9i.js';
|
|
9
|
+
import { g as getCaseResolvedReplyType, a as getCaseResolvedThreadReplySelectType } from '../chunks/bundle-BtY8jyVv.js';
|
|
10
|
+
import { b as isContextMenuClosed, c as getMessageTopOffset } from '../chunks/bundle-BvG71y_P.js';
|
|
11
|
+
import { a as useOnScrollPositionChangeDetectorWithRef } from '../chunks/bundle-DaoHZIZy.js';
|
|
12
|
+
import { p as pubSubFactory } from '../chunks/bundle-2uJIsyo2.js';
|
|
13
|
+
import { p as pubSubTopics } from '../chunks/bundle-BWuyd0AD.js';
|
|
14
|
+
import { g as VOICE_MESSAGE_FILE_NAME, h as VOICE_MESSAGE_MIME_TYPE, M as META_ARRAY_VOICE_DURATION_KEY, i as META_ARRAY_MESSAGE_TYPE_KEY, j as META_ARRAY_MESSAGE_TYPE_VALUE__VOICE, S as SCROLL_BUFFER } from '../chunks/bundle-CD9AzC6s.js';
|
|
15
|
+
import { g as getIsReactionEnabled } from '../chunks/bundle-Jir4hfa9.js';
|
|
16
16
|
import '../withSendbird.js';
|
|
17
|
-
import '../chunks/bundle-
|
|
18
|
-
import '../chunks/bundle-
|
|
17
|
+
import '../chunks/bundle-DDkUg3Os.js';
|
|
18
|
+
import '../chunks/bundle-uBJzoaNT.js';
|
|
19
19
|
|
|
20
|
-
function runCallback(callback, lazy) {
|
|
21
|
-
if (lazy === void 0) { lazy = true; }
|
|
22
|
-
if (lazy) {
|
|
23
|
-
setTimeout(function () {
|
|
24
|
-
callback();
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
callback();
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
function getScrollBehavior(behavior, animated) {
|
|
32
|
-
if (typeof animated === 'boolean')
|
|
33
|
-
return animated ? 'smooth' : 'auto';
|
|
34
|
-
return behavior;
|
|
35
|
-
}
|
|
36
|
-
function useMessageListScroll(behavior) {
|
|
37
|
-
var scrollRef = useRef(null);
|
|
38
|
-
var scrollDistanceFromBottomRef = useRef(0);
|
|
39
|
-
var scrollPubSub = useState(function () { return pubSubFactory(); })[0];
|
|
40
|
-
var _a = useState(false), isScrollBottomReached = _a[0], setIsScrollBottomReached = _a[1];
|
|
41
|
-
// If there is no area to scroll, it is considered as scroll bottom reached.
|
|
42
|
-
if (isScrollBottomReached === false && scrollRef.current && scrollRef.current.scrollHeight <= scrollRef.current.clientHeight) {
|
|
43
|
-
scrollDistanceFromBottomRef.current = 0;
|
|
44
|
-
setIsScrollBottomReached(true);
|
|
45
|
-
}
|
|
46
|
-
useLayoutEffect(function () {
|
|
47
|
-
var unsubscribes = [];
|
|
48
|
-
unsubscribes.push(scrollPubSub.subscribe('scrollToBottom', function (_a) {
|
|
49
|
-
var resolve = _a.resolve, animated = _a.animated;
|
|
50
|
-
runCallback(function () {
|
|
51
|
-
if (!scrollRef.current)
|
|
52
|
-
return;
|
|
53
|
-
if (scrollRef.current.scroll) {
|
|
54
|
-
scrollRef.current.scroll({ top: scrollRef.current.scrollHeight, behavior: getScrollBehavior(behavior, animated) });
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
58
|
-
}
|
|
59
|
-
// Update data by manual update
|
|
60
|
-
scrollDistanceFromBottomRef.current = 0;
|
|
61
|
-
setIsScrollBottomReached(true);
|
|
62
|
-
if (resolve)
|
|
63
|
-
resolve();
|
|
64
|
-
});
|
|
65
|
-
}));
|
|
66
|
-
unsubscribes.push(scrollPubSub.subscribe('scroll', function (_a) {
|
|
67
|
-
var top = _a.top, animated = _a.animated, lazy = _a.lazy, resolve = _a.resolve;
|
|
68
|
-
runCallback(function () {
|
|
69
|
-
if (!scrollRef.current)
|
|
70
|
-
return;
|
|
71
|
-
var _a = scrollRef.current, scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;
|
|
72
|
-
if (scrollRef.current.scroll) {
|
|
73
|
-
scrollRef.current.scroll({ top: top, behavior: getScrollBehavior(behavior, animated) });
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
scrollRef.current.scrollTop = top;
|
|
77
|
-
}
|
|
78
|
-
// Update data by manual update
|
|
79
|
-
scrollDistanceFromBottomRef.current = Math.max(0, scrollHeight - scrollTop - clientHeight);
|
|
80
|
-
setIsScrollBottomReached(scrollDistanceFromBottomRef.current === 0);
|
|
81
|
-
if (resolve)
|
|
82
|
-
resolve();
|
|
83
|
-
}, lazy);
|
|
84
|
-
}));
|
|
85
|
-
return function () {
|
|
86
|
-
unsubscribes.forEach(function (_a) {
|
|
87
|
-
var remove = _a.remove;
|
|
88
|
-
return remove();
|
|
89
|
-
});
|
|
90
|
-
};
|
|
91
|
-
}, [behavior]);
|
|
92
|
-
// Update data by scroll events
|
|
93
|
-
useOnScrollPositionChangeDetectorWithRef(scrollRef, {
|
|
94
|
-
onReachedTop: function (_a) {
|
|
95
|
-
var distanceFromBottom = _a.distanceFromBottom;
|
|
96
|
-
setIsScrollBottomReached(false);
|
|
97
|
-
scrollDistanceFromBottomRef.current = distanceFromBottom;
|
|
98
|
-
},
|
|
99
|
-
onInBetween: function (_a) {
|
|
100
|
-
var distanceFromBottom = _a.distanceFromBottom;
|
|
101
|
-
setIsScrollBottomReached(false);
|
|
102
|
-
scrollDistanceFromBottomRef.current = distanceFromBottom;
|
|
103
|
-
},
|
|
104
|
-
onReachedBottom: function (_a) {
|
|
105
|
-
var distanceFromBottom = _a.distanceFromBottom;
|
|
106
|
-
setIsScrollBottomReached(true);
|
|
107
|
-
scrollDistanceFromBottomRef.current = distanceFromBottom;
|
|
108
|
-
},
|
|
109
|
-
});
|
|
110
|
-
return {
|
|
111
|
-
scrollRef: scrollRef,
|
|
112
|
-
scrollPubSub: scrollPubSub,
|
|
113
|
-
isScrollBottomReached: isScrollBottomReached,
|
|
114
|
-
setIsScrollBottomReached: setIsScrollBottomReached,
|
|
115
|
-
scrollDistanceFromBottomRef: scrollDistanceFromBottomRef,
|
|
116
|
-
};
|
|
20
|
+
function runCallback(callback, lazy) {
|
|
21
|
+
if (lazy === void 0) { lazy = true; }
|
|
22
|
+
if (lazy) {
|
|
23
|
+
setTimeout(function () {
|
|
24
|
+
callback();
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
callback();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function getScrollBehavior(behavior, animated) {
|
|
32
|
+
if (typeof animated === 'boolean')
|
|
33
|
+
return animated ? 'smooth' : 'auto';
|
|
34
|
+
return behavior;
|
|
35
|
+
}
|
|
36
|
+
function useMessageListScroll(behavior) {
|
|
37
|
+
var scrollRef = useRef(null);
|
|
38
|
+
var scrollDistanceFromBottomRef = useRef(0);
|
|
39
|
+
var scrollPubSub = useState(function () { return pubSubFactory(); })[0];
|
|
40
|
+
var _a = useState(false), isScrollBottomReached = _a[0], setIsScrollBottomReached = _a[1];
|
|
41
|
+
// If there is no area to scroll, it is considered as scroll bottom reached.
|
|
42
|
+
if (isScrollBottomReached === false && scrollRef.current && scrollRef.current.scrollHeight <= scrollRef.current.clientHeight) {
|
|
43
|
+
scrollDistanceFromBottomRef.current = 0;
|
|
44
|
+
setIsScrollBottomReached(true);
|
|
45
|
+
}
|
|
46
|
+
useLayoutEffect(function () {
|
|
47
|
+
var unsubscribes = [];
|
|
48
|
+
unsubscribes.push(scrollPubSub.subscribe('scrollToBottom', function (_a) {
|
|
49
|
+
var resolve = _a.resolve, animated = _a.animated;
|
|
50
|
+
runCallback(function () {
|
|
51
|
+
if (!scrollRef.current)
|
|
52
|
+
return;
|
|
53
|
+
if (scrollRef.current.scroll) {
|
|
54
|
+
scrollRef.current.scroll({ top: scrollRef.current.scrollHeight, behavior: getScrollBehavior(behavior, animated) });
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
58
|
+
}
|
|
59
|
+
// Update data by manual update
|
|
60
|
+
scrollDistanceFromBottomRef.current = 0;
|
|
61
|
+
setIsScrollBottomReached(true);
|
|
62
|
+
if (resolve)
|
|
63
|
+
resolve();
|
|
64
|
+
});
|
|
65
|
+
}));
|
|
66
|
+
unsubscribes.push(scrollPubSub.subscribe('scroll', function (_a) {
|
|
67
|
+
var top = _a.top, animated = _a.animated, lazy = _a.lazy, resolve = _a.resolve;
|
|
68
|
+
runCallback(function () {
|
|
69
|
+
if (!scrollRef.current)
|
|
70
|
+
return;
|
|
71
|
+
var _a = scrollRef.current, scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;
|
|
72
|
+
if (scrollRef.current.scroll) {
|
|
73
|
+
scrollRef.current.scroll({ top: top, behavior: getScrollBehavior(behavior, animated) });
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
scrollRef.current.scrollTop = top;
|
|
77
|
+
}
|
|
78
|
+
// Update data by manual update
|
|
79
|
+
scrollDistanceFromBottomRef.current = Math.max(0, scrollHeight - scrollTop - clientHeight);
|
|
80
|
+
setIsScrollBottomReached(scrollDistanceFromBottomRef.current === 0);
|
|
81
|
+
if (resolve)
|
|
82
|
+
resolve();
|
|
83
|
+
}, lazy);
|
|
84
|
+
}));
|
|
85
|
+
return function () {
|
|
86
|
+
unsubscribes.forEach(function (_a) {
|
|
87
|
+
var remove = _a.remove;
|
|
88
|
+
return remove();
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
}, [behavior]);
|
|
92
|
+
// Update data by scroll events
|
|
93
|
+
useOnScrollPositionChangeDetectorWithRef(scrollRef, {
|
|
94
|
+
onReachedTop: function (_a) {
|
|
95
|
+
var distanceFromBottom = _a.distanceFromBottom;
|
|
96
|
+
setIsScrollBottomReached(false);
|
|
97
|
+
scrollDistanceFromBottomRef.current = distanceFromBottom;
|
|
98
|
+
},
|
|
99
|
+
onInBetween: function (_a) {
|
|
100
|
+
var distanceFromBottom = _a.distanceFromBottom;
|
|
101
|
+
setIsScrollBottomReached(false);
|
|
102
|
+
scrollDistanceFromBottomRef.current = distanceFromBottom;
|
|
103
|
+
},
|
|
104
|
+
onReachedBottom: function (_a) {
|
|
105
|
+
var distanceFromBottom = _a.distanceFromBottom;
|
|
106
|
+
setIsScrollBottomReached(true);
|
|
107
|
+
scrollDistanceFromBottomRef.current = distanceFromBottom;
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
return {
|
|
111
|
+
scrollRef: scrollRef,
|
|
112
|
+
scrollPubSub: scrollPubSub,
|
|
113
|
+
isScrollBottomReached: isScrollBottomReached,
|
|
114
|
+
setIsScrollBottomReached: setIsScrollBottomReached,
|
|
115
|
+
scrollDistanceFromBottomRef: scrollDistanceFromBottomRef,
|
|
116
|
+
};
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
var pass = function (value) { return value; };
|
|
120
|
-
/**
|
|
121
|
-
* @description This hook controls common processes related to message sending, updating.
|
|
122
|
-
* */
|
|
123
|
-
function useMessageActions(params) {
|
|
124
|
-
var _this = this;
|
|
125
|
-
var _a = params.onBeforeSendUserMessage, onBeforeSendUserMessage = _a === void 0 ? pass : _a, _b = params.onBeforeSendFileMessage, onBeforeSendFileMessage = _b === void 0 ? pass : _b, _c = params.onBeforeUpdateUserMessage, onBeforeUpdateUserMessage = _c === void 0 ? pass : _c, _d = params.onBeforeSendVoiceMessage, onBeforeSendVoiceMessage = _d === void 0 ? pass : _d, _e = params.onBeforeSendMultipleFilesMessage, onBeforeSendMultipleFilesMessage = _e === void 0 ? pass : _e, sendFileMessage = params.sendFileMessage, sendMultipleFilesMessage = params.sendMultipleFilesMessage, sendUserMessage = params.sendUserMessage, updateUserMessage = params.updateUserMessage, scrollToBottom = params.scrollToBottom, quoteMessage = params.quoteMessage, replyType = params.replyType;
|
|
126
|
-
var buildInternalMessageParams = useCallback(function (basicParams) {
|
|
127
|
-
var messageParams = __assign({}, basicParams);
|
|
128
|
-
if (params.quoteMessage && replyType !== 'NONE') {
|
|
129
|
-
messageParams.isReplyToChannel = true;
|
|
130
|
-
messageParams.parentMessageId = quoteMessage.messageId;
|
|
131
|
-
}
|
|
132
|
-
return messageParams;
|
|
133
|
-
}, [replyType, quoteMessage]);
|
|
134
|
-
return {
|
|
135
|
-
sendUserMessage: useCallback(function (params) { return __awaiter(_this, void 0, void 0, function () {
|
|
136
|
-
var internalParams, processedParams;
|
|
137
|
-
return __generator(this, function (_a) {
|
|
138
|
-
switch (_a.label) {
|
|
139
|
-
case 0:
|
|
140
|
-
internalParams = buildInternalMessageParams(params);
|
|
141
|
-
return [4 /*yield*/, onBeforeSendUserMessage(internalParams)];
|
|
142
|
-
case 1:
|
|
143
|
-
processedParams = _a.sent();
|
|
144
|
-
return [2 /*return*/, sendUserMessage(processedParams, function () { return scrollToBottom(); })];
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
}); }, [buildInternalMessageParams, sendUserMessage, scrollToBottom]),
|
|
148
|
-
sendFileMessage: useCallback(function (params) { return __awaiter(_this, void 0, void 0, function () {
|
|
149
|
-
var internalParams, processedParams;
|
|
150
|
-
return __generator(this, function (_a) {
|
|
151
|
-
switch (_a.label) {
|
|
152
|
-
case 0:
|
|
153
|
-
internalParams = buildInternalMessageParams(params);
|
|
154
|
-
return [4 /*yield*/, onBeforeSendFileMessage(internalParams)];
|
|
155
|
-
case 1:
|
|
156
|
-
processedParams = _a.sent();
|
|
157
|
-
return [2 /*return*/, sendFileMessage(processedParams, function () { return scrollToBottom(); })];
|
|
158
|
-
}
|
|
159
|
-
});
|
|
160
|
-
}); }, [buildInternalMessageParams, sendFileMessage, scrollToBottom]),
|
|
161
|
-
sendMultipleFilesMessage: useCallback(function (params) { return __awaiter(_this, void 0, void 0, function () {
|
|
162
|
-
var internalParams, processedParams;
|
|
163
|
-
return __generator(this, function (_a) {
|
|
164
|
-
switch (_a.label) {
|
|
165
|
-
case 0:
|
|
166
|
-
internalParams = buildInternalMessageParams(params);
|
|
167
|
-
return [4 /*yield*/, onBeforeSendMultipleFilesMessage(internalParams)];
|
|
168
|
-
case 1:
|
|
169
|
-
processedParams = _a.sent();
|
|
170
|
-
return [2 /*return*/, sendMultipleFilesMessage(processedParams, function () { return scrollToBottom(); })];
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
}); }, [buildInternalMessageParams, sendMultipleFilesMessage, scrollToBottom]),
|
|
174
|
-
sendVoiceMessage: useCallback(function (params, duration) { return __awaiter(_this, void 0, void 0, function () {
|
|
175
|
-
var internalParams, processedParams;
|
|
176
|
-
return __generator(this, function (_a) {
|
|
177
|
-
switch (_a.label) {
|
|
178
|
-
case 0:
|
|
179
|
-
internalParams = buildInternalMessageParams(__assign(__assign({}, params), { fileName: VOICE_MESSAGE_FILE_NAME, mimeType: VOICE_MESSAGE_MIME_TYPE, metaArrays: [
|
|
180
|
-
new MessageMetaArray({
|
|
181
|
-
key: META_ARRAY_VOICE_DURATION_KEY,
|
|
182
|
-
value: ["".concat(duration)],
|
|
183
|
-
}),
|
|
184
|
-
new MessageMetaArray({
|
|
185
|
-
key: META_ARRAY_MESSAGE_TYPE_KEY,
|
|
186
|
-
value: [META_ARRAY_MESSAGE_TYPE_VALUE__VOICE],
|
|
187
|
-
}),
|
|
188
|
-
] }));
|
|
189
|
-
return [4 /*yield*/, onBeforeSendVoiceMessage(internalParams)];
|
|
190
|
-
case 1:
|
|
191
|
-
processedParams = _a.sent();
|
|
192
|
-
return [2 /*return*/, sendFileMessage(processedParams, function () { return scrollToBottom(); })];
|
|
193
|
-
}
|
|
194
|
-
});
|
|
195
|
-
}); }, [buildInternalMessageParams, sendFileMessage, scrollToBottom]),
|
|
196
|
-
updateUserMessage: useCallback(function (messageId, params) { return __awaiter(_this, void 0, void 0, function () {
|
|
197
|
-
var internalParams, processedParams;
|
|
198
|
-
return __generator(this, function (_a) {
|
|
199
|
-
switch (_a.label) {
|
|
200
|
-
case 0:
|
|
201
|
-
internalParams = buildInternalMessageParams(params);
|
|
202
|
-
return [4 /*yield*/, onBeforeUpdateUserMessage(internalParams)];
|
|
203
|
-
case 1:
|
|
204
|
-
processedParams = _a.sent();
|
|
205
|
-
return [2 /*return*/, updateUserMessage(messageId, processedParams)];
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
}); }, [buildInternalMessageParams, updateUserMessage]),
|
|
209
|
-
};
|
|
119
|
+
var pass = function (value) { return value; };
|
|
120
|
+
/**
|
|
121
|
+
* @description This hook controls common processes related to message sending, updating.
|
|
122
|
+
* */
|
|
123
|
+
function useMessageActions(params) {
|
|
124
|
+
var _this = this;
|
|
125
|
+
var _a = params.onBeforeSendUserMessage, onBeforeSendUserMessage = _a === void 0 ? pass : _a, _b = params.onBeforeSendFileMessage, onBeforeSendFileMessage = _b === void 0 ? pass : _b, _c = params.onBeforeUpdateUserMessage, onBeforeUpdateUserMessage = _c === void 0 ? pass : _c, _d = params.onBeforeSendVoiceMessage, onBeforeSendVoiceMessage = _d === void 0 ? pass : _d, _e = params.onBeforeSendMultipleFilesMessage, onBeforeSendMultipleFilesMessage = _e === void 0 ? pass : _e, sendFileMessage = params.sendFileMessage, sendMultipleFilesMessage = params.sendMultipleFilesMessage, sendUserMessage = params.sendUserMessage, updateUserMessage = params.updateUserMessage, scrollToBottom = params.scrollToBottom, quoteMessage = params.quoteMessage, replyType = params.replyType;
|
|
126
|
+
var buildInternalMessageParams = useCallback(function (basicParams) {
|
|
127
|
+
var messageParams = __assign({}, basicParams);
|
|
128
|
+
if (params.quoteMessage && replyType !== 'NONE') {
|
|
129
|
+
messageParams.isReplyToChannel = true;
|
|
130
|
+
messageParams.parentMessageId = quoteMessage.messageId;
|
|
131
|
+
}
|
|
132
|
+
return messageParams;
|
|
133
|
+
}, [replyType, quoteMessage]);
|
|
134
|
+
return {
|
|
135
|
+
sendUserMessage: useCallback(function (params) { return __awaiter(_this, void 0, void 0, function () {
|
|
136
|
+
var internalParams, processedParams;
|
|
137
|
+
return __generator(this, function (_a) {
|
|
138
|
+
switch (_a.label) {
|
|
139
|
+
case 0:
|
|
140
|
+
internalParams = buildInternalMessageParams(params);
|
|
141
|
+
return [4 /*yield*/, onBeforeSendUserMessage(internalParams)];
|
|
142
|
+
case 1:
|
|
143
|
+
processedParams = _a.sent();
|
|
144
|
+
return [2 /*return*/, sendUserMessage(processedParams, function () { return scrollToBottom(); })];
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
}); }, [buildInternalMessageParams, sendUserMessage, scrollToBottom]),
|
|
148
|
+
sendFileMessage: useCallback(function (params) { return __awaiter(_this, void 0, void 0, function () {
|
|
149
|
+
var internalParams, processedParams;
|
|
150
|
+
return __generator(this, function (_a) {
|
|
151
|
+
switch (_a.label) {
|
|
152
|
+
case 0:
|
|
153
|
+
internalParams = buildInternalMessageParams(params);
|
|
154
|
+
return [4 /*yield*/, onBeforeSendFileMessage(internalParams)];
|
|
155
|
+
case 1:
|
|
156
|
+
processedParams = _a.sent();
|
|
157
|
+
return [2 /*return*/, sendFileMessage(processedParams, function () { return scrollToBottom(); })];
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
}); }, [buildInternalMessageParams, sendFileMessage, scrollToBottom]),
|
|
161
|
+
sendMultipleFilesMessage: useCallback(function (params) { return __awaiter(_this, void 0, void 0, function () {
|
|
162
|
+
var internalParams, processedParams;
|
|
163
|
+
return __generator(this, function (_a) {
|
|
164
|
+
switch (_a.label) {
|
|
165
|
+
case 0:
|
|
166
|
+
internalParams = buildInternalMessageParams(params);
|
|
167
|
+
return [4 /*yield*/, onBeforeSendMultipleFilesMessage(internalParams)];
|
|
168
|
+
case 1:
|
|
169
|
+
processedParams = _a.sent();
|
|
170
|
+
return [2 /*return*/, sendMultipleFilesMessage(processedParams, function () { return scrollToBottom(); })];
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
}); }, [buildInternalMessageParams, sendMultipleFilesMessage, scrollToBottom]),
|
|
174
|
+
sendVoiceMessage: useCallback(function (params, duration) { return __awaiter(_this, void 0, void 0, function () {
|
|
175
|
+
var internalParams, processedParams;
|
|
176
|
+
return __generator(this, function (_a) {
|
|
177
|
+
switch (_a.label) {
|
|
178
|
+
case 0:
|
|
179
|
+
internalParams = buildInternalMessageParams(__assign(__assign({}, params), { fileName: VOICE_MESSAGE_FILE_NAME, mimeType: VOICE_MESSAGE_MIME_TYPE, metaArrays: [
|
|
180
|
+
new MessageMetaArray({
|
|
181
|
+
key: META_ARRAY_VOICE_DURATION_KEY,
|
|
182
|
+
value: ["".concat(duration)],
|
|
183
|
+
}),
|
|
184
|
+
new MessageMetaArray({
|
|
185
|
+
key: META_ARRAY_MESSAGE_TYPE_KEY,
|
|
186
|
+
value: [META_ARRAY_MESSAGE_TYPE_VALUE__VOICE],
|
|
187
|
+
}),
|
|
188
|
+
] }));
|
|
189
|
+
return [4 /*yield*/, onBeforeSendVoiceMessage(internalParams)];
|
|
190
|
+
case 1:
|
|
191
|
+
processedParams = _a.sent();
|
|
192
|
+
return [2 /*return*/, sendFileMessage(processedParams, function () { return scrollToBottom(); })];
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
}); }, [buildInternalMessageParams, sendFileMessage, scrollToBottom]),
|
|
196
|
+
updateUserMessage: useCallback(function (messageId, params) { return __awaiter(_this, void 0, void 0, function () {
|
|
197
|
+
var internalParams, processedParams;
|
|
198
|
+
return __generator(this, function (_a) {
|
|
199
|
+
switch (_a.label) {
|
|
200
|
+
case 0:
|
|
201
|
+
internalParams = buildInternalMessageParams(params);
|
|
202
|
+
return [4 /*yield*/, onBeforeUpdateUserMessage(internalParams)];
|
|
203
|
+
case 1:
|
|
204
|
+
processedParams = _a.sent();
|
|
205
|
+
return [2 /*return*/, updateUserMessage(messageId, processedParams)];
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
}); }, [buildInternalMessageParams, updateUserMessage]),
|
|
209
|
+
};
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
-
/**
|
|
213
|
-
* @description This hook is designed to prevent scroll flickering caused by duplicate calls of onEndReached and onTopReached.
|
|
214
|
-
* It controls the loading of messages to ensure a single request for message retrieval.
|
|
215
|
-
* */
|
|
216
|
-
var usePreventDuplicateRequest = function () {
|
|
217
|
-
var context = useRef({ locked: false, count: 0 }).current;
|
|
218
|
-
return {
|
|
219
|
-
lock: function () {
|
|
220
|
-
context.locked = true;
|
|
221
|
-
},
|
|
222
|
-
run: function (callback) {
|
|
223
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
224
|
-
return __generator(this, function (_b) {
|
|
225
|
-
switch (_b.label) {
|
|
226
|
-
case 0:
|
|
227
|
-
if (context.locked && context.count > 0)
|
|
228
|
-
return [2 /*return*/];
|
|
229
|
-
_b.label = 1;
|
|
230
|
-
case 1:
|
|
231
|
-
_b.trys.push([1, 3, , 4]);
|
|
232
|
-
context.count++;
|
|
233
|
-
return [4 /*yield*/, callback()];
|
|
234
|
-
case 2:
|
|
235
|
-
_b.sent();
|
|
236
|
-
return [3 /*break*/, 4];
|
|
237
|
-
case 3:
|
|
238
|
-
_b.sent();
|
|
239
|
-
return [3 /*break*/, 4];
|
|
240
|
-
case 4: return [2 /*return*/];
|
|
241
|
-
}
|
|
242
|
-
});
|
|
243
|
-
});
|
|
244
|
-
},
|
|
245
|
-
release: function () {
|
|
246
|
-
context.locked = false;
|
|
247
|
-
context.count = 0;
|
|
248
|
-
},
|
|
249
|
-
};
|
|
212
|
+
/**
|
|
213
|
+
* @description This hook is designed to prevent scroll flickering caused by duplicate calls of onEndReached and onTopReached.
|
|
214
|
+
* It controls the loading of messages to ensure a single request for message retrieval.
|
|
215
|
+
* */
|
|
216
|
+
var usePreventDuplicateRequest = function () {
|
|
217
|
+
var context = useRef({ locked: false, count: 0 }).current;
|
|
218
|
+
return {
|
|
219
|
+
lock: function () {
|
|
220
|
+
context.locked = true;
|
|
221
|
+
},
|
|
222
|
+
run: function (callback) {
|
|
223
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
224
|
+
return __generator(this, function (_b) {
|
|
225
|
+
switch (_b.label) {
|
|
226
|
+
case 0:
|
|
227
|
+
if (context.locked && context.count > 0)
|
|
228
|
+
return [2 /*return*/];
|
|
229
|
+
_b.label = 1;
|
|
230
|
+
case 1:
|
|
231
|
+
_b.trys.push([1, 3, , 4]);
|
|
232
|
+
context.count++;
|
|
233
|
+
return [4 /*yield*/, callback()];
|
|
234
|
+
case 2:
|
|
235
|
+
_b.sent();
|
|
236
|
+
return [3 /*break*/, 4];
|
|
237
|
+
case 3:
|
|
238
|
+
_b.sent();
|
|
239
|
+
return [3 /*break*/, 4];
|
|
240
|
+
case 4: return [2 /*return*/];
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
});
|
|
244
|
+
},
|
|
245
|
+
release: function () {
|
|
246
|
+
context.locked = false;
|
|
247
|
+
context.count = 0;
|
|
248
|
+
},
|
|
249
|
+
};
|
|
250
250
|
};
|
|
251
251
|
|
|
252
|
-
var GroupChannelContext = React__default.createContext(null);
|
|
253
|
-
var GroupChannelProvider = function (props) {
|
|
254
|
-
var _a, _b, _c;
|
|
255
|
-
var channelUrl = props.channelUrl, children = props.children, moduleReactionEnabled = props.isReactionEnabled, moduleReplyType = props.replyType, moduleThreadReplySelectType = props.threadReplySelectType, _d = props.isMessageGroupingEnabled, isMessageGroupingEnabled = _d === void 0 ? true : _d, isMultipleFilesMessageEnabled = props.isMultipleFilesMessageEnabled, showSearchIcon = props.showSearchIcon, _e = props.disableMarkAsRead, disableMarkAsRead = _e === void 0 ? false : _e, _f = props.scrollBehavior, scrollBehavior = _f === void 0 ? 'auto' : _f, startingPoint = props.startingPoint, _animatedMessageId = props.animatedMessageId, messageListQueryParams = props.messageListQueryParams, onBeforeSendUserMessage = props.onBeforeSendUserMessage, onBeforeSendFileMessage = props.onBeforeSendFileMessage, onBeforeSendVoiceMessage = props.onBeforeSendVoiceMessage, onBeforeSendMultipleFilesMessage = props.onBeforeSendMultipleFilesMessage, onBeforeUpdateUserMessage = props.onBeforeUpdateUserMessage, onBeforeDownloadFileMessage = props.onBeforeDownloadFileMessage, onMessageAnimated = props.onMessageAnimated, onBackClick = props.onBackClick, onChatHeaderActionClick = props.onChatHeaderActionClick, onReplyInThreadClick = props.onReplyInThreadClick, onSearchClick = props.onSearchClick, onQuoteMessageClick = props.onQuoteMessageClick, renderUserMentionItem = props.renderUserMentionItem;
|
|
256
|
-
// Global context
|
|
257
|
-
var _g = useSendbirdStateContext(), config = _g.config, stores = _g.stores;
|
|
258
|
-
var sdkStore = stores.sdkStore;
|
|
259
|
-
var markAsReadScheduler = config.markAsReadScheduler, logger = config.logger;
|
|
260
|
-
// State
|
|
261
|
-
var _h = useState(null), quoteMessage = _h[0], setQuoteMessage = _h[1];
|
|
262
|
-
var _j = useState(null), animatedMessageId = _j[0], setAnimatedMessageId = _j[1];
|
|
263
|
-
var _k = useState(null), currentChannel = _k[0], setCurrentChannel = _k[1];
|
|
264
|
-
var _l = useState(null), fetchChannelError = _l[0], setFetchChannelError = _l[1];
|
|
265
|
-
// Ref
|
|
266
|
-
var _m = useMessageListScroll(scrollBehavior), scrollRef = _m.scrollRef, scrollPubSub = _m.scrollPubSub, scrollDistanceFromBottomRef = _m.scrollDistanceFromBottomRef, isScrollBottomReached = _m.isScrollBottomReached, setIsScrollBottomReached = _m.setIsScrollBottomReached;
|
|
267
|
-
var messageInputRef = useRef(null);
|
|
268
|
-
var toggleReaction = useToggleReactionCallback(currentChannel, logger);
|
|
269
|
-
var replyType = getCaseResolvedReplyType(moduleReplyType !== null && moduleReplyType !== void 0 ? moduleReplyType : config.groupChannel.replyType).upperCase;
|
|
270
|
-
var threadReplySelectType = getCaseResolvedThreadReplySelectType(moduleThreadReplySelectType !== null && moduleThreadReplySelectType !== void 0 ? moduleThreadReplySelectType : config.groupChannel.threadReplySelectType).upperCase;
|
|
271
|
-
var chatReplyType = useIIFE(function () {
|
|
272
|
-
if (replyType === 'NONE')
|
|
273
|
-
return ReplyType.NONE;
|
|
274
|
-
return ReplyType.ONLY_REPLY_TO_CHANNEL;
|
|
275
|
-
});
|
|
276
|
-
var isReactionEnabled = getIsReactionEnabled({
|
|
277
|
-
channel: currentChannel,
|
|
278
|
-
config: config,
|
|
279
|
-
moduleLevel: moduleReactionEnabled,
|
|
280
|
-
});
|
|
281
|
-
var nicknamesMap = useMemo(function () { var _a; return new Map(((_a = currentChannel === null || currentChannel === void 0 ? void 0 : currentChannel.members) !== null && _a !== void 0 ? _a : []).map(function (_a) {
|
|
282
|
-
var userId = _a.userId, nickname = _a.nickname;
|
|
283
|
-
return [userId, nickname];
|
|
284
|
-
})); }, [currentChannel === null || currentChannel === void 0 ? void 0 : currentChannel.members]);
|
|
285
|
-
var preventDuplicateRequest = usePreventDuplicateRequest();
|
|
286
|
-
var messageDataSource = useGroupChannelMessages(sdkStore.sdk, currentChannel, {
|
|
287
|
-
startingPoint: startingPoint,
|
|
288
|
-
replyType: chatReplyType,
|
|
289
|
-
collectionCreator: getCollectionCreator(currentChannel, messageListQueryParams),
|
|
290
|
-
shouldCountNewMessages: function () { return !isScrollBottomReached; },
|
|
291
|
-
markAsRead: function (channels) {
|
|
292
|
-
// isScrollBottomReached is a state that is updated after the render is completed.
|
|
293
|
-
// So, we use scrollDistanceFromBottomRef to check quickly if the scroll is at the bottom.
|
|
294
|
-
if (!disableMarkAsRead && scrollDistanceFromBottomRef.current <= SCROLL_BUFFER) {
|
|
295
|
-
channels.forEach(function (it) { return markAsReadScheduler.push(it); });
|
|
296
|
-
}
|
|
297
|
-
},
|
|
298
|
-
onMessagesReceived: function () {
|
|
299
|
-
if (isScrollBottomReached && isContextMenuClosed()) {
|
|
300
|
-
scrollPubSub.publish('scrollToBottom', {});
|
|
301
|
-
}
|
|
302
|
-
},
|
|
303
|
-
onChannelDeleted: function () {
|
|
304
|
-
setCurrentChannel(null);
|
|
305
|
-
setFetchChannelError(null);
|
|
306
|
-
},
|
|
307
|
-
onCurrentUserBanned: function () {
|
|
308
|
-
setCurrentChannel(null);
|
|
309
|
-
setFetchChannelError(null);
|
|
310
|
-
},
|
|
311
|
-
onChannelUpdated: function (channel) { return setCurrentChannel(channel); },
|
|
312
|
-
logger: logger,
|
|
313
|
-
});
|
|
314
|
-
useOnScrollPositionChangeDetectorWithRef(scrollRef, {
|
|
315
|
-
onReachedTop: function () {
|
|
316
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
317
|
-
var _this = this;
|
|
318
|
-
return __generator(this, function (_a) {
|
|
319
|
-
switch (_a.label) {
|
|
320
|
-
case 0:
|
|
321
|
-
preventDuplicateRequest.lock();
|
|
322
|
-
return [4 /*yield*/, preventDuplicateRequest.run(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
323
|
-
var prevViewInfo;
|
|
324
|
-
return __generator(this, function (_a) {
|
|
325
|
-
switch (_a.label) {
|
|
326
|
-
case 0:
|
|
327
|
-
if (!messageDataSource.hasPrevious())
|
|
328
|
-
return [2 /*return*/];
|
|
329
|
-
prevViewInfo = { scrollTop: scrollRef.current.scrollTop, scrollHeight: scrollRef.current.scrollHeight };
|
|
330
|
-
return [4 /*yield*/, messageDataSource.loadPrevious()];
|
|
331
|
-
case 1:
|
|
332
|
-
_a.sent();
|
|
333
|
-
// FIXME: We need a good way to detect right after the rendering of the screen instead of using setTimeout.
|
|
334
|
-
setTimeout(function () {
|
|
335
|
-
var nextViewInfo = { scrollHeight: scrollRef.current.scrollHeight };
|
|
336
|
-
var viewUpdated = prevViewInfo.scrollHeight < nextViewInfo.scrollHeight;
|
|
337
|
-
if (viewUpdated) {
|
|
338
|
-
var bottomOffset = prevViewInfo.scrollHeight - prevViewInfo.scrollTop;
|
|
339
|
-
scrollPubSub.publish('scroll', { top: nextViewInfo.scrollHeight - bottomOffset, lazy: false, animated: false });
|
|
340
|
-
}
|
|
341
|
-
});
|
|
342
|
-
return [2 /*return*/];
|
|
343
|
-
}
|
|
344
|
-
});
|
|
345
|
-
}); })];
|
|
346
|
-
case 1:
|
|
347
|
-
_a.sent();
|
|
348
|
-
preventDuplicateRequest.release();
|
|
349
|
-
return [2 /*return*/];
|
|
350
|
-
}
|
|
351
|
-
});
|
|
352
|
-
});
|
|
353
|
-
},
|
|
354
|
-
onReachedBottom: function () {
|
|
355
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
356
|
-
var _this = this;
|
|
357
|
-
return __generator(this, function (_a) {
|
|
358
|
-
switch (_a.label) {
|
|
359
|
-
case 0:
|
|
360
|
-
preventDuplicateRequest.lock();
|
|
361
|
-
return [4 /*yield*/, preventDuplicateRequest.run(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
362
|
-
var prevViewInfo;
|
|
363
|
-
return __generator(this, function (_a) {
|
|
364
|
-
switch (_a.label) {
|
|
365
|
-
case 0:
|
|
366
|
-
if (!messageDataSource.hasNext())
|
|
367
|
-
return [2 /*return*/];
|
|
368
|
-
prevViewInfo = { scrollTop: scrollRef.current.scrollTop, scrollHeight: scrollRef.current.scrollHeight };
|
|
369
|
-
return [4 /*yield*/, messageDataSource.loadNext()];
|
|
370
|
-
case 1:
|
|
371
|
-
_a.sent();
|
|
372
|
-
setTimeout(function () {
|
|
373
|
-
var nextViewInfo = { scrollHeight: scrollRef.current.scrollHeight };
|
|
374
|
-
var viewUpdated = prevViewInfo.scrollHeight < nextViewInfo.scrollHeight;
|
|
375
|
-
if (viewUpdated) {
|
|
376
|
-
scrollPubSub.publish('scroll', { top: prevViewInfo.scrollTop, lazy: false, animated: false });
|
|
377
|
-
}
|
|
378
|
-
});
|
|
379
|
-
return [2 /*return*/];
|
|
380
|
-
}
|
|
381
|
-
});
|
|
382
|
-
}); })];
|
|
383
|
-
case 1:
|
|
384
|
-
_a.sent();
|
|
385
|
-
preventDuplicateRequest.release();
|
|
386
|
-
if (currentChannel && !messageDataSource.hasNext()) {
|
|
387
|
-
messageDataSource.resetNewMessages();
|
|
388
|
-
if (!disableMarkAsRead)
|
|
389
|
-
markAsReadScheduler.push(currentChannel);
|
|
390
|
-
}
|
|
391
|
-
return [2 /*return*/];
|
|
392
|
-
}
|
|
393
|
-
});
|
|
394
|
-
});
|
|
395
|
-
},
|
|
396
|
-
});
|
|
397
|
-
// SideEffect: Fetch and set to current channel by channelUrl prop.
|
|
398
|
-
useAsyncEffect(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
399
|
-
var channel, error_1;
|
|
400
|
-
var _a;
|
|
401
|
-
return __generator(this, function (_b) {
|
|
402
|
-
switch (_b.label) {
|
|
403
|
-
case 0:
|
|
404
|
-
if (!(sdkStore.initialized && channelUrl)) return [3 /*break*/, 5];
|
|
405
|
-
_b.label = 1;
|
|
406
|
-
case 1:
|
|
407
|
-
_b.trys.push([1, 3, 4, 5]);
|
|
408
|
-
return [4 /*yield*/, sdkStore.sdk.groupChannel.getChannel(channelUrl)];
|
|
409
|
-
case 2:
|
|
410
|
-
channel = _b.sent();
|
|
411
|
-
setCurrentChannel(channel);
|
|
412
|
-
setFetchChannelError(null);
|
|
413
|
-
return [3 /*break*/, 5];
|
|
414
|
-
case 3:
|
|
415
|
-
error_1 = _b.sent();
|
|
416
|
-
setCurrentChannel(null);
|
|
417
|
-
setFetchChannelError(error_1);
|
|
418
|
-
(_a = logger === null || logger === void 0 ? void 0 : logger.error) === null || _a === void 0 ? void 0 : _a.call(logger, 'GroupChannelProvider: error when fetching channel', error_1);
|
|
419
|
-
return [3 /*break*/, 5];
|
|
420
|
-
case 4:
|
|
421
|
-
// Reset states when channel changes
|
|
422
|
-
setQuoteMessage(null);
|
|
423
|
-
setAnimatedMessageId(null);
|
|
424
|
-
return [7 /*endfinally*/];
|
|
425
|
-
case 5: return [2 /*return*/];
|
|
426
|
-
}
|
|
427
|
-
});
|
|
428
|
-
}); }, [sdkStore.initialized, sdkStore.sdk, channelUrl]);
|
|
429
|
-
// SideEffect: Scroll to the bottom
|
|
430
|
-
// - On the initialized message list
|
|
431
|
-
// - On messages sent from the thread
|
|
432
|
-
useAsyncLayoutEffect(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
433
|
-
var onSentMessageFromOtherModule, subscribes;
|
|
434
|
-
return __generator(this, function (_a) {
|
|
435
|
-
switch (_a.label) {
|
|
436
|
-
case 0:
|
|
437
|
-
if (!messageDataSource.initialized) return [3 /*break*/, 2];
|
|
438
|
-
// it prevents message load from previous/next before scroll to bottom finished.
|
|
439
|
-
preventDuplicateRequest.lock();
|
|
440
|
-
return [4 /*yield*/, preventDuplicateRequest.run(function () {
|
|
441
|
-
return new Promise(function (resolve) {
|
|
442
|
-
scrollPubSub.publish('scrollToBottom', { resolve: resolve, animated: false });
|
|
443
|
-
});
|
|
444
|
-
})];
|
|
445
|
-
case 1:
|
|
446
|
-
_a.sent();
|
|
447
|
-
preventDuplicateRequest.release();
|
|
448
|
-
_a.label = 2;
|
|
449
|
-
case 2:
|
|
450
|
-
onSentMessageFromOtherModule = function (data) {
|
|
451
|
-
if (data.channel.url === channelUrl)
|
|
452
|
-
scrollPubSub.publish('scrollToBottom', {});
|
|
453
|
-
};
|
|
454
|
-
subscribes = [
|
|
455
|
-
config.pubSub.subscribe(pubSubTopics.SEND_USER_MESSAGE, onSentMessageFromOtherModule),
|
|
456
|
-
config.pubSub.subscribe(pubSubTopics.SEND_FILE_MESSAGE, onSentMessageFromOtherModule),
|
|
457
|
-
];
|
|
458
|
-
return [2 /*return*/, function () {
|
|
459
|
-
subscribes.forEach(function (subscribe) { return subscribe.remove(); });
|
|
460
|
-
scrollPubSub.publish('scrollToBottom', { animated: false });
|
|
461
|
-
}];
|
|
462
|
-
}
|
|
463
|
-
});
|
|
464
|
-
}); }, [messageDataSource.initialized, channelUrl]);
|
|
465
|
-
// SideEffect: Reset MessageCollection with startingPoint prop.
|
|
466
|
-
useEffect(function () {
|
|
467
|
-
if (typeof startingPoint === 'number') {
|
|
468
|
-
// We do not handle animation for message search here.
|
|
469
|
-
// Please update the animatedMessageId prop to trigger the animation.
|
|
470
|
-
scrollToMessage(startingPoint, 0, false, false);
|
|
471
|
-
}
|
|
472
|
-
}, [startingPoint]);
|
|
473
|
-
// SideEffect: Update animatedMessageId prop to state.
|
|
474
|
-
useEffect(function () {
|
|
475
|
-
if (_animatedMessageId)
|
|
476
|
-
setAnimatedMessageId(_animatedMessageId);
|
|
477
|
-
}, [_animatedMessageId]);
|
|
478
|
-
var scrollToBottom = usePreservedCallback(function (animated) { return __awaiter(void 0, void 0, void 0, function () {
|
|
479
|
-
return __generator(this, function (_a) {
|
|
480
|
-
switch (_a.label) {
|
|
481
|
-
case 0:
|
|
482
|
-
if (!scrollRef.current)
|
|
483
|
-
return [2 /*return*/];
|
|
484
|
-
setAnimatedMessageId(null);
|
|
485
|
-
setIsScrollBottomReached(true);
|
|
486
|
-
if (!(config.isOnline && messageDataSource.hasNext())) return [3 /*break*/, 2];
|
|
487
|
-
return [4 /*yield*/, messageDataSource.resetWithStartingPoint(Number.MAX_SAFE_INTEGER)];
|
|
488
|
-
case 1:
|
|
489
|
-
_a.sent();
|
|
490
|
-
scrollPubSub.publish('scrollToBottom', { animated: animated });
|
|
491
|
-
return [3 /*break*/, 3];
|
|
492
|
-
case 2:
|
|
493
|
-
scrollPubSub.publish('scrollToBottom', { animated: animated });
|
|
494
|
-
_a.label = 3;
|
|
495
|
-
case 3:
|
|
496
|
-
if (currentChannel && !messageDataSource.hasNext()) {
|
|
497
|
-
messageDataSource.resetNewMessages();
|
|
498
|
-
if (!disableMarkAsRead)
|
|
499
|
-
markAsReadScheduler.push(currentChannel);
|
|
500
|
-
}
|
|
501
|
-
return [2 /*return*/];
|
|
502
|
-
}
|
|
503
|
-
});
|
|
504
|
-
}); });
|
|
505
|
-
var scrollToMessage = usePreservedCallback(function (createdAt, messageId, messageFocusAnimated, scrollAnimated) { return __awaiter(void 0, void 0, void 0, function () {
|
|
506
|
-
var element, parentNode, clickHandler, message, topOffset;
|
|
507
|
-
return __generator(this, function (_a) {
|
|
508
|
-
switch (_a.label) {
|
|
509
|
-
case 0:
|
|
510
|
-
element = scrollRef.current;
|
|
511
|
-
parentNode = element === null || element === void 0 ? void 0 : element.parentNode;
|
|
512
|
-
clickHandler = {
|
|
513
|
-
activate: function () {
|
|
514
|
-
if (!element || !parentNode)
|
|
515
|
-
return;
|
|
516
|
-
element.style.pointerEvents = 'auto';
|
|
517
|
-
parentNode.style.cursor = 'auto';
|
|
518
|
-
},
|
|
519
|
-
deactivate: function () {
|
|
520
|
-
if (!element || !parentNode)
|
|
521
|
-
return;
|
|
522
|
-
element.style.pointerEvents = 'none';
|
|
523
|
-
parentNode.style.cursor = 'wait';
|
|
524
|
-
},
|
|
525
|
-
};
|
|
526
|
-
clickHandler.deactivate();
|
|
527
|
-
setAnimatedMessageId(null);
|
|
528
|
-
message = messageDataSource.messages.find(function (it) { return it.messageId === messageId || it.createdAt === createdAt; });
|
|
529
|
-
if (!message) return [3 /*break*/, 1];
|
|
530
|
-
topOffset = getMessageTopOffset(message.createdAt);
|
|
531
|
-
if (topOffset)
|
|
532
|
-
scrollPubSub.publish('scroll', { top: topOffset, animated: scrollAnimated });
|
|
533
|
-
if (messageFocusAnimated !== null && messageFocusAnimated !== void 0 ? messageFocusAnimated : true)
|
|
534
|
-
setAnimatedMessageId(messageId);
|
|
535
|
-
return [3 /*break*/, 3];
|
|
536
|
-
case 1: return [4 /*yield*/, messageDataSource.resetWithStartingPoint(createdAt)];
|
|
537
|
-
case 2:
|
|
538
|
-
_a.sent();
|
|
539
|
-
setTimeout(function () {
|
|
540
|
-
var topOffset = getMessageTopOffset(createdAt);
|
|
541
|
-
if (topOffset)
|
|
542
|
-
scrollPubSub.publish('scroll', { top: topOffset, lazy: false, animated: scrollAnimated });
|
|
543
|
-
if (messageFocusAnimated !== null && messageFocusAnimated !== void 0 ? messageFocusAnimated : true)
|
|
544
|
-
setAnimatedMessageId(messageId);
|
|
545
|
-
});
|
|
546
|
-
_a.label = 3;
|
|
547
|
-
case 3:
|
|
548
|
-
clickHandler.activate();
|
|
549
|
-
return [2 /*return*/];
|
|
550
|
-
}
|
|
551
|
-
});
|
|
552
|
-
}); });
|
|
553
|
-
var messageActions = useMessageActions(__assign(__assign(__assign({}, props), messageDataSource), { scrollToBottom: scrollToBottom, quoteMessage: quoteMessage, replyType: replyType }));
|
|
554
|
-
return (React__default.createElement(GroupChannelContext.Provider, { value: __assign(__assign({
|
|
555
|
-
// # Props
|
|
556
|
-
channelUrl: channelUrl, isReactionEnabled: isReactionEnabled, isMessageGroupingEnabled: isMessageGroupingEnabled, isMultipleFilesMessageEnabled: isMultipleFilesMessageEnabled, showSearchIcon: showSearchIcon !== null && showSearchIcon !== void 0 ? showSearchIcon : config.
|
|
557
|
-
// # Custom Props
|
|
558
|
-
messageListQueryParams: messageListQueryParams,
|
|
559
|
-
// ## Message
|
|
560
|
-
onBeforeSendUserMessage: onBeforeSendUserMessage, onBeforeSendFileMessage: onBeforeSendFileMessage, onBeforeSendVoiceMessage: onBeforeSendVoiceMessage, onBeforeSendMultipleFilesMessage: onBeforeSendMultipleFilesMessage, onBeforeUpdateUserMessage: onBeforeUpdateUserMessage, onBeforeDownloadFileMessage: onBeforeDownloadFileMessage,
|
|
561
|
-
// ## Focusing
|
|
562
|
-
onMessageAnimated: onMessageAnimated,
|
|
563
|
-
// ## Click
|
|
564
|
-
onBackClick: onBackClick, onChatHeaderActionClick: onChatHeaderActionClick, onReplyInThreadClick: onReplyInThreadClick, onSearchClick: onSearchClick, onQuoteMessageClick: onQuoteMessageClick,
|
|
565
|
-
// ## Custom render
|
|
566
|
-
renderUserMentionItem: renderUserMentionItem,
|
|
567
|
-
// Internal Interface
|
|
568
|
-
currentChannel: currentChannel, fetchChannelError: fetchChannelError, nicknamesMap: nicknamesMap, scrollRef: scrollRef, scrollDistanceFromBottomRef: scrollDistanceFromBottomRef, scrollPubSub: scrollPubSub, messageInputRef: messageInputRef, quoteMessage: quoteMessage, setQuoteMessage: setQuoteMessage, animatedMessageId: animatedMessageId, setAnimatedMessageId: setAnimatedMessageId, isScrollBottomReached: isScrollBottomReached, setIsScrollBottomReached: setIsScrollBottomReached, scrollToBottom: scrollToBottom, scrollToMessage: scrollToMessage, toggleReaction: toggleReaction }, messageDataSource), messageActions) },
|
|
569
|
-
React__default.createElement(UserProfileProvider, { disableUserProfile: (_a = props === null || props === void 0 ? void 0 : props.disableUserProfile) !== null && _a !== void 0 ? _a : config === null || config === void 0 ? void 0 : config.disableUserProfile, renderUserProfile: (_b = props === null || props === void 0 ? void 0 : props.renderUserProfile) !== null && _b !== void 0 ? _b : config === null || config === void 0 ? void 0 : config.renderUserProfile, onUserProfileMessage: (_c = props === null || props === void 0 ? void 0 : props.onUserProfileMessage) !== null && _c !== void 0 ? _c : config === null || config === void 0 ? void 0 : config.onUserProfileMessage }, children)));
|
|
570
|
-
};
|
|
571
|
-
var useGroupChannelContext = function () {
|
|
572
|
-
var context = useContext(GroupChannelContext);
|
|
573
|
-
if (!context)
|
|
574
|
-
throw new Error('GroupChannelContext not found. Use within the GroupChannel module.');
|
|
575
|
-
return context;
|
|
576
|
-
};
|
|
577
|
-
function getCollectionCreator(groupChannel, messageListQueryParams) {
|
|
578
|
-
return function (defaultParams) {
|
|
579
|
-
var params = __assign(__assign(__assign({}, defaultParams), { prevResultLimit: 30, nextResultLimit: 30 }), messageListQueryParams);
|
|
580
|
-
return groupChannel.createMessageCollection(__assign(__assign({}, params), { filter: new MessageFilter(params) }));
|
|
581
|
-
};
|
|
252
|
+
var GroupChannelContext = React__default.createContext(null);
|
|
253
|
+
var GroupChannelProvider = function (props) {
|
|
254
|
+
var _a, _b, _c;
|
|
255
|
+
var channelUrl = props.channelUrl, children = props.children, moduleReactionEnabled = props.isReactionEnabled, moduleReplyType = props.replyType, moduleThreadReplySelectType = props.threadReplySelectType, _d = props.isMessageGroupingEnabled, isMessageGroupingEnabled = _d === void 0 ? true : _d, isMultipleFilesMessageEnabled = props.isMultipleFilesMessageEnabled, showSearchIcon = props.showSearchIcon, _e = props.disableMarkAsRead, disableMarkAsRead = _e === void 0 ? false : _e, _f = props.scrollBehavior, scrollBehavior = _f === void 0 ? 'auto' : _f, startingPoint = props.startingPoint, _animatedMessageId = props.animatedMessageId, messageListQueryParams = props.messageListQueryParams, onBeforeSendUserMessage = props.onBeforeSendUserMessage, onBeforeSendFileMessage = props.onBeforeSendFileMessage, onBeforeSendVoiceMessage = props.onBeforeSendVoiceMessage, onBeforeSendMultipleFilesMessage = props.onBeforeSendMultipleFilesMessage, onBeforeUpdateUserMessage = props.onBeforeUpdateUserMessage, onBeforeDownloadFileMessage = props.onBeforeDownloadFileMessage, onMessageAnimated = props.onMessageAnimated, onBackClick = props.onBackClick, onChatHeaderActionClick = props.onChatHeaderActionClick, onReplyInThreadClick = props.onReplyInThreadClick, onSearchClick = props.onSearchClick, onQuoteMessageClick = props.onQuoteMessageClick, renderUserMentionItem = props.renderUserMentionItem;
|
|
256
|
+
// Global context
|
|
257
|
+
var _g = useSendbirdStateContext(), config = _g.config, stores = _g.stores;
|
|
258
|
+
var sdkStore = stores.sdkStore;
|
|
259
|
+
var markAsReadScheduler = config.markAsReadScheduler, logger = config.logger;
|
|
260
|
+
// State
|
|
261
|
+
var _h = useState(null), quoteMessage = _h[0], setQuoteMessage = _h[1];
|
|
262
|
+
var _j = useState(null), animatedMessageId = _j[0], setAnimatedMessageId = _j[1];
|
|
263
|
+
var _k = useState(null), currentChannel = _k[0], setCurrentChannel = _k[1];
|
|
264
|
+
var _l = useState(null), fetchChannelError = _l[0], setFetchChannelError = _l[1];
|
|
265
|
+
// Ref
|
|
266
|
+
var _m = useMessageListScroll(scrollBehavior), scrollRef = _m.scrollRef, scrollPubSub = _m.scrollPubSub, scrollDistanceFromBottomRef = _m.scrollDistanceFromBottomRef, isScrollBottomReached = _m.isScrollBottomReached, setIsScrollBottomReached = _m.setIsScrollBottomReached;
|
|
267
|
+
var messageInputRef = useRef(null);
|
|
268
|
+
var toggleReaction = useToggleReactionCallback(currentChannel, logger);
|
|
269
|
+
var replyType = getCaseResolvedReplyType(moduleReplyType !== null && moduleReplyType !== void 0 ? moduleReplyType : config.groupChannel.replyType).upperCase;
|
|
270
|
+
var threadReplySelectType = getCaseResolvedThreadReplySelectType(moduleThreadReplySelectType !== null && moduleThreadReplySelectType !== void 0 ? moduleThreadReplySelectType : config.groupChannel.threadReplySelectType).upperCase;
|
|
271
|
+
var chatReplyType = useIIFE(function () {
|
|
272
|
+
if (replyType === 'NONE')
|
|
273
|
+
return ReplyType.NONE;
|
|
274
|
+
return ReplyType.ONLY_REPLY_TO_CHANNEL;
|
|
275
|
+
});
|
|
276
|
+
var isReactionEnabled = getIsReactionEnabled({
|
|
277
|
+
channel: currentChannel,
|
|
278
|
+
config: config,
|
|
279
|
+
moduleLevel: moduleReactionEnabled,
|
|
280
|
+
});
|
|
281
|
+
var nicknamesMap = useMemo(function () { var _a; return new Map(((_a = currentChannel === null || currentChannel === void 0 ? void 0 : currentChannel.members) !== null && _a !== void 0 ? _a : []).map(function (_a) {
|
|
282
|
+
var userId = _a.userId, nickname = _a.nickname;
|
|
283
|
+
return [userId, nickname];
|
|
284
|
+
})); }, [currentChannel === null || currentChannel === void 0 ? void 0 : currentChannel.members]);
|
|
285
|
+
var preventDuplicateRequest = usePreventDuplicateRequest();
|
|
286
|
+
var messageDataSource = useGroupChannelMessages(sdkStore.sdk, currentChannel, {
|
|
287
|
+
startingPoint: startingPoint,
|
|
288
|
+
replyType: chatReplyType,
|
|
289
|
+
collectionCreator: getCollectionCreator(currentChannel, messageListQueryParams),
|
|
290
|
+
shouldCountNewMessages: function () { return !isScrollBottomReached; },
|
|
291
|
+
markAsRead: function (channels) {
|
|
292
|
+
// isScrollBottomReached is a state that is updated after the render is completed.
|
|
293
|
+
// So, we use scrollDistanceFromBottomRef to check quickly if the scroll is at the bottom.
|
|
294
|
+
if (!disableMarkAsRead && scrollDistanceFromBottomRef.current <= SCROLL_BUFFER) {
|
|
295
|
+
channels.forEach(function (it) { return markAsReadScheduler.push(it); });
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
onMessagesReceived: function () {
|
|
299
|
+
if (isScrollBottomReached && isContextMenuClosed()) {
|
|
300
|
+
scrollPubSub.publish('scrollToBottom', {});
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
onChannelDeleted: function () {
|
|
304
|
+
setCurrentChannel(null);
|
|
305
|
+
setFetchChannelError(null);
|
|
306
|
+
},
|
|
307
|
+
onCurrentUserBanned: function () {
|
|
308
|
+
setCurrentChannel(null);
|
|
309
|
+
setFetchChannelError(null);
|
|
310
|
+
},
|
|
311
|
+
onChannelUpdated: function (channel) { return setCurrentChannel(channel); },
|
|
312
|
+
logger: logger,
|
|
313
|
+
});
|
|
314
|
+
useOnScrollPositionChangeDetectorWithRef(scrollRef, {
|
|
315
|
+
onReachedTop: function () {
|
|
316
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
317
|
+
var _this = this;
|
|
318
|
+
return __generator(this, function (_a) {
|
|
319
|
+
switch (_a.label) {
|
|
320
|
+
case 0:
|
|
321
|
+
preventDuplicateRequest.lock();
|
|
322
|
+
return [4 /*yield*/, preventDuplicateRequest.run(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
323
|
+
var prevViewInfo;
|
|
324
|
+
return __generator(this, function (_a) {
|
|
325
|
+
switch (_a.label) {
|
|
326
|
+
case 0:
|
|
327
|
+
if (!messageDataSource.hasPrevious())
|
|
328
|
+
return [2 /*return*/];
|
|
329
|
+
prevViewInfo = { scrollTop: scrollRef.current.scrollTop, scrollHeight: scrollRef.current.scrollHeight };
|
|
330
|
+
return [4 /*yield*/, messageDataSource.loadPrevious()];
|
|
331
|
+
case 1:
|
|
332
|
+
_a.sent();
|
|
333
|
+
// FIXME: We need a good way to detect right after the rendering of the screen instead of using setTimeout.
|
|
334
|
+
setTimeout(function () {
|
|
335
|
+
var nextViewInfo = { scrollHeight: scrollRef.current.scrollHeight };
|
|
336
|
+
var viewUpdated = prevViewInfo.scrollHeight < nextViewInfo.scrollHeight;
|
|
337
|
+
if (viewUpdated) {
|
|
338
|
+
var bottomOffset = prevViewInfo.scrollHeight - prevViewInfo.scrollTop;
|
|
339
|
+
scrollPubSub.publish('scroll', { top: nextViewInfo.scrollHeight - bottomOffset, lazy: false, animated: false });
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
return [2 /*return*/];
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
}); })];
|
|
346
|
+
case 1:
|
|
347
|
+
_a.sent();
|
|
348
|
+
preventDuplicateRequest.release();
|
|
349
|
+
return [2 /*return*/];
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
});
|
|
353
|
+
},
|
|
354
|
+
onReachedBottom: function () {
|
|
355
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
356
|
+
var _this = this;
|
|
357
|
+
return __generator(this, function (_a) {
|
|
358
|
+
switch (_a.label) {
|
|
359
|
+
case 0:
|
|
360
|
+
preventDuplicateRequest.lock();
|
|
361
|
+
return [4 /*yield*/, preventDuplicateRequest.run(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
362
|
+
var prevViewInfo;
|
|
363
|
+
return __generator(this, function (_a) {
|
|
364
|
+
switch (_a.label) {
|
|
365
|
+
case 0:
|
|
366
|
+
if (!messageDataSource.hasNext())
|
|
367
|
+
return [2 /*return*/];
|
|
368
|
+
prevViewInfo = { scrollTop: scrollRef.current.scrollTop, scrollHeight: scrollRef.current.scrollHeight };
|
|
369
|
+
return [4 /*yield*/, messageDataSource.loadNext()];
|
|
370
|
+
case 1:
|
|
371
|
+
_a.sent();
|
|
372
|
+
setTimeout(function () {
|
|
373
|
+
var nextViewInfo = { scrollHeight: scrollRef.current.scrollHeight };
|
|
374
|
+
var viewUpdated = prevViewInfo.scrollHeight < nextViewInfo.scrollHeight;
|
|
375
|
+
if (viewUpdated) {
|
|
376
|
+
scrollPubSub.publish('scroll', { top: prevViewInfo.scrollTop, lazy: false, animated: false });
|
|
377
|
+
}
|
|
378
|
+
});
|
|
379
|
+
return [2 /*return*/];
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
}); })];
|
|
383
|
+
case 1:
|
|
384
|
+
_a.sent();
|
|
385
|
+
preventDuplicateRequest.release();
|
|
386
|
+
if (currentChannel && !messageDataSource.hasNext()) {
|
|
387
|
+
messageDataSource.resetNewMessages();
|
|
388
|
+
if (!disableMarkAsRead)
|
|
389
|
+
markAsReadScheduler.push(currentChannel);
|
|
390
|
+
}
|
|
391
|
+
return [2 /*return*/];
|
|
392
|
+
}
|
|
393
|
+
});
|
|
394
|
+
});
|
|
395
|
+
},
|
|
396
|
+
});
|
|
397
|
+
// SideEffect: Fetch and set to current channel by channelUrl prop.
|
|
398
|
+
useAsyncEffect(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
399
|
+
var channel, error_1;
|
|
400
|
+
var _a;
|
|
401
|
+
return __generator(this, function (_b) {
|
|
402
|
+
switch (_b.label) {
|
|
403
|
+
case 0:
|
|
404
|
+
if (!(sdkStore.initialized && channelUrl)) return [3 /*break*/, 5];
|
|
405
|
+
_b.label = 1;
|
|
406
|
+
case 1:
|
|
407
|
+
_b.trys.push([1, 3, 4, 5]);
|
|
408
|
+
return [4 /*yield*/, sdkStore.sdk.groupChannel.getChannel(channelUrl)];
|
|
409
|
+
case 2:
|
|
410
|
+
channel = _b.sent();
|
|
411
|
+
setCurrentChannel(channel);
|
|
412
|
+
setFetchChannelError(null);
|
|
413
|
+
return [3 /*break*/, 5];
|
|
414
|
+
case 3:
|
|
415
|
+
error_1 = _b.sent();
|
|
416
|
+
setCurrentChannel(null);
|
|
417
|
+
setFetchChannelError(error_1);
|
|
418
|
+
(_a = logger === null || logger === void 0 ? void 0 : logger.error) === null || _a === void 0 ? void 0 : _a.call(logger, 'GroupChannelProvider: error when fetching channel', error_1);
|
|
419
|
+
return [3 /*break*/, 5];
|
|
420
|
+
case 4:
|
|
421
|
+
// Reset states when channel changes
|
|
422
|
+
setQuoteMessage(null);
|
|
423
|
+
setAnimatedMessageId(null);
|
|
424
|
+
return [7 /*endfinally*/];
|
|
425
|
+
case 5: return [2 /*return*/];
|
|
426
|
+
}
|
|
427
|
+
});
|
|
428
|
+
}); }, [sdkStore.initialized, sdkStore.sdk, channelUrl]);
|
|
429
|
+
// SideEffect: Scroll to the bottom
|
|
430
|
+
// - On the initialized message list
|
|
431
|
+
// - On messages sent from the thread
|
|
432
|
+
useAsyncLayoutEffect(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
433
|
+
var onSentMessageFromOtherModule, subscribes;
|
|
434
|
+
return __generator(this, function (_a) {
|
|
435
|
+
switch (_a.label) {
|
|
436
|
+
case 0:
|
|
437
|
+
if (!messageDataSource.initialized) return [3 /*break*/, 2];
|
|
438
|
+
// it prevents message load from previous/next before scroll to bottom finished.
|
|
439
|
+
preventDuplicateRequest.lock();
|
|
440
|
+
return [4 /*yield*/, preventDuplicateRequest.run(function () {
|
|
441
|
+
return new Promise(function (resolve) {
|
|
442
|
+
scrollPubSub.publish('scrollToBottom', { resolve: resolve, animated: false });
|
|
443
|
+
});
|
|
444
|
+
})];
|
|
445
|
+
case 1:
|
|
446
|
+
_a.sent();
|
|
447
|
+
preventDuplicateRequest.release();
|
|
448
|
+
_a.label = 2;
|
|
449
|
+
case 2:
|
|
450
|
+
onSentMessageFromOtherModule = function (data) {
|
|
451
|
+
if (data.channel.url === channelUrl)
|
|
452
|
+
scrollPubSub.publish('scrollToBottom', {});
|
|
453
|
+
};
|
|
454
|
+
subscribes = [
|
|
455
|
+
config.pubSub.subscribe(pubSubTopics.SEND_USER_MESSAGE, onSentMessageFromOtherModule),
|
|
456
|
+
config.pubSub.subscribe(pubSubTopics.SEND_FILE_MESSAGE, onSentMessageFromOtherModule),
|
|
457
|
+
];
|
|
458
|
+
return [2 /*return*/, function () {
|
|
459
|
+
subscribes.forEach(function (subscribe) { return subscribe.remove(); });
|
|
460
|
+
scrollPubSub.publish('scrollToBottom', { animated: false });
|
|
461
|
+
}];
|
|
462
|
+
}
|
|
463
|
+
});
|
|
464
|
+
}); }, [messageDataSource.initialized, channelUrl]);
|
|
465
|
+
// SideEffect: Reset MessageCollection with startingPoint prop.
|
|
466
|
+
useEffect(function () {
|
|
467
|
+
if (typeof startingPoint === 'number') {
|
|
468
|
+
// We do not handle animation for message search here.
|
|
469
|
+
// Please update the animatedMessageId prop to trigger the animation.
|
|
470
|
+
scrollToMessage(startingPoint, 0, false, false);
|
|
471
|
+
}
|
|
472
|
+
}, [startingPoint]);
|
|
473
|
+
// SideEffect: Update animatedMessageId prop to state.
|
|
474
|
+
useEffect(function () {
|
|
475
|
+
if (_animatedMessageId)
|
|
476
|
+
setAnimatedMessageId(_animatedMessageId);
|
|
477
|
+
}, [_animatedMessageId]);
|
|
478
|
+
var scrollToBottom = usePreservedCallback(function (animated) { return __awaiter(void 0, void 0, void 0, function () {
|
|
479
|
+
return __generator(this, function (_a) {
|
|
480
|
+
switch (_a.label) {
|
|
481
|
+
case 0:
|
|
482
|
+
if (!scrollRef.current)
|
|
483
|
+
return [2 /*return*/];
|
|
484
|
+
setAnimatedMessageId(null);
|
|
485
|
+
setIsScrollBottomReached(true);
|
|
486
|
+
if (!(config.isOnline && messageDataSource.hasNext())) return [3 /*break*/, 2];
|
|
487
|
+
return [4 /*yield*/, messageDataSource.resetWithStartingPoint(Number.MAX_SAFE_INTEGER)];
|
|
488
|
+
case 1:
|
|
489
|
+
_a.sent();
|
|
490
|
+
scrollPubSub.publish('scrollToBottom', { animated: animated });
|
|
491
|
+
return [3 /*break*/, 3];
|
|
492
|
+
case 2:
|
|
493
|
+
scrollPubSub.publish('scrollToBottom', { animated: animated });
|
|
494
|
+
_a.label = 3;
|
|
495
|
+
case 3:
|
|
496
|
+
if (currentChannel && !messageDataSource.hasNext()) {
|
|
497
|
+
messageDataSource.resetNewMessages();
|
|
498
|
+
if (!disableMarkAsRead)
|
|
499
|
+
markAsReadScheduler.push(currentChannel);
|
|
500
|
+
}
|
|
501
|
+
return [2 /*return*/];
|
|
502
|
+
}
|
|
503
|
+
});
|
|
504
|
+
}); });
|
|
505
|
+
var scrollToMessage = usePreservedCallback(function (createdAt, messageId, messageFocusAnimated, scrollAnimated) { return __awaiter(void 0, void 0, void 0, function () {
|
|
506
|
+
var element, parentNode, clickHandler, message, topOffset;
|
|
507
|
+
return __generator(this, function (_a) {
|
|
508
|
+
switch (_a.label) {
|
|
509
|
+
case 0:
|
|
510
|
+
element = scrollRef.current;
|
|
511
|
+
parentNode = element === null || element === void 0 ? void 0 : element.parentNode;
|
|
512
|
+
clickHandler = {
|
|
513
|
+
activate: function () {
|
|
514
|
+
if (!element || !parentNode)
|
|
515
|
+
return;
|
|
516
|
+
element.style.pointerEvents = 'auto';
|
|
517
|
+
parentNode.style.cursor = 'auto';
|
|
518
|
+
},
|
|
519
|
+
deactivate: function () {
|
|
520
|
+
if (!element || !parentNode)
|
|
521
|
+
return;
|
|
522
|
+
element.style.pointerEvents = 'none';
|
|
523
|
+
parentNode.style.cursor = 'wait';
|
|
524
|
+
},
|
|
525
|
+
};
|
|
526
|
+
clickHandler.deactivate();
|
|
527
|
+
setAnimatedMessageId(null);
|
|
528
|
+
message = messageDataSource.messages.find(function (it) { return it.messageId === messageId || it.createdAt === createdAt; });
|
|
529
|
+
if (!message) return [3 /*break*/, 1];
|
|
530
|
+
topOffset = getMessageTopOffset(message.createdAt);
|
|
531
|
+
if (topOffset)
|
|
532
|
+
scrollPubSub.publish('scroll', { top: topOffset, animated: scrollAnimated });
|
|
533
|
+
if (messageFocusAnimated !== null && messageFocusAnimated !== void 0 ? messageFocusAnimated : true)
|
|
534
|
+
setAnimatedMessageId(messageId);
|
|
535
|
+
return [3 /*break*/, 3];
|
|
536
|
+
case 1: return [4 /*yield*/, messageDataSource.resetWithStartingPoint(createdAt)];
|
|
537
|
+
case 2:
|
|
538
|
+
_a.sent();
|
|
539
|
+
setTimeout(function () {
|
|
540
|
+
var topOffset = getMessageTopOffset(createdAt);
|
|
541
|
+
if (topOffset)
|
|
542
|
+
scrollPubSub.publish('scroll', { top: topOffset, lazy: false, animated: scrollAnimated });
|
|
543
|
+
if (messageFocusAnimated !== null && messageFocusAnimated !== void 0 ? messageFocusAnimated : true)
|
|
544
|
+
setAnimatedMessageId(messageId);
|
|
545
|
+
});
|
|
546
|
+
_a.label = 3;
|
|
547
|
+
case 3:
|
|
548
|
+
clickHandler.activate();
|
|
549
|
+
return [2 /*return*/];
|
|
550
|
+
}
|
|
551
|
+
});
|
|
552
|
+
}); });
|
|
553
|
+
var messageActions = useMessageActions(__assign(__assign(__assign({}, props), messageDataSource), { scrollToBottom: scrollToBottom, quoteMessage: quoteMessage, replyType: replyType }));
|
|
554
|
+
return (React__default.createElement(GroupChannelContext.Provider, { value: __assign(__assign({
|
|
555
|
+
// # Props
|
|
556
|
+
channelUrl: channelUrl, isReactionEnabled: isReactionEnabled, isMessageGroupingEnabled: isMessageGroupingEnabled, isMultipleFilesMessageEnabled: isMultipleFilesMessageEnabled, showSearchIcon: showSearchIcon !== null && showSearchIcon !== void 0 ? showSearchIcon : config.groupChannelSettings.enableMessageSearch, replyType: replyType, threadReplySelectType: threadReplySelectType, disableMarkAsRead: disableMarkAsRead, scrollBehavior: scrollBehavior,
|
|
557
|
+
// # Custom Props
|
|
558
|
+
messageListQueryParams: messageListQueryParams,
|
|
559
|
+
// ## Message
|
|
560
|
+
onBeforeSendUserMessage: onBeforeSendUserMessage, onBeforeSendFileMessage: onBeforeSendFileMessage, onBeforeSendVoiceMessage: onBeforeSendVoiceMessage, onBeforeSendMultipleFilesMessage: onBeforeSendMultipleFilesMessage, onBeforeUpdateUserMessage: onBeforeUpdateUserMessage, onBeforeDownloadFileMessage: onBeforeDownloadFileMessage,
|
|
561
|
+
// ## Focusing
|
|
562
|
+
onMessageAnimated: onMessageAnimated,
|
|
563
|
+
// ## Click
|
|
564
|
+
onBackClick: onBackClick, onChatHeaderActionClick: onChatHeaderActionClick, onReplyInThreadClick: onReplyInThreadClick, onSearchClick: onSearchClick, onQuoteMessageClick: onQuoteMessageClick,
|
|
565
|
+
// ## Custom render
|
|
566
|
+
renderUserMentionItem: renderUserMentionItem,
|
|
567
|
+
// Internal Interface
|
|
568
|
+
currentChannel: currentChannel, fetchChannelError: fetchChannelError, nicknamesMap: nicknamesMap, scrollRef: scrollRef, scrollDistanceFromBottomRef: scrollDistanceFromBottomRef, scrollPubSub: scrollPubSub, messageInputRef: messageInputRef, quoteMessage: quoteMessage, setQuoteMessage: setQuoteMessage, animatedMessageId: animatedMessageId, setAnimatedMessageId: setAnimatedMessageId, isScrollBottomReached: isScrollBottomReached, setIsScrollBottomReached: setIsScrollBottomReached, scrollToBottom: scrollToBottom, scrollToMessage: scrollToMessage, toggleReaction: toggleReaction }, messageDataSource), messageActions) },
|
|
569
|
+
React__default.createElement(UserProfileProvider, { disableUserProfile: (_a = props === null || props === void 0 ? void 0 : props.disableUserProfile) !== null && _a !== void 0 ? _a : config === null || config === void 0 ? void 0 : config.disableUserProfile, renderUserProfile: (_b = props === null || props === void 0 ? void 0 : props.renderUserProfile) !== null && _b !== void 0 ? _b : config === null || config === void 0 ? void 0 : config.renderUserProfile, onUserProfileMessage: (_c = props === null || props === void 0 ? void 0 : props.onUserProfileMessage) !== null && _c !== void 0 ? _c : config === null || config === void 0 ? void 0 : config.onUserProfileMessage }, children)));
|
|
570
|
+
};
|
|
571
|
+
var useGroupChannelContext = function () {
|
|
572
|
+
var context = useContext(GroupChannelContext);
|
|
573
|
+
if (!context)
|
|
574
|
+
throw new Error('GroupChannelContext not found. Use within the GroupChannel module.');
|
|
575
|
+
return context;
|
|
576
|
+
};
|
|
577
|
+
function getCollectionCreator(groupChannel, messageListQueryParams) {
|
|
578
|
+
return function (defaultParams) {
|
|
579
|
+
var params = __assign(__assign(__assign({}, defaultParams), { prevResultLimit: 30, nextResultLimit: 30 }), messageListQueryParams);
|
|
580
|
+
return groupChannel.createMessageCollection(__assign(__assign({}, params), { filter: new MessageFilter(params) }));
|
|
581
|
+
};
|
|
582
582
|
}
|
|
583
583
|
|
|
584
584
|
export { GroupChannelContext, GroupChannelProvider, useGroupChannelContext };
|