@cometchat/chat-uikit-react-native 4.3.8 → 4.3.10
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/package.json +1 -1
- package/src/CometChatAddMembers/CometChatAddMembers.tsx +2 -1
- package/src/CometChatBannedMembers/CometChatBannedMembers.tsx +3 -0
- package/src/CometChatConversations/CometChatConversations.tsx +180 -29
- package/src/CometChatConversations/ConversationsConfiguration.ts +16 -6
- package/src/CometChatDetails/CometChatDetails.tsx +13 -9
- package/src/CometChatGroupMembers/CometChatGroupMembers.tsx +19 -3
- package/src/CometChatGroupMembers/GroupMemberConfiguration.ts +26 -2
- package/src/CometChatGroupsWithMessages/CometChatGroupsWithMessages.tsx +4 -2
- package/src/CometChatMessageComposer/CometChatMessageComposer.tsx +12 -3
- package/src/CometChatMessageHeader/CometChatMessageHeader.tsx +1 -1
- package/src/CometChatMessageList/CometChatMessageList.tsx +32 -5
- package/src/CometChatMessageList/MessageListConfiguration.ts +14 -2
- package/src/CometChatTransferOwnership/CometChatTransferOwnership.tsx +1 -0
- package/src/CometChatUsersWithMessages/CometChatUsersWithMessages.tsx +5 -3
- package/src/calls/CallEvents.ts +1 -1
- package/src/calls/CallingExtentionDecorator.tsx +2 -1
- package/src/calls/CometChatCallButtons/CometChatCallButtons.tsx +3 -1
- package/src/calls/CometChatCallLogs/CometChatCallLogs.tsx +1 -1
- package/src/calls/CometChatIncomingCall/CometChatIncomingCall.tsx +1 -1
- package/src/calls/CometChatOutgoingCall/CometChatOutgoingCall.tsx +2 -2
- package/src/extensions/CollaborativeDocument/CollaborativeDocumentExtensionDecorator.tsx +3 -0
- package/src/extensions/CollaborativeWhiteboard/CollaborativeWhiteboardExtensionDecorator.tsx +3 -0
- package/src/extensions/Polls/PollsDecorator.tsx +23 -26
- package/src/extensions/Stickers/StickersExtensionDecorator.tsx +5 -0
- package/src/extensions/ThumbnailGeneration/ThumbnailGenerationDecorator.tsx +1 -1
- package/src/index.ts +10 -1
- package/src/shared/CometChatUiKit/CometChatUIKit.ts +33 -13
- package/src/shared/CometChatUiKit/UIKitSettings.ts +8 -5
- package/src/shared/constants/UIKitConstants.ts +2 -2
- package/src/shared/events/CometChatUIEventHandler/CometChatUIEventHandler.ts +3 -0
- package/src/shared/events/CometChatUIEventHandler/Listener.ts +4 -4
- package/src/shared/formatters/CometChatMentionsFormatter/CometChatMentionsFormatter.tsx +4 -1
- package/src/shared/formatters/CometChatTextFormatter.ts +1 -1
- package/src/shared/framework/DataSource.ts +1 -2
- package/src/shared/framework/DataSourceDecorator.tsx +1 -2
- package/src/shared/framework/MessageDataSource.tsx +28 -6
- package/src/shared/index.ts +11 -3
- package/src/shared/libs/VideoPlayer/Video.js +4 -5
- package/src/shared/modals/CometChatMessageTemplate.ts +15 -0
- package/src/shared/modals/InteractiveData/InteractiveElements/index.ts +1 -0
- package/src/shared/modals/InteractiveData/InteractiveEntities/ElementEntity.ts +1 -2
- package/src/shared/modals/InteractiveData/index.ts +1 -0
- package/src/shared/modals/index.ts +3 -2
- package/src/shared/utils/MessageUtils.tsx +1 -0
- package/src/shared/views/CometChatDateTimePicker/CometChatDateTimePicker.tsx +1 -1
- package/src/shared/views/CometChatFormBubble/CometChatFormBubble.tsx +3 -5
- package/src/shared/views/CometChatList/CometChatList.tsx +44 -17
- package/src/shared/views/CometChatSchedulerBubble/CometChatSchedulerBubble.tsx +3 -5
- package/src/shared/views/CometChatVideoBubble/CometChatVideoBubble.tsx +1 -1
- package/src/shared/views/index.ts +4 -0
|
@@ -4,8 +4,8 @@ import { ExtensionsDataSource } from "../framework"
|
|
|
4
4
|
export type UIKitSettings = {
|
|
5
5
|
appId: string,
|
|
6
6
|
region: string,
|
|
7
|
-
authKey
|
|
8
|
-
subscriptionType?:
|
|
7
|
+
authKey?: string,
|
|
8
|
+
subscriptionType?: "NONE" | "ALL_USERS" | "ROLES" | "FRIENDS",
|
|
9
9
|
autoEstablishSocketConnection?: boolean,
|
|
10
10
|
overrideAdminHost?: string,
|
|
11
11
|
overrideClientHost?: string,
|
|
@@ -13,7 +13,8 @@ export type UIKitSettings = {
|
|
|
13
13
|
googleApiKey?: string,
|
|
14
14
|
disableCalling?: boolean,
|
|
15
15
|
aiFeatures?:AIExtensionDataSource[],
|
|
16
|
-
extensions?:ExtensionsDataSource[]
|
|
16
|
+
extensions?:ExtensionsDataSource[],
|
|
17
|
+
roles?: string[]
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
export function UIKitSettings({
|
|
@@ -28,7 +29,8 @@ export function UIKitSettings({
|
|
|
28
29
|
googleApiKey,
|
|
29
30
|
disableCalling,
|
|
30
31
|
aiFeatures,
|
|
31
|
-
extensions
|
|
32
|
+
extensions,
|
|
33
|
+
roles
|
|
32
34
|
}: UIKitSettings): UIKitSettings {
|
|
33
35
|
return {
|
|
34
36
|
appId,
|
|
@@ -42,6 +44,7 @@ export function UIKitSettings({
|
|
|
42
44
|
googleApiKey,
|
|
43
45
|
disableCalling,
|
|
44
46
|
aiFeatures,
|
|
45
|
-
extensions
|
|
47
|
+
extensions,
|
|
48
|
+
roles
|
|
46
49
|
}
|
|
47
50
|
}
|
|
@@ -76,6 +76,9 @@ export class CometChatUIEventHandler {
|
|
|
76
76
|
case listener._eventListener.ccShowOngoingCall?.name:
|
|
77
77
|
listener._eventListener.ccShowOngoingCall(param);
|
|
78
78
|
break;
|
|
79
|
+
case listener._eventListener.ccCallFailed?.name:
|
|
80
|
+
listener._eventListener.ccCallFailed(param);
|
|
81
|
+
break;
|
|
79
82
|
}
|
|
80
83
|
});
|
|
81
84
|
}
|
|
@@ -135,7 +135,7 @@ type CallUIEvents = {
|
|
|
135
135
|
ccOutgoingCallCancelled?: Function,
|
|
136
136
|
ccCallEnded?: Function,
|
|
137
137
|
ccCallInitiated?: Function,
|
|
138
|
-
|
|
138
|
+
ccCallFailed?: Function,
|
|
139
139
|
ccShowOngoingCall?: (CometChatOngoingComponent) => void,
|
|
140
140
|
}
|
|
141
141
|
|
|
@@ -166,7 +166,7 @@ export class CallUIEventListener {
|
|
|
166
166
|
ccCallRejected?: Function = undefined;
|
|
167
167
|
ccCallEnded?: Function = undefined;
|
|
168
168
|
ccOutgoingCallCancelled?: Function = undefined;
|
|
169
|
-
|
|
169
|
+
ccCallFailed?: Function = undefined;
|
|
170
170
|
ccCallInitiated?: Function = undefined;
|
|
171
171
|
ccShowOngoingCall?: (CometChatOngoingComponent) => void;
|
|
172
172
|
|
|
@@ -180,11 +180,11 @@ export class CallUIEventListener {
|
|
|
180
180
|
ccCallRejected,
|
|
181
181
|
ccCallEnded,
|
|
182
182
|
ccOutgoingCallCancelled,
|
|
183
|
-
|
|
183
|
+
ccCallFailed,
|
|
184
184
|
ccCallInitiated,
|
|
185
185
|
ccShowOngoingCall,
|
|
186
186
|
}: CallUIEvents) {
|
|
187
|
-
if (!isFalsy(
|
|
187
|
+
if (!isFalsy(ccCallFailed)) this.ccCallFailed = ccCallFailed;
|
|
188
188
|
if (!isFalsy(ccCallInitiated)) this.ccCallInitiated = ccCallInitiated;
|
|
189
189
|
if (!isFalsy(ccOutgoingCall)) this.ccOutgoingCall = ccOutgoingCall;
|
|
190
190
|
if (!isFalsy(ccCallAccepted)) this.ccCallAccepted = ccCallAccepted;
|
|
@@ -6,6 +6,7 @@ import { Text } from "react-native";
|
|
|
6
6
|
import { CometChatUIEventHandler, CometChatUIEvents } from '../../events';
|
|
7
7
|
import { localize } from '../../resources';
|
|
8
8
|
import { SuggestionItem } from '../../views/CometChatSuggestionList';
|
|
9
|
+
import { CometChatUIKit } from '../../CometChatUiKit';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Represents the CometChatMentionsFormatter class.
|
|
@@ -334,7 +335,9 @@ export class CometChatMentionsFormatter extends CometChatTextFormatter {
|
|
|
334
335
|
// Check if segment is a UID
|
|
335
336
|
if (userRegistry.hasOwnProperty(segment)) {
|
|
336
337
|
|
|
337
|
-
let
|
|
338
|
+
let _loggedInUser = this.loggedInUser || CometChatUIKit.loggedInUser;
|
|
339
|
+
|
|
340
|
+
let textStyle = (_loggedInUser?.getUid() == segment) ? this.mentionsStyle.loggedInUserTextStyle : this.mentionsStyle.textStyle;
|
|
338
341
|
let onPressProp = this.temp ? { onPress: (event: any) => this.onMentionClick(event, segment) } : {};
|
|
339
342
|
|
|
340
343
|
return (
|
|
@@ -9,10 +9,9 @@ import { ImageBubbleStyleInterface } from "../views/CometChatImageBubble";
|
|
|
9
9
|
import { VideoBubbleStyleInterface } from "../views/CometChatVideoBubble";
|
|
10
10
|
import { CometChatMessageComposerActionInterface } from "../helper/types";
|
|
11
11
|
import { AIOptionsStyle } from "../../AI/AIOptionsStyle";
|
|
12
|
-
import { CardMessage, FormMessage } from "../modals/InteractiveData";
|
|
12
|
+
import { CardMessage, FormMessage, SchedulerMessage } from "../modals/InteractiveData";
|
|
13
13
|
import { FormBubbleStyle } from "../views/CometChatFormBubble/FormBubbleStyle";
|
|
14
14
|
import { CardBubbleStyle } from "../views/CometChatCardBubble/CardBubbleStyle";
|
|
15
|
-
import { SchedulerMessage } from "../modals/InteractiveData/InteractiveMessage";
|
|
16
15
|
import { SchedulerBubbleStyles } from "../views/CometChatSchedulerBubble";
|
|
17
16
|
import { CometChatMentionsFormatter, CometChatTextFormatter, CometChatUrlsFormatter } from "../formatters";
|
|
18
17
|
import { AdditionalBubbleStylingParams, MessageBubbleAlignmentType } from "../base/Types";
|
|
@@ -3,8 +3,7 @@ import { AdditionalBubbleStylingParams, MessageBubbleAlignmentType } from "../ba
|
|
|
3
3
|
import { CometChatMentionsFormatter, CometChatTextFormatter, CometChatUrlsFormatter } from "../formatters";
|
|
4
4
|
import { CometChatMessageComposerActionInterface } from "../helper/types";
|
|
5
5
|
import { CometChatMessageOption, CometChatMessageTemplate } from "../modals";
|
|
6
|
-
import { CardMessage, FormMessage } from "../modals/InteractiveData";
|
|
7
|
-
import { SchedulerMessage } from "../modals/InteractiveData/InteractiveMessage";
|
|
6
|
+
import { CardMessage, FormMessage, SchedulerMessage } from "../modals/InteractiveData";
|
|
8
7
|
import { CometChatTheme } from "../resources/CometChatTheme";
|
|
9
8
|
import { VideoBubbleStyleInterface, ImageBubbleStyleInterface, AudioBubbleStyleInterface, FileBubbleStyleInterface } from "../views";
|
|
10
9
|
import { CardBubbleStyle } from "../views/CometChatCardBubble/CardBubbleStyle";
|
|
@@ -17,16 +17,14 @@ import { CometChatMessageComposerActionInterface } from "../helper/types";
|
|
|
17
17
|
import { ICONS } from "./resources";
|
|
18
18
|
import { CometChatConversationUtils } from "../utils/conversationUtils";
|
|
19
19
|
import { AIOptionsStyle } from "../../AI/AIOptionsStyle";
|
|
20
|
-
import { CometChatFormBubble, CometChatCardBubble } from "../views";
|
|
21
|
-
import { CardMessage, FormMessage } from "../modals/InteractiveData";
|
|
20
|
+
import { CometChatFormBubble, CometChatCardBubble, CometChatSchedulerBubble } from "../views";
|
|
21
|
+
import { CardMessage, FormMessage, SchedulerMessage } from "../modals/InteractiveData";
|
|
22
22
|
import { FormBubbleStyle } from "../views/CometChatFormBubble/FormBubbleStyle";
|
|
23
23
|
import { CardBubbleStyle } from "../views/CometChatCardBubble/CardBubbleStyle";
|
|
24
|
-
import {
|
|
25
|
-
import { CometChatSchedulerBubble, SchedulerBubbleStyles } from "../views/CometChatSchedulerBubble";
|
|
24
|
+
import { SchedulerBubbleStyles } from "../views/CometChatSchedulerBubble";
|
|
26
25
|
import { View } from "react-native";
|
|
27
26
|
import { CommonUtils } from "../utils/CommonUtils";
|
|
28
|
-
import { CometChatUIKit } from "
|
|
29
|
-
import { CometChatMentionsFormatter, CometChatTextFormatter, CometChatUrlsFormatter, MentionTextStyle } from "../formatters";
|
|
27
|
+
import { CometChatUIKit, CometChatMentionsFormatter, CometChatTextFormatter, CometChatUrlsFormatter, MentionTextStyle } from "../..";
|
|
30
28
|
import { AdditionalBubbleStylingParams, MessageBubbleAlignmentType } from "../base/Types";
|
|
31
29
|
|
|
32
30
|
function isAudioMessage(message: CometChat.BaseMessage): message is CometChat.MediaMessage {
|
|
@@ -599,6 +597,9 @@ export class MessageDataSource implements DataSource {
|
|
|
599
597
|
}
|
|
600
598
|
},
|
|
601
599
|
options: (loggedInuser, message, group) => ChatConfigurator.dataSource.getTextMessageOptions(loggedInuser, message, group),
|
|
600
|
+
BottomView: (message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => {
|
|
601
|
+
return ChatConfigurator.dataSource.getBottomView(message, alignment);
|
|
602
|
+
}
|
|
602
603
|
});
|
|
603
604
|
}
|
|
604
605
|
|
|
@@ -614,6 +615,9 @@ export class MessageDataSource implements DataSource {
|
|
|
614
615
|
}
|
|
615
616
|
},
|
|
616
617
|
options: (loggedInuser, message, group) => ChatConfigurator.dataSource.getFormMessageOptions(loggedInuser, message, group),
|
|
618
|
+
BottomView: (message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => {
|
|
619
|
+
return ChatConfigurator.dataSource.getBottomView(message, alignment);
|
|
620
|
+
}
|
|
617
621
|
});
|
|
618
622
|
}
|
|
619
623
|
|
|
@@ -629,6 +633,9 @@ export class MessageDataSource implements DataSource {
|
|
|
629
633
|
}
|
|
630
634
|
},
|
|
631
635
|
options: (loggedInuser, message, group) => ChatConfigurator.dataSource.getSchedulerMessageOptions(loggedInuser, message, group),
|
|
636
|
+
BottomView: (message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => {
|
|
637
|
+
return ChatConfigurator.dataSource.getBottomView(message, alignment);
|
|
638
|
+
}
|
|
632
639
|
});
|
|
633
640
|
}
|
|
634
641
|
|
|
@@ -644,6 +651,9 @@ export class MessageDataSource implements DataSource {
|
|
|
644
651
|
}
|
|
645
652
|
},
|
|
646
653
|
options: (loggedInuser, message, group) => ChatConfigurator.dataSource.getCardMessageOptions(loggedInuser, message, group),
|
|
654
|
+
BottomView: (message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => {
|
|
655
|
+
return ChatConfigurator.dataSource.getBottomView(message, alignment);
|
|
656
|
+
}
|
|
647
657
|
});
|
|
648
658
|
}
|
|
649
659
|
|
|
@@ -658,6 +668,9 @@ export class MessageDataSource implements DataSource {
|
|
|
658
668
|
return ChatConfigurator.dataSource.getAudioMessageContentView(message, alignment, theme);
|
|
659
669
|
},
|
|
660
670
|
options: (loggedInuser, message, group) => ChatConfigurator.dataSource.getAudioMessageOptions(loggedInuser, message, group),
|
|
671
|
+
BottomView: (message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => {
|
|
672
|
+
return ChatConfigurator.dataSource.getBottomView(message, alignment);
|
|
673
|
+
}
|
|
661
674
|
})
|
|
662
675
|
}
|
|
663
676
|
getVideoMessageTemplate(theme: CometChatTheme): CometChatMessageTemplate {
|
|
@@ -671,6 +684,9 @@ export class MessageDataSource implements DataSource {
|
|
|
671
684
|
return ChatConfigurator.dataSource.getVideoMessageContentView(message, alignment, theme);
|
|
672
685
|
},
|
|
673
686
|
options: (loggedInuser, message, group) => ChatConfigurator.dataSource.getVideoMessageOptions(loggedInuser, message, group),
|
|
687
|
+
BottomView: (message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => {
|
|
688
|
+
return ChatConfigurator.dataSource.getBottomView(message, alignment);
|
|
689
|
+
}
|
|
674
690
|
})
|
|
675
691
|
}
|
|
676
692
|
getImageMessageTemplate(theme: CometChatTheme): CometChatMessageTemplate {
|
|
@@ -684,6 +700,9 @@ export class MessageDataSource implements DataSource {
|
|
|
684
700
|
return ChatConfigurator.dataSource.getImageMessageContentView(message, alignment, theme);
|
|
685
701
|
},
|
|
686
702
|
options: (loggedInuser, message, group) => ChatConfigurator.dataSource.getImageMessageOptions(loggedInuser, message, group),
|
|
703
|
+
BottomView: (message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => {
|
|
704
|
+
return ChatConfigurator.dataSource.getBottomView(message, alignment);
|
|
705
|
+
}
|
|
687
706
|
})
|
|
688
707
|
}
|
|
689
708
|
getFileMessageTemplate(theme: CometChatTheme): CometChatMessageTemplate {
|
|
@@ -697,6 +716,9 @@ export class MessageDataSource implements DataSource {
|
|
|
697
716
|
return ChatConfigurator.dataSource.getFileMessageContentView(message, alignment, theme);
|
|
698
717
|
},
|
|
699
718
|
options: (loggedInuser, message, group) => ChatConfigurator.dataSource.getFileMessageOptions(loggedInuser, message, group),
|
|
719
|
+
BottomView: (message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => {
|
|
720
|
+
return ChatConfigurator.dataSource.getBottomView(message, alignment);
|
|
721
|
+
}
|
|
700
722
|
});
|
|
701
723
|
}
|
|
702
724
|
getGroupActionTemplate(theme: CometChatTheme): CometChatMessageTemplate {
|
package/src/shared/index.ts
CHANGED
|
@@ -49,7 +49,8 @@ import {
|
|
|
49
49
|
RadioButtonElement,
|
|
50
50
|
SingleSelectElement,
|
|
51
51
|
TextInputElement,
|
|
52
|
-
URLNavigationAction
|
|
52
|
+
URLNavigationAction,
|
|
53
|
+
DateTimeElement
|
|
53
54
|
} from './modals';
|
|
54
55
|
import { CometChatLocalize, localize } from './resources/CometChatLocalize';
|
|
55
56
|
import { CometChatTheme, Palette, Typography } from './resources/CometChatTheme';
|
|
@@ -173,7 +174,10 @@ import {
|
|
|
173
174
|
CometChatSuggestionListInterface,
|
|
174
175
|
SuggestionItem,
|
|
175
176
|
SuggestionListConfiguration,
|
|
176
|
-
SuggestionListConfigurationInterface
|
|
177
|
+
SuggestionListConfigurationInterface,
|
|
178
|
+
CometChatDateTimePicker,
|
|
179
|
+
CometChatDateTimePickerInterface,
|
|
180
|
+
DatePickerStyleInterface,
|
|
177
181
|
} from './views';
|
|
178
182
|
|
|
179
183
|
import {
|
|
@@ -390,5 +394,9 @@ export {
|
|
|
390
394
|
CometChatSuggestionListInterface,
|
|
391
395
|
SuggestionItem,
|
|
392
396
|
SuggestionListConfiguration,
|
|
393
|
-
SuggestionListConfigurationInterface
|
|
397
|
+
SuggestionListConfigurationInterface,
|
|
398
|
+
CometChatDateTimePicker,
|
|
399
|
+
CometChatDateTimePickerInterface,
|
|
400
|
+
DatePickerStyleInterface,
|
|
401
|
+
DateTimeElement,
|
|
394
402
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { StyleSheet, requireNativeComponent, NativeModules, View, Image, Platform,
|
|
4
|
-
import { ViewPropTypes, ImagePropTypes } from 'deprecated-react-native-prop-types';
|
|
3
|
+
import { StyleSheet, requireNativeComponent, NativeModules, View, Image, Platform, ViewProps, ImageResizeMode } from 'react-native';
|
|
5
4
|
import resolveAssetSource from 'react-native/Libraries/Image/resolveAssetSource';
|
|
6
5
|
import TextTrackType from './TextTrackType';
|
|
7
6
|
import FilterType from './FilterType';
|
|
@@ -390,9 +389,9 @@ Video.propTypes = {
|
|
|
390
389
|
}),
|
|
391
390
|
minLoadRetryCount: PropTypes.number,
|
|
392
391
|
maxBitRate: PropTypes.number,
|
|
393
|
-
resizeMode:
|
|
392
|
+
resizeMode: ImageResizeMode,
|
|
394
393
|
poster: PropTypes.string,
|
|
395
|
-
posterResizeMode:
|
|
394
|
+
posterResizeMode: ImageResizeMode,
|
|
396
395
|
repeat: PropTypes.bool,
|
|
397
396
|
automaticallyWaitsToMinimizeStalling: PropTypes.bool,
|
|
398
397
|
allowsExternalPlayback: PropTypes.bool,
|
|
@@ -483,7 +482,7 @@ Video.propTypes = {
|
|
|
483
482
|
translateX: PropTypes.number,
|
|
484
483
|
translateY: PropTypes.number,
|
|
485
484
|
rotation: PropTypes.number,
|
|
486
|
-
...
|
|
485
|
+
...ViewProps,
|
|
487
486
|
};
|
|
488
487
|
|
|
489
488
|
const RCTVideo = requireNativeComponent('CCRCTVideo', Video, {
|
|
@@ -31,6 +31,13 @@ interface MessageTemplateInterface {
|
|
|
31
31
|
*/
|
|
32
32
|
BubbleView?: (messageObject: CometChat.BaseMessage) => JSX.Element,
|
|
33
33
|
|
|
34
|
+
/**
|
|
35
|
+
* The bottom view of the message template.
|
|
36
|
+
* @param messageObject - The message object.
|
|
37
|
+
* @returns The JSX element representing the bottom view.
|
|
38
|
+
*/
|
|
39
|
+
BottomView?: (messageObject: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => JSX.Element,
|
|
40
|
+
|
|
34
41
|
/**
|
|
35
42
|
* The header view of the message template.
|
|
36
43
|
* @param messageObject - The message object.
|
|
@@ -90,6 +97,12 @@ export class CometChatMessageTemplate implements MessageTemplateInterface {
|
|
|
90
97
|
* @returns The JSX element representing the bubble view.
|
|
91
98
|
*/
|
|
92
99
|
BubbleView?: (messageObject: CometChat.BaseMessage) => JSX.Element;
|
|
100
|
+
/**
|
|
101
|
+
* The bottom view of the message template.
|
|
102
|
+
* @param messageObject - The message object.
|
|
103
|
+
* @returns The JSX element representing the bottom view.
|
|
104
|
+
*/
|
|
105
|
+
BottomView?: (messageObject: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType) => JSX.Element;
|
|
93
106
|
/**
|
|
94
107
|
* The header view of the message template.
|
|
95
108
|
* @param messageObject - The message object.
|
|
@@ -128,6 +141,7 @@ export class CometChatMessageTemplate implements MessageTemplateInterface {
|
|
|
128
141
|
category = "MESSAGE",
|
|
129
142
|
type = CometChat.MESSAGE_TYPE.TEXT,
|
|
130
143
|
ContentView,
|
|
144
|
+
BottomView,
|
|
131
145
|
BubbleView,
|
|
132
146
|
HeaderView,
|
|
133
147
|
StatusInfoView,
|
|
@@ -137,6 +151,7 @@ export class CometChatMessageTemplate implements MessageTemplateInterface {
|
|
|
137
151
|
this.category = category;
|
|
138
152
|
this.type = type;
|
|
139
153
|
this.ContentView = ContentView;
|
|
154
|
+
this.BottomView = BottomView;
|
|
140
155
|
this.BubbleView = BubbleView;
|
|
141
156
|
this.HeaderView = HeaderView;
|
|
142
157
|
this.StatusInfoView = StatusInfoView;
|
|
@@ -8,3 +8,4 @@ export { OptionElement } from "./OptionElement";
|
|
|
8
8
|
export { RadioButtonElement } from "./RadioButtonElement";
|
|
9
9
|
export { SingleSelectElement } from "./SingleSelectElement";
|
|
10
10
|
export { TextInputElement } from "./TextInputElement";
|
|
11
|
+
export { DateTimeElement } from './DateTimeElement';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { BaseInputElement, BaseInteractiveElement, LabelElement } from "../InteractiveElements";
|
|
1
|
+
import { BaseInputElement, BaseInteractiveElement, LabelElement, DateTimeElement } from "../InteractiveElements";
|
|
2
2
|
|
|
3
3
|
import { ElementType } from "../../../constants/UIKitConstants";
|
|
4
|
-
import { DateTimeElement } from "../InteractiveElements/DateTimeElement";
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* Represents the base input for a dynamic form element.
|
|
@@ -5,7 +5,7 @@ import { CometChatDetailsTemplate } from './CometChatDetailsTemplate';
|
|
|
5
5
|
import { CometChatDetailsOption } from './CometChatDetailsOption';
|
|
6
6
|
import { CometChatCallLogDetailsTemplate } from './CometChatCallLogDetailsTemplate';
|
|
7
7
|
import { CometChatCallLogDetailsOption } from './CometChatCallLogDetailsOptions';
|
|
8
|
-
import { APIAction, ActionEntity, BaseInputElement, BaseInteractiveElement, ButtonElement, CardMessage, CheckboxElement, CustomAction, CustomInteractiveMessage, DropdownElement, ElementEntity, FormMessage, LabelElement, OptionElement, RadioButtonElement, SingleSelectElement, TextInputElement, URLNavigationAction, SchedulerMessage } from './InteractiveData'
|
|
8
|
+
import { APIAction, ActionEntity, BaseInputElement, BaseInteractiveElement, ButtonElement, CardMessage, CheckboxElement, CustomAction, CustomInteractiveMessage, DropdownElement, ElementEntity, FormMessage, LabelElement, OptionElement, RadioButtonElement, SingleSelectElement, TextInputElement, URLNavigationAction, SchedulerMessage, DateTimeElement } from './InteractiveData'
|
|
9
9
|
|
|
10
10
|
export {
|
|
11
11
|
CometChatOptions,
|
|
@@ -33,5 +33,6 @@ export {
|
|
|
33
33
|
URLNavigationAction,
|
|
34
34
|
CometChatCallLogDetailsTemplate,
|
|
35
35
|
CometChatCallLogDetailsOption,
|
|
36
|
-
SchedulerMessage
|
|
36
|
+
SchedulerMessage,
|
|
37
|
+
DateTimeElement
|
|
37
38
|
};
|
|
@@ -52,6 +52,7 @@ export const MessageUtils = {
|
|
|
52
52
|
id={`${message.getId()}`}
|
|
53
53
|
alignment={alignment}
|
|
54
54
|
ContentView={template?.ContentView?.bind(this, message, alignment) || MessageContentView.bind(this, message, alignment, theme)}
|
|
55
|
+
BottomView={template?.BottomView && template?.BottomView?.bind(this, message, alignment)}
|
|
55
56
|
style={{backgroundColor: theme?.palette?.getPrimary()}}
|
|
56
57
|
/>;
|
|
57
58
|
}
|
|
@@ -11,11 +11,11 @@ import DateTimePickerModal from "../../libs/datePickerModal";
|
|
|
11
11
|
import { ICONS } from "../../assets/images";
|
|
12
12
|
import { CometChatContextType } from "../../base";
|
|
13
13
|
import { CometChatContext } from "../../CometChatContext";
|
|
14
|
-
import { DateTimeElement } from "../../modals/InteractiveData/InteractiveElements/DateTimeElement";
|
|
15
14
|
import { DateTime } from "../../libs/luxon/src/luxon";
|
|
16
15
|
import { convertToATimeZone } from "../../utils/SchedulerUtils";
|
|
17
16
|
import DateTimePicker from "@react-native-community/datetimepicker";
|
|
18
17
|
import { styles } from "./DateTimePickerStyle";
|
|
18
|
+
import { DateTimeElement } from "../../modals";
|
|
19
19
|
|
|
20
20
|
export interface CometChatDateTimePickerInterface {
|
|
21
21
|
style: object;
|
|
@@ -10,7 +10,7 @@ import { CometChatContext } from "../../CometChatContext";
|
|
|
10
10
|
// Style Components import
|
|
11
11
|
import { FormBubbleStyle, FormBubbleStyleInterface } from "./FormBubbleStyle";
|
|
12
12
|
|
|
13
|
-
import { APIAction, ButtonElement, CheckboxElement, DropdownElement, ElementEntity, FormMessage, LabelElement, OptionElement, RadioButtonElement, SingleSelectElement, TextInputElement, URLNavigationAction } from '../../modals/InteractiveData';
|
|
13
|
+
import { APIAction, ButtonElement, CheckboxElement, DateTimeElement, DropdownElement, ElementEntity, FormMessage, LabelElement, OptionElement, RadioButtonElement, SingleSelectElement, TextInputElement, URLNavigationAction } from '../../modals/InteractiveData';
|
|
14
14
|
import { ButtonAction, ElementType, HTTPSRequestMethods, goalType } from "../../constants/UIKitConstants";
|
|
15
15
|
import CometChatDropdown from "../CometChatDropDown/CometChatDropDown";
|
|
16
16
|
import { CometChatNetworkUtils } from "../../utils/NetworkUtils";
|
|
@@ -24,10 +24,8 @@ import { localize } from "../../resources";
|
|
|
24
24
|
import { memo } from "react";
|
|
25
25
|
import { ButtonStyle, CometChatButton } from "../CometChatButton";
|
|
26
26
|
import CometChatLabel from "../CometChatLabel/CometChatLabel";
|
|
27
|
-
import {
|
|
28
|
-
import { CometChatDateTimePicker } from
|
|
29
|
-
import { CometChatUIKit } from "../../CometChatUiKit";
|
|
30
|
-
import { CometChatUiKitConstants } from "../..";
|
|
27
|
+
import { CometChatUiKitConstants, CometChatUIKit } from "../..";
|
|
28
|
+
import { CometChatDateTimePicker } from '../CometChatDateTimePicker'
|
|
31
29
|
|
|
32
30
|
const WebView = NativeModules['WebViewManager'];
|
|
33
31
|
const { TimeZoneCodeManager } = NativeModules;
|
|
@@ -2,6 +2,7 @@ import React, {
|
|
|
2
2
|
useContext,
|
|
3
3
|
useEffect,
|
|
4
4
|
useImperativeHandle,
|
|
5
|
+
useRef,
|
|
5
6
|
useState,
|
|
6
7
|
} from 'react';
|
|
7
8
|
|
|
@@ -97,7 +98,7 @@ export interface CometChatListProps {
|
|
|
97
98
|
hideError?: boolean;
|
|
98
99
|
onItemPress?: (user: any) => void;
|
|
99
100
|
onItemLongPress?: (user: any) => void;
|
|
100
|
-
onError?: (error:
|
|
101
|
+
onError?: (error: CometChat.CometChatException) => void;
|
|
101
102
|
onBack?: Function;
|
|
102
103
|
selectionIcon?: ImageType;
|
|
103
104
|
listItemKey: 'uid' | 'guid' | 'conversationId';
|
|
@@ -197,6 +198,22 @@ export const CometChatList = React.forwardRef<
|
|
|
197
198
|
: ''
|
|
198
199
|
: ''
|
|
199
200
|
);
|
|
201
|
+
const searchInputRef = useRef(
|
|
202
|
+
requestBuilder && searchRequestBuilder
|
|
203
|
+
? searchRequestBuilder.searchKeyword
|
|
204
|
+
? searchRequestBuilder.searchKeyword
|
|
205
|
+
: ''
|
|
206
|
+
: requestBuilder
|
|
207
|
+
? requestBuilder.searchKeyword
|
|
208
|
+
? requestBuilder.searchKeyword
|
|
209
|
+
: ''
|
|
210
|
+
: searchRequestBuilder
|
|
211
|
+
? searchRequestBuilder.searchKeyword
|
|
212
|
+
? searchRequestBuilder.searchKeyword
|
|
213
|
+
: ''
|
|
214
|
+
: ''
|
|
215
|
+
);
|
|
216
|
+
|
|
200
217
|
const [shouldSelect, setShouldSelect] = React.useState(
|
|
201
218
|
selectionMode !== 'none' ? true : false
|
|
202
219
|
);
|
|
@@ -211,20 +228,21 @@ export const CometChatList = React.forwardRef<
|
|
|
211
228
|
|
|
212
229
|
const searchHandler = (searchText: string) => {
|
|
213
230
|
setSearchInput(searchText);
|
|
214
|
-
|
|
215
|
-
|
|
231
|
+
let _searchRequestBuilder = searchRequestBuilder || requestBuilder;
|
|
232
|
+
if (searchRequestBuilder && searchText) {
|
|
233
|
+
_searchRequestBuilder = searchRequestBuilder
|
|
216
234
|
.setSearchKeyword(searchText ? searchText : '')
|
|
217
235
|
.build();
|
|
218
236
|
} else if (requestBuilder) {
|
|
219
|
-
|
|
237
|
+
_searchRequestBuilder = requestBuilder
|
|
220
238
|
.setSearchKeyword(searchText ? searchText : '')
|
|
221
239
|
.build();
|
|
222
240
|
}
|
|
223
|
-
getSearch();
|
|
241
|
+
getSearch(_searchRequestBuilder);
|
|
224
242
|
};
|
|
225
243
|
|
|
226
|
-
const getSearch = () => {
|
|
227
|
-
getList(
|
|
244
|
+
const getSearch = (builder) => {
|
|
245
|
+
getList(builder)
|
|
228
246
|
.then((newlist: any) => {
|
|
229
247
|
setDecoratorMessage(NO_DATA_FOUND);
|
|
230
248
|
setList(newlist);
|
|
@@ -252,9 +270,17 @@ export const CometChatList = React.forwardRef<
|
|
|
252
270
|
new CometChat.ConnectionListener({
|
|
253
271
|
onConnected: () => {
|
|
254
272
|
console.log("ConnectionListener => On Connected");
|
|
255
|
-
|
|
273
|
+
if (requestBuilder) {
|
|
274
|
+
if (searchInputRef.current)
|
|
275
|
+
listHandlerRef.current = requestBuilder
|
|
276
|
+
.setSearchKeyword(searchInputRef.current)
|
|
277
|
+
.build();
|
|
278
|
+
else listHandlerRef.current = requestBuilder.build();
|
|
279
|
+
}
|
|
256
280
|
getList(listHandlerRef.current)
|
|
257
281
|
.then((newlist: any) => {
|
|
282
|
+
console.log('new list -->> ',newlist);
|
|
283
|
+
|
|
258
284
|
setDecoratorMessage(NO_DATA_FOUND);
|
|
259
285
|
setList(newlist);
|
|
260
286
|
})
|
|
@@ -279,15 +305,10 @@ export const CometChatList = React.forwardRef<
|
|
|
279
305
|
}
|
|
280
306
|
}, []);
|
|
281
307
|
|
|
308
|
+
|
|
282
309
|
useEffect(() => {
|
|
283
310
|
if (initialRunRef.current === true) {
|
|
284
|
-
if (
|
|
285
|
-
if (searchInput)
|
|
286
|
-
listHandlerRef.current = searchRequestBuilder
|
|
287
|
-
.setSearchKeyword(searchInput)
|
|
288
|
-
.build();
|
|
289
|
-
else listHandlerRef.current = searchRequestBuilder.build();
|
|
290
|
-
} else if (requestBuilder) {
|
|
311
|
+
if (requestBuilder) {
|
|
291
312
|
if (searchInput)
|
|
292
313
|
listHandlerRef.current = requestBuilder
|
|
293
314
|
.setSearchKeyword(searchInput)
|
|
@@ -303,6 +324,10 @@ export const CometChatList = React.forwardRef<
|
|
|
303
324
|
setShouldSelect(selectionMode !== 'none' ? true : false);
|
|
304
325
|
}, [selectionMode]);
|
|
305
326
|
|
|
327
|
+
useEffect(() => {
|
|
328
|
+
searchInputRef.current = searchInput
|
|
329
|
+
}, [searchInput]);
|
|
330
|
+
|
|
306
331
|
/**
|
|
307
332
|
* Updates the list of users to be displayed
|
|
308
333
|
* @param
|
|
@@ -512,9 +537,9 @@ export const CometChatList = React.forwardRef<
|
|
|
512
537
|
Object.keys(selectedItems).includes(item.value[listItemKey]) && ICONS.CHECK
|
|
513
538
|
}
|
|
514
539
|
SubtitleView={
|
|
515
|
-
SubtitleView ? () =>
|
|
540
|
+
SubtitleView ? () => SubtitleView(item.value) : null
|
|
516
541
|
}
|
|
517
|
-
TailView={TailView ? () =>
|
|
542
|
+
TailView={TailView ? () => TailView(item.value) : null}
|
|
518
543
|
statusIndicatorStyle={
|
|
519
544
|
selectedItems[item.value[listItemKey]] === true
|
|
520
545
|
? {
|
|
@@ -562,6 +587,8 @@ export const CometChatList = React.forwardRef<
|
|
|
562
587
|
lastCall = setTimeout(() => {
|
|
563
588
|
props?.fetchNext().then((listItems: any) => {
|
|
564
589
|
resolve(listItems);
|
|
590
|
+
}).catch((error) => {
|
|
591
|
+
reject(error)
|
|
565
592
|
});
|
|
566
593
|
}, 500);
|
|
567
594
|
lastReject = reject;
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
} from "react-native";
|
|
10
10
|
import { CometChatContextType } from "../../base";
|
|
11
11
|
import { CometChatContext } from "../../CometChatContext";
|
|
12
|
-
import { SchedulerMessage } from "../../modals/InteractiveData/InteractiveMessage";
|
|
13
12
|
import { SchedulerBubbleStyles } from "./styles";
|
|
14
13
|
import { CometChatAvatar } from "../CometChatAvatar";
|
|
15
14
|
import { styles } from "./styles";
|
|
@@ -18,10 +17,9 @@ import {
|
|
|
18
17
|
DefaultTheme,
|
|
19
18
|
} from "../../libs/CometChatCalendar";
|
|
20
19
|
import { ICONS } from "../../assets/images";
|
|
21
|
-
import { CometChatTimeSlotSelector } from "../CometChatTimeSlotSelector/CometChatTimeSlotSelector";
|
|
22
20
|
import { CometChatButton } from "../CometChatButton";
|
|
23
21
|
import icsToJson from "../../utils/icsToJson";
|
|
24
|
-
import { APIAction, ButtonElement } from "../../modals";
|
|
22
|
+
import { APIAction, ButtonElement, SchedulerMessage } from "../../modals";
|
|
25
23
|
import { CometChat } from "@cometchat/chat-sdk-react-native";
|
|
26
24
|
import { CometChatNetworkUtils } from "../../utils/NetworkUtils";
|
|
27
25
|
import { HTTPSRequestMethods } from "../../constants/UIKitConstants";
|
|
@@ -37,8 +35,8 @@ import {
|
|
|
37
35
|
} from "../../utils/SchedulerUtils";
|
|
38
36
|
import CometChatQuickView from "../CometChatQuickView/CometChatQuickView";
|
|
39
37
|
import { localize } from "../../resources";
|
|
40
|
-
import { CometChatUIKit } from "
|
|
41
|
-
import {
|
|
38
|
+
import { CometChatUiKitConstants, CometChatUIKit } from "../..";
|
|
39
|
+
import { CometChatTimeSlotSelector } from "../CometChatTimeSlotSelector";
|
|
42
40
|
import { InteractiveMessageUtils } from "../../utils/InteractiveMessageUtils";
|
|
43
41
|
|
|
44
42
|
const { TimeZoneCodeManager } = NativeModules;
|
|
@@ -167,7 +167,7 @@ export const CometChatVideoBubble = (props: CometChatVideoBubbleInterface) => {
|
|
|
167
167
|
volumeIcon={playerVolumeIcon}
|
|
168
168
|
volumeIconColor={style.playerVolumeIconColor}
|
|
169
169
|
/>
|
|
170
|
-
<ImageBackground source={(typeof thumbnailUrl === "object" ? thumbnailUrl?.uri : thumbnailUrl) || placeholderImage || defaultThumbnail} resizeMode={"cover"} style={{ backgroundColor, ...border, borderRadius, height, width, overflow: "hidden" }}>
|
|
170
|
+
<ImageBackground source={(typeof thumbnailUrl === "object" ? { uri: thumbnailUrl?.uri } : thumbnailUrl) || placeholderImage || defaultThumbnail} resizeMode={"cover"} style={{ backgroundColor, ...border, borderRadius, height, width, overflow: "hidden" }}>
|
|
171
171
|
<View
|
|
172
172
|
onTouchStart={handleTouchStart}
|
|
173
173
|
onTouchEnd={handleTouchEnd}
|
|
@@ -86,6 +86,7 @@ import {
|
|
|
86
86
|
import { CometChatFormBubble, CometChatFormBubbleInterface } from './CometChatFormBubble'
|
|
87
87
|
import { CometChatCardBubble, CometChatCardBubbleInterface } from './CometChatCardBubble'
|
|
88
88
|
import { CometChatSchedulerBubble, CometChatSchedulerBubbleInterface } from './CometChatSchedulerBubble'
|
|
89
|
+
import { CometChatDateTimePicker, CometChatDateTimePickerInterface, DatePickerStyleInterface } from './CometChatDateTimePicker'
|
|
89
90
|
|
|
90
91
|
import { CometChatReactions, CometChatReactionsInterface, ReactionsConfiguration, ReactionsConfigurationInterface, ReactionsStyle, ReactionsStyleInterface } from './CometChatReactions';
|
|
91
92
|
import { CometChatReactionList, CometChatReactionListInterface, ReactionListStyle, ReactionListStyleInterface, ReactionListConfiguration, ReactionListConfigurationInterface } from './CometChatReactionList';
|
|
@@ -205,4 +206,7 @@ export {
|
|
|
205
206
|
SuggestionItem,
|
|
206
207
|
SuggestionListConfiguration,
|
|
207
208
|
SuggestionListConfigurationInterface,
|
|
209
|
+
CometChatDateTimePicker,
|
|
210
|
+
CometChatDateTimePickerInterface,
|
|
211
|
+
DatePickerStyleInterface
|
|
208
212
|
};
|