@cometchat/chat-uikit-react-native 4.3.19 → 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.
Files changed (51) hide show
  1. package/android/.gradle/7.4/checksums/checksums.lock +0 -0
  2. package/android/.gradle/7.4/dependencies-accessors/dependencies-accessors.lock +0 -0
  3. package/android/.gradle/7.4/dependencies-accessors/gc.properties +0 -0
  4. package/android/.gradle/7.4/executionHistory/executionHistory.lock +0 -0
  5. package/android/.gradle/7.4/fileChanges/last-build.bin +0 -0
  6. package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
  7. package/android/.gradle/7.4/gc.properties +0 -0
  8. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  9. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  10. package/android/.gradle/vcs-1/gc.properties +0 -0
  11. package/android/src/main/AndroidManifest.xml +6 -0
  12. package/package.json +1 -1
  13. package/src/CometChatConversations/CometChatConversations.tsx +19 -25
  14. package/src/CometChatGroups/CometChatGroups.tsx +2 -2
  15. package/src/CometChatGroups/GroupsConfiguration.ts +13 -16
  16. package/src/CometChatGroups/resources/index.ts +0 -3
  17. package/src/CometChatMessageComposer/CometChatMessageComposer.tsx +6 -2
  18. package/src/CometChatMessageInformation/MessageInformationConfiguration.tsx +31 -12
  19. package/src/CometChatMessageInformation/index.ts +6 -3
  20. package/src/CometChatMessageList/CometChatMessageList.tsx +24 -9
  21. package/src/CometChatMessageList/MessageListConfiguration.ts +21 -0
  22. package/src/CometChatTabs/CometChatTabs.tsx +8 -8
  23. package/src/CometChatThreadedMessages/CometChatThreadedMessages.tsx +2 -1
  24. package/src/CometChatUsers/CometChatUsers.tsx +40 -11
  25. package/src/CometChatUsers/UsersConfiguration.tsx +2 -2
  26. package/src/CometChatUsers/UsersStyle.ts +101 -0
  27. package/src/CometChatUsers/index.ts +4 -1
  28. package/src/extensions/LinkPreview/LinkPreviewBubble.tsx +1 -1
  29. package/src/extensions/MessageTranslation/MessageTranslationDecorator.tsx +1 -1
  30. package/src/extensions/SmartReplies/SmartRepliesDecorator.tsx +11 -6
  31. package/src/index.ts +8 -2
  32. package/src/shared/events/CometChatUIEventHandler/CometChatUIEventHandler.ts +53 -53
  33. package/src/shared/framework/MessageDataSource.tsx +1 -1
  34. package/src/shared/libs/ImageZoom/ReactNativeZoomableView.tsx +1 -0
  35. package/src/shared/libs/ImageZoom/ReactNativeZoomableViewWithGestures.tsx +1 -1
  36. package/src/shared/libs/VideoPlayerControls/components/Control.tsx +1 -1
  37. package/src/shared/libs/VideoPlayerControls/components/PlayPause/PlayPause.tsx +1 -1
  38. package/src/shared/libs/luxon/src/impl/zoneUtil.js +0 -4
  39. package/src/shared/utils/CommonUtils.ts +15 -15
  40. package/src/shared/utils/InteractiveMessageUtils.ts +1 -1
  41. package/src/shared/views/CometChatActionSheet/ActionSheetStyle.ts +10 -12
  42. package/src/shared/views/CometChatAudioBubble/CometChatAudioBubble.tsx +1 -1
  43. package/src/shared/views/CometChatFileBubble/CometChatFileBubble.tsx +2 -2
  44. package/src/shared/views/CometChatFormBubble/CometChatFormBubble.tsx +1 -1
  45. package/src/shared/views/CometChatImageBubble/CometChatImageBubble.tsx +3 -3
  46. package/src/shared/views/CometChatImageBubble/assets/index.ts +1 -0
  47. package/src/shared/views/CometChatMessageBubble/MessageBubbleStyle.ts +2 -2
  48. package/src/shared/views/CometChatReactionList/CometChatReactionList.tsx +0 -1
  49. package/src/shared/views/CometChatSchedulerBubble/CometChatSchedulerBubble.tsx +5 -5
  50. package/src/shared/views/CometChatVideoBubble/CometChatVideoBubble.tsx +1 -1
  51. package/src/CometChatGroups/resources/search.png +0 -0
@@ -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?: CometChatListStylesInterface;
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
 
@@ -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: any) {
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: any, smartReply: any) => {
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?.receiverType === ReceiverTypeConstants.user) {
107
- chatWithId = message?.sender?.uid;
111
+ if (message?.getReceiverType() === ReceiverTypeConstants.user) {
112
+ chatWithId = message?.getSender()?.getUid();
108
113
  chatWith = ReceiverTypeConstants.user;
109
114
  } else {
110
- chatWithId = message?.receiverId;
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
- MessageInformationConfigurationInterface,
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.map((listener) => {
111
+ CometChatUIEventHandler.messageHandlers?.map((listener) => {
112
112
  switch (name) {
113
- case listener._eventListener.ccMessageLiveReaction?.name:
114
- listener._eventListener.ccMessageLiveReaction(param);
113
+ case listener._eventListener?.ccMessageLiveReaction?.name:
114
+ listener._eventListener?.ccMessageLiveReaction?.(param);
115
115
  break;
116
- case listener._eventListener.ccMessageDeleted?.name:
117
- listener._eventListener.ccMessageDeleted(param);
116
+ case listener._eventListener?.ccMessageDeleted?.name:
117
+ listener._eventListener?.ccMessageDeleted?.(param);
118
118
  break;
119
- case listener._eventListener.ccMessageEdited?.name:
120
- listener._eventListener.ccMessageEdited(param);
119
+ case listener._eventListener?.ccMessageEdited?.name:
120
+ listener._eventListener?.ccMessageEdited?.(param);
121
121
  break;
122
- case listener._eventListener.ccMessageRead?.name:
123
- listener._eventListener.ccMessageRead(param);
122
+ case listener._eventListener?.ccMessageRead?.name:
123
+ listener._eventListener?.ccMessageRead?.(param);
124
124
  break;
125
- case listener._eventListener.ccMessageSent?.name:
126
- listener._eventListener.ccMessageSent(param);
125
+ case listener._eventListener?.ccMessageSent?.name:
126
+ listener._eventListener?.ccMessageSent?.(param);
127
127
  break;
128
- case listener._eventListener.ccMessageDelivered?.name:
129
- listener._eventListener.ccMessageSent(param);
128
+ case listener._eventListener?.ccMessageDelivered?.name:
129
+ listener._eventListener?.ccMessageSent?.(param);
130
130
  break;
131
- case listener._eventListener.ccActiveChatChanged?.name:
132
- listener._eventListener.ccActiveChatChanged(param);
131
+ case listener._eventListener?.ccActiveChatChanged?.name:
132
+ listener._eventListener?.ccActiveChatChanged?.(param);
133
133
  break;
134
- case listener._eventListener.onTextMessageReceived?.name:
135
- listener._eventListener.onTextMessageReceived(param);
134
+ case listener._eventListener?.onTextMessageReceived?.name:
135
+ listener._eventListener?.onTextMessageReceived?.(param);
136
136
  break;
137
- case listener._eventListener.onMediaMessageReceived?.name:
138
- listener._eventListener.onMediaMessageReceived(param);
137
+ case listener._eventListener?.onMediaMessageReceived?.name:
138
+ listener._eventListener?.onMediaMessageReceived?.(param);
139
139
  break;
140
- case listener._eventListener.onCustomMessageReceived?.name:
141
- listener._eventListener.onCustomMessageReceived(param);
140
+ case listener._eventListener?.onCustomMessageReceived?.name:
141
+ listener._eventListener?.onCustomMessageReceived?.(param);
142
142
  break;
143
- case listener._eventListener.onTypingStarted?.name:
144
- listener._eventListener.onTypingStarted(param);
143
+ case listener._eventListener?.onTypingStarted?.name:
144
+ listener._eventListener?.onTypingStarted?.(param);
145
145
  break;
146
- case listener._eventListener.onTypingEnded?.name:
147
- listener._eventListener.onTypingEnded(param);
146
+ case listener._eventListener?.onTypingEnded?.name:
147
+ listener._eventListener?.onTypingEnded?.(param);
148
148
  break;
149
- case listener._eventListener.onMessagesDelivered?.name:
150
- listener._eventListener.onMessagesDelivered(param);
149
+ case listener._eventListener?.onMessagesDelivered?.name:
150
+ listener._eventListener?.onMessagesDelivered?.(param);
151
151
  break;
152
- case listener._eventListener.onMessagesRead?.name:
153
- listener._eventListener.onMessagesRead(param);
152
+ case listener._eventListener?.onMessagesRead?.name:
153
+ listener._eventListener?.onMessagesRead?.(param);
154
154
  break;
155
- case listener._eventListener.onMessageEdited?.name:
156
- listener._eventListener.onMessageEdited(param);
155
+ case listener._eventListener?.onMessageEdited?.name:
156
+ listener._eventListener?.onMessageEdited?.(param);
157
157
  break;
158
- case listener._eventListener.onMessageDeleted?.name:
159
- listener._eventListener.onMessageDeleted(param);
158
+ case listener._eventListener?.onMessageDeleted?.name:
159
+ listener._eventListener?.onMessageDeleted?.(param);
160
160
  break;
161
- case listener._eventListener.onTransientMessageReceived?.name:
162
- listener._eventListener.onTransientMessageReceived(param);
161
+ case listener._eventListener?.onTransientMessageReceived?.name:
162
+ listener._eventListener?.onTransientMessageReceived?.(param);
163
163
  break;
164
- case listener._eventListener.onFormMessageReceived?.name:
165
- listener._eventListener.onFormMessageReceived(param);
164
+ case listener._eventListener?.onFormMessageReceived?.name:
165
+ listener._eventListener?.onFormMessageReceived?.(param);
166
166
  break;
167
- case listener._eventListener.onCardMessageReceived?.name:
168
- listener._eventListener.onCardMessageReceived(param);
167
+ case listener._eventListener?.onCardMessageReceived?.name:
168
+ listener._eventListener?.onCardMessageReceived?.(param);
169
169
  break;
170
- case listener._eventListener.onSchedulerMessageReceived?.name:
171
- listener._eventListener.onSchedulerMessageReceived(param);
170
+ case listener._eventListener?.onSchedulerMessageReceived?.name:
171
+ listener._eventListener?.onSchedulerMessageReceived?.(param);
172
172
  break;
173
- case listener._eventListener.onCustomInteractiveMessageReceived?.name:
174
- listener._eventListener.onCustomInteractiveMessageReceived(param);
173
+ case listener._eventListener?.onCustomInteractiveMessageReceived?.name:
174
+ listener._eventListener?.onCustomInteractiveMessageReceived?.(param);
175
175
  break;
176
- case listener._eventListener.onInteractionGoalCompleted?.name:
177
- listener._eventListener.onInteractionGoalCompleted(param);
176
+ case listener._eventListener?.onInteractionGoalCompleted?.name:
177
+ listener._eventListener?.onInteractionGoalCompleted?.(param);
178
178
  break;
179
- case listener._eventListener.onMessageReactionRemoved?.name:
180
- listener._eventListener.onMessageReactionRemoved(param);
179
+ case listener._eventListener?.onMessageReactionRemoved?.name:
180
+ listener._eventListener?.onMessageReactionRemoved?.(param);
181
181
  break;
182
- case listener._eventListener.onMessageReactionAdded?.name:
183
- listener._eventListener.onMessageReactionAdded(param);
182
+ case listener._eventListener?.onMessageReactionAdded?.name:
183
+ listener._eventListener?.onMessageReactionAdded?.(param);
184
184
  break;
185
- case listener._eventListener.onMessagesDeliveredToAll?.name:
186
- listener._eventListener.onMessagesDeliveredToAll(param);
185
+ case listener._eventListener?.onMessagesDeliveredToAll?.name:
186
+ listener._eventListener?.onMessagesDeliveredToAll?.(param);
187
187
  break;
188
- case listener._eventListener.onMessagesReadByAll?.name:
189
- listener._eventListener.onMessagesReadByAll(param);
188
+ case listener._eventListener?.onMessagesReadByAll?.name:
189
+ listener._eventListener?.onMessagesReadByAll?.(param);
190
190
  break;
191
191
  }
192
192
  });
@@ -393,7 +393,7 @@ export class MessageDataSource implements DataSource {
393
393
  let loggedInUser = CometChatUIKit.loggedInUser;
394
394
  if(loggedInUser) {
395
395
  let mentionedUsers = message.getMentionedUsers();
396
- let textFormatters = [...(additionalParams?.textFormatters || [])] || [];
396
+ let textFormatters = [...(additionalParams?.textFormatters ?? [])];
397
397
 
398
398
  let linksTextFormatter = ChatConfigurator.getDataSource().getUrlsFormatter(loggedInUser);
399
399
  linksTextFormatter.setMessage(message);
@@ -556,6 +556,7 @@ class ReactNativeZoomableView extends Component<
556
556
  this._handleShifting(gestureState);
557
557
  }
558
558
  }
559
+ return false;
559
560
  };
560
561
 
561
562
  /**
@@ -134,7 +134,7 @@ class ReactNativeZoomableViewWithGestures extends React.Component<
134
134
  const { dx, dy } = gestureState;
135
135
 
136
136
  if (!swipeLengthThreshold) {
137
- return;
137
+ return null;
138
138
  }
139
139
 
140
140
  if (this._isValidHorizontalSwipe(gestureState)) {
@@ -5,7 +5,7 @@ import {styles} from './styles';
5
5
  interface ControlProps extends ViewProps {
6
6
  children: ReactNode;
7
7
  callback?: () => void;
8
- controlRef?: RefObject<TouchableHighlight>;
8
+ controlRef?: RefObject<any>;
9
9
  disabled?: boolean;
10
10
  style?: any;
11
11
  resetControlTimeout?: () => void;
@@ -5,7 +5,7 @@ import {NullControl} from '../NullControl';
5
5
  import type {VideoAnimations} from '../../types';
6
6
  import {styles} from './styles';
7
7
 
8
- export const playPauseRef = createRef<TouchableHighlight>();
8
+ export const playPauseRef = createRef<any>();
9
9
 
10
10
  interface PlayPauseProps {
11
11
  animations: VideoAnimations;
@@ -1,7 +1,3 @@
1
- /**
2
- * @private
3
- */
4
-
5
1
  import Zone from "../zone.js";
6
2
  import IANAZone from "../zones/IANAZone.js";
7
3
  import FixedOffsetZone from "../zones/fixedOffsetZone.js";
@@ -65,7 +65,7 @@ export class CommonUtils {
65
65
  static mergeArrays(arr1: Array<object>, arr2: Array<object>, key: string) {
66
66
  let map = new Map();
67
67
 
68
- arr1.forEach(obj => {
68
+ arr1.forEach((obj: any) => {
69
69
  if(!obj[key]) {
70
70
  map.set("" + Date.now() + Math.random(), obj);
71
71
  return;
@@ -73,7 +73,7 @@ export class CommonUtils {
73
73
  map.set(obj[key], obj);
74
74
  });
75
75
 
76
- arr2.forEach(obj => {
76
+ arr2.forEach((obj: any) => {
77
77
  if (map.has(obj[key]) && obj[key]) {
78
78
  let mergedObj = this.mergeObjects(map.get(obj[key]), obj);
79
79
  map.set(obj[key], mergedObj);
@@ -89,24 +89,24 @@ export class CommonUtils {
89
89
  return Array.from(map.values());
90
90
  }
91
91
 
92
- static getComponentIdFromMessage(message: CometChat.BaseMessage): Object {
93
- let id = {};
94
- if (message.receiver instanceof CometChat.User) {
95
- id['uid'] = (message.sender as CometChat.User).uid;
96
- } else if (message.receiver instanceof CometChat.Group) {
97
- id['guid'] = (message.receiver as CometChat.Group).guid;
92
+ static getComponentIdFromMessage(message : CometChat.BaseMessage):Object{
93
+ let id: anyObject = {};
94
+ if (message.getReceiver() instanceof CometChat.User) {
95
+ id['uid'] = (message.getSender() as any).uid;
96
+ } else if (message.getReceiver() instanceof CometChat.Group) {
97
+ id['guid'] = (message.getReceiver() as any).guid;
98
98
  }
99
- if (message.parentMessageId && message.parentMessageId !== 0) {
100
- id['parentMessageId'] = message.parentMessageId;
99
+ if (message.getParentMessageId() && message.getParentMessageId() !== 0) {
100
+ id['parentMessageId'] = message.getParentMessageId();
101
101
  }
102
102
  return id;
103
103
  }
104
104
 
105
- static checkIdBelongsToThisComponent(id, user: CometChat.User, group: CometChat.Group, parentMessageId: string | number): boolean {
106
- if (id) {
107
- if (id['parentMessageId'] && (id['parentMessageId'] != parentMessageId)) return false
108
- if ((id['uid'] || user) && id['uid'] != user?.uid) return false;
109
- if ((id['guid'] || group) && id['guid'] != group?.guid) return false;
105
+ static checkIdBelongsToThisComponent(id: anyObject, user :CometChat.User | any, group: CometChat.Group | any, parentMessageId :string| number): boolean{
106
+ if(id){
107
+ if(id['parentMessageId'] && ( id['parentMessageId'] != parentMessageId ))return false
108
+ if((id['uid'] || user) && id['uid'] != user?.uid) return false;
109
+ if( (id['guid'] || group) && id['guid'] != group?.guid) return false;
110
110
  }
111
111
  return true;
112
112
  }
@@ -24,7 +24,7 @@ export class InteractiveMessageUtils {
24
24
  let completed = false;
25
25
  let neededInteractionElement = interactionGoal?.getElementIds() || [];
26
26
  let neededInteractionElementCondition: string = interactionGoal?.getType() || "";
27
- let _interactedElements = [...interactedElements] || [];
27
+ let _interactedElements = [...(interactedElements ?? [])];
28
28
 
29
29
  switch (neededInteractionElementCondition) {
30
30
  case goalType.anyOf.toString():
@@ -20,15 +20,15 @@ export interface ActionSheetStylesInterface extends BaseStyleInterface {
20
20
  */
21
21
 
22
22
  export class ActionSheetStyles extends BaseStyle {
23
- layoutModeIconTint: string;
24
- titleFont: FontStyleInterface;
25
- titleColor: string;
26
- listItemIconTint: string;
27
- listItemTitleFont: FontStyleInterface;
28
- listItemTitleColor: string;
29
- listItemIconBackground: string;
30
- listItemIconBorderRadius: number;
31
- actionSheetSeparatorTint: string;
23
+ layoutModeIconTint?: string;
24
+ titleFont?: FontStyleInterface;
25
+ titleColor?: string;
26
+ listItemIconTint?: string;
27
+ listItemTitleFont?: FontStyleInterface;
28
+ listItemTitleColor?: string;
29
+ listItemIconBackground?: string;
30
+ listItemIconBorderRadius?: number;
31
+ actionSheetSeparatorTint?: string;
32
32
  paddingHorizontal?: number;
33
33
  optionsSeparatorTint?:string;
34
34
  /**
@@ -56,8 +56,6 @@ export class ActionSheetStyles extends BaseStyle {
56
56
  borderRadius: props.borderRadius,
57
57
  });
58
58
  if (props)
59
- for (const [key, value] of Object.entries(props)) {
60
- this[key] = value;
61
- }
59
+ Object.assign(this, props);
62
60
  }
63
61
  }
@@ -54,7 +54,7 @@ export const CometChatAudioBubble = ({
54
54
  const { theme } = useContext<CometChatContextType>(CometChatContext);
55
55
 
56
56
  const callCount = useRef(0);
57
- const timerId = useRef(null);
57
+ const timerId = useRef<any>(null);
58
58
  const threshold = 10;
59
59
  const timeframe = 1000;
60
60
 
@@ -42,7 +42,7 @@ export const CometChatFileBubble = ({
42
42
  const { theme } = useContext<CometChatContextType>(CometChatContext);
43
43
 
44
44
  const callCount = useRef(0);
45
- const timerId = useRef(null);
45
+ const timerId = useRef<any>(null);
46
46
  const threshold = 10;
47
47
  const timeframe = 1000;
48
48
 
@@ -118,7 +118,7 @@ export const CometChatFileBubble = ({
118
118
  };
119
119
 
120
120
 
121
- const wrapperPressTime = useRef(0);
121
+ const wrapperPressTime = useRef<any>(0);
122
122
  let viewProps = Platform.OS === "ios" ? {
123
123
  onTouchStart: () => {
124
124
  wrapperPressTime.current = Date.now();
@@ -433,7 +433,7 @@ export const CometChatFormBubble = memo((props: CometChatFormBubbleInterface) =>
433
433
  let completed = false;
434
434
  let neededInteractionElement = interactionGoal?.getElementIds() || [];
435
435
  let neededInteractionElementCondition: string = interactionGoal?.getType() || "";
436
- let _interactedElements = [...interactedElements] || [];
436
+ let _interactedElements = [...(interactedElements ?? [])];
437
437
 
438
438
  switch (neededInteractionElementCondition) {
439
439
  case goalType.anyOf.toString():
@@ -62,7 +62,7 @@ export const CometChatImageBubble = (props: CometChatImageBubbleInterface) => {
62
62
 
63
63
 
64
64
  const callCount = useRef(0);
65
- const timerId = useRef(null);
65
+ const timerId = useRef<any>(null);
66
66
  const threshold = 10;
67
67
  const timeframe = 1000;
68
68
 
@@ -232,13 +232,13 @@ export const CometChatImageBubble = (props: CometChatImageBubbleInterface) => {
232
232
  height,
233
233
  width,
234
234
  backgroundColor,
235
- }}
235
+ } as ImageStyle}
236
236
  />
237
237
  </View>
238
238
  :
239
239
  <Image
240
240
  resizeMode={resizeMode || "cover"}
241
- source={getImage(thumbnailUrl) || getImage(imageUrl)}
241
+ source={thumbnailUrl ? getImage(thumbnailUrl) : getImage(imageUrl!)}
242
242
  style={{
243
243
  height,
244
244
  width,
@@ -1,5 +1,6 @@
1
1
  //@ts-ignore
2
2
  import Spinner from './spineer.png';
3
+ //@ts-ignore
3
4
  import Default_image from './default_image.png'
4
5
 
5
6
  export const ICONS = {