@sendbird/uikit-react 3.16.8 → 3.16.9
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 +88 -88
- package/CHANGELOG.md +6 -0
- package/Channel/components/ChannelHeader.js +32 -32
- package/Channel/components/ChannelUI.js +67 -67
- package/Channel/components/FileViewer.js +30 -30
- package/Channel/components/FrozenNotification.js +6 -6
- package/Channel/components/Message.js +56 -56
- package/Channel/components/MessageInput.js +43 -43
- package/Channel/components/MessageInputWrapper.js +43 -43
- package/Channel/components/MessageList.js +60 -60
- package/Channel/components/RemoveMessageModal.js +29 -29
- package/Channel/components/SuggestedMentionList.js +29 -29
- package/Channel/components/TypingIndicator.js +9 -9
- package/Channel/components/UnreadCount.js +8 -8
- package/Channel/context.js +23 -23
- package/Channel/hooks/useHandleUploadFiles.js +18 -18
- package/Channel/hooks/useInitialMessagesFetch.js +8 -8
- package/Channel/utils/compareMessagesForGrouping.js +8 -8
- package/Channel/utils/getMessagePartsInfo.js +9 -9
- package/Channel.js +67 -67
- package/ChannelList/components/AddChannel.js +88 -88
- package/ChannelList/components/ChannelListHeader.js +13 -13
- package/ChannelList/components/ChannelListUI.js +88 -88
- package/ChannelList/components/ChannelPreview.js +32 -32
- package/ChannelList/components/ChannelPreviewAction.js +17 -17
- package/ChannelList/context.js +14 -14
- package/ChannelList.js +88 -88
- package/ChannelSettings/components/ChannelProfile.js +23 -23
- package/ChannelSettings/components/ChannelSettingMenuList.js +14 -14
- package/ChannelSettings/components/ChannelSettingsHeader.js +11 -11
- package/ChannelSettings/components/ChannelSettingsMenuItem.js +2 -2
- package/ChannelSettings/components/ChannelSettingsUI.js +31 -31
- package/ChannelSettings/components/EditDetailsModal.js +19 -19
- package/ChannelSettings/components/LeaveChannel.js +20 -20
- package/ChannelSettings/components/ModerationPanel.js +29 -29
- package/ChannelSettings/components/UserListItem.js +19 -19
- package/ChannelSettings/components/UserPanel.js +28 -28
- package/ChannelSettings/context.js +9 -9
- package/ChannelSettings/hooks/useMenuList.js +29 -29
- package/ChannelSettings.js +31 -31
- package/CreateChannel/components/CreateChannelUI.js +88 -88
- package/CreateChannel/components/InviteUsers.js +88 -88
- package/CreateChannel/components/SelectChannelType.js +88 -88
- package/CreateChannel/context.js +88 -88
- package/CreateChannel.js +88 -88
- package/CreateOpenChannel/components/CreateOpenChannelUI.js +15 -15
- package/CreateOpenChannel/context.js +4 -4
- package/CreateOpenChannel.js +15 -15
- package/EditUserProfile/components/EditUserProfileUI.js +15 -15
- package/EditUserProfile/context.js +1 -1
- package/EditUserProfile.js +15 -15
- package/GroupChannel/components/FileViewer.js +28 -28
- package/GroupChannel/components/FrozenNotification.js +6 -6
- package/GroupChannel/components/GroupChannelHeader.js +29 -29
- package/GroupChannel/components/GroupChannelUI.js +63 -63
- package/GroupChannel/components/Message.js +54 -54
- package/GroupChannel/components/MessageInputWrapper.js +41 -41
- package/GroupChannel/components/MessageList.js +56 -56
- package/GroupChannel/components/RemoveMessageModal.js +27 -27
- package/GroupChannel/components/SuggestedMentionList.js +15 -15
- package/GroupChannel/components/TypingIndicator.js +9 -9
- package/GroupChannel/components/UnreadCount.js +8 -8
- package/GroupChannel/context.js +15 -15
- package/GroupChannel.js +63 -63
- package/GroupChannelList/components/AddGroupChannel.js +88 -88
- package/GroupChannelList/components/GroupChannelListHeader.js +13 -13
- package/GroupChannelList/components/GroupChannelListItem.js +32 -32
- package/GroupChannelList/components/GroupChannelListUI.js +88 -88
- package/GroupChannelList/components/GroupChannelPreviewAction.js +17 -17
- package/GroupChannelList/context.js +10 -10
- package/GroupChannelList.js +88 -88
- package/MessageSearch/components/MessageSearchUI.js +20 -20
- package/MessageSearch/context.js +6 -6
- package/MessageSearch.js +22 -22
- package/OpenChannel/components/FrozenChannelNotification.js +5 -5
- package/OpenChannel/components/OpenChannelHeader.js +20 -20
- package/OpenChannel/components/OpenChannelInput.js +29 -29
- package/OpenChannel/components/OpenChannelMessage.js +39 -39
- package/OpenChannel/components/OpenChannelMessageList.js +43 -43
- package/OpenChannel/components/OpenChannelUI.js +43 -43
- package/OpenChannel/context.js +19 -19
- package/OpenChannel.js +43 -43
- package/OpenChannelList/components/OpenChannelListUI.js +17 -17
- package/OpenChannelList/components/OpenChannelPreview.js +6 -6
- package/OpenChannelList/context.js +6 -6
- package/OpenChannelList.js +17 -17
- package/OpenChannelSettings/components/EditDetailsModal.js +18 -18
- package/OpenChannelSettings/components/OpenChannelProfile.js +18 -18
- package/OpenChannelSettings/components/OpenChannelSettingsUI.js +24 -24
- package/OpenChannelSettings/components/OperatorUI.js +24 -24
- package/OpenChannelSettings/components/ParticipantUI.js +22 -22
- package/OpenChannelSettings/context.js +6 -6
- package/OpenChannelSettings.js +24 -24
- package/SendbirdProvider.js +23 -23
- package/Thread/components/ParentMessageInfo.js +49 -49
- package/Thread/components/ParentMessageInfoItem.js +34 -34
- package/Thread/components/ThreadHeader.js +8 -8
- package/Thread/components/ThreadList.js +56 -56
- package/Thread/components/ThreadListItem.js +56 -56
- package/Thread/components/ThreadMessageInput.js +46 -46
- package/Thread/components/ThreadUI.js +62 -62
- package/Thread/context.js +15 -15
- package/Thread.js +62 -62
- package/VoicePlayer/context.js +6 -6
- package/VoicePlayer/useVoicePlayer.js +14 -14
- package/VoiceRecorder/context.js +13 -13
- package/VoiceRecorder/useVoiceRecorder.js +12 -12
- package/chunks/{bundle-B7-mUZu7.js → bundle-B5YnH_bZ.js} +1 -1
- package/chunks/bundle-B5YnH_bZ.js.map +1 -0
- package/chunks/{bundle-B_A8Uj8b.js → bundle-B7LJP6uD.js} +3 -3
- package/chunks/{bundle-B_A8Uj8b.js.map → bundle-B7LJP6uD.js.map} +1 -1
- package/chunks/{bundle-SvjGCfne.js → bundle-B83hoJ_j.js} +3 -3
- package/chunks/{bundle-SvjGCfne.js.map → bundle-B83hoJ_j.js.map} +1 -1
- package/chunks/{bundle-4D4_7cbS.js → bundle-BBzNJkTC.js} +1 -1
- package/chunks/bundle-BBzNJkTC.js.map +1 -0
- package/chunks/{bundle-BgDkvAUr.js → bundle-BID6Oznq.js} +3 -3
- package/chunks/{bundle-BgDkvAUr.js.map → bundle-BID6Oznq.js.map} +1 -1
- package/chunks/{bundle-DXIpH3W2.js → bundle-BIpsQoZM.js} +1 -1
- package/chunks/bundle-BIpsQoZM.js.map +1 -0
- package/chunks/{bundle-B-UR5uUY.js → bundle-BKZt9o1F.js} +1 -1
- package/chunks/{bundle-B-UR5uUY.js.map → bundle-BKZt9o1F.js.map} +1 -1
- package/chunks/{bundle-BRZ-fk0E.js → bundle-BSKWHbiZ.js} +10 -10
- package/chunks/{bundle-BRZ-fk0E.js.map → bundle-BSKWHbiZ.js.map} +1 -1
- package/chunks/{bundle-BOQAPdnF.js → bundle-BTRsBhSP.js} +1 -1
- package/chunks/bundle-BTRsBhSP.js.map +1 -0
- package/chunks/{bundle-ZIcy4GZM.js → bundle-BVGPrS-0.js} +4 -4
- package/chunks/{bundle-ZIcy4GZM.js.map → bundle-BVGPrS-0.js.map} +1 -1
- package/chunks/{bundle-CDV8AYgt.js → bundle-BX570l_k.js} +3 -3
- package/chunks/bundle-BX570l_k.js.map +1 -0
- package/chunks/{bundle-BsjPoFDW.js → bundle-BYR5uV_H.js} +1 -1
- package/chunks/{bundle-BsjPoFDW.js.map → bundle-BYR5uV_H.js.map} +1 -1
- package/chunks/{bundle-CLx3vwwI.js → bundle-BZ2wHbrz.js} +1 -1
- package/chunks/bundle-BZ2wHbrz.js.map +1 -0
- package/chunks/{bundle-sRAn8KYg.js → bundle-BZABTuI8.js} +8 -8
- package/chunks/bundle-BZABTuI8.js.map +1 -0
- package/chunks/{bundle-BiU5GOJa.js → bundle-BjQE3gm1.js} +5 -5
- package/chunks/{bundle-BiU5GOJa.js.map → bundle-BjQE3gm1.js.map} +1 -1
- package/chunks/{bundle-DIDUURtl.js → bundle-Bmdb9pIK.js} +3 -3
- package/chunks/{bundle-DIDUURtl.js.map → bundle-Bmdb9pIK.js.map} +1 -1
- package/chunks/{bundle-DTS-uU1_.js → bundle-BmyxRq9a.js} +14 -14
- package/chunks/{bundle-DTS-uU1_.js.map → bundle-BmyxRq9a.js.map} +1 -1
- package/chunks/{bundle-QZcjovdG.js → bundle-BntU6xha.js} +1 -1
- package/chunks/bundle-BntU6xha.js.map +1 -0
- package/chunks/{bundle-DzzUrNmL.js → bundle-BoCpB627.js} +1 -1
- package/chunks/bundle-BoCpB627.js.map +1 -0
- package/chunks/{bundle-CwfU7XnU.js → bundle-Bpv5h56D.js} +1 -1
- package/chunks/bundle-Bpv5h56D.js.map +1 -0
- package/chunks/{bundle-S-aXl3jq.js → bundle-Bt2DqAYD.js} +12 -12
- package/chunks/{bundle-S-aXl3jq.js.map → bundle-Bt2DqAYD.js.map} +1 -1
- package/chunks/{bundle-DG85l4tk.js → bundle-BugRLq09.js} +14 -14
- package/chunks/{bundle-DG85l4tk.js.map → bundle-BugRLq09.js.map} +1 -1
- package/chunks/{bundle-2EbTbHya.js → bundle-BvGPxdgc.js} +1 -1
- package/chunks/{bundle-2EbTbHya.js.map → bundle-BvGPxdgc.js.map} +1 -1
- package/chunks/{bundle-DlgrDAZX.js → bundle-ByFGGKX5.js} +2 -2
- package/chunks/{bundle-DlgrDAZX.js.map → bundle-ByFGGKX5.js.map} +1 -1
- package/chunks/{bundle-C_Bj-oeJ.js → bundle-ByIYMALs.js} +3 -3
- package/chunks/{bundle-C_Bj-oeJ.js.map → bundle-ByIYMALs.js.map} +1 -1
- package/chunks/{bundle-Bs0S8wQP.js → bundle-C3Ez17kh.js} +4 -4
- package/chunks/bundle-C3Ez17kh.js.map +1 -0
- package/chunks/{bundle-B0UH4qgo.js → bundle-C5Ih9B7Z.js} +1 -1
- package/chunks/bundle-C5Ih9B7Z.js.map +1 -0
- package/chunks/{bundle-C63EZHDP.js → bundle-C5qGxiDg.js} +5 -5
- package/chunks/{bundle-C63EZHDP.js.map → bundle-C5qGxiDg.js.map} +1 -1
- package/chunks/{bundle-DDSun-_c.js → bundle-C7EvDKbp.js} +4 -4
- package/chunks/{bundle-DDSun-_c.js.map → bundle-C7EvDKbp.js.map} +1 -1
- package/chunks/{bundle-uV_TEAvL.js → bundle-CDxHBrmg.js} +6 -6
- package/chunks/{bundle-uV_TEAvL.js.map → bundle-CDxHBrmg.js.map} +1 -1
- package/chunks/{bundle-19RRma1T.js → bundle-CNfgarJU.js} +10 -10
- package/chunks/{bundle-19RRma1T.js.map → bundle-CNfgarJU.js.map} +1 -1
- package/chunks/{bundle-Dokasjr1.js → bundle-CQY1Vhgt.js} +1 -1
- package/chunks/bundle-CQY1Vhgt.js.map +1 -0
- package/chunks/{bundle-CAJl5N4R.js → bundle-CQmP70o-.js} +4 -4
- package/chunks/bundle-CQmP70o-.js.map +1 -0
- package/chunks/{bundle-BEAKdhJw.js → bundle-CTtRmLaQ.js} +1 -1
- package/chunks/bundle-CTtRmLaQ.js.map +1 -0
- package/chunks/{bundle-DytwP8RF.js → bundle-CUG8aQUl.js} +7 -7
- package/chunks/{bundle-DytwP8RF.js.map → bundle-CUG8aQUl.js.map} +1 -1
- package/chunks/{bundle-CddXYET0.js → bundle-CcE78WZ0.js} +5 -5
- package/chunks/{bundle-CddXYET0.js.map → bundle-CcE78WZ0.js.map} +1 -1
- package/chunks/{bundle-CSJ53xaT.js → bundle-CdILp5Ht.js} +465 -392
- package/chunks/bundle-CdILp5Ht.js.map +1 -0
- package/chunks/{bundle-3w_Dk0EP.js → bundle-CjtOeKDH.js} +2 -2
- package/chunks/bundle-CjtOeKDH.js.map +1 -0
- package/chunks/{bundle-UWwF1Hyj.js → bundle-CkN5BpDO.js} +12 -12
- package/chunks/bundle-CkN5BpDO.js.map +1 -0
- package/chunks/{bundle-DD67EHrK.js → bundle-ClP2v0RX.js} +3 -3
- package/chunks/bundle-ClP2v0RX.js.map +1 -0
- package/chunks/{bundle-D90Dai1z.js → bundle-CmEWKIf3.js} +3 -3
- package/chunks/bundle-CmEWKIf3.js.map +1 -0
- package/chunks/{bundle-CekAYJN_.js → bundle-CoqWx1L6.js} +3 -3
- package/chunks/bundle-CoqWx1L6.js.map +1 -0
- package/chunks/{bundle-CieSinpC.js → bundle-Cs7mmSeL.js} +5 -5
- package/chunks/bundle-Cs7mmSeL.js.map +1 -0
- package/chunks/{bundle-DzoOdl4j.js → bundle-CvXosgMy.js} +6 -6
- package/chunks/bundle-CvXosgMy.js.map +1 -0
- package/chunks/{bundle-6PF_dVw5.js → bundle-CwFhwvI0.js} +7 -7
- package/chunks/{bundle-6PF_dVw5.js.map → bundle-CwFhwvI0.js.map} +1 -1
- package/chunks/{bundle-BVUryxPg.js → bundle-Cx0ij_p6.js} +2 -2
- package/chunks/{bundle-BVUryxPg.js.map → bundle-Cx0ij_p6.js.map} +1 -1
- package/chunks/{bundle-ClNB_q5u.js → bundle-Cx8h9ZUu.js} +1 -1
- package/chunks/bundle-Cx8h9ZUu.js.map +1 -0
- package/chunks/{bundle-DYGSQKvt.js → bundle-CxvcwY-S.js} +2 -2
- package/chunks/bundle-CxvcwY-S.js.map +1 -0
- package/chunks/{bundle-OVaef-VB.js → bundle-D4Qx18jn.js} +9 -9
- package/chunks/bundle-D4Qx18jn.js.map +1 -0
- package/chunks/{bundle-NfL9hHdo.js → bundle-D6fvLhSj.js} +1 -1
- package/chunks/bundle-D6fvLhSj.js.map +1 -0
- package/chunks/{bundle-C5UyLngq.js → bundle-D7cX9Fjm.js} +4 -4
- package/chunks/bundle-D7cX9Fjm.js.map +1 -0
- package/chunks/{bundle-Dr92I1-B.js → bundle-D9ylcucS.js} +1 -1
- package/chunks/bundle-D9ylcucS.js.map +1 -0
- package/chunks/{bundle-DPMmCwJa.js → bundle-DCmMZLn8.js} +4 -4
- package/chunks/bundle-DCmMZLn8.js.map +1 -0
- package/chunks/{bundle-DyJdx5kB.js → bundle-DFYOnVXR.js} +1 -1
- package/chunks/bundle-DFYOnVXR.js.map +1 -0
- package/chunks/{bundle-C7tB0Kjq.js → bundle-DFoa4qG2.js} +12 -12
- package/chunks/{bundle-C7tB0Kjq.js.map → bundle-DFoa4qG2.js.map} +1 -1
- package/chunks/{bundle-Cs90CrUq.js → bundle-DKW7_WWj.js} +8 -8
- package/chunks/bundle-DKW7_WWj.js.map +1 -0
- package/chunks/{bundle-BodstWU6.js → bundle-DLBFowSs.js} +4 -4
- package/chunks/{bundle-BodstWU6.js.map → bundle-DLBFowSs.js.map} +1 -1
- package/chunks/{bundle-C_glFM4Z.js → bundle-DLOgtfcc.js} +9 -9
- package/chunks/{bundle-C_glFM4Z.js.map → bundle-DLOgtfcc.js.map} +1 -1
- package/chunks/{bundle-C0VuTt3c.js → bundle-DMq4hDJ1.js} +6 -6
- package/chunks/bundle-DMq4hDJ1.js.map +1 -0
- package/chunks/{bundle-FqbH02lt.js → bundle-DOwPISeS.js} +1 -1
- package/chunks/bundle-DOwPISeS.js.map +1 -0
- package/chunks/{bundle-DTtdpBmF.js → bundle-DQI9pg8J.js} +8 -8
- package/chunks/bundle-DQI9pg8J.js.map +1 -0
- package/chunks/{bundle-DrPUrygn.js → bundle-DYBstvIJ.js} +2 -2
- package/chunks/{bundle-DrPUrygn.js.map → bundle-DYBstvIJ.js.map} +1 -1
- package/chunks/{bundle-Bo4ebSiS.js → bundle-DZz3KH2o.js} +12 -12
- package/chunks/{bundle-Bo4ebSiS.js.map → bundle-DZz3KH2o.js.map} +1 -1
- package/chunks/{bundle-BSNODDBN.js → bundle-D_w8WEfL.js} +2 -2
- package/chunks/bundle-D_w8WEfL.js.map +1 -0
- package/chunks/{bundle-2DKN7_KU.js → bundle-DcJrfmnR.js} +1 -1
- package/chunks/bundle-DcJrfmnR.js.map +1 -0
- package/chunks/{bundle-DgT_60cR.js → bundle-DgySHYkz.js} +1 -1
- package/chunks/bundle-DgySHYkz.js.map +1 -0
- package/chunks/{bundle-CMa_LzhI.js → bundle-DjDbKets.js} +4 -4
- package/chunks/bundle-DjDbKets.js.map +1 -0
- package/chunks/{bundle-K9rk8Bfi.js → bundle-DkDPgJrt.js} +8 -8
- package/chunks/bundle-DkDPgJrt.js.map +1 -0
- package/chunks/{bundle-BbdfL5hx.js → bundle-DkXJrVqz.js} +1 -1
- package/chunks/{bundle-BbdfL5hx.js.map → bundle-DkXJrVqz.js.map} +1 -1
- package/chunks/{bundle-Bx-11rmr.js → bundle-DnyHxqQ0.js} +1 -1
- package/chunks/bundle-DnyHxqQ0.js.map +1 -0
- package/chunks/{bundle-ahZJSNwR.js → bundle-Dpbh5U_k.js} +15 -15
- package/chunks/{bundle-ahZJSNwR.js.map → bundle-Dpbh5U_k.js.map} +1 -1
- package/chunks/{bundle-Q-b7_fsl.js → bundle-DrsCAuld.js} +7 -7
- package/chunks/bundle-DrsCAuld.js.map +1 -0
- package/chunks/{bundle-CKfMCXxd.js → bundle-DuxNodq3.js} +12 -12
- package/chunks/{bundle-CKfMCXxd.js.map → bundle-DuxNodq3.js.map} +1 -1
- package/chunks/{bundle-i3mSZHsu.js → bundle-Dxu9l-xP.js} +4 -4
- package/chunks/{bundle-i3mSZHsu.js.map → bundle-Dxu9l-xP.js.map} +1 -1
- package/chunks/{bundle-DuSlvN3-.js → bundle-Eoom7SNM.js} +1 -1
- package/chunks/{bundle-DuSlvN3-.js.map → bundle-Eoom7SNM.js.map} +1 -1
- package/chunks/{bundle-Be1fe9ZF.js → bundle-KRH4HO2b.js} +1 -1
- package/chunks/bundle-KRH4HO2b.js.map +1 -0
- package/chunks/{bundle-B_wXyf2_.js → bundle-MU-n4WB7.js} +4 -4
- package/chunks/bundle-MU-n4WB7.js.map +1 -0
- package/chunks/{bundle-29anv6Qs.js → bundle-T8eF3MdZ.js} +1 -1
- package/chunks/bundle-T8eF3MdZ.js.map +1 -0
- package/chunks/{bundle-BrjY7wQc.js → bundle-Wf7fEqRo.js} +2 -2
- package/chunks/{bundle-BrjY7wQc.js.map → bundle-Wf7fEqRo.js.map} +1 -1
- package/chunks/{bundle-B14ovUBm.js → bundle-XT9o5ifH.js} +33 -33
- package/chunks/{bundle-B14ovUBm.js.map → bundle-XT9o5ifH.js.map} +1 -1
- package/chunks/{bundle-BkjPzgla.js → bundle-ZNC8CUp_.js} +1 -1
- package/chunks/bundle-ZNC8CUp_.js.map +1 -0
- package/chunks/{bundle-CUOEzxFF.js → bundle-_QhzybuL.js} +1 -1
- package/chunks/bundle-_QhzybuL.js.map +1 -0
- package/chunks/{bundle-DrefLz0G.js → bundle-bKvynVo7.js} +1 -1
- package/chunks/{bundle-DrefLz0G.js.map → bundle-bKvynVo7.js.map} +1 -1
- package/chunks/{bundle-9MYFaUTM.js → bundle-bk-seQq_.js} +11 -11
- package/chunks/{bundle-9MYFaUTM.js.map → bundle-bk-seQq_.js.map} +1 -1
- package/chunks/{bundle-lzpjHgR_.js → bundle-jH_7tVuA.js} +5 -5
- package/chunks/{bundle-lzpjHgR_.js.map → bundle-jH_7tVuA.js.map} +1 -1
- package/chunks/{bundle-CyyqWqaj.js → bundle-nHCcLxQh.js} +7 -7
- package/chunks/bundle-nHCcLxQh.js.map +1 -0
- package/chunks/{bundle-D-UKgtlz.js → bundle-paE3yw-E.js} +1 -1
- package/chunks/bundle-paE3yw-E.js.map +1 -0
- package/chunks/{bundle-pOfT343E.js → bundle-tjmSjVLm.js} +4 -4
- package/chunks/bundle-tjmSjVLm.js.map +1 -0
- package/chunks/{bundle-DA4za5Rj.js → bundle-w0Ht9vHs.js} +4 -4
- package/chunks/bundle-w0Ht9vHs.js.map +1 -0
- package/chunks/{bundle-BcieCrHN.js → bundle-x_BFBJ3V.js} +3 -3
- package/chunks/bundle-x_BFBJ3V.js.map +1 -0
- package/chunks/{bundle-Bz9CQOX4.js → bundle-xdBGfpYx.js} +7 -7
- package/chunks/{bundle-Bz9CQOX4.js.map → bundle-xdBGfpYx.js.map} +1 -1
- package/cjs/App.js +88 -88
- package/cjs/Channel/components/ChannelHeader.js +32 -32
- package/cjs/Channel/components/ChannelUI.js +67 -67
- package/cjs/Channel/components/FileViewer.js +30 -30
- package/cjs/Channel/components/FrozenNotification.js +6 -6
- package/cjs/Channel/components/Message.js +56 -56
- package/cjs/Channel/components/MessageInput.js +43 -43
- package/cjs/Channel/components/MessageInputWrapper.js +43 -43
- package/cjs/Channel/components/MessageList.js +60 -60
- package/cjs/Channel/components/RemoveMessageModal.js +29 -29
- package/cjs/Channel/components/SuggestedMentionList.js +29 -29
- package/cjs/Channel/components/TypingIndicator.js +9 -9
- package/cjs/Channel/components/UnreadCount.js +8 -8
- package/cjs/Channel/context.js +23 -23
- package/cjs/Channel/hooks/useHandleUploadFiles.js +18 -18
- package/cjs/Channel/hooks/useInitialMessagesFetch.js +8 -8
- package/cjs/Channel/utils/compareMessagesForGrouping.js +8 -8
- package/cjs/Channel/utils/getMessagePartsInfo.js +9 -9
- package/cjs/Channel.js +67 -67
- package/cjs/ChannelList/components/AddChannel.js +88 -88
- package/cjs/ChannelList/components/ChannelListHeader.js +13 -13
- package/cjs/ChannelList/components/ChannelListUI.js +88 -88
- package/cjs/ChannelList/components/ChannelPreview.js +32 -32
- package/cjs/ChannelList/components/ChannelPreviewAction.js +17 -17
- package/cjs/ChannelList/context.js +14 -14
- package/cjs/ChannelList.js +88 -88
- package/cjs/ChannelSettings/components/ChannelProfile.js +23 -23
- package/cjs/ChannelSettings/components/ChannelSettingMenuList.js +14 -14
- package/cjs/ChannelSettings/components/ChannelSettingsHeader.js +11 -11
- package/cjs/ChannelSettings/components/ChannelSettingsMenuItem.js +2 -2
- package/cjs/ChannelSettings/components/ChannelSettingsUI.js +31 -31
- package/cjs/ChannelSettings/components/EditDetailsModal.js +19 -19
- package/cjs/ChannelSettings/components/LeaveChannel.js +20 -20
- package/cjs/ChannelSettings/components/ModerationPanel.js +29 -29
- package/cjs/ChannelSettings/components/UserListItem.js +19 -19
- package/cjs/ChannelSettings/components/UserPanel.js +28 -28
- package/cjs/ChannelSettings/context.js +9 -9
- package/cjs/ChannelSettings/hooks/useMenuList.js +29 -29
- package/cjs/ChannelSettings.js +31 -31
- package/cjs/CreateChannel/components/CreateChannelUI.js +88 -88
- package/cjs/CreateChannel/components/InviteUsers.js +88 -88
- package/cjs/CreateChannel/components/SelectChannelType.js +88 -88
- package/cjs/CreateChannel/context.js +88 -88
- package/cjs/CreateChannel.js +88 -88
- package/cjs/CreateOpenChannel/components/CreateOpenChannelUI.js +15 -15
- package/cjs/CreateOpenChannel/context.js +4 -4
- package/cjs/CreateOpenChannel.js +15 -15
- package/cjs/EditUserProfile/components/EditUserProfileUI.js +15 -15
- package/cjs/EditUserProfile/context.js +1 -1
- package/cjs/EditUserProfile.js +15 -15
- package/cjs/GroupChannel/components/FileViewer.js +28 -28
- package/cjs/GroupChannel/components/FrozenNotification.js +6 -6
- package/cjs/GroupChannel/components/GroupChannelHeader.js +29 -29
- package/cjs/GroupChannel/components/GroupChannelUI.js +63 -63
- package/cjs/GroupChannel/components/Message.js +54 -54
- package/cjs/GroupChannel/components/MessageInputWrapper.js +40 -40
- package/cjs/GroupChannel/components/MessageList.js +56 -56
- package/cjs/GroupChannel/components/RemoveMessageModal.js +27 -27
- package/cjs/GroupChannel/components/SuggestedMentionList.js +15 -15
- package/cjs/GroupChannel/components/TypingIndicator.js +9 -9
- package/cjs/GroupChannel/components/UnreadCount.js +8 -8
- package/cjs/GroupChannel/context.js +15 -15
- package/cjs/GroupChannel.js +63 -63
- package/cjs/GroupChannelList/components/AddGroupChannel.js +88 -88
- package/cjs/GroupChannelList/components/GroupChannelListHeader.js +13 -13
- package/cjs/GroupChannelList/components/GroupChannelListItem.js +32 -32
- package/cjs/GroupChannelList/components/GroupChannelListUI.js +88 -88
- package/cjs/GroupChannelList/components/GroupChannelPreviewAction.js +17 -17
- package/cjs/GroupChannelList/context.js +10 -10
- package/cjs/GroupChannelList.js +88 -88
- package/cjs/MessageSearch/components/MessageSearchUI.js +20 -20
- package/cjs/MessageSearch/context.js +6 -6
- package/cjs/MessageSearch.js +22 -22
- package/cjs/OpenChannel/components/FrozenChannelNotification.js +5 -5
- package/cjs/OpenChannel/components/OpenChannelHeader.js +20 -20
- package/cjs/OpenChannel/components/OpenChannelInput.js +29 -29
- package/cjs/OpenChannel/components/OpenChannelMessage.js +39 -39
- package/cjs/OpenChannel/components/OpenChannelMessageList.js +43 -43
- package/cjs/OpenChannel/components/OpenChannelUI.js +43 -43
- package/cjs/OpenChannel/context.js +19 -19
- package/cjs/OpenChannel.js +43 -43
- package/cjs/OpenChannelList/components/OpenChannelListUI.js +17 -17
- package/cjs/OpenChannelList/components/OpenChannelPreview.js +6 -6
- package/cjs/OpenChannelList/context.js +6 -6
- package/cjs/OpenChannelList.js +17 -17
- package/cjs/OpenChannelSettings/components/EditDetailsModal.js +18 -18
- package/cjs/OpenChannelSettings/components/OpenChannelProfile.js +18 -18
- package/cjs/OpenChannelSettings/components/OpenChannelSettingsUI.js +24 -24
- package/cjs/OpenChannelSettings/components/OperatorUI.js +24 -24
- package/cjs/OpenChannelSettings/components/ParticipantUI.js +22 -22
- package/cjs/OpenChannelSettings/context.js +6 -6
- package/cjs/OpenChannelSettings.js +24 -24
- package/cjs/SendbirdProvider.js +23 -23
- package/cjs/Thread/components/ParentMessageInfo.js +49 -49
- package/cjs/Thread/components/ParentMessageInfoItem.js +34 -34
- package/cjs/Thread/components/ThreadHeader.js +8 -8
- package/cjs/Thread/components/ThreadList.js +56 -56
- package/cjs/Thread/components/ThreadListItem.js +56 -56
- package/cjs/Thread/components/ThreadMessageInput.js +46 -46
- package/cjs/Thread/components/ThreadUI.js +62 -62
- package/cjs/Thread/context.js +15 -15
- package/cjs/Thread.js +62 -62
- package/cjs/VoicePlayer/context.js +6 -6
- package/cjs/VoicePlayer/useVoicePlayer.js +14 -14
- package/cjs/VoiceRecorder/context.js +13 -13
- package/cjs/VoiceRecorder/useVoiceRecorder.js +12 -12
- package/cjs/chunks/{bundle-DDPA24Ym.js → bundle-4KV6_8wa.js} +1 -1
- package/cjs/chunks/bundle-4KV6_8wa.js.map +1 -0
- package/cjs/chunks/{bundle-BijTJ0c2.js → bundle-5zygIx0U.js} +7 -7
- package/cjs/chunks/bundle-5zygIx0U.js.map +1 -0
- package/cjs/chunks/{bundle-Be5cYG-8.js → bundle-71dqgbWK.js} +1 -1
- package/cjs/chunks/bundle-71dqgbWK.js.map +1 -0
- package/cjs/chunks/{bundle-BtJsON3R.js → bundle-8acuAHPD.js} +1 -1
- package/cjs/chunks/bundle-8acuAHPD.js.map +1 -0
- package/cjs/chunks/{bundle-D8mb9MKq.js → bundle-93bWzNKo.js} +7 -7
- package/cjs/chunks/{bundle-D8mb9MKq.js.map → bundle-93bWzNKo.js.map} +1 -1
- package/cjs/chunks/{bundle-CATF4h3Q.js → bundle-9YGI1VxU.js} +4 -4
- package/cjs/chunks/bundle-9YGI1VxU.js.map +1 -0
- package/cjs/chunks/{bundle-BmhAGvYn.js → bundle-9Zp-yHMR.js} +6 -6
- package/cjs/chunks/bundle-9Zp-yHMR.js.map +1 -0
- package/cjs/chunks/{bundle-By9bOgFx.js → bundle-B1DjOWvS.js} +11 -11
- package/cjs/chunks/{bundle-By9bOgFx.js.map → bundle-B1DjOWvS.js.map} +1 -1
- package/cjs/chunks/{bundle-BWWIsE09.js → bundle-B1baPRRe.js} +4 -4
- package/cjs/chunks/bundle-B1baPRRe.js.map +1 -0
- package/cjs/chunks/{bundle-DXcy9R4M.js → bundle-B8JKZQ6b.js} +1 -1
- package/cjs/chunks/{bundle-DXcy9R4M.js.map → bundle-B8JKZQ6b.js.map} +1 -1
- package/cjs/chunks/{bundle-KpCtn3E5.js → bundle-BB7JE5l0.js} +1 -1
- package/cjs/chunks/bundle-BB7JE5l0.js.map +1 -0
- package/cjs/chunks/{bundle-C3Wsgq6X.js → bundle-BDeo4Lwx.js} +2 -2
- package/cjs/chunks/{bundle-C3Wsgq6X.js.map → bundle-BDeo4Lwx.js.map} +1 -1
- package/cjs/chunks/{bundle-CjxRN7kP.js → bundle-BE0tBkIE.js} +1 -1
- package/cjs/chunks/{bundle-CjxRN7kP.js.map → bundle-BE0tBkIE.js.map} +1 -1
- package/cjs/chunks/{bundle-CzQWSkYD.js → bundle-BE91vSly.js} +1 -1
- package/cjs/chunks/bundle-BE91vSly.js.map +1 -0
- package/cjs/chunks/{bundle-C7NIZXsi.js → bundle-BISpveo1.js} +5 -5
- package/cjs/chunks/{bundle-C7NIZXsi.js.map → bundle-BISpveo1.js.map} +1 -1
- package/cjs/chunks/{bundle-B7aEyxDJ.js → bundle-BJWbfoHg.js} +2 -2
- package/cjs/chunks/bundle-BJWbfoHg.js.map +1 -0
- package/cjs/chunks/{bundle-ya6_vMhO.js → bundle-BSB0IxBQ.js} +1 -1
- package/cjs/chunks/bundle-BSB0IxBQ.js.map +1 -0
- package/cjs/chunks/{bundle-Dr-ZZhAr.js → bundle-BT-tqAqU.js} +3 -3
- package/cjs/chunks/{bundle-Dr-ZZhAr.js.map → bundle-BT-tqAqU.js.map} +1 -1
- package/cjs/chunks/{bundle-DA3KLmoV.js → bundle-BVKENLWb.js} +12 -12
- package/cjs/chunks/{bundle-DA3KLmoV.js.map → bundle-BVKENLWb.js.map} +1 -1
- package/cjs/chunks/{bundle-D83t7kQt.js → bundle-BWY5IXv2.js} +1 -1
- package/cjs/chunks/bundle-BWY5IXv2.js.map +1 -0
- package/cjs/chunks/{bundle-CtcrPWbo.js → bundle-BWd9-rRw.js} +1 -1
- package/cjs/chunks/bundle-BWd9-rRw.js.map +1 -0
- package/cjs/chunks/{bundle-B5DImaot.js → bundle-BXOwJFmM.js} +8 -8
- package/cjs/chunks/bundle-BXOwJFmM.js.map +1 -0
- package/cjs/chunks/{bundle-p5AMM6bU.js → bundle-BYpTrdEd.js} +5 -5
- package/cjs/chunks/{bundle-p5AMM6bU.js.map → bundle-BYpTrdEd.js.map} +1 -1
- package/cjs/chunks/{bundle-Ct_lW8hI.js → bundle-BZWQ1NTC.js} +14 -14
- package/cjs/chunks/bundle-BZWQ1NTC.js.map +1 -0
- package/cjs/chunks/{bundle-CgxoBZ0q.js → bundle-Bcubj7Gw.js} +8 -8
- package/cjs/chunks/bundle-Bcubj7Gw.js.map +1 -0
- package/cjs/chunks/{bundle-tKhabQAd.js → bundle-Bl0gl4VD.js} +4 -4
- package/cjs/chunks/bundle-Bl0gl4VD.js.map +1 -0
- package/cjs/chunks/{bundle-D8786bwt.js → bundle-BlVuZEFn.js} +4 -4
- package/cjs/chunks/bundle-BlVuZEFn.js.map +1 -0
- package/cjs/chunks/{bundle-JUvZGt3Q.js → bundle-Btaa15jO.js} +1 -1
- package/cjs/chunks/bundle-Btaa15jO.js.map +1 -0
- package/cjs/chunks/{bundle-Iem46lqC.js → bundle-BzwktTo_.js} +4 -4
- package/cjs/chunks/bundle-BzwktTo_.js.map +1 -0
- package/cjs/chunks/{bundle-DSRFKM2R.js → bundle-BzxkBOcv.js} +1 -1
- package/cjs/chunks/bundle-BzxkBOcv.js.map +1 -0
- package/cjs/chunks/{bundle-B0xh7srZ.js → bundle-C-c3245O.js} +1 -1
- package/cjs/chunks/bundle-C-c3245O.js.map +1 -0
- package/cjs/chunks/{bundle-Cqyxf0LC.js → bundle-C1QA55RE.js} +3 -3
- package/cjs/chunks/bundle-C1QA55RE.js.map +1 -0
- package/cjs/chunks/{bundle-C4xLg4S4.js → bundle-C8fqEvFP.js} +1 -1
- package/cjs/chunks/bundle-C8fqEvFP.js.map +1 -0
- package/cjs/chunks/{bundle-Bkuc5bwC.js → bundle-CAcwnk2Q.js} +7 -7
- package/cjs/chunks/bundle-CAcwnk2Q.js.map +1 -0
- package/cjs/chunks/{bundle-Byf3JHBz.js → bundle-CBwYCeZb.js} +1 -1
- package/cjs/chunks/{bundle-Byf3JHBz.js.map → bundle-CBwYCeZb.js.map} +1 -1
- package/cjs/chunks/{bundle-C5ckuHVD.js → bundle-CHXOpzUL.js} +10 -10
- package/cjs/chunks/bundle-CHXOpzUL.js.map +1 -0
- package/cjs/chunks/{bundle-VtTkC7o3.js → bundle-CPZpGOT4.js} +4 -4
- package/cjs/chunks/{bundle-VtTkC7o3.js.map → bundle-CPZpGOT4.js.map} +1 -1
- package/cjs/chunks/{bundle-DphM1mNA.js → bundle-CSBpiQKa.js} +1 -1
- package/cjs/chunks/bundle-CSBpiQKa.js.map +1 -0
- package/cjs/chunks/{bundle-l-Hf-1I0.js → bundle-CToE0GyB.js} +12 -12
- package/cjs/chunks/{bundle-l-Hf-1I0.js.map → bundle-CToE0GyB.js.map} +1 -1
- package/cjs/chunks/{bundle-CWTqtnQO.js → bundle-CUl9TucN.js} +1 -1
- package/cjs/chunks/bundle-CUl9TucN.js.map +1 -0
- package/cjs/chunks/{bundle-CDhba0Ik.js → bundle-CXy_f9TW.js} +1 -1
- package/cjs/chunks/bundle-CXy_f9TW.js.map +1 -0
- package/cjs/chunks/{bundle-Dv7MCQ5s.js → bundle-CYQ8PYWj.js} +3 -3
- package/cjs/chunks/bundle-CYQ8PYWj.js.map +1 -0
- package/cjs/chunks/{bundle-BqhdTNA2.js → bundle-CZjDXe9_.js} +4 -4
- package/cjs/chunks/bundle-CZjDXe9_.js.map +1 -0
- package/cjs/chunks/{bundle-wHImRt4w.js → bundle-CdFtSIKT.js} +12 -12
- package/cjs/chunks/bundle-CdFtSIKT.js.map +1 -0
- package/cjs/chunks/{bundle-BuqLUmbr.js → bundle-Ce65LzvC.js} +10 -10
- package/cjs/chunks/{bundle-BuqLUmbr.js.map → bundle-Ce65LzvC.js.map} +1 -1
- package/cjs/chunks/{bundle-D_w5bnPd.js → bundle-CnSWKGc4.js} +4 -4
- package/cjs/chunks/bundle-CnSWKGc4.js.map +1 -0
- package/cjs/chunks/{bundle-CoLGyVM7.js → bundle-ConY3ho5.js} +1 -1
- package/cjs/chunks/bundle-ConY3ho5.js.map +1 -0
- package/cjs/chunks/{bundle-EaE84c1u.js → bundle-D0jB-ZsW.js} +1 -1
- package/cjs/chunks/bundle-D0jB-ZsW.js.map +1 -0
- package/cjs/chunks/{bundle-C3rM3Ztv.js → bundle-D1gn3U0O.js} +7 -7
- package/cjs/chunks/bundle-D1gn3U0O.js.map +1 -0
- package/cjs/chunks/{bundle-Wz8wcC8J.js → bundle-D4UzJ-7q.js} +2 -2
- package/cjs/chunks/bundle-D4UzJ-7q.js.map +1 -0
- package/cjs/chunks/{bundle-CHbACwVy.js → bundle-DECaw4lg.js} +1 -1
- package/cjs/chunks/bundle-DECaw4lg.js.map +1 -0
- package/cjs/chunks/{bundle-CsYWZ0_f.js → bundle-DEL52Z11.js} +33 -33
- package/cjs/chunks/{bundle-CsYWZ0_f.js.map → bundle-DEL52Z11.js.map} +1 -1
- package/cjs/chunks/{bundle-CXS1Xff3.js → bundle-DHK1ET58.js} +6 -6
- package/cjs/chunks/bundle-DHK1ET58.js.map +1 -0
- package/cjs/chunks/{bundle-BLSItw7_.js → bundle-DMeIUsXL.js} +1 -1
- package/cjs/chunks/bundle-DMeIUsXL.js.map +1 -0
- package/cjs/chunks/{bundle-B4NcyELU.js → bundle-DOEBAaWF.js} +14 -14
- package/cjs/chunks/{bundle-B4NcyELU.js.map → bundle-DOEBAaWF.js.map} +1 -1
- package/cjs/chunks/{bundle-CroWYp-8.js → bundle-DOuI16f9.js} +8 -8
- package/cjs/chunks/{bundle-CroWYp-8.js.map → bundle-DOuI16f9.js.map} +1 -1
- package/cjs/chunks/{bundle-CmAcdA9c.js → bundle-DP2LknUT.js} +1 -1
- package/cjs/chunks/bundle-DP2LknUT.js.map +1 -0
- package/cjs/chunks/{bundle-DCtoNM-7.js → bundle-DV03EViB.js} +2 -2
- package/cjs/chunks/bundle-DV03EViB.js.map +1 -0
- package/cjs/chunks/{bundle-jK41VUwI.js → bundle-DWfLEP_0.js} +2 -2
- package/cjs/chunks/{bundle-jK41VUwI.js.map → bundle-DWfLEP_0.js.map} +1 -1
- package/cjs/chunks/{bundle-COpa1hF1.js → bundle-DdnCy8Je.js} +6 -6
- package/cjs/chunks/{bundle-COpa1hF1.js.map → bundle-DdnCy8Je.js.map} +1 -1
- package/cjs/chunks/{bundle-BLORPb9I.js → bundle-DhNJkytP.js} +1 -1
- package/cjs/chunks/bundle-DhNJkytP.js.map +1 -0
- package/cjs/chunks/{bundle-DJsZItzb.js → bundle-DhWVYFSK.js} +4 -4
- package/cjs/chunks/bundle-DhWVYFSK.js.map +1 -0
- package/cjs/chunks/{bundle-C_bbb-dp.js → bundle-DmRLBKRr.js} +3 -3
- package/cjs/chunks/bundle-DmRLBKRr.js.map +1 -0
- package/cjs/chunks/{bundle-CWWDc-jq.js → bundle-DmhwxDam.js} +3 -3
- package/cjs/chunks/bundle-DmhwxDam.js.map +1 -0
- package/cjs/chunks/{bundle-bbeoas0y.js → bundle-DnDLZR4B.js} +3 -3
- package/cjs/chunks/{bundle-bbeoas0y.js.map → bundle-DnDLZR4B.js.map} +1 -1
- package/cjs/chunks/{bundle-D4ttYKan.js → bundle-DrnK8T0C.js} +12 -12
- package/cjs/chunks/{bundle-D4ttYKan.js.map → bundle-DrnK8T0C.js.map} +1 -1
- package/cjs/chunks/{bundle-BmW2Yn3Q.js → bundle-DsFHmqiX.js} +15 -15
- package/cjs/chunks/{bundle-BmW2Yn3Q.js.map → bundle-DsFHmqiX.js.map} +1 -1
- package/cjs/chunks/{bundle-48-ANevp.js → bundle-Dy1QxkVu.js} +465 -392
- package/cjs/chunks/bundle-Dy1QxkVu.js.map +1 -0
- package/cjs/chunks/{bundle-BJXK4UV6.js → bundle-DzHIrb6T.js} +3 -3
- package/cjs/chunks/{bundle-BJXK4UV6.js.map → bundle-DzHIrb6T.js.map} +1 -1
- package/cjs/chunks/{bundle-Sibh5a_G.js → bundle-JJrresQy.js} +4 -4
- package/cjs/chunks/bundle-JJrresQy.js.map +1 -0
- package/cjs/chunks/{bundle-DgQ9fMEI.js → bundle-MlGqIlFr.js} +1 -1
- package/cjs/chunks/bundle-MlGqIlFr.js.map +1 -0
- package/cjs/chunks/{bundle-IKpW2l2j.js → bundle-O_B1b_E5.js} +7 -7
- package/cjs/chunks/bundle-O_B1b_E5.js.map +1 -0
- package/cjs/chunks/{bundle-Dd5sHG-K.js → bundle-PLOfmvPv.js} +2 -2
- package/cjs/chunks/bundle-PLOfmvPv.js.map +1 -0
- package/cjs/chunks/{bundle-u7llDhg-.js → bundle-Q5vg6IPH.js} +1 -1
- package/cjs/chunks/bundle-Q5vg6IPH.js.map +1 -0
- package/cjs/chunks/{bundle-DjML1ul2.js → bundle-QDr-C4Po.js} +1 -1
- package/cjs/chunks/bundle-QDr-C4Po.js.map +1 -0
- package/cjs/chunks/{bundle-BGJJ5sP3.js → bundle-QWl8QUDg.js} +12 -12
- package/cjs/chunks/{bundle-BGJJ5sP3.js.map → bundle-QWl8QUDg.js.map} +1 -1
- package/cjs/chunks/{bundle-CynaFF2G.js → bundle-S-xcssWx.js} +1 -1
- package/cjs/chunks/bundle-S-xcssWx.js.map +1 -0
- package/cjs/chunks/{bundle-DXwnWGR6.js → bundle-VmBxGdtN.js} +9 -9
- package/cjs/chunks/{bundle-DXwnWGR6.js.map → bundle-VmBxGdtN.js.map} +1 -1
- package/cjs/chunks/{bundle-B84lWsGH.js → bundle-XTL3uso6.js} +1 -1
- package/cjs/chunks/bundle-XTL3uso6.js.map +1 -0
- package/cjs/chunks/{bundle-WotxJ_Ab.js → bundle-_5GthuIG.js} +8 -8
- package/cjs/chunks/bundle-_5GthuIG.js.map +1 -0
- package/cjs/chunks/{bundle-BFyUna1U.js → bundle-edLI5BAx.js} +4 -4
- package/cjs/chunks/{bundle-BFyUna1U.js.map → bundle-edLI5BAx.js.map} +1 -1
- package/cjs/chunks/{bundle-COEM7gAr.js → bundle-fuib3cfF.js} +9 -9
- package/cjs/chunks/{bundle-COEM7gAr.js.map → bundle-fuib3cfF.js.map} +1 -1
- package/cjs/chunks/{bundle-Czozc_b7.js → bundle-jS-nlWKb.js} +5 -5
- package/cjs/chunks/{bundle-Czozc_b7.js.map → bundle-jS-nlWKb.js.map} +1 -1
- package/cjs/chunks/{bundle-Ddc4NjWH.js → bundle-l3NOX5JV.js} +1 -1
- package/cjs/chunks/bundle-l3NOX5JV.js.map +1 -0
- package/cjs/chunks/{bundle-CXN-DL6s.js → bundle-lMI-nvUj.js} +3 -3
- package/cjs/chunks/bundle-lMI-nvUj.js.map +1 -0
- package/cjs/chunks/{bundle-CT350f9x.js → bundle-mD8GLt1R.js} +5 -5
- package/cjs/chunks/bundle-mD8GLt1R.js.map +1 -0
- package/cjs/chunks/{bundle-ZS9cLNMS.js → bundle-qYRd0njx.js} +3 -3
- package/cjs/chunks/bundle-qYRd0njx.js.map +1 -0
- package/cjs/chunks/{bundle-0zoyDqJ2.js → bundle-qlSPX_jd.js} +5 -5
- package/cjs/chunks/{bundle-0zoyDqJ2.js.map → bundle-qlSPX_jd.js.map} +1 -1
- package/cjs/chunks/{bundle-BfLPNtFS.js → bundle-uvtr8RQn.js} +3 -3
- package/cjs/chunks/bundle-uvtr8RQn.js.map +1 -0
- package/cjs/chunks/{bundle-BIZUP_xN.js → bundle-x_V9zseQ.js} +2 -2
- package/cjs/chunks/bundle-x_V9zseQ.js.map +1 -0
- package/cjs/chunks/{bundle-B_kiHl24.js → bundle-yI1WWKuh.js} +4 -4
- package/cjs/chunks/bundle-yI1WWKuh.js.map +1 -0
- package/cjs/hooks/useConnectionState.js +5 -5
- package/cjs/hooks/useLocalization.js +4 -4
- package/cjs/hooks/useModal.js +13 -13
- package/cjs/index.js +89 -89
- 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 +5 -5
- package/cjs/ui/BottomSheet.js +13 -13
- package/cjs/ui/Button.js +3 -3
- package/cjs/ui/ChannelAvatar.js +5 -5
- package/cjs/ui/ConnectionStatus.js +6 -6
- package/cjs/ui/ContextMenu.js +14 -14
- package/cjs/ui/DateSeparator.js +4 -4
- package/cjs/ui/EmojiReactions.js +23 -23
- package/cjs/ui/FallbackTemplateMessageItemBody.tsx.js +10 -10
- package/cjs/ui/FileMessageItemBody.js +13 -13
- package/cjs/ui/FileViewer.js +19 -19
- 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 +2 -2
- 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 +19 -19
- package/cjs/ui/MentionUserLabel.js +2 -2
- package/cjs/ui/MessageContent.js +42 -42
- package/cjs/ui/MessageFeedbackFailedModal.js +13 -13
- package/cjs/ui/MessageFeedbackModal.js +13 -13
- package/cjs/ui/MessageInput/hooks/usePaste.js +7 -7
- package/cjs/ui/MessageInput.js +20 -20
- package/cjs/ui/MessageItemMenu.js +15 -15
- package/cjs/ui/MessageItemReactionMenu.js +16 -16
- package/cjs/ui/MessageMenu.js +16 -16
- package/cjs/ui/MessageSearchFileItem.js +17 -17
- package/cjs/ui/MessageSearchItem.js +12 -12
- package/cjs/ui/MessageStatus.js +15 -15
- package/cjs/ui/MessageTemplate.js +1 -1
- package/cjs/ui/MobileFeedbackMenu.js +13 -13
- package/cjs/ui/MobileMenu.js +18 -18
- package/cjs/ui/Modal.js +12 -12
- package/cjs/ui/MutedAvatarOverlay.js +2 -2
- package/cjs/ui/OGMessageItemBody.js +23 -23
- package/cjs/ui/OpenChannelAdminMessage.js +3 -3
- package/cjs/ui/OpenChannelAvatar.js +8 -8
- package/cjs/ui/OpenchannelConversationHeader.js +8 -8
- package/cjs/ui/OpenchannelFileMessage.js +24 -24
- package/cjs/ui/OpenchannelOGMessage.js +26 -26
- package/cjs/ui/OpenchannelThumbnailMessage.js +23 -23
- package/cjs/ui/OpenchannelUserMessage.js +24 -24
- package/cjs/ui/PlaceHolder.js +6 -6
- package/cjs/ui/PlaybackTime.js +3 -3
- package/cjs/ui/ProgressBar.js +1 -1
- package/cjs/ui/QuoteMessage.js +12 -12
- package/cjs/ui/QuoteMessageInput.js +12 -12
- 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 +14 -14
- package/cjs/ui/TextButton.js +2 -2
- package/cjs/ui/TextMessageItemBody.js +22 -22
- package/cjs/ui/ThreadReplies.js +8 -8
- package/cjs/ui/ThumbnailMessageItemBody.js +10 -10
- package/cjs/ui/Toggle.js +4 -4
- 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 +10 -10
- package/cjs/ui/UserListItem.js +19 -19
- package/cjs/ui/UserListItemMenu.js +16 -16
- package/cjs/ui/UserProfile.js +13 -13
- package/cjs/ui/VoiceMessageInput.js +9 -9
- package/cjs/ui/VoiceMessageItemBody.js +14 -14
- package/cjs/ui/Word.js +19 -19
- package/cjs/useSendbirdStateContext.js +4 -4
- package/cjs/utils/message/isVoiceMessage.js +6 -6
- package/cjs/withSendbird.js +23 -23
- package/dist/index.css +5 -19
- package/hooks/useConnectionState.js +5 -5
- package/hooks/useLocalization.js +4 -4
- package/hooks/useModal.js +14 -14
- package/index.js +89 -89
- package/package.json +4 -4
- package/pubSub/topics.js +1 -1
- package/sendbirdSelectors.js +2 -2
- 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 +5 -5
- package/ui/BottomSheet.js +13 -13
- package/ui/Button.js +3 -3
- package/ui/ChannelAvatar.js +5 -5
- package/ui/ConnectionStatus.js +6 -6
- package/ui/ContextMenu.js +14 -14
- package/ui/DateSeparator.js +4 -4
- package/ui/EmojiReactions.js +23 -23
- package/ui/FallbackTemplateMessageItemBody.tsx.js +10 -10
- package/ui/FileMessageItemBody.js +13 -13
- package/ui/FileViewer.js +19 -19
- package/ui/Header.js +6 -6
- package/ui/Icon.js +2 -2
- package/ui/IconButton.js +1 -1
- package/ui/ImageRenderer.js +2 -2
- 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 +19 -19
- package/ui/MentionUserLabel.js +2 -2
- package/ui/MessageContent.js +42 -42
- package/ui/MessageFeedbackFailedModal.js +13 -13
- package/ui/MessageFeedbackModal.js +13 -13
- package/ui/MessageInput/hooks/usePaste.js +7 -7
- package/ui/MessageInput.js +20 -20
- package/ui/MessageItemMenu.js +15 -15
- package/ui/MessageItemReactionMenu.js +16 -16
- package/ui/MessageMenu.js +16 -16
- package/ui/MessageSearchFileItem.js +17 -17
- package/ui/MessageSearchItem.js +12 -12
- package/ui/MessageStatus.js +15 -15
- package/ui/MessageTemplate.js +1 -1
- package/ui/MobileFeedbackMenu.js +13 -13
- package/ui/MobileMenu.js +18 -18
- package/ui/Modal.js +12 -12
- package/ui/MutedAvatarOverlay.js +2 -2
- package/ui/OGMessageItemBody.js +23 -23
- package/ui/OpenChannelAdminMessage.js +3 -3
- package/ui/OpenChannelAvatar.js +8 -8
- package/ui/OpenchannelConversationHeader.js +8 -8
- package/ui/OpenchannelFileMessage.js +24 -24
- package/ui/OpenchannelOGMessage.js +26 -26
- package/ui/OpenchannelThumbnailMessage.js +23 -23
- package/ui/OpenchannelUserMessage.js +24 -24
- package/ui/PlaceHolder.js +6 -6
- package/ui/PlaybackTime.js +3 -3
- package/ui/ProgressBar.js +1 -1
- package/ui/QuoteMessage.js +12 -12
- package/ui/QuoteMessageInput.js +12 -12
- package/ui/ReactionBadge.js +3 -3
- package/ui/ReactionButton.js +4 -4
- package/ui/SortByRow.js +2 -2
- package/ui/TemplateMessageItemBody.js +14 -14
- package/ui/TextButton.js +2 -2
- package/ui/TextMessageItemBody.js +22 -22
- package/ui/ThreadReplies.js +8 -8
- package/ui/ThumbnailMessageItemBody.js +10 -10
- package/ui/Toggle.js +4 -4
- package/ui/Tooltip.js +3 -3
- package/ui/TooltipWrapper.js +1 -1
- package/ui/TypingIndicatorBubble.js +4 -4
- package/ui/UnknownMessageItemBody.js +10 -10
- package/ui/UserListItem.js +19 -19
- package/ui/UserListItemMenu.js +17 -17
- package/ui/UserProfile.js +13 -13
- package/ui/VoiceMessageInput.js +9 -9
- package/ui/VoiceMessageItemBody.js +14 -14
- package/ui/Word.js +19 -19
- package/useSendbirdStateContext.js +4 -4
- package/utils/message/isVoiceMessage.js +6 -6
- package/withSendbird.js +23 -23
- package/chunks/bundle-29anv6Qs.js.map +0 -1
- package/chunks/bundle-2DKN7_KU.js.map +0 -1
- package/chunks/bundle-3w_Dk0EP.js.map +0 -1
- package/chunks/bundle-4D4_7cbS.js.map +0 -1
- package/chunks/bundle-B0UH4qgo.js.map +0 -1
- package/chunks/bundle-B7-mUZu7.js.map +0 -1
- package/chunks/bundle-BEAKdhJw.js.map +0 -1
- package/chunks/bundle-BOQAPdnF.js.map +0 -1
- package/chunks/bundle-BSNODDBN.js.map +0 -1
- package/chunks/bundle-B_wXyf2_.js.map +0 -1
- package/chunks/bundle-BcieCrHN.js.map +0 -1
- package/chunks/bundle-Be1fe9ZF.js.map +0 -1
- package/chunks/bundle-BkjPzgla.js.map +0 -1
- package/chunks/bundle-Bs0S8wQP.js.map +0 -1
- package/chunks/bundle-Bx-11rmr.js.map +0 -1
- package/chunks/bundle-C0VuTt3c.js.map +0 -1
- package/chunks/bundle-C5UyLngq.js.map +0 -1
- package/chunks/bundle-CAJl5N4R.js.map +0 -1
- package/chunks/bundle-CDV8AYgt.js.map +0 -1
- package/chunks/bundle-CLx3vwwI.js.map +0 -1
- package/chunks/bundle-CMa_LzhI.js.map +0 -1
- package/chunks/bundle-CSJ53xaT.js.map +0 -1
- package/chunks/bundle-CUOEzxFF.js.map +0 -1
- package/chunks/bundle-CekAYJN_.js.map +0 -1
- package/chunks/bundle-CieSinpC.js.map +0 -1
- package/chunks/bundle-ClNB_q5u.js.map +0 -1
- package/chunks/bundle-Cs90CrUq.js.map +0 -1
- package/chunks/bundle-CwfU7XnU.js.map +0 -1
- package/chunks/bundle-CyyqWqaj.js.map +0 -1
- package/chunks/bundle-D-UKgtlz.js.map +0 -1
- package/chunks/bundle-D90Dai1z.js.map +0 -1
- package/chunks/bundle-DA4za5Rj.js.map +0 -1
- package/chunks/bundle-DD67EHrK.js.map +0 -1
- package/chunks/bundle-DPMmCwJa.js.map +0 -1
- package/chunks/bundle-DTtdpBmF.js.map +0 -1
- package/chunks/bundle-DXIpH3W2.js.map +0 -1
- package/chunks/bundle-DYGSQKvt.js.map +0 -1
- package/chunks/bundle-DgT_60cR.js.map +0 -1
- package/chunks/bundle-Dokasjr1.js.map +0 -1
- package/chunks/bundle-Dr92I1-B.js.map +0 -1
- package/chunks/bundle-DyJdx5kB.js.map +0 -1
- package/chunks/bundle-DzoOdl4j.js.map +0 -1
- package/chunks/bundle-DzzUrNmL.js.map +0 -1
- package/chunks/bundle-FqbH02lt.js.map +0 -1
- package/chunks/bundle-K9rk8Bfi.js.map +0 -1
- package/chunks/bundle-NfL9hHdo.js.map +0 -1
- package/chunks/bundle-OVaef-VB.js.map +0 -1
- package/chunks/bundle-Q-b7_fsl.js.map +0 -1
- package/chunks/bundle-QZcjovdG.js.map +0 -1
- package/chunks/bundle-UWwF1Hyj.js.map +0 -1
- package/chunks/bundle-pOfT343E.js.map +0 -1
- package/chunks/bundle-sRAn8KYg.js.map +0 -1
- package/cjs/chunks/bundle-48-ANevp.js.map +0 -1
- package/cjs/chunks/bundle-B0xh7srZ.js.map +0 -1
- package/cjs/chunks/bundle-B5DImaot.js.map +0 -1
- package/cjs/chunks/bundle-B7aEyxDJ.js.map +0 -1
- package/cjs/chunks/bundle-B84lWsGH.js.map +0 -1
- package/cjs/chunks/bundle-BIZUP_xN.js.map +0 -1
- package/cjs/chunks/bundle-BLORPb9I.js.map +0 -1
- package/cjs/chunks/bundle-BLSItw7_.js.map +0 -1
- package/cjs/chunks/bundle-BWWIsE09.js.map +0 -1
- package/cjs/chunks/bundle-B_kiHl24.js.map +0 -1
- package/cjs/chunks/bundle-Be5cYG-8.js.map +0 -1
- package/cjs/chunks/bundle-BfLPNtFS.js.map +0 -1
- package/cjs/chunks/bundle-BijTJ0c2.js.map +0 -1
- package/cjs/chunks/bundle-Bkuc5bwC.js.map +0 -1
- package/cjs/chunks/bundle-BmhAGvYn.js.map +0 -1
- package/cjs/chunks/bundle-BqhdTNA2.js.map +0 -1
- package/cjs/chunks/bundle-BtJsON3R.js.map +0 -1
- package/cjs/chunks/bundle-C3rM3Ztv.js.map +0 -1
- package/cjs/chunks/bundle-C4xLg4S4.js.map +0 -1
- package/cjs/chunks/bundle-C5ckuHVD.js.map +0 -1
- package/cjs/chunks/bundle-CATF4h3Q.js.map +0 -1
- package/cjs/chunks/bundle-CDhba0Ik.js.map +0 -1
- package/cjs/chunks/bundle-CHbACwVy.js.map +0 -1
- package/cjs/chunks/bundle-CT350f9x.js.map +0 -1
- package/cjs/chunks/bundle-CWTqtnQO.js.map +0 -1
- package/cjs/chunks/bundle-CWWDc-jq.js.map +0 -1
- package/cjs/chunks/bundle-CXN-DL6s.js.map +0 -1
- package/cjs/chunks/bundle-CXS1Xff3.js.map +0 -1
- package/cjs/chunks/bundle-C_bbb-dp.js.map +0 -1
- package/cjs/chunks/bundle-CgxoBZ0q.js.map +0 -1
- package/cjs/chunks/bundle-CmAcdA9c.js.map +0 -1
- package/cjs/chunks/bundle-CoLGyVM7.js.map +0 -1
- package/cjs/chunks/bundle-Cqyxf0LC.js.map +0 -1
- package/cjs/chunks/bundle-Ct_lW8hI.js.map +0 -1
- package/cjs/chunks/bundle-CtcrPWbo.js.map +0 -1
- package/cjs/chunks/bundle-CynaFF2G.js.map +0 -1
- package/cjs/chunks/bundle-CzQWSkYD.js.map +0 -1
- package/cjs/chunks/bundle-D83t7kQt.js.map +0 -1
- package/cjs/chunks/bundle-D8786bwt.js.map +0 -1
- package/cjs/chunks/bundle-DCtoNM-7.js.map +0 -1
- package/cjs/chunks/bundle-DDPA24Ym.js.map +0 -1
- package/cjs/chunks/bundle-DJsZItzb.js.map +0 -1
- package/cjs/chunks/bundle-DSRFKM2R.js.map +0 -1
- package/cjs/chunks/bundle-D_w5bnPd.js.map +0 -1
- package/cjs/chunks/bundle-Dd5sHG-K.js.map +0 -1
- package/cjs/chunks/bundle-Ddc4NjWH.js.map +0 -1
- package/cjs/chunks/bundle-DgQ9fMEI.js.map +0 -1
- package/cjs/chunks/bundle-DjML1ul2.js.map +0 -1
- package/cjs/chunks/bundle-DphM1mNA.js.map +0 -1
- package/cjs/chunks/bundle-Dv7MCQ5s.js.map +0 -1
- package/cjs/chunks/bundle-EaE84c1u.js.map +0 -1
- package/cjs/chunks/bundle-IKpW2l2j.js.map +0 -1
- package/cjs/chunks/bundle-Iem46lqC.js.map +0 -1
- package/cjs/chunks/bundle-JUvZGt3Q.js.map +0 -1
- package/cjs/chunks/bundle-KpCtn3E5.js.map +0 -1
- package/cjs/chunks/bundle-Sibh5a_G.js.map +0 -1
- package/cjs/chunks/bundle-WotxJ_Ab.js.map +0 -1
- package/cjs/chunks/bundle-Wz8wcC8J.js.map +0 -1
- package/cjs/chunks/bundle-ZS9cLNMS.js.map +0 -1
- package/cjs/chunks/bundle-tKhabQAd.js.map +0 -1
- package/cjs/chunks/bundle-u7llDhg-.js.map +0 -1
- package/cjs/chunks/bundle-wHImRt4w.js.map +0 -1
- package/cjs/chunks/bundle-ya6_vMhO.js.map +0 -1
|
@@ -121,7 +121,7 @@ const outCarouselStyle = (carouselstyle) => {
|
|
|
121
121
|
if (!carouselstyle)
|
|
122
122
|
return {};
|
|
123
123
|
return {
|
|
124
|
-
carouselStyle: Object.assign(Object.assign({}, carouselstyle), outSingle('spacing', carouselstyle)),
|
|
124
|
+
carouselStyle: Object.assign(Object.assign(Object.assign({}, carouselstyle), outSingle('spacing', carouselstyle)), outSingle('maxChildWidth', carouselstyle)),
|
|
125
125
|
};
|
|
126
126
|
};
|
|
127
127
|
const outViewProps = (view) => {
|
|
@@ -168,28 +168,15 @@ const createParser = (params) => {
|
|
|
168
168
|
mapCarouselProps: (params === null || params === void 0 ? void 0 : params.mapCarouselProps) || defaultMapper,
|
|
169
169
|
};
|
|
170
170
|
const transforms = [colorTransform, numberTransform, ...((_a = params === null || params === void 0 ? void 0 : params.transforms) !== null && _a !== void 0 ? _a : [])];
|
|
171
|
-
const transformDirty = new Set();
|
|
172
171
|
return {
|
|
173
172
|
setTransforms(newTransforms) {
|
|
174
173
|
transforms.length = 0;
|
|
175
174
|
transforms.push(...newTransforms);
|
|
176
|
-
transformDirty.clear();
|
|
177
175
|
},
|
|
178
176
|
addTransforms(newTransforms) {
|
|
179
177
|
transforms.push(...newTransforms);
|
|
180
178
|
},
|
|
181
179
|
parse(rawItem, options) {
|
|
182
|
-
// Note: it is for mutable transforms
|
|
183
|
-
// const uniqId =
|
|
184
|
-
// typeof options.depth === 'number' && typeof options.elemIdx === 'number'
|
|
185
|
-
// ? `id-${options.depth}-${options.elemIdx}`
|
|
186
|
-
// : rawItem.id ?? rawItem.elementId ?? JSON.stringify(rawItem);
|
|
187
|
-
//
|
|
188
|
-
// let item = rawItem;
|
|
189
|
-
// if (!transformDirty.has(uniqId)) {
|
|
190
|
-
// item = transforms.reduce((it, transform) => transform(it), rawItem);
|
|
191
|
-
// transformDirty.add(uniqId);
|
|
192
|
-
// }
|
|
193
180
|
const item = transforms.reduce((it, transform) => transform.run(it), rawItem);
|
|
194
181
|
switch (item.type) {
|
|
195
182
|
case ComponentType.Box: {
|
|
@@ -376,14 +363,15 @@ const createMessageTemplate = (opts) => {
|
|
|
376
363
|
if (!isTemplateVersionSupported(templateVersion)) {
|
|
377
364
|
throw new Error(`Cannot parse template item due to unsupported template version: ${templateVersion}, ${SUPPORTED_TEMPLATE_VERSIONS}`);
|
|
378
365
|
}
|
|
379
|
-
return (React__default.createElement(React__default.Fragment, null, templateItems.map((
|
|
380
|
-
const result = parser.parse(
|
|
366
|
+
return (React__default.createElement(React__default.Fragment, null, templateItems.map((rawProperties, index, siblings) => {
|
|
367
|
+
const result = parser.parse(rawProperties, { parentLayout, depth, elemIdx: index, siblings });
|
|
381
368
|
const item = result.transformed;
|
|
382
369
|
const rendererProps = {
|
|
383
370
|
key: index,
|
|
384
371
|
siblings,
|
|
385
372
|
parentLayout,
|
|
386
373
|
parsedProperties: result.properties,
|
|
374
|
+
rawProperties,
|
|
387
375
|
};
|
|
388
376
|
switch (item.type) {
|
|
389
377
|
case ComponentType.Carousel: {
|
|
@@ -419,7 +407,7 @@ const createMessageTemplate = (opts) => {
|
|
|
419
407
|
MessageTemplate: ({ templateVersion, templateItems, parentLayout = defaultProperties.rootLayout, }) => {
|
|
420
408
|
const items = setTemplateItemId(templateItems);
|
|
421
409
|
return (React__default.createElement(SizeContextProvider, null,
|
|
422
|
-
React__default.createElement(Container,
|
|
410
|
+
React__default.createElement(Container, { className: 'sb-message-template__parent' },
|
|
423
411
|
React__default.createElement(MessageTemplateBase, { isRoot: true, parentLayout: parentLayout, templateItems: items, templateVersion: templateVersion }))));
|
|
424
412
|
},
|
|
425
413
|
MessageTemplateBase,
|
|
@@ -1284,11 +1272,276 @@ var ActionType;
|
|
|
1284
1272
|
},
|
|
1285
1273
|
});
|
|
1286
1274
|
|
|
1275
|
+
function isWrappedText(view) {
|
|
1276
|
+
var _a;
|
|
1277
|
+
return view.type === ComponentType.Text && ((_a = view.width) === null || _a === void 0 ? void 0 : _a.value) == FlexSizeSpecValue.WrapContent;
|
|
1278
|
+
}
|
|
1279
|
+
// Compares the size spec to the option and returns whether they are equal or not.
|
|
1280
|
+
const isSizeCompatibleWithOption = ({ size, option, }) => {
|
|
1281
|
+
if (option === 'wrap') {
|
|
1282
|
+
return size.type === 'flex' && size.value == FlexSizeSpecValue.WrapContent;
|
|
1283
|
+
}
|
|
1284
|
+
if (option === 'fill') {
|
|
1285
|
+
return size.type === 'flex' && size.value == FlexSizeSpecValue.FillParent;
|
|
1286
|
+
}
|
|
1287
|
+
return size.type === 'fixed';
|
|
1288
|
+
};
|
|
1289
|
+
const isGif = (url) => {
|
|
1290
|
+
var _a;
|
|
1291
|
+
if (typeof url !== 'string')
|
|
1292
|
+
return false;
|
|
1293
|
+
const extension = (_a = url.split('.').pop()) === null || _a === void 0 ? void 0 : _a.toLowerCase();
|
|
1294
|
+
return extension === 'gif';
|
|
1295
|
+
};
|
|
1296
|
+
const clx = (...names) => {
|
|
1297
|
+
return names.filter((it) => !!it).join(' ');
|
|
1298
|
+
};
|
|
1299
|
+
const hasValidURLProtocol = (url = '') => {
|
|
1300
|
+
return ['http://', 'https://', 'ftp://'].some((protocol) => url.startsWith(protocol));
|
|
1301
|
+
};
|
|
1302
|
+
/**
|
|
1303
|
+
* @param url - url to be checked
|
|
1304
|
+
* @returns url with http:// protocol if it doesn't have any protocol
|
|
1305
|
+
* @example
|
|
1306
|
+
* returnUrl('www.sendbird.com') // returns 'http://www.sendbird.com'
|
|
1307
|
+
* returnUrl('https://www.sendbird.com') // returns 'https://www.sendbird.com'
|
|
1308
|
+
* returnUrl('ftp://www.sendbird.com') // returns 'ftp://www.sendbird.com'
|
|
1309
|
+
* returnUrl('sendbird.com') // returns 'https://sendbird.com'
|
|
1310
|
+
**/
|
|
1311
|
+
const getValidURL = (url = '') => {
|
|
1312
|
+
if (hasValidURLProtocol(url))
|
|
1313
|
+
return url;
|
|
1314
|
+
return `https://${url}`;
|
|
1315
|
+
};
|
|
1316
|
+
|
|
1317
|
+
function getDefaultStyles(overrides) {
|
|
1318
|
+
return Object.assign({ display: 'flex', overflow: 'hidden', boxSizing: 'border-box' }, overrides);
|
|
1319
|
+
}
|
|
1320
|
+
function setViewProps(styles, props, options) {
|
|
1321
|
+
setViewSize(styles, props, options);
|
|
1322
|
+
setViewStyle(styles, props);
|
|
1323
|
+
}
|
|
1324
|
+
function setBorderStyle(styles, borderWidth, borderColor, radius) {
|
|
1325
|
+
if (borderWidth) {
|
|
1326
|
+
styles['--border-width'] = `${borderWidth}px`;
|
|
1327
|
+
styles['--border-color'] = borderColor || 'transparent';
|
|
1328
|
+
}
|
|
1329
|
+
if (radius) {
|
|
1330
|
+
styles['borderRadius'] = radius;
|
|
1331
|
+
styles['--border-radius'] = `${radius}px`;
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
function setViewStyle(styles, props) {
|
|
1335
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1336
|
+
const { viewStyle } = props;
|
|
1337
|
+
styles['marginBlockStart'] = (_a = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.margin) === null || _a === void 0 ? void 0 : _a.top;
|
|
1338
|
+
styles['marginBlockEnd'] = (_b = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.margin) === null || _b === void 0 ? void 0 : _b.bottom;
|
|
1339
|
+
styles['marginInlineStart'] = (_c = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.margin) === null || _c === void 0 ? void 0 : _c.left;
|
|
1340
|
+
styles['marginInlineEnd'] = (_d = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.margin) === null || _d === void 0 ? void 0 : _d.right;
|
|
1341
|
+
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);
|
|
1342
|
+
if (marginHorizontal > 0 && styles.width === '100%')
|
|
1343
|
+
styles.width = `calc(100% - ${marginHorizontal}px)`;
|
|
1344
|
+
if (viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.backgroundColor)
|
|
1345
|
+
styles['backgroundColor'] = viewStyle.backgroundColor;
|
|
1346
|
+
// use JSON.stringify to escape special characters in image URL
|
|
1347
|
+
if (viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.backgroundImageUrl) {
|
|
1348
|
+
styles['backgroundImage'] = `url(${JSON.stringify(viewStyle.backgroundImageUrl)})`;
|
|
1349
|
+
styles['backgroundSize'] = '100% 100%';
|
|
1350
|
+
styles['backgroundPosition'] = 'center';
|
|
1351
|
+
}
|
|
1352
|
+
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);
|
|
1353
|
+
}
|
|
1354
|
+
function getViewSizeStyle(width, height, parentLayout) {
|
|
1355
|
+
const style = {};
|
|
1356
|
+
if (width.type === 'flex' && width.value == FlexSizeSpecValue.FillParent) {
|
|
1357
|
+
style['width'] = '100%';
|
|
1358
|
+
if (parentLayout === Layout.Row) {
|
|
1359
|
+
style['flex'] = 1;
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
else if (width.type === 'flex' && width.value == FlexSizeSpecValue.WrapContent) {
|
|
1363
|
+
style['width'] = 'fit-content';
|
|
1364
|
+
if (parentLayout === Layout.Row) {
|
|
1365
|
+
style['flexShrink'] = 0;
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
else if (width.type === 'fixed' && width.value >= 0) {
|
|
1369
|
+
style['width'] = width.value;
|
|
1370
|
+
if (parentLayout === Layout.Row) {
|
|
1371
|
+
style['flexShrink'] = 0;
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
if (height.type === 'flex' && height.value == FlexSizeSpecValue.FillParent) {
|
|
1375
|
+
style['height'] = '100%';
|
|
1376
|
+
if (parentLayout === Layout.Column) {
|
|
1377
|
+
style['flex'] = 1;
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
else if (height.type === 'flex' && height.value == FlexSizeSpecValue.WrapContent) {
|
|
1381
|
+
style['height'] = 'fit-content';
|
|
1382
|
+
if (parentLayout === Layout.Column) {
|
|
1383
|
+
style['flexShrink'] = 0;
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
else if (height.type === 'fixed' && height.value >= 0) {
|
|
1387
|
+
style['height'] = height.value;
|
|
1388
|
+
if (parentLayout === Layout.Column) {
|
|
1389
|
+
style['flexShrink'] = 0;
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
return style;
|
|
1393
|
+
}
|
|
1394
|
+
function setViewSize(styles, props, options) {
|
|
1395
|
+
var _a, _b;
|
|
1396
|
+
const { width: defaultWidth, height: defaultHeight } = defaultProperties.view.size;
|
|
1397
|
+
const { parentLayout } = options;
|
|
1398
|
+
const sizeStyle = getViewSizeStyle((_a = props.width) !== null && _a !== void 0 ? _a : defaultWidth, (_b = props.height) !== null && _b !== void 0 ? _b : defaultHeight, parentLayout);
|
|
1399
|
+
Object.assign(styles, sizeStyle);
|
|
1400
|
+
}
|
|
1401
|
+
function setAlign(styles, layout = defaultProperties.box.layout, align = defaultProperties.box.align) {
|
|
1402
|
+
if (layout === Layout.Row) {
|
|
1403
|
+
styles['flexDirection'] = 'row';
|
|
1404
|
+
styles['alignItems'] = alignInFlex(align.vertical);
|
|
1405
|
+
styles['justifyContent'] = alignInFlex(align.horizontal);
|
|
1406
|
+
}
|
|
1407
|
+
if (layout === Layout.Column) {
|
|
1408
|
+
styles['flexDirection'] = 'column';
|
|
1409
|
+
styles['alignItems'] = alignInFlex(align.horizontal);
|
|
1410
|
+
styles['justifyContent'] = alignInFlex(align.vertical);
|
|
1411
|
+
}
|
|
1412
|
+
}
|
|
1413
|
+
function setTextAlign(styles, align = defaultProperties.box.align.horizontal) {
|
|
1414
|
+
switch (align) {
|
|
1415
|
+
case AlignValue.Left:
|
|
1416
|
+
styles.textAlign = 'start';
|
|
1417
|
+
break;
|
|
1418
|
+
case AlignValue.Right:
|
|
1419
|
+
styles.textAlign = 'end';
|
|
1420
|
+
break;
|
|
1421
|
+
case AlignValue.Center:
|
|
1422
|
+
styles.textAlign = 'center';
|
|
1423
|
+
break;
|
|
1424
|
+
default:
|
|
1425
|
+
styles.textAlign = 'start';
|
|
1426
|
+
break;
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
function setImageStyle(styles, imageStyle) {
|
|
1430
|
+
const { contentMode = MediaContentMode.AspectFit } = imageStyle || {};
|
|
1431
|
+
if (contentMode) {
|
|
1432
|
+
switch (contentMode) {
|
|
1433
|
+
case MediaContentMode.AspectFill:
|
|
1434
|
+
styles['objectFit'] = 'cover';
|
|
1435
|
+
break;
|
|
1436
|
+
case MediaContentMode.AspectFit:
|
|
1437
|
+
styles['objectFit'] = 'contain';
|
|
1438
|
+
break;
|
|
1439
|
+
case MediaContentMode.ScalesToFill:
|
|
1440
|
+
styles['objectFit'] = 'fill';
|
|
1441
|
+
break;
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1445
|
+
// uses image meta-data to render images that doesn't break the UI
|
|
1446
|
+
// https://sendbird.atlassian.net/wiki/spaces/UK/pages/2008220608/Message+template+-+Image+policy
|
|
1447
|
+
function setImageAspectRatio(styles, props) {
|
|
1448
|
+
var _a, _b, _c, _d;
|
|
1449
|
+
const imageMetaData = props === null || props === void 0 ? void 0 : props.metaData;
|
|
1450
|
+
if (!(imageMetaData === null || imageMetaData === void 0 ? void 0 : imageMetaData.pixelHeight) || !(imageMetaData === null || imageMetaData === void 0 ? void 0 : imageMetaData.pixelWidth)) {
|
|
1451
|
+
return;
|
|
1452
|
+
}
|
|
1453
|
+
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') {
|
|
1454
|
+
return;
|
|
1455
|
+
}
|
|
1456
|
+
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}`;
|
|
1457
|
+
}
|
|
1458
|
+
function webkitLineClampStyles(numberOfLines) {
|
|
1459
|
+
return {
|
|
1460
|
+
WebkitLineClamp: numberOfLines,
|
|
1461
|
+
WebkitBoxOrient: 'vertical',
|
|
1462
|
+
display: '-webkit-box',
|
|
1463
|
+
overflow: 'hidden',
|
|
1464
|
+
overflowWrap: 'anywhere',
|
|
1465
|
+
flex: 1,
|
|
1466
|
+
};
|
|
1467
|
+
}
|
|
1468
|
+
function setTextStyle(styles, props, options) {
|
|
1469
|
+
const { textStyle, width } = props;
|
|
1470
|
+
// TODO: Change default as design
|
|
1471
|
+
const { size, color, weight } = textStyle || {};
|
|
1472
|
+
if (size)
|
|
1473
|
+
styles['fontSize'] = size;
|
|
1474
|
+
if (color)
|
|
1475
|
+
styles['color'] = color;
|
|
1476
|
+
if (weight)
|
|
1477
|
+
styles['fontWeight'] = weight;
|
|
1478
|
+
if ((width === null || width === void 0 ? void 0 : width.type) === 'flex' && (width === null || width === void 0 ? void 0 : width.value) == FlexSizeSpecValue.WrapContent) {
|
|
1479
|
+
styles['width'] = 'fit-content';
|
|
1480
|
+
styles['maxWidth'] = '100%';
|
|
1481
|
+
}
|
|
1482
|
+
if (props.type === ComponentType.Text) {
|
|
1483
|
+
const { siblings, elemIdx } = options;
|
|
1484
|
+
// To push out any subsequent components from the container,
|
|
1485
|
+
// if a prior one is long enough to occupy an entire line
|
|
1486
|
+
// @link https://sendbird.atlassian.net/browse/NOTI-709
|
|
1487
|
+
if (siblings != null && siblings.length >= 2 && siblings.every(isWrappedText)) {
|
|
1488
|
+
styles.flexShrink = siblings.length - 1 === elemIdx ? 1 : 0;
|
|
1489
|
+
}
|
|
1490
|
+
}
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1493
|
+
const parser = createParser({
|
|
1494
|
+
mapBoxProps(props, options) {
|
|
1495
|
+
const styles = getDefaultStyles();
|
|
1496
|
+
setViewProps(styles, props, options);
|
|
1497
|
+
setAlign(styles, props.layout, props.align);
|
|
1498
|
+
return styles;
|
|
1499
|
+
},
|
|
1500
|
+
mapTextProps(props, options) {
|
|
1501
|
+
var _a;
|
|
1502
|
+
const styles = getDefaultStyles({ whiteSpace: 'pre-line', wordBreak: 'break-word' });
|
|
1503
|
+
// Better not set flex 1 to text
|
|
1504
|
+
setViewProps(styles, props, options);
|
|
1505
|
+
setTextStyle(styles, props, options);
|
|
1506
|
+
setAlign(styles, Layout.Row, props.align);
|
|
1507
|
+
setTextAlign(styles, (_a = props.align) === null || _a === void 0 ? void 0 : _a.horizontal);
|
|
1508
|
+
return styles;
|
|
1509
|
+
},
|
|
1510
|
+
mapImageProps(props, options) {
|
|
1511
|
+
const styles = getDefaultStyles();
|
|
1512
|
+
setViewProps(styles, props, options);
|
|
1513
|
+
setImageStyle(styles, props.imageStyle);
|
|
1514
|
+
setImageAspectRatio(styles, props);
|
|
1515
|
+
return styles;
|
|
1516
|
+
},
|
|
1517
|
+
mapTextButtonProps(props, options) {
|
|
1518
|
+
const styles = getDefaultStyles({ whiteSpace: 'pre-line', alignItems: 'center', justifyContent: 'center' });
|
|
1519
|
+
setViewProps(styles, props, options);
|
|
1520
|
+
setTextStyle(styles, props, options);
|
|
1521
|
+
return styles;
|
|
1522
|
+
},
|
|
1523
|
+
mapImageButtonProps(props, options) {
|
|
1524
|
+
const styles = getDefaultStyles();
|
|
1525
|
+
setViewProps(styles, props, options);
|
|
1526
|
+
setImageStyle(styles, props.imageStyle);
|
|
1527
|
+
setImageAspectRatio(styles, props);
|
|
1528
|
+
return styles;
|
|
1529
|
+
},
|
|
1530
|
+
mapCarouselProps(props, options) {
|
|
1531
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1532
|
+
const styles = getDefaultStyles();
|
|
1533
|
+
setViewProps(styles, props, options);
|
|
1534
|
+
styles['paddingBlockStart'] = (_b = (_a = props.viewStyle) === null || _a === void 0 ? void 0 : _a.padding) === null || _b === void 0 ? void 0 : _b.top;
|
|
1535
|
+
styles['paddingBlockEnd'] = (_d = (_c = props.viewStyle) === null || _c === void 0 ? void 0 : _c.padding) === null || _d === void 0 ? void 0 : _d.bottom;
|
|
1536
|
+
styles['paddingInlineStart'] = (_f = (_e = props.viewStyle) === null || _e === void 0 ? void 0 : _e.padding) === null || _f === void 0 ? void 0 : _f.left;
|
|
1537
|
+
styles['paddingInlineEnd'] = (_h = (_g = props.viewStyle) === null || _g === void 0 ? void 0 : _g.padding) === null || _h === void 0 ? void 0 : _h.right;
|
|
1538
|
+
return styles;
|
|
1539
|
+
},
|
|
1540
|
+
});
|
|
1541
|
+
|
|
1287
1542
|
const SWIPE_THRESHOLD = 24;
|
|
1543
|
+
const CLICK_THRESHOLD = 5;
|
|
1288
1544
|
function useCarousel({ spacing, childrenLength, paddingInlineStart, paddingInlineEnd }) {
|
|
1289
|
-
// TODO: RTL support
|
|
1290
|
-
const paddingStart = paddingInlineStart;
|
|
1291
|
-
const paddingEnd = paddingInlineEnd;
|
|
1292
1545
|
const carouselRef = useRef(null);
|
|
1293
1546
|
const childrenRefs = useRef(Array.from({ length: childrenLength }, () => React__default.createRef()));
|
|
1294
1547
|
const isDragging = useRef(false);
|
|
@@ -1300,22 +1553,32 @@ function useCarousel({ spacing, childrenLength, paddingInlineStart, paddingInlin
|
|
|
1300
1553
|
offset: 0,
|
|
1301
1554
|
translateX: 0,
|
|
1302
1555
|
currentIndex: 0,
|
|
1556
|
+
didMove: false,
|
|
1303
1557
|
});
|
|
1304
1558
|
const [childWidths, setChildWidths] = useState(() => childrenRefs.current.map(() => 0));
|
|
1559
|
+
const [isRTL, setIsRTL] = useState(false);
|
|
1560
|
+
const directionMultiplier = isRTL ? -1 : 1;
|
|
1305
1561
|
const itemPositions = useMemo(() => {
|
|
1306
|
-
let currentPosition =
|
|
1562
|
+
let currentPosition = paddingInlineStart;
|
|
1307
1563
|
return childWidths.map((width, i) => {
|
|
1308
|
-
const
|
|
1564
|
+
const spacingOffset = i > 0 ? spacing : 0;
|
|
1565
|
+
const start = currentPosition - spacingOffset;
|
|
1309
1566
|
const end = start - width;
|
|
1310
1567
|
currentPosition = end;
|
|
1311
1568
|
return { start, end };
|
|
1312
1569
|
});
|
|
1313
|
-
}, [childWidths, spacing,
|
|
1570
|
+
}, [childWidths, spacing, paddingInlineStart]);
|
|
1314
1571
|
const totalContentWidth = useMemo(() => {
|
|
1315
1572
|
const totalItemWidth = childWidths.reduce((acc, width) => acc + width, 0);
|
|
1316
1573
|
const totalSpacing = spacing * (childrenLength - 1);
|
|
1317
1574
|
return totalItemWidth + totalSpacing;
|
|
1318
1575
|
}, [childWidths, spacing, childrenLength]);
|
|
1576
|
+
useLayoutEffect(() => {
|
|
1577
|
+
if (carouselRef.current) {
|
|
1578
|
+
const dir = getComputedStyle(carouselRef.current).direction;
|
|
1579
|
+
setIsRTL(dir === 'rtl');
|
|
1580
|
+
}
|
|
1581
|
+
}, []);
|
|
1319
1582
|
useLayoutEffect(() => {
|
|
1320
1583
|
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; }));
|
|
1321
1584
|
}, [childrenLength]);
|
|
@@ -1359,9 +1622,9 @@ function useCarousel({ spacing, childrenLength, paddingInlineStart, paddingInlin
|
|
|
1359
1622
|
function clampTranslateX(translateX) {
|
|
1360
1623
|
var _a, _b;
|
|
1361
1624
|
const containerWidth = (_b = (_a = carouselRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth) !== null && _b !== void 0 ? _b : 0;
|
|
1362
|
-
const start =
|
|
1363
|
-
const end = Math.min(0, containerWidth - totalContentWidth) -
|
|
1364
|
-
return Math.min(start, Math.max(
|
|
1625
|
+
const start = paddingInlineStart;
|
|
1626
|
+
const end = Math.min(0, containerWidth - totalContentWidth) - paddingInlineEnd;
|
|
1627
|
+
return Math.min(start, Math.max(translateX, end));
|
|
1365
1628
|
}
|
|
1366
1629
|
drag.current.currentIndex = newIndex;
|
|
1367
1630
|
drag.current.translateX = clampTranslateX(itemPositions[newIndex].start);
|
|
@@ -1375,7 +1638,8 @@ function useCarousel({ spacing, childrenLength, paddingInlineStart, paddingInlin
|
|
|
1375
1638
|
};
|
|
1376
1639
|
const animate = () => {
|
|
1377
1640
|
if (carouselRef.current) {
|
|
1378
|
-
|
|
1641
|
+
const tx = (drag.current.translateX + drag.current.offset) * directionMultiplier;
|
|
1642
|
+
carouselRef.current.style.transform = `translateX(${tx}px)`;
|
|
1379
1643
|
}
|
|
1380
1644
|
if (animationFrame.current) {
|
|
1381
1645
|
animationFrame.current = requestAnimationFrame(animate);
|
|
@@ -1397,26 +1661,38 @@ function useCarousel({ spacing, childrenLength, paddingInlineStart, paddingInlin
|
|
|
1397
1661
|
drag.current.sx = event.clientX;
|
|
1398
1662
|
drag.current.sy = event.clientY;
|
|
1399
1663
|
drag.current.offset = 0;
|
|
1664
|
+
drag.current.didMove = false;
|
|
1400
1665
|
animationFrame.current = requestAnimationFrame(animate);
|
|
1401
1666
|
};
|
|
1402
1667
|
const onMouseMove = (event) => {
|
|
1403
1668
|
if (!isDragging.current || drag.current.sx === null)
|
|
1404
1669
|
return;
|
|
1405
|
-
drag.current.offset = event.clientX - drag.current.sx;
|
|
1670
|
+
drag.current.offset = (event.clientX - drag.current.sx) * directionMultiplier;
|
|
1671
|
+
if (Math.abs(drag.current.offset) > CLICK_THRESHOLD) {
|
|
1672
|
+
drag.current.didMove = true;
|
|
1673
|
+
}
|
|
1406
1674
|
};
|
|
1407
|
-
const onMouseUp = () => {
|
|
1675
|
+
const onMouseUp = (event) => {
|
|
1408
1676
|
if (!isDragging.current)
|
|
1409
1677
|
return;
|
|
1410
1678
|
scrollStop();
|
|
1411
1679
|
dragRelease();
|
|
1412
1680
|
dragStop();
|
|
1681
|
+
if (drag.current.didMove) {
|
|
1682
|
+
event.preventDefault();
|
|
1683
|
+
event.stopPropagation();
|
|
1684
|
+
}
|
|
1413
1685
|
};
|
|
1414
|
-
const onMouseLeave = () => {
|
|
1686
|
+
const onMouseLeave = (event) => {
|
|
1415
1687
|
if (!isDragging.current)
|
|
1416
1688
|
return;
|
|
1417
1689
|
scrollStop();
|
|
1418
1690
|
dragRelease();
|
|
1419
1691
|
dragStop();
|
|
1692
|
+
if (drag.current.didMove) {
|
|
1693
|
+
event.preventDefault();
|
|
1694
|
+
event.stopPropagation();
|
|
1695
|
+
}
|
|
1420
1696
|
};
|
|
1421
1697
|
const onTouchStart = (event) => {
|
|
1422
1698
|
scrollStop();
|
|
@@ -1425,6 +1701,7 @@ function useCarousel({ spacing, childrenLength, paddingInlineStart, paddingInlin
|
|
|
1425
1701
|
drag.current.sx = touch.clientX;
|
|
1426
1702
|
drag.current.sy = touch.clientY;
|
|
1427
1703
|
drag.current.offset = 0;
|
|
1704
|
+
drag.current.didMove = false;
|
|
1428
1705
|
animationFrame.current = requestAnimationFrame(animate);
|
|
1429
1706
|
};
|
|
1430
1707
|
const onTouchMove = (event) => {
|
|
@@ -1433,7 +1710,10 @@ function useCarousel({ spacing, childrenLength, paddingInlineStart, paddingInlin
|
|
|
1433
1710
|
const { clientX, clientY } = event.touches[0];
|
|
1434
1711
|
const { sx, sy } = drag.current;
|
|
1435
1712
|
if (isDragging.current) {
|
|
1436
|
-
drag.current.offset = clientX - sx;
|
|
1713
|
+
drag.current.offset = (clientX - sx) * directionMultiplier;
|
|
1714
|
+
if (Math.abs(drag.current.offset) > CLICK_THRESHOLD) {
|
|
1715
|
+
drag.current.didMove = true;
|
|
1716
|
+
}
|
|
1437
1717
|
return;
|
|
1438
1718
|
}
|
|
1439
1719
|
const isVerticalScroll = Math.abs(clientY - sy) > Math.abs(clientX - sx);
|
|
@@ -1441,16 +1721,26 @@ function useCarousel({ spacing, childrenLength, paddingInlineStart, paddingInlin
|
|
|
1441
1721
|
scrollStart();
|
|
1442
1722
|
}
|
|
1443
1723
|
else {
|
|
1444
|
-
drag.current.offset = clientX - sx;
|
|
1724
|
+
drag.current.offset = (clientX - sx) * directionMultiplier;
|
|
1445
1725
|
blockScroll();
|
|
1446
1726
|
dragStart();
|
|
1447
1727
|
}
|
|
1448
1728
|
};
|
|
1449
|
-
const onTouchEnd = () => {
|
|
1729
|
+
const onTouchEnd = (event) => {
|
|
1450
1730
|
unblockScroll();
|
|
1451
1731
|
scrollStop();
|
|
1452
1732
|
dragRelease();
|
|
1453
1733
|
dragStop();
|
|
1734
|
+
if (drag.current.didMove) {
|
|
1735
|
+
event.preventDefault();
|
|
1736
|
+
event.stopPropagation();
|
|
1737
|
+
}
|
|
1738
|
+
};
|
|
1739
|
+
const onClickCapture = (event) => {
|
|
1740
|
+
if (drag.current.didMove) {
|
|
1741
|
+
event.preventDefault();
|
|
1742
|
+
event.stopPropagation();
|
|
1743
|
+
}
|
|
1454
1744
|
};
|
|
1455
1745
|
return {
|
|
1456
1746
|
carouselRef,
|
|
@@ -1463,6 +1753,7 @@ function useCarousel({ spacing, childrenLength, paddingInlineStart, paddingInlin
|
|
|
1463
1753
|
onTouchStart,
|
|
1464
1754
|
onTouchMove,
|
|
1465
1755
|
onTouchEnd,
|
|
1756
|
+
onClickCapture,
|
|
1466
1757
|
},
|
|
1467
1758
|
};
|
|
1468
1759
|
}
|
|
@@ -1478,52 +1769,32 @@ var __rest$4 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1478
1769
|
}
|
|
1479
1770
|
return t;
|
|
1480
1771
|
};
|
|
1481
|
-
const
|
|
1482
|
-
|
|
1772
|
+
const RMTCarousel = (_a) => {
|
|
1773
|
+
var { children, style, spacing = defaultProperties.carousel.style.spacing, maxChildWidth = defaultProperties.carousel.style.maxChildWidth, inlineStyle } = _a, props = __rest$4(_a, ["children", "style", "spacing", "maxChildWidth", "inlineStyle"]);
|
|
1774
|
+
const _b = style !== null && style !== void 0 ? style : {}, { paddingInlineStart = 0, paddingInlineEnd = 0 } = _b, restStyle = __rest$4(_b, ["paddingInlineStart", "paddingInlineEnd"]);
|
|
1483
1775
|
const { carouselRef, childrenRefs, handlers } = useCarousel({
|
|
1484
1776
|
spacing,
|
|
1485
1777
|
childrenLength: children.length,
|
|
1486
1778
|
paddingInlineStart: Number(paddingInlineStart),
|
|
1487
1779
|
paddingInlineEnd: Number(paddingInlineEnd),
|
|
1488
1780
|
});
|
|
1489
|
-
return (React__default.createElement("div", Object.assign({}, handlers, { ref: carouselRef,
|
|
1781
|
+
return (React__default.createElement("div", Object.assign({}, handlers, { ref: carouselRef, style: Object.assign(Object.assign(Object.assign({}, restStyle), { gap: spacing, width: '100%', overflow: 'visible' }), inlineStyle) }, props), children.map((item, index) => (React__default.createElement(RMTCarouselChild, { ref: childrenRefs.current[index], key: index, maxChildWidth: maxChildWidth }, item)))));
|
|
1490
1782
|
};
|
|
1491
|
-
const
|
|
1783
|
+
const RMTCarouselChild = React__default.forwardRef(function CarouselChild({ maxChildWidth, children }, ref) {
|
|
1492
1784
|
const maxWidth = shouldSetMaxChildWidth(children.props, maxChildWidth) ? maxChildWidth : 'fit-content';
|
|
1493
1785
|
return (React__default.createElement("div", { ref: ref, style: { maxWidth, width: '100%', flexShrink: 0, overflow: 'hidden', userSelect: 'none' } }, children));
|
|
1494
1786
|
});
|
|
1495
1787
|
// Note: Set the maxChildWidth because it's impossible to determine the maximum width of items in the Carousel Child template when they have FillParent
|
|
1496
1788
|
function shouldSetMaxChildWidth(props, maxChildWidth) {
|
|
1497
1789
|
return !!props.templateItems.find((it) => {
|
|
1498
|
-
var _a
|
|
1499
|
-
const
|
|
1500
|
-
const
|
|
1790
|
+
var _a;
|
|
1791
|
+
const width = (_a = it.width) !== null && _a !== void 0 ? _a : defaultProperties.view.size.width;
|
|
1792
|
+
const hasFillWidth = width.type === 'flex' && width.value === FlexSizeSpecValue.FillParent;
|
|
1793
|
+
const overMaxChildWidth = width.type === 'fixed' && width.value >= maxChildWidth;
|
|
1501
1794
|
return hasFillWidth || overMaxChildWidth;
|
|
1502
1795
|
});
|
|
1503
1796
|
}
|
|
1504
1797
|
|
|
1505
|
-
function isWrappedText(view) {
|
|
1506
|
-
var _a;
|
|
1507
|
-
return view.type === ComponentType.Text && ((_a = view.width) === null || _a === void 0 ? void 0 : _a.value) == FlexSizeSpecValue.WrapContent;
|
|
1508
|
-
}
|
|
1509
|
-
// Compares the size spec to the option and returns whether they are equal or not.
|
|
1510
|
-
const isSizeCompatibleWithOption = ({ size, option, }) => {
|
|
1511
|
-
if (option === 'wrap') {
|
|
1512
|
-
return size.type === 'flex' && size.value == FlexSizeSpecValue.WrapContent;
|
|
1513
|
-
}
|
|
1514
|
-
if (option === 'fill') {
|
|
1515
|
-
return size.type === 'flex' && size.value == FlexSizeSpecValue.FillParent;
|
|
1516
|
-
}
|
|
1517
|
-
return size.type === 'fixed';
|
|
1518
|
-
};
|
|
1519
|
-
const isGif = (url) => {
|
|
1520
|
-
var _a;
|
|
1521
|
-
if (typeof url !== 'string')
|
|
1522
|
-
return false;
|
|
1523
|
-
const extension = (_a = url.split('.').pop()) === null || _a === void 0 ? void 0 : _a.toLowerCase();
|
|
1524
|
-
return extension === 'gif';
|
|
1525
|
-
};
|
|
1526
|
-
|
|
1527
1798
|
var __rest$3 = (undefined && undefined.__rest) || function (s, e) {
|
|
1528
1799
|
var t = {};
|
|
1529
1800
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -1535,7 +1806,7 @@ var __rest$3 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
1535
1806
|
}
|
|
1536
1807
|
return t;
|
|
1537
1808
|
};
|
|
1538
|
-
const
|
|
1809
|
+
const RMTImageCanvas = (props) => {
|
|
1539
1810
|
const { imageSize, canvasRef, canvasProps } = useCanvasMessageTemplateImage(props);
|
|
1540
1811
|
return (React__default.createElement("canvas", Object.assign({}, canvasProps, { ref: canvasRef, width: imageSize === null || imageSize === void 0 ? void 0 : imageSize.width, height: imageSize === null || imageSize === void 0 ? void 0 : imageSize.height, onError: props.onError })));
|
|
1541
1812
|
};
|
|
@@ -1551,7 +1822,6 @@ const useCanvasMessageTemplateImage = (_a) => {
|
|
|
1551
1822
|
}, [fallbackImageSize, metaData === null || metaData === void 0 ? void 0 : metaData.pixelHeight, metaData === null || metaData === void 0 ? void 0 : metaData.pixelWidth]);
|
|
1552
1823
|
useEffect(() => {
|
|
1553
1824
|
if (imageSize == null) {
|
|
1554
|
-
console.log('Canvas_ReactMessageTemplateImage: no metaData, render fit to container');
|
|
1555
1825
|
if (canvasRef.current) {
|
|
1556
1826
|
canvasRef.current.style.width = '100%';
|
|
1557
1827
|
canvasRef.current.style.height = '100%';
|
|
@@ -1574,234 +1844,89 @@ const useCanvasMessageTemplateImage = (_a) => {
|
|
|
1574
1844
|
ctx.globalCompositeOperation = 'source-over';
|
|
1575
1845
|
ctx.fillStyle = '#000';
|
|
1576
1846
|
// draw
|
|
1577
|
-
ctx.drawImage(img, 0, 0, imageWidth, imageHeight);
|
|
1578
|
-
ctx.globalCompositeOperation = 'source-atop';
|
|
1579
|
-
ctx.fillStyle = tintColor;
|
|
1580
|
-
ctx.fillRect(0, 0, imageWidth, imageHeight);
|
|
1581
|
-
}
|
|
1582
|
-
}
|
|
1583
|
-
};
|
|
1584
|
-
const onImageError = (event) => {
|
|
1585
|
-
var _a;
|
|
1586
|
-
// @ts-ignore
|
|
1587
|
-
(_a = props.onError) === null || _a === void 0 ? void 0 : _a.call(props, event);
|
|
1588
|
-
};
|
|
1589
|
-
img.addEventListener('load', onImageLoad);
|
|
1590
|
-
img.addEventListener('error', onImageError);
|
|
1591
|
-
img.src = props.src;
|
|
1592
|
-
return () => {
|
|
1593
|
-
img.removeEventListener('load', onImageLoad);
|
|
1594
|
-
img.removeEventListener('error', onImageError);
|
|
1595
|
-
};
|
|
1596
|
-
}
|
|
1597
|
-
return;
|
|
1598
|
-
}, [props.src, imageSize, tintColor]);
|
|
1599
|
-
return {
|
|
1600
|
-
canvasRef,
|
|
1601
|
-
canvasProps: props,
|
|
1602
|
-
imageSize,
|
|
1603
|
-
};
|
|
1604
|
-
};
|
|
1605
|
-
|
|
1606
|
-
const ImgReactMessageTemplateImage = (props) => {
|
|
1607
|
-
return React__default.createElement("img", Object.assign({}, props, { onError: props.onError, referrerPolicy: "no-referrer" }));
|
|
1608
|
-
};
|
|
1609
|
-
|
|
1610
|
-
const PlaceholderReactMessageTemplateImage = (props) => {
|
|
1611
|
-
return React__default.createElement("div", { style: Object.assign(Object.assign({}, props.style), { backgroundColor: 'transparent' }) });
|
|
1612
|
-
};
|
|
1613
|
-
|
|
1614
|
-
var __rest$2 = (undefined && undefined.__rest) || function (s, e) {
|
|
1615
|
-
var t = {};
|
|
1616
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1617
|
-
t[p] = s[p];
|
|
1618
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
1619
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1620
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
1621
|
-
t[p[i]] = s[p[i]];
|
|
1622
|
-
}
|
|
1623
|
-
return t;
|
|
1624
|
-
};
|
|
1625
|
-
const ReactMessageTemplateImage = (_a) => {
|
|
1626
|
-
var { tintColor, metaData } = _a, props = __rest$2(_a, ["tintColor", "metaData"]);
|
|
1627
|
-
const { hasError, onError } = useImageLoadError(props.src);
|
|
1628
|
-
if (props.onError)
|
|
1629
|
-
console.warn('`onError` is intercepted and not executed in the ReactMessageTemplateImage.');
|
|
1630
|
-
if (hasError) {
|
|
1631
|
-
return React__default.createElement(PlaceholderReactMessageTemplateImage, Object.assign({}, props));
|
|
1632
|
-
}
|
|
1633
|
-
else if (tintColor && !isGif(props.src)) {
|
|
1634
|
-
return React__default.createElement(CanvasReactMessageTemplateImage, Object.assign({}, props, { onError: onError, tintColor: tintColor, metaData: metaData }));
|
|
1635
|
-
}
|
|
1636
|
-
else {
|
|
1637
|
-
return React__default.createElement(ImgReactMessageTemplateImage, Object.assign({}, props, { onError: onError }));
|
|
1638
|
-
}
|
|
1639
|
-
};
|
|
1640
|
-
const useImageLoadError = (source) => {
|
|
1641
|
-
const [hasError, setHasError] = useState(false);
|
|
1642
|
-
useEffect(() => setHasError(false), [source]);
|
|
1643
|
-
return {
|
|
1644
|
-
hasError,
|
|
1645
|
-
onError: useCallback(() => setHasError(true), []),
|
|
1646
|
-
};
|
|
1647
|
-
};
|
|
1648
|
-
|
|
1649
|
-
function getDefaultStyles(overrides) {
|
|
1650
|
-
return Object.assign({ display: 'flex', overflow: 'hidden', boxSizing: 'border-box' }, overrides);
|
|
1651
|
-
}
|
|
1652
|
-
function setViewProps(styles, props, options) {
|
|
1653
|
-
setViewSize(styles, props, options);
|
|
1654
|
-
setViewStyle(styles, props);
|
|
1655
|
-
}
|
|
1656
|
-
function setBorderStyle(styles, borderWidth, borderColor, radius) {
|
|
1657
|
-
if (borderWidth) {
|
|
1658
|
-
styles['--border-width'] = `${borderWidth}px`;
|
|
1659
|
-
styles['--border-color'] = borderColor || 'transparent';
|
|
1660
|
-
}
|
|
1661
|
-
if (radius) {
|
|
1662
|
-
styles['borderRadius'] = radius;
|
|
1663
|
-
styles['--border-radius'] = `${radius}px`;
|
|
1664
|
-
}
|
|
1665
|
-
}
|
|
1666
|
-
function setViewStyle(styles, props) {
|
|
1667
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1668
|
-
const { viewStyle } = props;
|
|
1669
|
-
styles['marginBlockStart'] = (_a = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.margin) === null || _a === void 0 ? void 0 : _a.top;
|
|
1670
|
-
styles['marginBlockEnd'] = (_b = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.margin) === null || _b === void 0 ? void 0 : _b.bottom;
|
|
1671
|
-
styles['marginInlineStart'] = (_c = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.margin) === null || _c === void 0 ? void 0 : _c.left;
|
|
1672
|
-
styles['marginInlineEnd'] = (_d = viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.margin) === null || _d === void 0 ? void 0 : _d.right;
|
|
1673
|
-
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);
|
|
1674
|
-
if (marginHorizontal > 0 && styles.width === '100%')
|
|
1675
|
-
styles.width = `calc(100% - ${marginHorizontal}px)`;
|
|
1676
|
-
if (viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.backgroundColor)
|
|
1677
|
-
styles['backgroundColor'] = viewStyle.backgroundColor;
|
|
1678
|
-
// use JSON.stringify to escape special characters in image URL
|
|
1679
|
-
if (viewStyle === null || viewStyle === void 0 ? void 0 : viewStyle.backgroundImageUrl) {
|
|
1680
|
-
styles['backgroundImage'] = `url(${JSON.stringify(viewStyle.backgroundImageUrl)})`;
|
|
1681
|
-
styles['backgroundSize'] = '100% 100%';
|
|
1682
|
-
styles['backgroundPosition'] = 'center';
|
|
1683
|
-
}
|
|
1684
|
-
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);
|
|
1685
|
-
}
|
|
1686
|
-
function getViewSizeStyle(width, height, parentLayout) {
|
|
1687
|
-
const style = {};
|
|
1688
|
-
if (width.type === 'flex' && width.value == FlexSizeSpecValue.FillParent) {
|
|
1689
|
-
style['width'] = '100%';
|
|
1690
|
-
if (parentLayout === Layout.Row) {
|
|
1691
|
-
style['flex'] = 1;
|
|
1692
|
-
}
|
|
1693
|
-
}
|
|
1694
|
-
else if (width.type === 'fixed' && width.value >= 0) {
|
|
1695
|
-
style['width'] = width.value;
|
|
1696
|
-
}
|
|
1697
|
-
if (height.type === 'flex' && height.value == FlexSizeSpecValue.FillParent) {
|
|
1698
|
-
style['height'] = '100%';
|
|
1699
|
-
if (parentLayout === Layout.Column) {
|
|
1700
|
-
style['flex'] = 1;
|
|
1847
|
+
ctx.drawImage(img, 0, 0, imageWidth, imageHeight);
|
|
1848
|
+
ctx.globalCompositeOperation = 'source-atop';
|
|
1849
|
+
ctx.fillStyle = tintColor;
|
|
1850
|
+
ctx.fillRect(0, 0, imageWidth, imageHeight);
|
|
1851
|
+
}
|
|
1852
|
+
}
|
|
1853
|
+
};
|
|
1854
|
+
const onImageError = (event) => {
|
|
1855
|
+
var _a;
|
|
1856
|
+
// @ts-ignore
|
|
1857
|
+
(_a = props.onError) === null || _a === void 0 ? void 0 : _a.call(props, event);
|
|
1858
|
+
};
|
|
1859
|
+
img.addEventListener('load', onImageLoad);
|
|
1860
|
+
img.addEventListener('error', onImageError);
|
|
1861
|
+
img.src = props.src;
|
|
1862
|
+
return () => {
|
|
1863
|
+
img.removeEventListener('load', onImageLoad);
|
|
1864
|
+
img.removeEventListener('error', onImageError);
|
|
1865
|
+
};
|
|
1701
1866
|
}
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
}
|
|
1721
|
-
if (
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
function setTextAlign(styles, align = defaultProperties.box.align.horizontal) {
|
|
1728
|
-
styles.textAlign = align;
|
|
1729
|
-
}
|
|
1730
|
-
function setImageStyle(styles, imageStyle) {
|
|
1731
|
-
const { contentMode = MediaContentMode.AspectFit } = imageStyle || {};
|
|
1732
|
-
if (contentMode) {
|
|
1733
|
-
switch (contentMode) {
|
|
1734
|
-
case MediaContentMode.AspectFill:
|
|
1735
|
-
styles['objectFit'] = 'cover';
|
|
1736
|
-
break;
|
|
1737
|
-
case MediaContentMode.AspectFit:
|
|
1738
|
-
styles['objectFit'] = 'contain';
|
|
1739
|
-
break;
|
|
1740
|
-
case MediaContentMode.ScalesToFill:
|
|
1741
|
-
styles['objectFit'] = 'fill';
|
|
1742
|
-
break;
|
|
1867
|
+
return;
|
|
1868
|
+
}, [props.src, imageSize, tintColor]);
|
|
1869
|
+
return {
|
|
1870
|
+
canvasRef,
|
|
1871
|
+
canvasProps: props,
|
|
1872
|
+
imageSize,
|
|
1873
|
+
};
|
|
1874
|
+
};
|
|
1875
|
+
|
|
1876
|
+
const RMTImageDefault = (props) => {
|
|
1877
|
+
return React__default.createElement("img", Object.assign({}, props, { onError: props.onError, draggable: false, referrerPolicy: "no-referrer" }));
|
|
1878
|
+
};
|
|
1879
|
+
|
|
1880
|
+
const RMTImagePlaceholder = (props) => {
|
|
1881
|
+
return React__default.createElement("div", { style: Object.assign(Object.assign({}, props.style), { backgroundColor: 'transparent' }) });
|
|
1882
|
+
};
|
|
1883
|
+
|
|
1884
|
+
var __rest$2 = (undefined && undefined.__rest) || function (s, e) {
|
|
1885
|
+
var t = {};
|
|
1886
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1887
|
+
t[p] = s[p];
|
|
1888
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
1889
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1890
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
1891
|
+
t[p[i]] = s[p[i]];
|
|
1743
1892
|
}
|
|
1893
|
+
return t;
|
|
1894
|
+
};
|
|
1895
|
+
const RMTImage = (_a) => {
|
|
1896
|
+
var { tintColor, metaData } = _a, props = __rest$2(_a, ["tintColor", "metaData"]);
|
|
1897
|
+
const { hasError, onError } = useImageLoadError(props.src);
|
|
1898
|
+
if (props.onError)
|
|
1899
|
+
console.warn('`onError` is intercepted and not executed in the ReactMessageTemplateImage.');
|
|
1900
|
+
if (hasError) {
|
|
1901
|
+
return React__default.createElement(RMTImagePlaceholder, Object.assign({}, props));
|
|
1744
1902
|
}
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
// https://sendbird.atlassian.net/wiki/spaces/UK/pages/2008220608/Message+template+-+Image+policy
|
|
1748
|
-
function setImageAspectRatio(styles, props) {
|
|
1749
|
-
var _a, _b, _c, _d;
|
|
1750
|
-
const imageMetaData = props === null || props === void 0 ? void 0 : props.metaData;
|
|
1751
|
-
if (!(imageMetaData === null || imageMetaData === void 0 ? void 0 : imageMetaData.pixelHeight) || !(imageMetaData === null || imageMetaData === void 0 ? void 0 : imageMetaData.pixelWidth)) {
|
|
1752
|
-
return;
|
|
1903
|
+
else if (tintColor && !isGif(props.src)) {
|
|
1904
|
+
return React__default.createElement(RMTImageCanvas, Object.assign({}, props, { onError: onError, tintColor: tintColor, metaData: metaData }));
|
|
1753
1905
|
}
|
|
1754
|
-
|
|
1755
|
-
return;
|
|
1906
|
+
else {
|
|
1907
|
+
return React__default.createElement(RMTImageDefault, Object.assign({}, props, { onError: onError }));
|
|
1756
1908
|
}
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1909
|
+
};
|
|
1910
|
+
const useImageLoadError = (source) => {
|
|
1911
|
+
const [hasError, setHasError] = useState(false);
|
|
1912
|
+
useEffect(() => setHasError(false), [source]);
|
|
1760
1913
|
return {
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
display: '-webkit-box',
|
|
1764
|
-
overflow: 'hidden',
|
|
1765
|
-
overflowWrap: 'anywhere',
|
|
1766
|
-
flex: 1,
|
|
1914
|
+
hasError,
|
|
1915
|
+
onError: useCallback(() => setHasError(true), []),
|
|
1767
1916
|
};
|
|
1768
|
-
}
|
|
1769
|
-
function setTextStyle(styles, props, options) {
|
|
1770
|
-
const { textStyle, width } = props;
|
|
1771
|
-
// TODO: Change default as design
|
|
1772
|
-
const { size, color, weight } = textStyle || {};
|
|
1773
|
-
if (size)
|
|
1774
|
-
styles['fontSize'] = size;
|
|
1775
|
-
if (color)
|
|
1776
|
-
styles['color'] = color;
|
|
1777
|
-
if (weight)
|
|
1778
|
-
styles['fontWeight'] = weight;
|
|
1779
|
-
if ((width === null || width === void 0 ? void 0 : width.type) === 'flex' && (width === null || width === void 0 ? void 0 : width.value) == FlexSizeSpecValue.WrapContent) {
|
|
1780
|
-
styles['width'] = 'fit-content';
|
|
1781
|
-
styles['maxWidth'] = '100%';
|
|
1782
|
-
}
|
|
1783
|
-
if (props.type === ComponentType.Text) {
|
|
1784
|
-
const { siblings, elemIdx } = options;
|
|
1785
|
-
// To push out any subsequent components from the container,
|
|
1786
|
-
// if a prior one is long enough to occupy an entire line
|
|
1787
|
-
// @link https://sendbird.atlassian.net/browse/NOTI-709
|
|
1788
|
-
if (siblings != null && siblings.length >= 2 && siblings.every(isWrappedText)) {
|
|
1789
|
-
styles.flexShrink = siblings.length - 1 === elemIdx ? 1 : 0;
|
|
1790
|
-
}
|
|
1791
|
-
}
|
|
1792
|
-
}
|
|
1917
|
+
};
|
|
1793
1918
|
|
|
1794
1919
|
// create a context provider for MessageComponent
|
|
1795
1920
|
// - this is a wrapper for MessageComponent
|
|
1796
1921
|
const MessageContext = React__default.createContext(null);
|
|
1797
|
-
const MessageProvider = (
|
|
1798
|
-
const { message, handleWebAction, handleCustomAction, handlePredefinedAction, children } = props;
|
|
1922
|
+
const MessageProvider = ({ message, handleWebAction, handleCustomAction, handlePredefinedAction, highlight, children, }) => {
|
|
1799
1923
|
const value = React__default.useMemo(() => ({
|
|
1800
1924
|
message,
|
|
1801
1925
|
handleWebAction,
|
|
1802
1926
|
handleCustomAction,
|
|
1803
1927
|
handlePredefinedAction,
|
|
1804
|
-
|
|
1928
|
+
highlight,
|
|
1929
|
+
}), [message === null || message === void 0 ? void 0 : message.updatedAt, highlight === null || highlight === void 0 ? void 0 : highlight.getContainerClassName, highlight === null || highlight === void 0 ? void 0 : highlight.getContainerInlineStyle, highlight === null || highlight === void 0 ? void 0 : highlight.renderText]);
|
|
1805
1930
|
return React__default.createElement(MessageContext.Provider, { value: value }, children);
|
|
1806
1931
|
};
|
|
1807
1932
|
const useMessageContext = () => {
|
|
@@ -1812,6 +1937,18 @@ const useMessageContext = () => {
|
|
|
1812
1937
|
return context;
|
|
1813
1938
|
};
|
|
1814
1939
|
|
|
1940
|
+
/**
|
|
1941
|
+
* This hook is used to highlight each item in the message template by extending its style.
|
|
1942
|
+
* */
|
|
1943
|
+
function useHighlightStyle(raw) {
|
|
1944
|
+
const { highlight } = useMessageContext();
|
|
1945
|
+
return {
|
|
1946
|
+
className: (highlight === null || highlight === void 0 ? void 0 : highlight.getContainerClassName) ? highlight.getContainerClassName(raw) : undefined,
|
|
1947
|
+
style: (highlight === null || highlight === void 0 ? void 0 : highlight.getContainerInlineStyle) ? highlight.getContainerInlineStyle(raw) : undefined,
|
|
1948
|
+
renderText: (highlight === null || highlight === void 0 ? void 0 : highlight.renderText) ? highlight.renderText : (it) => it,
|
|
1949
|
+
};
|
|
1950
|
+
}
|
|
1951
|
+
|
|
1815
1952
|
/**
|
|
1816
1953
|
* Preserves a reference to the given callback function as an argument while the component is mounted.
|
|
1817
1954
|
* Wraps the given callback in React's Ref to preserve the reference.
|
|
@@ -2017,28 +2154,13 @@ var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
|
2017
2154
|
}
|
|
2018
2155
|
return t;
|
|
2019
2156
|
};
|
|
2020
|
-
const hasValidUrlProtocol = (url = '') => ['http://', 'https://', 'ftp://'].some((protocol) => url.startsWith(protocol));
|
|
2021
|
-
/**
|
|
2022
|
-
* @param url - url to be checked
|
|
2023
|
-
* @returns url with http:// protocol if it doesn't have any protocol
|
|
2024
|
-
* @example
|
|
2025
|
-
* returnUrl('www.sendbird.com') // returns 'http://www.sendbird.com'
|
|
2026
|
-
* returnUrl('https://www.sendbird.com') // returns 'https://www.sendbird.com'
|
|
2027
|
-
* returnUrl('ftp://www.sendbird.com') // returns 'ftp://www.sendbird.com'
|
|
2028
|
-
* returnUrl('sendbird.com') // returns 'https://sendbird.com'
|
|
2029
|
-
**/
|
|
2030
|
-
const returnUrl = (url = '') => {
|
|
2031
|
-
if (hasValidUrlProtocol(url)) {
|
|
2032
|
-
return url;
|
|
2033
|
-
}
|
|
2034
|
-
return `https://${url}`;
|
|
2035
|
-
};
|
|
2036
2157
|
// todo: semantic html here is not perfect, need to revisit. Same for Button
|
|
2037
|
-
const ActionHandler = ({ children, props, className, style }) => {
|
|
2158
|
+
const ActionHandler = ({ children, props, className, style, inlineStyle }) => {
|
|
2038
2159
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
2039
2160
|
const { recalculatedStyle, elemRef } = useRecalculateWidth({ style, props });
|
|
2040
2161
|
const { message, handleWebAction, handleCustomAction, handlePredefinedAction } = useMessageContext();
|
|
2041
2162
|
const borderClass = ((_a = props.viewStyle) === null || _a === void 0 ? void 0 : _a.borderWidth) ? 'sb-message-template__border' : '';
|
|
2163
|
+
const actionClass = props.action ? 'sb-message-template__action' : '';
|
|
2042
2164
|
const paddingStyles = {
|
|
2043
2165
|
paddingBlockStart: (_c = (_b = props.viewStyle) === null || _b === void 0 ? void 0 : _b.padding) === null || _c === void 0 ? void 0 : _c.top,
|
|
2044
2166
|
paddingBlockEnd: (_e = (_d = props.viewStyle) === null || _d === void 0 ? void 0 : _d.padding) === null || _e === void 0 ? void 0 : _e.bottom,
|
|
@@ -2052,7 +2174,7 @@ const ActionHandler = ({ children, props, className, style }) => {
|
|
|
2052
2174
|
handleWebAction(e, props.action, message);
|
|
2053
2175
|
}
|
|
2054
2176
|
else {
|
|
2055
|
-
(_c = window === null || window === void 0 ? void 0 : window.open(
|
|
2177
|
+
(_c = window === null || window === void 0 ? void 0 : window.open(getValidURL((_b = props === null || props === void 0 ? void 0 : props.action) === null || _b === void 0 ? void 0 : _b.data), '_blank', 'noopener noreferrer')) === null || _c === void 0 ? void 0 : _c.focus();
|
|
2056
2178
|
}
|
|
2057
2179
|
}
|
|
2058
2180
|
else if (((_d = props.action) === null || _d === void 0 ? void 0 : _d.type) === 'custom') {
|
|
@@ -2060,7 +2182,7 @@ const ActionHandler = ({ children, props, className, style }) => {
|
|
|
2060
2182
|
handleCustomAction(e, props.action, message);
|
|
2061
2183
|
}
|
|
2062
2184
|
else {
|
|
2063
|
-
(_f = window === null || window === void 0 ? void 0 : window.open(
|
|
2185
|
+
(_f = window === null || window === void 0 ? void 0 : window.open(getValidURL((_e = props === null || props === void 0 ? void 0 : props.action) === null || _e === void 0 ? void 0 : _e.data), '_blank', 'noopener noreferrer')) === null || _f === void 0 ? void 0 : _f.focus();
|
|
2064
2186
|
}
|
|
2065
2187
|
}
|
|
2066
2188
|
else if (((_g = props.action) === null || _g === void 0 ? void 0 : _g.type) === 'uikit') {
|
|
@@ -2068,135 +2190,86 @@ const ActionHandler = ({ children, props, className, style }) => {
|
|
|
2068
2190
|
}
|
|
2069
2191
|
};
|
|
2070
2192
|
if (props.type === ComponentType.TextButton) {
|
|
2071
|
-
return (React__default.createElement("button", { className: clx(className, borderClass), "data-sb-template-id": props.elementId, style: Object.assign(Object.assign({}, style), paddingStyles), onClick: onClick }, children));
|
|
2193
|
+
return (React__default.createElement("button", { className: clx(className, borderClass, actionClass), "data-sb-template-id": props.elementId, style: Object.assign(Object.assign(Object.assign({}, style), paddingStyles), inlineStyle), onClick: onClick }, children));
|
|
2072
2194
|
}
|
|
2073
2195
|
const { display, flexDirection, justifyContent, alignItems, objectFit } = recalculatedStyle, wrapperStyles = __rest(recalculatedStyle, ["display", "flexDirection", "justifyContent", "alignItems", "objectFit"]);
|
|
2074
|
-
return (React__default.createElement("div", { ref: elemRef, className: clx(className, borderClass,
|
|
2196
|
+
return (React__default.createElement("div", { ref: elemRef, className: clx(className, borderClass, actionClass), "data-sb-template-id": props.elementId, style: Object.assign(Object.assign({}, wrapperStyles), inlineStyle), onClick: onClick },
|
|
2075
2197
|
React__default.createElement("div", { style: Object.assign({ display,
|
|
2076
2198
|
flexDirection,
|
|
2077
2199
|
justifyContent,
|
|
2078
2200
|
alignItems,
|
|
2079
2201
|
objectFit, width: '100%', height: '100%' }, paddingStyles) }, children)));
|
|
2080
2202
|
};
|
|
2081
|
-
function clx(...names) {
|
|
2082
|
-
return names.filter((it) => !!it).join(' ');
|
|
2083
|
-
}
|
|
2084
2203
|
|
|
2085
|
-
/**
|
|
2086
|
-
* Text that is fixed or fill parent should be wrapped in a div with max-width: 100% and max-height: 100%
|
|
2087
|
-
* This is to prevent text from overflowing the padding of the container
|
|
2088
|
-
*/
|
|
2089
|
-
function isFixedOrFill(view) {
|
|
2090
|
-
var _a, _b, _c, _d;
|
|
2091
|
-
const heightType = (_a = view === null || view === void 0 ? void 0 : view.height) === null || _a === void 0 ? void 0 : _a.type;
|
|
2092
|
-
const widthType = (_b = view === null || view === void 0 ? void 0 : view.width) === null || _b === void 0 ? void 0 : _b.type;
|
|
2093
|
-
const isFixedDiamension = heightType === 'fixed' || widthType === 'fixed';
|
|
2094
|
-
const isFill = (heightType === 'flex' && ((_c = view === null || view === void 0 ? void 0 : view.height) === null || _c === void 0 ? void 0 : _c.value) === FlexSizeSpecValue.FillParent) ||
|
|
2095
|
-
(widthType === 'flex' && ((_d = view === null || view === void 0 ? void 0 : view.width) === null || _d === void 0 ? void 0 : _d.value) === FlexSizeSpecValue.FillParent);
|
|
2096
|
-
return isFixedDiamension || isFill;
|
|
2097
|
-
}
|
|
2098
|
-
function convertNewlinesToBr(text) {
|
|
2099
|
-
return text.split('\n').map((line, index) => (React__default.createElement(React__default.Fragment, { key: index },
|
|
2100
|
-
line,
|
|
2101
|
-
React__default.createElement("br", null))));
|
|
2102
|
-
}
|
|
2103
|
-
function renderText(view) {
|
|
2104
|
-
const { text, maxTextLines } = view;
|
|
2105
|
-
const isToBeWrapped = isFixedOrFill(view);
|
|
2106
|
-
const hasMaxLines = typeof maxTextLines === 'number' && maxTextLines > 0;
|
|
2107
|
-
const convertedText = convertNewlinesToBr(text);
|
|
2108
|
-
if (hasMaxLines || isToBeWrapped) {
|
|
2109
|
-
const wrapperStyling = Object.assign(Object.assign({}, ((hasMaxLines || isToBeWrapped) && { maxWidth: '100%' })), (isToBeWrapped && { maxHeight: '100%', overflow: 'hidden' }));
|
|
2110
|
-
return (React__default.createElement("div", { style: wrapperStyling }, hasMaxLines ? React__default.createElement("div", { style: webkitLineClampStyles(maxTextLines) }, convertedText) : convertedText));
|
|
2111
|
-
}
|
|
2112
|
-
return hasMaxLines ? React__default.createElement("div", { style: webkitLineClampStyles(maxTextLines) }, convertedText) : convertedText;
|
|
2113
|
-
}
|
|
2114
2204
|
const renderer = createRenderer({
|
|
2115
2205
|
views: {
|
|
2116
2206
|
box(props) {
|
|
2117
|
-
|
|
2207
|
+
const highlight = useHighlightStyle(props.rawProperties);
|
|
2208
|
+
return (React__default.createElement(ActionHandler, { className: clx('sb-message-template__box', highlight.className), inlineStyle: highlight.style, elementId: props.elementId, style: props.parsedProperties, props: props }, props.children));
|
|
2118
2209
|
},
|
|
2119
2210
|
text(props) {
|
|
2120
|
-
|
|
2211
|
+
const highlight = useHighlightStyle(props.rawProperties);
|
|
2212
|
+
return (React__default.createElement(ActionHandler, { className: clx('sb-message-template__text', highlight.className), inlineStyle: highlight.style, elementId: props.elementId, style: props.parsedProperties, props: props }, renderText(props, highlight.renderText)));
|
|
2121
2213
|
},
|
|
2122
2214
|
image(props) {
|
|
2123
2215
|
var _a;
|
|
2216
|
+
const highlight = useHighlightStyle(props.rawProperties);
|
|
2124
2217
|
// todo: add image backup
|
|
2125
|
-
return (React__default.createElement(ActionHandler, { className:
|
|
2126
|
-
React__default.createElement(
|
|
2218
|
+
return (React__default.createElement(ActionHandler, { className: clx('sb-message-template__image-container', highlight.className), inlineStyle: highlight.style, elementId: props.elementId, style: props.parsedProperties, props: props },
|
|
2219
|
+
React__default.createElement(RMTImage, { className: 'sb-message-template__image', alt: 'image', src: props.imageUrl, style: { width: '100%', height: '100%', aspectRatio: 'inherit', objectFit: 'inherit' }, tintColor: (_a = props.imageStyle) === null || _a === void 0 ? void 0 : _a.tintColor, metaData: props.metaData })));
|
|
2127
2220
|
},
|
|
2128
2221
|
textButton(props) {
|
|
2129
|
-
|
|
2222
|
+
const highlight = useHighlightStyle(props.rawProperties);
|
|
2223
|
+
return (React__default.createElement(ActionHandler, { className: clx('sb-message-template__text-button', highlight.className), inlineStyle: highlight.style, elementId: props.elementId, style: props.parsedProperties, props: props }, renderText(Object.assign({ maxTextLines: defaultProperties.textButton.maxTextLines }, props), highlight.renderText)));
|
|
2130
2224
|
},
|
|
2131
2225
|
imageButton(props) {
|
|
2132
2226
|
var _a;
|
|
2133
|
-
|
|
2134
|
-
|
|
2227
|
+
const highlight = useHighlightStyle(props.rawProperties);
|
|
2228
|
+
return (React__default.createElement(ActionHandler, { className: clx('sb-message-template__image-container', 'sb-message-template__image-button', highlight.className), inlineStyle: highlight.style, elementId: props.elementId, style: props.parsedProperties, props: props },
|
|
2229
|
+
React__default.createElement(RMTImage, { className: 'sb-message-template__image', alt: 'image-button', src: props.imageUrl, style: { width: '100%', height: '100%', aspectRatio: 'inherit', objectFit: 'inherit' }, tintColor: (_a = props.imageStyle) === null || _a === void 0 ? void 0 : _a.tintColor, metaData: props.metaData })));
|
|
2135
2230
|
},
|
|
2136
2231
|
carouselView(props) {
|
|
2137
2232
|
var _a, _b;
|
|
2138
|
-
|
|
2233
|
+
const highlight = useHighlightStyle(props.rawProperties);
|
|
2234
|
+
return (React__default.createElement(RMTCarousel, { className: clx('sb-message-template__carousel', highlight.className), inlineStyle: highlight.style, maxChildWidth: (_a = props.carouselStyle) === null || _a === void 0 ? void 0 : _a.maxChildWidth, spacing: (_b = props.carouselStyle) === null || _b === void 0 ? void 0 : _b.spacing, style: props.parsedProperties }, props.children));
|
|
2139
2235
|
},
|
|
2140
2236
|
},
|
|
2141
2237
|
});
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
}
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
mapImageButtonProps(props, options) {
|
|
2173
|
-
const styles = getDefaultStyles();
|
|
2174
|
-
setViewProps(styles, props, options);
|
|
2175
|
-
setImageStyle(styles, props.imageStyle);
|
|
2176
|
-
setImageAspectRatio(styles, props);
|
|
2177
|
-
return styles;
|
|
2178
|
-
},
|
|
2179
|
-
mapCarouselProps(props, options) {
|
|
2180
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2181
|
-
const styles = getDefaultStyles();
|
|
2182
|
-
setViewProps(styles, props, options);
|
|
2183
|
-
styles['paddingBlockStart'] = (_b = (_a = props.viewStyle) === null || _a === void 0 ? void 0 : _a.padding) === null || _b === void 0 ? void 0 : _b.top;
|
|
2184
|
-
styles['paddingBlockEnd'] = (_d = (_c = props.viewStyle) === null || _c === void 0 ? void 0 : _c.padding) === null || _d === void 0 ? void 0 : _d.bottom;
|
|
2185
|
-
styles['paddingInlineStart'] = (_f = (_e = props.viewStyle) === null || _e === void 0 ? void 0 : _e.padding) === null || _f === void 0 ? void 0 : _f.left;
|
|
2186
|
-
styles['paddingInlineEnd'] = (_h = (_g = props.viewStyle) === null || _g === void 0 ? void 0 : _g.padding) === null || _h === void 0 ? void 0 : _h.right;
|
|
2187
|
-
return styles;
|
|
2188
|
-
},
|
|
2189
|
-
});
|
|
2238
|
+
function convertNewlinesToBr(text, highlightText) {
|
|
2239
|
+
return text.split('\n').map((line, index) => (React__default.createElement(React__default.Fragment, { key: index },
|
|
2240
|
+
highlightText(line),
|
|
2241
|
+
React__default.createElement("br", null))));
|
|
2242
|
+
}
|
|
2243
|
+
function renderText(view, highlightText) {
|
|
2244
|
+
const { text, maxTextLines } = view;
|
|
2245
|
+
const isToBeWrapped = isFixedOrFill(view);
|
|
2246
|
+
const hasMaxLines = typeof maxTextLines === 'number' && maxTextLines > 0;
|
|
2247
|
+
const convertedText = convertNewlinesToBr(text, highlightText);
|
|
2248
|
+
if (hasMaxLines || isToBeWrapped) {
|
|
2249
|
+
const wrapperStyling = Object.assign(Object.assign({}, ((hasMaxLines || isToBeWrapped) && { maxWidth: '100%' })), (isToBeWrapped && { maxHeight: '100%', overflow: 'hidden' }));
|
|
2250
|
+
return (React__default.createElement("div", { style: wrapperStyling }, hasMaxLines ? React__default.createElement("div", { style: webkitLineClampStyles(maxTextLines) }, convertedText) : convertedText));
|
|
2251
|
+
}
|
|
2252
|
+
return hasMaxLines ? React__default.createElement("div", { style: webkitLineClampStyles(maxTextLines) }, convertedText) : convertedText;
|
|
2253
|
+
}
|
|
2254
|
+
/**
|
|
2255
|
+
* Text that is fixed or fill parent should be wrapped in a div with max-width: 100% and max-height: 100%
|
|
2256
|
+
* This is to prevent text from overflowing the padding of the container
|
|
2257
|
+
*/
|
|
2258
|
+
function isFixedOrFill(view) {
|
|
2259
|
+
var _a, _b, _c, _d;
|
|
2260
|
+
const heightType = (_a = view === null || view === void 0 ? void 0 : view.height) === null || _a === void 0 ? void 0 : _a.type;
|
|
2261
|
+
const widthType = (_b = view === null || view === void 0 ? void 0 : view.width) === null || _b === void 0 ? void 0 : _b.type;
|
|
2262
|
+
const isFixedDimension = heightType === 'fixed' || widthType === 'fixed';
|
|
2263
|
+
const isFill = (heightType === 'flex' && ((_c = view === null || view === void 0 ? void 0 : view.height) === null || _c === void 0 ? void 0 : _c.value) === FlexSizeSpecValue.FillParent) ||
|
|
2264
|
+
(widthType === 'flex' && ((_d = view === null || view === void 0 ? void 0 : view.width) === null || _d === void 0 ? void 0 : _d.value) === FlexSizeSpecValue.FillParent);
|
|
2265
|
+
return isFixedDimension || isFill;
|
|
2266
|
+
}
|
|
2267
|
+
|
|
2190
2268
|
createMessageTemplate({
|
|
2191
2269
|
renderer,
|
|
2192
2270
|
parser,
|
|
2193
2271
|
Container: ({ children, className }) => {
|
|
2194
|
-
return (React__default.createElement("div", { className: `sb-message-template__parent ${className}`, style: {
|
|
2195
|
-
display: 'flex',
|
|
2196
|
-
flexDirection: 'column',
|
|
2197
|
-
maxWidth: 400,
|
|
2198
|
-
marginBlockEnd: 24,
|
|
2199
|
-
} }, children));
|
|
2272
|
+
return (React__default.createElement("div", { className: `sb-message-template__parent ${className}`, style: { display: 'flex', flexDirection: 'column', maxWidth: 400, marginBlockEnd: 24 } }, children));
|
|
2200
2273
|
},
|
|
2201
2274
|
});
|
|
2202
2275
|
|
|
@@ -2217,4 +2290,4 @@ function MessageTemplate(_a) {
|
|
|
2217
2290
|
}
|
|
2218
2291
|
|
|
2219
2292
|
export { MessageProvider as M, MessageTemplate as a };
|
|
2220
|
-
//# sourceMappingURL=bundle-
|
|
2293
|
+
//# sourceMappingURL=bundle-CdILp5Ht.js.map
|