@cometchat/chat-uikit-react-native 4.2.2 → 4.3.1
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/README.md +26 -67
- package/android/.gradle/7.4/checksums/checksums.lock +0 -0
- package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/reactnativecometchatuikit/CometchatUiKitPackage.java +2 -1
- package/android/src/main/java/com/reactnativecometchatuikit/ReactVideoView.java +796 -0
- package/android/src/main/java/com/reactnativecometchatuikit/ReactVideoViewManager.java +172 -0
- package/android/src/main/java/com/scalablevideoview/BuildConfig.java +10 -0
- package/android/src/main/java/com/scalablevideoview/PivotPoint.java +13 -0
- package/android/src/main/java/com/scalablevideoview/ScalableType.java +34 -0
- package/android/src/main/java/com/scalablevideoview/ScalableVideoView.java +255 -0
- package/android/src/main/java/com/scalablevideoview/ScaleManager.java +188 -0
- package/android/src/main/java/com/scalablevideoview/Size.java +20 -0
- package/android/src/main/java/com/zipfile/APEZProvider.java +287 -0
- package/android/src/main/java/com/zipfile/APKExpansionSupport.java +81 -0
- package/android/src/main/java/com/zipfile/ZipResourceFile.java +428 -0
- package/android/src/main/res/values/attrs.xml +37 -0
- package/ios/FileManager.m +75 -5
- package/ios/Video/CCRCTVideo.h +67 -0
- package/ios/Video/CCRCTVideo.m +2031 -0
- package/ios/Video/CCRCTVideoManager.h +6 -0
- package/ios/Video/CCRCTVideoManager.m +133 -0
- package/ios/Video/CCRCTVideoPlayerViewController.h +20 -0
- package/ios/Video/CCRCTVideoPlayerViewController.m +43 -0
- package/ios/Video/CCRCTVideoPlayerViewControllerDelegate.h +7 -0
- package/ios/Video/UIView+FindUIViewController.h +15 -0
- package/ios/Video/UIView+FindUIViewController.m +21 -0
- package/ios/VideoCaching/RCTVideoCache.h +38 -0
- package/ios/VideoCaching/RCTVideoCache.m +174 -0
- package/ios/VideoPickerModule.h +7 -0
- package/ios/VideoPickerModule.mm +95 -0
- package/package.json +3 -4
- package/react-native-cometchat-ui-kit.podspec +24 -10
- package/src/CometChatContacts/CometChatContacts.tsx +12 -9
- package/src/CometChatConversations/CometChatConversations.tsx +84 -64
- package/src/CometChatDetails/CometChatDetails.tsx +14 -12
- package/src/CometChatGroupMembers/CometChatGroupMembers.tsx +8 -4
- package/src/CometChatGroupMembers/resources/check.png +0 -0
- package/src/CometChatGroupMembers/resources/index.ts +2 -0
- package/src/CometChatGroups/CometChatGroups.tsx +4 -4
- package/src/CometChatMessageComposer/CometChatMessageComposer.tsx +57 -15
- package/src/CometChatMessageHeader/CometChatMessageHeader.tsx +9 -2
- package/src/CometChatMessageInformation/CometChatMessageInformation.tsx +1 -1
- package/src/CometChatMessageList/CometChatMessageList.tsx +596 -181
- package/src/CometChatMessageList/MessageListConfiguration.ts +55 -4
- package/src/CometChatMessageList/resources/index.ts +5 -1
- package/src/CometChatMessageList/resources/leftarrowcurve.png +0 -0
- package/src/CometChatMessageList/resources/rightarrowcurve.png +0 -0
- package/src/CometChatMessages/CometChatMessages.tsx +1 -1
- package/src/CometChatThreadedMessages/CometChatThreadedMessages.tsx +4 -12
- package/src/CometChatThreadedMessages/style.ts +3 -1
- package/src/CometChatUsers/CometChatUsers.tsx +1 -1
- package/src/calls/CallUtils.ts +4 -8
- package/src/calls/CallingExtentionDecorator.tsx +5 -2
- package/src/calls/CometChatCallBubble/styles.ts +2 -1
- package/src/calls/CometChatCallButtons/CometChatCallButtons.tsx +14 -3
- package/src/calls/CometChatIncomingCall/CometChatIncomingCall.tsx +9 -9
- package/src/calls/CometChatOutgoingCall/CometChatOutgoingCall.tsx +80 -73
- package/src/extensions/CollaborativeBubble/styles.ts +2 -0
- package/src/extensions/SmartReplies/SmartRepliesDecorator.tsx +11 -0
- package/src/extensions/index.ts +0 -4
- package/src/index.ts +53 -8
- package/src/shared/CometChatUiKit/CometChatUIKit.ts +14 -2
- package/src/shared/constants/UIKitConstants.ts +1 -0
- package/src/shared/events/CometChatUIEventHandler/CometChatUIEventHandler.ts +6 -0
- package/src/shared/events/CometChatUIEventHandler/Listener.ts +8 -0
- package/src/shared/events/ListenerInitializer.ts +6 -0
- package/src/shared/events/messages.ts +2 -0
- package/src/shared/framework/MessageDataSource.tsx +29 -25
- package/src/shared/index.ts +49 -1
- package/src/shared/libs/VideoPlayer/DRMType.js +6 -0
- package/src/shared/libs/VideoPlayer/FilterType.js +18 -0
- package/src/shared/libs/VideoPlayer/TextTrackType.js +5 -0
- package/src/shared/libs/VideoPlayer/Video.js +519 -0
- package/src/shared/libs/VideoPlayer/VideoResizeMode.js +5 -0
- package/src/shared/libs/VideoPlayerControls/OSSupport/PlatformSupport.tsx +43 -0
- package/src/shared/libs/VideoPlayerControls/OSSupport/TVOSSupport.tsx +16 -0
- package/src/shared/libs/VideoPlayerControls/OSSupport/index.tsx +1 -0
- package/src/shared/libs/VideoPlayerControls/VideoPlayer.tsx +511 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/back.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/back@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/back@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/bottom-vignette.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/bottom-vignette@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/bottom-vignette@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/error-icon.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/error-icon@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/error-icon@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/expand.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/expand@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/expand@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/forward.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/forward@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/forward@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/loader-icon.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/loader-icon@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/loader-icon@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/pause.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/pause@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/pause@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/play.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/play@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/play@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/rewind.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/rewind@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/rewind@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/shrink.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/shrink@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/shrink@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/top-vignette.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/top-vignette@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/top-vignette@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/volume.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/volume@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/volume@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/components/Back/Back.tsx +28 -0
- package/src/shared/libs/VideoPlayerControls/components/Back/index.ts +1 -0
- package/src/shared/libs/VideoPlayerControls/components/BottomControls.tsx +142 -0
- package/src/shared/libs/VideoPlayerControls/components/Control.tsx +45 -0
- package/src/shared/libs/VideoPlayerControls/components/Error/Error.tsx +22 -0
- package/src/shared/libs/VideoPlayerControls/components/Error/index.ts +1 -0
- package/src/shared/libs/VideoPlayerControls/components/Error/styles.ts +21 -0
- package/src/shared/libs/VideoPlayerControls/components/Fullscreen.tsx +36 -0
- package/src/shared/libs/VideoPlayerControls/components/Loader/Loader.tsx +15 -0
- package/src/shared/libs/VideoPlayerControls/components/Loader/index.ts +1 -0
- package/src/shared/libs/VideoPlayerControls/components/Loader/styles.ts +16 -0
- package/src/shared/libs/VideoPlayerControls/components/NullControl.tsx +7 -0
- package/src/shared/libs/VideoPlayerControls/components/Overlay.tsx +23 -0
- package/src/shared/libs/VideoPlayerControls/components/PlayPause/PlayPause.tsx +109 -0
- package/src/shared/libs/VideoPlayerControls/components/PlayPause/index.ts +1 -0
- package/src/shared/libs/VideoPlayerControls/components/PlayPause/styles.ts +21 -0
- package/src/shared/libs/VideoPlayerControls/components/Seekbar/Seekbar.tsx +47 -0
- package/src/shared/libs/VideoPlayerControls/components/Seekbar/index.ts +1 -0
- package/src/shared/libs/VideoPlayerControls/components/Seekbar/styles.ts +37 -0
- package/src/shared/libs/VideoPlayerControls/components/Timer/Timer.tsx +28 -0
- package/src/shared/libs/VideoPlayerControls/components/Timer/index.ts +1 -0
- package/src/shared/libs/VideoPlayerControls/components/Timer/styles.ts +12 -0
- package/src/shared/libs/VideoPlayerControls/components/Title.tsx +35 -0
- package/src/shared/libs/VideoPlayerControls/components/TopControls.tsx +110 -0
- package/src/shared/libs/VideoPlayerControls/components/Volume/Volume.tsx +37 -0
- package/src/shared/libs/VideoPlayerControls/components/Volume/index.ts +1 -0
- package/src/shared/libs/VideoPlayerControls/components/Volume/styles.ts +31 -0
- package/src/shared/libs/VideoPlayerControls/components/index.ts +14 -0
- package/src/shared/libs/VideoPlayerControls/components/styles.ts +30 -0
- package/src/shared/libs/VideoPlayerControls/hooks/index.ts +3 -0
- package/src/shared/libs/VideoPlayerControls/hooks/useAnimations.ts +68 -0
- package/src/shared/libs/VideoPlayerControls/hooks/useControlTimeout.tsx +67 -0
- package/src/shared/libs/VideoPlayerControls/hooks/usePanResponders.tsx +96 -0
- package/src/shared/libs/VideoPlayerControls/index.ts +4 -0
- package/src/shared/libs/VideoPlayerControls/styles.ts +19 -0
- package/src/shared/libs/VideoPlayerControls/types.ts +290 -0
- package/src/shared/libs/VideoPlayerControls/utils.ts +76 -0
- package/src/shared/modals/CometChatMessageTemplate.ts +113 -9
- package/src/shared/modals/InteractiveData/InteractiveMessage/SchedulerMessage.ts +23 -21
- package/src/shared/resources/CometChatLocalize/resources/ar/translation.json +4 -1
- package/src/shared/resources/CometChatLocalize/resources/de/translation.json +4 -1
- package/src/shared/resources/CometChatLocalize/resources/en/translation.json +6 -3
- package/src/shared/resources/CometChatLocalize/resources/es/translation.json +4 -1
- package/src/shared/resources/CometChatLocalize/resources/fr/translation.json +4 -1
- package/src/shared/resources/CometChatLocalize/resources/hi/translation.json +4 -1
- package/src/shared/resources/CometChatLocalize/resources/lt/translation.json +4 -1
- package/src/shared/resources/CometChatLocalize/resources/ms/translation.json +4 -1
- package/src/shared/resources/CometChatLocalize/resources/pt/translation.json +4 -1
- package/src/shared/resources/CometChatLocalize/resources/ru/translation.json +4 -1
- package/src/shared/resources/CometChatLocalize/resources/sv/translation.json +4 -1
- package/src/shared/resources/CometChatLocalize/resources/zh/translation.json +4 -1
- package/src/shared/resources/CometChatLocalize/resources/zh-tw/translation.json +4 -1
- package/src/shared/resources/CometChatTheme/Palette.ts +79 -45
- package/src/shared/resources/CometChatTheme/Typography.ts +18 -0
- package/src/shared/utils/CommonUtils.ts +71 -0
- package/src/shared/utils/PermissionUtilIOS.ts +104 -0
- package/src/shared/views/CometChatActionSheet/ActionSheetStyle.ts +3 -1
- package/src/shared/views/CometChatActionSheet/CometChatActionSheet.tsx +6 -6
- package/src/shared/views/CometChatAudioBubble/CometChatAudioBubble.tsx +28 -5
- package/src/shared/views/CometChatAudioBubble/style.ts +4 -2
- package/src/shared/views/CometChatAvatar/AvatarStyle.ts +1 -1
- package/src/shared/views/CometChatBottomSheet/CometChatBottomSheet.tsx +4 -3
- package/src/shared/views/CometChatEmojiKeyboard/CometChatEmojiKeyboard.tsx +47 -31
- package/src/shared/views/CometChatEmojiKeyboard/EmojiKeyboardConfiguration.ts +5 -5
- package/src/shared/views/CometChatEmojiKeyboard/EmojiKeyboardStyle.ts +12 -13
- package/src/shared/views/CometChatFileBubble/CometChatFileBubble.tsx +52 -5
- package/src/shared/views/CometChatFileBubble/style.ts +4 -2
- package/src/shared/views/CometChatImageBubble/CometChatImageBubble.tsx +25 -2
- package/src/shared/views/CometChatList/CometChatList.tsx +2 -1
- package/src/shared/views/CometChatMessageBubble/CometChatMessageBubble.tsx +51 -2
- package/src/shared/views/CometChatQuickReactions/CometChatQuickReactions.tsx +76 -0
- package/src/shared/views/CometChatQuickReactions/QuickReactionsConfiguration.tsx +12 -0
- package/src/shared/views/CometChatQuickReactions/QuickReactionsStyle.tsx +35 -0
- package/src/shared/views/CometChatQuickReactions/index.ts +12 -0
- package/src/shared/views/CometChatReactions/CometChatReactions.tsx +166 -0
- package/src/shared/views/CometChatReactions/ReactionsConfiguration.tsx +12 -0
- package/src/shared/views/CometChatReactions/ReactionsStyle.tsx +43 -0
- package/src/shared/views/CometChatReactions/index.ts +12 -0
- package/src/{extensions/Reactions/CometChatMessageReactions → shared/views/CometChatReactions}/style.ts +7 -7
- package/src/shared/views/CometChatReactionsList/CometChatReactionsList.tsx +335 -0
- package/src/shared/views/CometChatReactionsList/ReactionsListConfiguration.tsx +14 -0
- package/src/shared/views/CometChatReactionsList/ReactionsListStyle.tsx +67 -0
- package/src/shared/views/CometChatReactionsList/index.ts +12 -0
- package/src/shared/views/CometChatReactionsList/resources/Spineer.png +0 -0
- package/src/shared/views/CometChatReactionsList/resources/index.ts +5 -0
- package/src/shared/views/CometChatReceipt/CometChatReceipt.tsx +21 -4
- package/src/shared/views/CometChatReceipt/MessageConfiguration.ts +12 -0
- package/src/shared/views/CometChatReceipt/resources/error.png +0 -0
- package/src/shared/views/CometChatTextBubble/CometChatTextBubble.tsx +1 -1
- package/src/shared/views/CometChatVideoBubble/CometChatVideoBubble.tsx +78 -12
- package/src/shared/views/CometChatVideoBubble/VideoBubbleStyle.ts +52 -2
- package/src/shared/views/CometChatVideoPlayer/CometChatVideoPlayer.tsx +134 -0
- package/src/shared/views/CometChatVideoPlayer/index.tsx +1 -0
- package/src/shared/views/index.ts +30 -0
- package/android/.gradle/7.4.2/checksums/checksums.lock +0 -0
- package/android/.gradle/7.4.2/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.4.2/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.4.2/gc.properties +0 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.idea/gradle.xml +0 -13
- package/android/.idea/misc.xml +0 -8
- package/android/.idea/modules/android.iml +0 -18
- package/android/.idea/modules.xml +0 -8
- package/android/.idea/vcs.xml +0 -6
- package/android/local.properties +0 -8
- package/src/extensions/Reactions/CometChatMessageReactions/CometChatMessageReactions.tsx +0 -249
- package/src/extensions/Reactions/CometChatMessageReactions/index.ts +0 -3
- package/src/extensions/Reactions/ReactionsDecorator.tsx +0 -164
- package/src/extensions/Reactions/ReactionsExtension.tsx +0 -48
- package/src/extensions/Reactions/index.ts +0 -4
- /package/src/{extensions/Reactions → shared/views/CometChatQuickReactions}/resources/AddReactions.png +0 -0
- /package/src/{extensions/Reactions → shared/views/CometChatQuickReactions}/resources/index.ts +0 -0
|
@@ -21,6 +21,10 @@ import {
|
|
|
21
21
|
} from '../CometChatMessages/MessageStyle';
|
|
22
22
|
import { DateStyleInterface } from '../shared/views/CometChatDate/DateStyle';
|
|
23
23
|
import { ActionSheetStylesInterface } from '../shared/views/CometChatActionSheet/ActionSheetStyle';
|
|
24
|
+
import { ReactionsConfigurationInterface } from '../shared/views/CometChatReactions';
|
|
25
|
+
import { ReactionsListConfigurationInterface } from '../shared/views/CometChatReactionsList';
|
|
26
|
+
import { QuickReactionsConfigurationInterface } from '../shared/views/CometChatQuickReactions';
|
|
27
|
+
import { EmojiKeyboardStyle } from '../shared/views/CometChatEmojiKeyboard';
|
|
24
28
|
|
|
25
29
|
export interface MessageListConfigurationInterface {
|
|
26
30
|
ErrorStateView?: (e: CometChat.CometChatException) => JSX.Element;
|
|
@@ -69,10 +73,33 @@ export interface MessageListConfigurationInterface {
|
|
|
69
73
|
wrapperMessageBubbleStyle?: MessageStyleInterface;
|
|
70
74
|
actionSheetStyle?: ActionSheetStylesInterface;
|
|
71
75
|
messageListStyle?: MessageListStyleInterface;
|
|
76
|
+
/**
|
|
77
|
+
* Hides the header of the action sheet
|
|
78
|
+
*/
|
|
79
|
+
hideActionSheetHeader?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Message Reaction Configuration @ReactionsConfigurationInterface
|
|
82
|
+
*/
|
|
83
|
+
reactionsConfiguration?: ReactionsConfigurationInterface;
|
|
84
|
+
/**
|
|
85
|
+
* Message Reaction List Configuration @ReactionsListConfigurationInterface
|
|
86
|
+
*/
|
|
87
|
+
reactionsListConfiguration?: ReactionsListConfigurationInterface;
|
|
88
|
+
/**
|
|
89
|
+
* Quick Reaction Configuration @QuickReactionsConfigurationInterface
|
|
90
|
+
*/
|
|
91
|
+
quickReactionConfiguration?: QuickReactionsConfigurationInterface;
|
|
92
|
+
/**
|
|
93
|
+
* Emoji Keyboard Style @EmojiKeyboardConfiguration
|
|
94
|
+
*/
|
|
95
|
+
emojiKeyboardStyle?: EmojiKeyboardStyle;
|
|
96
|
+
/**
|
|
97
|
+
* Disables the reactions functionality
|
|
98
|
+
*/
|
|
99
|
+
disableReactions?: boolean;
|
|
72
100
|
}
|
|
73
101
|
export class MessageListConfiguration
|
|
74
|
-
implements MessageListConfigurationInterface
|
|
75
|
-
{
|
|
102
|
+
implements MessageListConfigurationInterface {
|
|
76
103
|
ErrorStateView: (e: CometChat.CometChatException) => JSX.Element;
|
|
77
104
|
errorStateText?: String;
|
|
78
105
|
EmptyStateView: () => JSX.Element;
|
|
@@ -92,7 +119,7 @@ export class MessageListConfiguration
|
|
|
92
119
|
scrollToBottomOnNewMessage: boolean;
|
|
93
120
|
onThreadRepliesPress?: (
|
|
94
121
|
messageObject: CometChat.BaseMessage,
|
|
95
|
-
messageBubbleView: ()=>JSX.Element
|
|
122
|
+
messageBubbleView: () => JSX.Element
|
|
96
123
|
) => void;
|
|
97
124
|
HeaderView?: ({
|
|
98
125
|
user,
|
|
@@ -119,7 +146,31 @@ export class MessageListConfiguration
|
|
|
119
146
|
messageListStyle: MessageListStyleInterface;
|
|
120
147
|
disableReceipt: boolean;
|
|
121
148
|
dateSeperatorPattern: (item: number) => DatePattern;
|
|
122
|
-
|
|
149
|
+
/**
|
|
150
|
+
* Hides the header of the action sheet
|
|
151
|
+
*/
|
|
152
|
+
hideActionSheetHeader?: boolean;
|
|
153
|
+
/**
|
|
154
|
+
* Message Reaction Configuration @ReactionsConfigurationInterface
|
|
155
|
+
*/
|
|
156
|
+
reactionsConfiguration?: ReactionsConfigurationInterface;
|
|
157
|
+
/**
|
|
158
|
+
* Message Reaction List Configuration @ReactionsListConfigurationInterface
|
|
159
|
+
*/
|
|
160
|
+
reactionsListConfiguration?: ReactionsListConfigurationInterface;
|
|
161
|
+
/**
|
|
162
|
+
* Quick Reaction Configuration @QuickReactionsConfigurationInterface
|
|
163
|
+
*/
|
|
164
|
+
quickReactionConfiguration?: QuickReactionsConfigurationInterface;
|
|
165
|
+
/**
|
|
166
|
+
* Emoji Keyboard Style @EmojiKeyboardConfiguration
|
|
167
|
+
*/
|
|
168
|
+
emojiKeyboardStyle?: EmojiKeyboardStyle;
|
|
169
|
+
/**
|
|
170
|
+
* Disables the reactions functionality
|
|
171
|
+
*/
|
|
172
|
+
disableReactions?: boolean;
|
|
173
|
+
|
|
123
174
|
constructor(props: MessageListConfigurationInterface) {
|
|
124
175
|
if (props) {
|
|
125
176
|
for (const [key, value] of Object.entries(props)) {
|
|
@@ -3,11 +3,15 @@ import closeIcon from "./close.png";
|
|
|
3
3
|
import backIcon from "./back.png";
|
|
4
4
|
import loadingIcon from "./spineer.png";
|
|
5
5
|
import downArrowIcon from "./downArrowIcon.png";
|
|
6
|
+
import LeftArrowCurve from './leftarrowcurve.png';
|
|
7
|
+
import RightArrowCurve from './rightarrowcurve.png';
|
|
6
8
|
|
|
7
9
|
export {
|
|
8
10
|
rightArrowIcon,
|
|
9
11
|
closeIcon,
|
|
10
12
|
backIcon,
|
|
11
13
|
loadingIcon,
|
|
12
|
-
downArrowIcon
|
|
14
|
+
downArrowIcon,
|
|
15
|
+
LeftArrowCurve,
|
|
16
|
+
RightArrowCurve
|
|
13
17
|
}
|
|
Binary file
|
|
Binary file
|
|
@@ -156,7 +156,6 @@ export const CometChatMessages = (props: CometChatMessagesInterface) => {
|
|
|
156
156
|
uiEventListener,
|
|
157
157
|
{
|
|
158
158
|
ccUserBlocked: ({ user }: { user: CometChat.User }) => {
|
|
159
|
-
_headerConfiguration.onBack && _headerConfiguration.onBack();
|
|
160
159
|
user.setBlockedByMe(true);
|
|
161
160
|
setUserObject(user);
|
|
162
161
|
},
|
|
@@ -297,6 +296,7 @@ export const CometChatMessages = (props: CometChatMessagesInterface) => {
|
|
|
297
296
|
setShowComponent(ComponentNames.Thread);
|
|
298
297
|
}}
|
|
299
298
|
customSoundForMessages={customSoundForIncomingMessages}
|
|
299
|
+
hideActionSheetHeader={true}
|
|
300
300
|
{..._listConfiguration}
|
|
301
301
|
/>
|
|
302
302
|
}
|
|
@@ -167,13 +167,13 @@ export const CometChatThreadedMessages = (
|
|
|
167
167
|
CometChat.getLoggedinUser().then((loggedUser) => {
|
|
168
168
|
loggedInUser.current = loggedUser;
|
|
169
169
|
if (message.getSender()!.getUid() == loggedUser.getUid()) {
|
|
170
|
-
if (message
|
|
170
|
+
if (message?.getReceiverType() == 'group') {
|
|
171
171
|
setGroup(message.getReceiver());
|
|
172
172
|
} else {
|
|
173
173
|
setUser(message.getReceiver());
|
|
174
174
|
}
|
|
175
175
|
} else {
|
|
176
|
-
if (message
|
|
176
|
+
if (message?.getReceiverType() == 'group') {
|
|
177
177
|
setGroup(message.getReceiver());
|
|
178
178
|
} else {
|
|
179
179
|
setUser(message.getSender());
|
|
@@ -236,16 +236,8 @@ export const CometChatThreadedMessages = (
|
|
|
236
236
|
},
|
|
237
237
|
]}
|
|
238
238
|
>
|
|
239
|
-
{replyCount ?? 0}
|
|
239
|
+
{replyCount ?? 0} {replyCount > 1 ? localize("REPLIES") : localize("REPLY")}
|
|
240
240
|
</Text>
|
|
241
|
-
<Image
|
|
242
|
-
source={ICONS.MORE}
|
|
243
|
-
resizeMode={'contain'}
|
|
244
|
-
style={[
|
|
245
|
-
styles.actionIcon,
|
|
246
|
-
{ tintColor: theme.palette.getPrimary() },
|
|
247
|
-
]}
|
|
248
|
-
/>
|
|
249
241
|
</View>
|
|
250
242
|
)}
|
|
251
243
|
<View style={{ flex: 1, paddingHorizontal: 8 }}>
|
|
@@ -268,7 +260,7 @@ export const CometChatThreadedMessages = (
|
|
|
268
260
|
parentMessageId={message.getId()}
|
|
269
261
|
messageComposerStyle={{
|
|
270
262
|
borderRadius: 10,
|
|
271
|
-
backgroundColor: theme.palette.getAccent100(),
|
|
263
|
+
// backgroundColor: theme.palette.getAccent100(),
|
|
272
264
|
}}
|
|
273
265
|
user={user}
|
|
274
266
|
group={group}
|
|
@@ -164,7 +164,7 @@ export const CometChatUsers = React.forwardRef<
|
|
|
164
164
|
CometChatUsers.defaultProps = {
|
|
165
165
|
usersRequestBuilder: new CometChat.UsersRequestBuilder()
|
|
166
166
|
.setLimit(30)
|
|
167
|
-
.hideBlockedUsers(
|
|
167
|
+
.hideBlockedUsers(false)
|
|
168
168
|
.setRoles([])
|
|
169
169
|
.friendsOnly(false)
|
|
170
170
|
.setStatus('')
|
package/src/calls/CallUtils.ts
CHANGED
|
@@ -36,16 +36,11 @@ export class CallUtils {
|
|
|
36
36
|
}
|
|
37
37
|
break;
|
|
38
38
|
case CALL_ONGOING:
|
|
39
|
-
callMessageText = `${localize(`
|
|
39
|
+
callMessageText = `${localize(`CALL_ACCEPTED`)}`;
|
|
40
40
|
break;
|
|
41
41
|
case CALL_ENDED:
|
|
42
|
-
|
|
43
|
-
callMessageText = `${localize(`OUTGOING_CALL`)}`;
|
|
44
|
-
} else {
|
|
45
|
-
callMessageText = `${localize(`INCOMING_CALL`)}`;
|
|
46
|
-
}
|
|
42
|
+
callMessageText = `${localize(`CALL_ENDED`)}`;
|
|
47
43
|
break;
|
|
48
|
-
case CALL_BUSY:
|
|
49
44
|
case CALL_UNANSWERED:
|
|
50
45
|
if (this.isInitiator(initiator, loggedInUser)) {
|
|
51
46
|
callMessageText = `${localize('UNANSWERED_CALL')}`;
|
|
@@ -60,9 +55,10 @@ export class CallUtils {
|
|
|
60
55
|
callMessageText = `${localize('MISSED_CALL')}`;
|
|
61
56
|
}
|
|
62
57
|
break;
|
|
58
|
+
case CALL_BUSY:
|
|
63
59
|
case CALL_REJECTED:
|
|
64
60
|
if (this.isInitiator(initiator, loggedInUser)) {
|
|
65
|
-
callMessageText = `${localize('
|
|
61
|
+
callMessageText = `${localize('CALL_REJECTED')}`;
|
|
66
62
|
} else {
|
|
67
63
|
callMessageText = `${localize('MISSED_CALL')}`;
|
|
68
64
|
}
|
|
@@ -16,6 +16,7 @@ import { CallingPackage } from "./CallingPackage";
|
|
|
16
16
|
import { CallUtils } from "./CallUtils";
|
|
17
17
|
import { CometChatUIEventHandler } from "../shared";
|
|
18
18
|
import { CallUIEvents } from "./CallEvents";
|
|
19
|
+
import { permissionUtilIOS } from "../shared/utils/PermissionUtilIOS";
|
|
19
20
|
|
|
20
21
|
const CometChatCalls = CallingPackage.CometChatCalls;
|
|
21
22
|
|
|
@@ -127,8 +128,10 @@ export class CallingExtensionDecorator extends DataSourceDecorator {
|
|
|
127
128
|
)
|
|
128
129
|
}
|
|
129
130
|
|
|
130
|
-
startDirectCall(sessionId: string, theme?: CometChatTheme) {
|
|
131
|
-
|
|
131
|
+
async startDirectCall(sessionId: string, theme?: CometChatTheme) {
|
|
132
|
+
if (!(await permissionUtilIOS.startResourceBasedTask(["mic", "camera"]))) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
132
135
|
const callSettingsBuilder = new CometChatCalls.CallSettingsBuilder()
|
|
133
136
|
.setCallEventListener(
|
|
134
137
|
new CometChatCalls.OngoingCallListener({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useContext, useEffect, useState, useRef } from 'react'
|
|
2
|
-
import { View, Text, TouchableOpacity, Image } from 'react-native'
|
|
2
|
+
import { View, Text, TouchableOpacity, Image, Platform, Alert, Linking } from 'react-native'
|
|
3
3
|
import { CometChat } from '@cometchat/chat-sdk-react-native'
|
|
4
4
|
import { CometChatUIEventHandler } from '../../shared/events/CometChatUIEventHandler/CometChatUIEventHandler'
|
|
5
5
|
import { CallButtonStyle, CallButtonStyleInterface } from './CallButtonStyle'
|
|
@@ -12,6 +12,7 @@ import { Style } from './style'
|
|
|
12
12
|
import { CallUIEvents } from '../CallEvents'
|
|
13
13
|
import { CometChatOutgoingCall } from '../CometChatOutgoingCall'
|
|
14
14
|
import { CometChatUIKit } from '../../shared/CometChatUiKit/CometChatUIKit'
|
|
15
|
+
import { permissionUtilIOS } from '../../shared/utils/PermissionUtilIOS'
|
|
15
16
|
|
|
16
17
|
const listenerId = "callEventListener_" + new Date().getTime();
|
|
17
18
|
|
|
@@ -201,9 +202,14 @@ export const CometChatCallButtons = (props: CometChatCallButtonsInterface) => {
|
|
|
201
202
|
}
|
|
202
203
|
}
|
|
203
204
|
|
|
204
|
-
const makeVoiceCall = () => {
|
|
205
|
+
const makeVoiceCall = async () => {
|
|
205
206
|
if (disableButton)
|
|
206
207
|
return;
|
|
208
|
+
|
|
209
|
+
if (!(await permissionUtilIOS.startResourceBasedTask(["mic"]))) {
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
|
|
207
213
|
if (onVoiceCallPress)
|
|
208
214
|
return onVoiceCallPress({ user, group })
|
|
209
215
|
|
|
@@ -212,9 +218,14 @@ export const CometChatCallButtons = (props: CometChatCallButtonsInterface) => {
|
|
|
212
218
|
|
|
213
219
|
}
|
|
214
220
|
|
|
215
|
-
const makeVideoCall = () => {
|
|
221
|
+
const makeVideoCall = async () => {
|
|
216
222
|
if (disableButton)
|
|
217
223
|
return;
|
|
224
|
+
|
|
225
|
+
if (!(await permissionUtilIOS.startResourceBasedTask(["mic", "camera"]))) {
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
|
|
218
229
|
if (onVideoCallPress)
|
|
219
230
|
return onVideoCallPress({ user, group })
|
|
220
231
|
|
|
@@ -7,7 +7,7 @@ import { CometChat } from '@cometchat/chat-sdk-react-native';
|
|
|
7
7
|
import { AvatarStyleInterface, CometChatContext, CometChatListItem, CometChatSoundManager, ListItemStyleInterface, localize } from '../../shared';
|
|
8
8
|
import { IncomingCallStyle, IncomingCallStyleInterface } from './IncomingCallStyle';
|
|
9
9
|
import { Style } from './styles';
|
|
10
|
-
import { CallTypeConstants, MessageCategoryConstants } from '../../shared/constants/UIKitConstants';
|
|
10
|
+
import { CallTypeConstants, MessageCategoryConstants, MessageTypeConstants } from '../../shared/constants/UIKitConstants';
|
|
11
11
|
import { CometChatCard } from '../../shared/views/CometChatCard';
|
|
12
12
|
import { AcceptCall, DeclineIcon } from './resources';
|
|
13
13
|
import { CometChatButton } from '../../shared/views/CometChatButton';
|
|
@@ -134,7 +134,7 @@ export const CometChatIncomingCall = (props: CometChatIncomingCallInterface) =>
|
|
|
134
134
|
|
|
135
135
|
useEffect(() => {
|
|
136
136
|
if (call) {
|
|
137
|
-
if (!disableSoundForCalls) {
|
|
137
|
+
if (!disableSoundForCalls && call.getType() !== MessageTypeConstants.meeting) {
|
|
138
138
|
if (customSoundForCalls)
|
|
139
139
|
CometChatSoundManager.play(
|
|
140
140
|
"incomingCall",
|
|
@@ -146,14 +146,14 @@ export const CometChatIncomingCall = (props: CometChatIncomingCallInterface) =>
|
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
|
|
149
|
-
|
|
150
|
-
{
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
149
|
+
// CometChatUIEventHandler.addCallListener(listnerID,
|
|
150
|
+
// {
|
|
151
|
+
// ccCallEnded: () => {
|
|
152
|
+
// setShowCallScreen(false);
|
|
153
|
+
// acceptedCall.current = null;
|
|
154
154
|
|
|
155
|
-
|
|
156
|
-
})
|
|
155
|
+
// }
|
|
156
|
+
// })
|
|
157
157
|
|
|
158
158
|
CometChat.addCallListener(
|
|
159
159
|
listnerID,
|
|
@@ -103,9 +103,9 @@ export const CometChatOutgoingCall = (props: CometChatOutgoingCallInterface) =>
|
|
|
103
103
|
subtitleFont: theme.typography.text2,
|
|
104
104
|
...outgoingCallStyle,
|
|
105
105
|
});
|
|
106
|
-
|
|
107
|
-
function
|
|
108
|
-
return call.getCategory()== MessageCategoryConstants.call
|
|
106
|
+
|
|
107
|
+
function checkIfDefualtCall(call: CometChat.BaseMessage): Boolean {
|
|
108
|
+
return call.getCategory() == MessageCategoryConstants.call
|
|
109
109
|
|
|
110
110
|
}
|
|
111
111
|
|
|
@@ -114,15 +114,16 @@ export const CometChatOutgoingCall = (props: CometChatOutgoingCallInterface) =>
|
|
|
114
114
|
CometChat.endCall((call as CometChat.Call).getSessionId())
|
|
115
115
|
.then(() => {
|
|
116
116
|
(call as CometChat.Call).setStatus("ended");
|
|
117
|
-
CometChatUIEventHandler.emitCallEvent(CallUIEvents.ccCallEnded,{call});
|
|
117
|
+
CometChatUIEventHandler.emitCallEvent(CallUIEvents.ccCallEnded, { call });
|
|
118
118
|
})
|
|
119
119
|
.catch(err => {
|
|
120
|
-
console.log("Error", err);
|
|
120
|
+
console.log("Error", err);
|
|
121
|
+
})
|
|
121
122
|
}
|
|
122
123
|
}
|
|
123
|
-
|
|
124
|
+
|
|
124
125
|
useEffect(() => {
|
|
125
|
-
if (call['status'] == "ongoing" || (call.getCategory() == (CometChat.CATEGORY_CUSTOM as CometChat.MessageCategory) && call.getType() == MessageTypeConstants.meeting)
|
|
126
|
+
if (call['status'] == "ongoing" || (call.getCategory() == (CometChat.CATEGORY_CUSTOM as CometChat.MessageCategory) && call.getType() == MessageTypeConstants.meeting)) {
|
|
126
127
|
ongoingCall.current = call;
|
|
127
128
|
if (call.getType() == MessageTypeConstants.meeting)
|
|
128
129
|
callSessionId.current = (call as CometChat.CustomMessage).getCustomData()['sessionId'];
|
|
@@ -130,8 +131,16 @@ export const CometChatOutgoingCall = (props: CometChatOutgoingCallInterface) =>
|
|
|
130
131
|
callSessionId.current = call['sessionId'];
|
|
131
132
|
setCallConnected(true);
|
|
132
133
|
}
|
|
133
|
-
|
|
134
|
-
|
|
134
|
+
|
|
135
|
+
if (!disableSoundForCalls && call.getType() !== MessageTypeConstants.meeting) {
|
|
136
|
+
if (customSoundForCalls)
|
|
137
|
+
CometChatSoundManager.play(
|
|
138
|
+
"outgoingCall",
|
|
139
|
+
customSoundForCalls
|
|
140
|
+
)
|
|
141
|
+
else
|
|
142
|
+
CometChatSoundManager.play("outgoingCall")
|
|
143
|
+
}
|
|
135
144
|
|
|
136
145
|
CometChat.addCallListener(
|
|
137
146
|
listenerId,
|
|
@@ -151,10 +160,7 @@ export const CometChatOutgoingCall = (props: CometChatOutgoingCallInterface) =>
|
|
|
151
160
|
})
|
|
152
161
|
);
|
|
153
162
|
|
|
154
|
-
CometChatUIEventHandler.addCallListener(
|
|
155
|
-
ccCallEnded: () => {
|
|
156
|
-
setCallConnected(false);
|
|
157
|
-
},
|
|
163
|
+
CometChatUIEventHandler.addCallListener(listenerId, {
|
|
158
164
|
ccCallFailled: () => {
|
|
159
165
|
setCallConnected(false);
|
|
160
166
|
}
|
|
@@ -163,27 +169,28 @@ export const CometChatOutgoingCall = (props: CometChatOutgoingCallInterface) =>
|
|
|
163
169
|
|
|
164
170
|
callListener.current = new CometChatCalls.OngoingCallListener({
|
|
165
171
|
onCallEnded: () => {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
172
|
+
if (checkIfDefualtCall(call)) {
|
|
173
|
+
setCallConnected(false);
|
|
174
|
+
call.setStatus("ended");
|
|
175
|
+
CometChatUIEventHandler.emitCallEvent(CallUIEvents.ccCallEnded, { call });
|
|
176
|
+
}
|
|
170
177
|
},
|
|
171
178
|
onCallEndButtonPressed: () => {
|
|
172
|
-
if(!checkIfDefualtCall(call)){
|
|
179
|
+
if (!checkIfDefualtCall(call)) {
|
|
173
180
|
setCallConnected(false);
|
|
174
181
|
call.setStatus("ended");
|
|
175
|
-
CometChatUIEventHandler.emitCallEvent(CallUIEvents.ccCallEnded,{call});
|
|
182
|
+
CometChatUIEventHandler.emitCallEvent(CallUIEvents.ccCallEnded, { call });
|
|
176
183
|
} else {
|
|
177
184
|
endCallIfRequired();
|
|
178
185
|
}
|
|
179
|
-
|
|
186
|
+
},
|
|
180
187
|
onUserJoined: user => {
|
|
181
188
|
console.log("user joined:", user);
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
189
|
+
},
|
|
190
|
+
onUserLeft: user => {
|
|
191
|
+
endCallIfRequired();
|
|
192
|
+
},
|
|
193
|
+
onError: (error) => {
|
|
187
194
|
CometChatUIEventHandler.emitCallEvent(CallUIEvents.ccCallFailled, { error });
|
|
188
195
|
}
|
|
189
196
|
});
|
|
@@ -209,54 +216,54 @@ export const CometChatOutgoingCall = (props: CometChatOutgoingCallInterface) =>
|
|
|
209
216
|
onRequestClose={() => onDeclineButtonPressed && onDeclineButtonPressed(call as CometChat.Call)}
|
|
210
217
|
>
|
|
211
218
|
<SafeAreaView>
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
219
|
+
{
|
|
220
|
+
isCallConnected ?
|
|
221
|
+
<CometChatOngoingCall
|
|
222
|
+
sessionID={callSessionId.current}
|
|
223
|
+
callSettingsBuilder={callSettings.current}
|
|
224
|
+
/> :
|
|
225
|
+
<CometChatCard
|
|
226
|
+
avatarUrl={
|
|
227
|
+
call?.getReceiverType?.() == "user" ?
|
|
228
|
+
call?.getReceiver?.()['avatar'] :
|
|
229
|
+
call?.getReceiver?.()['icon']
|
|
230
|
+
}
|
|
231
|
+
avatarName={call?.getReceiver?.().getName?.()}
|
|
232
|
+
avatarStyle={avatarStyle}
|
|
233
|
+
title={call?.getReceiver?.().getName?.()}
|
|
234
|
+
style={{
|
|
235
|
+
backgroundColor,
|
|
236
|
+
height,
|
|
237
|
+
width,
|
|
238
|
+
border,
|
|
239
|
+
borderRadius,
|
|
240
|
+
titleColor,
|
|
241
|
+
titleFont,
|
|
242
|
+
}}
|
|
243
|
+
SubtitleView={() => {
|
|
244
|
+
return <Text style={{ color: subtitleColor, ...subtitleFont }}>{
|
|
245
|
+
call?.['type'] == CallTypeConstants.audio ?
|
|
246
|
+
localize("OUTGOING_AUDIO_CALL") :
|
|
247
|
+
localize("OUTGOING_VIDEO_CALL")}</Text>
|
|
248
|
+
}}
|
|
249
|
+
BottomView={() => {
|
|
250
|
+
return <CometChatButton
|
|
251
|
+
onPress={() => onDeclineButtonPressed && onDeclineButtonPressed(call as CometChat.Call)}
|
|
252
|
+
iconUrl={declineButtonIcon || DeclineIcon}
|
|
253
|
+
text={declineButtonText || localize("CANCEL")}
|
|
254
|
+
style={{
|
|
255
|
+
iconTint: theme.palette.getSecondary(),
|
|
256
|
+
iconBackgroundColor: theme.palette.getError(),
|
|
257
|
+
iconCornerRadius: 25,
|
|
258
|
+
height: 50,
|
|
259
|
+
width: 50,
|
|
260
|
+
textColor: theme.palette.getAccent(),
|
|
261
|
+
...buttonStyle
|
|
262
|
+
}}
|
|
263
|
+
/>
|
|
264
|
+
}}
|
|
265
|
+
/>
|
|
266
|
+
}
|
|
260
267
|
</SafeAreaView>
|
|
261
268
|
</Modal>
|
|
262
269
|
);
|
|
@@ -8,6 +8,7 @@ export const Styles = (props) =>
|
|
|
8
8
|
maxHeight: props.height || 114,
|
|
9
9
|
width: props.width || 228,
|
|
10
10
|
padding: 8,
|
|
11
|
+
paddingBottom: 0
|
|
11
12
|
},
|
|
12
13
|
rowStyle: {
|
|
13
14
|
flexDirection: 'row',
|
|
@@ -56,6 +57,7 @@ export const Styles = (props) =>
|
|
|
56
57
|
justifyContent: 'center',
|
|
57
58
|
alignItems: 'center',
|
|
58
59
|
margin: 8,
|
|
60
|
+
marginBottom: 0,
|
|
59
61
|
backgroundColor: props.buttonBackgroundColor || 'rgba(20, 20, 20, 0.04)',
|
|
60
62
|
},
|
|
61
63
|
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
import { CometChatUIEventHandler } from '../../shared/events/CometChatUIEventHandler/CometChatUIEventHandler';
|
|
17
17
|
import { CometChatUIKit } from '../../shared/CometChatUiKit/CometChatUIKit';
|
|
18
18
|
import { SmartRepliesConfigurationInterface } from './SmartRepliesExtension';
|
|
19
|
+
import { CommonUtils } from '../../shared/utils/CommonUtils';
|
|
19
20
|
|
|
20
21
|
export class SmartRepliesDecorator extends DataSourceDecorator {
|
|
21
22
|
smartRepliesConfiguration?: SmartRepliesConfigurationInterface;
|
|
@@ -45,6 +46,7 @@ export class SmartRepliesDecorator extends DataSourceDecorator {
|
|
|
45
46
|
this.getReplies(message);
|
|
46
47
|
},
|
|
47
48
|
onTextMessageReceived: (textMessage) => {
|
|
49
|
+
if(textMessage && textMessage['sender']?.['uid'] != this.loggedInUser.getUid())
|
|
48
50
|
this.getReplies(textMessage);
|
|
49
51
|
},
|
|
50
52
|
}
|
|
@@ -60,6 +62,8 @@ export class SmartRepliesDecorator extends DataSourceDecorator {
|
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
getReplies(message) {
|
|
65
|
+
|
|
66
|
+
let id = CommonUtils.getComponentIdFromMessage(message);
|
|
63
67
|
const smartReplyData = getExtentionData(
|
|
64
68
|
message,
|
|
65
69
|
ExtensionConstants.smartReply
|
|
@@ -76,6 +80,7 @@ export class SmartRepliesDecorator extends DataSourceDecorator {
|
|
|
76
80
|
}
|
|
77
81
|
CometChatUIEventHandler.emitUIEvent(CometChatUIEvents.showPanel, {
|
|
78
82
|
alignment: ViewAlignment.messageListBottom,
|
|
83
|
+
id: id,
|
|
79
84
|
child: () => (
|
|
80
85
|
<SmartRepliesView
|
|
81
86
|
replies={options}
|
|
@@ -91,6 +96,7 @@ export class SmartRepliesDecorator extends DataSourceDecorator {
|
|
|
91
96
|
|
|
92
97
|
handleSendMessage = (message, smartReply) => {
|
|
93
98
|
let chatWithId = '';
|
|
99
|
+
let id = CommonUtils.getComponentIdFromMessage(message)
|
|
94
100
|
let chatWith;
|
|
95
101
|
if (!smartReply.trim().length) {
|
|
96
102
|
return;
|
|
@@ -117,6 +123,11 @@ export class SmartRepliesDecorator extends DataSourceDecorator {
|
|
|
117
123
|
CometChatUIKit.sendTextMessage(textMessage)
|
|
118
124
|
.then(() => {})
|
|
119
125
|
.catch(() => {})
|
|
126
|
+
|
|
127
|
+
CometChatUIEventHandler.emitUIEvent(CometChatUIEvents.showPanel, {
|
|
128
|
+
alignment: ViewAlignment.messageListBottom,
|
|
129
|
+
id: id,
|
|
130
|
+
});
|
|
120
131
|
};
|
|
121
132
|
|
|
122
133
|
onCloseRepliesPannel = () => {
|
package/src/extensions/index.ts
CHANGED
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
} from "./LinkPreview";
|
|
11
11
|
import { MessageTranslationBubble, MessageTranslationExtension, MessageTranslationConfigurationInterface } from "./MessageTranslation";
|
|
12
12
|
import { CometChatCreatePoll, PollsStyleInterface, CometChatCreatePollInterface, PollsConfigurationInterface, PollsExtension } from "./Polls";
|
|
13
|
-
import { CometChatMessageReactions, ReactionsExtension, ReactionsConfigurationInterface } from "./Reactions";
|
|
14
13
|
import { SmartRepliesExtension, SmartRepliesConfigurationInterface, SmartRepliesInterface, SmartRepliesView } from "./SmartReplies";
|
|
15
14
|
import { CometChatStickerBubble, StickerConfigurationInterface, StickersExtension, CometChatStickerBubbleProps as CometChatStickerBubbleInterface } from "./Stickers";
|
|
16
15
|
import { TextModerationConfigurationInterface, TextModerationExtension, TextModerationExtensionDecorator } from "./TextModeration";
|
|
@@ -42,9 +41,6 @@ export {
|
|
|
42
41
|
CometChatCreatePoll,
|
|
43
42
|
CometChatCreatePollInterface,
|
|
44
43
|
PollsConfigurationInterface, PollsExtension, PollsStyleInterface,
|
|
45
|
-
CometChatMessageReactions,
|
|
46
|
-
ReactionsExtension,
|
|
47
|
-
ReactionsConfigurationInterface,
|
|
48
44
|
SmartRepliesExtension,
|
|
49
45
|
SmartRepliesConfigurationInterface,
|
|
50
46
|
SmartRepliesInterface,
|