@cometchat/chat-uikit-react-native 4.3.18 → 4.3.20
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/.gradle/7.4/checksums/checksums.lock +0 -0
- package/android/.gradle/7.4/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.4/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.4/executionHistory/executionHistory.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/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/src/main/AndroidManifest.xml +6 -0
- package/ios/FileManager.m +2 -0
- package/package.json +1 -1
- package/src/CometChatConversations/CometChatConversations.tsx +31 -33
- package/src/CometChatGroups/CometChatGroups.tsx +2 -2
- package/src/CometChatGroups/GroupsConfiguration.ts +13 -16
- package/src/CometChatGroups/resources/index.ts +0 -3
- package/src/CometChatMessageComposer/CometChatMessageComposer.tsx +14 -5
- package/src/CometChatMessageInformation/MessageInformationConfiguration.tsx +31 -12
- package/src/CometChatMessageInformation/index.ts +6 -3
- package/src/CometChatMessageList/CometChatMessageList.tsx +86 -13
- package/src/CometChatMessageList/MessageListConfiguration.ts +21 -0
- package/src/CometChatTabs/CometChatTabs.tsx +8 -8
- package/src/CometChatThreadedMessages/CometChatThreadedMessages.tsx +2 -1
- package/src/CometChatUsers/CometChatUsers.tsx +40 -11
- package/src/CometChatUsers/UsersConfiguration.tsx +2 -2
- package/src/CometChatUsers/UsersStyle.ts +101 -0
- package/src/CometChatUsers/index.ts +4 -1
- package/src/extensions/LinkPreview/LinkPreviewBubble.tsx +1 -1
- package/src/extensions/MessageTranslation/MessageTranslationBubble.tsx +1 -1
- package/src/extensions/MessageTranslation/MessageTranslationDecorator.tsx +1 -1
- package/src/extensions/SmartReplies/SmartRepliesDecorator.tsx +11 -6
- package/src/index.ts +8 -2
- package/src/shared/events/CometChatUIEventHandler/CometChatUIEventHandler.ts +53 -53
- package/src/shared/framework/MessageDataSource.tsx +15 -11
- package/src/shared/libs/ImageZoom/ReactNativeZoomableView.tsx +1 -0
- package/src/shared/libs/ImageZoom/ReactNativeZoomableViewWithGestures.tsx +1 -1
- package/src/shared/libs/VideoPlayerControls/components/Control.tsx +1 -1
- package/src/shared/libs/VideoPlayerControls/components/PlayPause/PlayPause.tsx +1 -1
- package/src/shared/libs/luxon/src/impl/zoneUtil.js +0 -4
- package/src/shared/utils/CommonUtils.ts +17 -17
- package/src/shared/utils/DetailsUtils/DetailsUtils.tsx +1 -1
- package/src/shared/utils/InteractiveMessageUtils.ts +1 -1
- package/src/shared/views/CometChatActionSheet/ActionSheetStyle.ts +10 -12
- package/src/shared/views/CometChatAudioBubble/CometChatAudioBubble.tsx +1 -1
- package/src/shared/views/CometChatFileBubble/CometChatFileBubble.tsx +2 -2
- package/src/shared/views/CometChatFormBubble/CometChatFormBubble.tsx +1 -1
- package/src/shared/views/CometChatImageBubble/CometChatImageBubble.tsx +3 -3
- package/src/shared/views/CometChatImageBubble/assets/index.ts +1 -0
- package/src/shared/views/CometChatListItem/CometChatListItem.tsx +1 -1
- package/src/shared/views/CometChatMessageBubble/MessageBubbleStyle.ts +2 -2
- package/src/shared/views/CometChatReactionList/CometChatReactionList.tsx +0 -1
- package/src/shared/views/CometChatSchedulerBubble/CometChatSchedulerBubble.tsx +5 -5
- package/src/shared/views/CometChatVideoBubble/CometChatVideoBubble.tsx +1 -1
- package/src/CometChatGroups/resources/search.png +0 -0
|
@@ -21,6 +21,7 @@ import { ReactionsConfigurationInterface } from '../shared/views/CometChatReacti
|
|
|
21
21
|
import { ReactionListConfigurationInterface } from '../shared/views/CometChatReactionList';
|
|
22
22
|
import { QuickReactionsConfigurationInterface } from '../shared/views/CometChatQuickReactions';
|
|
23
23
|
import { EmojiKeyboardStyle } from '../shared/views/CometChatEmojiKeyboard';
|
|
24
|
+
import { CometChatMessageInformationConfigurationInterface } from '../CometChatMessageInformation/MessageInformationConfiguration';
|
|
24
25
|
|
|
25
26
|
export interface MessageListConfigurationInterface {
|
|
26
27
|
ErrorStateView?: (e: CometChat.CometChatException) => JSX.Element;
|
|
@@ -91,6 +92,11 @@ export interface MessageListConfigurationInterface {
|
|
|
91
92
|
/**
|
|
92
93
|
* Hides the header of the action sheet
|
|
93
94
|
*/
|
|
95
|
+
/**
|
|
96
|
+
* @deprecated
|
|
97
|
+
*
|
|
98
|
+
* This property is deprecated as of version 4.3.20, as it is no longer needed. It will be removed in subsequent versions.
|
|
99
|
+
*/
|
|
94
100
|
hideActionSheetHeader?: boolean;
|
|
95
101
|
/**
|
|
96
102
|
* Message Reaction Configuration @ReactionsConfigurationInterface
|
|
@@ -118,6 +124,11 @@ export interface MessageListConfigurationInterface {
|
|
|
118
124
|
* @type {Array<CometChatMentionsFormatter | CometChatUrlsFormatter | CometChatTextFormatter>}
|
|
119
125
|
*/
|
|
120
126
|
textFormatters?: Array<CometChatMentionsFormatter | CometChatUrlsFormatter | CometChatTextFormatter>;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Message Information Configuration @CometChatMessageInformationConfigurationInterface
|
|
130
|
+
*/
|
|
131
|
+
messageInformationConfiguration?: CometChatMessageInformationConfigurationInterface;
|
|
121
132
|
}
|
|
122
133
|
export class MessageListConfiguration
|
|
123
134
|
implements MessageListConfigurationInterface {
|
|
@@ -189,6 +200,11 @@ export class MessageListConfiguration
|
|
|
189
200
|
/**
|
|
190
201
|
* Hides the header of the action sheet
|
|
191
202
|
*/
|
|
203
|
+
/**
|
|
204
|
+
* @deprecated
|
|
205
|
+
*
|
|
206
|
+
* This property is deprecated as of version 4.3.20, as it is no longer needed. It will be removed in subsequent versions.
|
|
207
|
+
*/
|
|
192
208
|
hideActionSheetHeader?: boolean;
|
|
193
209
|
/**
|
|
194
210
|
* Message Reaction Configuration @ReactionsConfigurationInterface
|
|
@@ -218,6 +234,11 @@ export class MessageListConfiguration
|
|
|
218
234
|
*/
|
|
219
235
|
textFormatters?: Array<CometChatMentionsFormatter | CometChatUrlsFormatter | CometChatTextFormatter>;
|
|
220
236
|
|
|
237
|
+
/**
|
|
238
|
+
* Message Information Configuration @CometChatMessageInformationConfigurationInterface
|
|
239
|
+
*/
|
|
240
|
+
messageInformationConfiguration?: CometChatMessageInformationConfigurationInterface;
|
|
241
|
+
|
|
221
242
|
constructor(props: MessageListConfigurationInterface) {
|
|
222
243
|
if (props) {
|
|
223
244
|
for (const [key, value] of Object.entries(props)) {
|
|
@@ -27,7 +27,7 @@ export const CometChatTabs = (props: CometChatTabsInterface) => {
|
|
|
27
27
|
keepAlive = false,
|
|
28
28
|
tabAlignment = "bottom",
|
|
29
29
|
} = props;
|
|
30
|
-
|
|
30
|
+
|
|
31
31
|
const { theme } = React.useContext(CometChatContext);
|
|
32
32
|
|
|
33
33
|
const [views, setViews] = useState<Array<ViewType>>([]);
|
|
@@ -45,7 +45,7 @@ export const CometChatTabs = (props: CometChatTabsInterface) => {
|
|
|
45
45
|
},[props.tabs]);
|
|
46
46
|
|
|
47
47
|
useEffect(() => {
|
|
48
|
-
|
|
48
|
+
loadActiveTab();
|
|
49
49
|
}, [])
|
|
50
50
|
|
|
51
51
|
const getStyleFor = (tab: TabItem) => {
|
|
@@ -67,8 +67,8 @@ export const CometChatTabs = (props: CometChatTabsInterface) => {
|
|
|
67
67
|
titleTextColor: style?.tabTitleTextColor || theme?.palette.getAccent(),
|
|
68
68
|
titleTextFont: style?.tabTitleTextFont || theme?.typography.body,
|
|
69
69
|
activeIconTint: theme?.palette.getPrimary(),
|
|
70
|
-
activeTitleTextColor: style?.activeTabTitleTextColor || theme?.palette.
|
|
71
|
-
activeBackgroundColor: style?.activeTabBackgroundColor || theme?.palette.
|
|
70
|
+
activeTitleTextColor: style?.activeTabTitleTextColor || theme?.palette.getSecondary(),
|
|
71
|
+
activeBackgroundColor: style?.activeTabBackgroundColor || theme?.palette.getPrimary(),
|
|
72
72
|
iconTint: theme?.palette.getAccent600(),
|
|
73
73
|
activeTitleTextFont: theme?.typography.body,
|
|
74
74
|
borderRadius: style?.borderRadius,
|
|
@@ -80,7 +80,7 @@ export const CometChatTabs = (props: CometChatTabsInterface) => {
|
|
|
80
80
|
width: tabs.length <= 4 ? (screenWidth - 30) / tabs.length : width,
|
|
81
81
|
border: tab.isActive ? style?.activeTabBorder : undefined,
|
|
82
82
|
borderRadius: style?.borderRadius,
|
|
83
|
-
backgroundColor: tab.isActive ? activeBackgroundColor :
|
|
83
|
+
backgroundColor: tab.isActive ? activeBackgroundColor : "transparent",
|
|
84
84
|
tintColor: tab.isActive ? activeIconTint : iconTint,
|
|
85
85
|
color: tab.isActive ? activeTitleTextColor : titleTextColor,
|
|
86
86
|
titleFont: tab.isActive ? activeTitleTextFont : titleTextFont,
|
|
@@ -126,9 +126,9 @@ export const CometChatTabs = (props: CometChatTabsInterface) => {
|
|
|
126
126
|
setTabs(newTabState);
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
const TabItemView = ({ item }) => {
|
|
129
|
+
const TabItemView = ({ item }: {item: any}) => {
|
|
130
130
|
let style = getStyleFor(item);
|
|
131
|
-
|
|
131
|
+
|
|
132
132
|
return (
|
|
133
133
|
<TouchableOpacity
|
|
134
134
|
style={[style, { justifyContent: "center", alignItems: "center" }] as ViewProps}
|
|
@@ -146,7 +146,7 @@ export const CometChatTabs = (props: CometChatTabsInterface) => {
|
|
|
146
146
|
|
|
147
147
|
const TabsList = () => {
|
|
148
148
|
return (
|
|
149
|
-
<View style={{flexDirection: 'row', backgroundColor: style
|
|
149
|
+
<View style={{flexDirection: 'row', backgroundColor: style?.backgroundColor, borderRadius: style?.borderRadius, margin: 15, marginTop: 0}}>
|
|
150
150
|
{ tabs.map(item=> <TabItemView item={item}/>) }
|
|
151
151
|
</View>
|
|
152
152
|
)
|
|
@@ -257,7 +257,7 @@ export const CometChatThreadedMessages = (
|
|
|
257
257
|
titleStyle={({
|
|
258
258
|
...theme.typography.heading,
|
|
259
259
|
color: theme.palette.getAccent(),
|
|
260
|
-
...threadedMessagesStyle
|
|
260
|
+
...threadedMessagesStyle?.titleStyle
|
|
261
261
|
}) as TextStyle
|
|
262
262
|
}
|
|
263
263
|
closeIconTint={
|
|
@@ -304,6 +304,7 @@ export const CometChatThreadedMessages = (
|
|
|
304
304
|
user={user}
|
|
305
305
|
group={group}
|
|
306
306
|
onError={onError && onError}
|
|
307
|
+
hideActionSheetHeader={true}
|
|
307
308
|
{...(messageListConfiguration ? messageListConfiguration : {})}
|
|
308
309
|
/>
|
|
309
310
|
)}
|
|
@@ -4,12 +4,16 @@ import React, { useRef, useEffect, useImperativeHandle } from 'react';
|
|
|
4
4
|
//@ts-ignore
|
|
5
5
|
import { CometChat } from '@cometchat/chat-sdk-react-native';
|
|
6
6
|
import {
|
|
7
|
+
BorderStyle,
|
|
8
|
+
CometChatContext,
|
|
9
|
+
CometChatContextType,
|
|
7
10
|
CometChatList,
|
|
8
11
|
CometChatListActionsInterface,
|
|
9
12
|
CometChatListProps,
|
|
10
13
|
CometChatListStylesInterface,
|
|
11
14
|
CometChatOptions,
|
|
12
15
|
} from '../shared';
|
|
16
|
+
import {UsersStyle, UsersStyleInterface} from './UsersStyle'
|
|
13
17
|
import { CometChatUIEventHandler } from '../shared/events/CometChatUIEventHandler/CometChatUIEventHandler';
|
|
14
18
|
|
|
15
19
|
export interface CometChatUsersInterface
|
|
@@ -61,10 +65,10 @@ export interface CometChatUsersInterface
|
|
|
61
65
|
usersRequestBuilder?: CometChat.UsersRequestBuilder;
|
|
62
66
|
/**
|
|
63
67
|
*
|
|
64
|
-
* @type {
|
|
68
|
+
* @type {UsersStyleInterface}
|
|
65
69
|
* pass custom styling for user
|
|
66
70
|
*/
|
|
67
|
-
usersStyle?:
|
|
71
|
+
usersStyle?: UsersStyleInterface;
|
|
68
72
|
/**
|
|
69
73
|
*
|
|
70
74
|
* Function which have user object as prop and takes a to render in place of subtitle view in list item
|
|
@@ -103,18 +107,43 @@ export const CometChatUsers = React.forwardRef<
|
|
|
103
107
|
const ccUserUnBlockedId = 'ccUserBlocked_' + new Date().getTime();
|
|
104
108
|
|
|
105
109
|
const { usersRequestBuilder, usersStyle, ...newProps } = props;
|
|
110
|
+
|
|
111
|
+
//context values
|
|
112
|
+
const { theme } = React.useContext<CometChatContextType>(CometChatContext);
|
|
113
|
+
|
|
106
114
|
const userRef = useRef<CometChatUsersActionsInterface>(null);
|
|
115
|
+
|
|
116
|
+
const _usersStyle = new UsersStyle({
|
|
117
|
+
backgroundColor: theme?.palette.getBackgroundColor(),
|
|
118
|
+
backIconTint: theme?.palette.getPrimary(),
|
|
119
|
+
emptyTextColor: theme?.palette.getAccent400(),
|
|
120
|
+
emptyTextFont: theme?.typography.caption2,
|
|
121
|
+
errorTextColor: theme?.palette.getError(),
|
|
122
|
+
errorTextFont: theme?.typography.subtitle1,
|
|
123
|
+
searchBackgroundColor: theme?.palette.getAccent600(),
|
|
124
|
+
searchBorder: new BorderStyle({
|
|
125
|
+
borderColor: theme?.palette.getAccent700(),
|
|
126
|
+
...usersStyle?.border,
|
|
127
|
+
}),
|
|
128
|
+
separatorColor: theme?.palette.getAccent100(),
|
|
129
|
+
subtitleTextColor: theme?.palette.getAccent600(),
|
|
130
|
+
subtitleTextFont: theme?.typography.text1,
|
|
131
|
+
titleColor: theme?.palette.getAccent(),
|
|
132
|
+
titleFont: theme?.typography.title1,
|
|
133
|
+
loadingIconTint: theme?.palette.getPrimary(),
|
|
134
|
+
...usersStyle
|
|
135
|
+
});
|
|
107
136
|
|
|
108
137
|
useImperativeHandle(ref, () => {
|
|
109
138
|
return {
|
|
110
|
-
updateList: userRef.current
|
|
111
|
-
addItemToList: userRef.current
|
|
112
|
-
removeItemFromList: userRef.current
|
|
113
|
-
getListItem: userRef.current
|
|
114
|
-
updateAndMoveToFirst: userRef.current
|
|
115
|
-
getSelectedItems: userRef.current
|
|
116
|
-
getAllListItems: userRef.current
|
|
117
|
-
clearSelection: userRef.current
|
|
139
|
+
updateList: userRef.current!.updateList,
|
|
140
|
+
addItemToList: userRef.current!.addItemToList,
|
|
141
|
+
removeItemFromList: userRef.current!.removeItemFromList,
|
|
142
|
+
getListItem: userRef.current!.getListItem,
|
|
143
|
+
updateAndMoveToFirst: userRef.current!.updateAndMoveToFirst,
|
|
144
|
+
getSelectedItems: userRef.current!.getSelectedItems,
|
|
145
|
+
getAllListItems: userRef.current!.getAllListItems,
|
|
146
|
+
clearSelection: userRef.current!.clearSelection
|
|
118
147
|
};
|
|
119
148
|
});
|
|
120
149
|
|
|
@@ -166,7 +195,7 @@ export const CometChatUsers = React.forwardRef<
|
|
|
166
195
|
ref={userRef}
|
|
167
196
|
title={'Users'}
|
|
168
197
|
requestBuilder={usersRequestBuilder}
|
|
169
|
-
listStyle={
|
|
198
|
+
listStyle={{ ..._usersStyle, background: _usersStyle.backgroundColor }}
|
|
170
199
|
{...newProps as CometChatListProps}
|
|
171
200
|
listItemKey="uid"
|
|
172
201
|
/>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ListRenderItem, StyleProp, ViewStyle } from 'react-native';
|
|
2
2
|
import {
|
|
3
3
|
AvatarStyleInterface,
|
|
4
|
-
CometChatListStylesInterface,
|
|
5
4
|
CometChatOptions,
|
|
6
5
|
ImageType,
|
|
7
6
|
ListItemStyleInterface,
|
|
@@ -10,6 +9,7 @@ import { StatusIndicatorStyleInterface } from '../shared/views/CometChatStatusIn
|
|
|
10
9
|
import { CometChatUsersInterface } from './CometChatUsers';
|
|
11
10
|
//@ts-ignore
|
|
12
11
|
import { CometChat } from '@cometchat/chat-sdk-react-native';
|
|
12
|
+
import { UsersStyleInterface } from './UsersStyle'
|
|
13
13
|
|
|
14
14
|
export interface UsersConfigurationInterface
|
|
15
15
|
extends Omit<
|
|
@@ -48,7 +48,7 @@ export class UsersConfiguration {
|
|
|
48
48
|
TailView?: (item: CometChat.User) => JSX.Element;
|
|
49
49
|
tailViewContainerStyle?: StyleProp<ViewStyle>;
|
|
50
50
|
usersRequestBuilder?: CometChat.UsersRequestBuilder;
|
|
51
|
-
usersStyle?:
|
|
51
|
+
usersStyle?: UsersStyleInterface;
|
|
52
52
|
constructor(props: UsersConfigurationInterface) {
|
|
53
53
|
if (props)
|
|
54
54
|
for (const [key, value] of Object.entries(props)) {
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { BaseStyle, BaseStyleInterface, BorderStyle, BorderStyleInterface, FontStyle, FontStyleInterface, ImageType } from "../shared";
|
|
2
|
+
import { localize } from "../shared";
|
|
3
|
+
|
|
4
|
+
export interface UsersStyleInterface extends BaseStyleInterface {
|
|
5
|
+
titleFont?: FontStyleInterface;
|
|
6
|
+
titleColor?: string;
|
|
7
|
+
backIconTint?: string;
|
|
8
|
+
searchBorder?: BorderStyleInterface;
|
|
9
|
+
searchBorderRadius?: number;
|
|
10
|
+
searchBackgroundColor?: string;
|
|
11
|
+
searchTextFont?: FontStyleInterface;
|
|
12
|
+
searchTextColor?: string;
|
|
13
|
+
searchIconTint?: string;
|
|
14
|
+
searchPlaceHolderTextColor?: string
|
|
15
|
+
separatorColor?: string;
|
|
16
|
+
loadingIconTint?: string;
|
|
17
|
+
emptyTextColor?: string;
|
|
18
|
+
emptyTextFont?: FontStyleInterface;
|
|
19
|
+
errorTextColor?: string;
|
|
20
|
+
errorTextFont?: FontStyleInterface;
|
|
21
|
+
subtitleTextColor?: string;
|
|
22
|
+
subtitleTextFont?: FontStyleInterface;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @class UsersStyle
|
|
27
|
+
* @description UsersStyle class is used for defining the UsersStyle template.
|
|
28
|
+
*/
|
|
29
|
+
export class UsersStyle extends BaseStyle {
|
|
30
|
+
titleFont: FontStyleInterface;
|
|
31
|
+
titleColor: string;
|
|
32
|
+
backIconTint: string;
|
|
33
|
+
searchBorder: BorderStyleInterface;
|
|
34
|
+
searchBorderRadius: number;
|
|
35
|
+
searchBackgroundColor: string;
|
|
36
|
+
searchTextFont: FontStyleInterface;
|
|
37
|
+
searchTextColor: string;
|
|
38
|
+
searchIconTint: string;
|
|
39
|
+
searchPlaceHolderTextColor: string;
|
|
40
|
+
separatorColor: string;
|
|
41
|
+
loadingIconTint: string;
|
|
42
|
+
emptyTextColor: string;
|
|
43
|
+
emptyTextFont: FontStyleInterface;
|
|
44
|
+
errorTextColor: string;
|
|
45
|
+
errorTextFont: FontStyleInterface;
|
|
46
|
+
subtitleTextColor: string;
|
|
47
|
+
subtitleTextFont: FontStyleInterface;
|
|
48
|
+
|
|
49
|
+
constructor(props: UsersStyleInterface) {
|
|
50
|
+
const {
|
|
51
|
+
width = "100%",
|
|
52
|
+
height = "100%",
|
|
53
|
+
border = new BorderStyle({ borderWidth: 0 }),
|
|
54
|
+
borderRadius = 0,
|
|
55
|
+
backgroundColor = "white",
|
|
56
|
+
titleFont = new FontStyle({ fontSize: 17 }),
|
|
57
|
+
titleColor = '#141414',
|
|
58
|
+
backIconTint = "black",
|
|
59
|
+
searchBorder = new BorderStyle({}),
|
|
60
|
+
searchBorderRadius = 50,
|
|
61
|
+
searchBackgroundColor = "rgba(20, 20, 20, 0.04)",
|
|
62
|
+
searchTextFont = new FontStyle({ fontSize: 17 }),
|
|
63
|
+
searchTextColor = "rgba(20,20,20,0.58)",
|
|
64
|
+
searchIconTint = "rgba(20,20,20,0.4)",
|
|
65
|
+
searchPlaceHolderTextColor = "rgba(20,20,20,0.58)",
|
|
66
|
+
separatorColor = "rgba(20, 20, 20, 0.1)",
|
|
67
|
+
loadingIconTint = "rgba(20,20,20, 0.7)",
|
|
68
|
+
emptyTextColor = "rgb(255, 59, 48)",
|
|
69
|
+
emptyTextFont = new FontStyle({ fontSize: 20 }),
|
|
70
|
+
errorTextColor = "rgb(255, 59, 48)",
|
|
71
|
+
errorTextFont = new FontStyle({ fontSize: 20 }),
|
|
72
|
+
subtitleTextColor = "rgba(20, 20, 20, 0.58)",
|
|
73
|
+
subtitleTextFont = new FontStyle({ fontSize: 16 }),
|
|
74
|
+
} = props;
|
|
75
|
+
super({
|
|
76
|
+
width,
|
|
77
|
+
height,
|
|
78
|
+
backgroundColor,
|
|
79
|
+
border,
|
|
80
|
+
borderRadius
|
|
81
|
+
});
|
|
82
|
+
this.titleFont = titleFont;
|
|
83
|
+
this.titleColor = titleColor;
|
|
84
|
+
this.backIconTint = backIconTint;
|
|
85
|
+
this.searchBorder = searchBorder;
|
|
86
|
+
this.searchBorderRadius = searchBorderRadius;
|
|
87
|
+
this.searchBackgroundColor = searchBackgroundColor;
|
|
88
|
+
this.searchTextFont = searchTextFont;
|
|
89
|
+
this.searchTextColor = searchTextColor;
|
|
90
|
+
this.searchIconTint = searchIconTint;
|
|
91
|
+
this.searchPlaceHolderTextColor = searchPlaceHolderTextColor;
|
|
92
|
+
this.separatorColor = separatorColor;
|
|
93
|
+
this.loadingIconTint = loadingIconTint;
|
|
94
|
+
this.emptyTextColor = emptyTextColor;
|
|
95
|
+
this.emptyTextFont = emptyTextFont;
|
|
96
|
+
this.errorTextColor = errorTextColor;
|
|
97
|
+
this.errorTextFont = errorTextFont;
|
|
98
|
+
this.subtitleTextColor = subtitleTextColor;
|
|
99
|
+
this.subtitleTextFont = subtitleTextFont;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -4,13 +4,16 @@ import {
|
|
|
4
4
|
CometChatUsersActionsInterface,
|
|
5
5
|
} from "./CometChatUsers";
|
|
6
6
|
|
|
7
|
+
import { UsersStyle, UsersStyleInterface } from "./UsersStyle"
|
|
8
|
+
|
|
7
9
|
import {
|
|
8
10
|
UsersConfiguration,
|
|
9
11
|
UsersConfigurationInterface,
|
|
10
12
|
} from "./UsersConfiguration";
|
|
11
|
-
export { CometChatUsers, UsersConfiguration };
|
|
13
|
+
export { CometChatUsers, UsersStyle, UsersConfiguration };
|
|
12
14
|
export type {
|
|
13
15
|
CometChatUsersInterface,
|
|
14
16
|
CometChatUsersActionsInterface,
|
|
15
17
|
UsersConfigurationInterface,
|
|
18
|
+
UsersStyleInterface
|
|
16
19
|
};
|
|
@@ -31,7 +31,7 @@ export const LinkPreviewBubble = (props: LinkPreviewBubbleInterface) => {
|
|
|
31
31
|
const [imageSource, setImageSource] = useState({ uri: image.startsWith("https:") ? image : `https:${image.split("http:")[1]}` });
|
|
32
32
|
|
|
33
33
|
const callCount = useRef(0);
|
|
34
|
-
const timerId = useRef(null);
|
|
34
|
+
const timerId = useRef<any>(null);
|
|
35
35
|
const threshold = 10;
|
|
36
36
|
const timeframe = 1000;
|
|
37
37
|
|
|
@@ -43,7 +43,7 @@ export const MessageTranslationBubble = (props: MessageTranslationBubble) => {
|
|
|
43
43
|
|
|
44
44
|
useEffect(() => {
|
|
45
45
|
let _formattedText: string = text || '';
|
|
46
|
-
let _formattedTranslatedText: string =
|
|
46
|
+
let _formattedTranslatedText: string = translatedText || '';
|
|
47
47
|
if (textFormatters && textFormatters.length) {
|
|
48
48
|
if (textFormatters) {
|
|
49
49
|
for (let i = 0; i < textFormatters.length; i++) {
|
|
@@ -199,7 +199,7 @@ export class MessageTranslationExtensionDecorator extends DataSourceDecorator {
|
|
|
199
199
|
|
|
200
200
|
let loggedInUser = CometChatUIKit.loggedInUser;
|
|
201
201
|
let mentionedUsers = message.getMentionedUsers();
|
|
202
|
-
let textFormatters = [...(additionalParams?.textFormatters
|
|
202
|
+
let textFormatters = [...(additionalParams?.textFormatters ?? [])];
|
|
203
203
|
|
|
204
204
|
let linksTextFormatter = ChatConfigurator.getDataSource().getUrlsFormatter(loggedInUser as any);
|
|
205
205
|
linksTextFormatter.setMessage(message);
|
|
@@ -45,7 +45,12 @@ export class SmartRepliesDecorator extends DataSourceDecorator {
|
|
|
45
45
|
ccActiveChatChanged: ({message}: any) => {
|
|
46
46
|
if(message && message['sender']?.['uid'] != this.loggedInUser?.getUid())
|
|
47
47
|
this.getReplies(message);
|
|
48
|
-
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
CometChat.addMessageListener(
|
|
52
|
+
Date.now()+"",
|
|
53
|
+
{
|
|
49
54
|
onTextMessageReceived: (textMessage: any) => {
|
|
50
55
|
if(textMessage && textMessage['sender']?.['uid'] != this.loggedInUser?.getUid())
|
|
51
56
|
this.getReplies(textMessage);
|
|
@@ -62,7 +67,7 @@ export class SmartRepliesDecorator extends DataSourceDecorator {
|
|
|
62
67
|
return 'SmartReply';
|
|
63
68
|
}
|
|
64
69
|
|
|
65
|
-
getReplies(message:
|
|
70
|
+
getReplies(message: CometChat.BaseMessage) {
|
|
66
71
|
|
|
67
72
|
let id = CommonUtils.getComponentIdFromMessage(message);
|
|
68
73
|
const smartReplyData = getExtentionData(
|
|
@@ -95,7 +100,7 @@ export class SmartRepliesDecorator extends DataSourceDecorator {
|
|
|
95
100
|
});
|
|
96
101
|
}
|
|
97
102
|
|
|
98
|
-
handleSendMessage = (message:
|
|
103
|
+
handleSendMessage = (message: CometChat.BaseMessage, smartReply: any) => {
|
|
99
104
|
let chatWithId = '';
|
|
100
105
|
let id = CommonUtils.getComponentIdFromMessage(message)
|
|
101
106
|
let chatWith;
|
|
@@ -103,11 +108,11 @@ export class SmartRepliesDecorator extends DataSourceDecorator {
|
|
|
103
108
|
return;
|
|
104
109
|
}
|
|
105
110
|
if (typeof message !== 'object') return;
|
|
106
|
-
if (message?.
|
|
107
|
-
chatWithId = message?.
|
|
111
|
+
if (message?.getReceiverType() === ReceiverTypeConstants.user) {
|
|
112
|
+
chatWithId = message?.getSender()?.getUid();
|
|
108
113
|
chatWith = ReceiverTypeConstants.user;
|
|
109
114
|
} else {
|
|
110
|
-
chatWithId = message?.
|
|
115
|
+
chatWithId = message?.getReceiverId();
|
|
111
116
|
chatWith = ReceiverTypeConstants.group;
|
|
112
117
|
}
|
|
113
118
|
let textMessage = new CometChat.TextMessage(
|
package/src/index.ts
CHANGED
|
@@ -183,6 +183,8 @@ import {
|
|
|
183
183
|
CometChatUsers,
|
|
184
184
|
CometChatUsersActionsInterface,
|
|
185
185
|
CometChatUsersInterface,
|
|
186
|
+
UsersStyle,
|
|
187
|
+
UsersStyleInterface,
|
|
186
188
|
UsersConfigurationInterface,
|
|
187
189
|
} from "./CometChatUsers";
|
|
188
190
|
|
|
@@ -266,7 +268,8 @@ import {
|
|
|
266
268
|
import {
|
|
267
269
|
CometChatMessageInformation,
|
|
268
270
|
CometChatMessageInformationInterface,
|
|
269
|
-
|
|
271
|
+
CometChatMessageInformationConfigurationInterface,
|
|
272
|
+
CometChatMessageInformationConfiguration,
|
|
270
273
|
MessageInformationStyleInterface,
|
|
271
274
|
} from "./CometChatMessageInformation";
|
|
272
275
|
|
|
@@ -465,6 +468,7 @@ export {
|
|
|
465
468
|
CometChatMessageComposer,
|
|
466
469
|
CometChatDetails,
|
|
467
470
|
CometChatUsers,
|
|
471
|
+
UsersStyle,
|
|
468
472
|
CometChatAddMembers,
|
|
469
473
|
CometChatBannedMembers,
|
|
470
474
|
//
|
|
@@ -577,6 +581,7 @@ export {
|
|
|
577
581
|
/* Text Formatters */
|
|
578
582
|
DateTimeElement,
|
|
579
583
|
CometChatDateTimePicker,
|
|
584
|
+
CometChatMessageInformationConfiguration
|
|
580
585
|
};
|
|
581
586
|
export type {
|
|
582
587
|
ThumbnailGenerationConfigurationInterface,
|
|
@@ -635,6 +640,7 @@ export type {
|
|
|
635
640
|
CometChatUsersActionsInterface,
|
|
636
641
|
CometChatUsersInterface,
|
|
637
642
|
UsersConfigurationInterface,
|
|
643
|
+
UsersStyleInterface,
|
|
638
644
|
BannedMembersConfigurationInterface,
|
|
639
645
|
CometChatBannedMembersInterface,
|
|
640
646
|
AddMembersConfigurationInterface,
|
|
@@ -714,7 +720,6 @@ export type {
|
|
|
714
720
|
ContactsStyleInterface,
|
|
715
721
|
StartConversationConfigurationInterface,
|
|
716
722
|
CometChatMessageInformationInterface,
|
|
717
|
-
MessageInformationConfigurationInterface,
|
|
718
723
|
MessageInformationStyleInterface,
|
|
719
724
|
CometChatFormBubbleInterface,
|
|
720
725
|
CometChatCardBubbleInterface,
|
|
@@ -748,6 +753,7 @@ export type {
|
|
|
748
753
|
SuggestionListConfigurationInterface,
|
|
749
754
|
CometChatDateTimePickerInterface,
|
|
750
755
|
DatePickerStyleInterface,
|
|
756
|
+
CometChatMessageInformationConfigurationInterface,
|
|
751
757
|
};
|
|
752
758
|
|
|
753
759
|
// AI
|
|
@@ -108,85 +108,85 @@ export class CometChatUIEventHandler {
|
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
static emitMessageEvent(name: string, param: object) {
|
|
111
|
-
CometChatUIEventHandler.messageHandlers
|
|
111
|
+
CometChatUIEventHandler.messageHandlers?.map((listener) => {
|
|
112
112
|
switch (name) {
|
|
113
|
-
case listener._eventListener
|
|
114
|
-
listener._eventListener
|
|
113
|
+
case listener._eventListener?.ccMessageLiveReaction?.name:
|
|
114
|
+
listener._eventListener?.ccMessageLiveReaction?.(param);
|
|
115
115
|
break;
|
|
116
|
-
case listener._eventListener
|
|
117
|
-
listener._eventListener
|
|
116
|
+
case listener._eventListener?.ccMessageDeleted?.name:
|
|
117
|
+
listener._eventListener?.ccMessageDeleted?.(param);
|
|
118
118
|
break;
|
|
119
|
-
case listener._eventListener
|
|
120
|
-
listener._eventListener
|
|
119
|
+
case listener._eventListener?.ccMessageEdited?.name:
|
|
120
|
+
listener._eventListener?.ccMessageEdited?.(param);
|
|
121
121
|
break;
|
|
122
|
-
case listener._eventListener
|
|
123
|
-
listener._eventListener
|
|
122
|
+
case listener._eventListener?.ccMessageRead?.name:
|
|
123
|
+
listener._eventListener?.ccMessageRead?.(param);
|
|
124
124
|
break;
|
|
125
|
-
case listener._eventListener
|
|
126
|
-
listener._eventListener
|
|
125
|
+
case listener._eventListener?.ccMessageSent?.name:
|
|
126
|
+
listener._eventListener?.ccMessageSent?.(param);
|
|
127
127
|
break;
|
|
128
|
-
case listener._eventListener
|
|
129
|
-
listener._eventListener
|
|
128
|
+
case listener._eventListener?.ccMessageDelivered?.name:
|
|
129
|
+
listener._eventListener?.ccMessageSent?.(param);
|
|
130
130
|
break;
|
|
131
|
-
case listener._eventListener
|
|
132
|
-
listener._eventListener
|
|
131
|
+
case listener._eventListener?.ccActiveChatChanged?.name:
|
|
132
|
+
listener._eventListener?.ccActiveChatChanged?.(param);
|
|
133
133
|
break;
|
|
134
|
-
case listener._eventListener
|
|
135
|
-
listener._eventListener
|
|
134
|
+
case listener._eventListener?.onTextMessageReceived?.name:
|
|
135
|
+
listener._eventListener?.onTextMessageReceived?.(param);
|
|
136
136
|
break;
|
|
137
|
-
case listener._eventListener
|
|
138
|
-
listener._eventListener
|
|
137
|
+
case listener._eventListener?.onMediaMessageReceived?.name:
|
|
138
|
+
listener._eventListener?.onMediaMessageReceived?.(param);
|
|
139
139
|
break;
|
|
140
|
-
case listener._eventListener
|
|
141
|
-
listener._eventListener
|
|
140
|
+
case listener._eventListener?.onCustomMessageReceived?.name:
|
|
141
|
+
listener._eventListener?.onCustomMessageReceived?.(param);
|
|
142
142
|
break;
|
|
143
|
-
case listener._eventListener
|
|
144
|
-
listener._eventListener
|
|
143
|
+
case listener._eventListener?.onTypingStarted?.name:
|
|
144
|
+
listener._eventListener?.onTypingStarted?.(param);
|
|
145
145
|
break;
|
|
146
|
-
case listener._eventListener
|
|
147
|
-
listener._eventListener
|
|
146
|
+
case listener._eventListener?.onTypingEnded?.name:
|
|
147
|
+
listener._eventListener?.onTypingEnded?.(param);
|
|
148
148
|
break;
|
|
149
|
-
case listener._eventListener
|
|
150
|
-
listener._eventListener
|
|
149
|
+
case listener._eventListener?.onMessagesDelivered?.name:
|
|
150
|
+
listener._eventListener?.onMessagesDelivered?.(param);
|
|
151
151
|
break;
|
|
152
|
-
case listener._eventListener
|
|
153
|
-
listener._eventListener
|
|
152
|
+
case listener._eventListener?.onMessagesRead?.name:
|
|
153
|
+
listener._eventListener?.onMessagesRead?.(param);
|
|
154
154
|
break;
|
|
155
|
-
case listener._eventListener
|
|
156
|
-
listener._eventListener
|
|
155
|
+
case listener._eventListener?.onMessageEdited?.name:
|
|
156
|
+
listener._eventListener?.onMessageEdited?.(param);
|
|
157
157
|
break;
|
|
158
|
-
case listener._eventListener
|
|
159
|
-
listener._eventListener
|
|
158
|
+
case listener._eventListener?.onMessageDeleted?.name:
|
|
159
|
+
listener._eventListener?.onMessageDeleted?.(param);
|
|
160
160
|
break;
|
|
161
|
-
case listener._eventListener
|
|
162
|
-
listener._eventListener
|
|
161
|
+
case listener._eventListener?.onTransientMessageReceived?.name:
|
|
162
|
+
listener._eventListener?.onTransientMessageReceived?.(param);
|
|
163
163
|
break;
|
|
164
|
-
case listener._eventListener
|
|
165
|
-
listener._eventListener
|
|
164
|
+
case listener._eventListener?.onFormMessageReceived?.name:
|
|
165
|
+
listener._eventListener?.onFormMessageReceived?.(param);
|
|
166
166
|
break;
|
|
167
|
-
case listener._eventListener
|
|
168
|
-
listener._eventListener
|
|
167
|
+
case listener._eventListener?.onCardMessageReceived?.name:
|
|
168
|
+
listener._eventListener?.onCardMessageReceived?.(param);
|
|
169
169
|
break;
|
|
170
|
-
case listener._eventListener
|
|
171
|
-
listener._eventListener
|
|
170
|
+
case listener._eventListener?.onSchedulerMessageReceived?.name:
|
|
171
|
+
listener._eventListener?.onSchedulerMessageReceived?.(param);
|
|
172
172
|
break;
|
|
173
|
-
case listener._eventListener
|
|
174
|
-
listener._eventListener
|
|
173
|
+
case listener._eventListener?.onCustomInteractiveMessageReceived?.name:
|
|
174
|
+
listener._eventListener?.onCustomInteractiveMessageReceived?.(param);
|
|
175
175
|
break;
|
|
176
|
-
case listener._eventListener
|
|
177
|
-
listener._eventListener
|
|
176
|
+
case listener._eventListener?.onInteractionGoalCompleted?.name:
|
|
177
|
+
listener._eventListener?.onInteractionGoalCompleted?.(param);
|
|
178
178
|
break;
|
|
179
|
-
case listener._eventListener
|
|
180
|
-
listener._eventListener
|
|
179
|
+
case listener._eventListener?.onMessageReactionRemoved?.name:
|
|
180
|
+
listener._eventListener?.onMessageReactionRemoved?.(param);
|
|
181
181
|
break;
|
|
182
|
-
case listener._eventListener
|
|
183
|
-
listener._eventListener
|
|
182
|
+
case listener._eventListener?.onMessageReactionAdded?.name:
|
|
183
|
+
listener._eventListener?.onMessageReactionAdded?.(param);
|
|
184
184
|
break;
|
|
185
|
-
case listener._eventListener
|
|
186
|
-
listener._eventListener
|
|
185
|
+
case listener._eventListener?.onMessagesDeliveredToAll?.name:
|
|
186
|
+
listener._eventListener?.onMessagesDeliveredToAll?.(param);
|
|
187
187
|
break;
|
|
188
|
-
case listener._eventListener
|
|
189
|
-
listener._eventListener
|
|
188
|
+
case listener._eventListener?.onMessagesReadByAll?.name:
|
|
189
|
+
listener._eventListener?.onMessagesReadByAll?.(param);
|
|
190
190
|
break;
|
|
191
191
|
}
|
|
192
192
|
});
|