@cometchat/chat-uikit-react-native 4.3.16 → 4.3.17
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 +12 -12
- package/src/CometChatAddMembers/index.ts +10 -8
- package/src/CometChatBannedMembers/BannedMembersConfiguration.tsx +1 -0
- package/src/CometChatBannedMembers/CometChatBannedMembers.tsx +8 -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 +204 -172
- package/src/CometChatConversations/index.ts +21 -10
- package/src/CometChatConversations/resources/index.ts +14 -0
- package/src/CometChatConversationsWithMessages/CometChatConversationsWithMessages.tsx +6 -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 +52 -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 +214 -195
- package/src/CometChatMessageList/MessageListConfiguration.ts +26 -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 +76 -0
- 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 +103 -15
- 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 +19 -12
- 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
|
@@ -10,6 +10,8 @@ import {
|
|
|
10
10
|
KeyboardAvoidingViewProps,
|
|
11
11
|
Dimensions,
|
|
12
12
|
Text,
|
|
13
|
+
ViewProps,
|
|
14
|
+
TextStyle,
|
|
13
15
|
} from 'react-native';
|
|
14
16
|
import { Style } from './styles';
|
|
15
17
|
import {
|
|
@@ -28,8 +30,9 @@ import {
|
|
|
28
30
|
CometChatSuggestionList,
|
|
29
31
|
SuggestionItem,
|
|
30
32
|
CometChatUIKit,
|
|
33
|
+
CometChatMessageOption,
|
|
31
34
|
} from '../shared';
|
|
32
|
-
|
|
35
|
+
//@ts-ignore
|
|
33
36
|
import { CheckPropertyExists } from '../shared/helper/functions';
|
|
34
37
|
//@ts-ignore
|
|
35
38
|
import { CometChat } from '@cometchat/chat-sdk-react-native';
|
|
@@ -593,8 +596,8 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
593
596
|
const composerIdMap = new Map().set('parentMessageId', parentMessageId);
|
|
594
597
|
const defaultAuxiliaryButtonOptions =
|
|
595
598
|
ChatConfigurator.getDataSource().getAuxiliaryOptions(
|
|
596
|
-
user,
|
|
597
|
-
group,
|
|
599
|
+
user as CometChat.User,
|
|
600
|
+
group as CometChat.Group,
|
|
598
601
|
composerIdMap,
|
|
599
602
|
theme
|
|
600
603
|
);
|
|
@@ -622,10 +625,10 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
622
625
|
const [AIOptionItems, setAIOptionItems] = React.useState([]);
|
|
623
626
|
const [rootAIOptionItems, setRootAIOptionItems] = React.useState([]);
|
|
624
627
|
const [actionSheetItems, setActionSheetItems] = React.useState([]);
|
|
625
|
-
const [messagePreview, setMessagePreview] = React.useState(null);
|
|
626
|
-
const [CustomView, setCustomView] = React.useState(null);
|
|
627
|
-
const [CustomViewHeader, setCustomViewHeader] = React.useState(null);
|
|
628
|
-
const [CustomViewFooter, setCustomViewFooter] = React.useState(null);
|
|
628
|
+
const [messagePreview, setMessagePreview] = React.useState<any>(null);
|
|
629
|
+
const [CustomView, setCustomView] = React.useState<any>(null);
|
|
630
|
+
const [CustomViewHeader, setCustomViewHeader] = React.useState<any>(null);
|
|
631
|
+
const [CustomViewFooter, setCustomViewFooter] = React.useState<any>(null);
|
|
629
632
|
const [isVisible, setIsVisible] = React.useState(false);
|
|
630
633
|
const [kbOffset, setKbOffset] = React.useState(59);
|
|
631
634
|
const [showMentionList, setShowMentionList] = React.useState(false);
|
|
@@ -637,10 +640,10 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
637
640
|
useLayoutEffect(() => {
|
|
638
641
|
if (Platform.OS === "ios") {
|
|
639
642
|
if (Number.isInteger(commonVars.safeAreaInsets.top)) {
|
|
640
|
-
setKbOffset(commonVars.safeAreaInsets.top)
|
|
643
|
+
setKbOffset(commonVars.safeAreaInsets.top as number);
|
|
641
644
|
return;
|
|
642
645
|
}
|
|
643
|
-
CommonUtil.getSafeAreaInsets().then(res => {
|
|
646
|
+
CommonUtil.getSafeAreaInsets().then((res: any) => {
|
|
644
647
|
if (Number.isInteger(res.top)) {
|
|
645
648
|
commonVars.safeAreaInsets.top = res.top;
|
|
646
649
|
commonVars.safeAreaInsets.bottom = res.bottom;
|
|
@@ -662,7 +665,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
662
665
|
...aiOptionsStyle,
|
|
663
666
|
})
|
|
664
667
|
|
|
665
|
-
|
|
668
|
+
let isTyping = useRef<any>(null);
|
|
666
669
|
|
|
667
670
|
/**
|
|
668
671
|
* Event callback
|
|
@@ -678,7 +681,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
678
681
|
|
|
679
682
|
let rawText = message?.text;
|
|
680
683
|
|
|
681
|
-
let users:
|
|
684
|
+
let users: any = {};
|
|
682
685
|
let regexes: Array<RegExp> = [];
|
|
683
686
|
|
|
684
687
|
allFormatters.current.forEach((formatter: CometChatTextFormatter, key) => {
|
|
@@ -692,7 +695,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
692
695
|
textComponents = resp;
|
|
693
696
|
})
|
|
694
697
|
|
|
695
|
-
let edits = [];
|
|
698
|
+
let edits: any[] = [];
|
|
696
699
|
|
|
697
700
|
regexes.forEach(regex => {
|
|
698
701
|
let match;
|
|
@@ -779,7 +782,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
779
782
|
}
|
|
780
783
|
}
|
|
781
784
|
else if (Platform.OS === 'ios' && fileType === MessageTypeConstants.video) {
|
|
782
|
-
NativeModules.VideoPickerModule.pickVideo(((file) => {
|
|
785
|
+
NativeModules.VideoPickerModule.pickVideo(((file: any) => {
|
|
783
786
|
if (file.uri)
|
|
784
787
|
sendMediaMessage(
|
|
785
788
|
chatWithId.current,
|
|
@@ -867,7 +870,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
867
870
|
|
|
868
871
|
let finalTextInput = getRegexString(plainTextInput.current);
|
|
869
872
|
|
|
870
|
-
let textMessage = new CometChat.TextMessage(
|
|
873
|
+
let textMessage: any = new CometChat.TextMessage(
|
|
871
874
|
chatWithId.current,
|
|
872
875
|
finalTextInput,
|
|
873
876
|
chatWith.current
|
|
@@ -981,7 +984,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
981
984
|
receiverType?: any
|
|
982
985
|
) => {
|
|
983
986
|
setShowActionSheet(false);
|
|
984
|
-
let mediaMessage = new CometChat.MediaMessage(
|
|
987
|
+
let mediaMessage: any = new CometChat.MediaMessage(
|
|
985
988
|
receiverId,
|
|
986
989
|
messageInput,
|
|
987
990
|
messageType,
|
|
@@ -1002,7 +1005,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1002
1005
|
});
|
|
1003
1006
|
parentMessageId && mediaMessage.setParentMessageId(parentMessageId as number);
|
|
1004
1007
|
|
|
1005
|
-
let localMessage = new CometChat.MediaMessage(
|
|
1008
|
+
let localMessage: any = new CometChat.MediaMessage(
|
|
1006
1009
|
receiverId,
|
|
1007
1010
|
messageInput,
|
|
1008
1011
|
messageType,
|
|
@@ -1132,7 +1135,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1132
1135
|
}
|
|
1133
1136
|
|
|
1134
1137
|
const AuxiliaryButtonViewElem = () => {
|
|
1135
|
-
if (AuxiliaryButtonView)
|
|
1138
|
+
if (AuxiliaryButtonView && id)
|
|
1136
1139
|
return (
|
|
1137
1140
|
<AuxiliaryButtonView user={user} group={group} composerId={id} />
|
|
1138
1141
|
);
|
|
@@ -1147,7 +1150,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1147
1150
|
};
|
|
1148
1151
|
|
|
1149
1152
|
const SendButtonViewElem = () => {
|
|
1150
|
-
if (SendButtonView)
|
|
1153
|
+
if (SendButtonView && id)
|
|
1151
1154
|
return <SendButtonView user={user} group={group} composerId={id} />;
|
|
1152
1155
|
return (
|
|
1153
1156
|
<ImageButton
|
|
@@ -1156,7 +1159,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1156
1159
|
Style.imageStyle,
|
|
1157
1160
|
{
|
|
1158
1161
|
tintColor: ((inputMessage as String).length === 0) ? theme.palette.getAccent400() :
|
|
1159
|
-
messageComposerStyle
|
|
1162
|
+
messageComposerStyle?.sendIconTint ||
|
|
1160
1163
|
theme.palette.getPrimary(),
|
|
1161
1164
|
},
|
|
1162
1165
|
]}
|
|
@@ -1167,7 +1170,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1167
1170
|
};
|
|
1168
1171
|
|
|
1169
1172
|
const SecondaryButtonViewElem = () => {
|
|
1170
|
-
if (SecondaryButtonView)
|
|
1173
|
+
if (SecondaryButtonView && id)
|
|
1171
1174
|
return (
|
|
1172
1175
|
<SecondaryButtonView user={user} group={group} composerId={id} />
|
|
1173
1176
|
);
|
|
@@ -1180,7 +1183,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1180
1183
|
height: 23,
|
|
1181
1184
|
width: 23,
|
|
1182
1185
|
resizeMode: 'contain',
|
|
1183
|
-
tintColor: messageComposerStyle
|
|
1186
|
+
tintColor: messageComposerStyle?.attachIconTint
|
|
1184
1187
|
? messageComposerStyle.attachIconTint
|
|
1185
1188
|
: theme.palette.getAccent(),
|
|
1186
1189
|
}}
|
|
@@ -1224,34 +1227,34 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1224
1227
|
|
|
1225
1228
|
//fetch logged in user
|
|
1226
1229
|
useEffect(() => {
|
|
1227
|
-
CometChat.getLoggedinUser().then((user) => (loggedInUser.current = user));
|
|
1230
|
+
CometChat.getLoggedinUser().then((user: any) => (loggedInUser.current = user));
|
|
1228
1231
|
let _formatter = [...(textFormatters || [])] || [];
|
|
1229
1232
|
|
|
1230
1233
|
if (!disableMentions) {
|
|
1231
1234
|
let mentionsFormatter = ChatConfigurator.getDataSource().getMentionsFormatter();
|
|
1232
|
-
mentionsFormatter.setLoggedInUser(CometChatUIKit.loggedInUser);
|
|
1235
|
+
CometChatUIKit.loggedInUser && mentionsFormatter.setLoggedInUser(CometChatUIKit.loggedInUser);
|
|
1233
1236
|
mentionsFormatter.setMentionsStyle(new MentionTextStyle({
|
|
1234
1237
|
loggedInUserTextStyle: {
|
|
1235
1238
|
color: theme.palette.getPrimary(),
|
|
1236
1239
|
...theme.typography.title2,
|
|
1237
1240
|
fontSize: 17
|
|
1238
|
-
},
|
|
1241
|
+
} as TextStyle,
|
|
1239
1242
|
textStyle: {
|
|
1240
1243
|
color: theme.palette.getPrimary(),
|
|
1241
1244
|
...theme.typography.subtitle1,
|
|
1242
1245
|
fontSize: 17
|
|
1243
|
-
}
|
|
1246
|
+
} as TextStyle
|
|
1244
1247
|
}));
|
|
1245
|
-
mentionsFormatter.setUser(user);
|
|
1246
|
-
mentionsFormatter.setGroup(group);
|
|
1248
|
+
user && mentionsFormatter.setUser(user);
|
|
1249
|
+
group && mentionsFormatter.setGroup(group);
|
|
1247
1250
|
|
|
1248
1251
|
_formatter.unshift(mentionsFormatter)
|
|
1249
1252
|
}
|
|
1250
1253
|
|
|
1251
1254
|
_formatter.forEach((formatter) => {
|
|
1252
|
-
formatter.setComposerId(id);
|
|
1253
|
-
formatter.setUser(user);
|
|
1254
|
-
formatter.setGroup(group);
|
|
1255
|
+
id && formatter.setComposerId(id);
|
|
1256
|
+
user && formatter.setUser(user);
|
|
1257
|
+
group && formatter.setGroup(group);
|
|
1255
1258
|
let trackingCharacter = formatter.getTrackingCharacter();
|
|
1256
1259
|
trackingCharacters.current.push(trackingCharacter);
|
|
1257
1260
|
|
|
@@ -1279,7 +1282,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1279
1282
|
}
|
|
1280
1283
|
}, [user, group, chatRef]);
|
|
1281
1284
|
|
|
1282
|
-
const handleOnClick = (CustomView) => {
|
|
1285
|
+
const handleOnClick = (CustomView: any) => {
|
|
1283
1286
|
let view = CustomView(
|
|
1284
1287
|
user,
|
|
1285
1288
|
group,
|
|
@@ -1313,14 +1316,14 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1313
1316
|
if (typeof item.onPress == 'function')
|
|
1314
1317
|
return {
|
|
1315
1318
|
...item,
|
|
1316
|
-
onPress: () => item.onPress(user, group),
|
|
1319
|
+
onPress: () => item.onPress?.(user, group),
|
|
1317
1320
|
};
|
|
1318
1321
|
return {
|
|
1319
1322
|
...item,
|
|
1320
1323
|
onPress: () => fileInputHandler(item.id),
|
|
1321
1324
|
};
|
|
1322
1325
|
})
|
|
1323
|
-
: defaultAttachmentOptions.map((item) => {
|
|
1326
|
+
: defaultAttachmentOptions.map((item: any) => {
|
|
1324
1327
|
if (typeof item.CustomView === 'function')
|
|
1325
1328
|
return {
|
|
1326
1329
|
...item,
|
|
@@ -1338,21 +1341,21 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1338
1341
|
})
|
|
1339
1342
|
);
|
|
1340
1343
|
|
|
1341
|
-
const aiOptions = ChatConfigurator.dataSource.getAIOptions(user, group, theme, composerIdMap, AIStyles);
|
|
1342
|
-
let newAiOptions = _getAIOptions(aiOptions);
|
|
1344
|
+
const aiOptions = ChatConfigurator.dataSource.getAIOptions(user as CometChat.User, group as CometChat.Group, theme, composerIdMap, AIStyles);
|
|
1345
|
+
let newAiOptions: any = _getAIOptions(aiOptions);
|
|
1343
1346
|
setAIOptionItems(newAiOptions);
|
|
1344
1347
|
setRootAIOptionItems(newAiOptions);
|
|
1345
1348
|
}, [user, group, id, parentMessageId]);
|
|
1346
1349
|
|
|
1347
|
-
const _getAIOptions = (options) => {
|
|
1350
|
+
const _getAIOptions = (options: (CometChatMessageOption | CometChatMessageComposerActionInterface)[]) => {
|
|
1348
1351
|
let newOptions = [...options];
|
|
1349
|
-
let newAiOptions = newOptions.map((item) => {
|
|
1352
|
+
let newAiOptions = newOptions.map((item: any) => {
|
|
1350
1353
|
if (typeof item.onPress === 'function')
|
|
1351
1354
|
return {
|
|
1352
1355
|
...item,
|
|
1353
1356
|
onPress: () => {
|
|
1354
1357
|
setShowAIOptions(false)
|
|
1355
|
-
item
|
|
1358
|
+
item?.onPress?.(user)
|
|
1356
1359
|
},
|
|
1357
1360
|
};
|
|
1358
1361
|
return {
|
|
@@ -1366,12 +1369,12 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1366
1369
|
|
|
1367
1370
|
useEffect(() => {
|
|
1368
1371
|
CometChatUIEventHandler.addMessageListener(editMessageListenerID, {
|
|
1369
|
-
ccMessageEdited: (item) => previewMessage(item),
|
|
1372
|
+
ccMessageEdited: (item: any) => previewMessage(item),
|
|
1370
1373
|
});
|
|
1371
1374
|
CometChatUIEventHandler.addUIListener(UiEventListenerID, {
|
|
1372
1375
|
ccToggleBottomSheet: (item) => {
|
|
1373
1376
|
if (item?.bots) {
|
|
1374
|
-
let newAiOptions = _getAIOptions(item.bots)
|
|
1377
|
+
let newAiOptions: any = _getAIOptions(item.bots)
|
|
1375
1378
|
setAIOptionItems(newAiOptions);
|
|
1376
1379
|
setShowAIOptions(true)
|
|
1377
1380
|
return;
|
|
@@ -1403,7 +1406,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1403
1406
|
}
|
|
1404
1407
|
}, []);
|
|
1405
1408
|
|
|
1406
|
-
const handlePannel = (item) => {
|
|
1409
|
+
const handlePannel = (item: any) => {
|
|
1407
1410
|
if (item.child) {
|
|
1408
1411
|
if (item.alignment === ViewAlignment.composerTop)
|
|
1409
1412
|
setCustomViewHeader(() => item.child);
|
|
@@ -1446,7 +1449,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1446
1449
|
console.log("Send Audio");
|
|
1447
1450
|
}
|
|
1448
1451
|
|
|
1449
|
-
function isCursorWithinMentionRange(mentionRanges, cursorPosition) {
|
|
1452
|
+
function isCursorWithinMentionRange(mentionRanges: any, cursorPosition: number) {
|
|
1450
1453
|
for (let [range, mention] of mentionRanges) {
|
|
1451
1454
|
const [start, end] = range.split('_').map(Number);
|
|
1452
1455
|
if (cursorPosition >= start && cursorPosition <= end) {
|
|
@@ -1468,7 +1471,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1468
1471
|
)
|
|
1469
1472
|
}
|
|
1470
1473
|
|
|
1471
|
-
let timeoutId;
|
|
1474
|
+
let timeoutId: any;
|
|
1472
1475
|
const openList = (selection: {
|
|
1473
1476
|
start: number;
|
|
1474
1477
|
end: number;
|
|
@@ -1490,7 +1493,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1490
1493
|
formatter.search(searchString);
|
|
1491
1494
|
}
|
|
1492
1495
|
} else {
|
|
1493
|
-
formatter
|
|
1496
|
+
formatter?.search(searchString);
|
|
1494
1497
|
}
|
|
1495
1498
|
|
|
1496
1499
|
} else {
|
|
@@ -1593,7 +1596,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1593
1596
|
newMentionMap.delete(newKey);
|
|
1594
1597
|
|
|
1595
1598
|
if (!ifIdExists(value.id, newMentionMap)) {
|
|
1596
|
-
let targetedFormatter = allFormatters.current.get(value.trackingCharacter);
|
|
1599
|
+
let targetedFormatter: any = allFormatters.current.get(value.trackingCharacter);
|
|
1597
1600
|
let existingCCUsers = [...targetedFormatter.getSuggestionItems()];
|
|
1598
1601
|
let userPosition = existingCCUsers.findIndex((item: SuggestionItem) => item.id === value.id);
|
|
1599
1602
|
if (userPosition !== -1) {
|
|
@@ -1625,7 +1628,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1625
1628
|
|
|
1626
1629
|
let newMentionMap = new Map(mentionMap.current);
|
|
1627
1630
|
|
|
1628
|
-
let targetedFormatter = allFormatters.current.get(activeCharacter.current);
|
|
1631
|
+
let targetedFormatter: any = allFormatters.current.get(activeCharacter.current);
|
|
1629
1632
|
|
|
1630
1633
|
let existingCCUsers = [...targetedFormatter.getSuggestionItems()];
|
|
1631
1634
|
let userAlreadyExists = existingCCUsers.find((existingUser: SuggestionItem) => existingUser.id === item.id);
|
|
@@ -1675,9 +1678,9 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1675
1678
|
}
|
|
1676
1679
|
|
|
1677
1680
|
const setFormattedInputMessage = () => {
|
|
1678
|
-
let textComponents = getRegexString(plainTextInput.current);
|
|
1681
|
+
let textComponents: any = getRegexString(plainTextInput.current);
|
|
1679
1682
|
|
|
1680
|
-
allFormatters.current.forEach((formatter
|
|
1683
|
+
allFormatters.current.forEach((formatter, key) => {
|
|
1681
1684
|
let resp = formatter.getFormattedText(textComponents);
|
|
1682
1685
|
textComponents = resp;
|
|
1683
1686
|
})
|
|
@@ -1743,7 +1746,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1743
1746
|
}
|
|
1744
1747
|
|
|
1745
1748
|
const getMentionLimitView = () => {
|
|
1746
|
-
let targetedFormatter = allFormatters.current.get(activeCharacter.current);
|
|
1749
|
+
let targetedFormatter: any = allFormatters.current.get(activeCharacter.current);
|
|
1747
1750
|
let shouldWarn;
|
|
1748
1751
|
let limit;
|
|
1749
1752
|
if (targetedFormatter?.getLimit && targetedFormatter?.getLimit()) {
|
|
@@ -1772,7 +1775,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1772
1775
|
marginLeft: 5,
|
|
1773
1776
|
color: theme.palette.getAccent500(),
|
|
1774
1777
|
...theme.typography.text1
|
|
1775
|
-
}}>{errorString}</Text>
|
|
1778
|
+
} as TextStyle}>{errorString}</Text>
|
|
1776
1779
|
</View>
|
|
1777
1780
|
)
|
|
1778
1781
|
}
|
|
@@ -1803,7 +1806,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1803
1806
|
paddingTop: CustomViewHeader ? 0 : 8
|
|
1804
1807
|
},
|
|
1805
1808
|
messageComposerStyle,
|
|
1806
|
-
]}
|
|
1809
|
+
] as ViewProps}
|
|
1807
1810
|
>
|
|
1808
1811
|
<EmojiBoard
|
|
1809
1812
|
hideSearch={true}
|
|
@@ -1831,19 +1834,19 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1831
1834
|
onClose={() => setShowActionSheet(false)}
|
|
1832
1835
|
style={{
|
|
1833
1836
|
// ...getActionSheetStyle(),
|
|
1834
|
-
...(messageComposerStyle
|
|
1837
|
+
...(messageComposerStyle?.actionSheetSeparatorTint
|
|
1835
1838
|
? {
|
|
1836
1839
|
actionSheetSeparatorTint:
|
|
1837
1840
|
messageComposerStyle.actionSheetSeparatorTint,
|
|
1838
1841
|
}
|
|
1839
1842
|
: {}),
|
|
1840
|
-
layoutModeIconTint: messageComposerStyle
|
|
1841
|
-
titleColor: messageComposerStyle
|
|
1842
|
-
listItemIconTint: messageComposerStyle
|
|
1843
|
-
listItemTitleFont: messageComposerStyle
|
|
1843
|
+
layoutModeIconTint: messageComposerStyle?.actionSheetLayoutModeIconTint,
|
|
1844
|
+
titleColor: messageComposerStyle?.actionSheetTitleColor,
|
|
1845
|
+
listItemIconTint: messageComposerStyle?.attachIconTint,
|
|
1846
|
+
listItemTitleFont: messageComposerStyle?.actionSheetTitleFont
|
|
1844
1847
|
}}
|
|
1845
1848
|
cometChatBottomSheetStyle={
|
|
1846
|
-
messageComposerStyle
|
|
1849
|
+
messageComposerStyle?.actionSheetCancelButtonIconTint
|
|
1847
1850
|
? {
|
|
1848
1851
|
lineColor:
|
|
1849
1852
|
messageComposerStyle.actionSheetCancelButtonIconTint,
|
|
@@ -1860,7 +1863,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1860
1863
|
}}
|
|
1861
1864
|
onSend={_sendRecordedAudio}
|
|
1862
1865
|
cometChatBottomSheetStyle={
|
|
1863
|
-
messageComposerStyle
|
|
1866
|
+
messageComposerStyle?.actionSheetCancelButtonIconTint
|
|
1864
1867
|
? {
|
|
1865
1868
|
lineColor:
|
|
1866
1869
|
messageComposerStyle.actionSheetCancelButtonIconTint,
|
|
@@ -1934,7 +1937,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1934
1937
|
openList(selection)
|
|
1935
1938
|
}
|
|
1936
1939
|
}
|
|
1937
|
-
maxHeight={maxHeight ??
|
|
1940
|
+
maxHeight={maxHeight ?? undefined}
|
|
1938
1941
|
onChangeText={textChangeHandler}
|
|
1939
1942
|
SecondaryButtonView={SecondaryButtonViewElem}
|
|
1940
1943
|
AuxiliaryButtonView={AuxiliaryButtonViewElem}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CometChatMessageComposer,
|
|
3
|
-
CometChatMessageComposerInterface,
|
|
3
|
+
CometChatMessageComposerInterface,
|
|
4
4
|
MessageComposerStyleInterface,
|
|
5
|
-
} from
|
|
5
|
+
} from "./CometChatMessageComposer";
|
|
6
6
|
import {
|
|
7
7
|
MessageComposerConfiguration,
|
|
8
8
|
MessageComposerConfigurationInterface,
|
|
9
|
-
} from
|
|
9
|
+
} from "./MessageComposerConfiguration";
|
|
10
10
|
|
|
11
|
-
export {
|
|
12
|
-
|
|
13
|
-
MessageComposerConfiguration,
|
|
11
|
+
export { CometChatMessageComposer, MessageComposerConfiguration };
|
|
12
|
+
export type {
|
|
14
13
|
MessageComposerConfigurationInterface,
|
|
15
|
-
CometChatMessageComposerInterface,
|
|
14
|
+
CometChatMessageComposerInterface,
|
|
16
15
|
MessageComposerStyleInterface,
|
|
17
16
|
};
|
|
@@ -1,12 +1,22 @@
|
|
|
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 CLOSE from './close.png';
|
|
13
|
+
//@ts-ignore
|
|
7
14
|
import STICKER from "./stickers.png";
|
|
15
|
+
//@ts-ignore
|
|
8
16
|
import MICROPHONE from "./microphone.png";
|
|
17
|
+
//@ts-ignore
|
|
9
18
|
import AI from './ai.png'
|
|
19
|
+
//@ts-ignore
|
|
10
20
|
import INFO from './Info.png';
|
|
11
21
|
|
|
12
22
|
export const ICONS ={
|
|
@@ -5,6 +5,8 @@ import {
|
|
|
5
5
|
Image,
|
|
6
6
|
ViewStyle,
|
|
7
7
|
StyleProp,
|
|
8
|
+
TextStyle,
|
|
9
|
+
ViewProps,
|
|
8
10
|
//@ts-ignore
|
|
9
11
|
} from 'react-native';
|
|
10
12
|
import React, { useEffect, useState, useRef, useContext } from 'react';
|
|
@@ -246,7 +248,7 @@ export const CometChatMessageHeader = (
|
|
|
246
248
|
}
|
|
247
249
|
style={[
|
|
248
250
|
styles.backButtonIconStyle,
|
|
249
|
-
{ tintColor: style
|
|
251
|
+
{ tintColor: style?.backIconTint ?? theme.palette.getPrimary() },
|
|
250
252
|
]}
|
|
251
253
|
/>
|
|
252
254
|
</TouchableOpacity>
|
|
@@ -260,10 +262,10 @@ export const CometChatMessageHeader = (
|
|
|
260
262
|
style={[
|
|
261
263
|
{
|
|
262
264
|
color:
|
|
263
|
-
style
|
|
265
|
+
style?.typingIndicatorTextColor ?? theme.palette.getAccent600(),
|
|
264
266
|
},
|
|
265
|
-
style
|
|
266
|
-
]}
|
|
267
|
+
style?.typingIndicatorTextFont ?? theme.typography.text1,
|
|
268
|
+
] as TextStyle}
|
|
267
269
|
>
|
|
268
270
|
{typingText}
|
|
269
271
|
</Text>
|
|
@@ -272,9 +274,9 @@ export const CometChatMessageHeader = (
|
|
|
272
274
|
return (
|
|
273
275
|
<Text
|
|
274
276
|
style={[
|
|
275
|
-
{ color: style
|
|
276
|
-
style
|
|
277
|
-
]}
|
|
277
|
+
{ color: style?.subtitleTextColor ?? theme.palette.getAccent600() },
|
|
278
|
+
style?.subtitleTextFont ?? theme.typography.text1,
|
|
279
|
+
] as TextStyle}
|
|
278
280
|
>
|
|
279
281
|
{receiverTypeRef.current === CometChat.RECEIVER_TYPE.GROUP &&
|
|
280
282
|
(groupObj?.['membersCount'] || groupObj?.['membersCount'] === 0)
|
|
@@ -288,11 +290,11 @@ export const CometChatMessageHeader = (
|
|
|
288
290
|
);
|
|
289
291
|
};
|
|
290
292
|
|
|
291
|
-
const handleUserStatus = (userDetails) => {
|
|
292
|
-
if (userDetails.uid === user
|
|
293
|
+
const handleUserStatus = (userDetails: any) => {
|
|
294
|
+
if (userDetails.uid === user?.getUid()) setUserStatus(userDetails.status);
|
|
293
295
|
};
|
|
294
296
|
|
|
295
|
-
const msgTypingIndicator = (typist, status) => {
|
|
297
|
+
const msgTypingIndicator = (typist: any, status: string) => {
|
|
296
298
|
if (
|
|
297
299
|
receiverTypeRef.current === CometChat.RECEIVER_TYPE.GROUP &&
|
|
298
300
|
receiverTypeRef.current === typist.receiverType &&
|
|
@@ -312,8 +314,8 @@ export const CometChatMessageHeader = (
|
|
|
312
314
|
}
|
|
313
315
|
};
|
|
314
316
|
|
|
315
|
-
const handleGroupListener = (groupDetails) => {
|
|
316
|
-
if (groupDetails?.guid === groupObj
|
|
317
|
+
const handleGroupListener = (groupDetails: any) => {
|
|
318
|
+
if (groupDetails?.guid === groupObj?.getGuid() && groupDetails.membersCount) {
|
|
317
319
|
setGroupObj(groupDetails);
|
|
318
320
|
}
|
|
319
321
|
};
|
|
@@ -353,7 +355,7 @@ export const CometChatMessageHeader = (
|
|
|
353
355
|
kickedMember,
|
|
354
356
|
kickedBy,
|
|
355
357
|
kickedFrom,
|
|
356
|
-
}) => {
|
|
358
|
+
}: any) => {
|
|
357
359
|
setGroupObj(kickedFrom);
|
|
358
360
|
};
|
|
359
361
|
const handleGroupMemberBanned = ({
|
|
@@ -361,7 +363,7 @@ export const CometChatMessageHeader = (
|
|
|
361
363
|
kickedUser,
|
|
362
364
|
kickedBy,
|
|
363
365
|
kickedFrom,
|
|
364
|
-
}) => {
|
|
366
|
+
}: any) => {
|
|
365
367
|
setGroupObj(kickedFrom);
|
|
366
368
|
};
|
|
367
369
|
const handleGroupMemberAdded = ({
|
|
@@ -369,19 +371,19 @@ export const CometChatMessageHeader = (
|
|
|
369
371
|
message,
|
|
370
372
|
usersAdded,
|
|
371
373
|
userAddedIn,
|
|
372
|
-
}) => {
|
|
374
|
+
}: any) => {
|
|
373
375
|
setGroupObj(userAddedIn);
|
|
374
376
|
};
|
|
375
|
-
const handleOwnershipChanged = ({ group, newOwner, message }) => {
|
|
377
|
+
const handleOwnershipChanged = ({ group, newOwner, message }: any) => {
|
|
376
378
|
setGroupObj(group);
|
|
377
379
|
};
|
|
378
380
|
|
|
379
381
|
useEffect(() => {
|
|
380
382
|
CometChatUIEventHandler.addGroupListener(groupListenerId, {
|
|
381
|
-
ccGroupMemberKicked: (item) => handleGroupMemberKicked(item),
|
|
382
|
-
ccGroupMemberBanned: (item) => handleGroupMemberBanned(item),
|
|
383
|
-
ccGroupMemberAdded: (item) => handleGroupMemberAdded(item),
|
|
384
|
-
ccOwnershipChanged: (item) => handleOwnershipChanged(item),
|
|
383
|
+
ccGroupMemberKicked: (item: any) => handleGroupMemberKicked(item),
|
|
384
|
+
ccGroupMemberBanned: (item: any) => handleGroupMemberBanned(item),
|
|
385
|
+
ccGroupMemberAdded: (item: any) => handleGroupMemberAdded(item),
|
|
386
|
+
ccOwnershipChanged: (item: any) => handleOwnershipChanged(item),
|
|
385
387
|
});
|
|
386
388
|
return () => {
|
|
387
389
|
CometChatUIEventHandler.removeGroupListener(groupListenerId);
|
|
@@ -393,14 +395,14 @@ export const CometChatMessageHeader = (
|
|
|
393
395
|
style={[
|
|
394
396
|
{ flexDirection: 'row' },
|
|
395
397
|
{
|
|
396
|
-
width: style
|
|
397
|
-
height: style
|
|
398
|
+
width: style?.width ?? 'auto',
|
|
399
|
+
height: style?.height ?? 'auto',
|
|
398
400
|
backgroundColor:
|
|
399
|
-
style
|
|
400
|
-
borderRadius: style
|
|
401
|
+
style?.backgroundColor ?? theme.palette.getBackgroundColor(),
|
|
402
|
+
borderRadius: style?.borderRadius ?? 0,
|
|
401
403
|
},
|
|
402
|
-
style
|
|
403
|
-
]}
|
|
404
|
+
style?.border ?? {},
|
|
405
|
+
] as ViewProps}
|
|
404
406
|
>
|
|
405
407
|
{!hideBackIcon && <BackButton />}
|
|
406
408
|
<View style={{ flex: 1 }}>
|
|
@@ -408,7 +410,7 @@ export const CometChatMessageHeader = (
|
|
|
408
410
|
<ListItemView user={user} group={group} />
|
|
409
411
|
) : (
|
|
410
412
|
<CometChatListItem
|
|
411
|
-
id={user ? user.getUid() : groupObj ? groupObj.getGuid() :
|
|
413
|
+
id={user ? user.getUid() : groupObj ? groupObj.getGuid() : ''}
|
|
412
414
|
title={user ? user.getName() : groupObj ? groupObj.getName() : ''}
|
|
413
415
|
avatarName={user ? user.getName() : groupObj ? groupObj.getName() : ''}
|
|
414
416
|
avatarURL={user ? user.getAvatar() ? { uri: user.getAvatar() } : undefined : groupObj ? groupObj.getIcon() ? { uri: groupObj.getIcon() } : undefined : undefined}
|
|
@@ -431,18 +433,18 @@ export const CometChatMessageHeader = (
|
|
|
431
433
|
}}
|
|
432
434
|
listItemStyle={{
|
|
433
435
|
titleFont: { fontWeight: '700' },
|
|
434
|
-
backgroundColor: style
|
|
436
|
+
backgroundColor: style?.backgroundColor,
|
|
435
437
|
...listItemStyle,
|
|
436
438
|
}}
|
|
437
439
|
statusIndicatorColor={
|
|
438
440
|
disableUsersPresence
|
|
439
441
|
? 'transparent'
|
|
440
442
|
: user && userStatus === UserStatusConstants.online
|
|
441
|
-
? style
|
|
443
|
+
? style?.onlineStatusColor || theme.palette.getSuccess()
|
|
442
444
|
: 'transparent'
|
|
443
445
|
}
|
|
444
446
|
statusIndicatorStyle={
|
|
445
|
-
groupObj
|
|
447
|
+
(groupObj
|
|
446
448
|
? {
|
|
447
449
|
height: 15,
|
|
448
450
|
width: 15,
|
|
@@ -455,7 +457,7 @@ export const CometChatMessageHeader = (
|
|
|
455
457
|
borderRadius: 15,
|
|
456
458
|
...statusIndicatorStyle,
|
|
457
459
|
}
|
|
458
|
-
: { ...statusIndicatorStyle }
|
|
460
|
+
: { ...statusIndicatorStyle }) as ViewProps
|
|
459
461
|
}
|
|
460
462
|
statusIndicatorIcon={
|
|
461
463
|
groupObj
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from
|
|
2
|
+
CometChatMessageHeader,
|
|
3
|
+
CometChatMessageHeaderInterface,
|
|
4
|
+
MessageHeaderStyleInterface,
|
|
5
|
+
} from "./CometChatMessageHeader";
|
|
6
6
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} from
|
|
10
|
-
export {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
MessageHeaderStyleInterface,
|
|
7
|
+
MessageHeaderConfiguration,
|
|
8
|
+
MessageHeaderConfigurationInterface,
|
|
9
|
+
} from "./MessageHeaderConfiguration";
|
|
10
|
+
export { CometChatMessageHeader, MessageHeaderConfiguration };
|
|
11
|
+
export type {
|
|
12
|
+
MessageHeaderConfigurationInterface,
|
|
13
|
+
CometChatMessageHeaderInterface,
|
|
14
|
+
MessageHeaderStyleInterface,
|
|
16
15
|
};
|