@cometchat/chat-uikit-react-native 4.3.16 → 4.3.18
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/AI/AIAssistBot/AIAssistBotDecorator.tsx +20 -15
- package/src/AI/AIAssistBot/AIAssistBotStyle.ts +2 -2
- package/src/AI/AIAssistBot/AIAssistBotView.tsx +16 -14
- package/src/AI/AIAssistBot/configuration.ts +8 -7
- package/src/AI/AIAssistBot/resources/index.ts +1 -0
- package/src/AI/AIBaseConfiguration.ts +1 -0
- package/src/AI/AIConversationStarter/AIConversationStarterDecorator.tsx +27 -26
- package/src/AI/AIConversationStarter/AIConversationStarterStyle.ts +1 -0
- package/src/AI/AIConversationStarter/style.ts +29 -31
- package/src/AI/AIConversationSummary/AIConversationSummaryDecorator.tsx +14 -13
- package/src/AI/AIConversationSummary/AIConversationSummaryView.tsx +5 -4
- package/src/AI/AIConversationSummary/resources/index.ts +1 -0
- package/src/AI/AIExtensionDataSource.ts +1 -0
- package/src/AI/AISmartReplies/AISmartRepliesDecorator.tsx +28 -27
- package/src/AI/AISmartReplies/configuration.ts +2 -0
- package/src/AI/CardView.tsx +5 -5
- package/src/AI/resources/index.ts +3 -0
- package/src/AI/style.ts +68 -80
- package/src/CometChatAddMembers/AddMembersConfiguration.tsx +1 -0
- package/src/CometChatAddMembers/CometChatAddMembers.tsx +14 -13
- package/src/CometChatAddMembers/index.ts +10 -8
- package/src/CometChatBannedMembers/BannedMembersConfiguration.tsx +1 -0
- package/src/CometChatBannedMembers/CometChatBannedMembers.tsx +11 -8
- package/src/CometChatBannedMembers/index.ts +12 -7
- package/src/CometChatBannedMembers/resources/index.ts +1 -0
- package/src/CometChatContacts/CometChatContacts.tsx +9 -9
- package/src/CometChatContacts/ContactsConfiguration.tsx +1 -0
- package/src/CometChatContacts/Header.tsx +4 -4
- package/src/CometChatContacts/index.ts +5 -3
- package/src/CometChatConversations/CometChatConversations.tsx +289 -221
- package/src/CometChatConversations/ConversationsConfiguration.ts +14 -0
- package/src/CometChatConversations/index.ts +21 -10
- package/src/CometChatConversations/resources/index.ts +14 -0
- package/src/CometChatConversationsWithMessages/CometChatConversationsWithMessages.tsx +7 -5
- package/src/CometChatConversationsWithMessages/index.ts +6 -5
- package/src/CometChatConversationsWithMessages/resources/index.ts +1 -0
- package/src/CometChatCreateGroup/CometChatCreateGroup.tsx +30 -30
- package/src/CometChatCreateGroup/CreateGroupConfiguration.ts +1 -0
- package/src/CometChatCreateGroup/Header.tsx +1 -1
- package/src/CometChatCreateGroup/index.ts +5 -6
- package/src/CometChatCreateGroup/resources/index.ts +3 -0
- package/src/CometChatDetails/CometChatDetails.tsx +29 -28
- package/src/CometChatDetails/DetailsConfiguration.tsx +1 -0
- package/src/CometChatDetails/Header.tsx +1 -1
- package/src/CometChatDetails/index.ts +17 -15
- package/src/CometChatDetails/listners.ts +16 -16
- package/src/CometChatDetails/resources/index.ts +5 -0
- package/src/CometChatGroupMembers/CometChatGroupMembers.tsx +62 -52
- package/src/CometChatGroupMembers/GroupMemberConfiguration.ts +1 -1
- package/src/CometChatGroupMembers/GroupMemberStyle.ts +3 -3
- package/src/CometChatGroupMembers/index.ts +8 -16
- package/src/CometChatGroupMembers/resources/index.ts +5 -0
- package/src/CometChatGroups/CometChatGroups.tsx +46 -46
- package/src/CometChatGroups/GroupsConfiguration.ts +10 -9
- package/src/CometChatGroups/GroupsStyle.ts +1 -1
- package/src/CometChatGroups/index.ts +11 -10
- package/src/CometChatGroups/resources/index.ts +10 -0
- package/src/CometChatGroupsWithMessages/CometChatGroupsWithMessages.tsx +9 -8
- package/src/CometChatGroupsWithMessages/index.ts +6 -5
- package/src/CometChatGroupsWithMessages/resources/index.ts +1 -0
- package/src/CometChatJoinProtectedGroup/CometChatJoinProtectedGroup.tsx +22 -21
- package/src/CometChatJoinProtectedGroup/Header.tsx +1 -1
- package/src/CometChatJoinProtectedGroup/JoinProtectedGroupConfiguration.ts +1 -0
- package/src/CometChatJoinProtectedGroup/index.ts +5 -6
- package/src/CometChatJoinProtectedGroup/resources/index.ts +2 -0
- package/src/CometChatMessageComposer/CometChatMessageComposer.tsx +62 -59
- package/src/CometChatMessageComposer/MessageComposerConfiguration.tsx +1 -0
- package/src/CometChatMessageComposer/index.ts +6 -7
- package/src/CometChatMessageComposer/resources/index.ts +10 -0
- package/src/CometChatMessageHeader/CometChatMessageHeader.tsx +33 -31
- package/src/CometChatMessageHeader/MessageHeaderConfiguration.tsx +1 -0
- package/src/CometChatMessageHeader/index.ts +12 -13
- package/src/CometChatMessageHeader/listners.ts +18 -18
- package/src/CometChatMessageHeader/resources/index.ts +3 -0
- package/src/CometChatMessageInformation/CometChatMessageInformation.tsx +28 -24
- package/src/CometChatMessageInformation/index.ts +8 -8
- package/src/CometChatMessageInformation/resources/index.ts +1 -0
- package/src/CometChatMessageList/CometChatMessageList.tsx +289 -227
- package/src/CometChatMessageList/MessageListConfiguration.ts +50 -25
- package/src/CometChatMessageList/index.ts +16 -18
- package/src/CometChatMessageList/resources/index.ts +7 -0
- package/src/CometChatMessages/CometChatMessages.tsx +29 -26
- package/src/CometChatMessages/MessagesConfiguration.ts +2 -0
- package/src/CometChatMessages/index.ts +8 -7
- package/src/CometChatMessages/resources/index.ts +1 -0
- package/src/CometChatTabs/CometChatTabs.tsx +13 -23
- package/src/CometChatTabs/CometChatTabsStyle.ts +2 -0
- package/src/CometChatTabs/index.ts +3 -8
- package/src/CometChatThreadedMessages/CometChatThreadedMessages.tsx +37 -37
- package/src/CometChatThreadedMessages/Header.tsx +2 -2
- package/src/CometChatThreadedMessages/ThreadedMessagesConfiguration.ts +1 -0
- package/src/CometChatThreadedMessages/index.ts +11 -12
- package/src/CometChatThreadedMessages/resources/index.ts +6 -0
- package/src/CometChatTransferOwnership/CometChatTransferOwnership.tsx +5 -5
- package/src/CometChatTransferOwnership/TransferOwnershipConfiguration.ts +1 -0
- package/src/CometChatTransferOwnership/index.ts +10 -11
- package/src/CometChatUsers/CometChatUsers.tsx +11 -11
- package/src/CometChatUsers/UsersConfiguration.tsx +1 -0
- package/src/CometChatUsers/index.ts +8 -6
- package/src/CometChatUsersWithMessages/CometChatUsersWithMessages.tsx +6 -5
- package/src/CometChatUsersWithMessages/index.ts +6 -5
- package/src/calls/CallUtils.ts +4 -3
- package/src/calls/CallingDetailsUtils.tsx +9 -8
- package/src/calls/CallingExtension.tsx +2 -2
- package/src/calls/CallingExtentionDecorator.tsx +17 -17
- package/src/calls/CometChatCallBubble/CometChatCallBubble.tsx +3 -2
- package/src/calls/CometChatCallBubble/index.ts +14 -10
- package/src/calls/CometChatCallBubble/resources/index.ts +3 -0
- package/src/calls/CometChatCallButtons/CometChatCallButtonConfiguration.ts +1 -0
- package/src/calls/CometChatCallButtons/CometChatCallButtons.tsx +19 -18
- package/src/calls/CometChatCallButtons/index.ts +10 -8
- package/src/calls/CometChatCallButtons/resources/index.ts +2 -0
- package/src/calls/CometChatCallLogDetails/CallLogDetailsConfiguration.ts +2 -0
- package/src/calls/CometChatCallLogDetails/CometChatCallLogDetails.tsx +14 -13
- package/src/calls/CometChatCallLogDetails/index.ts +21 -10
- package/src/calls/CometChatCallLogDetails/resources/index.ts +1 -0
- package/src/calls/CometChatCallLogHistory/CallLogHistoryConfiguration.ts +3 -1
- package/src/calls/CometChatCallLogHistory/CometChatCallLogHistory.tsx +25 -24
- package/src/calls/CometChatCallLogHistory/index.ts +21 -10
- package/src/calls/CometChatCallLogHistory/resources/index.ts +13 -0
- package/src/calls/CometChatCallLogParticipants/CallLogParticipantsConfiguration.ts +4 -2
- package/src/calls/CometChatCallLogParticipants/CometChatCallLogParticipants.tsx +13 -12
- package/src/calls/CometChatCallLogParticipants/index.ts +21 -10
- package/src/calls/CometChatCallLogParticipants/resources/index.ts +1 -0
- package/src/calls/CometChatCallLogRecordings/CallLogRecordingsConfiguration.ts +5 -3
- package/src/calls/CometChatCallLogRecordings/CometChatCallLogRecordings.tsx +14 -13
- package/src/calls/CometChatCallLogRecordings/index.ts +21 -10
- package/src/calls/CometChatCallLogRecordings/resources/index.ts +2 -0
- package/src/calls/CometChatCallLogs/CallLogsConfiguration.ts +5 -3
- package/src/calls/CometChatCallLogs/CometChatCallLogs.tsx +37 -36
- package/src/calls/CometChatCallLogs/index.ts +14 -10
- package/src/calls/CometChatCallLogs/resources/index.ts +11 -0
- package/src/calls/CometChatCallLogsWithDetails/CallLogsWithDetailsConfiguration.ts +1 -0
- package/src/calls/CometChatCallLogsWithDetails/CometChatCallLogsWithDetails.tsx +3 -2
- package/src/calls/CometChatCallLogsWithDetails/index.ts +2 -4
- package/src/calls/CometChatIncomingCall/CometChatIncomingCall.tsx +19 -15
- package/src/calls/CometChatIncomingCall/index.ts +10 -8
- package/src/calls/CometChatIncomingCall/resources/index.ts +4 -0
- package/src/calls/CometChatIncomingCall/styles.ts +0 -1
- package/src/calls/CometChatOngoingCall/CometChatOngoingCall.tsx +5 -4
- package/src/calls/CometChatOngoingCall/index.ts +6 -6
- package/src/calls/CometChatOutgoingCall/CometChatOutgoingCall.tsx +15 -13
- package/src/calls/CometChatOutgoingCall/index.ts +8 -6
- package/src/calls/CometChatOutgoingCall/resources/index.ts +1 -0
- package/src/calls/index.ts +99 -60
- package/src/calls/resources/index.ts +3 -0
- package/src/extensions/CollaborativeBubble/CometChatCollaborativeBubble.tsx +1 -0
- package/src/extensions/CollaborativeBubble/resources/index.ts +1 -0
- package/src/extensions/CollaborativeBubble/styles.ts +1 -1
- package/src/extensions/CollaborativeDocument/CollaborativeDocumentConfiguration.tsx +1 -1
- package/src/extensions/CollaborativeDocument/CollaborativeDocumentExtensionDecorator.tsx +10 -9
- package/src/extensions/CollaborativeDocument/index.ts +12 -9
- package/src/extensions/CollaborativeDocument/resources/index.ts +2 -0
- package/src/extensions/CollaborativeWhiteboard/CollaborativeWhiteboardConfiguration.tsx +1 -1
- package/src/extensions/CollaborativeWhiteboard/CollaborativeWhiteboardExtensionDecorator.tsx +15 -14
- package/src/extensions/CollaborativeWhiteboard/index.ts +12 -9
- package/src/extensions/CollaborativeWhiteboard/resources/index.ts +2 -0
- package/src/extensions/ExtensionModerator.tsx +4 -4
- package/src/extensions/ImageModeration/ImageModerationDecorator.tsx +1 -1
- package/src/extensions/ImageModeration/ImageModerationFilter.tsx +2 -1
- package/src/extensions/ImageModeration/index.ts +15 -7
- package/src/extensions/ImageModeration/resources/index.ts +1 -0
- package/src/extensions/LinkPreview/LinkPreviewBubble.tsx +8 -8
- package/src/extensions/LinkPreview/LinkPreviewExtention.tsx +1 -1
- package/src/extensions/LinkPreview/LinkPreviewExtentionDecorator.tsx +2 -1
- package/src/extensions/LinkPreview/index.ts +18 -10
- package/src/extensions/LinkPreview/resources/index.ts +1 -0
- package/src/extensions/MessageTranslation/MessageTranslationBubble.tsx +7 -7
- package/src/extensions/MessageTranslation/MessageTranslationDecorator.tsx +19 -17
- package/src/extensions/MessageTranslation/index.ts +7 -7
- package/src/extensions/MessageTranslation/resources/index.ts +1 -0
- package/src/extensions/Polls/Header.tsx +8 -8
- package/src/extensions/Polls/Polls.tsx +38 -33
- package/src/extensions/Polls/PollsBubble.tsx +35 -33
- package/src/extensions/Polls/PollsDecorator.tsx +7 -7
- package/src/extensions/Polls/index.ts +4 -5
- package/src/extensions/Polls/resources/index.ts +5 -0
- package/src/extensions/SmartReplies/SmartRepliesDecorator.tsx +11 -11
- package/src/extensions/SmartReplies/SmartRepliesView.tsx +4 -3
- package/src/extensions/SmartReplies/index.ts +6 -2
- package/src/extensions/SmartReplies/resources/index.ts +1 -0
- package/src/extensions/Stickers/CometChatStickerKeyboard/CometChatStickerKeyboard.tsx +12 -10
- package/src/extensions/Stickers/CometChatStickerKeyboard/StickerKeyboardConfiguration.ts +2 -1
- package/src/extensions/Stickers/CometChatStickerKeyboard/hooks.ts +19 -17
- package/src/extensions/Stickers/StickersBubble.tsx +4 -4
- package/src/extensions/Stickers/StickersExtensionDecorator.tsx +11 -10
- package/src/extensions/Stickers/index.ts +13 -8
- package/src/extensions/Stickers/resources/index.ts +1 -0
- package/src/extensions/TextModeration/TextModerationConfiguration.tsx +1 -1
- package/src/extensions/TextModeration/TextModerationExtension.tsx +1 -0
- package/src/extensions/TextModeration/TextModerationExtensionDecorator.tsx +1 -0
- package/src/extensions/TextModeration/index.ts +5 -4
- package/src/extensions/ThumbnailGeneration/ThumbnailGenerationDecorator.tsx +5 -5
- package/src/extensions/ThumbnailGeneration/index.ts +6 -2
- package/src/extensions/ThumbnailGeneration/resources/index.ts +1 -0
- package/src/extensions/index.ts +92 -47
- package/src/index.ts +225 -232
- package/src/shared/CometChatContext.tsx +1 -1
- package/src/shared/CometChatUiKit/CometChatUIKit.ts +40 -36
- package/src/shared/CometChatUiKit/CometChatUIKitHelper.ts +1 -0
- package/src/shared/assets/images/index.ts +16 -0
- package/src/shared/assets/images/search.png +0 -0
- package/src/shared/base/FontStyle.ts +2 -2
- package/src/shared/base/index.ts +8 -11
- package/src/shared/base/vars.ts +2 -2
- package/src/shared/constants/UIKitConstants.ts +16 -1
- package/src/shared/events/CometChatMessageEvents/index.ts +6 -4
- package/src/shared/events/CometChatUIEventHandler/CometChatUIEventHandler.ts +221 -219
- package/src/shared/events/CometChatUIEventHandler/Listener.ts +39 -37
- package/src/shared/events/ListenerInitializer.ts +8 -1
- package/src/shared/events/messages.ts +2 -0
- package/src/shared/formatters/CometChatMentionsFormatter/CometChatMentionsFormatter.tsx +11 -15
- package/src/shared/formatters/CometChatTextFormatter.ts +6 -5
- package/src/shared/formatters/CometChatUrlsFormatter/index.tsx +8 -10
- package/src/shared/framework/DataSource.ts +17 -17
- package/src/shared/framework/DataSourceDecorator.tsx +3 -2
- package/src/shared/framework/ExtensionsDataSource.tsx +1 -0
- package/src/shared/framework/MessageDataSource.tsx +125 -117
- package/src/shared/framework/index.ts +12 -6
- package/src/shared/framework/resources/index.ts +20 -0
- package/src/shared/helper/helperFunctions.ts +7 -5
- package/src/shared/index.ts +109 -100
- package/src/shared/libs/CometChatCalendar/Calendars/BaseCalendar.tsx +6 -3
- package/src/shared/libs/CometChatCalendar/Calendars/DateSelectionCalendar.tsx +2 -0
- package/src/shared/libs/CometChatCalendar/Calendars/MultiDateSelectionCalendar.tsx +2 -0
- package/src/shared/libs/CometChatCalendar/Components/Day.tsx +2 -0
- package/src/shared/libs/CometChatCalendar/Components/Days.tsx +1 -0
- package/src/shared/libs/CometChatCalendar/Components/Month.tsx +1 -0
- package/src/shared/libs/CometChatCalendar/Components/Months.tsx +1 -0
- package/src/shared/libs/CometChatCalendar/Components/Title.tsx +2 -0
- package/src/shared/libs/CometChatCalendar/Hooks/useSurroundingTimeUnits.ts +3 -0
- package/src/shared/libs/CometChatCalendar/Locales/index.ts +1 -0
- package/src/shared/libs/CometChatCalendar/Utils/dateRange.ts +1 -0
- package/src/shared/libs/CometChatCalendar/Utils/getExtraDays.ts +1 -0
- package/src/shared/libs/CometChatCalendar/Utils/getSurroundingTimeUnits.ts +1 -0
- package/src/shared/libs/ImageZoom/ReactNativeZoomableView.tsx +45 -42
- package/src/shared/libs/ImageZoom/ReactNativeZoomableViewWithGestures.tsx +13 -11
- package/src/shared/libs/ImageZoom/types/index.ts +12 -12
- package/src/shared/libs/VideoPlayerControls/OSSupport/TVOSSupport.tsx +1 -0
- package/src/shared/libs/VideoPlayerControls/VideoPlayer.tsx +1 -0
- package/src/shared/libs/datePickerModal/Modal.js +1 -1
- package/src/shared/modals/CometChatDetailsOption.ts +2 -2
- package/src/shared/modals/CometChatMessageTemplate.ts +13 -12
- package/src/shared/modals/InteractiveData/InteractiveElements/DateTimeElement.ts +7 -7
- package/src/shared/modals/InteractiveData/InteractiveMessage/CardMessage.ts +1 -0
- package/src/shared/modals/InteractiveData/InteractiveMessage/CustomInteractiveMessage.ts +1 -0
- package/src/shared/modals/InteractiveData/InteractiveMessage/FormMessage.ts +1 -0
- package/src/shared/modals/InteractiveData/InteractiveMessage/SchedulerMessage.ts +6 -7
- package/src/shared/modals/index.ts +37 -14
- package/src/shared/resources/CometChatLocalize/CometChatLocalize.ts +5 -5
- package/src/shared/resources/CometChatSoundManager/index.ts +1 -0
- package/src/shared/resources/CometChatTheme/Palette.ts +57 -55
- package/src/shared/resources/CometChatTheme/Typography.ts +30 -30
- package/src/shared/utils/CometChatLiveReactions/CometChatLiveReaction.tsx +17 -13
- package/src/shared/utils/CometChatLiveReactions/resources/index.ts +1 -0
- package/src/shared/utils/CometChatMessageHelper/index.ts +2 -2
- package/src/shared/utils/CometChatMessagePreview/{index.js → index.ts} +3 -0
- package/src/shared/utils/CometChatMessagePreview/resources/index.ts +1 -0
- package/src/shared/utils/CommonUtils.ts +85 -1
- package/src/shared/utils/DetailsUtils/DetailsUtils.tsx +3 -2
- package/src/shared/utils/DetailsUtils/resources/index.ts +7 -0
- package/src/shared/utils/InteractiveMessageUtils.ts +6 -5
- package/src/shared/utils/MessageUtils.tsx +108 -18
- package/src/shared/utils/NetworkUtils.tsx +1 -1
- package/src/shared/utils/PermissionUtil.ts +7 -6
- package/src/shared/utils/SchedulerUtils.ts +8 -6
- package/src/shared/utils/TypeUtils.ts +3 -0
- package/src/shared/utils/conversationUtils.ts +7 -5
- package/src/shared/utils/index.ts +2 -0
- package/src/shared/views/CometChatAICard/CometChatAICard.tsx +7 -6
- package/src/shared/views/CometChatAICard/resources/index.ts +2 -0
- package/src/shared/views/CometChatActionSheet/ActionSheetStyle.ts +3 -0
- package/src/shared/views/CometChatActionSheet/CometChatActionSheet.tsx +5 -5
- package/src/shared/views/CometChatActionSheet/hooks.ts +2 -2
- package/src/shared/views/CometChatActionSheet/index.ts +5 -3
- package/src/shared/views/CometChatActionSheet/resources/index.ts +2 -0
- package/src/shared/views/CometChatAudioBubble/CometChatAudioBubble.tsx +6 -6
- package/src/shared/views/CometChatAudioBubble/index.ts +8 -12
- package/src/shared/views/CometChatAudioBubble/resources/index.ts +2 -0
- package/src/shared/views/CometChatAvatar/CometChatAvatar.tsx +6 -5
- package/src/shared/views/CometChatAvatar/index.ts +7 -9
- package/src/shared/views/CometChatBadge/CometChatBadge.tsx +3 -3
- package/src/shared/views/CometChatBadge/index.ts +7 -9
- package/src/shared/views/CometChatBottomSheet/CometChatBottomSheet.tsx +51 -48
- package/src/shared/views/CometChatBottomSheet/index.ts +6 -2
- package/src/shared/views/CometChatButton/CometChatButton.tsx +5 -5
- package/src/shared/views/CometChatButton/index.ts +4 -14
- package/src/shared/views/CometChatCard/CometChatCard.tsx +3 -3
- package/src/shared/views/CometChatCard/index.ts +6 -7
- package/src/shared/views/CometChatCardBubble/CometChatCardBubble.tsx +11 -10
- package/src/shared/views/CometChatCardBubble/index.tsx +2 -1
- package/src/shared/views/CometChatCheckBox/CometChatCheckBox.tsx +6 -6
- package/src/shared/views/CometChatConfirmDialog/CometChatConfirmDialog.tsx +9 -9
- package/src/shared/views/CometChatConfirmDialog/CometChatConfirmDialogStyle.ts +1 -0
- package/src/shared/views/CometChatConfirmDialog/index.ts +9 -6
- package/src/shared/views/CometChatDate/CometChatDate.tsx +2 -2
- package/src/shared/views/CometChatDate/index.ts +12 -11
- package/src/shared/views/CometChatDateTimePicker/CometChatDateTimePicker.tsx +20 -17
- package/src/shared/views/CometChatDateTimePicker/index.ts +3 -5
- package/src/shared/views/CometChatDropDown/CometChatDropDown.tsx +8 -7
- package/src/shared/views/CometChatEmojiKeyboard/CometChatEmojiKeyboard.tsx +24 -33
- package/src/shared/views/CometChatEmojiKeyboard/Emoji.ts +1 -1
- package/src/shared/views/CometChatEmojiKeyboard/EmojiCategory.ts +1 -1
- package/src/shared/views/CometChatEmojiKeyboard/EmojiKeyboardConfiguration.ts +2 -1
- package/src/shared/views/CometChatEmojiKeyboard/EmojiKeyboardStyle.ts +2 -1
- package/src/shared/views/CometChatEmojiKeyboard/emojis.ts +8 -0
- package/src/shared/views/CometChatEmojiKeyboard/resources/index.ts +8 -0
- package/src/shared/views/CometChatEmojiKeyboard/style.ts +2 -2
- package/src/shared/views/CometChatFileBubble/CometChatFileBubble.tsx +3 -3
- package/src/shared/views/CometChatFileBubble/FileBubbleStyle.ts +1 -1
- package/src/shared/views/CometChatFileBubble/index.ts +7 -8
- package/src/shared/views/CometChatFileBubble/resources/index.ts +2 -0
- package/src/shared/views/CometChatFormBubble/CometChatFormBubble.tsx +33 -29
- package/src/shared/views/CometChatFormBubble/index.tsx +2 -1
- package/src/shared/views/CometChatImageBubble/CometChatImageBubble.tsx +63 -17
- package/src/shared/views/CometChatImageBubble/ImageBubbleStyle.ts +1 -1
- package/src/shared/views/CometChatImageBubble/assets/default_image.png +0 -0
- package/src/shared/views/CometChatImageBubble/assets/index.ts +3 -0
- package/src/shared/views/CometChatImageBubble/index.ts +10 -8
- package/src/shared/views/CometChatImageViewerModal/ImageViewerModal.tsx +1 -1
- package/src/shared/views/CometChatImageViewerModal/resources/index.ts +1 -0
- package/src/shared/views/CometChatLabel/CometChatLabel.tsx +2 -2
- package/src/shared/views/CometChatList/CometChatList.tsx +46 -42
- package/src/shared/views/CometChatList/index.ts +3 -3
- package/src/shared/views/CometChatList/resources/index.ts +5 -0
- package/src/shared/views/CometChatListItem/CometChatListItem.tsx +18 -13
- package/src/shared/views/CometChatListItem/ListItemConfiguration.tsx +1 -0
- package/src/shared/views/CometChatListItem/index.ts +8 -7
- package/src/shared/views/CometChatMediaRecorder/CometChatMediaRecorder.tsx +34 -31
- package/src/shared/views/CometChatMediaRecorder/index.ts +8 -9
- package/src/shared/views/CometChatMessageBubble/CometChatMessageBubble.tsx +22 -15
- package/src/shared/views/CometChatMessageBubble/MessageBubbleStyle.ts +4 -0
- package/src/shared/views/CometChatMessageBubble/index.ts +6 -5
- package/src/shared/views/CometChatMessageInput/CometChatMessageInput.tsx +10 -9
- package/src/shared/views/CometChatMessageInput/index.ts +2 -1
- package/src/shared/views/CometChatPanel/CometChatPanel.tsx +3 -3
- package/src/shared/views/CometChatPanel/resources/index.ts +1 -0
- package/src/shared/views/CometChatQuickReactions/CometChatQuickReactions.tsx +4 -4
- package/src/shared/views/CometChatQuickReactions/QuickReactionsConfiguration.tsx +1 -0
- package/src/shared/views/CometChatQuickReactions/index.ts +3 -7
- package/src/shared/views/CometChatQuickReactions/resources/index.ts +1 -0
- package/src/shared/views/CometChatQuickView/CometChatQuickView.tsx +6 -6
- package/src/shared/views/CometChatRadioButton/CometChatRadioButton.tsx +4 -4
- package/src/shared/views/CometChatReactionList/CometChatReactionList.tsx +29 -28
- package/src/shared/views/CometChatReactionList/ReactionListConfiguration.tsx +1 -0
- package/src/shared/views/CometChatReactionList/index.ts +3 -7
- package/src/shared/views/CometChatReactionList/resources/index.ts +1 -0
- package/src/shared/views/CometChatReactions/CometChatReactions.tsx +14 -14
- package/src/shared/views/CometChatReactions/ReactionsConfiguration.tsx +1 -0
- package/src/shared/views/CometChatReactions/index.ts +15 -11
- package/src/shared/views/CometChatReceipt/CometChatReceipt.tsx +5 -5
- package/src/shared/views/CometChatReceipt/index.ts +10 -8
- package/src/shared/views/CometChatSchedulerBubble/CometChatSchedulerBubble.tsx +59 -53
- package/src/shared/views/CometChatSchedulerBubble/index.ts +3 -5
- package/src/shared/views/CometChatSchedulerBubble/styles.ts +1 -1
- package/src/shared/views/CometChatSingleSelect/CometChatSingleSelect.tsx +4 -4
- package/src/shared/views/CometChatStatusIndicator/CometChatStatusIndicator.tsx +4 -4
- package/src/shared/views/CometChatStatusIndicator/StatusIndicatorConfiguration.ts +2 -2
- package/src/shared/views/CometChatStatusIndicator/index.ts +21 -10
- package/src/shared/views/CometChatSuggestionList/CometChatSuggestionList.tsx +1 -1
- package/src/shared/views/CometChatSuggestionList/SuggestionItem.ts +5 -5
- package/src/shared/views/CometChatSuggestionList/SuggestionListConfiguration.ts +3 -3
- package/src/shared/views/CometChatSuggestionList/index.ts +14 -10
- package/src/shared/views/CometChatTextBubble/CometChatTextBubble.tsx +6 -5
- package/src/shared/views/CometChatTextBubble/index.ts +6 -7
- package/src/shared/views/CometChatTextInput/CometChatTextInput.tsx +2 -2
- package/src/shared/views/CometChatTimeSlotSelector/CometChatTimeSlotSelector.tsx +5 -5
- package/src/shared/views/CometChatTimeSlotSelector/index.ts +3 -5
- package/src/shared/views/CometChatVideoBubble/CometChatVideoBubble.tsx +9 -8
- package/src/shared/views/CometChatVideoBubble/index.ts +10 -8
- package/src/shared/views/CometChatVideoBubble/resources/index.ts +2 -0
- package/src/shared/views/CometChatVideoPlayer/CometChatVideoPlayer.tsx +1 -1
- package/src/shared/views/SwipeRow/SwipeRow.tsx +4 -3
- package/src/shared/views/index.ts +151 -86
- package/ios/CometchatUiKit.xcodeproj/project.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/CometchatUiKit.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- package/src/shared/libs/CometChatCalendar/Components/Arrow.test.tsx +0 -112
- package/src/shared/libs/CometChatCalendar/Components/Day.test.tsx +0 -396
- package/src/shared/libs/CometChatCalendar/Components/Days.test.tsx +0 -216
- package/src/shared/libs/CometChatCalendar/Components/Month.test.tsx +0 -160
- package/src/shared/libs/CometChatCalendar/Components/Months.test.tsx +0 -262
- package/src/shared/libs/CometChatCalendar/Components/Title.test.tsx +0 -111
- package/src/shared/libs/CometChatCalendar/Components/Weekdays.test.tsx +0 -69
- package/src/shared/libs/CometChatCalendar/Hooks/useSurroundingTimeUnits.test.ts +0 -44
- package/src/shared/libs/CometChatCalendar/Utils/addOpacity.test.ts +0 -49
- package/src/shared/libs/CometChatCalendar/Utils/clamp.test.ts +0 -39
- package/src/shared/libs/CometChatCalendar/Utils/dateRange.test.ts +0 -20
- package/src/shared/libs/CometChatCalendar/Utils/getExtraDays.test.ts +0 -48
- package/src/shared/libs/CometChatCalendar/Utils/getSurroundingTimeUnits.test.ts +0 -60
|
@@ -22,10 +22,11 @@ import { CardMessage, FormMessage, SchedulerMessage } from "../modals/Interactiv
|
|
|
22
22
|
import { FormBubbleStyle } from "../views/CometChatFormBubble/FormBubbleStyle";
|
|
23
23
|
import { CardBubbleStyle } from "../views/CometChatCardBubble/CardBubbleStyle";
|
|
24
24
|
import { SchedulerBubbleStyles } from "../views/CometChatSchedulerBubble";
|
|
25
|
-
import { View } from "react-native";
|
|
25
|
+
import { TextStyle, View } from "react-native";
|
|
26
26
|
import { CommonUtils } from "../utils/CommonUtils";
|
|
27
|
-
import { CometChatUIKit, CometChatMentionsFormatter, CometChatTextFormatter, CometChatUrlsFormatter, MentionTextStyle } from "../..";
|
|
27
|
+
import { CometChatUIKit, CometChatMentionsFormatter, CometChatTextFormatter, CometChatUrlsFormatter, MentionTextStyle, CometChatUiKitConstants } from "../..";
|
|
28
28
|
import { AdditionalBubbleStylingParams, MessageBubbleAlignmentType } from "../base/Types";
|
|
29
|
+
import { MessageUtils } from "../utils/MessageUtils";
|
|
29
30
|
|
|
30
31
|
function isAudioMessage(message: CometChat.BaseMessage): message is CometChat.MediaMessage {
|
|
31
32
|
return message.getCategory() == CometChat.CATEGORY_MESSAGE &&
|
|
@@ -263,7 +264,7 @@ export class MessageDataSource implements DataSource {
|
|
|
263
264
|
|
|
264
265
|
private validateOption(loggedInUser: CometChat.User, messageObject: CometChat.BaseMessage, optionId: string, group?: CometChat.Group | null): boolean {
|
|
265
266
|
|
|
266
|
-
if (MessageOptionConstants.replyInThread === optionId && (!messageObject.parentMessageId || messageObject.parentMessageId === 0)) {
|
|
267
|
+
if (MessageOptionConstants.replyInThread === optionId && (!(messageObject as any).parentMessageId || (messageObject as any).parentMessageId === 0)) {
|
|
267
268
|
return true;
|
|
268
269
|
}
|
|
269
270
|
|
|
@@ -281,7 +282,7 @@ export class MessageDataSource implements DataSource {
|
|
|
281
282
|
return true;
|
|
282
283
|
}
|
|
283
284
|
|
|
284
|
-
let memberIsNotParticipant: boolean = group && (group.owner === loggedInUser.uid || group.scope !== GroupMemberScope.participant);
|
|
285
|
+
let memberIsNotParticipant: boolean | any = group && ((group as any).owner === (loggedInUser as any).uid || (group as any).scope !== GroupMemberScope.participant);
|
|
285
286
|
|
|
286
287
|
if (MessageOptionConstants.deleteMessage === optionId && (isSentByMe || memberIsNotParticipant)) {
|
|
287
288
|
return true;
|
|
@@ -331,10 +332,13 @@ export class MessageDataSource implements DataSource {
|
|
|
331
332
|
return messageOptionList;
|
|
332
333
|
}
|
|
333
334
|
|
|
334
|
-
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
getGroupActionBubble(message: CometChat.BaseMessage, theme: CometChatTheme): JSX.Element | null {
|
|
335
338
|
if (isActionMessage(message)) {
|
|
339
|
+
const messageText = MessageUtils.getActionMessage(message);
|
|
336
340
|
return <CometChatTextBubble
|
|
337
|
-
text={
|
|
341
|
+
text={messageText}
|
|
338
342
|
textContainerStyle={{ marginStart: 4, marginEnd: 4 }}
|
|
339
343
|
style={{
|
|
340
344
|
backgroundColor: theme?.palette?.getAccent50(),
|
|
@@ -349,7 +353,7 @@ export class MessageDataSource implements DataSource {
|
|
|
349
353
|
return null;
|
|
350
354
|
}
|
|
351
355
|
|
|
352
|
-
getBottomView(message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType): JSX.Element {
|
|
356
|
+
getBottomView(message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType): JSX.Element | null {
|
|
353
357
|
return null;
|
|
354
358
|
}
|
|
355
359
|
|
|
@@ -381,92 +385,96 @@ export class MessageDataSource implements DataSource {
|
|
|
381
385
|
return null;
|
|
382
386
|
}
|
|
383
387
|
|
|
384
|
-
getTextMessageBubble(messageText: string, message: CometChat.TextMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme, additionalParams?: AdditionalBubbleStylingParams): JSX.Element {
|
|
388
|
+
getTextMessageBubble(messageText: string, message: CometChat.TextMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme, additionalParams?: AdditionalBubbleStylingParams): JSX.Element | null {
|
|
385
389
|
let loggedInUser = CometChatUIKit.loggedInUser;
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
390
|
+
if(loggedInUser) {
|
|
391
|
+
let mentionedUsers = message.getMentionedUsers();
|
|
392
|
+
let textFormatters = [...(additionalParams?.textFormatters || [])] || [];
|
|
393
|
+
|
|
394
|
+
let linksTextFormatter = ChatConfigurator.getDataSource().getUrlsFormatter(loggedInUser);
|
|
395
|
+
linksTextFormatter.setMessage(message);
|
|
396
|
+
linksTextFormatter.setId("ccDefaultUrlsFormatterId")
|
|
397
|
+
textFormatters.push(linksTextFormatter);
|
|
398
|
+
|
|
399
|
+
if (!additionalParams?.disableMentions && mentionedUsers && mentionedUsers.length ) {
|
|
400
|
+
|
|
401
|
+
let mentionsTextFormatter = ChatConfigurator.getDataSource().getMentionsFormatter(loggedInUser);
|
|
402
|
+
mentionsTextFormatter.setLoggedInUser(loggedInUser);
|
|
403
|
+
mentionsTextFormatter.setId("ccDefaultMentionFormatterId")
|
|
404
|
+
let isUserSentMessage = alignment === "right";
|
|
405
|
+
if (isUserSentMessage) {
|
|
406
|
+
mentionsTextFormatter.setMentionsStyle(
|
|
407
|
+
new MentionTextStyle({
|
|
408
|
+
loggedInUserTextStyle: {
|
|
409
|
+
color: theme.palette.getTertiary(),
|
|
410
|
+
...theme.typography.title2,
|
|
411
|
+
fontSize: 16
|
|
412
|
+
} as TextStyle,
|
|
413
|
+
textStyle: {
|
|
414
|
+
color: theme.palette.getTertiary(),
|
|
415
|
+
...theme.typography.subtitle1,
|
|
416
|
+
fontSize: 16
|
|
417
|
+
} as TextStyle,
|
|
418
|
+
})
|
|
419
|
+
);
|
|
420
|
+
} else {
|
|
421
|
+
mentionsTextFormatter.setMentionsStyle(
|
|
422
|
+
new MentionTextStyle({
|
|
423
|
+
loggedInUserTextStyle: {
|
|
424
|
+
color: theme.palette.getPrimary(),
|
|
425
|
+
...theme.typography.title2,
|
|
426
|
+
fontSize: 16
|
|
427
|
+
} as TextStyle,
|
|
428
|
+
textStyle: {
|
|
429
|
+
color: theme.palette.getPrimary(),
|
|
430
|
+
...theme.typography.subtitle1,
|
|
431
|
+
fontSize: 16
|
|
432
|
+
} as TextStyle,
|
|
433
|
+
})
|
|
434
|
+
);
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
textFormatters.push(mentionsTextFormatter);
|
|
438
|
+
|
|
430
439
|
}
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
440
|
+
|
|
441
|
+
let finalFormatters: any[] = [];
|
|
442
|
+
|
|
443
|
+
let customerHasPassedUrlsFormatter;
|
|
444
|
+
|
|
445
|
+
textFormatters.forEach(formatter => {
|
|
446
|
+
if (formatter instanceof CometChatUrlsFormatter) {
|
|
447
|
+
if (formatter.getId() !== "ccDefaultUrlsFormatterId") {
|
|
448
|
+
customerHasPassedUrlsFormatter = true
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
formatter.setMessage(message);
|
|
452
|
+
let suggestionUsers = formatter.getSuggestionItems();
|
|
453
|
+
suggestionUsers.length > 0 && formatter.setSuggestionItems(suggestionUsers);
|
|
454
|
+
let _formatter = CommonUtils.clone(formatter);
|
|
455
|
+
finalFormatters.push(_formatter);
|
|
456
|
+
})
|
|
457
|
+
|
|
458
|
+
if (customerHasPassedUrlsFormatter) {
|
|
459
|
+
let customUrlsIndex = finalFormatters.findIndex((formatter: CometChatTextFormatter[]) => (formatter instanceof CometChatUrlsFormatter && formatter.getId() === "ccDefaultUrlsFormatterId"));
|
|
460
|
+
if (customUrlsIndex > -1) {
|
|
461
|
+
finalFormatters.splice(customUrlsIndex, 1);
|
|
444
462
|
}
|
|
445
463
|
}
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
464
|
+
|
|
465
|
+
return <CometChatTextBubble
|
|
466
|
+
text={messageText}
|
|
467
|
+
style={{
|
|
468
|
+
backgroundColor: "transparent",
|
|
469
|
+
textFont: theme?.typography.body,
|
|
470
|
+
textColor: alignment == "right" ? theme?.palette.getSecondary() : theme?.palette?.getAccent(),
|
|
471
|
+
borderRadius: 8
|
|
472
|
+
}}
|
|
473
|
+
textFormatters={finalFormatters}
|
|
474
|
+
/>
|
|
452
475
|
|
|
453
|
-
if (customerHasPassedUrlsFormatter) {
|
|
454
|
-
let customUrlsIndex = finalFormatters.findIndex((formatter: CometChatTextFormatter[]) => (formatter instanceof CometChatUrlsFormatter && formatter.getId() === "ccDefaultUrlsFormatterId"));
|
|
455
|
-
if (customUrlsIndex > -1) {
|
|
456
|
-
finalFormatters.splice(customUrlsIndex, 1);
|
|
457
|
-
}
|
|
458
476
|
}
|
|
459
|
-
|
|
460
|
-
return <CometChatTextBubble
|
|
461
|
-
text={messageText}
|
|
462
|
-
style={{
|
|
463
|
-
backgroundColor: "transparent",
|
|
464
|
-
textFont: theme?.typography.body,
|
|
465
|
-
textColor: alignment == "right" ? theme?.palette.getSecondary() : theme?.palette?.getAccent(),
|
|
466
|
-
borderRadius: 8
|
|
467
|
-
}}
|
|
468
|
-
textFormatters={finalFormatters}
|
|
469
|
-
/>
|
|
477
|
+
return null
|
|
470
478
|
}
|
|
471
479
|
|
|
472
480
|
getFormMessageBubble(message: FormMessage, theme: CometChatTheme, style?: FormBubbleStyle, onSubmitClick?: (data: any) => void): JSX.Element {
|
|
@@ -493,7 +501,7 @@ export class MessageDataSource implements DataSource {
|
|
|
493
501
|
/>
|
|
494
502
|
}
|
|
495
503
|
|
|
496
|
-
getImageMessageBubble(imageUrl: string, caption: string, style: ImageBubbleStyleInterface, message: CometChat.MediaMessage, theme: CometChatTheme): JSX.Element {
|
|
504
|
+
getImageMessageBubble(imageUrl: string, caption: string, style: ImageBubbleStyleInterface, message: CometChat.MediaMessage, theme: CometChatTheme): JSX.Element | null {
|
|
497
505
|
if (isImageMessage(message)) {
|
|
498
506
|
return <CometChatImageBubble
|
|
499
507
|
imageUrl={{ uri: imageUrl }}
|
|
@@ -503,7 +511,7 @@ export class MessageDataSource implements DataSource {
|
|
|
503
511
|
return null;
|
|
504
512
|
}
|
|
505
513
|
|
|
506
|
-
getAudioMessageBubble(audioUrl: string, title: string, style: AudioBubbleStyleInterface, message: CometChat.MediaMessage, theme: CometChatTheme): JSX.Element {
|
|
514
|
+
getAudioMessageBubble(audioUrl: string, title: string, style: AudioBubbleStyleInterface, message: CometChat.MediaMessage, theme: CometChatTheme): JSX.Element | null {
|
|
507
515
|
if (isAudioMessage(message)) {
|
|
508
516
|
return <CometChatAudioBubble
|
|
509
517
|
audioUrl={audioUrl}
|
|
@@ -514,7 +522,7 @@ export class MessageDataSource implements DataSource {
|
|
|
514
522
|
return null;
|
|
515
523
|
}
|
|
516
524
|
|
|
517
|
-
getFileMessageBubble(fileUrl: string, title: string, style: FileBubbleStyleInterface, message: CometChat.MediaMessage, theme: CometChatTheme): JSX.Element {
|
|
525
|
+
getFileMessageBubble(fileUrl: string, title: string, style: FileBubbleStyleInterface, message: CometChat.MediaMessage, theme: CometChatTheme): JSX.Element | null {
|
|
518
526
|
if (isFileMessage(message)) {
|
|
519
527
|
return <CometChatFileBubble
|
|
520
528
|
fileUrl={fileUrl}
|
|
@@ -524,7 +532,7 @@ export class MessageDataSource implements DataSource {
|
|
|
524
532
|
}
|
|
525
533
|
return null;
|
|
526
534
|
}
|
|
527
|
-
getTextMessageContentView(message: CometChat.TextMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme, additionalParams?: AdditionalBubbleStylingParams): JSX.Element {
|
|
535
|
+
getTextMessageContentView(message: CometChat.TextMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme, additionalParams?: AdditionalBubbleStylingParams): JSX.Element | null {
|
|
528
536
|
return ChatConfigurator.dataSource.getTextMessageBubble(message.getText(), message, alignment, theme, additionalParams);
|
|
529
537
|
}
|
|
530
538
|
getFormMessageContentView(message: FormMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme): JSX.Element {
|
|
@@ -536,7 +544,7 @@ export class MessageDataSource implements DataSource {
|
|
|
536
544
|
getCardMessageContentView(message: CardMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme): JSX.Element {
|
|
537
545
|
return ChatConfigurator.dataSource.getCardMessageBubble(message, theme);
|
|
538
546
|
}
|
|
539
|
-
getAudioMessageContentView(message: CometChat.MediaMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme): JSX.Element {
|
|
547
|
+
getAudioMessageContentView(message: CometChat.MediaMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme): JSX.Element | null {
|
|
540
548
|
let attachment = message.getAttachment();
|
|
541
549
|
return ChatConfigurator.dataSource.getAudioMessageBubble(attachment.getUrl(), attachment.getName(), {
|
|
542
550
|
iconTint: theme?.palette?.getPrimary(),
|
|
@@ -547,11 +555,11 @@ export class MessageDataSource implements DataSource {
|
|
|
547
555
|
subtitleFont: theme?.typography.subtitle1,
|
|
548
556
|
}, message, theme);
|
|
549
557
|
}
|
|
550
|
-
getVideoMessageContentView(message: CometChat.MediaMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme): JSX.Element {
|
|
558
|
+
getVideoMessageContentView(message: CometChat.MediaMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme): JSX.Element | null {
|
|
551
559
|
let attachment = message.getAttachment();
|
|
552
560
|
return ChatConfigurator.dataSource.getVideoMessageBubble(
|
|
553
561
|
attachment.getUrl(),
|
|
554
|
-
|
|
562
|
+
'',
|
|
555
563
|
message,
|
|
556
564
|
theme,
|
|
557
565
|
{
|
|
@@ -561,7 +569,7 @@ export class MessageDataSource implements DataSource {
|
|
|
561
569
|
}
|
|
562
570
|
);
|
|
563
571
|
}
|
|
564
|
-
getImageMessageContentView(message: CometChat.MediaMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme): JSX.Element {
|
|
572
|
+
getImageMessageContentView(message: CometChat.MediaMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme): JSX.Element | null {
|
|
565
573
|
let attachment = message.getAttachment();
|
|
566
574
|
let url: string = attachment.getUrl();
|
|
567
575
|
if (url == undefined)
|
|
@@ -571,7 +579,7 @@ export class MessageDataSource implements DataSource {
|
|
|
571
579
|
backgroundColor: theme?.palette.getAccent50()
|
|
572
580
|
}, message, theme);
|
|
573
581
|
}
|
|
574
|
-
getFileMessageContentView(message: CometChat.MediaMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme): JSX.Element {
|
|
582
|
+
getFileMessageContentView(message: CometChat.MediaMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme): JSX.Element | null {
|
|
575
583
|
let attachment = message.getAttachment();
|
|
576
584
|
return ChatConfigurator.dataSource.getFileMessageBubble(attachment.getUrl(), attachment.getName(),
|
|
577
585
|
{
|
|
@@ -589,7 +597,7 @@ export class MessageDataSource implements DataSource {
|
|
|
589
597
|
return new CometChatMessageTemplate({
|
|
590
598
|
type: MessageTypeConstants.text,
|
|
591
599
|
category: MessageCategoryConstants.message,
|
|
592
|
-
ContentView: (message: CometChat.BaseMessage, _alignment
|
|
600
|
+
ContentView: (message: CometChat.BaseMessage, _alignment?: MessageBubbleAlignmentType) => {
|
|
593
601
|
if (isDeletedMessage(message)) {
|
|
594
602
|
return ChatConfigurator.dataSource.getDeleteMessageBubble(message, theme);
|
|
595
603
|
} else {
|
|
@@ -597,7 +605,7 @@ export class MessageDataSource implements DataSource {
|
|
|
597
605
|
}
|
|
598
606
|
},
|
|
599
607
|
options: (loggedInuser, message, group) => ChatConfigurator.dataSource.getTextMessageOptions(loggedInuser, message, group),
|
|
600
|
-
BottomView: (message: CometChat.BaseMessage, alignment
|
|
608
|
+
BottomView: (message: CometChat.BaseMessage, alignment?: MessageBubbleAlignmentType) => {
|
|
601
609
|
return ChatConfigurator.dataSource.getBottomView(message, alignment);
|
|
602
610
|
}
|
|
603
611
|
});
|
|
@@ -607,7 +615,7 @@ export class MessageDataSource implements DataSource {
|
|
|
607
615
|
return new CometChatMessageTemplate({
|
|
608
616
|
type: MessageTypeConstants.form,
|
|
609
617
|
category: MessageCategoryConstants.interactive,
|
|
610
|
-
ContentView: (message: CometChat.BaseMessage, _alignment
|
|
618
|
+
ContentView: (message: CometChat.BaseMessage, _alignment?: MessageBubbleAlignmentType) => {
|
|
611
619
|
if (isDeletedMessage(message)) {
|
|
612
620
|
return ChatConfigurator.dataSource.getDeleteMessageBubble(message, theme);
|
|
613
621
|
} else {
|
|
@@ -615,7 +623,7 @@ export class MessageDataSource implements DataSource {
|
|
|
615
623
|
}
|
|
616
624
|
},
|
|
617
625
|
options: (loggedInuser, message, group) => ChatConfigurator.dataSource.getFormMessageOptions(loggedInuser, message, group),
|
|
618
|
-
BottomView: (message: CometChat.BaseMessage, alignment
|
|
626
|
+
BottomView: (message: CometChat.BaseMessage, alignment?: MessageBubbleAlignmentType) => {
|
|
619
627
|
return ChatConfigurator.dataSource.getBottomView(message, alignment);
|
|
620
628
|
}
|
|
621
629
|
});
|
|
@@ -625,7 +633,7 @@ export class MessageDataSource implements DataSource {
|
|
|
625
633
|
return new CometChatMessageTemplate({
|
|
626
634
|
type: MessageTypeConstants.scheduler,
|
|
627
635
|
category: MessageCategoryConstants.interactive,
|
|
628
|
-
ContentView: (message: CometChat.BaseMessage, _alignment
|
|
636
|
+
ContentView: (message: CometChat.BaseMessage, _alignment?: MessageBubbleAlignmentType) => {
|
|
629
637
|
if (isDeletedMessage(message)) {
|
|
630
638
|
return ChatConfigurator.dataSource.getDeleteMessageBubble(message, theme);
|
|
631
639
|
} else {
|
|
@@ -633,7 +641,7 @@ export class MessageDataSource implements DataSource {
|
|
|
633
641
|
}
|
|
634
642
|
},
|
|
635
643
|
options: (loggedInuser, message, group) => ChatConfigurator.dataSource.getSchedulerMessageOptions(loggedInuser, message, group),
|
|
636
|
-
BottomView: (message: CometChat.BaseMessage, alignment
|
|
644
|
+
BottomView: (message: CometChat.BaseMessage, alignment?: MessageBubbleAlignmentType) => {
|
|
637
645
|
return ChatConfigurator.dataSource.getBottomView(message, alignment);
|
|
638
646
|
}
|
|
639
647
|
});
|
|
@@ -643,7 +651,7 @@ export class MessageDataSource implements DataSource {
|
|
|
643
651
|
return new CometChatMessageTemplate({
|
|
644
652
|
type: MessageTypeConstants.card,
|
|
645
653
|
category: MessageCategoryConstants.interactive,
|
|
646
|
-
ContentView: (message: CometChat.BaseMessage, _alignment
|
|
654
|
+
ContentView: (message: CometChat.BaseMessage, _alignment?: MessageBubbleAlignmentType) => {
|
|
647
655
|
if (isDeletedMessage(message)) {
|
|
648
656
|
return ChatConfigurator.dataSource.getDeleteMessageBubble(message, theme);
|
|
649
657
|
} else {
|
|
@@ -651,7 +659,7 @@ export class MessageDataSource implements DataSource {
|
|
|
651
659
|
}
|
|
652
660
|
},
|
|
653
661
|
options: (loggedInuser, message, group) => ChatConfigurator.dataSource.getCardMessageOptions(loggedInuser, message, group),
|
|
654
|
-
BottomView: (message: CometChat.BaseMessage, alignment
|
|
662
|
+
BottomView: (message: CometChat.BaseMessage, alignment?: MessageBubbleAlignmentType) => {
|
|
655
663
|
return ChatConfigurator.dataSource.getBottomView(message, alignment);
|
|
656
664
|
}
|
|
657
665
|
});
|
|
@@ -661,14 +669,14 @@ export class MessageDataSource implements DataSource {
|
|
|
661
669
|
return new CometChatMessageTemplate({
|
|
662
670
|
type: MessageTypeConstants.audio,
|
|
663
671
|
category: MessageCategoryConstants.message,
|
|
664
|
-
ContentView: (message: CometChat.BaseMessage, alignment
|
|
672
|
+
ContentView: (message: CometChat.BaseMessage, alignment?: MessageBubbleAlignmentType) => {
|
|
665
673
|
if (isDeletedMessage(message)) {
|
|
666
674
|
return ChatConfigurator.dataSource.getDeleteMessageBubble(message, theme);
|
|
667
675
|
} else
|
|
668
676
|
return ChatConfigurator.dataSource.getAudioMessageContentView(message, alignment, theme);
|
|
669
677
|
},
|
|
670
678
|
options: (loggedInuser, message, group) => ChatConfigurator.dataSource.getAudioMessageOptions(loggedInuser, message, group),
|
|
671
|
-
BottomView: (message: CometChat.BaseMessage, alignment
|
|
679
|
+
BottomView: (message: CometChat.BaseMessage, alignment?: MessageBubbleAlignmentType) => {
|
|
672
680
|
return ChatConfigurator.dataSource.getBottomView(message, alignment);
|
|
673
681
|
}
|
|
674
682
|
})
|
|
@@ -677,14 +685,14 @@ export class MessageDataSource implements DataSource {
|
|
|
677
685
|
return new CometChatMessageTemplate({
|
|
678
686
|
type: MessageTypeConstants.video,
|
|
679
687
|
category: MessageCategoryConstants.message,
|
|
680
|
-
ContentView: (message: CometChat.BaseMessage, alignment
|
|
688
|
+
ContentView: (message: CometChat.BaseMessage, alignment?: MessageBubbleAlignmentType) => {
|
|
681
689
|
if (isDeletedMessage(message)) {
|
|
682
690
|
return ChatConfigurator.dataSource.getDeleteMessageBubble(message, theme);
|
|
683
691
|
} else
|
|
684
692
|
return ChatConfigurator.dataSource.getVideoMessageContentView(message, alignment, theme);
|
|
685
693
|
},
|
|
686
694
|
options: (loggedInuser, message, group) => ChatConfigurator.dataSource.getVideoMessageOptions(loggedInuser, message, group),
|
|
687
|
-
BottomView: (message: CometChat.BaseMessage, alignment
|
|
695
|
+
BottomView: (message: CometChat.BaseMessage, alignment?: MessageBubbleAlignmentType) => {
|
|
688
696
|
return ChatConfigurator.dataSource.getBottomView(message, alignment);
|
|
689
697
|
}
|
|
690
698
|
})
|
|
@@ -693,14 +701,14 @@ export class MessageDataSource implements DataSource {
|
|
|
693
701
|
return new CometChatMessageTemplate({
|
|
694
702
|
type: MessageTypeConstants.image,
|
|
695
703
|
category: MessageCategoryConstants.message,
|
|
696
|
-
ContentView: (message: CometChat.BaseMessage, alignment
|
|
704
|
+
ContentView: (message: CometChat.BaseMessage, alignment?: MessageBubbleAlignmentType) => {
|
|
697
705
|
if (isDeletedMessage(message)) {
|
|
698
706
|
return ChatConfigurator.dataSource.getDeleteMessageBubble(message, theme);
|
|
699
707
|
} else
|
|
700
708
|
return ChatConfigurator.dataSource.getImageMessageContentView(message, alignment, theme);
|
|
701
709
|
},
|
|
702
710
|
options: (loggedInuser, message, group) => ChatConfigurator.dataSource.getImageMessageOptions(loggedInuser, message, group),
|
|
703
|
-
BottomView: (message: CometChat.BaseMessage, alignment
|
|
711
|
+
BottomView: (message: CometChat.BaseMessage, alignment?: MessageBubbleAlignmentType) => {
|
|
704
712
|
return ChatConfigurator.dataSource.getBottomView(message, alignment);
|
|
705
713
|
}
|
|
706
714
|
})
|
|
@@ -709,14 +717,14 @@ export class MessageDataSource implements DataSource {
|
|
|
709
717
|
return new CometChatMessageTemplate({
|
|
710
718
|
type: MessageTypeConstants.file,
|
|
711
719
|
category: MessageCategoryConstants.message,
|
|
712
|
-
ContentView: (message: CometChat.BaseMessage, alignment
|
|
720
|
+
ContentView: (message: CometChat.BaseMessage, alignment?: MessageBubbleAlignmentType) => {
|
|
713
721
|
if (isDeletedMessage(message)) {
|
|
714
722
|
return ChatConfigurator.dataSource.getDeleteMessageBubble(message, theme);
|
|
715
723
|
} else
|
|
716
724
|
return ChatConfigurator.dataSource.getFileMessageContentView(message, alignment, theme);
|
|
717
725
|
},
|
|
718
726
|
options: (loggedInuser, message, group) => ChatConfigurator.dataSource.getFileMessageOptions(loggedInuser, message, group),
|
|
719
|
-
BottomView: (message: CometChat.BaseMessage, alignment
|
|
727
|
+
BottomView: (message: CometChat.BaseMessage, alignment?: MessageBubbleAlignmentType) => {
|
|
720
728
|
return ChatConfigurator.dataSource.getBottomView(message, alignment);
|
|
721
729
|
}
|
|
722
730
|
});
|
|
@@ -726,13 +734,13 @@ export class MessageDataSource implements DataSource {
|
|
|
726
734
|
type: MessageTypeConstants.groupMember,
|
|
727
735
|
category: MessageCategoryConstants.action,
|
|
728
736
|
ContentView: (message: CometChat.BaseMessage,
|
|
729
|
-
alignment
|
|
737
|
+
alignment?: MessageBubbleAlignmentType) => {
|
|
730
738
|
return ChatConfigurator.dataSource.getGroupActionBubble(message, theme);
|
|
731
739
|
}
|
|
732
740
|
});
|
|
733
741
|
}
|
|
734
742
|
|
|
735
|
-
getAllMessageTemplates(theme: CometChatTheme, additionalParams?: AdditionalBubbleStylingParams): CometChatMessageTemplate[] {
|
|
743
|
+
getAllMessageTemplates(theme: CometChatTheme, additionalParams?: AdditionalBubbleStylingParams): CometChatMessageTemplate[] | any[] {
|
|
736
744
|
return [
|
|
737
745
|
ChatConfigurator.dataSource.getTextMessageTemplate(theme, additionalParams),
|
|
738
746
|
ChatConfigurator.dataSource.getFormMessageTemplate(theme),
|
|
@@ -746,9 +754,9 @@ export class MessageDataSource implements DataSource {
|
|
|
746
754
|
];
|
|
747
755
|
}
|
|
748
756
|
|
|
749
|
-
getMessageTemplate(messageType: string, MessageCategory: string, theme: CometChatTheme): CometChatMessageTemplate {
|
|
757
|
+
getMessageTemplate(messageType: string, MessageCategory: string, theme: CometChatTheme): CometChatMessageTemplate | null {
|
|
750
758
|
// let _theme: CometChatTheme = useContext("theme") ???
|
|
751
|
-
let template
|
|
759
|
+
let template!: CometChatMessageTemplate | null;
|
|
752
760
|
|
|
753
761
|
//in case of call message return undefined
|
|
754
762
|
if (MessageCategory == MessageCategoryConstants.call) return template;
|
|
@@ -803,7 +811,7 @@ export class MessageDataSource implements DataSource {
|
|
|
803
811
|
getAuxiliaryOptions(user: CometChat.User, group: CometChat.Group, id: Map<string, any>, theme?: CometChatTheme): JSX.Element[] {
|
|
804
812
|
return [];
|
|
805
813
|
}
|
|
806
|
-
getAuxiliaryHeaderAppbarOptions(user?: CometChat.User, group?: CometChat.Group): JSX.Element {
|
|
814
|
+
getAuxiliaryHeaderAppbarOptions(user?: CometChat.User, group?: CometChat.Group): JSX.Element | null {
|
|
807
815
|
return null;
|
|
808
816
|
}
|
|
809
817
|
getId(): string {
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import { DataSource } from
|
|
2
|
-
import { ChatConfigurator } from
|
|
3
|
-
import { MessageDataSource } from
|
|
4
|
-
import { ExtensionsDataSource } from
|
|
5
|
-
import { DataSourceDecorator } from
|
|
6
|
-
export {
|
|
1
|
+
import { DataSource } from "./DataSource";
|
|
2
|
+
import { ChatConfigurator } from "./ChatConfigurator";
|
|
3
|
+
import { MessageDataSource } from "./MessageDataSource";
|
|
4
|
+
import { ExtensionsDataSource } from "./ExtensionsDataSource";
|
|
5
|
+
import { DataSourceDecorator } from "./DataSourceDecorator";
|
|
6
|
+
export {
|
|
7
|
+
MessageDataSource,
|
|
8
|
+
ChatConfigurator,
|
|
9
|
+
ExtensionsDataSource,
|
|
10
|
+
DataSourceDecorator,
|
|
11
|
+
};
|
|
12
|
+
export type { DataSource };
|
|
@@ -1,23 +1,43 @@
|
|
|
1
|
+
//@ts-ignore
|
|
1
2
|
import HEART from'./heart.png'
|
|
3
|
+
//@ts-ignore
|
|
2
4
|
import SEND from './send_message.png'
|
|
5
|
+
//@ts-ignore
|
|
3
6
|
import EMOJI from './emoji.png'
|
|
7
|
+
//@ts-ignore
|
|
4
8
|
import ADD from './circle_add.png'
|
|
9
|
+
//@ts-ignore
|
|
5
10
|
import IMAGE from './image.png'
|
|
11
|
+
//@ts-ignore
|
|
6
12
|
import AUDIO from "./audio-file.png";
|
|
13
|
+
//@ts-ignore
|
|
7
14
|
import VIDEO from "./video_upload.png";
|
|
15
|
+
//@ts-ignore
|
|
8
16
|
import FILE from "./file_upload.png";
|
|
17
|
+
//@ts-ignore
|
|
9
18
|
import EDIT from "./edit.png";
|
|
19
|
+
//@ts-ignore
|
|
10
20
|
import DELETE from "./delete.png";
|
|
21
|
+
//@ts-ignore
|
|
11
22
|
import COPY from "./copy.png";
|
|
23
|
+
//@ts-ignore
|
|
12
24
|
import SHARE from "./share.png";
|
|
25
|
+
//@ts-ignore
|
|
13
26
|
import INFO from "./info.png";
|
|
14
27
|
// import FORWARD from "./forward.png";
|
|
28
|
+
//@ts-ignore
|
|
15
29
|
import THREAD from "./thread.png";
|
|
30
|
+
//@ts-ignore
|
|
16
31
|
import REPLY from "./reply.png";
|
|
32
|
+
//@ts-ignore
|
|
17
33
|
import PRIVATE_MESSAGE from "./messageInPrivate.png";
|
|
34
|
+
//@ts-ignore
|
|
18
35
|
import PLAY from "./play.png";
|
|
36
|
+
//@ts-ignore
|
|
19
37
|
import PAUSE from "./pause.png";
|
|
38
|
+
//@ts-ignore
|
|
20
39
|
import STOP_PLAYER from "./stop_player.png";
|
|
40
|
+
//@ts-ignore
|
|
21
41
|
import MICROPHONE from "./microphone.png";
|
|
22
42
|
|
|
23
43
|
export const ICONS ={
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { anyObject } from "../utils";
|
|
2
|
+
|
|
3
|
+
export const getFilteredStyles = <T>(style: T|any, arrayOfKeys: string[]): T => {
|
|
4
|
+
let overrideStyle: any = {};
|
|
5
|
+
arrayOfKeys.forEach((element: any) => {
|
|
4
6
|
if (style && style[element]) overrideStyle[element] = style[element];
|
|
5
7
|
});
|
|
6
8
|
return overrideStyle as T;
|
|
@@ -8,9 +10,9 @@ export const getFilteredStyles = <T>(style: T, arrayOfKeys: string[]): T => {
|
|
|
8
10
|
|
|
9
11
|
export const getFilteredStylesWithKeySwap = <T>(
|
|
10
12
|
style: any,
|
|
11
|
-
objectOfKeys:
|
|
13
|
+
objectOfKeys: anyObject
|
|
12
14
|
): T => {
|
|
13
|
-
let overrideStyle = {};
|
|
15
|
+
let overrideStyle: any = {};
|
|
14
16
|
for (const key in objectOfKeys) {
|
|
15
17
|
if (style[key]) overrideStyle[objectOfKeys[key]] = style[key];
|
|
16
18
|
}
|