@cometchat/chat-uikit-react-native 5.0.0 → 5.0.2
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/android/src/main/java/com/reactnativecometchatuikit/FileManager.java +87 -49
- package/android/src/main/java/com/reactnativecometchatuikit/SoundPlayer.java +10 -0
- package/ios/SoundPlayer.m +8 -0
- package/package.json +8 -9
- package/src/CometChatConversations/CometChatConversations.tsx +19 -14
- package/src/CometChatConversations/style.ts +6 -2
- package/src/CometChatGroupMembers/CometChatGroupMembers.tsx +1 -0
- package/src/CometChatGroupMembers/style.ts +1 -0
- package/src/CometChatGroups/CometChatGroups.tsx +1 -0
- package/src/CometChatMessageComposer/CometChatMessageComposer.tsx +227 -57
- package/src/CometChatMessageComposer/styles.tsx +3 -6
- package/src/CometChatMessageHeader/CometChatMessageHeader.tsx +2 -2
- package/src/CometChatMessageHeader/styles.ts +1 -0
- package/src/CometChatMessageInformation/CometChatMessageInformation.tsx +1 -1
- package/src/CometChatMessageList/CometChatMessageList.tsx +188 -111
- package/src/CometChatMessageList/style.ts +0 -16
- package/src/CometChatThreadHeader/CometChatThreadHeader.tsx +1 -1
- package/src/CometChatUsers/CometChatUsers.tsx +1 -1
- package/src/calls/CallUtils.ts +18 -10
- package/src/calls/CallingExtensionDecorator.tsx +1 -1
- package/src/calls/CometChatCallBubble/CometChatCallBubble.tsx +8 -7
- package/src/calls/CometChatCallBubble/styles.ts +1 -0
- package/src/calls/CometChatCallButtons/CometChatCallButtons.tsx +6 -4
- package/src/calls/CometChatCallButtons/style.ts +2 -1
- package/src/calls/CometChatCallLogs/CometChatCallLogs.tsx +4 -3
- package/src/calls/CometChatCallLogs/style.ts +1 -0
- package/src/calls/CometChatIncomingCall/CometChatIncomingCall.tsx +4 -3
- package/src/calls/CometChatOngoingCall/CometChatOngoingCall.tsx +1 -0
- package/src/calls/CometChatOutgoingCall/CometChatOutgoingCall.tsx +3 -3
- package/src/calls/CometChatOutgoingCall/OutgoingCallConfiguration.ts +1 -0
- package/src/extensions/CollaborativeBubble/CometChatCollaborativeBubble.tsx +1 -1
- package/src/extensions/CollaborativeDocument/CollaborativeDocumentExtensionDecorator.tsx +1 -1
- package/src/extensions/CollaborativeWhiteboard/CollaborativeWhiteboardExtensionDecorator.tsx +1 -1
- package/src/extensions/LinkPreview/LinkPreviewBubble.tsx +15 -18
- package/src/extensions/LinkPreview/LinkPreviewExtensionDecorator.tsx +1 -1
- package/src/extensions/LinkPreview/style.ts +2 -2
- package/src/extensions/MessageTranslation/MessageTranslationDecorator.tsx +20 -17
- package/src/extensions/Polls/Polls.tsx +45 -8
- package/src/extensions/Polls/PollsDecorator.tsx +1 -1
- package/src/extensions/Stickers/StickersExtensionDecorator.tsx +2 -4
- package/src/extensions/Stickers/style.ts +3 -3
- package/src/extensions/ThumbnailGeneration/ThumbnailGenerationDecorator.tsx +1 -1
- package/src/imageresolver.d.ts +4 -0
- package/src/index.ts +2 -0
- package/src/shared/CometChatUiKit/CometChatUIKit.ts +1 -2
- package/src/shared/base/Types.ts +1 -0
- package/src/shared/formatters/CometChatMentionsFormatter/CometChatMentionsFormatter.tsx +114 -32
- package/src/shared/formatters/CometChatTextFormatter.ts +1 -0
- package/src/shared/formatters/CometChatUrlsFormatter/index.tsx +4 -4
- package/src/shared/framework/DataSource.ts +6 -2
- package/src/shared/framework/DataSourceDecorator.tsx +5 -4
- package/src/shared/framework/MessageDataSource.tsx +26 -28
- package/src/shared/helper/types/index.ts +1 -0
- package/src/shared/icons/Icon.tsx +1 -1
- package/src/shared/index.ts +41 -126
- package/src/shared/libs/ImageZoom/ReactNativeZoomableView.tsx +1 -1
- package/src/shared/libs/ImageZoom/ReactNativeZoomableViewWithGestures.tsx +4 -2
- package/src/shared/modals/CometChatMessageOption.ts +1 -0
- package/src/shared/modals/CometChatMessageTemplate.ts +1 -0
- package/src/shared/resources/CometChatSoundManager/index.ts +1 -0
- package/src/shared/utils/CometChatMessagePreview/CometChatMessagePreview.tsx +0 -8
- package/src/shared/utils/CometChatMessagePreview/index.ts +1 -2
- package/src/shared/utils/CommonUtils.ts +2 -1
- package/src/shared/utils/MessageUtils.tsx +54 -62
- package/src/shared/utils/conversationUtils.ts +1 -0
- package/src/shared/utils/index.ts +1 -2
- package/src/shared/views/CometChatActionSheet/ActionItem.ts +1 -0
- package/src/shared/views/CometChatActionSheet/CometChatActionSheet.tsx +1 -1
- package/src/shared/views/CometChatAudioBubble/AnimatedAudioWaves.tsx +1 -1
- package/src/shared/views/CometChatAudioBubble/CometChatAudioBubble.tsx +9 -6
- package/src/shared/views/CometChatBottomSheet/CometChatBottomSheet.tsx +1 -1
- package/src/shared/views/CometChatConfirmDialog/CometChatConfirmDialog.tsx +1 -1
- package/src/shared/views/CometChatConfirmDialog/style.ts +1 -0
- package/src/shared/views/CometChatDeletedBubble/styles.ts +1 -0
- package/src/shared/views/CometChatFileBubble/CometChatFileBubble.tsx +1 -1
- package/src/shared/views/CometChatList/CometChatList.tsx +2 -2
- package/src/shared/views/CometChatList/Header.tsx +1 -1
- package/src/shared/views/CometChatMediaRecorder/AnimatingMic.tsx +2 -2
- package/src/shared/views/CometChatMediaRecorder/CometChatAudioPreview/CometChatAudioPreview.tsx +16 -10
- package/src/shared/views/CometChatMessageBubble/CometChatMessageBubble.tsx +7 -8
- package/src/shared/views/CometChatMessageInput/CometChatMessageInput.tsx +1 -1
- package/src/shared/views/CometChatReactionList/CometChatReactionList.tsx +84 -70
- package/src/shared/views/CometChatReactions/CometChatReactions.tsx +1 -1
- package/src/shared/views/CometChatReactions/style.ts +5 -4
- package/src/shared/views/CometChatReceipt/style.ts +1 -0
- package/src/shared/views/CometChatStatusIndicator/CometChatStatusIndicator.tsx +1 -1
- package/src/shared/views/CometChatSuggestionList/style.ts +3 -2
- package/src/shared/views/CometChatTooltipMenu/CometChatTooltipMenu.tsx +1 -1
- package/src/shared/views/CometChatVideoBubble/CometChatVideoBubble.tsx +24 -47
- package/src/shared/views/CometChatVideoPlayer/CometChatVideoPlayer.tsx +68 -73
- package/src/shared/views/ErrorEmptyView/ErrorEmptyView.tsx +1 -0
- package/src/theme/CometChatThemeHelper.ts +69 -58
- package/src/theme/context.ts +2 -2
- package/src/theme/default/default.ts +204 -0
- package/src/theme/default/index.ts +0 -238
- package/src/theme/provider.tsx +7 -7
- package/src/theme/type.ts +5 -7
- package/android/.gradle/7.4/checksums/checksums.lock +0 -0
- package/android/.gradle/7.4/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.4/gc.properties +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/src/shared/utils/CometChatMessagePreview/MessagePreviewStyle.js +0 -42
package/src/shared/index.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as CometChatUiKitConstants from "./constants/UIKitConstants";
|
|
2
|
+
export { CometChatUiKitConstants };
|
|
3
|
+
|
|
4
|
+
export { Icon } from "./icons/Icon";
|
|
2
5
|
|
|
3
|
-
|
|
6
|
+
export type {
|
|
4
7
|
AdditionalParams,
|
|
5
8
|
ConversationType,
|
|
6
9
|
MessageBubbleAlignmentType,
|
|
@@ -9,186 +12,98 @@ import {
|
|
|
9
12
|
SelectionMode,
|
|
10
13
|
} from "./base";
|
|
11
14
|
|
|
12
|
-
|
|
15
|
+
export {
|
|
13
16
|
CometChatConversationEvents,
|
|
14
17
|
CometChatGroupsEvents,
|
|
15
18
|
CometChatUIEventHandler,
|
|
16
19
|
CometChatUIEvents,
|
|
17
20
|
MessageEvents,
|
|
18
21
|
} from "./events";
|
|
19
|
-
|
|
22
|
+
|
|
23
|
+
export type { DataSource } from "./framework";
|
|
24
|
+
|
|
25
|
+
export {
|
|
20
26
|
ChatConfigurator,
|
|
21
|
-
DataSource,
|
|
22
27
|
DataSourceDecorator,
|
|
23
28
|
ExtensionsDataSource,
|
|
24
29
|
MessageDataSource,
|
|
25
30
|
} from "./framework";
|
|
26
|
-
|
|
31
|
+
|
|
32
|
+
export type {
|
|
27
33
|
CometChatMessageOption,
|
|
34
|
+
} from "./modals";
|
|
35
|
+
|
|
36
|
+
export {
|
|
28
37
|
CometChatMessageTemplate,
|
|
29
38
|
} from "./modals";
|
|
30
|
-
|
|
31
|
-
|
|
39
|
+
|
|
40
|
+
export { CometChatLocalize, localize } from "./resources/CometChatLocalize";
|
|
41
|
+
export {
|
|
32
42
|
CometChatConversationUtils,
|
|
33
43
|
CometChatMessagePreview,
|
|
34
44
|
CometChatSoundManager,
|
|
35
|
-
MessagePreviewStyle,
|
|
36
45
|
} from "./utils";
|
|
37
46
|
|
|
38
|
-
|
|
39
|
-
ActionItemInterface,
|
|
40
|
-
BadgeStyle,
|
|
47
|
+
export {
|
|
41
48
|
CometChatActionSheet,
|
|
42
49
|
CometChatAudioBubble,
|
|
43
|
-
CometChatAudioBubbleInterface,
|
|
44
50
|
CometChatAvatar,
|
|
45
51
|
CometChatBadge,
|
|
46
52
|
CometChatBottomSheet,
|
|
47
|
-
CometChatBottomSheetInterface,
|
|
48
53
|
CometChatConfirmDialog,
|
|
49
|
-
CometChatConfirmDialogInterface,
|
|
50
54
|
CometChatDate,
|
|
51
|
-
CometChatDateInterface,
|
|
52
55
|
CometChatEmojiKeyboard,
|
|
53
56
|
CometChatFileBubble,
|
|
54
|
-
CometChatFileBubbleInterface,
|
|
55
57
|
CometChatImageBubble,
|
|
56
|
-
CometChatImageBubbleInterface,
|
|
57
58
|
CometChatList,
|
|
58
|
-
CometChatListActionsInterface,
|
|
59
59
|
CometChatListItem,
|
|
60
|
-
CometChatListItemInterface,
|
|
61
|
-
CometChatListProps,
|
|
62
|
-
CometChatListStylesInterface,
|
|
63
60
|
CometChatMediaRecorder,
|
|
64
|
-
CometChatMediaRecorderInterface,
|
|
65
61
|
CometChatMessageInput,
|
|
66
|
-
CometChatMessageInputInterface,
|
|
67
62
|
CometChatQuickReactions,
|
|
68
63
|
CometChatReactionList,
|
|
69
|
-
CometChatReactionListInterface,
|
|
70
64
|
CometChatReactions,
|
|
71
|
-
CometChatReactionsInterface,
|
|
72
65
|
CometChatStatusIndicator,
|
|
73
|
-
CometChatStatusIndicatorInterface,
|
|
74
66
|
CometChatSuggestionList,
|
|
75
|
-
CometChatSuggestionListInterface,
|
|
76
67
|
CometChatTextBubble,
|
|
77
|
-
CometChatTextBubbleInterface,
|
|
78
68
|
CometChatVideoBubble,
|
|
79
|
-
CometChatVideoBubbleInterface,
|
|
80
|
-
DateStyle,
|
|
81
69
|
SuggestionItem,
|
|
82
70
|
CometChatReceipt,
|
|
83
|
-
MenuItemInterface
|
|
84
71
|
} from "./views";
|
|
85
72
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
MentionTextStyle,
|
|
91
|
-
} from "./formatters";
|
|
92
|
-
|
|
93
|
-
import { CometChatUIKit, CometChatUIKitHelper, UIKitSettings } from "./CometChatUiKit";
|
|
94
|
-
|
|
95
|
-
import { CometChatMessageComposerAction } from "./helper/types";
|
|
96
|
-
|
|
97
|
-
import * as CometChatUiKitConstants from "./constants/UIKitConstants";
|
|
98
|
-
|
|
99
|
-
import { messageStatus } from "./utils/CometChatMessageHelper/index";
|
|
100
|
-
|
|
101
|
-
export type {
|
|
102
|
-
DataSource,
|
|
103
|
-
DateStyle,
|
|
104
|
-
ConversationType,
|
|
105
|
-
CometChatSuggestionListInterface,
|
|
106
|
-
CometChatTextBubbleInterface,
|
|
107
|
-
CometChatVideoBubbleInterface,
|
|
108
|
-
MessageBubbleAlignmentType,
|
|
109
|
-
CometChatMessageInputInterface,
|
|
110
|
-
CometChatMessageOption,
|
|
111
|
-
CometChatReactionListInterface,
|
|
112
|
-
CometChatReactionsInterface,
|
|
113
|
-
CometChatStatusIndicatorInterface,
|
|
114
|
-
MessageListAlignmentType,
|
|
115
|
-
MessageTimeAlignmentType,
|
|
116
|
-
SelectionMode,
|
|
73
|
+
export type{
|
|
74
|
+
ActionItemInterface,
|
|
75
|
+
BadgeStyle,
|
|
76
|
+
CometChatAudioBubbleInterface,
|
|
117
77
|
CometChatBottomSheetInterface,
|
|
118
|
-
CometChatFileBubbleInterface,
|
|
119
78
|
CometChatConfirmDialogInterface,
|
|
120
79
|
CometChatDateInterface,
|
|
80
|
+
CometChatFileBubbleInterface,
|
|
121
81
|
CometChatImageBubbleInterface,
|
|
122
82
|
CometChatListActionsInterface,
|
|
123
83
|
CometChatListItemInterface,
|
|
84
|
+
CometChatListProps,
|
|
124
85
|
CometChatListStylesInterface,
|
|
125
86
|
CometChatMediaRecorderInterface,
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
87
|
+
CometChatMessageInputInterface,
|
|
88
|
+
CometChatReactionListInterface,
|
|
89
|
+
CometChatReactionsInterface,
|
|
90
|
+
CometChatStatusIndicatorInterface,
|
|
91
|
+
CometChatSuggestionListInterface,
|
|
92
|
+
CometChatTextBubbleInterface,
|
|
93
|
+
CometChatVideoBubbleInterface,
|
|
94
|
+
DateStyle,
|
|
132
95
|
MenuItemInterface
|
|
133
|
-
};
|
|
96
|
+
} from "./views";
|
|
134
97
|
|
|
135
98
|
export {
|
|
136
|
-
//
|
|
137
|
-
ChatConfigurator,
|
|
138
|
-
//
|
|
139
|
-
CometChatActionSheet,
|
|
140
|
-
CometChatAudioBubble,
|
|
141
|
-
CometChatAvatar,
|
|
142
|
-
CometChatBadge,
|
|
143
|
-
CometChatBottomSheet,
|
|
144
|
-
CometChatConfirmDialog,
|
|
145
|
-
CometChatConversationEvents,
|
|
146
|
-
//
|
|
147
|
-
CometChatConversationUtils,
|
|
148
|
-
CometChatDate,
|
|
149
|
-
CometChatEmojiKeyboard,
|
|
150
|
-
CometChatFileBubble,
|
|
151
|
-
CometChatGroupsEvents,
|
|
152
|
-
CometChatImageBubble,
|
|
153
|
-
//
|
|
154
|
-
CometChatList,
|
|
155
|
-
//
|
|
156
|
-
CometChatListItem,
|
|
157
|
-
//
|
|
158
|
-
CometChatLocalize,
|
|
159
|
-
CometChatMediaRecorder,
|
|
160
99
|
CometChatMentionsFormatter,
|
|
161
|
-
CometChatMessageInput,
|
|
162
|
-
CometChatMessagePreview,
|
|
163
|
-
CometChatMessageTemplate,
|
|
164
|
-
//
|
|
165
|
-
CometChatQuickReactions,
|
|
166
|
-
CometChatReactionList,
|
|
167
|
-
CometChatReactions,
|
|
168
|
-
CometChatSoundManager,
|
|
169
|
-
CometChatStatusIndicator,
|
|
170
|
-
CometChatSuggestionList,
|
|
171
|
-
CometChatTextBubble,
|
|
172
100
|
CometChatTextFormatter,
|
|
173
|
-
// CometChatTheme,
|
|
174
|
-
CometChatUIEventHandler,
|
|
175
|
-
CometChatUIEvents,
|
|
176
|
-
CometChatUIKit,
|
|
177
|
-
CometChatUIKitHelper,
|
|
178
|
-
CometChatUiKitConstants,
|
|
179
101
|
CometChatUrlsFormatter,
|
|
180
|
-
CometChatVideoBubble,
|
|
181
|
-
DataSourceDecorator,
|
|
182
|
-
ExtensionsDataSource,
|
|
183
102
|
MentionTextStyle,
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
messageStatus,
|
|
192
|
-
CometChatReceipt,
|
|
193
|
-
Icon
|
|
194
|
-
};
|
|
103
|
+
} from "./formatters";
|
|
104
|
+
|
|
105
|
+
export { CometChatUIKit, CometChatUIKitHelper, UIKitSettings } from "./CometChatUiKit";
|
|
106
|
+
|
|
107
|
+
export type { CometChatMessageComposerAction } from "./helper/types";
|
|
108
|
+
|
|
109
|
+
export { messageStatus } from "./utils/CometChatMessageHelper/index";
|
|
@@ -54,7 +54,7 @@ class ReactNativeZoomableView extends Component<
|
|
|
54
54
|
ReactNativeZoomableViewProps,
|
|
55
55
|
ReactNativeZoomableViewState
|
|
56
56
|
> {
|
|
57
|
-
zoomSubjectWrapperRef: RefObject<View>;
|
|
57
|
+
zoomSubjectWrapperRef: RefObject<View | null>;
|
|
58
58
|
gestureHandlers: any;
|
|
59
59
|
doubleTapFirstTapReleaseTimestamp!: number | any;
|
|
60
60
|
|
|
@@ -18,7 +18,7 @@ class ReactNativeZoomableViewWithGestures extends React.Component<
|
|
|
18
18
|
ReactNativeZoomableViewWithGesturesProps,
|
|
19
19
|
ReactNativeZoomableViewState
|
|
20
20
|
> {
|
|
21
|
-
zoomableViewRef: React.RefObject<ReactNativeZoomableView
|
|
21
|
+
zoomableViewRef: React.RefObject<ReactNativeZoomableView | null>;
|
|
22
22
|
|
|
23
23
|
constructor(props: ReactNativeZoomableViewWithGesturesProps) {
|
|
24
24
|
super(props);
|
|
@@ -209,7 +209,9 @@ class ReactNativeZoomableViewWithGestures extends React.Component<
|
|
|
209
209
|
return (
|
|
210
210
|
<ReactNativeZoomableView
|
|
211
211
|
{...this.props}
|
|
212
|
-
ref={
|
|
212
|
+
ref={(ref) => {
|
|
213
|
+
this.zoomableViewRef.current = ref;
|
|
214
|
+
}}
|
|
213
215
|
onShiftingEnd={this._onShiftingEnd}
|
|
214
216
|
/>
|
|
215
217
|
);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CometChat } from "@cometchat/chat-sdk-react-native";
|
|
2
2
|
import { ImageSourcePropType, ImageStyle, TextStyle, ViewStyle } from "react-native";
|
|
3
3
|
import { ActionItemInterface } from "../views";
|
|
4
|
+
import { JSX } from "react";
|
|
4
5
|
|
|
5
6
|
export type CometChatMessageOption = ActionItemInterface & {
|
|
6
7
|
id: string;
|
|
@@ -2,6 +2,7 @@ import { CometChat } from "@cometchat/chat-sdk-react-native";
|
|
|
2
2
|
import { MessageBubbleAlignmentType } from "../base/Types";
|
|
3
3
|
import { CometChatMessageOption } from "./CometChatMessageOption";
|
|
4
4
|
import { CometChatTheme } from "../../theme/type";
|
|
5
|
+
import { JSX } from "react";
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Represents the interface for a message template.
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
2
|
import { View, Text, TouchableOpacity, Image } from "react-native";
|
|
4
|
-
// import { getExtensionData, ExtensionConstants, CometChatTheme } from "../../shared";
|
|
5
3
|
import closeIcon from "./resources/close.png";
|
|
6
4
|
import { useTheme } from "../../../theme";
|
|
7
5
|
import { Styles } from "./style";
|
|
@@ -41,10 +39,4 @@ const CometChatMessagePreview = (props: any) => {
|
|
|
41
39
|
);
|
|
42
40
|
};
|
|
43
41
|
|
|
44
|
-
CometChatMessagePreview.propTypes = {
|
|
45
|
-
messagePreviewTitle: PropTypes.string,
|
|
46
|
-
messagePreviewSubtitle: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
47
|
-
closeIconURL: PropTypes.any,
|
|
48
|
-
onCloseClick: PropTypes.func,
|
|
49
|
-
};
|
|
50
42
|
export { CometChatMessagePreview };
|
|
@@ -171,7 +171,8 @@ export class CommonUtils {
|
|
|
171
171
|
// );
|
|
172
172
|
|
|
173
173
|
// Wait for IMAGE_PREFETCH_TIMEOUT before retrying
|
|
174
|
-
await new Promise((resolve) => setTimeout(resolve, IMAGE_PREFETCH_TIMEOUT));
|
|
174
|
+
await new Promise<void>((resolve) => setTimeout(resolve, IMAGE_PREFETCH_TIMEOUT));
|
|
175
|
+
|
|
175
176
|
|
|
176
177
|
// Retry with reduced attempt count
|
|
177
178
|
return CommonUtils.prefetchThumbnail(url, attempts - 1);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { CometChat } from "@cometchat/chat-sdk-react-native";
|
|
2
|
-
import React, {
|
|
3
|
-
import { ColorValue,
|
|
4
|
-
import { useTheme } from "../../theme";
|
|
2
|
+
import React, { JSX } from "react";
|
|
3
|
+
import { ColorValue, Text, View } from "react-native";
|
|
5
4
|
import { MessageBubbleAlignmentType } from "../base";
|
|
6
5
|
import {
|
|
7
6
|
CometChatCustomMessageTypes,
|
|
@@ -132,62 +131,58 @@ const MessageContentView = (props: {
|
|
|
132
131
|
return null;
|
|
133
132
|
};
|
|
134
133
|
|
|
135
|
-
const getLeadingView =
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
)
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
},
|
|
165
|
-
[]
|
|
166
|
-
);
|
|
167
|
-
|
|
168
|
-
const getHeaderView = useCallback(
|
|
169
|
-
(item: CometChat.BaseMessage | any, theme: CometChatTheme): JSX.Element | undefined => {
|
|
170
|
-
const _style = getBubbleStyle(item, theme);
|
|
171
|
-
if (
|
|
172
|
-
item.getSender()?.getUid() != CometChatUIKit.loggedInUser?.getUid() &&
|
|
173
|
-
![MessageCategoryConstants.action, MessageCategoryConstants.call].includes(item.getCategory())
|
|
174
|
-
) {
|
|
175
|
-
const senderName = (item.getSender()?.getName() || "").trim();
|
|
176
|
-
return (
|
|
177
|
-
<View style={{ flexDirection: "row" }}>
|
|
178
|
-
{Boolean(senderName) && (
|
|
179
|
-
<Text style={_style.senderNameTextStyles} numberOfLines={1} ellipsizeMode={"tail"}>
|
|
180
|
-
{senderName}
|
|
181
|
-
</Text>
|
|
182
|
-
)}
|
|
183
|
-
</View>
|
|
184
|
-
);
|
|
185
|
-
}
|
|
186
|
-
return undefined;
|
|
187
|
-
},
|
|
188
|
-
[]
|
|
189
|
-
);
|
|
134
|
+
const getLeadingView = (
|
|
135
|
+
item: CometChat.BaseMessage,
|
|
136
|
+
theme: CometChatTheme,
|
|
137
|
+
avatarVisibility = true
|
|
138
|
+
): JSX.Element | undefined => {
|
|
139
|
+
if (!avatarVisibility) return undefined;
|
|
140
|
+
let _style = getBubbleStyle(item, theme);
|
|
141
|
+
if (
|
|
142
|
+
item.getSender()?.getUid() !== CometChatUIKit.loggedInUser?.getUid() &&
|
|
143
|
+
item.getCategory() != MessageCategoryConstants.action
|
|
144
|
+
) {
|
|
145
|
+
return (
|
|
146
|
+
<CometChatAvatar
|
|
147
|
+
image={
|
|
148
|
+
item?.getSender()?.getAvatar && item?.getSender()?.getAvatar()
|
|
149
|
+
? { uri: item.getSender().getAvatar() }
|
|
150
|
+
: undefined
|
|
151
|
+
}
|
|
152
|
+
name={
|
|
153
|
+
item?.getSender()?.getName && item?.getSender()?.getName()
|
|
154
|
+
? item?.getSender()?.getName()
|
|
155
|
+
: ""
|
|
156
|
+
}
|
|
157
|
+
style={_style.avatarStyle}
|
|
158
|
+
/>
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
return undefined;
|
|
162
|
+
};
|
|
190
163
|
|
|
164
|
+
const getHeaderView = (
|
|
165
|
+
item: CometChat.BaseMessage | any,
|
|
166
|
+
theme: CometChatTheme
|
|
167
|
+
): JSX.Element | undefined => {
|
|
168
|
+
const _style = getBubbleStyle(item, theme);
|
|
169
|
+
if (
|
|
170
|
+
item.getSender()?.getUid() != CometChatUIKit.loggedInUser?.getUid() &&
|
|
171
|
+
![MessageCategoryConstants.action, MessageCategoryConstants.call].includes(item.getCategory())
|
|
172
|
+
) {
|
|
173
|
+
const senderName = (item.getSender()?.getName() || "").trim();
|
|
174
|
+
return (
|
|
175
|
+
<View style={{ flexDirection: "row" }}>
|
|
176
|
+
{Boolean(senderName) && (
|
|
177
|
+
<Text style={_style.senderNameTextStyles} numberOfLines={1} ellipsizeMode={"tail"}>
|
|
178
|
+
{senderName}
|
|
179
|
+
</Text>
|
|
180
|
+
)}
|
|
181
|
+
</View>
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
return undefined;
|
|
185
|
+
};
|
|
191
186
|
const getBubbleStyle = (item: CometChat.BaseMessage, theme: CometChatTheme): BubbleStyles => {
|
|
192
187
|
const loggedInUser = CometChatUIKit.loggedInUser!;
|
|
193
188
|
const type = (() => {
|
|
@@ -251,10 +246,7 @@ const getStatusInfoView = (
|
|
|
251
246
|
]}
|
|
252
247
|
>
|
|
253
248
|
<CometChatDate
|
|
254
|
-
timeStamp={
|
|
255
|
-
(item.getDeletedAt() || item.getSentAt()) *
|
|
256
|
-
1000 || getSentAtTimestamp(item)
|
|
257
|
-
}
|
|
249
|
+
timeStamp={(item.getDeletedAt() || item.getSentAt()) * 1000 || getSentAtTimestamp(item)}
|
|
258
250
|
pattern={"timeFormat"}
|
|
259
251
|
customDateString={datePattern && datePattern(item)}
|
|
260
252
|
style={_style.dateStyles}
|
|
@@ -6,6 +6,7 @@ import { getMessagePreviewInternal } from "./MessageUtils";
|
|
|
6
6
|
import { MessageCategoryConstants } from "../constants/UIKitConstants";
|
|
7
7
|
import { CometChatUIKit } from "../CometChatUiKit";
|
|
8
8
|
import { CometChatTheme } from "../../theme/type";
|
|
9
|
+
import { JSX } from "react";
|
|
9
10
|
|
|
10
11
|
export class CometChatConversationUtils {
|
|
11
12
|
static getLastMessage(conversation: CometChat.Conversation): CometChat.BaseMessage | undefined {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { CometChatSoundManager } from "../resources/CometChatSoundManager";
|
|
2
|
-
import { CometChatMessagePreview
|
|
2
|
+
import { CometChatMessagePreview } from "./CometChatMessagePreview";
|
|
3
3
|
import { CometChatConversationUtils } from "./conversationUtils";
|
|
4
4
|
export {
|
|
5
5
|
CometChatConversationUtils,
|
|
6
6
|
CometChatMessagePreview,
|
|
7
7
|
CometChatSoundManager,
|
|
8
|
-
MessagePreviewStyle,
|
|
9
8
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useCallback, useEffect, useRef, useState } from "react";
|
|
1
|
+
import React, { JSX, useCallback, useEffect, useRef, useState } from "react";
|
|
2
2
|
import {
|
|
3
3
|
EmitterSubscription,
|
|
4
4
|
ImageSourcePropType,
|
|
@@ -18,7 +18,7 @@ import { AnimatedAudioWaves } from "./AnimatedAudioWaves";
|
|
|
18
18
|
const { SoundPlayer } = NativeModules;
|
|
19
19
|
const eventEmitter = new NativeEventEmitter(SoundPlayer);
|
|
20
20
|
let listener: EmitterSubscription;
|
|
21
|
-
let interval:
|
|
21
|
+
let interval: ReturnType<typeof setTimeout>;;
|
|
22
22
|
|
|
23
23
|
export interface CometChatAudioBubbleInterface {
|
|
24
24
|
/**
|
|
@@ -70,22 +70,24 @@ export const CometChatAudioBubble = ({
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
return () => {
|
|
73
|
-
|
|
73
|
+
SoundPlayer.releaseMediaPlayer();
|
|
74
74
|
};
|
|
75
75
|
}, [audioUrl]);
|
|
76
76
|
|
|
77
77
|
useEffect(() => {
|
|
78
78
|
listener = eventEmitter.addListener("soundPlayStatus", (data) => {
|
|
79
79
|
if (audioUrl === data.url) {
|
|
80
|
-
setStatus("
|
|
80
|
+
setStatus("");
|
|
81
|
+
|
|
81
82
|
clearInterval(interval);
|
|
82
|
-
|
|
83
|
+
|
|
84
|
+
setCurrentTime(0);
|
|
83
85
|
}
|
|
84
86
|
});
|
|
85
87
|
|
|
86
88
|
return () => {
|
|
87
89
|
listener.remove();
|
|
88
|
-
|
|
90
|
+
clearInterval(interval);
|
|
89
91
|
};
|
|
90
92
|
}, [audioUrl]);
|
|
91
93
|
|
|
@@ -231,3 +233,4 @@ export const CometChatAudioBubble = ({
|
|
|
231
233
|
</View>
|
|
232
234
|
);
|
|
233
235
|
};
|
|
236
|
+
// CometChatAudioBubble
|
|
@@ -168,7 +168,7 @@ const CometChatBottomSheet = forwardRef(
|
|
|
168
168
|
flex: 1,
|
|
169
169
|
backgroundColor: overlayAnim.interpolate({
|
|
170
170
|
inputRange: [0, 0.2],
|
|
171
|
-
outputRange: ["rgba(0,0,0,0)", "rgba(0,0,0,0.
|
|
171
|
+
outputRange: ["rgba(0,0,0,0)", "rgba(0,0,0,0.35)"],
|
|
172
172
|
}),
|
|
173
173
|
}}
|
|
174
174
|
onStartShouldSetResponder={() => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ImageSourcePropType, ImageStyle, StyleSheet, TextStyle, ViewStyle } from "react-native";
|
|
2
2
|
import { CometChatTheme } from "../../../theme/type";
|
|
3
3
|
import { deepMerge } from "../../helper/helperFunctions";
|
|
4
|
+
import { JSX } from "react";
|
|
4
5
|
|
|
5
6
|
export type ConfirmDialogStyle = {
|
|
6
7
|
containerStyle: ViewStyle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useCallback, useEffect, useImperativeHandle, useRef, useState } from "react";
|
|
1
|
+
import React, { JSX, useCallback, useEffect, useImperativeHandle, useRef, useState } from "react";
|
|
2
2
|
import {
|
|
3
3
|
ActivityIndicator,
|
|
4
4
|
ColorValue,
|
|
@@ -643,7 +643,7 @@ export const CometChatList = React.forwardRef<CometChatListActionsInterface, Com
|
|
|
643
643
|
* Returns a container of users if exists else returns the corresponding decorator message
|
|
644
644
|
*/
|
|
645
645
|
const getMessageContainer = useCallback(() => {
|
|
646
|
-
let messageContainer =
|
|
646
|
+
let messageContainer: JSX.Element = <></>;
|
|
647
647
|
if (list.length === 0 && dataLoadingStatus.toLowerCase() === NO_DATA_FOUND) {
|
|
648
648
|
messageContainer = EmptyView ? (
|
|
649
649
|
<EmptyView />
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useEffect, useMemo, useRef } from "react";
|
|
1
|
+
import React, { JSX, useEffect, useMemo, useRef } from "react";
|
|
2
2
|
import {
|
|
3
3
|
Animated,
|
|
4
4
|
Easing,
|
|
@@ -41,7 +41,7 @@ export const AnimatingMic = ({
|
|
|
41
41
|
}, [theme, style]);
|
|
42
42
|
|
|
43
43
|
useEffect(() => {
|
|
44
|
-
if (isAnimating === false) return;
|
|
44
|
+
if (isAnimating === false) return () => {};
|
|
45
45
|
Animated.loop(
|
|
46
46
|
Animated.sequence([
|
|
47
47
|
Animated.timing(scaleAnim, {
|