@sendbird/uikit-react 3.15.4 → 3.15.5-rc
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 +80 -79
- package/App.js.map +1 -1
- package/CHANGELOG.md +11 -0
- package/Channel/components/ChannelHeader.js +34 -34
- package/Channel/components/ChannelUI.js +66 -65
- package/Channel/components/ChannelUI.js.map +1 -1
- package/Channel/components/FileViewer.js +31 -31
- package/Channel/components/FrozenNotification.js +5 -5
- package/Channel/components/Message.js +55 -55
- package/Channel/components/MessageInput.js +43 -43
- package/Channel/components/MessageInputWrapper.js +43 -43
- package/Channel/components/MessageList.js +61 -60
- package/Channel/components/MessageList.js.map +1 -1
- package/Channel/components/RemoveMessageModal.js +30 -30
- package/Channel/components/SuggestedMentionList.js +32 -32
- package/Channel/components/TypingIndicator.js +5 -5
- package/Channel/components/UnreadCount.js +7 -7
- package/Channel/context.js +28 -28
- package/Channel/hooks/useHandleUploadFiles.js +16 -16
- package/Channel/hooks/useInitialMessagesFetch.js +8 -8
- package/Channel/utils/compareMessagesForGrouping.js +8 -7
- package/Channel/utils/compareMessagesForGrouping.js.map +1 -1
- package/Channel/utils/getMessagePartsInfo.js +9 -8
- package/Channel/utils/getMessagePartsInfo.js.map +1 -1
- package/Channel.js +66 -65
- package/Channel.js.map +1 -1
- package/ChannelList/components/AddChannel.js +22 -22
- package/ChannelList/components/ChannelListHeader.js +9 -9
- package/ChannelList/components/ChannelListUI.js +37 -37
- package/ChannelList/components/ChannelPreview.js +30 -30
- package/ChannelList/components/ChannelPreviewAction.js +14 -14
- package/ChannelList/context.js +18 -18
- package/ChannelList.js +37 -37
- package/ChannelSettings/components/ChannelProfile.js +20 -20
- package/ChannelSettings/components/ChannelSettingMenuList.js +17 -17
- package/ChannelSettings/components/ChannelSettingsHeader.js +7 -7
- package/ChannelSettings/components/ChannelSettingsMenuItem.js +2 -2
- package/ChannelSettings/components/ChannelSettingsUI.js +27 -27
- package/ChannelSettings/components/EditDetailsModal.js +20 -20
- package/ChannelSettings/components/LeaveChannel.js +17 -17
- package/ChannelSettings/components/ModerationPanel.js +25 -25
- package/ChannelSettings/components/UserListItem.js +18 -18
- package/ChannelSettings/components/UserPanel.js +24 -24
- package/ChannelSettings/context.js +16 -16
- package/ChannelSettings/hooks/useMenuList.js +25 -25
- package/ChannelSettings.js +27 -27
- package/CreateChannel/components/CreateChannelUI.js +19 -19
- package/CreateChannel/components/InviteUsers.js +19 -19
- package/CreateChannel/components/SelectChannelType.js +16 -16
- package/CreateChannel/context.js +4 -4
- package/CreateChannel.js +19 -19
- package/CreateOpenChannel/components/CreateOpenChannelUI.js +17 -17
- package/CreateOpenChannel/context.js +1 -1
- package/CreateOpenChannel.js +17 -17
- package/EditUserProfile/components/EditUserProfileUI.js +18 -18
- package/EditUserProfile/context.js +1 -1
- package/EditUserProfile.js +18 -18
- package/GroupChannel/components/FileViewer.js +26 -26
- package/GroupChannel/components/FrozenNotification.js +5 -5
- package/GroupChannel/components/GroupChannelHeader.js +29 -29
- package/GroupChannel/components/GroupChannelUI.js +59 -58
- package/GroupChannel/components/GroupChannelUI.js.map +1 -1
- package/GroupChannel/components/Message.js +50 -50
- package/GroupChannel/components/MessageInputWrapper.js +38 -38
- package/GroupChannel/components/MessageList.js +52 -51
- package/GroupChannel/components/MessageList.js.map +1 -1
- package/GroupChannel/components/RemoveMessageModal.js +25 -25
- package/GroupChannel/components/SuggestedMentionList.js +11 -11
- package/GroupChannel/components/TypingIndicator.js +5 -5
- package/GroupChannel/components/UnreadCount.js +7 -7
- package/GroupChannel/context.js +23 -23
- package/GroupChannel.js +59 -58
- package/GroupChannel.js.map +1 -1
- package/GroupChannelList/components/AddGroupChannel.js +21 -21
- package/GroupChannelList/components/GroupChannelListHeader.js +9 -9
- package/GroupChannelList/components/GroupChannelListItem.js +28 -28
- package/GroupChannelList/components/GroupChannelListUI.js +36 -36
- package/GroupChannelList/components/GroupChannelPreviewAction.js +14 -14
- package/GroupChannelList/context.js +16 -16
- package/GroupChannelList.js +36 -36
- package/MessageSearch/components/MessageSearchUI.js +15 -14
- package/MessageSearch/components/MessageSearchUI.js.map +1 -1
- package/MessageSearch/context.js +1 -1
- package/MessageSearch.js +17 -16
- package/MessageSearch.js.map +1 -1
- package/OpenChannel/components/FrozenChannelNotification.js +4 -4
- package/OpenChannel/components/OpenChannelHeader.js +21 -21
- package/OpenChannel/components/OpenChannelInput.js +27 -27
- package/OpenChannel/components/OpenChannelMessage.js +36 -36
- package/OpenChannel/components/OpenChannelMessageList.js +40 -40
- package/OpenChannel/components/OpenChannelUI.js +40 -40
- package/OpenChannel/context.js +20 -20
- package/OpenChannel.js +40 -40
- package/OpenChannelList/components/OpenChannelListUI.js +19 -19
- package/OpenChannelList/components/OpenChannelPreview.js +6 -6
- package/OpenChannelList/context.js +3 -3
- package/OpenChannelList.js +19 -19
- package/OpenChannelSettings/components/EditDetailsModal.js +20 -20
- package/OpenChannelSettings/components/OpenChannelProfile.js +20 -20
- package/OpenChannelSettings/components/OpenChannelSettingsUI.js +21 -21
- package/OpenChannelSettings/components/OperatorUI.js +21 -21
- package/OpenChannelSettings/components/ParticipantUI.js +19 -19
- package/OpenChannelSettings/context.js +15 -15
- package/OpenChannelSettings.js +21 -21
- package/SendbirdProvider.js +20 -20
- package/Thread/components/ParentMessageInfo.js +45 -45
- package/Thread/components/ParentMessageInfoItem.js +30 -30
- package/Thread/components/ThreadHeader.js +7 -7
- package/Thread/components/ThreadList.js +52 -52
- package/Thread/components/ThreadListItem.js +52 -52
- package/Thread/components/ThreadMessageInput.js +43 -43
- package/Thread/components/ThreadUI.js +58 -58
- package/Thread/context.js +21 -21
- package/Thread.js +58 -58
- package/VoicePlayer/context.js +4 -4
- package/VoicePlayer/useVoicePlayer.js +14 -14
- package/VoiceRecorder/context.js +14 -14
- package/VoiceRecorder/useVoiceRecorder.js +14 -14
- package/chunks/{bundle-kAnCqJ1s.js → bundle--I9c_WRf.js} +2 -2
- package/chunks/bundle--I9c_WRf.js.map +1 -0
- package/chunks/{bundle-Qa-OShfm.js → bundle-33x_fIZU.js} +12 -12
- package/chunks/bundle-33x_fIZU.js.map +1 -0
- package/chunks/{bundle-DZ92KGoS.js → bundle-3SjnCeCw.js} +3 -3
- package/chunks/bundle-3SjnCeCw.js.map +1 -0
- package/chunks/{bundle-piJ_EqHo.js → bundle-3dXyFyph.js} +8 -8
- package/chunks/bundle-3dXyFyph.js.map +1 -0
- package/chunks/{bundle-DOVBsMiS.js → bundle-3h7e3nL9.js} +6 -6
- package/chunks/bundle-3h7e3nL9.js.map +1 -0
- package/chunks/{bundle-Dw_-sD_V.js → bundle-6HZ2fPYG.js} +6 -6
- package/chunks/bundle-6HZ2fPYG.js.map +1 -0
- package/chunks/{bundle-4FX6gpGw.js → bundle-6qtkp1BQ.js} +1 -1
- package/chunks/bundle-6qtkp1BQ.js.map +1 -0
- package/chunks/{bundle-D48t2vTo.js → bundle-B-KvpqF_.js} +1 -1
- package/chunks/bundle-B-KvpqF_.js.map +1 -0
- package/chunks/{bundle-BQ1z_avv.js → bundle-B-SkGtAp.js} +6 -6
- package/chunks/{bundle-BQ1z_avv.js.map → bundle-B-SkGtAp.js.map} +1 -1
- package/chunks/{bundle-g4f6DqPZ.js → bundle-BDc7lm7H.js} +1 -1
- package/chunks/bundle-BDc7lm7H.js.map +1 -0
- package/chunks/{bundle-CkDGUIvh.js → bundle-BHJDpnnw.js} +8 -8
- package/chunks/bundle-BHJDpnnw.js.map +1 -0
- package/chunks/{bundle-BHGFStnL.js → bundle-BW_e3YLX.js} +2 -2
- package/chunks/{bundle-BHGFStnL.js.map → bundle-BW_e3YLX.js.map} +1 -1
- package/chunks/{bundle-DbVGPg9d.js → bundle-Baxp9dWn.js} +1 -1
- package/chunks/bundle-Baxp9dWn.js.map +1 -0
- package/chunks/{bundle-CYvEzbcv.js → bundle-BcMa6bRz.js} +1 -1
- package/chunks/{bundle-CYvEzbcv.js.map → bundle-BcMa6bRz.js.map} +1 -1
- package/chunks/{bundle-BafPumSi.js → bundle-Bci8XE9e.js} +11 -11
- package/chunks/{bundle-BafPumSi.js.map → bundle-Bci8XE9e.js.map} +1 -1
- package/chunks/{bundle-kMS1-vHn.js → bundle-BftwVmTo.js} +1 -1
- package/chunks/bundle-BftwVmTo.js.map +1 -0
- package/chunks/{bundle-DZK4rg_Y.js → bundle-BlC-a9vb.js} +1 -1
- package/chunks/bundle-BlC-a9vb.js.map +1 -0
- package/chunks/{bundle-BE89xaRV.js → bundle-Bm8WXXjU.js} +3 -3
- package/chunks/{bundle-BE89xaRV.js.map → bundle-Bm8WXXjU.js.map} +1 -1
- package/chunks/{bundle-02mU_mdQ.js → bundle-C0IbzUJG.js} +1 -1
- package/chunks/bundle-C0IbzUJG.js.map +1 -0
- package/chunks/{bundle-D3WudT0B.js → bundle-C2BixEka.js} +3 -3
- package/chunks/{bundle-D3WudT0B.js.map → bundle-C2BixEka.js.map} +1 -1
- package/chunks/{bundle-B9UrPiWj.js → bundle-C2q8Goc7.js} +3 -3
- package/chunks/{bundle-B9UrPiWj.js.map → bundle-C2q8Goc7.js.map} +1 -1
- package/chunks/{bundle-BAce4maL.js → bundle-C4rgncw9.js} +1 -1
- package/chunks/bundle-C4rgncw9.js.map +1 -0
- package/chunks/{bundle-CgXWgHrU.js → bundle-C7YkwrEO.js} +4 -4
- package/chunks/{bundle-CgXWgHrU.js.map → bundle-C7YkwrEO.js.map} +1 -1
- package/chunks/{bundle-DzFqlsbR.js → bundle-CALm3gy6.js} +1 -1
- package/chunks/bundle-CALm3gy6.js.map +1 -0
- package/chunks/{bundle-B9HB3GJk.js → bundle-CBtXowGf.js} +6 -6
- package/chunks/{bundle-B9HB3GJk.js.map → bundle-CBtXowGf.js.map} +1 -1
- package/chunks/{bundle-C_lEOEUK.js → bundle-CJFbDSex.js} +9 -9
- package/chunks/{bundle-C_lEOEUK.js.map → bundle-CJFbDSex.js.map} +1 -1
- package/chunks/{bundle-Bv0CLKmK.js → bundle-CK0sFwxD.js} +5 -5
- package/chunks/bundle-CK0sFwxD.js.map +1 -0
- package/chunks/{bundle-S77tFmNz.js → bundle-CMCuKccH.js} +1 -1
- package/chunks/{bundle-S77tFmNz.js.map → bundle-CMCuKccH.js.map} +1 -1
- package/chunks/{bundle-BpEd5_0o.js → bundle-CMESiX3f.js} +2 -2
- package/chunks/{bundle-BpEd5_0o.js.map → bundle-CMESiX3f.js.map} +1 -1
- package/chunks/{bundle-zxooGkqM.js → bundle-CPjZUpaJ.js} +585 -398
- package/chunks/bundle-CPjZUpaJ.js.map +1 -0
- package/chunks/{bundle-Ch7HVLiB.js → bundle-CYk2_7OD.js} +2 -2
- package/chunks/bundle-CYk2_7OD.js.map +1 -0
- package/chunks/{bundle-DEIDkSEG.js → bundle-CZi17F-s.js} +1 -1
- package/chunks/bundle-CZi17F-s.js.map +1 -0
- package/chunks/{bundle-ZwPNoncU.js → bundle-Cc2AzHgR.js} +1 -1
- package/chunks/bundle-Cc2AzHgR.js.map +1 -0
- package/chunks/{bundle-CtFDB6uM.js → bundle-CeIDeVKz.js} +3 -3
- package/{cjs/chunks/bundle-BpwAPpI9.js.map → chunks/bundle-CeIDeVKz.js.map} +1 -1
- package/chunks/{bundle-xPkUUY0y.js → bundle-CnU1tGdg.js} +3 -3
- package/chunks/bundle-CnU1tGdg.js.map +1 -0
- package/chunks/{bundle-CJW-g_-k.js → bundle-Cou4aMSR.js} +3 -3
- package/chunks/bundle-Cou4aMSR.js.map +1 -0
- package/chunks/{bundle-fSCONSew.js → bundle-CrBkSKYR.js} +9 -9
- package/chunks/bundle-CrBkSKYR.js.map +1 -0
- package/chunks/{bundle-BR3hUG8u.js → bundle-CulRJLM1.js} +2 -2
- package/chunks/bundle-CulRJLM1.js.map +1 -0
- package/chunks/{bundle-CUQ997bd.js → bundle-D-WJgiLR.js} +9 -9
- package/chunks/{bundle-CUQ997bd.js.map → bundle-D-WJgiLR.js.map} +1 -1
- package/chunks/{bundle-CZxcoh5B.js → bundle-D0tTmUIi.js} +4 -4
- package/chunks/bundle-D0tTmUIi.js.map +1 -0
- package/chunks/{bundle-CCC-fCd1.js → bundle-D3yIGHW4.js} +2 -2
- package/chunks/bundle-D3yIGHW4.js.map +1 -0
- package/chunks/{bundle-CiwJHy6g.js → bundle-D4By470U.js} +1 -1
- package/chunks/bundle-D4By470U.js.map +1 -0
- package/chunks/{bundle-D5bkstmZ.js → bundle-DCf7kAXe.js} +1 -1
- package/chunks/bundle-DCf7kAXe.js.map +1 -0
- package/chunks/{bundle-v3c-9N0A.js → bundle-DD_n8b-U.js} +12 -12
- package/chunks/{bundle-v3c-9N0A.js.map → bundle-DD_n8b-U.js.map} +1 -1
- package/chunks/{bundle-BJ63dG1P.js → bundle-DF2n_bAT.js} +3 -3
- package/chunks/{bundle-BJ63dG1P.js.map → bundle-DF2n_bAT.js.map} +1 -1
- package/chunks/{bundle-Dy0AI0rz.js → bundle-DFx1pzwI.js} +4 -4
- package/chunks/bundle-DFx1pzwI.js.map +1 -0
- package/chunks/{bundle-D4Oav06e.js → bundle-DH-PCSHq.js} +11 -11
- package/chunks/bundle-DH-PCSHq.js.map +1 -0
- package/chunks/{bundle-BtnCB-7T.js → bundle-DHJxhHOQ.js} +7 -7
- package/chunks/{bundle-BtnCB-7T.js.map → bundle-DHJxhHOQ.js.map} +1 -1
- package/chunks/{bundle-C8mlxyec.js → bundle-DLQPi9Ml.js} +13 -13
- package/chunks/{bundle-C8mlxyec.js.map → bundle-DLQPi9Ml.js.map} +1 -1
- package/chunks/{bundle-Dw-CkW5p.js → bundle-DPAgdcbr.js} +1 -1
- package/chunks/bundle-DPAgdcbr.js.map +1 -0
- package/chunks/{bundle-C8gQKppc.js → bundle-DPIbqPRR.js} +1 -1
- package/chunks/bundle-DPIbqPRR.js.map +1 -0
- package/chunks/{bundle-CCOya1C2.js → bundle-DQAZvuLz.js} +5 -5
- package/chunks/{bundle-CCOya1C2.js.map → bundle-DQAZvuLz.js.map} +1 -1
- package/chunks/{bundle-C_xDLLUt.js → bundle-DQZrZMxL.js} +4 -4
- package/chunks/bundle-DQZrZMxL.js.map +1 -0
- package/chunks/{bundle-C49aAsth.js → bundle-DdbAw4rK.js} +11 -11
- package/chunks/{bundle-C49aAsth.js.map → bundle-DdbAw4rK.js.map} +1 -1
- package/chunks/{bundle-BauMJKnf.js → bundle-Dh52nlfv.js} +5 -5
- package/chunks/{bundle-BauMJKnf.js.map → bundle-Dh52nlfv.js.map} +1 -1
- package/chunks/{bundle-DFkvUVw1.js → bundle-DpXwYPDY.js} +1 -1
- package/chunks/bundle-DpXwYPDY.js.map +1 -0
- package/chunks/{bundle-07bGaKDM.js → bundle-Dph9R1sB.js} +2 -2
- package/chunks/bundle-Dph9R1sB.js.map +1 -0
- package/chunks/{bundle-Cl-vRzDr.js → bundle-DxNpKh7a.js} +1 -1
- package/chunks/bundle-DxNpKh7a.js.map +1 -0
- package/chunks/{bundle-BtoO5ttX.js → bundle-InYgYKoj.js} +1 -1
- package/chunks/{bundle-BtoO5ttX.js.map → bundle-InYgYKoj.js.map} +1 -1
- package/chunks/bundle-IuyaesCR.js +8 -0
- package/chunks/bundle-IuyaesCR.js.map +1 -0
- package/chunks/{bundle-BcUjwXyv.js → bundle-LWgbZrK9.js} +1 -1
- package/chunks/bundle-LWgbZrK9.js.map +1 -0
- package/chunks/{bundle-DyKHaG_F.js → bundle-NPlmdBO7.js} +6 -6
- package/chunks/bundle-NPlmdBO7.js.map +1 -0
- package/chunks/{bundle-BoeyQYjc.js → bundle-Ncue9UT5.js} +3 -2
- package/chunks/bundle-Ncue9UT5.js.map +1 -0
- package/chunks/{bundle-D8l9-enQ.js → bundle-SWVu1WqU.js} +1 -1
- package/chunks/bundle-SWVu1WqU.js.map +1 -0
- package/chunks/{bundle-B8FD5WDF.js → bundle-SphrgdI0.js} +3 -3
- package/chunks/{bundle-B8FD5WDF.js.map → bundle-SphrgdI0.js.map} +1 -1
- package/chunks/{bundle-DPIvYZBS.js → bundle-WWn_D4d2.js} +1 -1
- package/chunks/bundle-WWn_D4d2.js.map +1 -0
- package/chunks/{bundle-DVOn95Bl.js → bundle-Z3Q9ku00.js} +1 -1
- package/chunks/bundle-Z3Q9ku00.js.map +1 -0
- package/chunks/{bundle-CAKtTn_6.js → bundle-ZChnhF-4.js} +2 -2
- package/chunks/{bundle-CAKtTn_6.js.map → bundle-ZChnhF-4.js.map} +1 -1
- package/chunks/{bundle-C3oeRQke.js → bundle-a5U4VIhq.js} +1 -1
- package/chunks/bundle-a5U4VIhq.js.map +1 -0
- package/chunks/{bundle-1AhxUDPU.js → bundle-aVMDbd16.js} +1 -1
- package/chunks/bundle-aVMDbd16.js.map +1 -0
- package/chunks/{bundle-BdMFvS48.js → bundle-bx8b10Ci.js} +1 -1
- package/chunks/bundle-bx8b10Ci.js.map +1 -0
- package/chunks/{bundle-zuweEiOJ.js → bundle-fOd_Qy9y.js} +8 -8
- package/chunks/{bundle-zuweEiOJ.js.map → bundle-fOd_Qy9y.js.map} +1 -1
- package/chunks/{bundle-CsHJ18W0.js → bundle-iA8j1zFK.js} +2 -2
- package/chunks/bundle-iA8j1zFK.js.map +1 -0
- package/chunks/{bundle-C_9aMSZU.js → bundle-iNT3JvJN.js} +4 -4
- package/chunks/bundle-iNT3JvJN.js.map +1 -0
- package/chunks/{bundle-ub1P3ZHF.js → bundle-j2cJQ0HY.js} +1 -1
- package/chunks/bundle-j2cJQ0HY.js.map +1 -0
- package/chunks/{bundle-f-kJq0yY.js → bundle-jEX7eNZe.js} +1 -1
- package/chunks/bundle-jEX7eNZe.js.map +1 -0
- package/chunks/{bundle-BqdQUkyf.js → bundle-jn4Q_HvR.js} +27 -15
- package/chunks/{bundle-BqdQUkyf.js.map → bundle-jn4Q_HvR.js.map} +1 -1
- package/chunks/{bundle-Ddg2e7WW.js → bundle-ma-TVXV7.js} +7 -7
- package/chunks/{bundle-Ddg2e7WW.js.map → bundle-ma-TVXV7.js.map} +1 -1
- package/chunks/{bundle-t_NHXb8k.js → bundle-olFk3EFS.js} +18 -45
- package/chunks/bundle-olFk3EFS.js.map +1 -0
- package/chunks/{bundle-KBGS7iEb.js → bundle-pZk9V8aD.js} +5 -5
- package/chunks/{bundle-KBGS7iEb.js.map → bundle-pZk9V8aD.js.map} +1 -1
- package/chunks/{bundle-Cdoy9-UG.js → bundle-q9l437Kc.js} +4 -4
- package/chunks/bundle-q9l437Kc.js.map +1 -0
- package/chunks/{bundle-CM8k_MAe.js → bundle-qFmHm75z.js} +3 -3
- package/chunks/bundle-qFmHm75z.js.map +1 -0
- package/chunks/{bundle-DSgx0Ssa.js → bundle-qYYy24MV.js} +1 -1
- package/chunks/{bundle-DSgx0Ssa.js.map → bundle-qYYy24MV.js.map} +1 -1
- package/chunks/{bundle-DGc-w_0Y.js → bundle-rMTjif0s.js} +1 -1
- package/chunks/bundle-rMTjif0s.js.map +1 -0
- package/chunks/{bundle-WBTZOgwR.js → bundle-u9yqWrxm.js} +3 -3
- package/chunks/bundle-u9yqWrxm.js.map +1 -0
- package/chunks/{bundle-DsRjGWKb.js → bundle-xxHx7kNM.js} +3 -3
- package/chunks/{bundle-DsRjGWKb.js.map → bundle-xxHx7kNM.js.map} +1 -1
- package/cjs/App.js +80 -79
- package/cjs/App.js.map +1 -1
- package/cjs/Channel/components/ChannelHeader.js +34 -34
- package/cjs/Channel/components/ChannelUI.js +66 -65
- package/cjs/Channel/components/ChannelUI.js.map +1 -1
- package/cjs/Channel/components/FileViewer.js +31 -31
- package/cjs/Channel/components/FrozenNotification.js +5 -5
- package/cjs/Channel/components/Message.js +55 -55
- package/cjs/Channel/components/MessageInput.js +43 -43
- package/cjs/Channel/components/MessageInputWrapper.js +43 -43
- package/cjs/Channel/components/MessageList.js +62 -61
- package/cjs/Channel/components/MessageList.js.map +1 -1
- package/cjs/Channel/components/RemoveMessageModal.js +30 -30
- package/cjs/Channel/components/SuggestedMentionList.js +32 -32
- package/cjs/Channel/components/TypingIndicator.js +5 -5
- package/cjs/Channel/components/UnreadCount.js +7 -7
- package/cjs/Channel/context.js +28 -28
- package/cjs/Channel/hooks/useHandleUploadFiles.js +16 -16
- package/cjs/Channel/hooks/useInitialMessagesFetch.js +8 -8
- package/cjs/Channel/utils/compareMessagesForGrouping.js +8 -7
- package/cjs/Channel/utils/compareMessagesForGrouping.js.map +1 -1
- package/cjs/Channel/utils/getMessagePartsInfo.js +9 -8
- package/cjs/Channel/utils/getMessagePartsInfo.js.map +1 -1
- package/cjs/Channel.js +66 -65
- package/cjs/Channel.js.map +1 -1
- package/cjs/ChannelList/components/AddChannel.js +22 -22
- package/cjs/ChannelList/components/ChannelListHeader.js +9 -9
- package/cjs/ChannelList/components/ChannelListUI.js +37 -37
- package/cjs/ChannelList/components/ChannelPreview.js +30 -30
- package/cjs/ChannelList/components/ChannelPreviewAction.js +14 -14
- package/cjs/ChannelList/context.js +18 -18
- package/cjs/ChannelList.js +37 -37
- package/cjs/ChannelSettings/components/ChannelProfile.js +20 -20
- package/cjs/ChannelSettings/components/ChannelSettingMenuList.js +17 -17
- package/cjs/ChannelSettings/components/ChannelSettingsHeader.js +7 -7
- package/cjs/ChannelSettings/components/ChannelSettingsMenuItem.js +2 -2
- package/cjs/ChannelSettings/components/ChannelSettingsUI.js +27 -27
- package/cjs/ChannelSettings/components/EditDetailsModal.js +20 -20
- package/cjs/ChannelSettings/components/LeaveChannel.js +17 -17
- package/cjs/ChannelSettings/components/ModerationPanel.js +25 -25
- package/cjs/ChannelSettings/components/UserListItem.js +18 -18
- package/cjs/ChannelSettings/components/UserPanel.js +24 -24
- package/cjs/ChannelSettings/context.js +16 -16
- package/cjs/ChannelSettings/hooks/useMenuList.js +25 -25
- package/cjs/ChannelSettings.js +27 -27
- package/cjs/CreateChannel/components/CreateChannelUI.js +19 -19
- package/cjs/CreateChannel/components/InviteUsers.js +19 -19
- package/cjs/CreateChannel/components/SelectChannelType.js +16 -16
- package/cjs/CreateChannel/context.js +4 -4
- package/cjs/CreateChannel.js +19 -19
- package/cjs/CreateOpenChannel/components/CreateOpenChannelUI.js +17 -17
- package/cjs/CreateOpenChannel/context.js +1 -1
- package/cjs/CreateOpenChannel.js +17 -17
- package/cjs/EditUserProfile/components/EditUserProfileUI.js +18 -18
- package/cjs/EditUserProfile/context.js +1 -1
- package/cjs/EditUserProfile.js +18 -18
- package/cjs/GroupChannel/components/FileViewer.js +26 -26
- package/cjs/GroupChannel/components/FrozenNotification.js +5 -5
- package/cjs/GroupChannel/components/GroupChannelHeader.js +29 -29
- package/cjs/GroupChannel/components/GroupChannelUI.js +59 -58
- package/cjs/GroupChannel/components/GroupChannelUI.js.map +1 -1
- package/cjs/GroupChannel/components/Message.js +50 -50
- package/cjs/GroupChannel/components/MessageInputWrapper.js +37 -37
- package/cjs/GroupChannel/components/MessageList.js +53 -52
- package/cjs/GroupChannel/components/MessageList.js.map +1 -1
- package/cjs/GroupChannel/components/RemoveMessageModal.js +25 -25
- package/cjs/GroupChannel/components/SuggestedMentionList.js +11 -11
- package/cjs/GroupChannel/components/TypingIndicator.js +5 -5
- package/cjs/GroupChannel/components/UnreadCount.js +7 -7
- package/cjs/GroupChannel/context.js +23 -23
- package/cjs/GroupChannel.js +59 -58
- package/cjs/GroupChannel.js.map +1 -1
- package/cjs/GroupChannelList/components/AddGroupChannel.js +21 -21
- package/cjs/GroupChannelList/components/GroupChannelListHeader.js +9 -9
- package/cjs/GroupChannelList/components/GroupChannelListItem.js +28 -28
- package/cjs/GroupChannelList/components/GroupChannelListUI.js +36 -36
- package/cjs/GroupChannelList/components/GroupChannelPreviewAction.js +14 -14
- package/cjs/GroupChannelList/context.js +16 -16
- package/cjs/GroupChannelList.js +36 -36
- package/cjs/MessageSearch/components/MessageSearchUI.js +15 -14
- package/cjs/MessageSearch/components/MessageSearchUI.js.map +1 -1
- package/cjs/MessageSearch/context.js +1 -1
- package/cjs/MessageSearch.js +17 -16
- package/cjs/MessageSearch.js.map +1 -1
- package/cjs/OpenChannel/components/FrozenChannelNotification.js +4 -4
- package/cjs/OpenChannel/components/OpenChannelHeader.js +21 -21
- package/cjs/OpenChannel/components/OpenChannelInput.js +27 -27
- package/cjs/OpenChannel/components/OpenChannelMessage.js +36 -36
- package/cjs/OpenChannel/components/OpenChannelMessageList.js +40 -40
- package/cjs/OpenChannel/components/OpenChannelUI.js +40 -40
- package/cjs/OpenChannel/context.js +20 -20
- package/cjs/OpenChannel.js +40 -40
- package/cjs/OpenChannelList/components/OpenChannelListUI.js +19 -19
- package/cjs/OpenChannelList/components/OpenChannelPreview.js +6 -6
- package/cjs/OpenChannelList/context.js +3 -3
- package/cjs/OpenChannelList.js +19 -19
- package/cjs/OpenChannelSettings/components/EditDetailsModal.js +20 -20
- package/cjs/OpenChannelSettings/components/OpenChannelProfile.js +20 -20
- package/cjs/OpenChannelSettings/components/OpenChannelSettingsUI.js +21 -21
- package/cjs/OpenChannelSettings/components/OperatorUI.js +21 -21
- package/cjs/OpenChannelSettings/components/ParticipantUI.js +19 -19
- package/cjs/OpenChannelSettings/context.js +15 -15
- package/cjs/OpenChannelSettings.js +21 -21
- package/cjs/SendbirdProvider.js +20 -20
- package/cjs/Thread/components/ParentMessageInfo.js +45 -45
- package/cjs/Thread/components/ParentMessageInfoItem.js +30 -30
- package/cjs/Thread/components/ThreadHeader.js +7 -7
- package/cjs/Thread/components/ThreadList.js +52 -52
- package/cjs/Thread/components/ThreadListItem.js +52 -52
- package/cjs/Thread/components/ThreadMessageInput.js +43 -43
- package/cjs/Thread/components/ThreadUI.js +58 -58
- package/cjs/Thread/context.js +21 -21
- package/cjs/Thread.js +58 -58
- package/cjs/VoicePlayer/context.js +4 -4
- package/cjs/VoicePlayer/useVoicePlayer.js +14 -14
- package/cjs/VoiceRecorder/context.js +14 -14
- package/cjs/VoiceRecorder/useVoiceRecorder.js +14 -14
- package/cjs/chunks/{bundle-C5eIOPz0.js → bundle-5UEpClKI.js} +6 -6
- package/cjs/chunks/bundle-5UEpClKI.js.map +1 -0
- package/cjs/chunks/{bundle-Db8YvH3q.js → bundle-7j4y34xF.js} +1 -1
- package/cjs/chunks/bundle-7j4y34xF.js.map +1 -0
- package/cjs/chunks/{bundle-BWbn8TYb.js → bundle-Ag40-RuN.js} +8 -8
- package/cjs/chunks/bundle-Ag40-RuN.js.map +1 -0
- package/cjs/chunks/{bundle-CM9WiyJr.js → bundle-AzK9r2xk.js} +2 -2
- package/cjs/chunks/bundle-AzK9r2xk.js.map +1 -0
- package/cjs/chunks/{bundle-CIZAIkTO.js → bundle-B-0Eyanb.js} +1 -1
- package/cjs/chunks/bundle-B-0Eyanb.js.map +1 -0
- package/cjs/chunks/{bundle-BXPOAoB6.js → bundle-B04UbcZR.js} +19 -47
- package/cjs/chunks/bundle-B04UbcZR.js.map +1 -0
- package/cjs/chunks/{bundle-BCChjjwq.js → bundle-B0uMgGvG.js} +2 -2
- package/cjs/chunks/bundle-B0uMgGvG.js.map +1 -0
- package/cjs/chunks/{bundle-lqC_6gBR.js → bundle-B30trpJg.js} +13 -13
- package/cjs/chunks/bundle-B30trpJg.js.map +1 -0
- package/cjs/chunks/{bundle-B4yvC9Hz.js → bundle-B4A4LNzA.js} +1 -1
- package/cjs/chunks/bundle-B4A4LNzA.js.map +1 -0
- package/cjs/chunks/{bundle-DweV15BE.js → bundle-B5Dls1U7.js} +1 -1
- package/cjs/chunks/bundle-B5Dls1U7.js.map +1 -0
- package/cjs/chunks/{bundle-BJ0h7G0c.js → bundle-BAGojM5f.js} +4 -4
- package/cjs/chunks/bundle-BAGojM5f.js.map +1 -0
- package/cjs/chunks/{bundle-Ezzvgnkr.js → bundle-BE-PztZ0.js} +4 -4
- package/cjs/chunks/bundle-BE-PztZ0.js.map +1 -0
- package/cjs/chunks/{bundle-tY97PA7n.js → bundle-BEM_ASq9.js} +9 -9
- package/cjs/chunks/{bundle-C9ZOR9xa.js.map → bundle-BEM_ASq9.js.map} +1 -1
- package/cjs/chunks/{bundle-BpwAPpI9.js → bundle-BF08bSP5.js} +11 -11
- package/{chunks/bundle-CtFDB6uM.js.map → cjs/chunks/bundle-BF08bSP5.js.map} +1 -1
- package/cjs/chunks/{bundle-D7z1mmDp.js → bundle-BJOFFStQ.js} +3 -3
- package/cjs/chunks/bundle-BJOFFStQ.js.map +1 -0
- package/cjs/chunks/{bundle-CfZTR4zC.js → bundle-BJg-Fwa2.js} +1 -1
- package/cjs/chunks/bundle-BJg-Fwa2.js.map +1 -0
- package/cjs/chunks/{bundle-BwE__yQ0.js → bundle-BJxxeOPQ.js} +3 -3
- package/cjs/chunks/{bundle-BwE__yQ0.js.map → bundle-BJxxeOPQ.js.map} +1 -1
- package/cjs/chunks/{bundle-LL9X-ZFA.js → bundle-BKslY8ci.js} +7 -7
- package/cjs/chunks/bundle-BKslY8ci.js.map +1 -0
- package/cjs/chunks/{bundle-CF2nS6c6.js → bundle-BLDgtnsJ.js} +4 -4
- package/cjs/chunks/bundle-BLDgtnsJ.js.map +1 -0
- package/cjs/chunks/{bundle-DNMXfsO0.js → bundle-BMkh1Hou.js} +8 -8
- package/cjs/chunks/{bundle-DNMXfsO0.js.map → bundle-BMkh1Hou.js.map} +1 -1
- package/cjs/chunks/{bundle-BuKwTuVv.js → bundle-BOqolkOj.js} +1 -1
- package/cjs/chunks/bundle-BOqolkOj.js.map +1 -0
- package/cjs/chunks/{bundle-Omd3faBY.js → bundle-BSl1Vhhj.js} +1 -1
- package/cjs/chunks/bundle-BSl1Vhhj.js.map +1 -0
- package/cjs/chunks/{bundle-D24hyvZV.js → bundle-BUN-bd9M.js} +3 -3
- package/cjs/chunks/{bundle-D24hyvZV.js.map → bundle-BUN-bd9M.js.map} +1 -1
- package/cjs/chunks/{bundle-CuaaEAz6.js → bundle-BawOTHsT.js} +583 -396
- package/cjs/chunks/bundle-BawOTHsT.js.map +1 -0
- package/cjs/chunks/{bundle-DtmJbh2k.js → bundle-BjTRaoh8.js} +1 -1
- package/cjs/chunks/bundle-BjTRaoh8.js.map +1 -0
- package/cjs/chunks/{bundle-pph4vfaO.js → bundle-Bl_JEXJZ.js} +2 -2
- package/cjs/chunks/bundle-Bl_JEXJZ.js.map +1 -0
- package/cjs/chunks/{bundle-DrfEImqs.js → bundle-BmE459u-.js} +3 -3
- package/cjs/chunks/bundle-BmE459u-.js.map +1 -0
- package/cjs/chunks/{bundle-DZ7PcPyb.js → bundle-BtrWa42l.js} +11 -11
- package/cjs/chunks/{bundle-DZ7PcPyb.js.map → bundle-BtrWa42l.js.map} +1 -1
- package/cjs/chunks/{bundle-CfM5CrA0.js → bundle-Bu8yv3Ys.js} +1 -1
- package/cjs/chunks/bundle-Bu8yv3Ys.js.map +1 -0
- package/cjs/chunks/{bundle-BCxrXYI3.js → bundle-BwjH8VWL.js} +9 -9
- package/cjs/chunks/bundle-BwjH8VWL.js.map +1 -0
- package/cjs/chunks/{bundle-BQUV_WAU.js → bundle-Bx1TRTuJ.js} +5 -5
- package/cjs/chunks/bundle-Bx1TRTuJ.js.map +1 -0
- package/cjs/chunks/{bundle-Dn0-m4mJ.js → bundle-C2R8_As1.js} +2 -2
- package/cjs/chunks/bundle-C2R8_As1.js.map +1 -0
- package/cjs/chunks/{bundle-B3vWGR_K.js → bundle-C30Bl664.js} +9 -9
- package/cjs/chunks/{bundle-B3vWGR_K.js.map → bundle-C30Bl664.js.map} +1 -1
- package/cjs/chunks/{bundle-CeLmQMmo.js → bundle-C3Ryz7dC.js} +1 -1
- package/cjs/chunks/bundle-C3Ryz7dC.js.map +1 -0
- package/cjs/chunks/{bundle-BMhYApRu.js → bundle-CA9KBBbB.js} +1 -1
- package/cjs/chunks/bundle-CA9KBBbB.js.map +1 -0
- package/cjs/chunks/{bundle-BH4jo8Br.js → bundle-CBJHy0tm.js} +1 -1
- package/cjs/chunks/bundle-CBJHy0tm.js.map +1 -0
- package/cjs/chunks/{bundle-B_WxxAei.js → bundle-CLUpI-G_.js} +12 -12
- package/cjs/chunks/{bundle-B_WxxAei.js.map → bundle-CLUpI-G_.js.map} +1 -1
- package/cjs/chunks/{bundle-CYpPCSbs.js → bundle-CLc82DSY.js} +2 -2
- package/cjs/chunks/bundle-CLc82DSY.js.map +1 -0
- package/cjs/chunks/{bundle-C9ZOR9xa.js → bundle-COnW-F6y.js} +5 -5
- package/cjs/chunks/{bundle-tY97PA7n.js.map → bundle-COnW-F6y.js.map} +1 -1
- package/cjs/chunks/{bundle-Vbr70dS-.js → bundle-CSijO8Ha.js} +6 -6
- package/cjs/chunks/bundle-CSijO8Ha.js.map +1 -0
- package/cjs/chunks/{bundle-D_lF37ye.js → bundle-CZBSoDZl.js} +1 -1
- package/cjs/chunks/bundle-CZBSoDZl.js.map +1 -0
- package/cjs/chunks/{bundle-DFT3H9MM.js → bundle-CZu9T9rx.js} +1 -1
- package/cjs/chunks/bundle-CZu9T9rx.js.map +1 -0
- package/cjs/chunks/{bundle-UrfGgm28.js → bundle-CbOsDB5x.js} +3 -3
- package/cjs/chunks/{bundle-UrfGgm28.js.map → bundle-CbOsDB5x.js.map} +1 -1
- package/cjs/chunks/{bundle-et2uTovT.js → bundle-CchJVdWA.js} +6 -6
- package/cjs/chunks/bundle-CchJVdWA.js.map +1 -0
- package/cjs/chunks/{bundle-Ctcafl75.js → bundle-Ch50x-PE.js} +1 -1
- package/cjs/chunks/bundle-Ch50x-PE.js.map +1 -0
- package/cjs/chunks/{bundle-Blch0kG8.js → bundle-CrEtfw2b.js} +2 -2
- package/cjs/chunks/bundle-CrEtfw2b.js.map +1 -0
- package/cjs/chunks/{bundle-Q8pO_OyW.js → bundle-CtNVuXOV.js} +3 -3
- package/cjs/chunks/bundle-CtNVuXOV.js.map +1 -0
- package/cjs/chunks/{bundle-DRtpyy_k.js → bundle-Cttv8ibL.js} +6 -6
- package/cjs/chunks/{bundle-DRtpyy_k.js.map → bundle-Cttv8ibL.js.map} +1 -1
- package/cjs/chunks/{bundle-BlctoPRq.js → bundle-CvIMeo9c.js} +7 -7
- package/cjs/chunks/{bundle-BlctoPRq.js.map → bundle-CvIMeo9c.js.map} +1 -1
- package/cjs/chunks/{bundle-DJx1xhzu.js → bundle-Cx1TrCud.js} +3 -3
- package/cjs/chunks/{bundle-DJx1xhzu.js.map → bundle-Cx1TrCud.js.map} +1 -1
- package/cjs/chunks/{bundle-ByanPeD0.js → bundle-D1WznkCG.js} +4 -4
- package/cjs/chunks/{bundle-ByanPeD0.js.map → bundle-D1WznkCG.js.map} +1 -1
- package/cjs/chunks/{bundle-CsB_i6B0.js → bundle-DA7hnT2_.js} +1 -1
- package/cjs/chunks/bundle-DA7hnT2_.js.map +1 -0
- package/cjs/chunks/{bundle-5IKXZjCM.js → bundle-DBkmtON2.js} +3 -3
- package/cjs/chunks/bundle-DBkmtON2.js.map +1 -0
- package/cjs/chunks/{bundle-COihomAk.js → bundle-DJ6gESuh.js} +1 -1
- package/cjs/chunks/bundle-DJ6gESuh.js.map +1 -0
- package/cjs/chunks/{bundle-CW2Ejtnv.js → bundle-DJpox8pU.js} +8 -8
- package/cjs/chunks/bundle-DJpox8pU.js.map +1 -0
- package/cjs/chunks/{bundle-BdkNokVA.js → bundle-DMIQ1oMu.js} +1 -1
- package/cjs/chunks/bundle-DMIQ1oMu.js.map +1 -0
- package/cjs/chunks/{bundle-ZOmsvW3a.js → bundle-DOddO_HL.js} +1 -1
- package/cjs/chunks/bundle-DOddO_HL.js.map +1 -0
- package/cjs/chunks/{bundle-BgLxFRQk.js → bundle-DOvYuY4G.js} +3 -3
- package/cjs/chunks/bundle-DOvYuY4G.js.map +1 -0
- package/cjs/chunks/{bundle-DnC1jVeG.js → bundle-DXPkoTqY.js} +5 -5
- package/cjs/chunks/bundle-DXPkoTqY.js.map +1 -0
- package/cjs/chunks/{bundle-BIO_eBe4.js → bundle-DXyGojZK.js} +3 -1
- package/cjs/chunks/bundle-DXyGojZK.js.map +1 -0
- package/cjs/chunks/{bundle-ClyzMwDC.js → bundle-D_88grIC.js} +1 -1
- package/cjs/chunks/bundle-D_88grIC.js.map +1 -0
- package/cjs/chunks/{bundle-DncXV6Zi.js → bundle-D_XEC_S2.js} +2 -2
- package/cjs/chunks/bundle-D_XEC_S2.js.map +1 -0
- package/cjs/chunks/{bundle-B1BFXAIQ.js → bundle-D_bXEGLv.js} +1 -1
- package/cjs/chunks/bundle-D_bXEGLv.js.map +1 -0
- package/cjs/chunks/{bundle-DYmapMAd.js → bundle-DaAn1TO8.js} +4 -4
- package/cjs/chunks/{bundle-DYmapMAd.js.map → bundle-DaAn1TO8.js.map} +1 -1
- package/cjs/chunks/{bundle-Bz09H9J_.js → bundle-DeSyhKkp.js} +4 -4
- package/cjs/chunks/bundle-DeSyhKkp.js.map +1 -0
- package/cjs/chunks/{bundle-BrQ2ZPGR.js → bundle-Dj17m_pQ.js} +1 -1
- package/cjs/chunks/bundle-Dj17m_pQ.js.map +1 -0
- package/cjs/chunks/{bundle-CASJD9zh.js → bundle-DkZPlQQZ.js} +11 -11
- package/cjs/chunks/{bundle-CASJD9zh.js.map → bundle-DkZPlQQZ.js.map} +1 -1
- package/cjs/chunks/{bundle-CX437C0t.js → bundle-DqB7RPPk.js} +3 -3
- package/cjs/chunks/bundle-DqB7RPPk.js.map +1 -0
- package/cjs/chunks/{bundle-DikxzL_d.js → bundle-Dw2ZLm5K.js} +2 -2
- package/cjs/chunks/{bundle-DikxzL_d.js.map → bundle-Dw2ZLm5K.js.map} +1 -1
- package/cjs/chunks/{bundle-7CPMX_TT.js → bundle-DwS2dhK4.js} +1 -1
- package/cjs/chunks/bundle-DwS2dhK4.js.map +1 -0
- package/cjs/chunks/{bundle-2h0tunYE.js → bundle-E1ZfPjoN.js} +4 -4
- package/cjs/chunks/bundle-E1ZfPjoN.js.map +1 -0
- package/cjs/chunks/{bundle-D2P6gVxf.js → bundle-INA3mRFQ.js} +1 -1
- package/cjs/chunks/bundle-INA3mRFQ.js.map +1 -0
- package/cjs/chunks/{bundle-By1Sf00B.js → bundle-MH0H52a8.js} +1 -1
- package/cjs/chunks/bundle-MH0H52a8.js.map +1 -0
- package/cjs/chunks/{bundle-Bc9wvPCN.js → bundle-O7nRvkeO.js} +1 -1
- package/cjs/chunks/bundle-O7nRvkeO.js.map +1 -0
- package/cjs/chunks/{bundle-BBJTtQpB.js → bundle-S_OENA8m.js} +12 -12
- package/cjs/chunks/{bundle-BBJTtQpB.js.map → bundle-S_OENA8m.js.map} +1 -1
- package/cjs/chunks/{bundle-B-Lh9WrT.js → bundle-Sna1He3j.js} +2 -2
- package/cjs/chunks/{bundle-B-Lh9WrT.js.map → bundle-Sna1He3j.js.map} +1 -1
- package/cjs/chunks/{bundle-BZ7JTELl.js → bundle-WaPmQqwG.js} +1 -1
- package/cjs/chunks/bundle-WaPmQqwG.js.map +1 -0
- package/cjs/chunks/{bundle-DC7D5Jct.js → bundle-Zj9JAC1-.js} +6 -6
- package/cjs/chunks/bundle-Zj9JAC1-.js.map +1 -0
- package/cjs/chunks/{bundle-1hFPx8T-.js → bundle-cLuDdTvp.js} +1 -1
- package/cjs/chunks/bundle-cLuDdTvp.js.map +1 -0
- package/cjs/chunks/{bundle-BwhU8sVU.js → bundle-eaIAyDcC.js} +1 -1
- package/cjs/chunks/bundle-eaIAyDcC.js.map +1 -0
- package/cjs/chunks/{bundle-Bqw9YOBI.js → bundle-gHxmVA0a.js} +1 -1
- package/cjs/chunks/{bundle-Bqw9YOBI.js.map → bundle-gHxmVA0a.js.map} +1 -1
- package/cjs/chunks/{bundle-Bpkxxjt3.js → bundle-kRMalZH9.js} +5 -5
- package/cjs/chunks/{bundle-Bpkxxjt3.js.map → bundle-kRMalZH9.js.map} +1 -1
- package/cjs/chunks/{bundle-DfojQg99.js → bundle-ksFBVDZV.js} +3 -3
- package/cjs/chunks/bundle-ksFBVDZV.js.map +1 -0
- package/cjs/chunks/{bundle-DU96Nzq-.js → bundle-wKKjdG_5.js} +27 -15
- package/cjs/chunks/bundle-wKKjdG_5.js.map +1 -0
- package/cjs/chunks/bundle-xsYGRug4.js +8 -0
- package/cjs/chunks/bundle-xsYGRug4.js.map +1 -0
- package/cjs/chunks/{bundle-Ev0IfN_G.js → bundle-zuqi92MB.js} +1 -1
- package/cjs/chunks/bundle-zuqi92MB.js.map +1 -0
- package/cjs/hooks/useModal.js +14 -14
- package/cjs/index.js +87 -86
- package/cjs/index.js.map +1 -1
- package/cjs/pubSub/topics.js +1 -1
- package/cjs/sendbirdSelectors.js +2 -2
- package/cjs/ui/Accordion.js +2 -2
- package/cjs/ui/AccordionGroup.js +1 -1
- package/cjs/ui/AdminMessage.js +3 -3
- package/cjs/ui/Avatar.js +4 -4
- package/cjs/ui/Badge.js +4 -4
- package/cjs/ui/BottomSheet.js +14 -14
- package/cjs/ui/Button.js +3 -3
- package/cjs/ui/ChannelAvatar.js +5 -5
- package/cjs/ui/ConnectionStatus.js +5 -5
- package/cjs/ui/ContextMenu.js +11 -10
- package/cjs/ui/ContextMenu.js.map +1 -1
- package/cjs/ui/DateSeparator.js +4 -4
- package/cjs/ui/EmojiReactions.js +20 -20
- package/cjs/ui/FallbackTemplateMessageItemBody.tsx.js +8 -7
- package/cjs/ui/FallbackTemplateMessageItemBody.tsx.js.map +1 -1
- package/cjs/ui/FileMessageItemBody.js +10 -9
- package/cjs/ui/FileMessageItemBody.js.map +1 -1
- package/cjs/ui/FileViewer.js +17 -17
- package/cjs/ui/Header.js +6 -6
- package/cjs/ui/Icon.js +2 -2
- package/cjs/ui/IconButton.js +1 -1
- package/cjs/ui/ImageRenderer.js +27 -21
- package/cjs/ui/ImageRenderer.js.map +1 -1
- package/cjs/ui/Input.js +3 -3
- package/cjs/ui/Label.js +3 -3
- package/cjs/ui/LinkLabel.js +4 -4
- package/cjs/ui/Loader.js +2 -2
- package/cjs/ui/LoadingTemplateMessageItemBody.tsx.js +2 -2
- package/cjs/ui/MentionLabel.js +18 -18
- package/cjs/ui/MentionUserLabel.js +2 -2
- package/cjs/ui/MessageContent.js +101 -84
- package/cjs/ui/MessageContent.js.map +1 -1
- package/cjs/ui/MessageFeedbackFailedModal.js +15 -15
- package/cjs/ui/MessageFeedbackModal.js +15 -15
- package/cjs/ui/MessageInput/hooks/usePaste.js +7 -7
- package/cjs/ui/MessageInput.js +16 -15
- package/cjs/ui/MessageInput.js.map +1 -1
- package/cjs/ui/MessageItemMenu.js +12 -11
- package/cjs/ui/MessageItemMenu.js.map +1 -1
- package/cjs/ui/MessageItemReactionMenu.js +13 -12
- package/cjs/ui/MessageItemReactionMenu.js.map +1 -1
- package/cjs/ui/MessageMenu.js +12 -11
- package/cjs/ui/MessageMenu.js.map +1 -1
- package/cjs/ui/MessageSearchFileItem.js +15 -14
- package/cjs/ui/MessageSearchFileItem.js.map +1 -1
- package/cjs/ui/MessageSearchItem.js +11 -11
- package/cjs/ui/MessageStatus.js +13 -12
- package/cjs/ui/MessageStatus.js.map +1 -1
- package/cjs/ui/MessageTemplate.js +1 -1
- package/cjs/ui/MobileFeedbackMenu.js +14 -14
- package/cjs/ui/MobileMenu.js +15 -15
- package/cjs/ui/Modal.js +14 -14
- package/cjs/ui/MutedAvatarOverlay.js +2 -2
- package/cjs/ui/OGMessageItemBody.js +21 -21
- package/cjs/ui/OpenChannelAdminMessage.js +3 -3
- package/cjs/ui/OpenChannelAvatar.js +7 -7
- package/cjs/ui/OpenchannelConversationHeader.js +7 -7
- package/cjs/ui/OpenchannelFileMessage.js +22 -22
- package/cjs/ui/OpenchannelOGMessage.js +24 -24
- package/cjs/ui/OpenchannelThumbnailMessage.js +21 -21
- package/cjs/ui/OpenchannelUserMessage.js +22 -22
- package/cjs/ui/PlaceHolder.js +5 -5
- package/cjs/ui/PlaybackTime.js +3 -3
- package/cjs/ui/ProgressBar.js +1 -1
- package/cjs/ui/QuoteMessage.js +10 -9
- package/cjs/ui/QuoteMessage.js.map +1 -1
- package/cjs/ui/QuoteMessageInput.js +10 -9
- package/cjs/ui/QuoteMessageInput.js.map +1 -1
- package/cjs/ui/ReactionBadge.js +3 -3
- package/cjs/ui/ReactionButton.js +4 -4
- package/cjs/ui/SortByRow.js +2 -2
- package/cjs/ui/TemplateMessageItemBody.js +134 -252
- package/cjs/ui/TemplateMessageItemBody.js.map +1 -1
- package/cjs/ui/TextButton.js +2 -2
- package/cjs/ui/TextMessageItemBody.js +21 -21
- package/cjs/ui/ThreadReplies.js +7 -7
- package/cjs/ui/ThumbnailMessageItemBody.js +9 -8
- package/cjs/ui/ThumbnailMessageItemBody.js.map +1 -1
- package/cjs/ui/Toggle.js +1 -1
- package/cjs/ui/Tooltip.js +3 -3
- package/cjs/ui/TooltipWrapper.js +1 -1
- package/cjs/ui/TypingIndicatorBubble.js +4 -4
- package/cjs/ui/UnknownMessageItemBody.js +8 -7
- package/cjs/ui/UnknownMessageItemBody.js.map +1 -1
- package/cjs/ui/UserListItem.js +18 -18
- package/cjs/ui/UserListItemMenu.js +12 -11
- package/cjs/ui/UserListItemMenu.js.map +1 -1
- package/cjs/ui/UserProfile.js +18 -18
- package/cjs/ui/VoiceMessageInput.js +8 -8
- package/cjs/ui/VoiceMessageItemBody.js +14 -14
- package/cjs/ui/Word.js +18 -18
- package/cjs/useSendbirdStateContext.js +1 -1
- package/cjs/utils/message/isVoiceMessage.js +5 -4
- package/cjs/utils/message/isVoiceMessage.js.map +1 -1
- package/cjs/withSendbird.js +1 -1
- package/dist/index.css +48 -56
- package/hooks/useModal.js +14 -14
- package/index.js +86 -85
- package/index.js.map +1 -1
- package/package.json +3 -3
- package/pubSub/topics.js +1 -1
- package/sendbirdSelectors.js +2 -2
- package/types/modules/Channel/components/Message/hooks/useIsElementInViewport.d.ts +1 -1
- package/types/modules/Channel/components/Message/hooks/useLazyImageLoader.d.ts +2 -2
- package/types/types.d.ts +0 -4
- package/types/ui/MessageContent/MessageBody/index.d.ts +0 -2
- package/types/ui/MessageContent/MessageContentForTemplateMessage.d.ts +15 -0
- package/types/ui/MessageTemplate/messageTemplateErrorBoundary.d.ts +0 -3
- package/types/ui/TemplateMessageItemBody/index.d.ts +15 -3
- package/types/ui/TemplateMessageItemBody/types.d.ts +8 -6
- package/types/utils/consts.d.ts +1 -0
- package/types/utils/index.d.ts +6 -9
- package/ui/Accordion.js +2 -2
- package/ui/AccordionGroup.js +1 -1
- package/ui/AdminMessage.js +3 -3
- package/ui/Avatar.js +4 -4
- package/ui/Badge.js +4 -4
- package/ui/BottomSheet.js +14 -14
- package/ui/Button.js +3 -3
- package/ui/ChannelAvatar.js +5 -5
- package/ui/ConnectionStatus.js +5 -5
- package/ui/ContextMenu.js +11 -10
- package/ui/ContextMenu.js.map +1 -1
- package/ui/DateSeparator.js +4 -4
- package/ui/EmojiReactions.js +20 -20
- package/ui/FallbackTemplateMessageItemBody.tsx.js +8 -7
- package/ui/FallbackTemplateMessageItemBody.tsx.js.map +1 -1
- package/ui/FileMessageItemBody.js +10 -9
- package/ui/FileMessageItemBody.js.map +1 -1
- package/ui/FileViewer.js +17 -17
- package/ui/Header.js +6 -6
- package/ui/Icon.js +2 -2
- package/ui/IconButton.js +1 -1
- package/ui/ImageRenderer.js +28 -22
- package/ui/ImageRenderer.js.map +1 -1
- package/ui/Input.js +3 -3
- package/ui/Label.js +3 -3
- package/ui/LinkLabel.js +4 -4
- package/ui/Loader.js +2 -2
- package/ui/LoadingTemplateMessageItemBody.tsx.js +2 -2
- package/ui/MentionLabel.js +18 -18
- package/ui/MentionUserLabel.js +2 -2
- package/ui/MessageContent.js +101 -84
- package/ui/MessageContent.js.map +1 -1
- package/ui/MessageFeedbackFailedModal.js +15 -15
- package/ui/MessageFeedbackModal.js +15 -15
- package/ui/MessageInput/hooks/usePaste.js +7 -7
- package/ui/MessageInput.js +16 -15
- package/ui/MessageInput.js.map +1 -1
- package/ui/MessageItemMenu.js +12 -11
- package/ui/MessageItemMenu.js.map +1 -1
- package/ui/MessageItemReactionMenu.js +13 -12
- package/ui/MessageItemReactionMenu.js.map +1 -1
- package/ui/MessageMenu.js +12 -11
- package/ui/MessageMenu.js.map +1 -1
- package/ui/MessageSearchFileItem.js +15 -14
- package/ui/MessageSearchFileItem.js.map +1 -1
- package/ui/MessageSearchItem.js +11 -11
- package/ui/MessageStatus.js +13 -12
- package/ui/MessageStatus.js.map +1 -1
- package/ui/MessageTemplate.js +1 -1
- package/ui/MobileFeedbackMenu.js +14 -14
- package/ui/MobileMenu.js +15 -15
- package/ui/Modal.js +14 -14
- package/ui/MutedAvatarOverlay.js +2 -2
- package/ui/OGMessageItemBody.js +21 -21
- package/ui/OpenChannelAdminMessage.js +3 -3
- package/ui/OpenChannelAvatar.js +7 -7
- package/ui/OpenchannelConversationHeader.js +7 -7
- package/ui/OpenchannelFileMessage.js +22 -22
- package/ui/OpenchannelOGMessage.js +24 -24
- package/ui/OpenchannelThumbnailMessage.js +21 -21
- package/ui/OpenchannelUserMessage.js +22 -22
- package/ui/PlaceHolder.js +5 -5
- package/ui/PlaybackTime.js +3 -3
- package/ui/ProgressBar.js +1 -1
- package/ui/QuoteMessage.js +10 -9
- package/ui/QuoteMessage.js.map +1 -1
- package/ui/QuoteMessageInput.js +10 -9
- package/ui/QuoteMessageInput.js.map +1 -1
- package/ui/ReactionBadge.js +3 -3
- package/ui/ReactionButton.js +4 -4
- package/ui/SortByRow.js +2 -2
- package/ui/TemplateMessageItemBody.js +134 -253
- package/ui/TemplateMessageItemBody.js.map +1 -1
- package/ui/TextButton.js +2 -2
- package/ui/TextMessageItemBody.js +21 -21
- package/ui/ThreadReplies.js +7 -7
- package/ui/ThumbnailMessageItemBody.js +9 -8
- package/ui/ThumbnailMessageItemBody.js.map +1 -1
- package/ui/Toggle.js +1 -1
- package/ui/Tooltip.js +3 -3
- package/ui/TooltipWrapper.js +1 -1
- package/ui/TypingIndicatorBubble.js +4 -4
- package/ui/UnknownMessageItemBody.js +8 -7
- package/ui/UnknownMessageItemBody.js.map +1 -1
- package/ui/UserListItem.js +18 -18
- package/ui/UserListItemMenu.js +13 -12
- package/ui/UserListItemMenu.js.map +1 -1
- package/ui/UserProfile.js +18 -18
- package/ui/VoiceMessageInput.js +8 -8
- package/ui/VoiceMessageItemBody.js +14 -14
- package/ui/Word.js +18 -18
- package/useSendbirdStateContext.js +1 -1
- package/utils/message/isVoiceMessage.js +5 -4
- package/utils/message/isVoiceMessage.js.map +1 -1
- package/withSendbird.js +1 -1
- package/chunks/bundle-02mU_mdQ.js.map +0 -1
- package/chunks/bundle-07bGaKDM.js.map +0 -1
- package/chunks/bundle-1AhxUDPU.js.map +0 -1
- package/chunks/bundle-4FX6gpGw.js.map +0 -1
- package/chunks/bundle-BAce4maL.js.map +0 -1
- package/chunks/bundle-BR3hUG8u.js.map +0 -1
- package/chunks/bundle-BcUjwXyv.js.map +0 -1
- package/chunks/bundle-BdMFvS48.js.map +0 -1
- package/chunks/bundle-BoeyQYjc.js.map +0 -1
- package/chunks/bundle-Bv0CLKmK.js.map +0 -1
- package/chunks/bundle-C3oeRQke.js.map +0 -1
- package/chunks/bundle-C8gQKppc.js.map +0 -1
- package/chunks/bundle-CCC-fCd1.js.map +0 -1
- package/chunks/bundle-CJW-g_-k.js.map +0 -1
- package/chunks/bundle-CM8k_MAe.js.map +0 -1
- package/chunks/bundle-CZxcoh5B.js.map +0 -1
- package/chunks/bundle-C_9aMSZU.js.map +0 -1
- package/chunks/bundle-C_xDLLUt.js.map +0 -1
- package/chunks/bundle-Cdoy9-UG.js.map +0 -1
- package/chunks/bundle-Ch7HVLiB.js.map +0 -1
- package/chunks/bundle-CiwJHy6g.js.map +0 -1
- package/chunks/bundle-CkDGUIvh.js.map +0 -1
- package/chunks/bundle-Cl-vRzDr.js.map +0 -1
- package/chunks/bundle-CsHJ18W0.js.map +0 -1
- package/chunks/bundle-D48t2vTo.js.map +0 -1
- package/chunks/bundle-D4Oav06e.js.map +0 -1
- package/chunks/bundle-D5bkstmZ.js.map +0 -1
- package/chunks/bundle-D8l9-enQ.js.map +0 -1
- package/chunks/bundle-DEIDkSEG.js.map +0 -1
- package/chunks/bundle-DFkvUVw1.js.map +0 -1
- package/chunks/bundle-DGc-w_0Y.js.map +0 -1
- package/chunks/bundle-DOVBsMiS.js.map +0 -1
- package/chunks/bundle-DPIvYZBS.js.map +0 -1
- package/chunks/bundle-DVOn95Bl.js.map +0 -1
- package/chunks/bundle-DZ92KGoS.js.map +0 -1
- package/chunks/bundle-DZK4rg_Y.js.map +0 -1
- package/chunks/bundle-DbVGPg9d.js.map +0 -1
- package/chunks/bundle-Dw-CkW5p.js.map +0 -1
- package/chunks/bundle-Dw_-sD_V.js.map +0 -1
- package/chunks/bundle-Dy0AI0rz.js.map +0 -1
- package/chunks/bundle-DyKHaG_F.js.map +0 -1
- package/chunks/bundle-DzFqlsbR.js.map +0 -1
- package/chunks/bundle-Qa-OShfm.js.map +0 -1
- package/chunks/bundle-WBTZOgwR.js.map +0 -1
- package/chunks/bundle-ZwPNoncU.js.map +0 -1
- package/chunks/bundle-f-kJq0yY.js.map +0 -1
- package/chunks/bundle-fSCONSew.js.map +0 -1
- package/chunks/bundle-g4f6DqPZ.js.map +0 -1
- package/chunks/bundle-kAnCqJ1s.js.map +0 -1
- package/chunks/bundle-kMS1-vHn.js.map +0 -1
- package/chunks/bundle-piJ_EqHo.js.map +0 -1
- package/chunks/bundle-t_NHXb8k.js.map +0 -1
- package/chunks/bundle-ub1P3ZHF.js.map +0 -1
- package/chunks/bundle-xPkUUY0y.js.map +0 -1
- package/chunks/bundle-zxooGkqM.js.map +0 -1
- package/cjs/chunks/bundle-1hFPx8T-.js.map +0 -1
- package/cjs/chunks/bundle-2h0tunYE.js.map +0 -1
- package/cjs/chunks/bundle-5IKXZjCM.js.map +0 -1
- package/cjs/chunks/bundle-7CPMX_TT.js.map +0 -1
- package/cjs/chunks/bundle-B1BFXAIQ.js.map +0 -1
- package/cjs/chunks/bundle-B4yvC9Hz.js.map +0 -1
- package/cjs/chunks/bundle-BCChjjwq.js.map +0 -1
- package/cjs/chunks/bundle-BCxrXYI3.js.map +0 -1
- package/cjs/chunks/bundle-BH4jo8Br.js.map +0 -1
- package/cjs/chunks/bundle-BIO_eBe4.js.map +0 -1
- package/cjs/chunks/bundle-BJ0h7G0c.js.map +0 -1
- package/cjs/chunks/bundle-BMhYApRu.js.map +0 -1
- package/cjs/chunks/bundle-BQUV_WAU.js.map +0 -1
- package/cjs/chunks/bundle-BWbn8TYb.js.map +0 -1
- package/cjs/chunks/bundle-BXPOAoB6.js.map +0 -1
- package/cjs/chunks/bundle-BZ7JTELl.js.map +0 -1
- package/cjs/chunks/bundle-Bc9wvPCN.js.map +0 -1
- package/cjs/chunks/bundle-BdkNokVA.js.map +0 -1
- package/cjs/chunks/bundle-BgLxFRQk.js.map +0 -1
- package/cjs/chunks/bundle-Blch0kG8.js.map +0 -1
- package/cjs/chunks/bundle-BrQ2ZPGR.js.map +0 -1
- package/cjs/chunks/bundle-BuKwTuVv.js.map +0 -1
- package/cjs/chunks/bundle-BwhU8sVU.js.map +0 -1
- package/cjs/chunks/bundle-By1Sf00B.js.map +0 -1
- package/cjs/chunks/bundle-Bz09H9J_.js.map +0 -1
- package/cjs/chunks/bundle-C5eIOPz0.js.map +0 -1
- package/cjs/chunks/bundle-CF2nS6c6.js.map +0 -1
- package/cjs/chunks/bundle-CIZAIkTO.js.map +0 -1
- package/cjs/chunks/bundle-CM9WiyJr.js.map +0 -1
- package/cjs/chunks/bundle-COihomAk.js.map +0 -1
- package/cjs/chunks/bundle-CW2Ejtnv.js.map +0 -1
- package/cjs/chunks/bundle-CX437C0t.js.map +0 -1
- package/cjs/chunks/bundle-CYpPCSbs.js.map +0 -1
- package/cjs/chunks/bundle-CeLmQMmo.js.map +0 -1
- package/cjs/chunks/bundle-CfM5CrA0.js.map +0 -1
- package/cjs/chunks/bundle-CfZTR4zC.js.map +0 -1
- package/cjs/chunks/bundle-ClyzMwDC.js.map +0 -1
- package/cjs/chunks/bundle-CsB_i6B0.js.map +0 -1
- package/cjs/chunks/bundle-Ctcafl75.js.map +0 -1
- package/cjs/chunks/bundle-CuaaEAz6.js.map +0 -1
- package/cjs/chunks/bundle-D2P6gVxf.js.map +0 -1
- package/cjs/chunks/bundle-D7z1mmDp.js.map +0 -1
- package/cjs/chunks/bundle-DC7D5Jct.js.map +0 -1
- package/cjs/chunks/bundle-DFT3H9MM.js.map +0 -1
- package/cjs/chunks/bundle-DU96Nzq-.js.map +0 -1
- package/cjs/chunks/bundle-D_lF37ye.js.map +0 -1
- package/cjs/chunks/bundle-Db8YvH3q.js.map +0 -1
- package/cjs/chunks/bundle-DfojQg99.js.map +0 -1
- package/cjs/chunks/bundle-Dn0-m4mJ.js.map +0 -1
- package/cjs/chunks/bundle-DnC1jVeG.js.map +0 -1
- package/cjs/chunks/bundle-DncXV6Zi.js.map +0 -1
- package/cjs/chunks/bundle-DrfEImqs.js.map +0 -1
- package/cjs/chunks/bundle-DtmJbh2k.js.map +0 -1
- package/cjs/chunks/bundle-DweV15BE.js.map +0 -1
- package/cjs/chunks/bundle-Ev0IfN_G.js.map +0 -1
- package/cjs/chunks/bundle-Ezzvgnkr.js.map +0 -1
- package/cjs/chunks/bundle-LL9X-ZFA.js.map +0 -1
- package/cjs/chunks/bundle-Omd3faBY.js.map +0 -1
- package/cjs/chunks/bundle-Q8pO_OyW.js.map +0 -1
- package/cjs/chunks/bundle-Vbr70dS-.js.map +0 -1
- package/cjs/chunks/bundle-ZOmsvW3a.js.map +0 -1
- package/cjs/chunks/bundle-et2uTovT.js.map +0 -1
- package/cjs/chunks/bundle-lqC_6gBR.js.map +0 -1
- package/cjs/chunks/bundle-pph4vfaO.js.map +0 -1
|
@@ -13,15 +13,156 @@ var ComponentType;
|
|
|
13
13
|
ComponentType["Image"] = "image";
|
|
14
14
|
ComponentType["TextButton"] = "textButton";
|
|
15
15
|
ComponentType["ImageButton"] = "imageButton";
|
|
16
|
+
ComponentType["Carousel"] = "carouselView";
|
|
16
17
|
})(ComponentType || (ComponentType = {}));
|
|
17
|
-
|
|
18
|
-
(
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
|
|
19
|
+
const outSingle$1 = (key, obj) => {
|
|
20
|
+
if (typeof obj[key] !== 'string')
|
|
21
|
+
return {};
|
|
22
|
+
return { [key]: argbToRgba(obj[key]) };
|
|
23
|
+
};
|
|
24
|
+
function argbToRgba(string) {
|
|
25
|
+
if (!string.startsWith('#')) {
|
|
26
|
+
return string;
|
|
27
|
+
}
|
|
28
|
+
if (string.length === 9) {
|
|
29
|
+
return `#${string.slice(3)}${string[1]}${string[2]}`;
|
|
30
|
+
}
|
|
31
|
+
if (string.length === 5) {
|
|
32
|
+
return `#${string.slice(2)}${string[1]}`;
|
|
33
|
+
}
|
|
34
|
+
return string;
|
|
35
|
+
}
|
|
36
|
+
const outViewStyle$1 = (viewStyle) => {
|
|
37
|
+
if (!viewStyle)
|
|
38
|
+
return {};
|
|
39
|
+
return {
|
|
40
|
+
viewStyle: Object.assign(Object.assign(Object.assign({}, viewStyle), outSingle$1('backgroundColor', viewStyle)), outSingle$1('borderColor', viewStyle)),
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
const outTextStyle$1 = (textStyle) => {
|
|
44
|
+
if (!textStyle)
|
|
45
|
+
return {};
|
|
46
|
+
return {
|
|
47
|
+
textStyle: Object.assign(Object.assign({}, textStyle), outSingle$1('color', textStyle)),
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
const outImageStyle = (imageStyle) => {
|
|
51
|
+
if (!imageStyle)
|
|
52
|
+
return {};
|
|
53
|
+
return {
|
|
54
|
+
imageStyle: Object.assign(Object.assign({}, imageStyle), outSingle$1('tintColor', imageStyle)),
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
const colorTransform = {
|
|
58
|
+
run(prop) {
|
|
59
|
+
if (prop.type === ComponentType.Text || prop.type === ComponentType.TextButton) {
|
|
60
|
+
return Object.assign(Object.assign(Object.assign({}, prop), outViewStyle$1(prop.viewStyle)), outTextStyle$1(prop.textStyle));
|
|
61
|
+
}
|
|
62
|
+
if (prop.type === ComponentType.ImageButton || prop.type === ComponentType.Image) {
|
|
63
|
+
return Object.assign(Object.assign(Object.assign({}, prop), outViewStyle$1(prop.viewStyle)), outImageStyle(prop.imageStyle));
|
|
64
|
+
}
|
|
65
|
+
return Object.assign(Object.assign({}, prop), outViewStyle$1(prop.viewStyle));
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const isNumber = (val) => {
|
|
70
|
+
if (typeof val === 'string') {
|
|
71
|
+
return !Number.isNaN(Number(val));
|
|
72
|
+
}
|
|
73
|
+
return typeof val === 'number' && !Number.isNaN(val);
|
|
74
|
+
};
|
|
75
|
+
const outSingle = (key, obj) => {
|
|
76
|
+
if (obj[key] === undefined || obj[key] === null)
|
|
77
|
+
return {};
|
|
78
|
+
return isNumber(obj[key]) ? { [key]: Number(obj[key]) } : {};
|
|
79
|
+
};
|
|
80
|
+
const outSpacing = (key, spacing) => {
|
|
81
|
+
if (!spacing)
|
|
82
|
+
return {};
|
|
83
|
+
return {
|
|
84
|
+
[key]: {
|
|
85
|
+
left: isNumber(spacing.left) ? Number(spacing.left) : spacing.left,
|
|
86
|
+
right: isNumber(spacing.right) ? Number(spacing.right) : spacing.right,
|
|
87
|
+
top: isNumber(spacing.top) ? Number(spacing.top) : spacing.top,
|
|
88
|
+
bottom: isNumber(spacing.bottom) ? Number(spacing.bottom) : spacing.bottom,
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
const outSize = (key, size) => {
|
|
93
|
+
if (!size)
|
|
94
|
+
return {};
|
|
95
|
+
return {
|
|
96
|
+
[key]: {
|
|
97
|
+
type: size.type,
|
|
98
|
+
value: isNumber(size.value) ? Number(size.value) : size.value,
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
const outMetadata = (metaData) => {
|
|
103
|
+
if (!metaData)
|
|
104
|
+
return {};
|
|
105
|
+
return {
|
|
106
|
+
metaData: {
|
|
107
|
+
pixelWidth: isNumber(metaData.pixelWidth) ? Number(metaData.pixelWidth) : metaData.pixelWidth,
|
|
108
|
+
pixelHeight: isNumber(metaData.pixelHeight) ? Number(metaData.pixelHeight) : metaData.pixelHeight,
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
const outViewStyle = (viewStyle) => {
|
|
113
|
+
if (!viewStyle)
|
|
114
|
+
return {};
|
|
115
|
+
return {
|
|
116
|
+
viewStyle: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, viewStyle), outSingle('borderWidth', viewStyle)), outSingle('radius', viewStyle)), outSpacing('margin', viewStyle.margin)), outSpacing('padding', viewStyle.padding)),
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
const outTextStyle = (textStyle) => {
|
|
120
|
+
if (!textStyle)
|
|
121
|
+
return {};
|
|
122
|
+
return {
|
|
123
|
+
textStyle: Object.assign(Object.assign(Object.assign({}, textStyle), outSingle('size', textStyle)), outSingle('weight', textStyle)),
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
const outCarouselStyle = (carouselstyle) => {
|
|
127
|
+
if (!carouselstyle)
|
|
128
|
+
return {};
|
|
129
|
+
return {
|
|
130
|
+
carouselStyle: Object.assign(Object.assign({}, carouselstyle), outSingle('spacing', carouselstyle)),
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
const outViewProps = (view) => {
|
|
134
|
+
return Object.assign(Object.assign(Object.assign({}, outSize('width', view.width)), outSize('height', view.height)), outViewStyle(view.viewStyle));
|
|
135
|
+
};
|
|
136
|
+
const outTextProps = (text) => {
|
|
137
|
+
return Object.assign(Object.assign(Object.assign({}, outViewProps(text)), outTextStyle(text.textStyle)), outSingle('maxTextLines', text));
|
|
138
|
+
};
|
|
139
|
+
const outImageProps = (image) => {
|
|
140
|
+
return Object.assign(Object.assign({}, outViewProps(image)), outMetadata(image.metaData));
|
|
141
|
+
};
|
|
142
|
+
const outCarouselProps = (carousel) => {
|
|
143
|
+
return Object.assign(Object.assign(Object.assign({}, outViewProps(carousel)), outCarouselStyle(carousel.carouselStyle)), {
|
|
144
|
+
// Convert only top-level items to find has fill width values.
|
|
145
|
+
items: carousel.items.map((item) => (Object.assign(Object.assign({}, item), { body: Object.assign(Object.assign({}, item.body), { items: item.body.items.map((it) => numberTransform.run(it)) }) }))) });
|
|
146
|
+
};
|
|
147
|
+
const numberTransform = {
|
|
148
|
+
run(prop) {
|
|
149
|
+
if (prop.type === ComponentType.Text || prop.type === ComponentType.TextButton) {
|
|
150
|
+
return Object.assign(Object.assign({}, prop), outTextProps(prop));
|
|
151
|
+
}
|
|
152
|
+
if (prop.type === ComponentType.ImageButton || prop.type === ComponentType.Image) {
|
|
153
|
+
return Object.assign(Object.assign({}, prop), outImageProps(prop));
|
|
154
|
+
}
|
|
155
|
+
if (prop.type === ComponentType.Carousel) {
|
|
156
|
+
return Object.assign(Object.assign({}, prop), outCarouselProps(prop));
|
|
157
|
+
}
|
|
158
|
+
return Object.assign(Object.assign({}, prop), outViewProps(prop));
|
|
159
|
+
},
|
|
160
|
+
};
|
|
21
161
|
|
|
22
162
|
// -------- Set property mapper
|
|
23
163
|
const MAPPER = () => undefined;
|
|
24
164
|
const createParser = (params) => {
|
|
165
|
+
var _a;
|
|
25
166
|
const defaultMapper = (params === null || params === void 0 ? void 0 : params.defaultMapper) || MAPPER;
|
|
26
167
|
const mapper = {
|
|
27
168
|
defaultMapper,
|
|
@@ -32,31 +173,51 @@ const createParser = (params) => {
|
|
|
32
173
|
mapImageButtonProps: (params === null || params === void 0 ? void 0 : params.mapImageButtonProps) || defaultMapper,
|
|
33
174
|
mapCarouselProps: (params === null || params === void 0 ? void 0 : params.mapCarouselProps) || defaultMapper,
|
|
34
175
|
};
|
|
35
|
-
const transforms = (params === null || params === void 0 ? void 0 : params.transforms)
|
|
176
|
+
const transforms = [colorTransform, numberTransform, ...((_a = params === null || params === void 0 ? void 0 : params.transforms) !== null && _a !== void 0 ? _a : [])];
|
|
177
|
+
const transformDirty = new Set();
|
|
36
178
|
return {
|
|
179
|
+
setTransforms(newTransforms) {
|
|
180
|
+
transforms.length = 0;
|
|
181
|
+
transforms.push(...newTransforms);
|
|
182
|
+
transformDirty.clear();
|
|
183
|
+
},
|
|
184
|
+
addTransforms(newTransforms) {
|
|
185
|
+
transforms.push(...newTransforms);
|
|
186
|
+
},
|
|
37
187
|
parse(rawItem, options) {
|
|
38
|
-
|
|
188
|
+
// Note: it is for mutable transforms
|
|
189
|
+
// const uniqId =
|
|
190
|
+
// typeof options.depth === 'number' && typeof options.elemIdx === 'number'
|
|
191
|
+
// ? `id-${options.depth}-${options.elemIdx}`
|
|
192
|
+
// : rawItem.id ?? rawItem.elementId ?? JSON.stringify(rawItem);
|
|
193
|
+
//
|
|
194
|
+
// let item = rawItem;
|
|
195
|
+
// if (!transformDirty.has(uniqId)) {
|
|
196
|
+
// item = transforms.reduce((it, transform) => transform(it), rawItem);
|
|
197
|
+
// transformDirty.add(uniqId);
|
|
198
|
+
// }
|
|
199
|
+
const item = transforms.reduce((it, transform) => transform.run(it), rawItem);
|
|
39
200
|
switch (item.type) {
|
|
40
201
|
case ComponentType.Box: {
|
|
41
|
-
return { properties: mapper.mapBoxProps(item, options) };
|
|
202
|
+
return { transformed: item, properties: mapper.mapBoxProps(item, options) };
|
|
42
203
|
}
|
|
43
204
|
case ComponentType.Text: {
|
|
44
|
-
return { properties: mapper.mapTextProps(item, options) };
|
|
205
|
+
return { transformed: item, properties: mapper.mapTextProps(item, options) };
|
|
45
206
|
}
|
|
46
207
|
case ComponentType.Image: {
|
|
47
|
-
return { properties: mapper.mapImageProps(item, options) };
|
|
208
|
+
return { transformed: item, properties: mapper.mapImageProps(item, options) };
|
|
48
209
|
}
|
|
49
210
|
case ComponentType.TextButton: {
|
|
50
|
-
return { properties: mapper.mapTextButtonProps(item, options) };
|
|
211
|
+
return { transformed: item, properties: mapper.mapTextButtonProps(item, options) };
|
|
51
212
|
}
|
|
52
213
|
case ComponentType.ImageButton: {
|
|
53
|
-
return { properties: mapper.mapImageButtonProps(item, options) };
|
|
214
|
+
return { transformed: item, properties: mapper.mapImageButtonProps(item, options) };
|
|
54
215
|
}
|
|
55
|
-
case
|
|
56
|
-
return { properties: mapper.mapCarouselProps(item, options) };
|
|
216
|
+
case ComponentType.Carousel: {
|
|
217
|
+
return { transformed: item, properties: mapper.mapCarouselProps(item, options) };
|
|
57
218
|
}
|
|
58
219
|
default:
|
|
59
|
-
return { properties: undefined };
|
|
220
|
+
return { transformed: item, properties: undefined };
|
|
60
221
|
}
|
|
61
222
|
},
|
|
62
223
|
};
|
|
@@ -75,7 +236,7 @@ function createRenderer(params) {
|
|
|
75
236
|
};
|
|
76
237
|
}
|
|
77
238
|
|
|
78
|
-
var __rest$
|
|
239
|
+
var __rest$5 = (undefined && undefined.__rest) || function (s, e) {
|
|
79
240
|
var t = {};
|
|
80
241
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
81
242
|
t[p] = s[p];
|
|
@@ -93,7 +254,7 @@ const SizeContext = React.createContext({
|
|
|
93
254
|
const SizeContextProvider = ({ children }) => {
|
|
94
255
|
const [sizes, setSizes] = React.useState({});
|
|
95
256
|
const updateSize = React.useCallback((_a) => {
|
|
96
|
-
var { id } = _a, rest = __rest$
|
|
257
|
+
var { id } = _a, rest = __rest$5(_a, ["id"]);
|
|
97
258
|
if (id) {
|
|
98
259
|
setSizes((prevSizes) => (Object.assign(Object.assign({}, prevSizes), { [id]: rest })));
|
|
99
260
|
}
|
|
@@ -157,7 +318,7 @@ const alignInFlex = (align) => {
|
|
|
157
318
|
const isTemplateVersionSupported = (templateVersion) => {
|
|
158
319
|
if (!templateVersion)
|
|
159
320
|
return true;
|
|
160
|
-
return SUPPORTED_TEMPLATE_VERSIONS.includes(templateVersion);
|
|
321
|
+
return SUPPORTED_TEMPLATE_VERSIONS.includes(Number(templateVersion));
|
|
161
322
|
};
|
|
162
323
|
|
|
163
324
|
const memoize = (fn) => {
|
|
@@ -201,6 +362,15 @@ const defaultProperties = {
|
|
|
201
362
|
layout: Layout.Row,
|
|
202
363
|
align: { vertical: AlignValue.Top, horizontal: AlignValue.Left },
|
|
203
364
|
},
|
|
365
|
+
textButton: {
|
|
366
|
+
maxTextLines: 1,
|
|
367
|
+
},
|
|
368
|
+
carousel: {
|
|
369
|
+
style: {
|
|
370
|
+
spacing: 10,
|
|
371
|
+
maxChildWidth: 240,
|
|
372
|
+
},
|
|
373
|
+
},
|
|
204
374
|
};
|
|
205
375
|
|
|
206
376
|
const createMessageTemplate = (opts) => {
|
|
@@ -208,42 +378,41 @@ const createMessageTemplate = (opts) => {
|
|
|
208
378
|
const UnknownMessage = opts.UnknownMessage || (() => null);
|
|
209
379
|
const parser = opts.parser || createParser();
|
|
210
380
|
const renderer = opts.renderer || createRenderer();
|
|
211
|
-
const MessageTemplateBase = ({ templateItems, parentLayout = defaultProperties.box.layout,
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
381
|
+
const MessageTemplateBase = ({ templateItems, templateVersion, parentLayout = defaultProperties.box.layout, depth = 0, }) => {
|
|
382
|
+
if (!isTemplateVersionSupported(templateVersion)) {
|
|
383
|
+
throw new Error(`Cannot parse template item due to unsupported template version: ${templateVersion}, ${SUPPORTED_TEMPLATE_VERSIONS}`);
|
|
384
|
+
}
|
|
385
|
+
return (React__default.default.createElement(React__default.default.Fragment, null, templateItems.map((rawItem, index, siblings) => {
|
|
386
|
+
const result = parser.parse(rawItem, { parentLayout, depth, elemIdx: index, siblings });
|
|
387
|
+
const item = result.transformed;
|
|
388
|
+
const rendererProps = {
|
|
216
389
|
key: index,
|
|
217
|
-
parentLayout,
|
|
218
|
-
parsedProperties: properties,
|
|
219
390
|
siblings,
|
|
391
|
+
parentLayout,
|
|
392
|
+
parsedProperties: result.properties,
|
|
220
393
|
};
|
|
221
394
|
switch (item.type) {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
if (!isRoot) {
|
|
225
|
-
throw new Error('Cannot parse template item as Carousel if the template item is not the root.');
|
|
226
|
-
}
|
|
227
|
-
if (!item.items || !Array.isArray(item.items) || item.items.length === 0) {
|
|
395
|
+
case ComponentType.Carousel: {
|
|
396
|
+
if (!Array.isArray(item.items) || item.items.length === 0) {
|
|
228
397
|
throw new Error('Cannot parse template item as Carousel if carousel has no items.');
|
|
229
398
|
}
|
|
230
|
-
return (React__default.default.createElement(renderer.carouselView, Object.assign({}, item,
|
|
399
|
+
return (React__default.default.createElement(renderer.carouselView, Object.assign({}, item, rendererProps), item.items.map((template, index) => (React__default.default.createElement(MessageTemplateBase, { key: index, templateItems: template.body.items || [], depth: depth + 1, templateVersion: template.version })))));
|
|
231
400
|
}
|
|
232
401
|
case ComponentType.Box: {
|
|
233
|
-
return (React__default.default.createElement(renderer.box, Object.assign({}, item,
|
|
234
|
-
React__default.default.createElement(MessageTemplateBase, { templateItems: item.items || [], parentLayout: item.layout })));
|
|
402
|
+
return (React__default.default.createElement(renderer.box, Object.assign({}, item, rendererProps),
|
|
403
|
+
React__default.default.createElement(MessageTemplateBase, { templateItems: item.items || [], parentLayout: item.layout, depth: depth + 1, templateVersion: templateVersion })));
|
|
235
404
|
}
|
|
236
405
|
case ComponentType.Text: {
|
|
237
|
-
return React__default.default.createElement(renderer.text, Object.assign({}, item,
|
|
406
|
+
return React__default.default.createElement(renderer.text, Object.assign({}, item, rendererProps));
|
|
238
407
|
}
|
|
239
408
|
case ComponentType.Image: {
|
|
240
|
-
return React__default.default.createElement(renderer.image, Object.assign({}, item,
|
|
409
|
+
return React__default.default.createElement(renderer.image, Object.assign({}, item, rendererProps));
|
|
241
410
|
}
|
|
242
411
|
case ComponentType.TextButton: {
|
|
243
|
-
return React__default.default.createElement(renderer.textButton, Object.assign({}, item,
|
|
412
|
+
return React__default.default.createElement(renderer.textButton, Object.assign({}, item, rendererProps));
|
|
244
413
|
}
|
|
245
414
|
case ComponentType.ImageButton: {
|
|
246
|
-
return React__default.default.createElement(renderer.imageButton, Object.assign({}, item,
|
|
415
|
+
return React__default.default.createElement(renderer.imageButton, Object.assign({}, item, rendererProps));
|
|
247
416
|
}
|
|
248
417
|
default: {
|
|
249
418
|
// or throw new Error('Cannot parse template item')
|
|
@@ -253,21 +422,11 @@ const createMessageTemplate = (opts) => {
|
|
|
253
422
|
})));
|
|
254
423
|
};
|
|
255
424
|
return {
|
|
256
|
-
MessageTemplate: ({ parentLayout = defaultProperties.rootLayout,
|
|
425
|
+
MessageTemplate: ({ templateVersion, templateItems, parentLayout = defaultProperties.rootLayout, }) => {
|
|
257
426
|
const items = setTemplateItemId(templateItems);
|
|
258
|
-
if (!isTemplateVersionSupported(templateVersion)) {
|
|
259
|
-
/**
|
|
260
|
-
* I choose to throw instead of returning UnknownMessage because UnknownMessage syntax (required prop: item) is not what UIKit wants.
|
|
261
|
-
*/
|
|
262
|
-
throw new Error(`Cannot parse template item due to unsupported template version: ${templateVersion}, ${SUPPORTED_TEMPLATE_VERSIONS}`);
|
|
263
|
-
}
|
|
264
|
-
let isCarousel = false;
|
|
265
|
-
if (Array.isArray(items) && items.length > 0) {
|
|
266
|
-
isCarousel = items[0].type === exports.CompositeComponentType.Carousel;
|
|
267
|
-
}
|
|
268
427
|
return (React__default.default.createElement(SizeContextProvider, null,
|
|
269
|
-
React__default.default.createElement(Container,
|
|
270
|
-
React__default.default.createElement(MessageTemplateBase, { parentLayout: parentLayout, templateItems: items,
|
|
428
|
+
React__default.default.createElement(Container, null,
|
|
429
|
+
React__default.default.createElement(MessageTemplateBase, { isRoot: true, parentLayout: parentLayout, templateItems: items, templateVersion: templateVersion }))));
|
|
271
430
|
},
|
|
272
431
|
MessageTemplateBase,
|
|
273
432
|
};
|
|
@@ -1131,67 +1290,102 @@ var ActionType;
|
|
|
1131
1290
|
},
|
|
1132
1291
|
});
|
|
1133
1292
|
|
|
1134
|
-
const
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
const
|
|
1138
|
-
|
|
1139
|
-
* fixed sized template items should use its child width.
|
|
1140
|
-
* Whereas flex sized template items should use its parent's width.
|
|
1141
|
-
* @param item
|
|
1142
|
-
*/
|
|
1143
|
-
function shouldRenderAsFixed(item) {
|
|
1144
|
-
var _a;
|
|
1145
|
-
return ((_a = item.props.templateItems[0].width) === null || _a === void 0 ? void 0 : _a.type) === 'fixed';
|
|
1146
|
-
}
|
|
1147
|
-
function CarouselItem({ item, defaultWidth, marginRight }) {
|
|
1148
|
-
const style = shouldRenderAsFixed(item)
|
|
1149
|
-
? { width: 'fit-content' }
|
|
1150
|
-
: { minWidth: defaultWidth, width: '100%' };
|
|
1151
|
-
if (marginRight) {
|
|
1152
|
-
style['marginRight'] = marginRight;
|
|
1153
|
-
}
|
|
1154
|
-
return React__default.default.createElement("div", { style: style }, item);
|
|
1155
|
-
}
|
|
1156
|
-
const Carousel = React__default.default.memo(({ children, gap = GAP_DEFAULT }) => {
|
|
1157
|
-
var _a, _b;
|
|
1293
|
+
const SWIPE_THRESHOLD = 24;
|
|
1294
|
+
function useCarousel({ spacing, childrenLength, paddingInlineStart, paddingInlineEnd }) {
|
|
1295
|
+
// TODO: RTL support
|
|
1296
|
+
const paddingStart = paddingInlineStart;
|
|
1297
|
+
const paddingEnd = paddingInlineEnd;
|
|
1158
1298
|
const carouselRef = React.useRef(null);
|
|
1159
|
-
const
|
|
1160
|
-
const
|
|
1161
|
-
const
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
return defaultItemWidth;
|
|
1167
|
-
});
|
|
1168
|
-
const itemPositions = getEachItemPositions();
|
|
1169
|
-
const [draggingInfo, setDraggingInfo] = React.useState({
|
|
1170
|
-
scrolling: false,
|
|
1171
|
-
dragging: false,
|
|
1172
|
-
startPos: null,
|
|
1299
|
+
const childrenRefs = React.useRef(Array.from({ length: childrenLength }, () => React__default.default.createRef()));
|
|
1300
|
+
const isDragging = React.useRef(false);
|
|
1301
|
+
const isScrolling = React.useRef(false);
|
|
1302
|
+
const animationFrame = React.useRef(null);
|
|
1303
|
+
const drag = React.useRef({
|
|
1304
|
+
sx: null,
|
|
1305
|
+
sy: null,
|
|
1173
1306
|
offset: 0,
|
|
1174
1307
|
translateX: 0,
|
|
1175
1308
|
currentIndex: 0,
|
|
1176
1309
|
});
|
|
1177
|
-
const
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1310
|
+
const [childWidths, setChildWidths] = React.useState(() => childrenRefs.current.map(() => 0));
|
|
1311
|
+
const itemPositions = React.useMemo(() => {
|
|
1312
|
+
let currentPosition = paddingStart;
|
|
1313
|
+
return childWidths.map((width, i) => {
|
|
1314
|
+
const start = currentPosition - (i > 0 ? spacing : 0);
|
|
1315
|
+
const end = start - width;
|
|
1316
|
+
currentPosition = end;
|
|
1317
|
+
return { start, end };
|
|
1318
|
+
});
|
|
1319
|
+
}, [childWidths, spacing, paddingStart]);
|
|
1320
|
+
const totalContentWidth = React.useMemo(() => {
|
|
1321
|
+
const totalItemWidth = childWidths.reduce((acc, width) => acc + width, 0);
|
|
1322
|
+
const totalSpacing = spacing * (childrenLength - 1);
|
|
1323
|
+
return totalItemWidth + totalSpacing;
|
|
1324
|
+
}, [childWidths, spacing, childrenLength]);
|
|
1325
|
+
React.useLayoutEffect(() => {
|
|
1326
|
+
setChildWidths(childrenRefs.current.map((ref) => { var _a, _b; return (_b = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.clientWidth) !== null && _b !== void 0 ? _b : 0; }));
|
|
1327
|
+
}, [childrenLength]);
|
|
1328
|
+
React.useLayoutEffect(() => {
|
|
1329
|
+
if (itemPositions.length > 0) {
|
|
1330
|
+
drag.current.translateX = itemPositions[0].start;
|
|
1331
|
+
animate();
|
|
1332
|
+
}
|
|
1333
|
+
}, [itemPositions]);
|
|
1334
|
+
const dragStart = () => {
|
|
1335
|
+
if (!carouselRef.current)
|
|
1185
1336
|
return;
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1337
|
+
isDragging.current = true;
|
|
1338
|
+
carouselRef.current.style.cursor = 'grabbing';
|
|
1339
|
+
carouselRef.current.style.transition = 'none';
|
|
1340
|
+
animationFrame.current = requestAnimationFrame(animate);
|
|
1189
1341
|
};
|
|
1190
|
-
const
|
|
1191
|
-
if (!
|
|
1342
|
+
const dragStop = () => {
|
|
1343
|
+
if (!carouselRef.current)
|
|
1192
1344
|
return;
|
|
1193
|
-
|
|
1194
|
-
|
|
1345
|
+
isDragging.current = false;
|
|
1346
|
+
carouselRef.current.style.cursor = 'grab';
|
|
1347
|
+
carouselRef.current.style.transition = 'transform 0.5s ease';
|
|
1348
|
+
if (animationFrame.current) {
|
|
1349
|
+
cancelAnimationFrame(animationFrame.current);
|
|
1350
|
+
animationFrame.current = null;
|
|
1351
|
+
}
|
|
1352
|
+
};
|
|
1353
|
+
const dragRelease = () => {
|
|
1354
|
+
const { offset, currentIndex } = drag.current;
|
|
1355
|
+
const thresholdExceeded = Math.abs(offset) >= SWIPE_THRESHOLD;
|
|
1356
|
+
const swipeToNext = offset < 0 && currentIndex < childrenLength - 1;
|
|
1357
|
+
const swipeToPrev = offset > 0 && currentIndex > 0;
|
|
1358
|
+
let newIndex = currentIndex;
|
|
1359
|
+
if (thresholdExceeded && swipeToNext) {
|
|
1360
|
+
newIndex = currentIndex + 1;
|
|
1361
|
+
}
|
|
1362
|
+
else if (thresholdExceeded && swipeToPrev) {
|
|
1363
|
+
newIndex = currentIndex - 1;
|
|
1364
|
+
}
|
|
1365
|
+
function clampTranslateX(translateX) {
|
|
1366
|
+
var _a, _b;
|
|
1367
|
+
const containerWidth = (_b = (_a = carouselRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth) !== null && _b !== void 0 ? _b : 0;
|
|
1368
|
+
const start = paddingStart;
|
|
1369
|
+
const end = Math.min(0, containerWidth - totalContentWidth) - paddingEnd;
|
|
1370
|
+
return Math.min(start, Math.max(end, translateX));
|
|
1371
|
+
}
|
|
1372
|
+
drag.current.currentIndex = newIndex;
|
|
1373
|
+
drag.current.translateX = clampTranslateX(itemPositions[newIndex].start);
|
|
1374
|
+
drag.current.offset = 0;
|
|
1375
|
+
};
|
|
1376
|
+
const scrollStart = () => {
|
|
1377
|
+
isScrolling.current = true;
|
|
1378
|
+
};
|
|
1379
|
+
const scrollStop = () => {
|
|
1380
|
+
isScrolling.current = false;
|
|
1381
|
+
};
|
|
1382
|
+
const animate = () => {
|
|
1383
|
+
if (carouselRef.current) {
|
|
1384
|
+
carouselRef.current.style.transform = `translateX(${drag.current.translateX + drag.current.offset}px)`;
|
|
1385
|
+
}
|
|
1386
|
+
if (animationFrame.current) {
|
|
1387
|
+
animationFrame.current = requestAnimationFrame(animate);
|
|
1388
|
+
}
|
|
1195
1389
|
};
|
|
1196
1390
|
const blockScroll = () => {
|
|
1197
1391
|
if (carouselRef.current) {
|
|
@@ -1203,115 +1397,116 @@ const Carousel = React__default.default.memo(({ children, gap = GAP_DEFAULT }) =
|
|
|
1203
1397
|
carouselRef.current.style.touchAction = 'pan-y';
|
|
1204
1398
|
}
|
|
1205
1399
|
};
|
|
1206
|
-
const
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1400
|
+
const onMouseDown = (event) => {
|
|
1401
|
+
dragStart();
|
|
1402
|
+
scrollStop();
|
|
1403
|
+
drag.current.sx = event.clientX;
|
|
1404
|
+
drag.current.sy = event.clientY;
|
|
1405
|
+
drag.current.offset = 0;
|
|
1406
|
+
animationFrame.current = requestAnimationFrame(animate);
|
|
1211
1407
|
};
|
|
1212
|
-
const
|
|
1213
|
-
if (!
|
|
1408
|
+
const onMouseMove = (event) => {
|
|
1409
|
+
if (!isDragging.current || drag.current.sx === null)
|
|
1214
1410
|
return;
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
if (draggingInfo.dragging) {
|
|
1220
|
-
if (newOffset === draggingInfo.offset)
|
|
1221
|
-
return;
|
|
1222
|
-
setDraggingInfo((props) => (Object.assign(Object.assign({}, props), { offset: newOffset })));
|
|
1411
|
+
drag.current.offset = event.clientX - drag.current.sx;
|
|
1412
|
+
};
|
|
1413
|
+
const onMouseUp = () => {
|
|
1414
|
+
if (!isDragging.current)
|
|
1223
1415
|
return;
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
}
|
|
1228
|
-
else {
|
|
1229
|
-
blockScroll();
|
|
1230
|
-
setDraggingInfo((props) => (Object.assign(Object.assign({}, props), { dragging: true, offset: newOffset })));
|
|
1231
|
-
}
|
|
1416
|
+
scrollStop();
|
|
1417
|
+
dragRelease();
|
|
1418
|
+
dragStop();
|
|
1232
1419
|
};
|
|
1233
|
-
const
|
|
1234
|
-
if (!
|
|
1420
|
+
const onMouseLeave = () => {
|
|
1421
|
+
if (!isDragging.current)
|
|
1235
1422
|
return;
|
|
1236
|
-
|
|
1237
|
-
|
|
1423
|
+
scrollStop();
|
|
1424
|
+
dragRelease();
|
|
1425
|
+
dragStop();
|
|
1238
1426
|
};
|
|
1239
|
-
const
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
};
|
|
1427
|
+
const onTouchStart = (event) => {
|
|
1428
|
+
scrollStop();
|
|
1429
|
+
dragStop();
|
|
1430
|
+
const touch = event.touches[0];
|
|
1431
|
+
drag.current.sx = touch.clientX;
|
|
1432
|
+
drag.current.sy = touch.clientY;
|
|
1433
|
+
drag.current.offset = 0;
|
|
1434
|
+
animationFrame.current = requestAnimationFrame(animate);
|
|
1248
1435
|
};
|
|
1249
|
-
const
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1436
|
+
const onTouchMove = (event) => {
|
|
1437
|
+
if (drag.current.sx === null || drag.current.sy === null || isScrolling.current)
|
|
1438
|
+
return;
|
|
1439
|
+
const { clientX, clientY } = event.touches[0];
|
|
1440
|
+
const { sx, sy } = drag.current;
|
|
1441
|
+
if (isDragging.current) {
|
|
1442
|
+
drag.current.offset = clientX - sx;
|
|
1254
1443
|
return;
|
|
1255
1444
|
}
|
|
1256
|
-
|
|
1257
|
-
if (
|
|
1258
|
-
|
|
1259
|
-
setDraggingInfo((props) => getNewDraggingInfo(props));
|
|
1260
|
-
return;
|
|
1261
|
-
}
|
|
1262
|
-
const nextIndex = currentIndex + 1;
|
|
1263
|
-
/**
|
|
1264
|
-
* This is special logic for "더 보기" button for Socar use-case.
|
|
1265
|
-
* The button will have a small width (less than 50px).
|
|
1266
|
-
* We want to include this button in the view and snap to right padding wall IFF !isLastTwoItemsFitScreen.
|
|
1267
|
-
*/
|
|
1268
|
-
if (nextIndex === children.length - 1 || isLastItemFitsScreen(nextIndex)) {
|
|
1269
|
-
setDraggingInfo((props) => getNewDraggingInfo(Object.assign(Object.assign({}, props), { newTranslateX: itemPositions[children.length - 1].end - PADDING_WIDTH - CONTENT_LEFT_WIDTH + screenWidth, nextIndex: children.length - 1 })));
|
|
1270
|
-
}
|
|
1271
|
-
else {
|
|
1272
|
-
setDraggingInfo((props) => getNewDraggingInfo(Object.assign(Object.assign({}, props), { newTranslateX: itemPositions[nextIndex].start, nextIndex })));
|
|
1273
|
-
}
|
|
1274
|
-
// If dragged to right, next index should be to the left
|
|
1275
|
-
}
|
|
1276
|
-
else if (offset > 0 && currentIndex > 0) {
|
|
1277
|
-
let nextIndex = currentIndex - 1;
|
|
1278
|
-
while (draggingInfo.translateX >= itemPositions[nextIndex].start) {
|
|
1279
|
-
nextIndex--;
|
|
1280
|
-
}
|
|
1281
|
-
setDraggingInfo((props) => getNewDraggingInfo(Object.assign(Object.assign({}, props), { newTranslateX: itemPositions[nextIndex].start, nextIndex })));
|
|
1445
|
+
const isVerticalScroll = Math.abs(clientY - sy) > Math.abs(clientX - sx);
|
|
1446
|
+
if (isVerticalScroll) {
|
|
1447
|
+
scrollStart();
|
|
1282
1448
|
}
|
|
1283
1449
|
else {
|
|
1284
|
-
|
|
1450
|
+
drag.current.offset = clientX - sx;
|
|
1451
|
+
blockScroll();
|
|
1452
|
+
dragStart();
|
|
1285
1453
|
}
|
|
1286
1454
|
};
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1455
|
+
const onTouchEnd = () => {
|
|
1456
|
+
unblockScroll();
|
|
1457
|
+
scrollStop();
|
|
1458
|
+
dragRelease();
|
|
1459
|
+
dragStop();
|
|
1460
|
+
};
|
|
1461
|
+
return {
|
|
1462
|
+
carouselRef,
|
|
1463
|
+
childrenRefs,
|
|
1464
|
+
handlers: {
|
|
1465
|
+
onMouseDown,
|
|
1466
|
+
onMouseMove,
|
|
1467
|
+
onMouseUp,
|
|
1468
|
+
onMouseLeave,
|
|
1469
|
+
onTouchStart,
|
|
1470
|
+
onTouchMove,
|
|
1471
|
+
onTouchEnd,
|
|
1472
|
+
},
|
|
1473
|
+
};
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
var __rest$4 = (undefined && undefined.__rest) || function (s, e) {
|
|
1477
|
+
var t = {};
|
|
1478
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1479
|
+
t[p] = s[p];
|
|
1480
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
1481
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1482
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
1483
|
+
t[p[i]] = s[p[i]];
|
|
1484
|
+
}
|
|
1485
|
+
return t;
|
|
1486
|
+
};
|
|
1487
|
+
const Carousel = ({ children, style, spacing = defaultProperties.carousel.style.spacing, maxChildWidth = defaultProperties.carousel.style.maxChildWidth, }) => {
|
|
1488
|
+
const _a = style !== null && style !== void 0 ? style : {}, { paddingInlineStart = 0, paddingInlineEnd = 0 } = _a, restStyle = __rest$4(_a, ["paddingInlineStart", "paddingInlineEnd"]);
|
|
1489
|
+
const { carouselRef, childrenRefs, handlers } = useCarousel({
|
|
1490
|
+
spacing,
|
|
1491
|
+
childrenLength: children.length,
|
|
1492
|
+
paddingInlineStart: Number(paddingInlineStart),
|
|
1493
|
+
paddingInlineEnd: Number(paddingInlineEnd),
|
|
1494
|
+
});
|
|
1495
|
+
return (React__default.default.createElement("div", Object.assign({}, handlers, { ref: carouselRef, className: 'sb-message-template__carousel', style: Object.assign(Object.assign({}, restStyle), { gap: spacing, width: '100%', overflow: 'visible' }) }), children.map((item, index) => (React__default.default.createElement(CarouselChild, { ref: childrenRefs.current[index], key: index, maxChildWidth: maxChildWidth }, item)))));
|
|
1496
|
+
};
|
|
1497
|
+
const CarouselChild = React__default.default.forwardRef(function CarouselChild({ maxChildWidth, children }, ref) {
|
|
1498
|
+
const maxWidth = shouldSetMaxChildWidth(children.props, maxChildWidth) ? maxChildWidth : 'fit-content';
|
|
1499
|
+
return (React__default.default.createElement("div", { ref: ref, style: { maxWidth, width: '100%', flexShrink: 0, overflow: 'hidden', userSelect: 'none' } }, children));
|
|
1314
1500
|
});
|
|
1501
|
+
// Note: Set the maxChildWidth because it's impossible to determine the maximum width of items in the Carousel Child template when they have FillParent
|
|
1502
|
+
function shouldSetMaxChildWidth(props, maxChildWidth) {
|
|
1503
|
+
return !!props.templateItems.find((it) => {
|
|
1504
|
+
var _a, _b, _c, _d;
|
|
1505
|
+
const hasFillWidth = ((_a = it.width) === null || _a === void 0 ? void 0 : _a.type) === 'flex' && ((_b = it.width) === null || _b === void 0 ? void 0 : _b.value) === FlexSizeSpecValue.FillParent;
|
|
1506
|
+
const overMaxChildWidth = ((_c = it.width) === null || _c === void 0 ? void 0 : _c.type) === 'fixed' && ((_d = it.width) === null || _d === void 0 ? void 0 : _d.value) >= maxChildWidth;
|
|
1507
|
+
return hasFillWidth || overMaxChildWidth;
|
|
1508
|
+
});
|
|
1509
|
+
}
|
|
1315
1510
|
|
|
1316
1511
|
function isWrappedText(view) {
|
|
1317
1512
|
var _a;
|
|
@@ -1334,12 +1529,6 @@ const isGif = (url) => {
|
|
|
1334
1529
|
const extension = (_a = url.split('.').pop()) === null || _a === void 0 ? void 0 : _a.toLowerCase();
|
|
1335
1530
|
return extension === 'gif';
|
|
1336
1531
|
};
|
|
1337
|
-
const isNumber = (val) => {
|
|
1338
|
-
if (typeof val === 'string') {
|
|
1339
|
-
return !Number.isNaN(Number(val));
|
|
1340
|
-
}
|
|
1341
|
-
return typeof val === 'number' && !Number.isNaN(val);
|
|
1342
|
-
};
|
|
1343
1532
|
|
|
1344
1533
|
var __rest$3 = (undefined && undefined.__rest) || function (s, e) {
|
|
1345
1534
|
var t = {};
|
|
@@ -1463,6 +1652,151 @@ const useImageLoadError = (source) => {
|
|
|
1463
1652
|
};
|
|
1464
1653
|
};
|
|
1465
1654
|
|
|
1655
|
+
function getDefaultStyles(overrides) {
|
|
1656
|
+
return Object.assign({ display: 'flex', overflow: 'hidden', boxSizing: 'border-box' }, overrides);
|
|
1657
|
+
}
|
|
1658
|
+
function setViewProps(styles, props, options) {
|
|
1659
|
+
setViewSize(styles, props, options);
|
|
1660
|
+
setViewStyle(styles, props);
|
|
1661
|
+
}
|
|
1662
|
+
function setBorderStyle(styles, borderWidth, borderColor, radius) {
|
|
1663
|
+
if (borderWidth) {
|
|
1664
|
+
styles['--border-width'] = `${borderWidth}px`;
|
|
1665
|
+
styles['--border-color'] = borderColor || 'transparent';
|
|
1666
|
+
}
|
|
1667
|
+
if (radius) {
|
|
1668
|
+
styles['borderRadius'] = radius;
|
|
1669
|
+
styles['--border-radius'] = `${radius}px`;
|
|
1670
|
+
}
|
|
1671
|
+
}
|
|
1672
|
+
function setViewStyle(styles, props) {
|
|
1673
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1674
|
+
const { viewStyle } = props;
|
|
1675
|
+
styles['marginBlockStart'] = (_a = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.margin) === null || _a === void 0 ? void 0 : _a.top;
|
|
1676
|
+
styles['marginBlockEnd'] = (_b = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.margin) === null || _b === void 0 ? void 0 : _b.bottom;
|
|
1677
|
+
styles['marginInlineStart'] = (_c = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.margin) === null || _c === void 0 ? void 0 : _c.left;
|
|
1678
|
+
styles['marginInlineEnd'] = (_d = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.margin) === null || _d === void 0 ? void 0 : _d.right;
|
|
1679
|
+
const marginHorizontal = ((_f = (_e = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.margin) === null || _e === void 0 ? void 0 : _e.left) !== null && _f !== void 0 ? _f : 0) + ((_h = (_g = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.margin) === null || _g === void 0 ? void 0 : _g.right) !== null && _h !== void 0 ? _h : 0);
|
|
1680
|
+
if (marginHorizontal > 0 && styles.width === '100%')
|
|
1681
|
+
styles.width = `calc(100% - ${marginHorizontal}px)`;
|
|
1682
|
+
if (viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.backgroundColor)
|
|
1683
|
+
styles['backgroundColor'] = viewStyle.backgroundColor;
|
|
1684
|
+
// use JSON.stringify to escape special characters in image URL
|
|
1685
|
+
if (viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.backgroundImageUrl) {
|
|
1686
|
+
styles['backgroundImage'] = `url(${JSON.stringify(viewStyle.backgroundImageUrl)})`;
|
|
1687
|
+
styles['backgroundSize'] = '100% 100%';
|
|
1688
|
+
styles['backgroundPosition'] = 'center';
|
|
1689
|
+
}
|
|
1690
|
+
setBorderStyle(styles, viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.borderWidth, viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.borderColor, viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.radius);
|
|
1691
|
+
}
|
|
1692
|
+
function getViewSizeStyle(width, height, parentLayout) {
|
|
1693
|
+
const style = {};
|
|
1694
|
+
if (width.type === 'flex' && width.value == FlexSizeSpecValue.FillParent) {
|
|
1695
|
+
style['width'] = '100%';
|
|
1696
|
+
if (parentLayout === Layout.Row) {
|
|
1697
|
+
style['flex'] = 1;
|
|
1698
|
+
}
|
|
1699
|
+
}
|
|
1700
|
+
else if (width.type === 'fixed' && width.value >= 0) {
|
|
1701
|
+
style['width'] = width.value;
|
|
1702
|
+
}
|
|
1703
|
+
if (height.type === 'flex' && height.value == FlexSizeSpecValue.FillParent) {
|
|
1704
|
+
style['height'] = '100%';
|
|
1705
|
+
if (parentLayout === Layout.Column) {
|
|
1706
|
+
style['flex'] = 1;
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
else if (height.type === 'fixed' && height.value >= 0) {
|
|
1710
|
+
style['height'] = height.value;
|
|
1711
|
+
}
|
|
1712
|
+
return style;
|
|
1713
|
+
}
|
|
1714
|
+
function setViewSize(styles, props, options) {
|
|
1715
|
+
var _a, _b;
|
|
1716
|
+
const { width: defaultWidth, height: defaultHeight } = defaultProperties.view.size;
|
|
1717
|
+
const { parentLayout } = options;
|
|
1718
|
+
const sizeStyle = getViewSizeStyle((_a = props.width) !== null && _a !== void 0 ? _a : defaultWidth, (_b = props.height) !== null && _b !== void 0 ? _b : defaultHeight, parentLayout);
|
|
1719
|
+
Object.assign(styles, sizeStyle);
|
|
1720
|
+
}
|
|
1721
|
+
function setAlign(styles, layout = defaultProperties.box.layout, align = defaultProperties.box.align) {
|
|
1722
|
+
if (layout === Layout.Row) {
|
|
1723
|
+
styles['flexDirection'] = 'row';
|
|
1724
|
+
styles['alignItems'] = alignInFlex(align.vertical);
|
|
1725
|
+
styles['justifyContent'] = alignInFlex(align.horizontal);
|
|
1726
|
+
}
|
|
1727
|
+
if (layout === Layout.Column) {
|
|
1728
|
+
styles['flexDirection'] = 'column';
|
|
1729
|
+
styles['alignItems'] = alignInFlex(align.horizontal);
|
|
1730
|
+
styles['justifyContent'] = alignInFlex(align.vertical);
|
|
1731
|
+
}
|
|
1732
|
+
}
|
|
1733
|
+
function setTextAlign(styles, align = defaultProperties.box.align.horizontal) {
|
|
1734
|
+
styles.textAlign = align;
|
|
1735
|
+
}
|
|
1736
|
+
function setImageStyle(styles, imageStyle) {
|
|
1737
|
+
const { contentMode = MediaContentMode.AspectFit } = imageStyle || {};
|
|
1738
|
+
if (contentMode) {
|
|
1739
|
+
switch (contentMode) {
|
|
1740
|
+
case MediaContentMode.AspectFill:
|
|
1741
|
+
styles['objectFit'] = 'cover';
|
|
1742
|
+
break;
|
|
1743
|
+
case MediaContentMode.AspectFit:
|
|
1744
|
+
styles['objectFit'] = 'contain';
|
|
1745
|
+
break;
|
|
1746
|
+
case MediaContentMode.ScalesToFill:
|
|
1747
|
+
styles['objectFit'] = 'fill';
|
|
1748
|
+
break;
|
|
1749
|
+
}
|
|
1750
|
+
}
|
|
1751
|
+
}
|
|
1752
|
+
// uses image meta-data to render images that doesn't break the UI
|
|
1753
|
+
// https://sendbird.atlassian.net/wiki/spaces/UK/pages/2008220608/Message+template+-+Image+policy
|
|
1754
|
+
function setImageAspectRatio(styles, props) {
|
|
1755
|
+
var _a, _b, _c, _d;
|
|
1756
|
+
const imageMetaData = props === null || props === void 0 ? void 0 : props.metaData;
|
|
1757
|
+
if (!(imageMetaData === null || imageMetaData === void 0 ? void 0 : imageMetaData.pixelHeight) || !(imageMetaData === null || imageMetaData === void 0 ? void 0 : imageMetaData.pixelWidth)) {
|
|
1758
|
+
return;
|
|
1759
|
+
}
|
|
1760
|
+
if (((_a = props === null || props === void 0 ? void 0 : props.width) === null || _a === void 0 ? void 0 : _a.type) === 'fixed' || ((_b = props === null || props === void 0 ? void 0 : props.height) === null || _b === void 0 ? void 0 : _b.type) === 'fixed') {
|
|
1761
|
+
return;
|
|
1762
|
+
}
|
|
1763
|
+
styles['aspectRatio'] = `${(_c = props === null || props === void 0 ? void 0 : props.metaData) === null || _c === void 0 ? void 0 : _c.pixelWidth} / ${(_d = props === null || props === void 0 ? void 0 : props.metaData) === null || _d === void 0 ? void 0 : _d.pixelHeight}`;
|
|
1764
|
+
}
|
|
1765
|
+
function webkitLineClampStyles(numberOfLines) {
|
|
1766
|
+
return {
|
|
1767
|
+
WebkitLineClamp: numberOfLines,
|
|
1768
|
+
WebkitBoxOrient: 'vertical',
|
|
1769
|
+
display: '-webkit-box',
|
|
1770
|
+
overflow: 'hidden',
|
|
1771
|
+
overflowWrap: 'anywhere',
|
|
1772
|
+
flex: 1,
|
|
1773
|
+
};
|
|
1774
|
+
}
|
|
1775
|
+
function setTextStyle(styles, props, options) {
|
|
1776
|
+
const { textStyle, width } = props;
|
|
1777
|
+
// TODO: Change default as design
|
|
1778
|
+
const { size, color, weight } = textStyle || {};
|
|
1779
|
+
if (size)
|
|
1780
|
+
styles['fontSize'] = size;
|
|
1781
|
+
if (color)
|
|
1782
|
+
styles['color'] = color;
|
|
1783
|
+
if (weight)
|
|
1784
|
+
styles['fontWeight'] = weight;
|
|
1785
|
+
if ((width === null || width === void 0 ? void 0 : width.type) === 'flex' && (width === null || width === void 0 ? void 0 : width.value) == FlexSizeSpecValue.WrapContent) {
|
|
1786
|
+
styles['width'] = 'fit-content';
|
|
1787
|
+
styles['maxWidth'] = '100%';
|
|
1788
|
+
}
|
|
1789
|
+
if (props.type === ComponentType.Text) {
|
|
1790
|
+
const { siblings, elemIdx } = options;
|
|
1791
|
+
// To push out any subsequent components from the container,
|
|
1792
|
+
// if a prior one is long enough to occupy an entire line
|
|
1793
|
+
// @link https://sendbird.atlassian.net/browse/NOTI-709
|
|
1794
|
+
if (siblings != null && siblings.length >= 2 && siblings.every(isWrappedText)) {
|
|
1795
|
+
styles.flexShrink = siblings.length - 1 === elemIdx ? 1 : 0;
|
|
1796
|
+
}
|
|
1797
|
+
}
|
|
1798
|
+
}
|
|
1799
|
+
|
|
1466
1800
|
// create a context provider for MessageComponent
|
|
1467
1801
|
// - this is a wrapper for MessageComponent
|
|
1468
1802
|
const MessageContext = React__default.default.createContext(null);
|
|
@@ -1476,7 +1810,13 @@ const MessageProvider = (props) => {
|
|
|
1476
1810
|
}), [message === null || message === void 0 ? void 0 : message.updatedAt]);
|
|
1477
1811
|
return React__default.default.createElement(MessageContext.Provider, { value: value }, children);
|
|
1478
1812
|
};
|
|
1479
|
-
const useMessageContext = () =>
|
|
1813
|
+
const useMessageContext = () => {
|
|
1814
|
+
const context = React__default.default.useContext(MessageContext);
|
|
1815
|
+
if (!context) {
|
|
1816
|
+
throw new Error('useMessageContext must be used within a MessageProvider');
|
|
1817
|
+
}
|
|
1818
|
+
return context;
|
|
1819
|
+
};
|
|
1480
1820
|
|
|
1481
1821
|
/**
|
|
1482
1822
|
* Preserves a reference to the given callback function as an argument while the component is mounted.
|
|
@@ -1672,167 +2012,6 @@ function useRecalculateWidth(params) {
|
|
|
1672
2012
|
return { recalculatedStyle: currentStyle, elemRef };
|
|
1673
2013
|
}
|
|
1674
2014
|
|
|
1675
|
-
function getDefaultStyles(overrides) {
|
|
1676
|
-
return Object.assign({ display: 'flex', overflow: 'hidden', boxSizing: 'border-box' }, overrides);
|
|
1677
|
-
}
|
|
1678
|
-
function setViewProps(styles, props, options) {
|
|
1679
|
-
var _a;
|
|
1680
|
-
setViewSize(styles, props, options);
|
|
1681
|
-
setViewStyle(styles, props);
|
|
1682
|
-
// [Padding] Just parse the values as numbers; the actual value has been set in the ActionHandler.
|
|
1683
|
-
if ((_a = props.viewStyle) === null || _a === void 0 ? void 0 : _a.padding) {
|
|
1684
|
-
const padding = props.viewStyle.padding;
|
|
1685
|
-
if (isNumber(padding.top))
|
|
1686
|
-
padding.top = Number(padding.top);
|
|
1687
|
-
if (isNumber(padding.bottom))
|
|
1688
|
-
padding.bottom = Number(padding.bottom);
|
|
1689
|
-
if (isNumber(padding.left))
|
|
1690
|
-
padding.left = Number(padding.left);
|
|
1691
|
-
if (isNumber(padding.right))
|
|
1692
|
-
padding.right = Number(padding.right);
|
|
1693
|
-
}
|
|
1694
|
-
}
|
|
1695
|
-
function setBorderStyle(styles, borderWidth, borderColor, radius) {
|
|
1696
|
-
if (borderWidth) {
|
|
1697
|
-
styles['--border-width'] = `${borderWidth}px`;
|
|
1698
|
-
styles['--border-color'] = borderColor || 'transparent';
|
|
1699
|
-
}
|
|
1700
|
-
if (radius) {
|
|
1701
|
-
styles['borderRadius'] = Number(radius);
|
|
1702
|
-
styles['--border-radius'] = `${radius}px`;
|
|
1703
|
-
}
|
|
1704
|
-
}
|
|
1705
|
-
function setViewStyle(styles, props) {
|
|
1706
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1707
|
-
const { viewStyle } = props;
|
|
1708
|
-
if (isNumber((_a = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.margin) === null || _a === void 0 ? void 0 : _a.top))
|
|
1709
|
-
styles['marginTop'] = Number((_b = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.margin) === null || _b === void 0 ? void 0 : _b.top);
|
|
1710
|
-
if (isNumber((_c = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.margin) === null || _c === void 0 ? void 0 : _c.bottom))
|
|
1711
|
-
styles['marginBottom'] = Number((_d = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.margin) === null || _d === void 0 ? void 0 : _d.bottom);
|
|
1712
|
-
if (isNumber((_e = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.margin) === null || _e === void 0 ? void 0 : _e.left))
|
|
1713
|
-
styles['marginLeft'] = Number((_f = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.margin) === null || _f === void 0 ? void 0 : _f.left);
|
|
1714
|
-
if (isNumber((_g = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.margin) === null || _g === void 0 ? void 0 : _g.right))
|
|
1715
|
-
styles['marginRight'] = Number((_h = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.margin) === null || _h === void 0 ? void 0 : _h.right);
|
|
1716
|
-
const marginHorizontal = Number((_j = styles.marginLeft) !== null && _j !== void 0 ? _j : '0') + Number((_k = styles.marginRight) !== null && _k !== void 0 ? _k : '0');
|
|
1717
|
-
if (marginHorizontal > 0 && styles.width === '100%')
|
|
1718
|
-
styles.width = `calc(100% - ${marginHorizontal}px)`;
|
|
1719
|
-
if (viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.backgroundColor)
|
|
1720
|
-
styles['backgroundColor'] = viewStyle.backgroundColor;
|
|
1721
|
-
// use JSON.stringify to escape special characters in image URL
|
|
1722
|
-
if (viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.backgroundImageUrl) {
|
|
1723
|
-
styles['backgroundImage'] = `url(${JSON.stringify(viewStyle.backgroundImageUrl)})`;
|
|
1724
|
-
styles['backgroundSize'] = '100%';
|
|
1725
|
-
styles['backgroundPosition'] = 'center';
|
|
1726
|
-
}
|
|
1727
|
-
setBorderStyle(styles, viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.borderWidth, viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.borderColor, viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.radius);
|
|
1728
|
-
}
|
|
1729
|
-
function getViewSizeStyle(width, height, parentLayout) {
|
|
1730
|
-
const style = {};
|
|
1731
|
-
if (width.type === 'flex' && width.value == FlexSizeSpecValue.FillParent) {
|
|
1732
|
-
style['width'] = '100%';
|
|
1733
|
-
if (parentLayout === Layout.Row) {
|
|
1734
|
-
style['flex'] = 1;
|
|
1735
|
-
}
|
|
1736
|
-
}
|
|
1737
|
-
else if (width.type === 'fixed' && width.value >= 0) {
|
|
1738
|
-
style['width'] = Number(width.value);
|
|
1739
|
-
}
|
|
1740
|
-
if (height.type === 'flex' && height.value == FlexSizeSpecValue.FillParent) {
|
|
1741
|
-
style['height'] = '100%';
|
|
1742
|
-
if (parentLayout === Layout.Column) {
|
|
1743
|
-
style['flex'] = 1;
|
|
1744
|
-
}
|
|
1745
|
-
}
|
|
1746
|
-
else if (height.type === 'fixed' && height.value >= 0) {
|
|
1747
|
-
style['height'] = Number(height.value);
|
|
1748
|
-
}
|
|
1749
|
-
return style;
|
|
1750
|
-
}
|
|
1751
|
-
function setViewSize(styles, props, options) {
|
|
1752
|
-
var _a, _b;
|
|
1753
|
-
const { width: defaultWidth, height: defaultHeight } = defaultProperties.view.size;
|
|
1754
|
-
const { parentLayout } = options;
|
|
1755
|
-
const sizeStyle = getViewSizeStyle((_a = props.width) !== null && _a !== void 0 ? _a : defaultWidth, (_b = props.height) !== null && _b !== void 0 ? _b : defaultHeight, parentLayout);
|
|
1756
|
-
Object.assign(styles, sizeStyle);
|
|
1757
|
-
}
|
|
1758
|
-
function setAlign(styles, layout = defaultProperties.box.layout, align = defaultProperties.box.align) {
|
|
1759
|
-
if (layout === Layout.Row) {
|
|
1760
|
-
styles['flexDirection'] = 'row';
|
|
1761
|
-
styles['alignItems'] = alignInFlex(align.vertical);
|
|
1762
|
-
styles['justifyContent'] = alignInFlex(align.horizontal);
|
|
1763
|
-
}
|
|
1764
|
-
if (layout === Layout.Column) {
|
|
1765
|
-
styles['flexDirection'] = 'column';
|
|
1766
|
-
styles['alignItems'] = alignInFlex(align.horizontal);
|
|
1767
|
-
styles['justifyContent'] = alignInFlex(align.vertical);
|
|
1768
|
-
}
|
|
1769
|
-
}
|
|
1770
|
-
function setTextAlign(styles, align = defaultProperties.box.align.horizontal) {
|
|
1771
|
-
styles.textAlign = align;
|
|
1772
|
-
}
|
|
1773
|
-
function setImageStyle(styles, imageStyle) {
|
|
1774
|
-
const { contentMode = MediaContentMode.AspectFit } = imageStyle || {};
|
|
1775
|
-
if (contentMode) {
|
|
1776
|
-
switch (contentMode) {
|
|
1777
|
-
case MediaContentMode.AspectFill:
|
|
1778
|
-
styles['objectFit'] = 'cover';
|
|
1779
|
-
break;
|
|
1780
|
-
case MediaContentMode.AspectFit:
|
|
1781
|
-
styles['objectFit'] = 'contain';
|
|
1782
|
-
break;
|
|
1783
|
-
case MediaContentMode.ScalesToFill:
|
|
1784
|
-
styles['objectFit'] = 'fill';
|
|
1785
|
-
break;
|
|
1786
|
-
}
|
|
1787
|
-
}
|
|
1788
|
-
}
|
|
1789
|
-
// uses image meta-data to render images that doesn't break the UI
|
|
1790
|
-
// https://sendbird.atlassian.net/wiki/spaces/UK/pages/2008220608/Message+template+-+Image+policy
|
|
1791
|
-
function setImageAspectRatio(styles, props) {
|
|
1792
|
-
var _a, _b, _c, _d;
|
|
1793
|
-
const imageMetaData = props === null || props === void 0 ? void 0 : props.metaData;
|
|
1794
|
-
if (!(imageMetaData === null || imageMetaData === void 0 ? void 0 : imageMetaData.pixelHeight) || !(imageMetaData === null || imageMetaData === void 0 ? void 0 : imageMetaData.pixelWidth)) {
|
|
1795
|
-
return;
|
|
1796
|
-
}
|
|
1797
|
-
if (((_a = props === null || props === void 0 ? void 0 : props.width) === null || _a === void 0 ? void 0 : _a.type) === 'fixed' || ((_b = props === null || props === void 0 ? void 0 : props.height) === null || _b === void 0 ? void 0 : _b.type) === 'fixed') {
|
|
1798
|
-
return;
|
|
1799
|
-
}
|
|
1800
|
-
styles['aspectRatio'] = `${(_c = props === null || props === void 0 ? void 0 : props.metaData) === null || _c === void 0 ? void 0 : _c.pixelWidth} / ${(_d = props === null || props === void 0 ? void 0 : props.metaData) === null || _d === void 0 ? void 0 : _d.pixelHeight}`;
|
|
1801
|
-
}
|
|
1802
|
-
function webkitLineClampStyles(numberOfLines) {
|
|
1803
|
-
return {
|
|
1804
|
-
WebkitLineClamp: numberOfLines,
|
|
1805
|
-
WebkitBoxOrient: 'vertical',
|
|
1806
|
-
display: '-webkit-box',
|
|
1807
|
-
overflow: 'hidden',
|
|
1808
|
-
overflowWrap: 'anywhere',
|
|
1809
|
-
flex: 1,
|
|
1810
|
-
};
|
|
1811
|
-
}
|
|
1812
|
-
function setTextStyle(styles, props, options) {
|
|
1813
|
-
const { textStyle, width } = props;
|
|
1814
|
-
// TODO: Change default as design
|
|
1815
|
-
const { size, color, weight = 'normal' } = textStyle || {};
|
|
1816
|
-
if (size)
|
|
1817
|
-
styles['fontSize'] = Number(size);
|
|
1818
|
-
if (color)
|
|
1819
|
-
styles['color'] = color;
|
|
1820
|
-
if (weight)
|
|
1821
|
-
styles['fontWeight'] = weight;
|
|
1822
|
-
if ((width === null || width === void 0 ? void 0 : width.value) == FlexSizeSpecValue.WrapContent) {
|
|
1823
|
-
styles['maxWidth'] = '100%';
|
|
1824
|
-
}
|
|
1825
|
-
if (props.type === ComponentType.Text) {
|
|
1826
|
-
const { siblings, elemIdx } = options;
|
|
1827
|
-
// To push out any subsequent components from the container,
|
|
1828
|
-
// if a prior one is long enough to occupy an entire line
|
|
1829
|
-
// @link https://sendbird.atlassian.net/browse/NOTI-709
|
|
1830
|
-
if (siblings != null && siblings.length >= 2 && siblings.every(isWrappedText)) {
|
|
1831
|
-
styles.flexShrink = siblings.length - 1 === elemIdx ? 1 : 0;
|
|
1832
|
-
}
|
|
1833
|
-
}
|
|
1834
|
-
}
|
|
1835
|
-
|
|
1836
2015
|
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
1837
2016
|
var t = {};
|
|
1838
2017
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -1861,13 +2040,20 @@ const returnUrl = (url = '') => {
|
|
|
1861
2040
|
return `https://${url}`;
|
|
1862
2041
|
};
|
|
1863
2042
|
// todo: semantic html here is not perfect, need to revisit. Same for Button
|
|
1864
|
-
const ActionHandler = ({
|
|
1865
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
2043
|
+
const ActionHandler = ({ children, props, className, style }) => {
|
|
2044
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1866
2045
|
const { recalculatedStyle, elemRef } = useRecalculateWidth({ style, props });
|
|
1867
2046
|
const { message, handleWebAction, handleCustomAction, handlePredefinedAction } = useMessageContext();
|
|
2047
|
+
const borderClass = ((_a = props.viewStyle) === null || _a === void 0 ? void 0 : _a.borderWidth) ? 'sb-message-template__border' : '';
|
|
2048
|
+
const paddingStyles = {
|
|
2049
|
+
paddingBlockStart: (_c = (_b = props.viewStyle) === null || _b === void 0 ? void 0 : _b.padding) === null || _c === void 0 ? void 0 : _c.top,
|
|
2050
|
+
paddingBlockEnd: (_e = (_d = props.viewStyle) === null || _d === void 0 ? void 0 : _d.padding) === null || _e === void 0 ? void 0 : _e.bottom,
|
|
2051
|
+
paddingInlineStart: (_g = (_f = props.viewStyle) === null || _f === void 0 ? void 0 : _f.padding) === null || _g === void 0 ? void 0 : _g.left,
|
|
2052
|
+
paddingInlineEnd: (_j = (_h = props.viewStyle) === null || _h === void 0 ? void 0 : _h.padding) === null || _j === void 0 ? void 0 : _j.right,
|
|
2053
|
+
};
|
|
1868
2054
|
const onClick = (e) => {
|
|
1869
2055
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
1870
|
-
if (((_a = props
|
|
2056
|
+
if (((_a = props.action) === null || _a === void 0 ? void 0 : _a.type) === 'web') {
|
|
1871
2057
|
if (handleWebAction) {
|
|
1872
2058
|
handleWebAction(e, props.action, message);
|
|
1873
2059
|
}
|
|
@@ -1875,7 +2061,7 @@ const ActionHandler = ({ className = '', style, children, props }) => {
|
|
|
1875
2061
|
(_c = window === null || window === void 0 ? void 0 : window.open(returnUrl((_b = props === null || props === void 0 ? void 0 : props.action) === null || _b === void 0 ? void 0 : _b.data), '_blank', 'noopener noreferrer')) === null || _c === void 0 ? void 0 : _c.focus();
|
|
1876
2062
|
}
|
|
1877
2063
|
}
|
|
1878
|
-
if (((_d = props
|
|
2064
|
+
else if (((_d = props.action) === null || _d === void 0 ? void 0 : _d.type) === 'custom') {
|
|
1879
2065
|
if (handleCustomAction) {
|
|
1880
2066
|
handleCustomAction(e, props.action, message);
|
|
1881
2067
|
}
|
|
@@ -1883,30 +2069,25 @@ const ActionHandler = ({ className = '', style, children, props }) => {
|
|
|
1883
2069
|
(_f = window === null || window === void 0 ? void 0 : window.open(returnUrl((_e = props === null || props === void 0 ? void 0 : props.action) === null || _e === void 0 ? void 0 : _e.data), '_blank', 'noopener noreferrer')) === null || _f === void 0 ? void 0 : _f.focus();
|
|
1884
2070
|
}
|
|
1885
2071
|
}
|
|
1886
|
-
if (((_g = props
|
|
2072
|
+
else if (((_g = props.action) === null || _g === void 0 ? void 0 : _g.type) === 'uikit') {
|
|
1887
2073
|
handlePredefinedAction === null || handlePredefinedAction === void 0 ? void 0 : handlePredefinedAction(e, props.action, message);
|
|
1888
2074
|
}
|
|
1889
2075
|
};
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
return (React__default.default.createElement("button", { className: `${className}${borderClass}`, "data-sb-template-id": props.elementId, style: Object.assign(Object.assign({}, style), { paddingTop: (_c = (_b = props.viewStyle) === null || _b === void 0 ? void 0 : _b.padding) === null || _c === void 0 ? void 0 : _c.top, paddingRight: (_e = (_d = props.viewStyle) === null || _d === void 0 ? void 0 : _d.padding) === null || _e === void 0 ? void 0 : _e.right, paddingBottom: (_g = (_f = props.viewStyle) === null || _f === void 0 ? void 0 : _f.padding) === null || _g === void 0 ? void 0 : _g.bottom, paddingLeft: (_j = (_h = props.viewStyle) === null || _h === void 0 ? void 0 : _h.padding) === null || _j === void 0 ? void 0 : _j.left }), onClick: onClick }, children));
|
|
2076
|
+
if (props.type === ComponentType.TextButton) {
|
|
2077
|
+
return (React__default.default.createElement("button", { className: clx(className, borderClass), "data-sb-template-id": props.elementId, style: Object.assign(Object.assign({}, style), paddingStyles), onClick: onClick }, children));
|
|
1893
2078
|
}
|
|
1894
2079
|
const { display, flexDirection, justifyContent, alignItems, objectFit } = recalculatedStyle, wrapperStyles = __rest(recalculatedStyle, ["display", "flexDirection", "justifyContent", "alignItems", "objectFit"]);
|
|
1895
|
-
return (React__default.default.createElement("div", { ref: elemRef, className:
|
|
1896
|
-
React__default.default.createElement("div", { style: {
|
|
1897
|
-
display,
|
|
2080
|
+
return (React__default.default.createElement("div", { ref: elemRef, className: clx(className, borderClass, props.action && 'sb-message-template__action'), "data-sb-template-id": props.elementId, style: wrapperStyles, onClick: onClick },
|
|
2081
|
+
React__default.default.createElement("div", { style: Object.assign({ display,
|
|
1898
2082
|
flexDirection,
|
|
1899
2083
|
justifyContent,
|
|
1900
2084
|
alignItems,
|
|
1901
|
-
objectFit,
|
|
1902
|
-
width: '100%',
|
|
1903
|
-
height: '100%',
|
|
1904
|
-
paddingTop: (_l = (_k = props.viewStyle) === null || _k === void 0 ? void 0 : _k.padding) === null || _l === void 0 ? void 0 : _l.top,
|
|
1905
|
-
paddingRight: (_o = (_m = props.viewStyle) === null || _m === void 0 ? void 0 : _m.padding) === null || _o === void 0 ? void 0 : _o.right,
|
|
1906
|
-
paddingBottom: (_q = (_p = props.viewStyle) === null || _p === void 0 ? void 0 : _p.padding) === null || _q === void 0 ? void 0 : _q.bottom,
|
|
1907
|
-
paddingLeft: (_s = (_r = props.viewStyle) === null || _r === void 0 ? void 0 : _r.padding) === null || _s === void 0 ? void 0 : _s.left,
|
|
1908
|
-
} }, children)));
|
|
2085
|
+
objectFit, width: '100%', height: '100%' }, paddingStyles) }, children)));
|
|
1909
2086
|
};
|
|
2087
|
+
function clx(...names) {
|
|
2088
|
+
return names.filter((it) => !!it).join(' ');
|
|
2089
|
+
}
|
|
2090
|
+
|
|
1910
2091
|
/**
|
|
1911
2092
|
* Text that is fixed or fill parent should be wrapped in a div with max-width: 100% and max-height: 100%
|
|
1912
2093
|
* This is to prevent text from overflowing the padding of the container
|
|
@@ -1928,13 +2109,13 @@ function convertNewlinesToBr(text) {
|
|
|
1928
2109
|
function renderText(view) {
|
|
1929
2110
|
const { text, maxTextLines } = view;
|
|
1930
2111
|
const isToBeWrapped = isFixedOrFill(view);
|
|
1931
|
-
const
|
|
2112
|
+
const hasMaxLines = typeof maxTextLines === 'number' && maxTextLines > 0;
|
|
1932
2113
|
const convertedText = convertNewlinesToBr(text);
|
|
1933
|
-
if (
|
|
1934
|
-
const wrapperStyling = Object.assign(Object.assign({}, ((
|
|
1935
|
-
return (React__default.default.createElement("div", { style: wrapperStyling },
|
|
2114
|
+
if (hasMaxLines || isToBeWrapped) {
|
|
2115
|
+
const wrapperStyling = Object.assign(Object.assign({}, ((hasMaxLines || isToBeWrapped) && { maxWidth: '100%' })), (isToBeWrapped && { maxHeight: '100%', overflow: 'hidden' }));
|
|
2116
|
+
return (React__default.default.createElement("div", { style: wrapperStyling }, hasMaxLines ? React__default.default.createElement("div", { style: webkitLineClampStyles(maxTextLines) }, convertedText) : convertedText));
|
|
1936
2117
|
}
|
|
1937
|
-
return
|
|
2118
|
+
return hasMaxLines ? React__default.default.createElement("div", { style: webkitLineClampStyles(maxTextLines) }, convertedText) : convertedText;
|
|
1938
2119
|
}
|
|
1939
2120
|
const renderer = createRenderer({
|
|
1940
2121
|
views: {
|
|
@@ -1951,7 +2132,7 @@ const renderer = createRenderer({
|
|
|
1951
2132
|
React__default.default.createElement(ReactMessageTemplateImage, { className: "sb-message-template__image", alt: "image", src: props.imageUrl, style: { width: '100%', height: '100%', aspectRatio: 'inherit', objectFit: 'inherit' }, tintColor: (_a = props.imageStyle) === null || _a === void 0 ? void 0 : _a.tintColor, metaData: props.metaData })));
|
|
1952
2133
|
},
|
|
1953
2134
|
textButton(props) {
|
|
1954
|
-
return (React__default.default.createElement(ActionHandler, { className: "sb-message-template__text-button", elementId: props.elementId, style: props.parsedProperties, props: props }, renderText(Object.assign({ maxTextLines:
|
|
2135
|
+
return (React__default.default.createElement(ActionHandler, { className: "sb-message-template__text-button", elementId: props.elementId, style: props.parsedProperties, props: props }, renderText(Object.assign({ maxTextLines: defaultProperties.textButton.maxTextLines }, props))));
|
|
1955
2136
|
},
|
|
1956
2137
|
imageButton(props) {
|
|
1957
2138
|
var _a;
|
|
@@ -1959,7 +2140,8 @@ const renderer = createRenderer({
|
|
|
1959
2140
|
React__default.default.createElement(ReactMessageTemplateImage, { className: "sb-message-template__image", alt: "image-button", src: props.imageUrl, style: { width: '100%', height: '100%', aspectRatio: 'inherit', objectFit: 'inherit' }, tintColor: (_a = props.imageStyle) === null || _a === void 0 ? void 0 : _a.tintColor, metaData: props.metaData })));
|
|
1960
2141
|
},
|
|
1961
2142
|
carouselView(props) {
|
|
1962
|
-
|
|
2143
|
+
var _a, _b;
|
|
2144
|
+
return (React__default.default.createElement(Carousel, { maxChildWidth: (_a = props.carouselStyle) === null || _a === void 0 ? void 0 : _a.maxChildWidth, spacing: (_b = props.carouselStyle) === null || _b === void 0 ? void 0 : _b.spacing, style: props.parsedProperties }, props.children));
|
|
1963
2145
|
},
|
|
1964
2146
|
},
|
|
1965
2147
|
});
|
|
@@ -1972,7 +2154,7 @@ const parser = createParser({
|
|
|
1972
2154
|
},
|
|
1973
2155
|
mapTextProps(props, options) {
|
|
1974
2156
|
var _a;
|
|
1975
|
-
const styles = getDefaultStyles({ whiteSpace: 'pre-line' });
|
|
2157
|
+
const styles = getDefaultStyles({ whiteSpace: 'pre-line', wordBreak: 'break-word' });
|
|
1976
2158
|
// Better not set flex 1 to text
|
|
1977
2159
|
setViewProps(styles, props, options);
|
|
1978
2160
|
setTextStyle(styles, props, options);
|
|
@@ -1990,7 +2172,7 @@ const parser = createParser({
|
|
|
1990
2172
|
mapTextButtonProps(props, options) {
|
|
1991
2173
|
const styles = getDefaultStyles({ whiteSpace: 'pre-line', alignItems: 'center', justifyContent: 'center' });
|
|
1992
2174
|
setViewProps(styles, props, options);
|
|
1993
|
-
setTextStyle(styles,
|
|
2175
|
+
setTextStyle(styles, props, options);
|
|
1994
2176
|
return styles;
|
|
1995
2177
|
},
|
|
1996
2178
|
mapImageButtonProps(props, options) {
|
|
@@ -2001,8 +2183,13 @@ const parser = createParser({
|
|
|
2001
2183
|
return styles;
|
|
2002
2184
|
},
|
|
2003
2185
|
mapCarouselProps(props, options) {
|
|
2186
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2004
2187
|
const styles = getDefaultStyles();
|
|
2005
2188
|
setViewProps(styles, props, options);
|
|
2189
|
+
styles['paddingBlockStart'] = (_b = (_a = props.viewStyle) === null || _a === void 0 ? void 0 : _a.padding) === null || _b === void 0 ? void 0 : _b.top;
|
|
2190
|
+
styles['paddingBlockEnd'] = (_d = (_c = props.viewStyle) === null || _c === void 0 ? void 0 : _c.padding) === null || _d === void 0 ? void 0 : _d.bottom;
|
|
2191
|
+
styles['paddingInlineStart'] = (_f = (_e = props.viewStyle) === null || _e === void 0 ? void 0 : _e.padding) === null || _f === void 0 ? void 0 : _f.left;
|
|
2192
|
+
styles['paddingInlineEnd'] = (_h = (_g = props.viewStyle) === null || _g === void 0 ? void 0 : _g.padding) === null || _h === void 0 ? void 0 : _h.right;
|
|
2006
2193
|
return styles;
|
|
2007
2194
|
},
|
|
2008
2195
|
});
|
|
@@ -2014,7 +2201,7 @@ createMessageTemplate({
|
|
|
2014
2201
|
display: 'flex',
|
|
2015
2202
|
flexDirection: 'column',
|
|
2016
2203
|
maxWidth: 400,
|
|
2017
|
-
|
|
2204
|
+
marginBlockEnd: 24,
|
|
2018
2205
|
} }, children));
|
|
2019
2206
|
},
|
|
2020
2207
|
});
|
|
@@ -2037,4 +2224,4 @@ function MessageTemplate(_a) {
|
|
|
2037
2224
|
|
|
2038
2225
|
exports.MessageProvider = MessageProvider;
|
|
2039
2226
|
exports.MessageTemplate = MessageTemplate;
|
|
2040
|
-
//# sourceMappingURL=bundle-
|
|
2227
|
+
//# sourceMappingURL=bundle-BawOTHsT.js.map
|