@sendbird/uikit-react 3.17.2 → 3.17.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/App.js +89 -89
- package/CHANGELOG.md +13 -0
- package/Channel/components/ChannelHeader.js +33 -33
- package/Channel/components/ChannelUI.js +68 -68
- package/Channel/components/FileViewer.js +31 -31
- package/Channel/components/FrozenNotification.js +6 -6
- package/Channel/components/Message.js +57 -57
- package/Channel/components/MessageInput.js +44 -44
- package/Channel/components/MessageInputWrapper.js +44 -44
- package/Channel/components/MessageList.js +61 -61
- package/Channel/components/RemoveMessageModal.js +30 -30
- package/Channel/components/SuggestedMentionList.js +30 -30
- package/Channel/components/TypingIndicator.js +9 -9
- package/Channel/components/UnreadCount.js +8 -8
- package/Channel/context.js +31 -30
- package/Channel/context.js.map +1 -1
- 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 +68 -68
- package/ChannelList/components/AddChannel.js +89 -89
- package/ChannelList/components/ChannelListHeader.js +13 -13
- package/ChannelList/components/ChannelListUI.js +89 -89
- package/ChannelList/components/ChannelPreview.js +32 -32
- package/ChannelList/components/ChannelPreviewAction.js +17 -17
- package/ChannelList/context.js +14 -14
- package/ChannelList.js +89 -89
- 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 +89 -89
- package/CreateChannel/components/InviteUsers.js +89 -89
- package/CreateChannel/components/SelectChannelType.js +89 -89
- package/CreateChannel/context.js +89 -89
- package/CreateChannel.js +89 -89
- 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 +57 -57
- 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 +89 -89
- package/GroupChannelList/components/GroupChannelListHeader.js +13 -13
- package/GroupChannelList/components/GroupChannelListItem.js +32 -32
- package/GroupChannelList/components/GroupChannelListUI.js +89 -89
- package/GroupChannelList/components/GroupChannelPreviewAction.js +17 -17
- package/GroupChannelList/context.js +10 -10
- package/GroupChannelList.js +89 -89
- 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 +25 -37
- package/SendbirdProvider.js.map +1 -1
- 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 +57 -56
- package/Thread/components/ThreadListItem.js.map +1 -1
- 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-ovCbHj17.js → bundle--Sz7RXuz.js} +4 -4
- package/chunks/bundle--Sz7RXuz.js.map +1 -0
- package/chunks/{bundle-BTe57HMb.js → bundle--jIqJVDq.js} +2 -2
- package/chunks/bundle--jIqJVDq.js.map +1 -0
- package/chunks/{bundle-DzW36hCC.js → bundle-0DrqmBzE.js} +1 -1
- package/chunks/bundle-0DrqmBzE.js.map +1 -0
- package/chunks/{bundle-CBbdUYu3.js → bundle-3npZm9P2.js} +8 -8
- package/chunks/{bundle-CBbdUYu3.js.map → bundle-3npZm9P2.js.map} +1 -1
- package/chunks/{bundle-CL4pMnNR.js → bundle-9BktfNFn.js} +3 -3
- package/chunks/{bundle-CL4pMnNR.js.map → bundle-9BktfNFn.js.map} +1 -1
- package/chunks/{bundle-CZELfPry.js → bundle-B-0NnLOm.js} +2 -2
- package/chunks/{bundle-CZELfPry.js.map → bundle-B-0NnLOm.js.map} +1 -1
- package/chunks/{bundle-BjGhphum.js → bundle-BEcHyg20.js} +5 -5
- package/chunks/bundle-BEcHyg20.js.map +1 -0
- package/chunks/{bundle-CW7sp9Ld.js → bundle-BGJm9kMZ.js} +8 -8
- package/chunks/bundle-BGJm9kMZ.js.map +1 -0
- package/chunks/{bundle-AOpqwRaJ.js → bundle-BGUnfEeP.js} +6 -6
- package/chunks/{bundle-AOpqwRaJ.js.map → bundle-BGUnfEeP.js.map} +1 -1
- package/chunks/{bundle-B3O9GNqv.js → bundle-BJOl_h3C.js} +1 -1
- package/chunks/bundle-BJOl_h3C.js.map +1 -0
- package/chunks/{bundle-DVZRgyYI.js → bundle-BKRfSnQL.js} +1 -1
- package/chunks/bundle-BKRfSnQL.js.map +1 -0
- package/chunks/{bundle-DYayy0Kj.js → bundle-BMDlBkMY.js} +2 -2
- package/chunks/bundle-BMDlBkMY.js.map +1 -0
- package/chunks/{bundle-DQ4NJFjI.js → bundle-BMV5F47t.js} +1 -1
- package/chunks/bundle-BMV5F47t.js.map +1 -0
- package/chunks/{bundle-CK34lvpA.js → bundle-BPlQDgVJ.js} +1 -1
- package/chunks/bundle-BPlQDgVJ.js.map +1 -0
- package/chunks/bundle-BRbBe6zP.js +25 -0
- package/chunks/bundle-BRbBe6zP.js.map +1 -0
- package/chunks/{bundle-Cz9AXaw7.js → bundle-BRuJjI60.js} +11 -8
- package/chunks/{bundle-Cz9AXaw7.js.map → bundle-BRuJjI60.js.map} +1 -1
- package/chunks/{bundle-BmiTBgG1.js → bundle-BRyFfKhh.js} +4 -4
- package/chunks/{bundle-BmiTBgG1.js.map → bundle-BRyFfKhh.js.map} +1 -1
- package/chunks/{bundle-DnHdryD_.js → bundle-BVI9Z3mE.js} +12 -12
- package/chunks/{bundle-DnHdryD_.js.map → bundle-BVI9Z3mE.js.map} +1 -1
- package/chunks/{bundle-CDfwyj6D.js → bundle-BY63oX3Q.js} +14 -14
- package/chunks/{bundle-CDfwyj6D.js.map → bundle-BY63oX3Q.js.map} +1 -1
- package/chunks/{bundle-Cg9VsWSo.js → bundle-B_xf4FTs.js} +1 -1
- package/chunks/bundle-B_xf4FTs.js.map +1 -0
- package/chunks/{bundle-Cne0PEpt.js → bundle-BdU8Ifxp.js} +10 -10
- package/chunks/{bundle-Cne0PEpt.js.map → bundle-BdU8Ifxp.js.map} +1 -1
- package/chunks/{bundle-CzMrfYTe.js → bundle-BiThSbiF.js} +3 -3
- package/chunks/bundle-BiThSbiF.js.map +1 -0
- package/chunks/{bundle-HJB6-gWU.js → bundle-BlIA910H.js} +1 -1
- package/chunks/bundle-BlIA910H.js.map +1 -0
- package/chunks/{bundle-zxsEkHB5.js → bundle-BmsBidSB.js} +1 -1
- package/chunks/bundle-BmsBidSB.js.map +1 -0
- package/chunks/{bundle-zm4HHnwp.js → bundle-BryieZDo.js} +1 -1
- package/chunks/bundle-BryieZDo.js.map +1 -0
- package/chunks/{bundle-Dzsn30px.js → bundle-Bsy6hKbm.js} +4 -4
- package/chunks/bundle-Bsy6hKbm.js.map +1 -0
- package/chunks/{bundle-nSggTugx.js → bundle-BsyrNhZs.js} +4 -4
- package/chunks/{bundle-nSggTugx.js.map → bundle-BsyrNhZs.js.map} +1 -1
- package/chunks/{bundle-DAJLIQZw.js → bundle-C1WYjzC2.js} +1 -1
- package/chunks/bundle-C1WYjzC2.js.map +1 -0
- package/chunks/{bundle-qNwshZLR.js → bundle-C4BYk9ql.js} +5 -5
- package/chunks/bundle-C4BYk9ql.js.map +1 -0
- package/chunks/{bundle-CKjna3wg.js → bundle-C8Jm3THq.js} +1 -1
- package/chunks/bundle-C8Jm3THq.js.map +1 -0
- package/chunks/{bundle-DMbIZ0fE.js → bundle-CDt2YO6x.js} +1 -1
- package/chunks/bundle-CDt2YO6x.js.map +1 -0
- package/chunks/{bundle-4P3PEixD.js → bundle-CEGR8YMs.js} +4 -4
- package/chunks/{bundle-DCEticsk.js.map → bundle-CEGR8YMs.js.map} +1 -1
- package/chunks/{bundle-Bhe0JUc_.js → bundle-CIYZ9f01.js} +4 -4
- package/chunks/{bundle-Bhe0JUc_.js.map → bundle-CIYZ9f01.js.map} +1 -1
- package/chunks/{bundle-CbGayeW1.js → bundle-CIsTqZWz.js} +3 -3
- package/chunks/bundle-CIsTqZWz.js.map +1 -0
- package/chunks/{bundle-Dntu5Q1l.js → bundle-CVyzdvX9.js} +3 -3
- package/chunks/bundle-CVyzdvX9.js.map +1 -0
- package/chunks/{bundle-DCEticsk.js → bundle-CY5T73qM.js} +5 -5
- package/chunks/{bundle-4P3PEixD.js.map → bundle-CY5T73qM.js.map} +1 -1
- package/chunks/{bundle-D6azoYzg.js → bundle-CZkmOxj6.js} +2 -2
- package/chunks/{bundle-D6azoYzg.js.map → bundle-CZkmOxj6.js.map} +1 -1
- package/chunks/{bundle-BDklsUYB.js → bundle-C_Vez3Fa.js} +7 -7
- package/chunks/{bundle-BDklsUYB.js.map → bundle-C_Vez3Fa.js.map} +1 -1
- package/chunks/{bundle-D7ZoQl6B.js → bundle-ChBQTryS.js} +1 -1
- package/chunks/bundle-ChBQTryS.js.map +1 -0
- package/chunks/{bundle-CtN4n7T1.js → bundle-Cjj-S0bl.js} +3 -3
- package/chunks/bundle-Cjj-S0bl.js.map +1 -0
- package/chunks/{bundle-zgyeFGxW.js → bundle-CkTNOTMo.js} +2 -2
- package/chunks/bundle-CkTNOTMo.js.map +1 -0
- package/chunks/{bundle-DhHNH4AC.js → bundle-CmXRAHD9.js} +33 -33
- package/chunks/{bundle-DhHNH4AC.js.map → bundle-CmXRAHD9.js.map} +1 -1
- package/chunks/{bundle-CEb_0mhS.js → bundle-CoGwS7Mb.js} +1 -1
- package/chunks/bundle-CoGwS7Mb.js.map +1 -0
- package/chunks/{bundle-DK0Va0Hb.js → bundle-Cv2la_lu.js} +2 -2
- package/chunks/bundle-Cv2la_lu.js.map +1 -0
- package/chunks/{bundle-DG5c1koB.js → bundle-CzVo31Pn.js} +9 -9
- package/chunks/{bundle-DG5c1koB.js.map → bundle-CzVo31Pn.js.map} +1 -1
- package/chunks/{bundle-BUba0pkq.js → bundle-D0Elh6NU.js} +10 -10
- package/chunks/{bundle-BUba0pkq.js.map → bundle-D0Elh6NU.js.map} +1 -1
- package/chunks/{bundle-BJ2mapxw.js → bundle-D2VSxItc.js} +1 -1
- package/chunks/bundle-D2VSxItc.js.map +1 -0
- package/chunks/{bundle-B9HkZJVl.js → bundle-D32PsH6z.js} +3 -3
- package/chunks/{bundle-B9HkZJVl.js.map → bundle-D32PsH6z.js.map} +1 -1
- package/chunks/{bundle-BtWZVL0Z.js → bundle-DAHfpZkx.js} +1 -1
- package/chunks/bundle-DAHfpZkx.js.map +1 -0
- package/chunks/{bundle-uVvibBmK.js → bundle-DBgwi1cE.js} +1 -1
- package/chunks/bundle-DBgwi1cE.js.map +1 -0
- package/chunks/{bundle-C-uQGUtK.js → bundle-DFbXkkgs.js} +4 -4
- package/chunks/bundle-DFbXkkgs.js.map +1 -0
- package/chunks/{bundle-BBtFrDLy.js → bundle-DKUTKvwE.js} +4 -4
- package/chunks/bundle-DKUTKvwE.js.map +1 -0
- package/chunks/{bundle-CHCBafXl.js → bundle-DKszPydP.js} +1 -1
- package/chunks/{bundle-CHCBafXl.js.map → bundle-DKszPydP.js.map} +1 -1
- package/chunks/{bundle-RFPu_1HD.js → bundle-DL3OLcNk.js} +1 -1
- package/chunks/{bundle-RFPu_1HD.js.map → bundle-DL3OLcNk.js.map} +1 -1
- package/chunks/{bundle-CstkgY4y.js → bundle-DN2z2JNq.js} +15 -15
- package/chunks/{bundle-CstkgY4y.js.map → bundle-DN2z2JNq.js.map} +1 -1
- package/chunks/{bundle-CPtt7fnf.js → bundle-DTJsSOC-.js} +1 -1
- package/chunks/bundle-DTJsSOC-.js.map +1 -0
- package/chunks/{bundle-BKnNFk3I.js → bundle-DWmNNvNj.js} +11 -11
- package/chunks/{bundle-BKnNFk3I.js.map → bundle-DWmNNvNj.js.map} +1 -1
- package/chunks/{bundle-DDdsgMpR.js → bundle-DYuSz-AU.js} +1 -1
- package/chunks/bundle-DYuSz-AU.js.map +1 -0
- package/chunks/{bundle-B9rLIDT2.js → bundle-DZTb5JPU.js} +5 -5
- package/chunks/{bundle-B9rLIDT2.js.map → bundle-DZTb5JPU.js.map} +1 -1
- package/chunks/{bundle-D7f8bGD2.js → bundle-D_Uq5DGe.js} +12 -12
- package/chunks/{bundle-D7f8bGD2.js.map → bundle-D_Uq5DGe.js.map} +1 -1
- package/chunks/{bundle-yxToVJTO.js → bundle-DbaLrmgZ.js} +8 -8
- package/chunks/bundle-DbaLrmgZ.js.map +1 -0
- package/chunks/{bundle-DWsP31gf.js → bundle-Dg-YjKZ9.js} +8 -8
- package/chunks/{bundle-DWsP31gf.js.map → bundle-Dg-YjKZ9.js.map} +1 -1
- package/chunks/{bundle-X8Nj-iGV.js → bundle-Dh1TZ15-.js} +2 -2
- package/chunks/bundle-Dh1TZ15-.js.map +1 -0
- package/chunks/{bundle-D0HLMr8A.js → bundle-DhYiP1-A.js} +1 -1
- package/chunks/bundle-DhYiP1-A.js.map +1 -0
- package/chunks/{bundle-B6fH-5rD.js → bundle-DlMteKWB.js} +1 -1
- package/chunks/bundle-DlMteKWB.js.map +1 -0
- package/chunks/{bundle-lHyjMBHE.js → bundle-DnDOkHAj.js} +1 -1
- package/chunks/bundle-DnDOkHAj.js.map +1 -0
- package/chunks/{bundle-CT4NqZ5W.js → bundle-DouvXxgX.js} +4 -4
- package/chunks/bundle-DouvXxgX.js.map +1 -0
- package/chunks/{bundle-DyW85C9e.js → bundle-DwPa2TQl.js} +6 -6
- package/chunks/bundle-DwPa2TQl.js.map +1 -0
- package/chunks/{bundle-BUrubWRP.js → bundle-DzE3HOwl.js} +13 -13
- package/chunks/{bundle-BUrubWRP.js.map → bundle-DzE3HOwl.js.map} +1 -1
- package/chunks/{bundle-BcmcHhQv.js → bundle-Fs1rDz4P.js} +1 -1
- package/chunks/{bundle-BcmcHhQv.js.map → bundle-Fs1rDz4P.js.map} +1 -1
- package/chunks/{bundle-WzqeulGV.js → bundle-Gpv20NNO.js} +7 -7
- package/chunks/bundle-Gpv20NNO.js.map +1 -0
- package/chunks/{bundle-D11FZYlw.js → bundle-LSjP4UWz.js} +6 -6
- package/chunks/bundle-LSjP4UWz.js.map +1 -0
- package/chunks/{bundle-efAHZQzS.js → bundle-NRV-gv1e.js} +4 -4
- package/chunks/{bundle-efAHZQzS.js.map → bundle-NRV-gv1e.js.map} +1 -1
- package/chunks/{bundle-DEkOOCXV.js → bundle-NYWLy13i.js} +4 -4
- package/chunks/bundle-NYWLy13i.js.map +1 -0
- package/chunks/{bundle-DJpACjBj.js → bundle-OGT22p-k.js} +7 -7
- package/{cjs/chunks/bundle-79zaNhm6.js.map → chunks/bundle-OGT22p-k.js.map} +1 -1
- package/chunks/bundle-OZw0fjH_.js +18424 -0
- package/chunks/bundle-OZw0fjH_.js.map +1 -0
- package/chunks/{bundle-BeJM_2bp.js → bundle-PFmHN7Jy.js} +3 -3
- package/chunks/bundle-PFmHN7Jy.js.map +1 -0
- package/chunks/{bundle-BtftT-cX.js → bundle-S8iPYCSA.js} +3 -3
- package/chunks/bundle-S8iPYCSA.js.map +1 -0
- package/chunks/{bundle-DFhwS44-.js → bundle-UvB7bADv.js} +1 -1
- package/chunks/bundle-UvB7bADv.js.map +1 -0
- package/chunks/{bundle-D9zEvquw.js → bundle-V-9Qd25h.js} +1 -1
- package/chunks/bundle-V-9Qd25h.js.map +1 -0
- package/chunks/{bundle-BFv38Gwl.js → bundle-XfyVGKnP.js} +1 -1
- package/chunks/{bundle-BFv38Gwl.js.map → bundle-XfyVGKnP.js.map} +1 -1
- package/chunks/{bundle-DbQ0puKt.js → bundle-XsV26VlN.js} +14 -14
- package/chunks/{bundle-DbQ0puKt.js.map → bundle-XsV26VlN.js.map} +1 -1
- package/chunks/{bundle-BYph6xb0.js → bundle-_OBfDye7.js} +3 -3
- package/chunks/{bundle-BYph6xb0.js.map → bundle-_OBfDye7.js.map} +1 -1
- package/chunks/{bundle-DXF932mD.js → bundle-_a6gAil7.js} +4 -4
- package/chunks/{bundle-DXF932mD.js.map → bundle-_a6gAil7.js.map} +1 -1
- package/chunks/{bundle-C25uvOTt.js → bundle-_bSKasth.js} +5 -5
- package/chunks/{bundle-C25uvOTt.js.map → bundle-_bSKasth.js.map} +1 -1
- package/chunks/{bundle--4FMUr0G.js → bundle-gHhQTuPR.js} +9 -9
- package/chunks/{bundle--4FMUr0G.js.map → bundle-gHhQTuPR.js.map} +1 -1
- package/chunks/{bundle-QsOY54vw.js → bundle-gZKU5nBj.js} +5 -5
- package/chunks/{bundle-QsOY54vw.js.map → bundle-gZKU5nBj.js.map} +1 -1
- package/chunks/{bundle-CXLeqXm5.js → bundle-qYHiUYZu.js} +2 -2
- package/chunks/{bundle-CXLeqXm5.js.map → bundle-qYHiUYZu.js.map} +1 -1
- package/chunks/{bundle-BI-kvvZ9.js → bundle-sqC3xa1V.js} +12 -12
- package/chunks/{bundle-BI-kvvZ9.js.map → bundle-sqC3xa1V.js.map} +1 -1
- package/chunks/{bundle-C9cE3NlS.js → bundle-wBnda9SZ.js} +1 -1
- package/chunks/{bundle-C9cE3NlS.js.map → bundle-wBnda9SZ.js.map} +1 -1
- package/chunks/{bundle-CLpNliIV.js → bundle-wXiJmfh6.js} +1 -1
- package/chunks/bundle-wXiJmfh6.js.map +1 -0
- package/chunks/{bundle-Cp7gI7g9.js → bundle-z5vWj8Ty.js} +7 -7
- package/chunks/bundle-z5vWj8Ty.js.map +1 -0
- package/cjs/App.js +89 -89
- package/cjs/Channel/components/ChannelHeader.js +33 -33
- package/cjs/Channel/components/ChannelUI.js +68 -68
- package/cjs/Channel/components/FileViewer.js +31 -31
- package/cjs/Channel/components/FrozenNotification.js +6 -6
- package/cjs/Channel/components/Message.js +57 -57
- package/cjs/Channel/components/MessageInput.js +44 -44
- package/cjs/Channel/components/MessageInputWrapper.js +44 -44
- package/cjs/Channel/components/MessageList.js +61 -61
- package/cjs/Channel/components/RemoveMessageModal.js +30 -30
- package/cjs/Channel/components/SuggestedMentionList.js +30 -30
- package/cjs/Channel/components/TypingIndicator.js +9 -9
- package/cjs/Channel/components/UnreadCount.js +8 -8
- package/cjs/Channel/context.js +31 -30
- package/cjs/Channel/context.js.map +1 -1
- 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 +68 -68
- package/cjs/ChannelList/components/AddChannel.js +89 -89
- package/cjs/ChannelList/components/ChannelListHeader.js +13 -13
- package/cjs/ChannelList/components/ChannelListUI.js +89 -89
- 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 +89 -89
- 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 +89 -89
- package/cjs/CreateChannel/components/InviteUsers.js +89 -89
- package/cjs/CreateChannel/components/SelectChannelType.js +89 -89
- package/cjs/CreateChannel/context.js +89 -89
- package/cjs/CreateChannel.js +89 -89
- 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 +57 -57
- 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 +89 -89
- package/cjs/GroupChannelList/components/GroupChannelListHeader.js +13 -13
- package/cjs/GroupChannelList/components/GroupChannelListItem.js +32 -32
- package/cjs/GroupChannelList/components/GroupChannelListUI.js +89 -89
- package/cjs/GroupChannelList/components/GroupChannelPreviewAction.js +17 -17
- package/cjs/GroupChannelList/context.js +10 -10
- package/cjs/GroupChannelList.js +89 -89
- 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 +25 -37
- package/cjs/SendbirdProvider.js.map +1 -1
- 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 +57 -56
- package/cjs/Thread/components/ThreadListItem.js.map +1 -1
- 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-o7bJmsVG.js → bundle-3nGXbnX_.js} +3 -3
- package/cjs/chunks/bundle-3nGXbnX_.js.map +1 -0
- package/cjs/chunks/{bundle-79zaNhm6.js → bundle-3v0pwJ9H.js} +8 -8
- package/{chunks/bundle-DJpACjBj.js.map → cjs/chunks/bundle-3v0pwJ9H.js.map} +1 -1
- package/cjs/chunks/{bundle-qNUnRJ-F.js → bundle-5jlfy1Ow.js} +1 -1
- package/cjs/chunks/bundle-5jlfy1Ow.js.map +1 -0
- package/cjs/chunks/{bundle-DJvJxkZV.js → bundle-ANdi3dSr.js} +12 -12
- package/cjs/chunks/bundle-ANdi3dSr.js.map +1 -0
- package/cjs/chunks/{bundle-FMDbM74k.js → bundle-B-KfKK9I.js} +12 -12
- package/cjs/chunks/{bundle-FMDbM74k.js.map → bundle-B-KfKK9I.js.map} +1 -1
- package/cjs/chunks/{bundle-BdnzjZUX.js → bundle-B2IxWnYD.js} +1 -1
- package/cjs/chunks/bundle-B2IxWnYD.js.map +1 -0
- package/cjs/chunks/{bundle-CWVSskOQ.js → bundle-B2alsqqW.js} +5 -5
- package/cjs/chunks/{bundle-CWVSskOQ.js.map → bundle-B2alsqqW.js.map} +1 -1
- package/cjs/chunks/{bundle-D1jvTvhG.js → bundle-B5ka_Awd.js} +5 -5
- package/cjs/chunks/bundle-B5ka_Awd.js.map +1 -0
- package/cjs/chunks/{bundle-REYf6P50.js → bundle-B60m32Xw.js} +4 -4
- package/cjs/chunks/bundle-B60m32Xw.js.map +1 -0
- package/cjs/chunks/{bundle-BeuUz2c0.js → bundle-B9-_x93L.js} +1 -1
- package/cjs/chunks/bundle-B9-_x93L.js.map +1 -0
- package/cjs/chunks/{bundle-HERYYUXZ.js → bundle-BFC91Brx.js} +4 -3
- package/cjs/chunks/{bundle-HERYYUXZ.js.map → bundle-BFC91Brx.js.map} +1 -1
- package/cjs/chunks/{bundle-DdEJUQ3V.js → bundle-BHWIGgxj.js} +1 -1
- package/cjs/chunks/bundle-BHWIGgxj.js.map +1 -0
- package/cjs/chunks/{bundle-DVUhCk1f.js → bundle-BIc5sJq4.js} +1 -1
- package/cjs/chunks/bundle-BIc5sJq4.js.map +1 -0
- package/cjs/chunks/{bundle-BUPw_lsA.js → bundle-BIrJktBj.js} +6 -6
- package/cjs/chunks/{bundle-BUPw_lsA.js.map → bundle-BIrJktBj.js.map} +1 -1
- package/cjs/chunks/{bundle-Bj7CL3aP.js → bundle-BJTLq5Qc.js} +3 -3
- package/cjs/chunks/bundle-BJTLq5Qc.js.map +1 -0
- package/cjs/chunks/{bundle-HkyQ0DjT.js → bundle-BOXscfXF.js} +1 -1
- package/cjs/chunks/bundle-BOXscfXF.js.map +1 -0
- package/cjs/chunks/{bundle-Dlhvq6qJ.js → bundle-BP4TYvv9.js} +2 -2
- package/cjs/chunks/bundle-BP4TYvv9.js.map +1 -0
- package/cjs/chunks/{bundle-u5TfAXpt.js → bundle-BPU8mjJt.js} +1 -1
- package/cjs/chunks/bundle-BPU8mjJt.js.map +1 -0
- package/cjs/chunks/{bundle-BE-eUbjS.js → bundle-BPpTAdQ0.js} +1 -1
- package/cjs/chunks/bundle-BPpTAdQ0.js.map +1 -0
- package/cjs/chunks/{bundle-BhbLo6cR.js → bundle-BQleL0j9.js} +9 -9
- package/cjs/chunks/{bundle-BhbLo6cR.js.map → bundle-BQleL0j9.js.map} +1 -1
- package/cjs/chunks/{bundle-kfqOElgK.js → bundle-BUUiEWpE.js} +1 -1
- package/cjs/chunks/bundle-BUUiEWpE.js.map +1 -0
- package/cjs/chunks/{bundle-n_eAVYbo.js → bundle-BVql4NX6.js} +1 -1
- package/cjs/chunks/bundle-BVql4NX6.js.map +1 -0
- package/cjs/chunks/{bundle-D6n8A6Zc.js → bundle-BWp2X_eQ.js} +3 -3
- package/cjs/chunks/bundle-BWp2X_eQ.js.map +1 -0
- package/cjs/chunks/{bundle-Ca4uPUG4.js → bundle-BZ1V9b9g.js} +3 -3
- package/cjs/chunks/bundle-BZ1V9b9g.js.map +1 -0
- package/cjs/chunks/{bundle-iWfMmu2k.js → bundle-BeQVnmH2.js} +2 -2
- package/cjs/chunks/bundle-BeQVnmH2.js.map +1 -0
- package/cjs/chunks/{bundle-DIhzbA62.js → bundle-BgvfZZPM.js} +5 -5
- package/cjs/chunks/{bundle-DIhzbA62.js.map → bundle-BgvfZZPM.js.map} +1 -1
- package/cjs/chunks/{bundle-DY3OUu9y.js → bundle-BjmGIkhj.js} +4 -4
- package/cjs/chunks/bundle-BjmGIkhj.js.map +1 -0
- package/cjs/chunks/{bundle-CjgU3l0w.js → bundle-Bk9VYI5o.js} +7 -7
- package/cjs/chunks/bundle-Bk9VYI5o.js.map +1 -0
- package/cjs/chunks/{bundle-C8vJRfhx.js → bundle-BmRxveyV.js} +1 -1
- package/cjs/chunks/bundle-BmRxveyV.js.map +1 -0
- package/cjs/chunks/{bundle-D-DJSLcL.js → bundle-Bo7hpkHl.js} +4 -4
- package/cjs/chunks/bundle-Bo7hpkHl.js.map +1 -0
- package/cjs/chunks/{bundle-Cch-IjCG.js → bundle-Bq2Z8KaT.js} +5 -5
- package/cjs/chunks/{bundle-Cch-IjCG.js.map → bundle-Bq2Z8KaT.js.map} +1 -1
- package/cjs/chunks/{bundle-B4Oz6Uwy.js → bundle-Bvv5CPc1.js} +4 -4
- package/cjs/chunks/bundle-Bvv5CPc1.js.map +1 -0
- package/cjs/chunks/{bundle-D66YmzI6.js → bundle-C-cKMVK5.js} +3 -3
- package/cjs/chunks/{bundle-D66YmzI6.js.map → bundle-C-cKMVK5.js.map} +1 -1
- package/cjs/chunks/{bundle-y6-ks46c.js → bundle-C0tjOrov.js} +3 -3
- package/cjs/chunks/bundle-C0tjOrov.js.map +1 -0
- package/cjs/chunks/{bundle-fiSori_W.js → bundle-C2IX5TkS.js} +8 -8
- package/cjs/chunks/bundle-C2IX5TkS.js.map +1 -0
- package/cjs/chunks/{bundle-CyJimqL9.js → bundle-C3KlPyot.js} +1 -1
- package/cjs/chunks/bundle-C3KlPyot.js.map +1 -0
- package/cjs/chunks/{bundle-NjC1jT1F.js → bundle-C4QGWug2.js} +4 -4
- package/cjs/chunks/{bundle-NjC1jT1F.js.map → bundle-C4QGWug2.js.map} +1 -1
- package/cjs/chunks/{bundle-C7WnFc5I.js → bundle-C6KW6xda.js} +1 -1
- package/cjs/chunks/{bundle-C7WnFc5I.js.map → bundle-C6KW6xda.js.map} +1 -1
- package/cjs/chunks/{bundle-kYn7Bizj.js → bundle-CDN8qW7X.js} +1 -1
- package/cjs/chunks/bundle-CDN8qW7X.js.map +1 -0
- package/cjs/chunks/{bundle-WPa3lxwD.js → bundle-CEZgsFmJ.js} +2 -2
- package/cjs/chunks/bundle-CEZgsFmJ.js.map +1 -0
- package/cjs/chunks/{bundle-CcK34zhy.js → bundle-CEyLNVvS.js} +2 -2
- package/cjs/chunks/bundle-CEyLNVvS.js.map +1 -0
- package/cjs/chunks/{bundle-BmtTyZzB.js → bundle-CIKnkotk.js} +1 -1
- package/cjs/chunks/bundle-CIKnkotk.js.map +1 -0
- package/cjs/chunks/{bundle-CVQ76olT.js → bundle-CLuHDUOQ.js} +10 -10
- package/cjs/chunks/bundle-CLuHDUOQ.js.map +1 -0
- package/cjs/chunks/{bundle-C7Bcsoej.js → bundle-CM1ECWyg.js} +4 -4
- package/cjs/chunks/bundle-CM1ECWyg.js.map +1 -0
- package/cjs/chunks/{bundle-D2ybBuHx.js → bundle-CSZcx-m7.js} +6 -6
- package/cjs/chunks/bundle-CSZcx-m7.js.map +1 -0
- package/cjs/chunks/{bundle-BH5CILPf.js → bundle-CTOCmxIS.js} +5 -5
- package/cjs/chunks/{bundle-BH5CILPf.js.map → bundle-CTOCmxIS.js.map} +1 -1
- package/cjs/chunks/{bundle-DB678BVx.js → bundle-CWhEqpIO.js} +13 -13
- package/cjs/chunks/bundle-CWhEqpIO.js.map +1 -0
- package/cjs/chunks/{bundle-DB3ydfO3.js → bundle-CY-mROcZ.js} +1 -1
- package/cjs/chunks/bundle-CY-mROcZ.js.map +1 -0
- package/cjs/chunks/{bundle-DwuvGkzI.js → bundle-CYK_lspp.js} +2 -2
- package/cjs/chunks/bundle-CYK_lspp.js.map +1 -0
- package/cjs/chunks/{bundle-DCvOEf9J.js → bundle-CZYADtQm.js} +12 -12
- package/cjs/chunks/{bundle-DCvOEf9J.js.map → bundle-CZYADtQm.js.map} +1 -1
- package/cjs/chunks/{bundle-eh-C24Pj.js → bundle-CapDmj2N.js} +7 -7
- package/cjs/chunks/bundle-CapDmj2N.js.map +1 -0
- package/cjs/chunks/{bundle-fVfMBori.js → bundle-Ci9Z8Gx1.js} +1 -1
- package/cjs/chunks/bundle-Ci9Z8Gx1.js.map +1 -0
- package/cjs/chunks/{bundle-D6mmpicY.js → bundle-CieeZY6s.js} +4 -4
- package/cjs/chunks/bundle-CieeZY6s.js.map +1 -0
- package/cjs/chunks/{bundle-C9bb3iWF.js → bundle-Cio3geXX.js} +3 -3
- package/cjs/chunks/bundle-Cio3geXX.js.map +1 -0
- package/cjs/chunks/{bundle-DWBI0JnU.js → bundle-Cjvq2ZOT.js} +1 -1
- package/cjs/chunks/bundle-Cjvq2ZOT.js.map +1 -0
- package/cjs/chunks/{bundle-JnXL26UL.js → bundle-CoT59Mpu.js} +33 -33
- package/cjs/chunks/{bundle-JnXL26UL.js.map → bundle-CoT59Mpu.js.map} +1 -1
- package/cjs/chunks/{bundle-D8sLPMwd.js → bundle-CrB7AETR.js} +11 -11
- package/cjs/chunks/{bundle-D8sLPMwd.js.map → bundle-CrB7AETR.js.map} +1 -1
- package/cjs/chunks/{bundle-Dc6k4jof.js → bundle-CtpWAlqw.js} +1 -1
- package/cjs/chunks/bundle-CtpWAlqw.js.map +1 -0
- package/cjs/chunks/{bundle-BAy4Z2n_.js → bundle-D9VNRYiT.js} +1 -1
- package/cjs/chunks/{bundle-BAy4Z2n_.js.map → bundle-D9VNRYiT.js.map} +1 -1
- package/cjs/chunks/{bundle-rpradL3a.js → bundle-DDvS9HEb.js} +10 -10
- package/cjs/chunks/bundle-DDvS9HEb.js.map +1 -0
- package/cjs/chunks/{bundle-DnXtQcIG.js → bundle-DH-nEckd.js} +1 -1
- package/cjs/chunks/bundle-DH-nEckd.js.map +1 -0
- package/cjs/chunks/{bundle-CyQuENXQ.js → bundle-DWK3fan8.js} +3 -3
- package/cjs/chunks/{bundle-CyQuENXQ.js.map → bundle-DWK3fan8.js.map} +1 -1
- package/cjs/chunks/{bundle-DYiDFr98.js → bundle-DYREwheh.js} +1 -1
- package/cjs/chunks/bundle-DYREwheh.js.map +1 -0
- package/cjs/chunks/{bundle-BWLRRAFI.js → bundle-DZLiR5dN.js} +7 -7
- package/cjs/chunks/{bundle-BWLRRAFI.js.map → bundle-DZLiR5dN.js.map} +1 -1
- package/cjs/chunks/{bundle-Bv2i41gB.js → bundle-DbbuwUMm.js} +8 -8
- package/cjs/chunks/bundle-DbbuwUMm.js.map +1 -0
- package/cjs/chunks/{bundle-D0cv-92J.js → bundle-DeaZ2PrP.js} +4 -4
- package/cjs/chunks/bundle-DeaZ2PrP.js.map +1 -0
- package/cjs/chunks/{bundle-Buhp9vb2.js → bundle-DfqFZ2kQ.js} +14 -14
- package/cjs/chunks/bundle-DfqFZ2kQ.js.map +1 -0
- package/cjs/chunks/{bundle-DFpSNLcN.js → bundle-Dg48fEl9.js} +1 -1
- package/cjs/chunks/bundle-Dg48fEl9.js.map +1 -0
- package/cjs/chunks/{bundle-C73YyNPC.js → bundle-Dg8Ui-Gg.js} +1 -1
- package/cjs/chunks/bundle-Dg8Ui-Gg.js.map +1 -0
- package/cjs/chunks/{bundle-Cy9Fl47U.js → bundle-DjmBE7_s.js} +4 -4
- package/cjs/chunks/bundle-DjmBE7_s.js.map +1 -0
- package/cjs/chunks/{bundle-DJVUSyDL.js → bundle-DmcomVs0.js} +4 -4
- package/cjs/chunks/bundle-DmcomVs0.js.map +1 -0
- package/cjs/chunks/{bundle-CejczCsL.js → bundle-DnJDR4u5.js} +14 -14
- package/cjs/chunks/{bundle-CejczCsL.js.map → bundle-DnJDR4u5.js.map} +1 -1
- package/cjs/chunks/{bundle-DowCzqdD.js → bundle-DoIfqfcV.js} +15 -15
- package/cjs/chunks/{bundle-DowCzqdD.js.map → bundle-DoIfqfcV.js.map} +1 -1
- package/cjs/chunks/{bundle-L5zC6xWM.js → bundle-DqXYRRO7.js} +1 -1
- package/cjs/chunks/bundle-DqXYRRO7.js.map +1 -0
- package/cjs/chunks/{bundle-BOXZxrtw.js → bundle-Du3meFk3.js} +5 -5
- package/cjs/chunks/bundle-Du3meFk3.js.map +1 -0
- package/cjs/chunks/{bundle-B0RkFDeK.js → bundle-DvPryEJn.js} +3 -3
- package/cjs/chunks/bundle-DvPryEJn.js.map +1 -0
- package/cjs/chunks/{bundle-BrHynphF.js → bundle-DxCwRDJR.js} +6 -6
- package/cjs/chunks/bundle-DxCwRDJR.js.map +1 -0
- package/cjs/chunks/{bundle-CTz3qwYY.js → bundle-DzXjLE21.js} +11 -8
- package/cjs/chunks/bundle-DzXjLE21.js.map +1 -0
- package/cjs/chunks/{bundle-CEY5QNl7.js → bundle-EMsvSkjF.js} +1 -1
- package/cjs/chunks/{bundle-CEY5QNl7.js.map → bundle-EMsvSkjF.js.map} +1 -1
- package/cjs/chunks/{bundle-BpZvuLdm.js → bundle-KIOZb3ks.js} +1 -1
- package/cjs/chunks/bundle-KIOZb3ks.js.map +1 -0
- package/cjs/chunks/{bundle-v95Xmjt9.js → bundle-LKI8DB23.js} +7 -7
- package/cjs/chunks/bundle-LKI8DB23.js.map +1 -0
- package/cjs/chunks/{bundle-JR9-1BeM.js → bundle-LgVwQzf4.js} +1 -1
- package/cjs/chunks/bundle-LgVwQzf4.js.map +1 -0
- package/cjs/chunks/{bundle-oo08qJuT.js → bundle-QrcqdsaB.js} +2 -2
- package/cjs/chunks/{bundle-oo08qJuT.js.map → bundle-QrcqdsaB.js.map} +1 -1
- package/cjs/chunks/{bundle-B46s7hdu.js → bundle-SAAHguUX.js} +9 -9
- package/cjs/chunks/{bundle-B46s7hdu.js.map → bundle-SAAHguUX.js.map} +1 -1
- package/cjs/chunks/{bundle-OV9QvRP8.js → bundle-b-GMoXo9.js} +8 -8
- package/cjs/chunks/bundle-b-GMoXo9.js.map +1 -0
- package/cjs/chunks/{bundle-ti8uh3us.js → bundle-eL933_es.js} +4 -4
- package/cjs/chunks/bundle-eL933_es.js.map +1 -0
- package/cjs/chunks/bundle-kN_YmX6K.js +18435 -0
- package/cjs/chunks/bundle-kN_YmX6K.js.map +1 -0
- package/cjs/chunks/{bundle-H44hyvFN.js → bundle-mDwFNnD9.js} +2 -2
- package/cjs/chunks/bundle-mDwFNnD9.js.map +1 -0
- package/cjs/chunks/{bundle-DFNM8KjC.js → bundle-rBcfDSMC.js} +1 -1
- package/cjs/chunks/bundle-rBcfDSMC.js.map +1 -0
- package/cjs/chunks/bundle-rpg5uLhA.js +32 -0
- package/cjs/chunks/bundle-rpg5uLhA.js.map +1 -0
- package/cjs/chunks/{bundle-CHvo3SHq.js → bundle-yeJtF1C-.js} +1 -1
- package/cjs/chunks/bundle-yeJtF1C-.js.map +1 -0
- package/cjs/chunks/{bundle-CXT12hPo.js → bundle-yj3Q8bOY.js} +2 -2
- package/cjs/chunks/bundle-yj3Q8bOY.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 +90 -90
- 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 +23 -21
- package/cjs/ui/MessageInput.js.map +1 -1
- 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 +15 -15
- 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 +24 -24
- package/dist/index.css +0 -98
- package/hooks/useConnectionState.js +5 -5
- package/hooks/useLocalization.js +4 -4
- package/hooks/useModal.js +14 -14
- package/index.js +90 -90
- package/package.json +4 -4
- package/pubSub/topics.js +1 -1
- package/sendbirdSelectors.js +2 -2
- package/types/ui/MessageInput/utils.d.ts +1 -0
- 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 +23 -21
- package/ui/MessageInput.js.map +1 -1
- 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 +15 -15
- 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 +24 -24
- package/chunks/bundle-B3O9GNqv.js.map +0 -1
- package/chunks/bundle-B6fH-5rD.js.map +0 -1
- package/chunks/bundle-BBtFrDLy.js.map +0 -1
- package/chunks/bundle-BJ2mapxw.js.map +0 -1
- package/chunks/bundle-BTe57HMb.js.map +0 -1
- package/chunks/bundle-BeJM_2bp.js.map +0 -1
- package/chunks/bundle-BjGhphum.js.map +0 -1
- package/chunks/bundle-BtWZVL0Z.js.map +0 -1
- package/chunks/bundle-BtftT-cX.js.map +0 -1
- package/chunks/bundle-C-uQGUtK.js.map +0 -1
- package/chunks/bundle-CEb_0mhS.js.map +0 -1
- package/chunks/bundle-CK34lvpA.js.map +0 -1
- package/chunks/bundle-CKjna3wg.js.map +0 -1
- package/chunks/bundle-CLpNliIV.js.map +0 -1
- package/chunks/bundle-COtGnAne.js +0 -2293
- package/chunks/bundle-COtGnAne.js.map +0 -1
- package/chunks/bundle-CPtt7fnf.js.map +0 -1
- package/chunks/bundle-CT4NqZ5W.js.map +0 -1
- package/chunks/bundle-CW7sp9Ld.js.map +0 -1
- package/chunks/bundle-CX0G3jkG.js +0 -1206
- package/chunks/bundle-CX0G3jkG.js.map +0 -1
- package/chunks/bundle-CbGayeW1.js.map +0 -1
- package/chunks/bundle-Cg9VsWSo.js.map +0 -1
- package/chunks/bundle-Cp7gI7g9.js.map +0 -1
- package/chunks/bundle-CtN4n7T1.js.map +0 -1
- package/chunks/bundle-CzMrfYTe.js.map +0 -1
- package/chunks/bundle-D0HLMr8A.js.map +0 -1
- package/chunks/bundle-D11FZYlw.js.map +0 -1
- package/chunks/bundle-D7ZoQl6B.js.map +0 -1
- package/chunks/bundle-D9zEvquw.js.map +0 -1
- package/chunks/bundle-DAJLIQZw.js.map +0 -1
- package/chunks/bundle-DDdsgMpR.js.map +0 -1
- package/chunks/bundle-DEkOOCXV.js.map +0 -1
- package/chunks/bundle-DFhwS44-.js.map +0 -1
- package/chunks/bundle-DK0Va0Hb.js.map +0 -1
- package/chunks/bundle-DMbIZ0fE.js.map +0 -1
- package/chunks/bundle-DQ4NJFjI.js.map +0 -1
- package/chunks/bundle-DVZRgyYI.js.map +0 -1
- package/chunks/bundle-DYayy0Kj.js.map +0 -1
- package/chunks/bundle-Dntu5Q1l.js.map +0 -1
- package/chunks/bundle-DyW85C9e.js.map +0 -1
- package/chunks/bundle-DzW36hCC.js.map +0 -1
- package/chunks/bundle-Dzsn30px.js.map +0 -1
- package/chunks/bundle-HJB6-gWU.js.map +0 -1
- package/chunks/bundle-WzqeulGV.js.map +0 -1
- package/chunks/bundle-X8Nj-iGV.js.map +0 -1
- package/chunks/bundle-lHyjMBHE.js.map +0 -1
- package/chunks/bundle-ovCbHj17.js.map +0 -1
- package/chunks/bundle-qNwshZLR.js.map +0 -1
- package/chunks/bundle-uVvibBmK.js.map +0 -1
- package/chunks/bundle-yxToVJTO.js.map +0 -1
- package/chunks/bundle-zgyeFGxW.js.map +0 -1
- package/chunks/bundle-zm4HHnwp.js.map +0 -1
- package/chunks/bundle-zxsEkHB5.js.map +0 -1
- package/cjs/chunks/bundle-B0RkFDeK.js.map +0 -1
- package/cjs/chunks/bundle-B4Oz6Uwy.js.map +0 -1
- package/cjs/chunks/bundle-BE-eUbjS.js.map +0 -1
- package/cjs/chunks/bundle-BL6JVo1H.js +0 -1217
- package/cjs/chunks/bundle-BL6JVo1H.js.map +0 -1
- package/cjs/chunks/bundle-BOXZxrtw.js.map +0 -1
- package/cjs/chunks/bundle-BdnzjZUX.js.map +0 -1
- package/cjs/chunks/bundle-BeuUz2c0.js.map +0 -1
- package/cjs/chunks/bundle-Bj7CL3aP.js.map +0 -1
- package/cjs/chunks/bundle-BmtTyZzB.js.map +0 -1
- package/cjs/chunks/bundle-BpZvuLdm.js.map +0 -1
- package/cjs/chunks/bundle-BrHynphF.js.map +0 -1
- package/cjs/chunks/bundle-BrzJTkCk.js +0 -2300
- package/cjs/chunks/bundle-BrzJTkCk.js.map +0 -1
- package/cjs/chunks/bundle-Buhp9vb2.js.map +0 -1
- package/cjs/chunks/bundle-Bv2i41gB.js.map +0 -1
- package/cjs/chunks/bundle-C73YyNPC.js.map +0 -1
- package/cjs/chunks/bundle-C7Bcsoej.js.map +0 -1
- package/cjs/chunks/bundle-C8vJRfhx.js.map +0 -1
- package/cjs/chunks/bundle-C9bb3iWF.js.map +0 -1
- package/cjs/chunks/bundle-CHvo3SHq.js.map +0 -1
- package/cjs/chunks/bundle-CTz3qwYY.js.map +0 -1
- package/cjs/chunks/bundle-CVQ76olT.js.map +0 -1
- package/cjs/chunks/bundle-CXT12hPo.js.map +0 -1
- package/cjs/chunks/bundle-Ca4uPUG4.js.map +0 -1
- package/cjs/chunks/bundle-CcK34zhy.js.map +0 -1
- package/cjs/chunks/bundle-CjgU3l0w.js.map +0 -1
- package/cjs/chunks/bundle-Cy9Fl47U.js.map +0 -1
- package/cjs/chunks/bundle-CyJimqL9.js.map +0 -1
- package/cjs/chunks/bundle-D-DJSLcL.js.map +0 -1
- package/cjs/chunks/bundle-D0cv-92J.js.map +0 -1
- package/cjs/chunks/bundle-D1jvTvhG.js.map +0 -1
- package/cjs/chunks/bundle-D2ybBuHx.js.map +0 -1
- package/cjs/chunks/bundle-D6mmpicY.js.map +0 -1
- package/cjs/chunks/bundle-D6n8A6Zc.js.map +0 -1
- package/cjs/chunks/bundle-DB3ydfO3.js.map +0 -1
- package/cjs/chunks/bundle-DB678BVx.js.map +0 -1
- package/cjs/chunks/bundle-DFNM8KjC.js.map +0 -1
- package/cjs/chunks/bundle-DFpSNLcN.js.map +0 -1
- package/cjs/chunks/bundle-DJVUSyDL.js.map +0 -1
- package/cjs/chunks/bundle-DJvJxkZV.js.map +0 -1
- package/cjs/chunks/bundle-DVUhCk1f.js.map +0 -1
- package/cjs/chunks/bundle-DWBI0JnU.js.map +0 -1
- package/cjs/chunks/bundle-DY3OUu9y.js.map +0 -1
- package/cjs/chunks/bundle-DYiDFr98.js.map +0 -1
- package/cjs/chunks/bundle-Dc6k4jof.js.map +0 -1
- package/cjs/chunks/bundle-DdEJUQ3V.js.map +0 -1
- package/cjs/chunks/bundle-Dlhvq6qJ.js.map +0 -1
- package/cjs/chunks/bundle-DnXtQcIG.js.map +0 -1
- package/cjs/chunks/bundle-DwuvGkzI.js.map +0 -1
- package/cjs/chunks/bundle-H44hyvFN.js.map +0 -1
- package/cjs/chunks/bundle-HkyQ0DjT.js.map +0 -1
- package/cjs/chunks/bundle-JR9-1BeM.js.map +0 -1
- package/cjs/chunks/bundle-L5zC6xWM.js.map +0 -1
- package/cjs/chunks/bundle-OV9QvRP8.js.map +0 -1
- package/cjs/chunks/bundle-REYf6P50.js.map +0 -1
- package/cjs/chunks/bundle-WPa3lxwD.js.map +0 -1
- package/cjs/chunks/bundle-eh-C24Pj.js.map +0 -1
- package/cjs/chunks/bundle-fVfMBori.js.map +0 -1
- package/cjs/chunks/bundle-fiSori_W.js.map +0 -1
- package/cjs/chunks/bundle-iWfMmu2k.js.map +0 -1
- package/cjs/chunks/bundle-kYn7Bizj.js.map +0 -1
- package/cjs/chunks/bundle-kfqOElgK.js.map +0 -1
- package/cjs/chunks/bundle-n_eAVYbo.js.map +0 -1
- package/cjs/chunks/bundle-o7bJmsVG.js.map +0 -1
- package/cjs/chunks/bundle-qNUnRJ-F.js.map +0 -1
- package/cjs/chunks/bundle-rpradL3a.js.map +0 -1
- package/cjs/chunks/bundle-ti8uh3us.js.map +0 -1
- package/cjs/chunks/bundle-u5TfAXpt.js.map +0 -1
- package/cjs/chunks/bundle-v95Xmjt9.js.map +0 -1
- package/cjs/chunks/bundle-y6-ks46c.js.map +0 -1
|
@@ -1,2293 +0,0 @@
|
|
|
1
|
-
import React__default, { createContext, useState, useCallback, useContext, useRef, useMemo, useLayoutEffect, useEffect } from 'react';
|
|
2
|
-
|
|
3
|
-
var ComponentType;
|
|
4
|
-
(function (ComponentType) {
|
|
5
|
-
ComponentType["Box"] = "box";
|
|
6
|
-
ComponentType["Text"] = "text";
|
|
7
|
-
ComponentType["Image"] = "image";
|
|
8
|
-
ComponentType["TextButton"] = "textButton";
|
|
9
|
-
ComponentType["ImageButton"] = "imageButton";
|
|
10
|
-
ComponentType["Carousel"] = "carouselView";
|
|
11
|
-
})(ComponentType || (ComponentType = {}));
|
|
12
|
-
|
|
13
|
-
const outSingle$1 = (key, obj) => {
|
|
14
|
-
if (typeof obj[key] !== 'string')
|
|
15
|
-
return {};
|
|
16
|
-
return { [key]: argbToRgba(obj[key]) };
|
|
17
|
-
};
|
|
18
|
-
function argbToRgba(string) {
|
|
19
|
-
if (!string.startsWith('#')) {
|
|
20
|
-
return string;
|
|
21
|
-
}
|
|
22
|
-
if (string.length === 9) {
|
|
23
|
-
return `#${string.slice(3)}${string[1]}${string[2]}`;
|
|
24
|
-
}
|
|
25
|
-
if (string.length === 5) {
|
|
26
|
-
return `#${string.slice(2)}${string[1]}`;
|
|
27
|
-
}
|
|
28
|
-
return string;
|
|
29
|
-
}
|
|
30
|
-
const outViewStyle$1 = (viewStyle) => {
|
|
31
|
-
if (!viewStyle)
|
|
32
|
-
return {};
|
|
33
|
-
return {
|
|
34
|
-
viewStyle: Object.assign(Object.assign(Object.assign({}, viewStyle), outSingle$1('backgroundColor', viewStyle)), outSingle$1('borderColor', viewStyle)),
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
const outTextStyle$1 = (textStyle) => {
|
|
38
|
-
if (!textStyle)
|
|
39
|
-
return {};
|
|
40
|
-
return {
|
|
41
|
-
textStyle: Object.assign(Object.assign({}, textStyle), outSingle$1('color', textStyle)),
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
const outImageStyle = (imageStyle) => {
|
|
45
|
-
if (!imageStyle)
|
|
46
|
-
return {};
|
|
47
|
-
return {
|
|
48
|
-
imageStyle: Object.assign(Object.assign({}, imageStyle), outSingle$1('tintColor', imageStyle)),
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
const colorTransform = {
|
|
52
|
-
run(prop) {
|
|
53
|
-
if (prop.type === ComponentType.Text || prop.type === ComponentType.TextButton) {
|
|
54
|
-
return Object.assign(Object.assign(Object.assign({}, prop), outViewStyle$1(prop.viewStyle)), outTextStyle$1(prop.textStyle));
|
|
55
|
-
}
|
|
56
|
-
if (prop.type === ComponentType.ImageButton || prop.type === ComponentType.Image) {
|
|
57
|
-
return Object.assign(Object.assign(Object.assign({}, prop), outViewStyle$1(prop.viewStyle)), outImageStyle(prop.imageStyle));
|
|
58
|
-
}
|
|
59
|
-
return Object.assign(Object.assign({}, prop), outViewStyle$1(prop.viewStyle));
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
const isNumber = (val) => {
|
|
64
|
-
if (typeof val === 'string') {
|
|
65
|
-
return !Number.isNaN(Number(val));
|
|
66
|
-
}
|
|
67
|
-
return typeof val === 'number' && !Number.isNaN(val);
|
|
68
|
-
};
|
|
69
|
-
const outSingle = (key, obj) => {
|
|
70
|
-
if (obj[key] === undefined || obj[key] === null)
|
|
71
|
-
return {};
|
|
72
|
-
return isNumber(obj[key]) ? { [key]: Number(obj[key]) } : {};
|
|
73
|
-
};
|
|
74
|
-
const outSpacing = (key, spacing) => {
|
|
75
|
-
if (!spacing)
|
|
76
|
-
return {};
|
|
77
|
-
return {
|
|
78
|
-
[key]: {
|
|
79
|
-
left: isNumber(spacing.left) ? Number(spacing.left) : spacing.left,
|
|
80
|
-
right: isNumber(spacing.right) ? Number(spacing.right) : spacing.right,
|
|
81
|
-
top: isNumber(spacing.top) ? Number(spacing.top) : spacing.top,
|
|
82
|
-
bottom: isNumber(spacing.bottom) ? Number(spacing.bottom) : spacing.bottom,
|
|
83
|
-
},
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
const outSize = (key, size) => {
|
|
87
|
-
if (!size)
|
|
88
|
-
return {};
|
|
89
|
-
return {
|
|
90
|
-
[key]: {
|
|
91
|
-
type: size.type,
|
|
92
|
-
value: isNumber(size.value) ? Number(size.value) : size.value,
|
|
93
|
-
},
|
|
94
|
-
};
|
|
95
|
-
};
|
|
96
|
-
const outMetadata = (metaData) => {
|
|
97
|
-
if (!metaData)
|
|
98
|
-
return {};
|
|
99
|
-
return {
|
|
100
|
-
metaData: {
|
|
101
|
-
pixelWidth: isNumber(metaData.pixelWidth) ? Number(metaData.pixelWidth) : metaData.pixelWidth,
|
|
102
|
-
pixelHeight: isNumber(metaData.pixelHeight) ? Number(metaData.pixelHeight) : metaData.pixelHeight,
|
|
103
|
-
},
|
|
104
|
-
};
|
|
105
|
-
};
|
|
106
|
-
const outViewStyle = (viewStyle) => {
|
|
107
|
-
if (!viewStyle)
|
|
108
|
-
return {};
|
|
109
|
-
return {
|
|
110
|
-
viewStyle: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, viewStyle), outSingle('borderWidth', viewStyle)), outSingle('radius', viewStyle)), outSpacing('margin', viewStyle.margin)), outSpacing('padding', viewStyle.padding)),
|
|
111
|
-
};
|
|
112
|
-
};
|
|
113
|
-
const outTextStyle = (textStyle) => {
|
|
114
|
-
if (!textStyle)
|
|
115
|
-
return {};
|
|
116
|
-
return {
|
|
117
|
-
textStyle: Object.assign(Object.assign(Object.assign({}, textStyle), outSingle('size', textStyle)), outSingle('weight', textStyle)),
|
|
118
|
-
};
|
|
119
|
-
};
|
|
120
|
-
const outCarouselStyle = (carouselstyle) => {
|
|
121
|
-
if (!carouselstyle)
|
|
122
|
-
return {};
|
|
123
|
-
return {
|
|
124
|
-
carouselStyle: Object.assign(Object.assign(Object.assign({}, carouselstyle), outSingle('spacing', carouselstyle)), outSingle('maxChildWidth', carouselstyle)),
|
|
125
|
-
};
|
|
126
|
-
};
|
|
127
|
-
const outViewProps = (view) => {
|
|
128
|
-
return Object.assign(Object.assign(Object.assign({}, outSize('width', view.width)), outSize('height', view.height)), outViewStyle(view.viewStyle));
|
|
129
|
-
};
|
|
130
|
-
const outTextProps = (text) => {
|
|
131
|
-
return Object.assign(Object.assign(Object.assign({}, outViewProps(text)), outTextStyle(text.textStyle)), outSingle('maxTextLines', text));
|
|
132
|
-
};
|
|
133
|
-
const outImageProps = (image) => {
|
|
134
|
-
return Object.assign(Object.assign({}, outViewProps(image)), outMetadata(image.metaData));
|
|
135
|
-
};
|
|
136
|
-
const outCarouselProps = (carousel) => {
|
|
137
|
-
return Object.assign(Object.assign(Object.assign({}, outViewProps(carousel)), outCarouselStyle(carousel.carouselStyle)), {
|
|
138
|
-
// Convert only top-level items to find has fill width values.
|
|
139
|
-
items: carousel.items.map((item) => (Object.assign(Object.assign({}, item), { body: Object.assign(Object.assign({}, item.body), { items: item.body.items.map((it) => numberTransform.run(it)) }) }))) });
|
|
140
|
-
};
|
|
141
|
-
const numberTransform = {
|
|
142
|
-
run(prop) {
|
|
143
|
-
if (prop.type === ComponentType.Text || prop.type === ComponentType.TextButton) {
|
|
144
|
-
return Object.assign(Object.assign({}, prop), outTextProps(prop));
|
|
145
|
-
}
|
|
146
|
-
if (prop.type === ComponentType.ImageButton || prop.type === ComponentType.Image) {
|
|
147
|
-
return Object.assign(Object.assign({}, prop), outImageProps(prop));
|
|
148
|
-
}
|
|
149
|
-
if (prop.type === ComponentType.Carousel) {
|
|
150
|
-
return Object.assign(Object.assign({}, prop), outCarouselProps(prop));
|
|
151
|
-
}
|
|
152
|
-
return Object.assign(Object.assign({}, prop), outViewProps(prop));
|
|
153
|
-
},
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
// -------- Set property mapper
|
|
157
|
-
const MAPPER = () => undefined;
|
|
158
|
-
const createParser = (params) => {
|
|
159
|
-
var _a;
|
|
160
|
-
const defaultMapper = (params === null || params === void 0 ? void 0 : params.defaultMapper) || MAPPER;
|
|
161
|
-
const mapper = {
|
|
162
|
-
defaultMapper,
|
|
163
|
-
mapBoxProps: (params === null || params === void 0 ? void 0 : params.mapBoxProps) || defaultMapper,
|
|
164
|
-
mapTextProps: (params === null || params === void 0 ? void 0 : params.mapTextProps) || defaultMapper,
|
|
165
|
-
mapImageProps: (params === null || params === void 0 ? void 0 : params.mapImageProps) || defaultMapper,
|
|
166
|
-
mapTextButtonProps: (params === null || params === void 0 ? void 0 : params.mapTextButtonProps) || defaultMapper,
|
|
167
|
-
mapImageButtonProps: (params === null || params === void 0 ? void 0 : params.mapImageButtonProps) || defaultMapper,
|
|
168
|
-
mapCarouselProps: (params === null || params === void 0 ? void 0 : params.mapCarouselProps) || defaultMapper,
|
|
169
|
-
};
|
|
170
|
-
const transforms = [colorTransform, numberTransform, ...((_a = params === null || params === void 0 ? void 0 : params.transforms) !== null && _a !== void 0 ? _a : [])];
|
|
171
|
-
return {
|
|
172
|
-
setTransforms(newTransforms) {
|
|
173
|
-
transforms.length = 0;
|
|
174
|
-
transforms.push(...newTransforms);
|
|
175
|
-
},
|
|
176
|
-
addTransforms(newTransforms) {
|
|
177
|
-
transforms.push(...newTransforms);
|
|
178
|
-
},
|
|
179
|
-
parse(rawItem, options) {
|
|
180
|
-
const item = transforms.reduce((it, transform) => transform.run(it), rawItem);
|
|
181
|
-
switch (item.type) {
|
|
182
|
-
case ComponentType.Box: {
|
|
183
|
-
return { transformed: item, properties: mapper.mapBoxProps(item, options) };
|
|
184
|
-
}
|
|
185
|
-
case ComponentType.Text: {
|
|
186
|
-
return { transformed: item, properties: mapper.mapTextProps(item, options) };
|
|
187
|
-
}
|
|
188
|
-
case ComponentType.Image: {
|
|
189
|
-
return { transformed: item, properties: mapper.mapImageProps(item, options) };
|
|
190
|
-
}
|
|
191
|
-
case ComponentType.TextButton: {
|
|
192
|
-
return { transformed: item, properties: mapper.mapTextButtonProps(item, options) };
|
|
193
|
-
}
|
|
194
|
-
case ComponentType.ImageButton: {
|
|
195
|
-
return { transformed: item, properties: mapper.mapImageButtonProps(item, options) };
|
|
196
|
-
}
|
|
197
|
-
case ComponentType.Carousel: {
|
|
198
|
-
return { transformed: item, properties: mapper.mapCarouselProps(item, options) };
|
|
199
|
-
}
|
|
200
|
-
default:
|
|
201
|
-
return { transformed: item, properties: undefined };
|
|
202
|
-
}
|
|
203
|
-
},
|
|
204
|
-
};
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
const FRAGMENT = ({ children }) => React__default.createElement(React__default.Fragment, null, children);
|
|
208
|
-
function createRenderer(params) {
|
|
209
|
-
var _a, _b, _c, _d, _e, _f;
|
|
210
|
-
return {
|
|
211
|
-
box: ((_a = params === null || params === void 0 ? void 0 : params.views) === null || _a === void 0 ? void 0 : _a.box) || FRAGMENT,
|
|
212
|
-
text: ((_b = params === null || params === void 0 ? void 0 : params.views) === null || _b === void 0 ? void 0 : _b.text) || FRAGMENT,
|
|
213
|
-
image: ((_c = params === null || params === void 0 ? void 0 : params.views) === null || _c === void 0 ? void 0 : _c.image) || FRAGMENT,
|
|
214
|
-
imageButton: ((_d = params === null || params === void 0 ? void 0 : params.views) === null || _d === void 0 ? void 0 : _d.imageButton) || FRAGMENT,
|
|
215
|
-
textButton: ((_e = params === null || params === void 0 ? void 0 : params.views) === null || _e === void 0 ? void 0 : _e.textButton) || FRAGMENT,
|
|
216
|
-
carouselView: ((_f = params === null || params === void 0 ? void 0 : params.views) === null || _f === void 0 ? void 0 : _f.carouselView) || FRAGMENT,
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
var __rest$5 = (undefined && undefined.__rest) || function (s, e) {
|
|
221
|
-
var t = {};
|
|
222
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
223
|
-
t[p] = s[p];
|
|
224
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
225
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
226
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
227
|
-
t[p[i]] = s[p[i]];
|
|
228
|
-
}
|
|
229
|
-
return t;
|
|
230
|
-
};
|
|
231
|
-
const SizeContext = createContext({
|
|
232
|
-
sizes: {},
|
|
233
|
-
updateSize: () => { },
|
|
234
|
-
});
|
|
235
|
-
const SizeContextProvider = ({ children }) => {
|
|
236
|
-
const [sizes, setSizes] = useState({});
|
|
237
|
-
const updateSize = useCallback((_a) => {
|
|
238
|
-
var { id } = _a, rest = __rest$5(_a, ["id"]);
|
|
239
|
-
if (id) {
|
|
240
|
-
setSizes((prevSizes) => (Object.assign(Object.assign({}, prevSizes), { [id]: rest })));
|
|
241
|
-
}
|
|
242
|
-
}, []);
|
|
243
|
-
return React__default.createElement(SizeContext.Provider, { value: { sizes, updateSize } }, children);
|
|
244
|
-
};
|
|
245
|
-
const useSizeContext = () => useContext(SizeContext);
|
|
246
|
-
|
|
247
|
-
var Layout;
|
|
248
|
-
(function (Layout) {
|
|
249
|
-
Layout["Row"] = "row";
|
|
250
|
-
Layout["Column"] = "column";
|
|
251
|
-
})(Layout || (Layout = {}));
|
|
252
|
-
var AlignValue;
|
|
253
|
-
(function (AlignValue) {
|
|
254
|
-
AlignValue["Center"] = "center";
|
|
255
|
-
AlignValue["Left"] = "left";
|
|
256
|
-
AlignValue["Right"] = "right";
|
|
257
|
-
AlignValue["Top"] = "top";
|
|
258
|
-
AlignValue["Bottom"] = "bottom";
|
|
259
|
-
})(AlignValue || (AlignValue = {}));
|
|
260
|
-
/**
|
|
261
|
-
* @description
|
|
262
|
-
* Caution: Numbers are passed as string types in the message template builder.
|
|
263
|
-
* Use `==` comparison instead of `===` comparison when using a regular enum instead of a string enum.
|
|
264
|
-
*/
|
|
265
|
-
var FlexSizeSpecValue;
|
|
266
|
-
(function (FlexSizeSpecValue) {
|
|
267
|
-
FlexSizeSpecValue[FlexSizeSpecValue["FillParent"] = 0] = "FillParent";
|
|
268
|
-
FlexSizeSpecValue[FlexSizeSpecValue["WrapContent"] = 1] = "WrapContent";
|
|
269
|
-
})(FlexSizeSpecValue || (FlexSizeSpecValue = {}));
|
|
270
|
-
var FontWeight;
|
|
271
|
-
(function (FontWeight) {
|
|
272
|
-
FontWeight["Normal"] = "normal";
|
|
273
|
-
FontWeight["Bold"] = "bold";
|
|
274
|
-
})(FontWeight || (FontWeight = {}));
|
|
275
|
-
var MediaContentMode;
|
|
276
|
-
(function (MediaContentMode) {
|
|
277
|
-
MediaContentMode["AspectFit"] = "aspectFit";
|
|
278
|
-
MediaContentMode["AspectFill"] = "aspectFill";
|
|
279
|
-
MediaContentMode["ScalesToFill"] = "scalesToFill";
|
|
280
|
-
})(MediaContentMode || (MediaContentMode = {}));
|
|
281
|
-
|
|
282
|
-
const SUPPORTED_TEMPLATE_VERSIONS = [
|
|
283
|
-
1,
|
|
284
|
-
2, // Composite templates: Carousel
|
|
285
|
-
];
|
|
286
|
-
const alignInFlex = (align) => {
|
|
287
|
-
switch (align) {
|
|
288
|
-
case AlignValue.Right:
|
|
289
|
-
case AlignValue.Bottom:
|
|
290
|
-
return 'flex-end';
|
|
291
|
-
case AlignValue.Center:
|
|
292
|
-
return 'center';
|
|
293
|
-
case AlignValue.Left:
|
|
294
|
-
case AlignValue.Top:
|
|
295
|
-
default:
|
|
296
|
-
return 'flex-start';
|
|
297
|
-
}
|
|
298
|
-
};
|
|
299
|
-
const isTemplateVersionSupported = (templateVersion) => {
|
|
300
|
-
if (!templateVersion)
|
|
301
|
-
return true;
|
|
302
|
-
return SUPPORTED_TEMPLATE_VERSIONS.includes(Number(templateVersion));
|
|
303
|
-
};
|
|
304
|
-
|
|
305
|
-
const memoize = (fn) => {
|
|
306
|
-
const cache = new Map();
|
|
307
|
-
const cached = function (val) {
|
|
308
|
-
return cache.has(val) ? cache.get(val) : cache.set(val, fn.call(this, val)) && cache.get(val);
|
|
309
|
-
};
|
|
310
|
-
cached.cache = cache;
|
|
311
|
-
return cached;
|
|
312
|
-
};
|
|
313
|
-
/**
|
|
314
|
-
* Generate each item's id by each item's array depth
|
|
315
|
-
*/
|
|
316
|
-
const setTemplateItemId = memoize((data) => {
|
|
317
|
-
const addIdRecursively = (item, id) => {
|
|
318
|
-
if ('items' in item && (item === null || item === void 0 ? void 0 : item.items) != null) {
|
|
319
|
-
item.items.forEach((subItem, subIdx) => {
|
|
320
|
-
const subId = `${id}-${subIdx}`;
|
|
321
|
-
subItem.id = subId;
|
|
322
|
-
addIdRecursively(subItem, subId);
|
|
323
|
-
});
|
|
324
|
-
}
|
|
325
|
-
};
|
|
326
|
-
data.forEach((item, idx) => {
|
|
327
|
-
const id = `${idx}`;
|
|
328
|
-
item.id = id;
|
|
329
|
-
addIdRecursively(item, id);
|
|
330
|
-
});
|
|
331
|
-
return data;
|
|
332
|
-
});
|
|
333
|
-
|
|
334
|
-
const defaultProperties = {
|
|
335
|
-
rootLayout: Layout.Column,
|
|
336
|
-
view: {
|
|
337
|
-
size: {
|
|
338
|
-
width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
|
|
339
|
-
height: { type: 'flex', value: FlexSizeSpecValue.WrapContent },
|
|
340
|
-
},
|
|
341
|
-
},
|
|
342
|
-
box: {
|
|
343
|
-
layout: Layout.Row,
|
|
344
|
-
align: { vertical: AlignValue.Top, horizontal: AlignValue.Left },
|
|
345
|
-
},
|
|
346
|
-
textButton: {
|
|
347
|
-
maxTextLines: 1,
|
|
348
|
-
},
|
|
349
|
-
carousel: {
|
|
350
|
-
style: {
|
|
351
|
-
spacing: 10,
|
|
352
|
-
maxChildWidth: 240,
|
|
353
|
-
},
|
|
354
|
-
},
|
|
355
|
-
};
|
|
356
|
-
|
|
357
|
-
const createMessageTemplate = (opts) => {
|
|
358
|
-
const Container = opts.Container || React__default.Fragment;
|
|
359
|
-
const UnknownMessage = opts.UnknownMessage || (() => null);
|
|
360
|
-
const parser = opts.parser || createParser();
|
|
361
|
-
const renderer = opts.renderer || createRenderer();
|
|
362
|
-
const MessageTemplateBase = ({ templateItems, templateVersion, parentLayout = defaultProperties.box.layout, depth = 0, }) => {
|
|
363
|
-
if (!isTemplateVersionSupported(templateVersion)) {
|
|
364
|
-
throw new Error(`Cannot parse template item due to unsupported template version: ${templateVersion}, ${SUPPORTED_TEMPLATE_VERSIONS}`);
|
|
365
|
-
}
|
|
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 });
|
|
368
|
-
const item = result.transformed;
|
|
369
|
-
const rendererProps = {
|
|
370
|
-
key: index,
|
|
371
|
-
siblings,
|
|
372
|
-
parentLayout,
|
|
373
|
-
parsedProperties: result.properties,
|
|
374
|
-
rawProperties,
|
|
375
|
-
};
|
|
376
|
-
switch (item.type) {
|
|
377
|
-
case ComponentType.Carousel: {
|
|
378
|
-
if (!Array.isArray(item.items) || item.items.length === 0) {
|
|
379
|
-
throw new Error('Cannot parse template item as Carousel if carousel has no items.');
|
|
380
|
-
}
|
|
381
|
-
return (React__default.createElement(renderer.carouselView, Object.assign({}, item, rendererProps), item.items.map((template, index) => (React__default.createElement(MessageTemplateBase, { key: index, templateItems: template.body.items || [], depth: depth + 1, templateVersion: template.version })))));
|
|
382
|
-
}
|
|
383
|
-
case ComponentType.Box: {
|
|
384
|
-
return (React__default.createElement(renderer.box, Object.assign({}, item, rendererProps),
|
|
385
|
-
React__default.createElement(MessageTemplateBase, { templateItems: item.items || [], parentLayout: item.layout, depth: depth + 1, templateVersion: templateVersion })));
|
|
386
|
-
}
|
|
387
|
-
case ComponentType.Text: {
|
|
388
|
-
return React__default.createElement(renderer.text, Object.assign({}, item, rendererProps));
|
|
389
|
-
}
|
|
390
|
-
case ComponentType.Image: {
|
|
391
|
-
return React__default.createElement(renderer.image, Object.assign({}, item, rendererProps));
|
|
392
|
-
}
|
|
393
|
-
case ComponentType.TextButton: {
|
|
394
|
-
return React__default.createElement(renderer.textButton, Object.assign({}, item, rendererProps));
|
|
395
|
-
}
|
|
396
|
-
case ComponentType.ImageButton: {
|
|
397
|
-
return React__default.createElement(renderer.imageButton, Object.assign({}, item, rendererProps));
|
|
398
|
-
}
|
|
399
|
-
default: {
|
|
400
|
-
// or throw new Error('Cannot parse template item')
|
|
401
|
-
return React__default.createElement(UnknownMessage, { item: item });
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
})));
|
|
405
|
-
};
|
|
406
|
-
return {
|
|
407
|
-
MessageTemplate: ({ templateVersion, templateItems, parentLayout = defaultProperties.rootLayout, }) => {
|
|
408
|
-
const items = setTemplateItemId(templateItems);
|
|
409
|
-
return (React__default.createElement(SizeContextProvider, null,
|
|
410
|
-
React__default.createElement(Container, { className: 'sb-message-template__parent' },
|
|
411
|
-
React__default.createElement(MessageTemplateBase, { isRoot: true, parentLayout: parentLayout, templateItems: items, templateVersion: templateVersion }))));
|
|
412
|
-
},
|
|
413
|
-
MessageTemplateBase,
|
|
414
|
-
};
|
|
415
|
-
};
|
|
416
|
-
|
|
417
|
-
var ActionType;
|
|
418
|
-
(function (ActionType) {
|
|
419
|
-
ActionType["Web"] = "web";
|
|
420
|
-
ActionType["Custom"] = "custom";
|
|
421
|
-
ActionType["UIKit"] = "uikit";
|
|
422
|
-
})(ActionType || (ActionType = {}));
|
|
423
|
-
|
|
424
|
-
({
|
|
425
|
-
version: 1,
|
|
426
|
-
body: {
|
|
427
|
-
items: [
|
|
428
|
-
{
|
|
429
|
-
type: ComponentType.Image,
|
|
430
|
-
action: { type: ActionType.Web, data: 'https://docs.sendbird.com' },
|
|
431
|
-
height: { type: 'fixed', value: 236 },
|
|
432
|
-
viewStyle: {
|
|
433
|
-
padding: {
|
|
434
|
-
left: 4,
|
|
435
|
-
right: 4,
|
|
436
|
-
top: 4,
|
|
437
|
-
bottom: 4,
|
|
438
|
-
},
|
|
439
|
-
},
|
|
440
|
-
imageUrl: 'https://cdn.pixabay.com/photo/2022/10/12/10/45/bird-7516219_1280.jpg',
|
|
441
|
-
imageStyle: { contentMode: MediaContentMode.AspectFill },
|
|
442
|
-
},
|
|
443
|
-
{
|
|
444
|
-
type: ComponentType.Box,
|
|
445
|
-
layout: Layout.Column,
|
|
446
|
-
width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
|
|
447
|
-
height: { type: 'fixed', value: 200 },
|
|
448
|
-
items: [
|
|
449
|
-
{
|
|
450
|
-
type: ComponentType.Box,
|
|
451
|
-
width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
|
|
452
|
-
height: { type: 'flex', value: FlexSizeSpecValue.FillParent },
|
|
453
|
-
viewStyle: { backgroundColor: '#fa6464' },
|
|
454
|
-
},
|
|
455
|
-
{
|
|
456
|
-
type: ComponentType.Box,
|
|
457
|
-
layout: Layout.Column,
|
|
458
|
-
width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
|
|
459
|
-
height: { type: 'flex', value: FlexSizeSpecValue.WrapContent },
|
|
460
|
-
viewStyle: { backgroundColor: '#ffaf5c' },
|
|
461
|
-
items: [
|
|
462
|
-
{
|
|
463
|
-
type: ComponentType.Text,
|
|
464
|
-
text: 'Message',
|
|
465
|
-
align: { horizontal: AlignValue.Center, vertical: AlignValue.Center },
|
|
466
|
-
width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
|
|
467
|
-
height: { type: 'fixed', value: 50 },
|
|
468
|
-
},
|
|
469
|
-
{
|
|
470
|
-
type: ComponentType.Image,
|
|
471
|
-
action: { type: ActionType.Web, data: 'https://docs.sendbird.com' },
|
|
472
|
-
width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
|
|
473
|
-
height: { type: 'fixed', value: 50 },
|
|
474
|
-
imageUrl: 'https://cdn.pixabay.com/photo/2022/10/12/10/45/bird-7516219_1280.jpg',
|
|
475
|
-
imageStyle: { contentMode: MediaContentMode.AspectFill },
|
|
476
|
-
},
|
|
477
|
-
],
|
|
478
|
-
},
|
|
479
|
-
{
|
|
480
|
-
type: ComponentType.Box,
|
|
481
|
-
width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
|
|
482
|
-
height: { type: 'fixed', value: 20 },
|
|
483
|
-
viewStyle: { backgroundColor: '#ffe450' },
|
|
484
|
-
},
|
|
485
|
-
{
|
|
486
|
-
type: ComponentType.Box,
|
|
487
|
-
width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
|
|
488
|
-
height: { type: 'flex', value: FlexSizeSpecValue.FillParent },
|
|
489
|
-
viewStyle: { backgroundColor: '#329a1b' },
|
|
490
|
-
},
|
|
491
|
-
],
|
|
492
|
-
},
|
|
493
|
-
{
|
|
494
|
-
type: ComponentType.Box,
|
|
495
|
-
viewStyle: { padding: { top: 12, bottom: 12, left: 12, right: 12 } },
|
|
496
|
-
layout: Layout.Column,
|
|
497
|
-
items: [
|
|
498
|
-
{
|
|
499
|
-
type: ComponentType.Box,
|
|
500
|
-
align: { horizontal: AlignValue.Left, vertical: AlignValue.Center },
|
|
501
|
-
layout: Layout.Row,
|
|
502
|
-
viewStyle: {
|
|
503
|
-
borderWidth: 1,
|
|
504
|
-
borderColor: '#72723f',
|
|
505
|
-
},
|
|
506
|
-
width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
|
|
507
|
-
height: { type: 'fixed', value: 150 },
|
|
508
|
-
items: [
|
|
509
|
-
{
|
|
510
|
-
type: ComponentType.Text,
|
|
511
|
-
width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
|
|
512
|
-
height: { type: 'fixed', value: 50 },
|
|
513
|
-
text: 'Sample1 text',
|
|
514
|
-
maxTextLines: 1,
|
|
515
|
-
align: { vertical: AlignValue.Center, horizontal: AlignValue.Left },
|
|
516
|
-
viewStyle: {
|
|
517
|
-
backgroundColor: '#cc4400',
|
|
518
|
-
},
|
|
519
|
-
textStyle: {
|
|
520
|
-
size: 16,
|
|
521
|
-
color: '#f8f8f8',
|
|
522
|
-
weight: FontWeight.Bold,
|
|
523
|
-
},
|
|
524
|
-
},
|
|
525
|
-
{
|
|
526
|
-
type: ComponentType.ImageButton,
|
|
527
|
-
action: { type: ActionType.UIKit, data: 'uikit://delete' },
|
|
528
|
-
width: { type: 'fixed', value: 20 },
|
|
529
|
-
height: { type: 'fixed', value: 20 },
|
|
530
|
-
imageUrl: 'https://file-ap-1.sendbird.com/5b5379aa73fd460da22ffaf9a61d0d7f.png',
|
|
531
|
-
imageStyle: { contentMode: MediaContentMode.AspectFit },
|
|
532
|
-
},
|
|
533
|
-
],
|
|
534
|
-
},
|
|
535
|
-
{
|
|
536
|
-
type: ComponentType.Text,
|
|
537
|
-
viewStyle: { padding: { top: 6, bottom: 12, left: 0, right: 0 } },
|
|
538
|
-
text: 'Esse eu esse duis ipsum et dolor eu ut sit amet consectetur cillum velit officia. Ex adipisicing elit quis ea sit. Occaecat in eu aliqua nulla magna id ut excepteur minim.',
|
|
539
|
-
maxTextLines: 2,
|
|
540
|
-
textStyle: { size: 14, color: '#e10000' },
|
|
541
|
-
width: { type: 'fixed', value: 200 },
|
|
542
|
-
height: { type: 'fixed', value: 50 },
|
|
543
|
-
},
|
|
544
|
-
{
|
|
545
|
-
type: ComponentType.TextButton,
|
|
546
|
-
action: { type: ActionType.Web, data: 'https://www.daum.net' },
|
|
547
|
-
text: 'Button 3',
|
|
548
|
-
textStyle: { size: 14, color: '#742ddd', weight: FontWeight.Bold },
|
|
549
|
-
},
|
|
550
|
-
],
|
|
551
|
-
},
|
|
552
|
-
],
|
|
553
|
-
},
|
|
554
|
-
});
|
|
555
|
-
({
|
|
556
|
-
'version': 1,
|
|
557
|
-
'body': {
|
|
558
|
-
'items': [
|
|
559
|
-
{
|
|
560
|
-
'type': ComponentType.Image,
|
|
561
|
-
'action': { 'type': ActionType.Web, 'data': 'https://www.naver.com/' },
|
|
562
|
-
'height': { 'type': 'fixed', 'value': 136 },
|
|
563
|
-
'imageUrl': 'https://cdn.pixabay.com/photo/2022/10/12/10/45/bird-7516219_1280.jpg',
|
|
564
|
-
'imageStyle': { 'contentMode': MediaContentMode.AspectFill },
|
|
565
|
-
},
|
|
566
|
-
{
|
|
567
|
-
'type': ComponentType.Box,
|
|
568
|
-
'viewStyle': { 'padding': { 'top': 12, 'bottom': 12, 'left': 12, 'right': 12 }, backgroundColor: '#cccccc' },
|
|
569
|
-
'layout': Layout.Column,
|
|
570
|
-
width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
|
|
571
|
-
'items': [
|
|
572
|
-
{
|
|
573
|
-
'type': ComponentType.Box,
|
|
574
|
-
width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
|
|
575
|
-
'layout': Layout.Row,
|
|
576
|
-
'items': [
|
|
577
|
-
{
|
|
578
|
-
'type': ComponentType.TextButton,
|
|
579
|
-
'action': { 'type': ActionType.Web, 'data': 'https://www.daum.net' },
|
|
580
|
-
width: { type: 'fixed', value: 150 },
|
|
581
|
-
'viewStyle': { 'margin': { 'top': 0, 'bottom': 0, 'left': 0, 'right': 4 } },
|
|
582
|
-
'text': 'Button 2',
|
|
583
|
-
'textStyle': { 'size': 14, 'weight': FontWeight.Bold },
|
|
584
|
-
},
|
|
585
|
-
{
|
|
586
|
-
'type': ComponentType.TextButton,
|
|
587
|
-
'action': { 'type': ActionType.Web, 'data': 'https://www.daum.net' },
|
|
588
|
-
width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
|
|
589
|
-
'viewStyle': { 'margin': { 'top': 0, 'bottom': 0, 'left': 4, 'right': 0 } },
|
|
590
|
-
'text': 'Button 3',
|
|
591
|
-
'textStyle': { 'size': 14, 'weight': FontWeight.Bold },
|
|
592
|
-
},
|
|
593
|
-
],
|
|
594
|
-
},
|
|
595
|
-
{
|
|
596
|
-
'type': ComponentType.Box,
|
|
597
|
-
width: { type: 'flex', value: FlexSizeSpecValue.FillParent },
|
|
598
|
-
'layout': Layout.Row,
|
|
599
|
-
'items': [
|
|
600
|
-
{
|
|
601
|
-
'type': ComponentType.Text,
|
|
602
|
-
'text': 'Sample2 text',
|
|
603
|
-
'width': { 'type': 'flex', 'value': FlexSizeSpecValue.FillParent },
|
|
604
|
-
'maxTextLines': 1,
|
|
605
|
-
'textStyle': { 'size': 16, 'weight': FontWeight.Bold },
|
|
606
|
-
},
|
|
607
|
-
{
|
|
608
|
-
'type': ComponentType.ImageButton,
|
|
609
|
-
'action': { 'type': ActionType.UIKit, 'data': 'uikit://delete' },
|
|
610
|
-
'width': { 'type': 'fixed', 'value': 20 },
|
|
611
|
-
'height': { 'type': 'fixed', 'value': 20 },
|
|
612
|
-
'imageUrl': 'https://file-ap-1.sendbird.com/5b5379aa73fd460da22ffaf9a61d0d7f.png',
|
|
613
|
-
'imageStyle': { 'contentMode': MediaContentMode.AspectFit },
|
|
614
|
-
},
|
|
615
|
-
],
|
|
616
|
-
},
|
|
617
|
-
{
|
|
618
|
-
'type': ComponentType.Text,
|
|
619
|
-
'viewStyle': { 'padding': { 'top': 6, 'bottom': 12, 'left': 0, 'right': 0 } },
|
|
620
|
-
'text': 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aui',
|
|
621
|
-
'textStyle': { 'size': 14 },
|
|
622
|
-
},
|
|
623
|
-
],
|
|
624
|
-
},
|
|
625
|
-
],
|
|
626
|
-
},
|
|
627
|
-
});
|
|
628
|
-
({
|
|
629
|
-
'version': 1,
|
|
630
|
-
'body': {
|
|
631
|
-
'items': [
|
|
632
|
-
{
|
|
633
|
-
'type': ComponentType.Box,
|
|
634
|
-
'viewStyle': { 'backgroundColor': '#ffffff', 'borderWidth': 1, 'borderColor': '#eeeeee', 'radius': 16 },
|
|
635
|
-
'layout': Layout.Column,
|
|
636
|
-
'items': [
|
|
637
|
-
{
|
|
638
|
-
'type': ComponentType.Image,
|
|
639
|
-
'height': { 'type': 'fixed', 'value': 200 },
|
|
640
|
-
'imageUrl': 'https://img.freepik.com/free-vector/cartoon-happy-hours-background_52683-81243.jpg?w=2000&t=st=1666689198~exp=1666689798~hmac=23109d44ba03deee7aee069cbeebfcb48fa27f85e53c1cafc5d5d7345f1a2041',
|
|
641
|
-
'imageStyle': { 'contentMode': MediaContentMode.AspectFill },
|
|
642
|
-
},
|
|
643
|
-
{
|
|
644
|
-
'type': ComponentType.Box,
|
|
645
|
-
'viewStyle': { 'padding': { 'top': 15, 'bottom': 15, 'left': 15, 'right': 15 } },
|
|
646
|
-
'layout': Layout.Column,
|
|
647
|
-
'items': [
|
|
648
|
-
{
|
|
649
|
-
'type': ComponentType.Text,
|
|
650
|
-
'text': "Don't miss these deals today",
|
|
651
|
-
'maxTextLines': 1,
|
|
652
|
-
'textStyle': { 'size': 20, 'color': '#e10000', 'weight': FontWeight.Bold },
|
|
653
|
-
},
|
|
654
|
-
{
|
|
655
|
-
'type': ComponentType.Text,
|
|
656
|
-
'viewStyle': { 'margin': { 'top': 5, 'bottom': 0, 'left': 0, 'right': 0 } },
|
|
657
|
-
'text': 'Pay with Maya and get cashback!',
|
|
658
|
-
'maxTextLines': 1,
|
|
659
|
-
'textStyle': { 'size': 14, 'color': '#e10000' },
|
|
660
|
-
},
|
|
661
|
-
{
|
|
662
|
-
'type': ComponentType.Box,
|
|
663
|
-
'align': { 'horizontal': AlignValue.Left, 'vertical': AlignValue.Center },
|
|
664
|
-
'viewStyle': { 'margin': { 'top': 10, 'bottom': 0, 'left': 0, 'right': 0 } },
|
|
665
|
-
'layout': Layout.Row,
|
|
666
|
-
'items': [
|
|
667
|
-
{
|
|
668
|
-
'type': ComponentType.Image,
|
|
669
|
-
'width': { 'type': 'fixed', 'value': 50 },
|
|
670
|
-
'height': { 'type': 'fixed', 'value': 50 },
|
|
671
|
-
'viewStyle': {
|
|
672
|
-
'backgroundColor': '#ffffff',
|
|
673
|
-
'borderWidth': 1,
|
|
674
|
-
'borderColor': '#eeeeee',
|
|
675
|
-
'radius': 25,
|
|
676
|
-
},
|
|
677
|
-
'imageUrl': 'https://yt3.ggpht.com/ytc/AMLnZu8Kg89ymE7qt5bsS9vMqi9h2aHiN6m9ID-IgxR6-Q=s900-c-k-c0x00ffffff-no-rj',
|
|
678
|
-
'imageStyle': { 'contentMode': MediaContentMode.AspectFill },
|
|
679
|
-
},
|
|
680
|
-
{
|
|
681
|
-
'type': ComponentType.Box,
|
|
682
|
-
'align': { 'horizontal': AlignValue.Left, 'vertical': AlignValue.Center },
|
|
683
|
-
'viewStyle': { 'margin': { 'top': 0, 'bottom': 0, 'left': 15, 'right': 0 } },
|
|
684
|
-
'layout': Layout.Column,
|
|
685
|
-
'items': [
|
|
686
|
-
{
|
|
687
|
-
'type': ComponentType.Text,
|
|
688
|
-
'text': 'Meralco',
|
|
689
|
-
'maxTextLines': 1,
|
|
690
|
-
'textStyle': { 'size': 16, 'color': '#e10000', 'weight': FontWeight.Bold },
|
|
691
|
-
},
|
|
692
|
-
{
|
|
693
|
-
'type': ComponentType.Text,
|
|
694
|
-
'viewStyle': { 'margin': { 'top': 3, 'bottom': 0, 'left': 0, 'right': 0 } },
|
|
695
|
-
'text': '30% cashback, P300 min spend',
|
|
696
|
-
'maxTextLines': 1,
|
|
697
|
-
'textStyle': { 'size': 12, 'color': '#610000', 'weight': FontWeight.Bold },
|
|
698
|
-
},
|
|
699
|
-
],
|
|
700
|
-
},
|
|
701
|
-
],
|
|
702
|
-
},
|
|
703
|
-
{
|
|
704
|
-
'type': ComponentType.Box,
|
|
705
|
-
'align': { 'horizontal': AlignValue.Left, 'vertical': AlignValue.Center },
|
|
706
|
-
'viewStyle': { 'margin': { 'top': 10, 'bottom': 0, 'left': 0, 'right': 0 } },
|
|
707
|
-
'layout': Layout.Row,
|
|
708
|
-
'items': [
|
|
709
|
-
{
|
|
710
|
-
'type': ComponentType.Image,
|
|
711
|
-
'width': { 'type': 'fixed', 'value': 50 },
|
|
712
|
-
'height': { 'type': 'fixed', 'value': 50 },
|
|
713
|
-
'viewStyle': {
|
|
714
|
-
'backgroundColor': '#ffffff',
|
|
715
|
-
'borderWidth': 1,
|
|
716
|
-
'borderColor': '#eeeeee',
|
|
717
|
-
'radius': 25,
|
|
718
|
-
},
|
|
719
|
-
'imageUrl': 'https://1000logos.net/wp-content/uploads/2021/12/Globe-Telecom-logo.png',
|
|
720
|
-
'imageStyle': { 'contentMode': MediaContentMode.AspectFill, tintColor: '#a49a9a' },
|
|
721
|
-
},
|
|
722
|
-
{
|
|
723
|
-
'type': ComponentType.Box,
|
|
724
|
-
'align': { 'horizontal': AlignValue.Left, 'vertical': AlignValue.Center },
|
|
725
|
-
'viewStyle': { 'margin': { 'top': 0, 'bottom': 0, 'left': 15, 'right': 0 } },
|
|
726
|
-
'layout': Layout.Column,
|
|
727
|
-
'items': [
|
|
728
|
-
{
|
|
729
|
-
'type': ComponentType.Text,
|
|
730
|
-
'text': 'Globe',
|
|
731
|
-
'maxTextLines': 1,
|
|
732
|
-
'textStyle': { 'size': 16, 'color': '#e10000', 'weight': FontWeight.Bold },
|
|
733
|
-
},
|
|
734
|
-
{
|
|
735
|
-
'type': ComponentType.Text,
|
|
736
|
-
'viewStyle': { 'margin': { 'top': 3, 'bottom': 0, 'left': 0, 'right': 0 } },
|
|
737
|
-
'text': '30% cashback, P300 min spend',
|
|
738
|
-
'maxTextLines': 1,
|
|
739
|
-
'textStyle': { 'size': 12, 'color': '#610000', 'weight': FontWeight.Bold },
|
|
740
|
-
},
|
|
741
|
-
],
|
|
742
|
-
},
|
|
743
|
-
],
|
|
744
|
-
},
|
|
745
|
-
{
|
|
746
|
-
'type': ComponentType.Box,
|
|
747
|
-
'align': { 'horizontal': AlignValue.Left, 'vertical': AlignValue.Center },
|
|
748
|
-
'viewStyle': { 'margin': { 'top': 10, 'bottom': 0, 'left': 0, 'right': 0 } },
|
|
749
|
-
'layout': Layout.Row,
|
|
750
|
-
'items': [
|
|
751
|
-
{
|
|
752
|
-
'type': ComponentType.Image,
|
|
753
|
-
'width': { 'type': 'fixed', 'value': 50 },
|
|
754
|
-
'height': { 'type': 'fixed', 'value': 50 },
|
|
755
|
-
'viewStyle': {
|
|
756
|
-
'backgroundColor': '#ffffff',
|
|
757
|
-
'borderWidth': 1,
|
|
758
|
-
'borderColor': '#eeeeee',
|
|
759
|
-
'radius': 25,
|
|
760
|
-
},
|
|
761
|
-
'imageUrl': 'https://upload.wikimedia.org/wikipedia/commons/thumb/4/41/Cignal.svg/640px-Cignal.svg.png',
|
|
762
|
-
'imageStyle': { 'contentMode': MediaContentMode.AspectFill },
|
|
763
|
-
},
|
|
764
|
-
{
|
|
765
|
-
'type': ComponentType.Box,
|
|
766
|
-
'align': { 'horizontal': AlignValue.Left, 'vertical': AlignValue.Center },
|
|
767
|
-
'viewStyle': { 'margin': { 'top': 0, 'bottom': 0, 'left': 15, 'right': 0 } },
|
|
768
|
-
'layout': Layout.Column,
|
|
769
|
-
'items': [
|
|
770
|
-
{
|
|
771
|
-
'type': ComponentType.Text,
|
|
772
|
-
'text': 'Cignal',
|
|
773
|
-
'maxTextLines': 1,
|
|
774
|
-
'textStyle': { 'size': 16, 'color': '#e10000', 'weight': FontWeight.Bold },
|
|
775
|
-
},
|
|
776
|
-
{
|
|
777
|
-
'type': ComponentType.Text,
|
|
778
|
-
'viewStyle': { 'margin': { 'top': 3, 'bottom': 0, 'left': 0, 'right': 0 } },
|
|
779
|
-
'text': '30% cashback, P300 min spend',
|
|
780
|
-
'maxTextLines': 1,
|
|
781
|
-
'textStyle': { 'size': 12, 'color': '#610000', 'weight': FontWeight.Bold },
|
|
782
|
-
},
|
|
783
|
-
],
|
|
784
|
-
},
|
|
785
|
-
],
|
|
786
|
-
},
|
|
787
|
-
{
|
|
788
|
-
'type': ComponentType.Box,
|
|
789
|
-
'align': { 'horizontal': AlignValue.Left, 'vertical': AlignValue.Center },
|
|
790
|
-
'viewStyle': { 'margin': { 'top': 10, 'bottom': 0, 'left': 0, 'right': 0 } },
|
|
791
|
-
'layout': Layout.Row,
|
|
792
|
-
'items': [
|
|
793
|
-
{
|
|
794
|
-
'type': ComponentType.TextButton,
|
|
795
|
-
'action': { 'type': ActionType.Web, 'data': 'https://www.daum.net' },
|
|
796
|
-
'viewStyle': {
|
|
797
|
-
'backgroundColor': '#e0e0e0',
|
|
798
|
-
'radius': 16,
|
|
799
|
-
'margin': { 'top': 0, 'bottom': 0, 'left': 0, 'right': 4 },
|
|
800
|
-
'padding': { 'top': 12, 'bottom': 12, 'left': 12, 'right': 12 },
|
|
801
|
-
},
|
|
802
|
-
'text': 'Learn more',
|
|
803
|
-
'textStyle': { 'size': 15, 'color': '#e10000', 'weight': FontWeight.Bold },
|
|
804
|
-
},
|
|
805
|
-
{
|
|
806
|
-
'type': ComponentType.TextButton,
|
|
807
|
-
'action': { 'type': ActionType.Web, 'data': 'https://www.daum.net' },
|
|
808
|
-
'viewStyle': {
|
|
809
|
-
'backgroundColor': '#e10000',
|
|
810
|
-
'radius': 16,
|
|
811
|
-
'margin': { 'top': 0, 'bottom': 0, 'left': 4, 'right': 0 },
|
|
812
|
-
'padding': { 'top': 12, 'bottom': 12, 'left': 12, 'right': 12 },
|
|
813
|
-
},
|
|
814
|
-
'text': 'Pay now',
|
|
815
|
-
'textStyle': { 'size': 15, 'color': '#ffffff', 'weight': FontWeight.Bold },
|
|
816
|
-
},
|
|
817
|
-
],
|
|
818
|
-
},
|
|
819
|
-
],
|
|
820
|
-
},
|
|
821
|
-
],
|
|
822
|
-
},
|
|
823
|
-
],
|
|
824
|
-
},
|
|
825
|
-
});
|
|
826
|
-
({
|
|
827
|
-
'version': 1,
|
|
828
|
-
'body': {
|
|
829
|
-
'items': [
|
|
830
|
-
{
|
|
831
|
-
'type': ComponentType.Box,
|
|
832
|
-
'layout': Layout.Column,
|
|
833
|
-
'items': [
|
|
834
|
-
{
|
|
835
|
-
'type': ComponentType.Image,
|
|
836
|
-
'imageUrl': 'https://static.sendbird.com/sample/profiles/profile_40_512px.png',
|
|
837
|
-
'metaData': {
|
|
838
|
-
'pixelWidth': 512,
|
|
839
|
-
'pixelHeight': 512,
|
|
840
|
-
},
|
|
841
|
-
'imageStyle': {
|
|
842
|
-
'tintColor': '#44ff1188',
|
|
843
|
-
},
|
|
844
|
-
viewStyle: {
|
|
845
|
-
'padding': {
|
|
846
|
-
'top': 12,
|
|
847
|
-
'right': 12,
|
|
848
|
-
'bottom': 12,
|
|
849
|
-
'left': 12,
|
|
850
|
-
},
|
|
851
|
-
},
|
|
852
|
-
},
|
|
853
|
-
{
|
|
854
|
-
'type': ComponentType.Box,
|
|
855
|
-
'viewStyle': {
|
|
856
|
-
'padding': {
|
|
857
|
-
'top': 12,
|
|
858
|
-
'right': 12,
|
|
859
|
-
'bottom': 12,
|
|
860
|
-
'left': 12,
|
|
861
|
-
},
|
|
862
|
-
},
|
|
863
|
-
'layout': Layout.Column,
|
|
864
|
-
'items': [
|
|
865
|
-
{
|
|
866
|
-
'type': ComponentType.Box,
|
|
867
|
-
'layout': Layout.Row,
|
|
868
|
-
'items': [
|
|
869
|
-
{
|
|
870
|
-
'type': ComponentType.Box,
|
|
871
|
-
'layout': Layout.Column,
|
|
872
|
-
'items': [
|
|
873
|
-
{
|
|
874
|
-
'type': ComponentType.Text,
|
|
875
|
-
'text': 'hi',
|
|
876
|
-
'maxTextLines': 3,
|
|
877
|
-
'viewStyle': {
|
|
878
|
-
'padding': {
|
|
879
|
-
'top': 0,
|
|
880
|
-
'bottom': 6,
|
|
881
|
-
'left': 0,
|
|
882
|
-
'right': 0,
|
|
883
|
-
},
|
|
884
|
-
},
|
|
885
|
-
'textStyle': {
|
|
886
|
-
'size': 16,
|
|
887
|
-
'weight': FontWeight.Bold,
|
|
888
|
-
},
|
|
889
|
-
},
|
|
890
|
-
{
|
|
891
|
-
'type': ComponentType.Text,
|
|
892
|
-
'text': 'bye',
|
|
893
|
-
'maxTextLines': 10,
|
|
894
|
-
'textStyle': {
|
|
895
|
-
'size': 14,
|
|
896
|
-
},
|
|
897
|
-
},
|
|
898
|
-
],
|
|
899
|
-
},
|
|
900
|
-
{
|
|
901
|
-
'type': ComponentType.ImageButton,
|
|
902
|
-
'action': {
|
|
903
|
-
'type': ActionType.UIKit,
|
|
904
|
-
'data': 'sendbirduikit://delete',
|
|
905
|
-
},
|
|
906
|
-
'width': {
|
|
907
|
-
'type': 'fixed',
|
|
908
|
-
'value': 20,
|
|
909
|
-
},
|
|
910
|
-
'height': {
|
|
911
|
-
'type': 'fixed',
|
|
912
|
-
'value': 20,
|
|
913
|
-
},
|
|
914
|
-
'metaData': {
|
|
915
|
-
'pixelWidth': 60,
|
|
916
|
-
'pixelHeight': 60,
|
|
917
|
-
},
|
|
918
|
-
'imageUrl': 'https://dxstmhyqfqr1o.cloudfront.net/sendbird-message-builder/icon-more.png',
|
|
919
|
-
'imageStyle': {
|
|
920
|
-
'tintColor': '#ff8d5a',
|
|
921
|
-
},
|
|
922
|
-
},
|
|
923
|
-
],
|
|
924
|
-
},
|
|
925
|
-
{
|
|
926
|
-
'type': ComponentType.Box,
|
|
927
|
-
'layout': Layout.Column,
|
|
928
|
-
'items': [
|
|
929
|
-
{
|
|
930
|
-
'type': ComponentType.Box,
|
|
931
|
-
'viewStyle': {
|
|
932
|
-
'margin': {
|
|
933
|
-
'top': 16,
|
|
934
|
-
'bottom': 0,
|
|
935
|
-
'left': 0,
|
|
936
|
-
'right': 0,
|
|
937
|
-
},
|
|
938
|
-
},
|
|
939
|
-
'align': {
|
|
940
|
-
'horizontal': AlignValue.Left,
|
|
941
|
-
'vertical': AlignValue.Center,
|
|
942
|
-
},
|
|
943
|
-
'layout': Layout.Row,
|
|
944
|
-
'items': [
|
|
945
|
-
{
|
|
946
|
-
'type': ComponentType.Image,
|
|
947
|
-
'imageUrl': 'https://ca.slack-edge.com/T0ADCTNEL-ULE240VNV-83fd5776e78e-512',
|
|
948
|
-
'width': {
|
|
949
|
-
'type': 'fixed',
|
|
950
|
-
'value': 40,
|
|
951
|
-
},
|
|
952
|
-
'height': {
|
|
953
|
-
'type': 'fixed',
|
|
954
|
-
'value': 40,
|
|
955
|
-
},
|
|
956
|
-
'metaData': {
|
|
957
|
-
'pixelWidth': 512,
|
|
958
|
-
'pixelHeight': 512,
|
|
959
|
-
},
|
|
960
|
-
'viewStyle': {
|
|
961
|
-
'backgroundColor': '#BDBDBD',
|
|
962
|
-
'radius': 20,
|
|
963
|
-
},
|
|
964
|
-
'imageStyle': {
|
|
965
|
-
'contentMode': MediaContentMode.AspectFill,
|
|
966
|
-
},
|
|
967
|
-
},
|
|
968
|
-
{
|
|
969
|
-
'type': ComponentType.Box,
|
|
970
|
-
'viewStyle': {
|
|
971
|
-
'margin': {
|
|
972
|
-
'top': 0,
|
|
973
|
-
'bottom': 0,
|
|
974
|
-
'left': 12,
|
|
975
|
-
'right': 0,
|
|
976
|
-
},
|
|
977
|
-
},
|
|
978
|
-
'layout': Layout.Column,
|
|
979
|
-
'items': [
|
|
980
|
-
{
|
|
981
|
-
'type': ComponentType.Text,
|
|
982
|
-
'text': 'Chongbu',
|
|
983
|
-
'maxTextLines': 1,
|
|
984
|
-
'textStyle': {
|
|
985
|
-
'size': 16,
|
|
986
|
-
'weight': FontWeight.Bold,
|
|
987
|
-
},
|
|
988
|
-
},
|
|
989
|
-
{
|
|
990
|
-
'type': ComponentType.Text,
|
|
991
|
-
'viewStyle': {
|
|
992
|
-
'margin': {
|
|
993
|
-
'top': 4,
|
|
994
|
-
'bottom': 0,
|
|
995
|
-
'left': 0,
|
|
996
|
-
'right': 0,
|
|
997
|
-
},
|
|
998
|
-
},
|
|
999
|
-
'text': ' ',
|
|
1000
|
-
'maxTextLines': 1,
|
|
1001
|
-
'textStyle': {
|
|
1002
|
-
'size': 14,
|
|
1003
|
-
},
|
|
1004
|
-
},
|
|
1005
|
-
],
|
|
1006
|
-
},
|
|
1007
|
-
],
|
|
1008
|
-
},
|
|
1009
|
-
{
|
|
1010
|
-
'type': ComponentType.Box,
|
|
1011
|
-
'viewStyle': {
|
|
1012
|
-
'margin': {
|
|
1013
|
-
'top': 16,
|
|
1014
|
-
'bottom': 0,
|
|
1015
|
-
'left': 0,
|
|
1016
|
-
'right': 0,
|
|
1017
|
-
},
|
|
1018
|
-
},
|
|
1019
|
-
'align': {
|
|
1020
|
-
'horizontal': AlignValue.Left,
|
|
1021
|
-
'vertical': AlignValue.Center,
|
|
1022
|
-
},
|
|
1023
|
-
'layout': Layout.Row,
|
|
1024
|
-
'items': [
|
|
1025
|
-
{
|
|
1026
|
-
'type': ComponentType.Image,
|
|
1027
|
-
'imageUrl': 'https://ca.slack-edge.com/T0ADCTNEL-U02LA25KY8J-d41a3e8c7554-512',
|
|
1028
|
-
'width': {
|
|
1029
|
-
'type': 'fixed',
|
|
1030
|
-
'value': 40,
|
|
1031
|
-
},
|
|
1032
|
-
'height': {
|
|
1033
|
-
'type': 'fixed',
|
|
1034
|
-
'value': 40,
|
|
1035
|
-
},
|
|
1036
|
-
'metaData': {
|
|
1037
|
-
'pixelWidth': 512,
|
|
1038
|
-
'pixelHeight': 512,
|
|
1039
|
-
},
|
|
1040
|
-
'viewStyle': {
|
|
1041
|
-
'backgroundColor': '#BDBDBD',
|
|
1042
|
-
'radius': 20,
|
|
1043
|
-
},
|
|
1044
|
-
'imageStyle': {
|
|
1045
|
-
'contentMode': MediaContentMode.AspectFill,
|
|
1046
|
-
},
|
|
1047
|
-
},
|
|
1048
|
-
{
|
|
1049
|
-
'type': ComponentType.Box,
|
|
1050
|
-
'viewStyle': {
|
|
1051
|
-
'margin': {
|
|
1052
|
-
'top': 0,
|
|
1053
|
-
'bottom': 0,
|
|
1054
|
-
'left': 12,
|
|
1055
|
-
'right': 0,
|
|
1056
|
-
},
|
|
1057
|
-
},
|
|
1058
|
-
'layout': Layout.Column,
|
|
1059
|
-
'items': [
|
|
1060
|
-
{
|
|
1061
|
-
'type': ComponentType.Text,
|
|
1062
|
-
'text': 'Amanda',
|
|
1063
|
-
'maxTextLines': 1,
|
|
1064
|
-
'textStyle': {
|
|
1065
|
-
'size': 16,
|
|
1066
|
-
'weight': FontWeight.Bold,
|
|
1067
|
-
},
|
|
1068
|
-
},
|
|
1069
|
-
{
|
|
1070
|
-
'type': ComponentType.Text,
|
|
1071
|
-
'viewStyle': {
|
|
1072
|
-
'margin': {
|
|
1073
|
-
'top': 4,
|
|
1074
|
-
'bottom': 0,
|
|
1075
|
-
'left': 0,
|
|
1076
|
-
'right': 0,
|
|
1077
|
-
},
|
|
1078
|
-
},
|
|
1079
|
-
'text': 'This is title message',
|
|
1080
|
-
'maxTextLines': 1,
|
|
1081
|
-
'textStyle': {
|
|
1082
|
-
'size': 14,
|
|
1083
|
-
},
|
|
1084
|
-
},
|
|
1085
|
-
],
|
|
1086
|
-
},
|
|
1087
|
-
],
|
|
1088
|
-
},
|
|
1089
|
-
],
|
|
1090
|
-
},
|
|
1091
|
-
],
|
|
1092
|
-
},
|
|
1093
|
-
],
|
|
1094
|
-
},
|
|
1095
|
-
],
|
|
1096
|
-
},
|
|
1097
|
-
});
|
|
1098
|
-
({
|
|
1099
|
-
'version': '1',
|
|
1100
|
-
'body': {
|
|
1101
|
-
'items': [
|
|
1102
|
-
{
|
|
1103
|
-
'type': 'box',
|
|
1104
|
-
'layout': 'column',
|
|
1105
|
-
height: { type: 'fixed', value: 600 },
|
|
1106
|
-
'items': [
|
|
1107
|
-
{
|
|
1108
|
-
'type': 'box',
|
|
1109
|
-
'layout': 'column',
|
|
1110
|
-
'viewStyle': { 'radius': '8', 'padding': { 'top': '12', 'bottom': '12', 'left': '12', 'right': '12' } },
|
|
1111
|
-
'items': [
|
|
1112
|
-
{
|
|
1113
|
-
'type': 'text',
|
|
1114
|
-
'text': 'Title text',
|
|
1115
|
-
'textStyle': { 'color': '#E0000000', 'size': '16', 'weight': 'bold' },
|
|
1116
|
-
'maxTextLines': '5',
|
|
1117
|
-
'viewStyle': {},
|
|
1118
|
-
'action': { 'data': 'www.naver.com' },
|
|
1119
|
-
},
|
|
1120
|
-
{
|
|
1121
|
-
'type': 'text',
|
|
1122
|
-
'viewStyle': { 'margin': { 'top': '8', 'right': '0', 'bottom': '0', 'left': '0' } },
|
|
1123
|
-
'text': 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aui',
|
|
1124
|
-
'textStyle': { 'color': '#E0000000', 'size': '14', 'weight': 'normal' },
|
|
1125
|
-
'maxTextLines': '5',
|
|
1126
|
-
'action': { 'data': 'https://www.naver.com' },
|
|
1127
|
-
},
|
|
1128
|
-
{
|
|
1129
|
-
'type': 'box',
|
|
1130
|
-
'layout': 'row',
|
|
1131
|
-
'viewStyle': { 'margin': { 'top': '12', 'right': '0', 'bottom': '0', 'left': '0' } },
|
|
1132
|
-
'items': [
|
|
1133
|
-
{
|
|
1134
|
-
'type': 'textButton',
|
|
1135
|
-
'viewStyle': {
|
|
1136
|
-
'backgroundColor': '#E0E0E0',
|
|
1137
|
-
'padding': { 'top': '10', 'bottom': '10', 'left': '20', 'right': '20' },
|
|
1138
|
-
},
|
|
1139
|
-
'text': 'Button 1',
|
|
1140
|
-
'textStyle': { 'color': '#742DDD', 'size': '14', 'weight': 'bold' },
|
|
1141
|
-
'maxTextLines': '5',
|
|
1142
|
-
'action': { 'data': 'www.naver.com' },
|
|
1143
|
-
},
|
|
1144
|
-
{
|
|
1145
|
-
'type': 'textButton',
|
|
1146
|
-
'viewStyle': {
|
|
1147
|
-
'backgroundColor': '#E0E0E0',
|
|
1148
|
-
'padding': { 'top': '10', 'bottom': '10', 'left': '20', 'right': '20' },
|
|
1149
|
-
'margin': { 'left': '8', 'right': '0', 'top': '0', 'bottom': '0' },
|
|
1150
|
-
},
|
|
1151
|
-
'text': 'Button 2',
|
|
1152
|
-
'textStyle': { 'color': '#742DDD', 'size': '14', 'weight': 'bold' },
|
|
1153
|
-
'maxTextLines': '5',
|
|
1154
|
-
'action': { 'data': 'https://www.naver.com' },
|
|
1155
|
-
},
|
|
1156
|
-
],
|
|
1157
|
-
},
|
|
1158
|
-
],
|
|
1159
|
-
'action': { 'data': 'https://www.naver.com' },
|
|
1160
|
-
},
|
|
1161
|
-
{
|
|
1162
|
-
'type': 'image',
|
|
1163
|
-
'viewStyle': {},
|
|
1164
|
-
'width': { 'type': 'flex', 'value': FlexSizeSpecValue.FillParent },
|
|
1165
|
-
'height': { 'type': 'flex', 'value': FlexSizeSpecValue.FillParent },
|
|
1166
|
-
'imageStyle': { 'contentMode': 'aspectFill' },
|
|
1167
|
-
'imageUrl': 'https://file-preprod.sendbird.com/d03c08bb3f9041a88c1207b6bbf15ab8.png',
|
|
1168
|
-
'metaData': { 'pixelWidth': '1062', 'pixelHeight': '1070' },
|
|
1169
|
-
},
|
|
1170
|
-
{
|
|
1171
|
-
'type': 'textButton',
|
|
1172
|
-
'viewStyle': {
|
|
1173
|
-
'backgroundColor': '#E0E0E0',
|
|
1174
|
-
'padding': { 'top': '10', 'bottom': '10', 'left': '20', 'right': '20' },
|
|
1175
|
-
},
|
|
1176
|
-
'width': { 'type': 'flex', 'value': FlexSizeSpecValue.FillParent },
|
|
1177
|
-
'height': { 'type': 'flex', 'value': FlexSizeSpecValue.FillParent },
|
|
1178
|
-
'text': 'Button',
|
|
1179
|
-
'textStyle': { 'color': '#742DDD', 'size': '16', 'weight': 'normal' },
|
|
1180
|
-
'maxTextLines': '5',
|
|
1181
|
-
'action': { 'data': 'www.naver.com' },
|
|
1182
|
-
},
|
|
1183
|
-
{
|
|
1184
|
-
'type': 'imageButton',
|
|
1185
|
-
'viewStyle': {},
|
|
1186
|
-
'width': { 'type': 'flex', 'value': FlexSizeSpecValue.FillParent },
|
|
1187
|
-
'height': { 'type': 'flex', 'value': FlexSizeSpecValue.FillParent },
|
|
1188
|
-
'imageUrl': 'https://file-preprod.sendbird.com/38fdf5c1056f42b89a44b38155cc4b49.jpg',
|
|
1189
|
-
'imageStyle': { 'contentMode': 'aspectFill' },
|
|
1190
|
-
'metaData': { 'pixelWidth': '1080', 'pixelHeight': '2640' },
|
|
1191
|
-
'action': { 'data': 'www.naver.com' },
|
|
1192
|
-
},
|
|
1193
|
-
],
|
|
1194
|
-
'viewStyle': {},
|
|
1195
|
-
},
|
|
1196
|
-
],
|
|
1197
|
-
},
|
|
1198
|
-
});
|
|
1199
|
-
({
|
|
1200
|
-
'version': 1,
|
|
1201
|
-
'body': {
|
|
1202
|
-
'items': [
|
|
1203
|
-
{
|
|
1204
|
-
'elementId': 'root',
|
|
1205
|
-
'type': 'box',
|
|
1206
|
-
'layout': 'column',
|
|
1207
|
-
'width': {
|
|
1208
|
-
'type': 'flex',
|
|
1209
|
-
'value': FlexSizeSpecValue.FillParent,
|
|
1210
|
-
},
|
|
1211
|
-
'height': {
|
|
1212
|
-
'type': 'flex',
|
|
1213
|
-
'value': FlexSizeSpecValue.WrapContent,
|
|
1214
|
-
},
|
|
1215
|
-
'items': [
|
|
1216
|
-
{
|
|
1217
|
-
'type': 'text',
|
|
1218
|
-
'viewStyle': {
|
|
1219
|
-
'backgroundColor': '#a0c0ffff',
|
|
1220
|
-
'margin': {
|
|
1221
|
-
'top': 16,
|
|
1222
|
-
'bottom': 16,
|
|
1223
|
-
'left': 16,
|
|
1224
|
-
'right': 16,
|
|
1225
|
-
},
|
|
1226
|
-
'padding': {
|
|
1227
|
-
'top': 16,
|
|
1228
|
-
'bottom': 16,
|
|
1229
|
-
'left': 16,
|
|
1230
|
-
'right': 16,
|
|
1231
|
-
},
|
|
1232
|
-
},
|
|
1233
|
-
'text': 'Wrap Wrap Wrap Wrap Wrap Wrap Wrap Wrap Wrap Wrap ',
|
|
1234
|
-
'textStyle': {
|
|
1235
|
-
'size': 14,
|
|
1236
|
-
'color': '#222121e0',
|
|
1237
|
-
'weight': 'normal',
|
|
1238
|
-
},
|
|
1239
|
-
'maxTextLines': 5,
|
|
1240
|
-
'width': {
|
|
1241
|
-
'type': 'flex',
|
|
1242
|
-
'value': FlexSizeSpecValue.FillParent,
|
|
1243
|
-
},
|
|
1244
|
-
'height': {
|
|
1245
|
-
'type': 'flex',
|
|
1246
|
-
'value': 1,
|
|
1247
|
-
},
|
|
1248
|
-
'align': {
|
|
1249
|
-
'horizontal': 'left',
|
|
1250
|
-
'vertical': 'top',
|
|
1251
|
-
},
|
|
1252
|
-
'elementId': 'c0e15878-4984-408d-abaa-4b495c2e3872',
|
|
1253
|
-
},
|
|
1254
|
-
{
|
|
1255
|
-
'type': 'imageButton',
|
|
1256
|
-
'viewStyle': {
|
|
1257
|
-
margin: {
|
|
1258
|
-
left: 24,
|
|
1259
|
-
right: 12,
|
|
1260
|
-
},
|
|
1261
|
-
},
|
|
1262
|
-
'width': { 'type': 'flex', 'value': FlexSizeSpecValue.FillParent },
|
|
1263
|
-
'height': { 'type': 'fixed', 'value': 250 },
|
|
1264
|
-
'imageUrl': 'https://cdn.pixabay.com/photo/2022/10/12/10/45/bird-7516219_1280.jpg',
|
|
1265
|
-
'imageStyle': { 'contentMode': 'aspectFill' },
|
|
1266
|
-
'metaData': { 'pixelWidth': '1080', 'pixelHeight': '2640' },
|
|
1267
|
-
'action': { 'data': 'www.naver.com' },
|
|
1268
|
-
},
|
|
1269
|
-
],
|
|
1270
|
-
},
|
|
1271
|
-
],
|
|
1272
|
-
},
|
|
1273
|
-
});
|
|
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
|
-
|
|
1542
|
-
const SWIPE_THRESHOLD = 24;
|
|
1543
|
-
const CLICK_THRESHOLD = 5;
|
|
1544
|
-
function useCarousel({ spacing, childrenLength, paddingInlineStart, paddingInlineEnd }) {
|
|
1545
|
-
const carouselRef = useRef(null);
|
|
1546
|
-
const childrenRefs = useRef(Array.from({ length: childrenLength }, () => React__default.createRef()));
|
|
1547
|
-
const isDragging = useRef(false);
|
|
1548
|
-
const isScrolling = useRef(false);
|
|
1549
|
-
const animationFrame = useRef(null);
|
|
1550
|
-
const drag = useRef({
|
|
1551
|
-
sx: null,
|
|
1552
|
-
sy: null,
|
|
1553
|
-
offset: 0,
|
|
1554
|
-
translateX: 0,
|
|
1555
|
-
currentIndex: 0,
|
|
1556
|
-
didMove: false,
|
|
1557
|
-
});
|
|
1558
|
-
const [childWidths, setChildWidths] = useState(() => childrenRefs.current.map(() => 0));
|
|
1559
|
-
const [isRTL, setIsRTL] = useState(false);
|
|
1560
|
-
const directionMultiplier = isRTL ? -1 : 1;
|
|
1561
|
-
const itemPositions = useMemo(() => {
|
|
1562
|
-
let currentPosition = paddingInlineStart;
|
|
1563
|
-
return childWidths.map((width, i) => {
|
|
1564
|
-
const spacingOffset = i > 0 ? spacing : 0;
|
|
1565
|
-
const start = currentPosition - spacingOffset;
|
|
1566
|
-
const end = start - width;
|
|
1567
|
-
currentPosition = end;
|
|
1568
|
-
return { start, end };
|
|
1569
|
-
});
|
|
1570
|
-
}, [childWidths, spacing, paddingInlineStart]);
|
|
1571
|
-
const totalContentWidth = useMemo(() => {
|
|
1572
|
-
const totalItemWidth = childWidths.reduce((acc, width) => acc + width, 0);
|
|
1573
|
-
const totalSpacing = spacing * (childrenLength - 1);
|
|
1574
|
-
return totalItemWidth + totalSpacing;
|
|
1575
|
-
}, [childWidths, spacing, childrenLength]);
|
|
1576
|
-
useLayoutEffect(() => {
|
|
1577
|
-
if (carouselRef.current) {
|
|
1578
|
-
const dir = getComputedStyle(carouselRef.current).direction;
|
|
1579
|
-
setIsRTL(dir === 'rtl');
|
|
1580
|
-
}
|
|
1581
|
-
}, []);
|
|
1582
|
-
useLayoutEffect(() => {
|
|
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; }));
|
|
1584
|
-
}, [childrenLength]);
|
|
1585
|
-
useLayoutEffect(() => {
|
|
1586
|
-
if (itemPositions.length > 0) {
|
|
1587
|
-
drag.current.translateX = itemPositions[0].start;
|
|
1588
|
-
animate();
|
|
1589
|
-
}
|
|
1590
|
-
}, [itemPositions]);
|
|
1591
|
-
const dragStart = () => {
|
|
1592
|
-
if (!carouselRef.current)
|
|
1593
|
-
return;
|
|
1594
|
-
isDragging.current = true;
|
|
1595
|
-
carouselRef.current.style.cursor = 'grabbing';
|
|
1596
|
-
carouselRef.current.style.transition = 'none';
|
|
1597
|
-
animationFrame.current = requestAnimationFrame(animate);
|
|
1598
|
-
};
|
|
1599
|
-
const dragStop = () => {
|
|
1600
|
-
if (!carouselRef.current)
|
|
1601
|
-
return;
|
|
1602
|
-
isDragging.current = false;
|
|
1603
|
-
carouselRef.current.style.cursor = 'grab';
|
|
1604
|
-
carouselRef.current.style.transition = 'transform 0.5s ease';
|
|
1605
|
-
if (animationFrame.current) {
|
|
1606
|
-
cancelAnimationFrame(animationFrame.current);
|
|
1607
|
-
animationFrame.current = null;
|
|
1608
|
-
}
|
|
1609
|
-
};
|
|
1610
|
-
const dragRelease = () => {
|
|
1611
|
-
const { offset, currentIndex } = drag.current;
|
|
1612
|
-
const thresholdExceeded = Math.abs(offset) >= SWIPE_THRESHOLD;
|
|
1613
|
-
const swipeToNext = offset < 0 && currentIndex < childrenLength - 1;
|
|
1614
|
-
const swipeToPrev = offset > 0 && currentIndex > 0;
|
|
1615
|
-
let newIndex = currentIndex;
|
|
1616
|
-
if (thresholdExceeded && swipeToNext) {
|
|
1617
|
-
newIndex = currentIndex + 1;
|
|
1618
|
-
}
|
|
1619
|
-
else if (thresholdExceeded && swipeToPrev) {
|
|
1620
|
-
newIndex = currentIndex - 1;
|
|
1621
|
-
}
|
|
1622
|
-
function clampTranslateX(translateX) {
|
|
1623
|
-
var _a, _b;
|
|
1624
|
-
const containerWidth = (_b = (_a = carouselRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth) !== null && _b !== void 0 ? _b : 0;
|
|
1625
|
-
const start = paddingInlineStart;
|
|
1626
|
-
const end = Math.min(0, containerWidth - totalContentWidth) - paddingInlineEnd;
|
|
1627
|
-
return Math.min(start, Math.max(translateX, end));
|
|
1628
|
-
}
|
|
1629
|
-
drag.current.currentIndex = newIndex;
|
|
1630
|
-
drag.current.translateX = clampTranslateX(itemPositions[newIndex].start);
|
|
1631
|
-
drag.current.offset = 0;
|
|
1632
|
-
};
|
|
1633
|
-
const scrollStart = () => {
|
|
1634
|
-
isScrolling.current = true;
|
|
1635
|
-
};
|
|
1636
|
-
const scrollStop = () => {
|
|
1637
|
-
isScrolling.current = false;
|
|
1638
|
-
};
|
|
1639
|
-
const animate = () => {
|
|
1640
|
-
if (carouselRef.current) {
|
|
1641
|
-
const tx = (drag.current.translateX + drag.current.offset) * directionMultiplier;
|
|
1642
|
-
carouselRef.current.style.transform = `translateX(${tx}px)`;
|
|
1643
|
-
}
|
|
1644
|
-
if (animationFrame.current) {
|
|
1645
|
-
animationFrame.current = requestAnimationFrame(animate);
|
|
1646
|
-
}
|
|
1647
|
-
};
|
|
1648
|
-
const blockScroll = () => {
|
|
1649
|
-
if (carouselRef.current) {
|
|
1650
|
-
carouselRef.current.style.touchAction = 'pan-x';
|
|
1651
|
-
}
|
|
1652
|
-
};
|
|
1653
|
-
const unblockScroll = () => {
|
|
1654
|
-
if (carouselRef.current) {
|
|
1655
|
-
carouselRef.current.style.touchAction = 'pan-y';
|
|
1656
|
-
}
|
|
1657
|
-
};
|
|
1658
|
-
const onMouseDown = (event) => {
|
|
1659
|
-
dragStart();
|
|
1660
|
-
scrollStop();
|
|
1661
|
-
drag.current.sx = event.clientX;
|
|
1662
|
-
drag.current.sy = event.clientY;
|
|
1663
|
-
drag.current.offset = 0;
|
|
1664
|
-
drag.current.didMove = false;
|
|
1665
|
-
animationFrame.current = requestAnimationFrame(animate);
|
|
1666
|
-
};
|
|
1667
|
-
const onMouseMove = (event) => {
|
|
1668
|
-
if (!isDragging.current || drag.current.sx === null)
|
|
1669
|
-
return;
|
|
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
|
-
}
|
|
1674
|
-
};
|
|
1675
|
-
const onMouseUp = (event) => {
|
|
1676
|
-
if (!isDragging.current)
|
|
1677
|
-
return;
|
|
1678
|
-
scrollStop();
|
|
1679
|
-
dragRelease();
|
|
1680
|
-
dragStop();
|
|
1681
|
-
if (drag.current.didMove) {
|
|
1682
|
-
event.preventDefault();
|
|
1683
|
-
event.stopPropagation();
|
|
1684
|
-
}
|
|
1685
|
-
};
|
|
1686
|
-
const onMouseLeave = (event) => {
|
|
1687
|
-
if (!isDragging.current)
|
|
1688
|
-
return;
|
|
1689
|
-
scrollStop();
|
|
1690
|
-
dragRelease();
|
|
1691
|
-
dragStop();
|
|
1692
|
-
if (drag.current.didMove) {
|
|
1693
|
-
event.preventDefault();
|
|
1694
|
-
event.stopPropagation();
|
|
1695
|
-
}
|
|
1696
|
-
};
|
|
1697
|
-
const onTouchStart = (event) => {
|
|
1698
|
-
scrollStop();
|
|
1699
|
-
dragStop();
|
|
1700
|
-
const touch = event.touches[0];
|
|
1701
|
-
drag.current.sx = touch.clientX;
|
|
1702
|
-
drag.current.sy = touch.clientY;
|
|
1703
|
-
drag.current.offset = 0;
|
|
1704
|
-
drag.current.didMove = false;
|
|
1705
|
-
animationFrame.current = requestAnimationFrame(animate);
|
|
1706
|
-
};
|
|
1707
|
-
const onTouchMove = (event) => {
|
|
1708
|
-
if (drag.current.sx === null || drag.current.sy === null || isScrolling.current)
|
|
1709
|
-
return;
|
|
1710
|
-
const { clientX, clientY } = event.touches[0];
|
|
1711
|
-
const { sx, sy } = drag.current;
|
|
1712
|
-
if (isDragging.current) {
|
|
1713
|
-
drag.current.offset = (clientX - sx) * directionMultiplier;
|
|
1714
|
-
if (Math.abs(drag.current.offset) > CLICK_THRESHOLD) {
|
|
1715
|
-
drag.current.didMove = true;
|
|
1716
|
-
}
|
|
1717
|
-
return;
|
|
1718
|
-
}
|
|
1719
|
-
const isVerticalScroll = Math.abs(clientY - sy) > Math.abs(clientX - sx);
|
|
1720
|
-
if (isVerticalScroll) {
|
|
1721
|
-
scrollStart();
|
|
1722
|
-
}
|
|
1723
|
-
else {
|
|
1724
|
-
drag.current.offset = (clientX - sx) * directionMultiplier;
|
|
1725
|
-
blockScroll();
|
|
1726
|
-
dragStart();
|
|
1727
|
-
}
|
|
1728
|
-
};
|
|
1729
|
-
const onTouchEnd = (event) => {
|
|
1730
|
-
unblockScroll();
|
|
1731
|
-
scrollStop();
|
|
1732
|
-
dragRelease();
|
|
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
|
-
}
|
|
1744
|
-
};
|
|
1745
|
-
return {
|
|
1746
|
-
carouselRef,
|
|
1747
|
-
childrenRefs,
|
|
1748
|
-
handlers: {
|
|
1749
|
-
onMouseDown,
|
|
1750
|
-
onMouseMove,
|
|
1751
|
-
onMouseUp,
|
|
1752
|
-
onMouseLeave,
|
|
1753
|
-
onTouchStart,
|
|
1754
|
-
onTouchMove,
|
|
1755
|
-
onTouchEnd,
|
|
1756
|
-
onClickCapture,
|
|
1757
|
-
},
|
|
1758
|
-
};
|
|
1759
|
-
}
|
|
1760
|
-
|
|
1761
|
-
var __rest$4 = (undefined && undefined.__rest) || function (s, e) {
|
|
1762
|
-
var t = {};
|
|
1763
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1764
|
-
t[p] = s[p];
|
|
1765
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
1766
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1767
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
1768
|
-
t[p[i]] = s[p[i]];
|
|
1769
|
-
}
|
|
1770
|
-
return t;
|
|
1771
|
-
};
|
|
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"]);
|
|
1775
|
-
const { carouselRef, childrenRefs, handlers } = useCarousel({
|
|
1776
|
-
spacing,
|
|
1777
|
-
childrenLength: children.length,
|
|
1778
|
-
paddingInlineStart: Number(paddingInlineStart),
|
|
1779
|
-
paddingInlineEnd: Number(paddingInlineEnd),
|
|
1780
|
-
});
|
|
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)))));
|
|
1782
|
-
};
|
|
1783
|
-
const RMTCarouselChild = React__default.forwardRef(function CarouselChild({ maxChildWidth, children }, ref) {
|
|
1784
|
-
const maxWidth = shouldSetMaxChildWidth(children.props, maxChildWidth) ? maxChildWidth : 'fit-content';
|
|
1785
|
-
return (React__default.createElement("div", { ref: ref, style: { maxWidth, width: '100%', flexShrink: 0, overflow: 'hidden', userSelect: 'none' } }, children));
|
|
1786
|
-
});
|
|
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
|
|
1788
|
-
function shouldSetMaxChildWidth(props, maxChildWidth) {
|
|
1789
|
-
return !!props.templateItems.find((it) => {
|
|
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;
|
|
1794
|
-
return hasFillWidth || overMaxChildWidth;
|
|
1795
|
-
});
|
|
1796
|
-
}
|
|
1797
|
-
|
|
1798
|
-
var __rest$3 = (undefined && undefined.__rest) || function (s, e) {
|
|
1799
|
-
var t = {};
|
|
1800
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1801
|
-
t[p] = s[p];
|
|
1802
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
1803
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1804
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
1805
|
-
t[p[i]] = s[p[i]];
|
|
1806
|
-
}
|
|
1807
|
-
return t;
|
|
1808
|
-
};
|
|
1809
|
-
const RMTImageCanvas = (props) => {
|
|
1810
|
-
const { imageSize, canvasRef, canvasProps } = useCanvasMessageTemplateImage(props);
|
|
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 })));
|
|
1812
|
-
};
|
|
1813
|
-
const useCanvasMessageTemplateImage = (_a) => {
|
|
1814
|
-
var { metaData, tintColor } = _a, props = __rest$3(_a, ["metaData", "tintColor"]);
|
|
1815
|
-
const canvasRef = useRef(null);
|
|
1816
|
-
const [fallbackImageSize, setFallbackImageSize] = useState();
|
|
1817
|
-
const imageSize = useMemo(() => {
|
|
1818
|
-
if ((metaData === null || metaData === void 0 ? void 0 : metaData.pixelHeight) && (metaData === null || metaData === void 0 ? void 0 : metaData.pixelWidth)) {
|
|
1819
|
-
return { width: metaData.pixelWidth, height: metaData.pixelHeight };
|
|
1820
|
-
}
|
|
1821
|
-
return fallbackImageSize;
|
|
1822
|
-
}, [fallbackImageSize, metaData === null || metaData === void 0 ? void 0 : metaData.pixelHeight, metaData === null || metaData === void 0 ? void 0 : metaData.pixelWidth]);
|
|
1823
|
-
useEffect(() => {
|
|
1824
|
-
if (imageSize == null) {
|
|
1825
|
-
if (canvasRef.current) {
|
|
1826
|
-
canvasRef.current.style.width = '100%';
|
|
1827
|
-
canvasRef.current.style.height = '100%';
|
|
1828
|
-
const containerSize = canvasRef.current.getBoundingClientRect();
|
|
1829
|
-
setFallbackImageSize(containerSize);
|
|
1830
|
-
}
|
|
1831
|
-
}
|
|
1832
|
-
}, [imageSize]);
|
|
1833
|
-
useEffect(() => {
|
|
1834
|
-
if (props.src) {
|
|
1835
|
-
const img = new Image();
|
|
1836
|
-
const onImageLoad = () => {
|
|
1837
|
-
if (canvasRef.current && tintColor && imageSize) {
|
|
1838
|
-
const ctx = canvasRef.current.getContext('2d');
|
|
1839
|
-
if (ctx) {
|
|
1840
|
-
const { width: imageWidth, height: imageHeight } = imageSize;
|
|
1841
|
-
// reset context before draw, consider `.save()` and `.restore()` api
|
|
1842
|
-
ctx.clearRect(0, 0, imageWidth, imageHeight);
|
|
1843
|
-
ctx.beginPath();
|
|
1844
|
-
ctx.globalCompositeOperation = 'source-over';
|
|
1845
|
-
ctx.fillStyle = '#000';
|
|
1846
|
-
// draw
|
|
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
|
-
};
|
|
1866
|
-
}
|
|
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]];
|
|
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));
|
|
1902
|
-
}
|
|
1903
|
-
else if (tintColor && !isGif(props.src)) {
|
|
1904
|
-
return React__default.createElement(RMTImageCanvas, Object.assign({}, props, { onError: onError, tintColor: tintColor, metaData: metaData }));
|
|
1905
|
-
}
|
|
1906
|
-
else {
|
|
1907
|
-
return React__default.createElement(RMTImageDefault, Object.assign({}, props, { onError: onError }));
|
|
1908
|
-
}
|
|
1909
|
-
};
|
|
1910
|
-
const useImageLoadError = (source) => {
|
|
1911
|
-
const [hasError, setHasError] = useState(false);
|
|
1912
|
-
useEffect(() => setHasError(false), [source]);
|
|
1913
|
-
return {
|
|
1914
|
-
hasError,
|
|
1915
|
-
onError: useCallback(() => setHasError(true), []),
|
|
1916
|
-
};
|
|
1917
|
-
};
|
|
1918
|
-
|
|
1919
|
-
// create a context provider for MessageComponent
|
|
1920
|
-
// - this is a wrapper for MessageComponent
|
|
1921
|
-
const MessageContext = React__default.createContext(null);
|
|
1922
|
-
const MessageProvider = ({ message, handleWebAction, handleCustomAction, handlePredefinedAction, highlight, children, }) => {
|
|
1923
|
-
const value = React__default.useMemo(() => ({
|
|
1924
|
-
message,
|
|
1925
|
-
handleWebAction,
|
|
1926
|
-
handleCustomAction,
|
|
1927
|
-
handlePredefinedAction,
|
|
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]);
|
|
1930
|
-
return React__default.createElement(MessageContext.Provider, { value: value }, children);
|
|
1931
|
-
};
|
|
1932
|
-
const useMessageContext = () => {
|
|
1933
|
-
const context = React__default.useContext(MessageContext);
|
|
1934
|
-
if (!context) {
|
|
1935
|
-
throw new Error('useMessageContext must be used within a MessageProvider');
|
|
1936
|
-
}
|
|
1937
|
-
return context;
|
|
1938
|
-
};
|
|
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
|
-
|
|
1952
|
-
/**
|
|
1953
|
-
* Preserves a reference to the given callback function as an argument while the component is mounted.
|
|
1954
|
-
* Wraps the given callback in React's Ref to preserve the reference.
|
|
1955
|
-
* @param callback want to be preserved
|
|
1956
|
-
*/
|
|
1957
|
-
function usePreservedCallback(callback) {
|
|
1958
|
-
const callbackRef = useRef(callback);
|
|
1959
|
-
useEffect(() => {
|
|
1960
|
-
callbackRef.current = callback;
|
|
1961
|
-
}, [callback]);
|
|
1962
|
-
return useCallback((...args) => {
|
|
1963
|
-
return callbackRef.current(...args);
|
|
1964
|
-
}, [callbackRef]);
|
|
1965
|
-
}
|
|
1966
|
-
|
|
1967
|
-
/**
|
|
1968
|
-
* This hook can be used when you want to safely effect the value stored in useRef
|
|
1969
|
-
* Got this idea from https://github.com/facebook/react/issues/15176
|
|
1970
|
-
* @param callback
|
|
1971
|
-
* @param deps
|
|
1972
|
-
* @returns effect callback
|
|
1973
|
-
*/
|
|
1974
|
-
function useRefEffect(callback, deps) {
|
|
1975
|
-
const preservedCallback = usePreservedCallback(callback);
|
|
1976
|
-
const disposeRef = useRef(noop);
|
|
1977
|
-
const effect = useCallback((element) => {
|
|
1978
|
-
disposeRef.current();
|
|
1979
|
-
disposeRef.current = noop;
|
|
1980
|
-
if (element != null) {
|
|
1981
|
-
const cleanup = callback(element);
|
|
1982
|
-
if (typeof cleanup === 'function') {
|
|
1983
|
-
disposeRef.current = cleanup;
|
|
1984
|
-
}
|
|
1985
|
-
}
|
|
1986
|
-
}, [preservedCallback, ...deps]);
|
|
1987
|
-
return effect;
|
|
1988
|
-
}
|
|
1989
|
-
function noop() { }
|
|
1990
|
-
|
|
1991
|
-
/**
|
|
1992
|
-
* Subscribes to ResizeObserver on the component exposing the Ref,
|
|
1993
|
-
* to detect changes in the size of DOM elements.
|
|
1994
|
-
* The ResizeObserver API is required.
|
|
1995
|
-
* If you are targeting browsers that do not support that API, probably need to add appropriate polyfill too.
|
|
1996
|
-
* @param onResize
|
|
1997
|
-
* @returns ref
|
|
1998
|
-
*/
|
|
1999
|
-
function useResizeObserver(onResize) {
|
|
2000
|
-
const resizeCallback = usePreservedCallback(onResize);
|
|
2001
|
-
const ref = useRefEffect((elem) => {
|
|
2002
|
-
const observer = new ResizeObserver((entries) => {
|
|
2003
|
-
if (entries[0] != null) {
|
|
2004
|
-
resizeCallback(entries[0]);
|
|
2005
|
-
}
|
|
2006
|
-
});
|
|
2007
|
-
observer.observe(elem);
|
|
2008
|
-
return () => {
|
|
2009
|
-
observer.unobserve(elem);
|
|
2010
|
-
};
|
|
2011
|
-
}, [resizeCallback]);
|
|
2012
|
-
return ref;
|
|
2013
|
-
}
|
|
2014
|
-
|
|
2015
|
-
/**
|
|
2016
|
-
* @returns an element's width / height observed by IntersectionObserver,
|
|
2017
|
-
* and ref to detect its resize event
|
|
2018
|
-
*/
|
|
2019
|
-
function useElementSize() {
|
|
2020
|
-
const [width, setWidth] = useState(-1);
|
|
2021
|
-
const [height, setHeight] = useState(-1);
|
|
2022
|
-
const [contentWidth, setContentWidth] = useState(-1);
|
|
2023
|
-
const [contentHeight, setContentHeight] = useState(-1);
|
|
2024
|
-
const [paddingWidth, setPaddingWidth] = useState(-1);
|
|
2025
|
-
const [paddingHeight, setPaddingHeight] = useState(-1);
|
|
2026
|
-
const ref = useResizeObserver((entry) => {
|
|
2027
|
-
// contentRect: content size only
|
|
2028
|
-
const { width: contentWidth, height: contentHeight } = entry.contentRect;
|
|
2029
|
-
// target: content + padding + border size
|
|
2030
|
-
const target = entry.target;
|
|
2031
|
-
const { width, height } = target.getBoundingClientRect();
|
|
2032
|
-
setWidth(width);
|
|
2033
|
-
setHeight(height);
|
|
2034
|
-
setContentWidth(contentWidth);
|
|
2035
|
-
setContentHeight(contentHeight);
|
|
2036
|
-
setPaddingWidth(width - contentWidth);
|
|
2037
|
-
setPaddingHeight(height - contentHeight);
|
|
2038
|
-
});
|
|
2039
|
-
return { ref, width, height, contentWidth, contentHeight, paddingWidth, paddingHeight };
|
|
2040
|
-
}
|
|
2041
|
-
|
|
2042
|
-
var __rest$1 = (undefined && undefined.__rest) || function (s, e) {
|
|
2043
|
-
var t = {};
|
|
2044
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2045
|
-
t[p] = s[p];
|
|
2046
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
2047
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
2048
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
2049
|
-
t[p[i]] = s[p[i]];
|
|
2050
|
-
}
|
|
2051
|
-
return t;
|
|
2052
|
-
};
|
|
2053
|
-
function isViewCompatibleWithSizeOption({ width = defaultProperties.view.size.width, height = defaultProperties.view.size.height, parentLayout = defaultProperties.box.layout, option, }) {
|
|
2054
|
-
if (parentLayout === Layout.Row) {
|
|
2055
|
-
return isSizeCompatibleWithOption({
|
|
2056
|
-
size: width,
|
|
2057
|
-
option,
|
|
2058
|
-
});
|
|
2059
|
-
}
|
|
2060
|
-
return isSizeCompatibleWithOption({
|
|
2061
|
-
size: height,
|
|
2062
|
-
option,
|
|
2063
|
-
});
|
|
2064
|
-
}
|
|
2065
|
-
function useRecalculateWidth(params) {
|
|
2066
|
-
const { style, props } = params;
|
|
2067
|
-
const _a = useElementSize(), { ref: elemRef } = _a, size = __rest$1(_a, ["ref"]);
|
|
2068
|
-
const { updateSize, sizes } = useSizeContext();
|
|
2069
|
-
const { id, siblings, parentLayout } = props;
|
|
2070
|
-
const { width, height, paddingWidth, paddingHeight, contentWidth, contentHeight } = size;
|
|
2071
|
-
useEffect(() => {
|
|
2072
|
-
updateSize({
|
|
2073
|
-
id: props.id,
|
|
2074
|
-
width,
|
|
2075
|
-
height,
|
|
2076
|
-
paddingWidth,
|
|
2077
|
-
paddingHeight,
|
|
2078
|
-
contentWidth,
|
|
2079
|
-
contentHeight,
|
|
2080
|
-
});
|
|
2081
|
-
}, [props.id, width, height, paddingWidth, paddingHeight, contentWidth, contentHeight, updateSize]);
|
|
2082
|
-
const currentStyle = useMemo(() => {
|
|
2083
|
-
const sumViewSize = (acc = 0, view) => {
|
|
2084
|
-
var _a, _b, _c, _d;
|
|
2085
|
-
if (parentLayout === Layout.Row) {
|
|
2086
|
-
return acc + ((_b = (_a = sizes[view.id]) === null || _a === void 0 ? void 0 : _a.contentWidth) !== null && _b !== void 0 ? _b : 0);
|
|
2087
|
-
}
|
|
2088
|
-
return acc + ((_d = (_c = sizes[view.id]) === null || _c === void 0 ? void 0 : _c.contentHeight) !== null && _d !== void 0 ? _d : 0);
|
|
2089
|
-
};
|
|
2090
|
-
const hasFillOption = isViewCompatibleWithSizeOption({
|
|
2091
|
-
width: props.width,
|
|
2092
|
-
height: props.height,
|
|
2093
|
-
parentLayout,
|
|
2094
|
-
option: 'fill',
|
|
2095
|
-
});
|
|
2096
|
-
if (hasFillOption) {
|
|
2097
|
-
const wrapSiblingsSize = siblings
|
|
2098
|
-
.filter(({ width, height }) => !isViewCompatibleWithSizeOption({
|
|
2099
|
-
width: width,
|
|
2100
|
-
height: height,
|
|
2101
|
-
parentLayout,
|
|
2102
|
-
option: 'fill',
|
|
2103
|
-
}))
|
|
2104
|
-
.reduce(sumViewSize, 0);
|
|
2105
|
-
const fillSiblingCount = siblings.filter(({ width, height }) => isViewCompatibleWithSizeOption({
|
|
2106
|
-
width: width,
|
|
2107
|
-
height: height,
|
|
2108
|
-
parentLayout,
|
|
2109
|
-
option: 'fill',
|
|
2110
|
-
})).length;
|
|
2111
|
-
const maxSizeOption = (() => {
|
|
2112
|
-
if (parentLayout === Layout.Row) {
|
|
2113
|
-
return {
|
|
2114
|
-
maxWidth: `calc((100% - ${wrapSiblingsSize}px) / ${fillSiblingCount})`,
|
|
2115
|
-
};
|
|
2116
|
-
}
|
|
2117
|
-
return {
|
|
2118
|
-
maxHeight: `calc((100% - ${wrapSiblingsSize}px) / ${fillSiblingCount})`,
|
|
2119
|
-
};
|
|
2120
|
-
})();
|
|
2121
|
-
return Object.assign(Object.assign(Object.assign({}, style), maxSizeOption), (width == 0 && { height: 0 }));
|
|
2122
|
-
}
|
|
2123
|
-
else {
|
|
2124
|
-
const currentElemIdx = siblings.findIndex((sibling) => sibling.id === id);
|
|
2125
|
-
const forwardSiblingsSize = siblings
|
|
2126
|
-
.slice(0, currentElemIdx)
|
|
2127
|
-
.filter(({ width, height }) => isViewCompatibleWithSizeOption({
|
|
2128
|
-
width: width,
|
|
2129
|
-
height: height,
|
|
2130
|
-
parentLayout,
|
|
2131
|
-
option: 'wrap',
|
|
2132
|
-
}))
|
|
2133
|
-
.reduce(sumViewSize, 0);
|
|
2134
|
-
return Object.assign(Object.assign(Object.assign({}, style), (width === 0 && { height: 0 })), (parentLayout === Layout.Row
|
|
2135
|
-
? {
|
|
2136
|
-
maxWidth: `calc(100% - ${forwardSiblingsSize}px)`,
|
|
2137
|
-
}
|
|
2138
|
-
: {
|
|
2139
|
-
maxHeight: `calc(100% - ${forwardSiblingsSize}px)`,
|
|
2140
|
-
}));
|
|
2141
|
-
}
|
|
2142
|
-
}, [props.width, props.height, parentLayout, sizes, siblings, style, width, id]);
|
|
2143
|
-
return { recalculatedStyle: currentStyle, elemRef };
|
|
2144
|
-
}
|
|
2145
|
-
|
|
2146
|
-
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
2147
|
-
var t = {};
|
|
2148
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2149
|
-
t[p] = s[p];
|
|
2150
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
2151
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
2152
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
2153
|
-
t[p[i]] = s[p[i]];
|
|
2154
|
-
}
|
|
2155
|
-
return t;
|
|
2156
|
-
};
|
|
2157
|
-
// todo: semantic html here is not perfect, need to revisit. Same for Button
|
|
2158
|
-
const ActionHandler = ({ children, props, className, style, inlineStyle }) => {
|
|
2159
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
2160
|
-
const { recalculatedStyle, elemRef } = useRecalculateWidth({ style, props });
|
|
2161
|
-
const { message, handleWebAction, handleCustomAction, handlePredefinedAction } = useMessageContext();
|
|
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' : '';
|
|
2164
|
-
const paddingStyles = {
|
|
2165
|
-
paddingBlockStart: (_c = (_b = props.viewStyle) === null || _b === void 0 ? void 0 : _b.padding) === null || _c === void 0 ? void 0 : _c.top,
|
|
2166
|
-
paddingBlockEnd: (_e = (_d = props.viewStyle) === null || _d === void 0 ? void 0 : _d.padding) === null || _e === void 0 ? void 0 : _e.bottom,
|
|
2167
|
-
paddingInlineStart: (_g = (_f = props.viewStyle) === null || _f === void 0 ? void 0 : _f.padding) === null || _g === void 0 ? void 0 : _g.left,
|
|
2168
|
-
paddingInlineEnd: (_j = (_h = props.viewStyle) === null || _h === void 0 ? void 0 : _h.padding) === null || _j === void 0 ? void 0 : _j.right,
|
|
2169
|
-
};
|
|
2170
|
-
const onClick = (e) => {
|
|
2171
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
2172
|
-
if (((_a = props.action) === null || _a === void 0 ? void 0 : _a.type) === 'web') {
|
|
2173
|
-
if (handleWebAction) {
|
|
2174
|
-
handleWebAction(e, props.action, message);
|
|
2175
|
-
}
|
|
2176
|
-
else {
|
|
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();
|
|
2178
|
-
}
|
|
2179
|
-
}
|
|
2180
|
-
else if (((_d = props.action) === null || _d === void 0 ? void 0 : _d.type) === 'custom') {
|
|
2181
|
-
if (handleCustomAction) {
|
|
2182
|
-
handleCustomAction(e, props.action, message);
|
|
2183
|
-
}
|
|
2184
|
-
else {
|
|
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();
|
|
2186
|
-
}
|
|
2187
|
-
}
|
|
2188
|
-
else if (((_g = props.action) === null || _g === void 0 ? void 0 : _g.type) === 'uikit') {
|
|
2189
|
-
handlePredefinedAction === null || handlePredefinedAction === void 0 ? void 0 : handlePredefinedAction(e, props.action, message);
|
|
2190
|
-
}
|
|
2191
|
-
};
|
|
2192
|
-
if (props.type === ComponentType.TextButton) {
|
|
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));
|
|
2194
|
-
}
|
|
2195
|
-
const { display, flexDirection, justifyContent, alignItems, objectFit } = recalculatedStyle, wrapperStyles = __rest(recalculatedStyle, ["display", "flexDirection", "justifyContent", "alignItems", "objectFit"]);
|
|
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 },
|
|
2197
|
-
React__default.createElement("div", { style: Object.assign({ display,
|
|
2198
|
-
flexDirection,
|
|
2199
|
-
justifyContent,
|
|
2200
|
-
alignItems,
|
|
2201
|
-
objectFit, width: '100%', height: '100%' }, paddingStyles) }, children)));
|
|
2202
|
-
};
|
|
2203
|
-
|
|
2204
|
-
const renderer = createRenderer({
|
|
2205
|
-
views: {
|
|
2206
|
-
box(props) {
|
|
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));
|
|
2209
|
-
},
|
|
2210
|
-
text(props) {
|
|
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)));
|
|
2213
|
-
},
|
|
2214
|
-
image(props) {
|
|
2215
|
-
var _a;
|
|
2216
|
-
const highlight = useHighlightStyle(props.rawProperties);
|
|
2217
|
-
// todo: add image backup
|
|
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 })));
|
|
2220
|
-
},
|
|
2221
|
-
textButton(props) {
|
|
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)));
|
|
2224
|
-
},
|
|
2225
|
-
imageButton(props) {
|
|
2226
|
-
var _a;
|
|
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 })));
|
|
2230
|
-
},
|
|
2231
|
-
carouselView(props) {
|
|
2232
|
-
var _a, _b;
|
|
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));
|
|
2235
|
-
},
|
|
2236
|
-
},
|
|
2237
|
-
});
|
|
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
|
-
|
|
2268
|
-
createMessageTemplate({
|
|
2269
|
-
renderer,
|
|
2270
|
-
parser,
|
|
2271
|
-
Container: ({ children, className }) => {
|
|
2272
|
-
return (React__default.createElement("div", { className: `sb-message-template__parent ${className}`, style: { display: 'flex', flexDirection: 'column', maxWidth: 400, marginBlockEnd: 24 } }, children));
|
|
2273
|
-
},
|
|
2274
|
-
});
|
|
2275
|
-
|
|
2276
|
-
var CustomTemplate = createMessageTemplate({
|
|
2277
|
-
parser: parser,
|
|
2278
|
-
renderer: renderer,
|
|
2279
|
-
Container: function (_a) {
|
|
2280
|
-
var children = _a.children, className = _a.className;
|
|
2281
|
-
return (React__default.createElement("div", { className: [
|
|
2282
|
-
"sb-message-template__parent ".concat(className),
|
|
2283
|
-
'sendbird-message-template__root',
|
|
2284
|
-
].join(' ') }, children));
|
|
2285
|
-
},
|
|
2286
|
-
}).MessageTemplate;
|
|
2287
|
-
function MessageTemplate(_a) {
|
|
2288
|
-
var templateItems = _a.templateItems, templateVersion = _a.templateVersion;
|
|
2289
|
-
return React__default.createElement(CustomTemplate, { templateItems: templateItems, templateVersion: templateVersion });
|
|
2290
|
-
}
|
|
2291
|
-
|
|
2292
|
-
export { MessageProvider as M, MessageTemplate as a };
|
|
2293
|
-
//# sourceMappingURL=bundle-COtGnAne.js.map
|