@cometchat/chat-uikit-react-native 4.0.0-beta.1.1 → 4.0.0
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/README.md +10 -4
- package/android/.gradle/7.4/checksums/checksums.lock +0 -0
- package/android/.gradle/7.4/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/7.4/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/7.4/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.4/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.4/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/.gitignore +3 -0
- package/android/.idea/gradle.xml +13 -0
- package/android/.idea/misc.xml +9 -0
- package/android/.idea/vcs.xml +6 -0
- package/android/build.gradle +2 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/android/gradlew +234 -0
- package/android/gradlew.bat +89 -0
- package/android/local.properties +8 -0
- package/android/src/main/AndroidManifest.xml +19 -2
- package/android/src/main/java/com/reactnativecometchatuikit/CometChatImageViewer.java +1 -0
- package/android/src/main/java/com/reactnativecometchatuikit/CometChatVideoPlayer.java +1 -0
- package/android/src/main/java/com/reactnativecometchatuikit/CometChatWebView.java +38 -0
- package/android/src/main/java/com/reactnativecometchatuikit/CometchatUiKitPackage.java +1 -0
- package/android/src/main/java/com/reactnativecometchatuikit/FileManager.java +223 -1
- package/android/src/main/java/com/reactnativecometchatuikit/WebViewManager.java +38 -0
- package/android/src/main/res/xml/filepaths.xml +6 -0
- package/ios/CometchatUiKit.xcodeproj/project.pbxproj +12 -0
- package/ios/CometchatUiKit.xcodeproj/project.xcworkspace/xcuserdata/ashishjajoo.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/FileManager.m +265 -37
- package/ios/WebViewManager.h +7 -0
- package/ios/WebViewManager.m +33 -0
- package/lib/CometChatAddMembers/AddMembersConfiguration.d.ts +1 -1
- package/lib/CometChatAddMembers/CometChatAddMembers.d.ts +1 -1
- package/lib/CometChatAddMembers/CometChatAddMembers.js +1 -1
- package/lib/CometChatBannedMembers/BannedMembersConfiguration.d.ts +1 -1
- package/lib/CometChatBannedMembers/CometChatBannedMembers.d.ts +1 -1
- package/lib/CometChatBannedMembers/CometChatBannedMembers.js +1 -1
- package/lib/CometChatContacts/CometChatContacts.d.ts +75 -0
- package/lib/CometChatContacts/CometChatContacts.js +84 -0
- package/lib/CometChatContacts/CometChatContacts.js.map +1 -0
- package/lib/CometChatContacts/ContactsConfiguration.d.ts +73 -0
- package/lib/CometChatContacts/ContactsConfiguration.js +2 -0
- package/lib/CometChatContacts/ContactsConfiguration.js.map +1 -0
- package/lib/CometChatContacts/ContactsStyle.d.ts +59 -0
- package/lib/CometChatContacts/ContactsStyle.js +2 -0
- package/lib/CometChatContacts/ContactsStyle.js.map +1 -0
- package/lib/CometChatContacts/Header.d.ts +31 -0
- package/lib/CometChatContacts/Header.js +72 -0
- package/lib/CometChatContacts/Header.js.map +1 -0
- package/lib/CometChatContacts/index.d.ts +4 -0
- package/lib/CometChatContacts/index.js +3 -0
- package/lib/CometChatContacts/index.js.map +1 -0
- package/lib/CometChatContacts/styles.d.ts +101 -0
- package/lib/CometChatContacts/styles.js +104 -0
- package/lib/CometChatContacts/styles.js.map +1 -0
- package/lib/CometChatConversations/CometChatConversations.d.ts +5 -1
- package/lib/CometChatConversations/CometChatConversations.js +22 -7
- package/lib/CometChatConversations/CometChatConversations.js.map +1 -1
- package/lib/CometChatConversations/ConversationsConfiguration.d.ts +1 -1
- package/lib/CometChatConversations/style.d.ts +4 -4
- package/lib/CometChatConversationsWithMessages/CometChatConversationsWithMessages.d.ts +3 -1
- package/lib/CometChatConversationsWithMessages/CometChatConversationsWithMessages.js +84 -5
- package/lib/CometChatConversationsWithMessages/CometChatConversationsWithMessages.js.map +1 -1
- package/lib/CometChatConversationsWithMessages/resources/index.d.ts +2 -0
- package/lib/CometChatConversationsWithMessages/resources/index.js +3 -0
- package/lib/CometChatConversationsWithMessages/resources/index.js.map +1 -0
- package/lib/CometChatConversationsWithMessages/styles.d.ts +4 -4
- package/lib/CometChatCreateGroup/CometChatCreateGroup.d.ts +1 -1
- package/lib/CometChatCreateGroup/CometChatCreateGroup.js +1 -1
- package/lib/CometChatCreateGroup/CreateGroupConfiguration.d.ts +1 -1
- package/lib/CometChatDetails/CometChatDetails.d.ts +1 -1
- package/lib/CometChatDetails/CometChatDetails.js +2 -1
- package/lib/CometChatDetails/CometChatDetails.js.map +1 -1
- package/lib/CometChatDetails/DetailsConfiguration.d.ts +1 -1
- package/lib/CometChatDetails/listners.js +1 -1
- package/lib/CometChatGroupMembers/CometChatGroupMembers.d.ts +1 -1
- package/lib/CometChatGroupMembers/CometChatGroupMembers.js +13 -1
- package/lib/CometChatGroupMembers/CometChatGroupMembers.js.map +1 -1
- package/lib/CometChatGroupMembers/GroupMemberConfiguration.d.ts +1 -1
- package/lib/CometChatGroupMembers/style.d.ts +5 -5
- package/lib/CometChatGroups/CometChatGroups.d.ts +5 -1
- package/lib/CometChatGroups/CometChatGroups.js +18 -5
- package/lib/CometChatGroups/CometChatGroups.js.map +1 -1
- package/lib/CometChatGroups/GroupsConfiguration.d.ts +1 -1
- package/lib/CometChatGroups/style.d.ts +1 -1
- package/lib/CometChatGroupsWithMessages/CometChatGroupsWithMessages.d.ts +1 -1
- package/lib/CometChatGroupsWithMessages/CometChatGroupsWithMessages.js +71 -8
- package/lib/CometChatGroupsWithMessages/CometChatGroupsWithMessages.js.map +1 -1
- package/lib/CometChatGroupsWithMessages/styles.d.ts +4 -4
- package/lib/CometChatJoinProtectedGroup/CometChatJoinProtectedGroup.d.ts +1 -1
- package/lib/CometChatJoinProtectedGroup/CometChatJoinProtectedGroup.js +1 -1
- package/lib/CometChatJoinProtectedGroup/JoinProtectedGroupConfiguration.d.ts +1 -1
- package/lib/CometChatMessageComposer/CometChatMessageComposer.d.ts +65 -1
- package/lib/CometChatMessageComposer/CometChatMessageComposer.js +39 -5
- package/lib/CometChatMessageComposer/CometChatMessageComposer.js.map +1 -1
- package/lib/CometChatMessageComposer/MessageComposerConfiguration.d.ts +11 -1
- package/lib/CometChatMessageComposer/MessageComposerConfiguration.js +9 -0
- package/lib/CometChatMessageComposer/MessageComposerConfiguration.js.map +1 -1
- package/lib/CometChatMessageComposer/resources/index.d.ts +1 -0
- package/lib/CometChatMessageComposer/resources/index.js +3 -1
- package/lib/CometChatMessageComposer/resources/index.js.map +1 -1
- package/lib/CometChatMessageComposer/styles.d.ts +1 -0
- package/lib/CometChatMessageComposer/styles.js +2 -1
- package/lib/CometChatMessageComposer/styles.js.map +1 -1
- package/lib/CometChatMessageHeader/CometChatMessageHeader.d.ts +1 -1
- package/lib/CometChatMessageHeader/CometChatMessageHeader.js +7 -1
- package/lib/CometChatMessageHeader/CometChatMessageHeader.js.map +1 -1
- package/lib/CometChatMessageHeader/MessageHeaderConfiguration.d.ts +1 -1
- package/lib/CometChatMessageHeader/listners.js +1 -1
- package/lib/CometChatMessageHeader/styles.d.ts +1 -1
- package/lib/CometChatMessageInformation/CometChatMessageInformation.d.ts +36 -0
- package/lib/CometChatMessageInformation/CometChatMessageInformation.js +173 -0
- package/lib/CometChatMessageInformation/CometChatMessageInformation.js.map +1 -0
- package/lib/CometChatMessageInformation/MessageInformationConfiguration.d.ts +3 -0
- package/lib/CometChatMessageInformation/MessageInformationConfiguration.js +2 -0
- package/lib/CometChatMessageInformation/MessageInformationConfiguration.js.map +1 -0
- package/lib/CometChatMessageInformation/MessageInformationStyle.d.ts +11 -0
- package/lib/CometChatMessageInformation/MessageInformationStyle.js +2 -0
- package/lib/CometChatMessageInformation/MessageInformationStyle.js.map +1 -0
- package/lib/CometChatMessageInformation/index.d.ts +4 -0
- package/lib/CometChatMessageInformation/index.js +3 -0
- package/lib/CometChatMessageInformation/index.js.map +1 -0
- package/lib/CometChatMessageInformation/resources/index.d.ts +2 -0
- package/lib/CometChatMessageInformation/resources/index.js +3 -0
- package/lib/CometChatMessageInformation/resources/index.js.map +1 -0
- package/lib/CometChatMessageInformation/styles.d.ts +23 -0
- package/lib/CometChatMessageInformation/styles.js +26 -0
- package/lib/CometChatMessageInformation/styles.js.map +1 -0
- package/lib/CometChatMessageList/CometChatMessageList.d.ts +3 -1
- package/lib/CometChatMessageList/CometChatMessageList.js +261 -18
- package/lib/CometChatMessageList/CometChatMessageList.js.map +1 -1
- package/lib/CometChatMessageList/MessageListConfiguration.d.ts +1 -1
- package/lib/CometChatMessageList/style.d.ts +3 -3
- package/lib/CometChatMessages/CometChatMessages.d.ts +1 -1
- package/lib/CometChatMessages/CometChatMessages.js +34 -1
- package/lib/CometChatMessages/CometChatMessages.js.map +1 -1
- package/lib/CometChatMessages/MessagesConfiguration.d.ts +1 -1
- package/lib/CometChatMessages/style.d.ts +2 -2
- package/lib/CometChatTabs/CometChatTabs.d.ts +1 -0
- package/lib/CometChatTabs/CometChatTabs.js +61 -22
- package/lib/CometChatTabs/CometChatTabs.js.map +1 -1
- package/lib/CometChatTabs/CometChatTabsStyle.d.ts +12 -2
- package/lib/CometChatTabs/CometChatTabsStyle.js +11 -1
- package/lib/CometChatTabs/CometChatTabsStyle.js.map +1 -1
- package/lib/CometChatTabs/TabItemStyle.d.ts +4 -2
- package/lib/CometChatTabs/TabItemStyle.js +3 -1
- package/lib/CometChatTabs/TabItemStyle.js.map +1 -1
- package/lib/CometChatThreadedMessages/CometChatThreadedMessages.d.ts +1 -1
- package/lib/CometChatThreadedMessages/CometChatThreadedMessages.js +5 -3
- package/lib/CometChatThreadedMessages/CometChatThreadedMessages.js.map +1 -1
- package/lib/CometChatThreadedMessages/ThreadedMessagesConfiguration.d.ts +1 -1
- package/lib/CometChatThreadedMessages/style.d.ts +3 -2
- package/lib/CometChatThreadedMessages/style.js +4 -2
- package/lib/CometChatThreadedMessages/style.js.map +1 -1
- package/lib/CometChatTransferOwnership/CometChatTransferOwnership.d.ts +1 -1
- package/lib/CometChatTransferOwnership/CometChatTransferOwnership.js +1 -1
- package/lib/CometChatTransferOwnership/TransferOwnershipConfiguration.d.ts +1 -1
- package/lib/CometChatUsers/CometChatUsers.d.ts +1 -1
- package/lib/CometChatUsers/CometChatUsers.js +1 -1
- package/lib/CometChatUsers/UsersConfiguration.d.ts +1 -1
- package/lib/CometChatUsersWithMessages/CometChatUsersWithMessages.d.ts +1 -1
- package/lib/CometChatUsersWithMessages/CometChatUsersWithMessages.js +29 -3
- package/lib/CometChatUsersWithMessages/CometChatUsersWithMessages.js.map +1 -1
- package/lib/CometChatUsersWithMessages/styles.d.ts +4 -4
- package/lib/calls/CallUtils.d.ts +1 -1
- package/lib/calls/CallUtils.js +1 -1
- package/lib/calls/CallingDetailsUtils.d.ts +1 -1
- package/lib/calls/CallingExtension.d.ts +3 -1
- package/lib/calls/CallingExtension.js +8 -2
- package/lib/calls/CallingExtension.js.map +1 -1
- package/lib/calls/CallingExtentionDecorator.d.ts +1 -1
- package/lib/calls/CallingExtentionDecorator.js +5 -2
- package/lib/calls/CallingExtentionDecorator.js.map +1 -1
- package/lib/calls/CometChatCallButtons/CometChatCallButtonConfiguration.d.ts +1 -1
- package/lib/calls/CometChatCallButtons/CometChatCallButtons.d.ts +1 -1
- package/lib/calls/CometChatCallButtons/CometChatCallButtons.js +1 -1
- package/lib/calls/CometChatCallDetails/CallDetailsConfiguration.d.ts +1 -1
- package/lib/calls/CometChatCallDetails/CometChatCallDetails.js +1 -1
- package/lib/calls/CometChatCallHistory/CallHistoryConfiguration.d.ts +1 -1
- package/lib/calls/CometChatCallHistory/CometChatCallHistory.js +1 -1
- package/lib/calls/CometChatCallHistoryWithDetails/style.d.ts +2 -2
- package/lib/calls/CometChatIncomingCall/CometChatIncomingCall.d.ts +1 -1
- package/lib/calls/CometChatIncomingCall/CometChatIncomingCall.js +1 -1
- package/lib/calls/CometChatOngoingCall/CometChatOngoingCall.d.ts +1 -1
- package/lib/calls/CometChatOngoingCall/CometChatOngoingCall.js +1 -1
- package/lib/calls/CometChatOutgoingCall/CometChatOutgoingCall.d.ts +1 -1
- package/lib/calls/CometChatOutgoingCall/CometChatOutgoingCall.js +23 -15
- package/lib/calls/CometChatOutgoingCall/CometChatOutgoingCall.js.map +1 -1
- package/lib/extensions/CollaborativeBubble/CollaborativeBubbleStyle.js +1 -1
- package/lib/extensions/CollaborativeBubble/CollaborativeBubbleStyle.js.map +1 -1
- package/lib/extensions/CollaborativeBubble/CometChatCollaborativeBubble.d.ts +1 -1
- package/lib/extensions/CollaborativeBubble/CometChatCollaborativeBubble.js +5 -4
- package/lib/extensions/CollaborativeBubble/CometChatCollaborativeBubble.js.map +1 -1
- package/lib/extensions/CollaborativeBubble/styles.js +1 -1
- package/lib/extensions/CollaborativeBubble/styles.js.map +1 -1
- package/lib/extensions/CollaborativeDocument/CollaborativeDocumentExtension.d.ts +3 -2
- package/lib/extensions/CollaborativeDocument/CollaborativeDocumentExtension.js +8 -3
- package/lib/extensions/CollaborativeDocument/CollaborativeDocumentExtension.js.map +1 -1
- package/lib/extensions/CollaborativeDocument/CollaborativeDocumentExtensionDecorator.d.ts +1 -1
- package/lib/extensions/CollaborativeDocument/CollaborativeDocumentExtensionDecorator.js +1 -1
- package/lib/extensions/CollaborativeWhiteboard/CollaborativeWhiteboardExtension.d.ts +3 -2
- package/lib/extensions/CollaborativeWhiteboard/CollaborativeWhiteboardExtension.js +10 -3
- package/lib/extensions/CollaborativeWhiteboard/CollaborativeWhiteboardExtension.js.map +1 -1
- package/lib/extensions/CollaborativeWhiteboard/CollaborativeWhiteboardExtensionDecorator.d.ts +1 -1
- package/lib/extensions/CollaborativeWhiteboard/CollaborativeWhiteboardExtensionDecorator.js +1 -1
- package/lib/extensions/ImageModeration/ImageModerationDecorator.d.ts +1 -1
- package/lib/extensions/ImageModeration/ImageModerationDecorator.js +1 -1
- package/lib/extensions/ImageModeration/ImageModerationExtension.d.ts +3 -2
- package/lib/extensions/ImageModeration/ImageModerationExtension.js +10 -3
- package/lib/extensions/ImageModeration/ImageModerationExtension.js.map +1 -1
- package/lib/extensions/ImageModeration/ImageModerationFilter.d.ts +1 -1
- package/lib/extensions/LinkPreview/LinkPreviewExtention.d.ts +3 -2
- package/lib/extensions/LinkPreview/LinkPreviewExtention.js +10 -3
- package/lib/extensions/LinkPreview/LinkPreviewExtention.js.map +1 -1
- package/lib/extensions/LinkPreview/LinkPreviewExtentionDecorator.d.ts +1 -1
- package/lib/extensions/MessageTranslation/MessageTranslationDecorator.d.ts +1 -1
- package/lib/extensions/MessageTranslation/MessageTranslationDecorator.js +1 -1
- package/lib/extensions/MessageTranslation/MessageTranslationExtension.d.ts +3 -2
- package/lib/extensions/MessageTranslation/MessageTranslationExtension.js +10 -3
- package/lib/extensions/MessageTranslation/MessageTranslationExtension.js.map +1 -1
- package/lib/extensions/Polls/Polls.d.ts +1 -1
- package/lib/extensions/Polls/Polls.js +1 -1
- package/lib/extensions/Polls/PollsBubble.d.ts +1 -1
- package/lib/extensions/Polls/PollsDecorator.d.ts +1 -1
- package/lib/extensions/Polls/PollsDecorator.js +1 -1
- package/lib/extensions/Polls/PollsExtension.d.ts +3 -2
- package/lib/extensions/Polls/PollsExtension.js +10 -3
- package/lib/extensions/Polls/PollsExtension.js.map +1 -1
- package/lib/extensions/Reactions/CometChatMessageReactions/CometChatMessageReactions.d.ts +1 -1
- package/lib/extensions/Reactions/CometChatMessageReactions/CometChatMessageReactions.js +0 -2
- package/lib/extensions/Reactions/CometChatMessageReactions/CometChatMessageReactions.js.map +1 -1
- package/lib/extensions/Reactions/ReactionsDecorator.d.ts +1 -1
- package/lib/extensions/Reactions/ReactionsDecorator.js +1 -1
- package/lib/extensions/Reactions/ReactionsExtension.d.ts +3 -2
- package/lib/extensions/Reactions/ReactionsExtension.js +10 -3
- package/lib/extensions/Reactions/ReactionsExtension.js.map +1 -1
- package/lib/extensions/SmartReplies/SmartRepliesDecorator.d.ts +1 -1
- package/lib/extensions/SmartReplies/SmartRepliesDecorator.js +1 -1
- package/lib/extensions/SmartReplies/SmartRepliesExtension.d.ts +3 -2
- package/lib/extensions/SmartReplies/SmartRepliesExtension.js +10 -3
- package/lib/extensions/SmartReplies/SmartRepliesExtension.js.map +1 -1
- package/lib/extensions/Stickers/CometChatStickerKeyboard/CometChatStickerKeyboard.d.ts +1 -1
- package/lib/extensions/Stickers/CometChatStickerKeyboard/StickerKeyboardConfiguration.d.ts +1 -1
- package/lib/extensions/Stickers/CometChatStickerKeyboard/hooks.js +1 -1
- package/lib/extensions/Stickers/CometChatStickerKeyboard/style.d.ts +6 -6
- package/lib/extensions/Stickers/StickersExtension.d.ts +3 -2
- package/lib/extensions/Stickers/StickersExtension.js +10 -4
- package/lib/extensions/Stickers/StickersExtension.js.map +1 -1
- package/lib/extensions/Stickers/StickersExtensionDecorator.d.ts +1 -1
- package/lib/extensions/Stickers/StickersExtensionDecorator.js +1 -1
- package/lib/extensions/TextModeration/TextModerationExtension.d.ts +3 -1
- package/lib/extensions/TextModeration/TextModerationExtension.js +19 -2
- package/lib/extensions/TextModeration/TextModerationExtension.js.map +1 -1
- package/lib/extensions/TextModeration/TextModerationExtensionDecorator.d.ts +1 -1
- package/lib/extensions/ThumbnailGeneration/ThumbnailGenerationDecorator.d.ts +1 -1
- package/lib/extensions/ThumbnailGeneration/ThumbnailGenerationExtension.d.ts +3 -2
- package/lib/extensions/ThumbnailGeneration/ThumbnailGenerationExtension.js +10 -3
- package/lib/extensions/ThumbnailGeneration/ThumbnailGenerationExtension.js.map +1 -1
- package/lib/index.d.ts +4 -2
- package/lib/index.js +6 -4
- package/lib/index.js.map +1 -1
- package/lib/shared/CometChatUiKit/CometChatUIKit.d.ts +8 -1
- package/lib/shared/CometChatUiKit/CometChatUIKit.js +54 -18
- package/lib/shared/CometChatUiKit/CometChatUIKit.js.map +1 -1
- package/lib/shared/CometChatUiKit/CometChatUIKitHelper.d.ts +1 -1
- package/lib/shared/CometChatUiKit/UIKitSettings.d.ts +3 -3
- package/lib/shared/CometChatUiKit/UIKitSettings.js +3 -11
- package/lib/shared/CometChatUiKit/UIKitSettings.js.map +1 -1
- package/lib/shared/assets/images/index.d.ts +9 -0
- package/lib/shared/assets/images/index.js +17 -0
- package/lib/shared/assets/images/index.js.map +1 -0
- package/lib/shared/constants/UIKitConstants.d.ts +0 -1
- package/lib/shared/constants/UIKitConstants.js +3 -3
- package/lib/shared/constants/UIKitConstants.js.map +1 -1
- package/lib/shared/events/CometChatUIEventHandler/CometChatUIEventHandler.js +6 -0
- package/lib/shared/events/CometChatUIEventHandler/CometChatUIEventHandler.js.map +1 -1
- package/lib/shared/events/CometChatUIEventHandler/Listener.d.ts +4 -2
- package/lib/shared/events/CometChatUIEventHandler/Listener.js +9 -2
- package/lib/shared/events/CometChatUIEventHandler/Listener.js.map +1 -1
- package/lib/shared/events/CometChatUIEvents.d.ts +1 -0
- package/lib/shared/events/CometChatUIEvents.js +1 -0
- package/lib/shared/events/CometChatUIEvents.js.map +1 -1
- package/lib/shared/framework/DataSource.d.ts +1 -1
- package/lib/shared/framework/DataSourceDecorator.d.ts +1 -1
- package/lib/shared/framework/ExtensionsDataSource.d.ts +5 -2
- package/lib/shared/framework/ExtensionsDataSource.js +13 -1
- package/lib/shared/framework/ExtensionsDataSource.js.map +1 -1
- package/lib/shared/framework/MessageDataSource.d.ts +2 -2
- package/lib/shared/framework/MessageDataSource.js +39 -17
- package/lib/shared/framework/MessageDataSource.js.map +1 -1
- package/lib/shared/framework/index.js +2 -1
- package/lib/shared/framework/index.js.map +1 -1
- package/lib/shared/framework/resources/index.d.ts +5 -1
- package/lib/shared/framework/resources/index.js +13 -3
- package/lib/shared/framework/resources/index.js.map +1 -1
- package/lib/shared/helper/Toast.d.ts +4 -0
- package/lib/shared/helper/Toast.js +23 -0
- package/lib/shared/helper/Toast.js.map +1 -0
- package/lib/shared/helper/types/index.d.ts +3 -4
- package/lib/shared/index.d.ts +2 -2
- package/lib/shared/index.js +4 -4
- package/lib/shared/index.js.map +1 -1
- package/lib/shared/modals/CometChatMessageOption.d.ts +1 -1
- package/lib/shared/modals/CometChatMessageTemplate.d.ts +1 -1
- package/lib/shared/modals/CometChatMessageTemplate.js +1 -1
- package/lib/shared/resources/CometChatLocalize/CometChatLocalize.d.ts +78 -0
- package/lib/shared/resources/CometChatLocalize/resources/ar/translation.json +7 -1
- package/lib/shared/resources/CometChatLocalize/resources/de/translation.json +7 -1
- package/lib/shared/resources/CometChatLocalize/resources/en/translation.json +9 -3
- package/lib/shared/resources/CometChatLocalize/resources/es/translation.json +7 -1
- package/lib/shared/resources/CometChatLocalize/resources/fr/translation.json +7 -1
- package/lib/shared/resources/CometChatLocalize/resources/hi/translation.json +7 -1
- package/lib/shared/resources/CometChatLocalize/resources/lt/translation.json +7 -1
- package/lib/shared/resources/CometChatLocalize/resources/ms/translation.json +7 -1
- package/lib/shared/resources/CometChatLocalize/resources/pt/translation.json +7 -1
- package/lib/shared/resources/CometChatLocalize/resources/ru/translation.json +7 -1
- package/lib/shared/resources/CometChatLocalize/resources/sv/translation.json +7 -1
- package/lib/shared/resources/CometChatLocalize/resources/zh/translation.json +7 -1
- package/lib/shared/resources/CometChatLocalize/resources/zh-tw/translation.json +7 -1
- package/lib/shared/utils/CometChatMessageHelper/index.js +1 -1
- package/lib/shared/utils/CometChatMessagePreview/CometChatMessagePreview.js +2 -1
- package/lib/shared/utils/CometChatMessagePreview/CometChatMessagePreview.js.map +1 -1
- package/lib/shared/utils/CometChatMessagePreview/style.d.ts +1 -0
- package/lib/shared/utils/CometChatMessagePreview/style.js +19 -5
- package/lib/shared/utils/CometChatMessagePreview/style.js.map +1 -1
- package/lib/shared/utils/DetailsUtils/DetailsUtils.d.ts +1 -1
- package/lib/shared/utils/MessageUtils.d.ts +15 -0
- package/lib/shared/utils/MessageUtils.js +31 -0
- package/lib/shared/utils/MessageUtils.js.map +1 -0
- package/lib/shared/utils/conversationUtils.d.ts +1 -1
- package/lib/shared/utils/conversationUtils.js +1 -1
- package/lib/shared/views/CometChatAudioBubble/CometChatAudioBubble.js +3 -3
- package/lib/shared/views/CometChatAudioBubble/CometChatAudioBubble.js.map +1 -1
- package/lib/shared/views/CometChatAvatar/styles.d.ts +2 -2
- package/lib/shared/views/CometChatBottomSheet/CometChatBottomSheet.js +1 -1
- package/lib/shared/views/CometChatBottomSheet/style.d.ts +1 -1
- package/lib/shared/views/CometChatCard/style.d.ts +2 -2
- package/lib/shared/views/CometChatEmojiKeyboard/CometChatEmojiKeyboard.js +38 -21
- package/lib/shared/views/CometChatEmojiKeyboard/CometChatEmojiKeyboard.js.map +1 -1
- package/lib/shared/views/CometChatEmojiKeyboard/style.d.ts +1 -1
- package/lib/shared/views/CometChatFileBubble/CometChatFileBubble.js +12 -9
- package/lib/shared/views/CometChatFileBubble/CometChatFileBubble.js.map +1 -1
- package/lib/shared/views/CometChatFileBubble/resources/index.d.ts +2 -1
- package/lib/shared/views/CometChatFileBubble/resources/index.js +2 -1
- package/lib/shared/views/CometChatFileBubble/resources/index.js.map +1 -1
- package/lib/shared/views/CometChatImageBubble/CometChatImageBubble.js +28 -10
- package/lib/shared/views/CometChatImageBubble/CometChatImageBubble.js.map +1 -1
- package/lib/shared/views/CometChatList/CometChatList.d.ts +2 -0
- package/lib/shared/views/CometChatList/CometChatList.js +51 -4
- package/lib/shared/views/CometChatList/CometChatList.js.map +1 -1
- package/lib/shared/views/CometChatList/Header.d.ts +1 -1
- package/lib/shared/views/CometChatList/Header.js +2 -2
- package/lib/shared/views/CometChatList/Header.js.map +1 -1
- package/lib/shared/views/CometChatList/styles.d.ts +8 -8
- package/lib/shared/views/CometChatListItem/style.d.ts +5 -5
- package/lib/shared/views/CometChatMediaRecorder/CometChatMediaRecorder.d.ts +25 -0
- package/lib/shared/views/CometChatMediaRecorder/CometChatMediaRecorder.js +151 -0
- package/lib/shared/views/CometChatMediaRecorder/CometChatMediaRecorder.js.map +1 -0
- package/lib/shared/views/CometChatMediaRecorder/MediaRecorderStyle.d.ts +26 -0
- package/lib/shared/views/CometChatMediaRecorder/MediaRecorderStyle.js +33 -0
- package/lib/shared/views/CometChatMediaRecorder/MediaRecorderStyle.js.map +1 -0
- package/lib/shared/views/CometChatMediaRecorder/index.d.ts +3 -0
- package/lib/shared/views/CometChatMediaRecorder/index.js +4 -0
- package/lib/shared/views/CometChatMediaRecorder/index.js.map +1 -0
- package/lib/shared/views/CometChatMediaRecorder/style.d.ts +27 -0
- package/lib/shared/views/CometChatMediaRecorder/style.js +28 -0
- package/lib/shared/views/CometChatMediaRecorder/style.js.map +1 -0
- package/lib/shared/views/CometChatMessageInput/CometChatMessageInput.js +2 -2
- package/lib/shared/views/CometChatMessageInput/CometChatMessageInput.js.map +1 -1
- package/lib/shared/views/CometChatMessageInput/styles.d.ts +1 -0
- package/lib/shared/views/CometChatMessageInput/styles.js +1 -0
- package/lib/shared/views/CometChatMessageInput/styles.js.map +1 -1
- package/lib/shared/views/CometChatVideoBubble/CometChatVideoBubble.js +23 -4
- package/lib/shared/views/CometChatVideoBubble/CometChatVideoBubble.js.map +1 -1
- package/lib/shared/views/SwipeRow/style.d.ts +3 -3
- package/lib/shared/views/index.d.ts +2 -1
- package/lib/shared/views/index.js +2 -1
- package/lib/shared/views/index.js.map +1 -1
- package/package.json +7 -6
- package/src/.DS_Store +0 -0
- package/src/CometChatAddMembers/AddMembersConfiguration.tsx +57 -0
- package/src/CometChatAddMembers/CometChatAddMembers.tsx +100 -0
- package/src/CometChatAddMembers/index.ts +8 -0
- package/src/CometChatBannedMembers/BannedMembersConfiguration.tsx +60 -0
- package/src/CometChatBannedMembers/CometChatBannedMembers.tsx +142 -0
- package/src/CometChatBannedMembers/index.ts +8 -0
- package/src/CometChatBannedMembers/resources/index.ts +3 -0
- package/src/CometChatContacts/CometChatContacts.tsx +226 -0
- package/src/CometChatContacts/ContactsConfiguration.tsx +68 -0
- package/src/CometChatContacts/ContactsStyle.ts +60 -0
- package/src/CometChatContacts/Header.tsx +167 -0
- package/src/CometChatContacts/index.ts +11 -0
- package/src/CometChatContacts/styles.ts +105 -0
- package/src/CometChatConversations/CometChatConversations.tsx +1034 -0
- package/src/CometChatConversations/ConversationsConfiguration.ts +181 -0
- package/src/CometChatConversations/ConversationsStyle.ts +88 -0
- package/src/CometChatConversations/index.ts +12 -0
- package/src/CometChatConversations/resources/index.ts +29 -0
- package/src/CometChatConversations/style.ts +63 -0
- package/src/CometChatConversationsWithMessages/CometChatConversationsWithMessages.tsx +230 -0
- package/src/CometChatConversationsWithMessages/index.ts +5 -0
- package/src/CometChatConversationsWithMessages/resources/index.ts +5 -0
- package/src/CometChatConversationsWithMessages/resources/start.png +0 -0
- package/src/CometChatConversationsWithMessages/styles.ts +15 -0
- package/src/CometChatCreateGroup/CometChatCreateGroup.tsx +387 -0
- package/src/CometChatCreateGroup/CreateGroupConfiguration.ts +35 -0
- package/src/CometChatCreateGroup/Header.tsx +60 -0
- package/src/CometChatCreateGroup/index.ts +16 -0
- package/src/CometChatCreateGroup/resources/index.ts +8 -0
- package/src/CometChatCreateGroup/style.ts +44 -0
- package/src/CometChatDetails/CometChatDetails.tsx +980 -0
- package/src/CometChatDetails/DetailsConfiguration.tsx +71 -0
- package/src/CometChatDetails/Header.tsx +42 -0
- package/src/CometChatDetails/index.ts +17 -0
- package/src/CometChatDetails/listners.ts +88 -0
- package/src/CometChatDetails/resources/index.ts +12 -0
- package/src/CometChatDetails/styles.ts +23 -0
- package/src/CometChatGroupMembers/CometChatGroupMembers.tsx +639 -0
- package/src/CometChatGroupMembers/GroupMemberConfiguration.ts +94 -0
- package/src/CometChatGroupMembers/GroupMemberStyle.ts +91 -0
- package/src/CometChatGroupMembers/GroupScopeStyle.ts +68 -0
- package/src/CometChatGroupMembers/index.ts +16 -0
- package/src/CometChatGroupMembers/resources/index.ts +11 -0
- package/src/CometChatGroupMembers/style.ts +31 -0
- package/src/CometChatGroups/CometChatGroups.tsx +611 -0
- package/src/CometChatGroups/GroupsConfiguration.ts +121 -0
- package/src/CometChatGroups/GroupsStyle.ts +112 -0
- package/src/CometChatGroups/index.ts +12 -0
- package/src/CometChatGroups/resources/index.ts +21 -0
- package/src/CometChatGroups/style.ts +19 -0
- package/src/CometChatGroupsWithMessages/CometChatGroupsWithMessages.tsx +231 -0
- package/src/CometChatGroupsWithMessages/index.ts +5 -0
- package/src/CometChatGroupsWithMessages/resources/index.ts +4 -0
- package/src/CometChatGroupsWithMessages/styles.ts +15 -0
- package/src/CometChatJoinProtectedGroup/CometChatJoinProtectedGroup.tsx +270 -0
- package/src/CometChatJoinProtectedGroup/Header.tsx +52 -0
- package/src/CometChatJoinProtectedGroup/JoinProtectedGroupConfiguration.ts +29 -0
- package/src/CometChatJoinProtectedGroup/index.ts +16 -0
- package/src/CometChatJoinProtectedGroup/resources/index.ts +6 -0
- package/src/CometChatJoinProtectedGroup/style.ts +11 -0
- package/src/CometChatMessageComposer/CometChatMessageComposer.tsx +1262 -0
- package/src/CometChatMessageComposer/MessageComposerConfiguration.tsx +81 -0
- package/src/CometChatMessageComposer/index.ts +17 -0
- package/src/CometChatMessageComposer/resources/index.ts +19 -0
- package/src/CometChatMessageComposer/resources/microphone.png +0 -0
- package/src/CometChatMessageComposer/styles.ts +31 -0
- package/src/CometChatMessageHeader/CometChatMessageHeader.tsx +504 -0
- package/src/CometChatMessageHeader/MessageHeaderConfiguration.tsx +61 -0
- package/src/CometChatMessageHeader/index.ts +16 -0
- package/src/CometChatMessageHeader/listners.ts +73 -0
- package/src/CometChatMessageHeader/resources/index.ts +8 -0
- package/src/CometChatMessageHeader/styles.ts +16 -0
- package/src/CometChatMessageInformation/.DS_Store +0 -0
- package/src/CometChatMessageInformation/CometChatMessageInformation.tsx +302 -0
- package/src/CometChatMessageInformation/MessageInformationConfiguration.tsx +13 -0
- package/src/CometChatMessageInformation/MessageInformationStyle.ts +12 -0
- package/src/CometChatMessageInformation/index.ts +13 -0
- package/src/CometChatMessageInformation/resources/index.ts +5 -0
- package/src/CometChatMessageInformation/styles.ts +26 -0
- package/src/CometChatMessageList/CometChatMessageList.tsx +1408 -0
- package/src/CometChatMessageList/MessageListConfiguration.ts +130 -0
- package/src/CometChatMessageList/MessageListStyle.ts +75 -0
- package/src/CometChatMessageList/index.ts +23 -0
- package/src/CometChatMessageList/resources/index.ts +13 -0
- package/src/CometChatMessageList/style.ts +55 -0
- package/src/CometChatMessages/CometChatMessages.tsx +334 -0
- package/src/CometChatMessages/MessageStyle.ts +34 -0
- package/src/CometChatMessages/MessagesConfiguration.ts +53 -0
- package/src/CometChatMessages/index.ts +15 -0
- package/src/CometChatMessages/resources/index.ts +5 -0
- package/src/CometChatMessages/style.ts +24 -0
- package/src/CometChatTabs/CometChatTabs.tsx +190 -0
- package/src/CometChatTabs/CometChatTabsStyle.ts +43 -0
- package/src/CometChatTabs/TabItemStyle.ts +55 -0
- package/src/CometChatTabs/TabItems.ts +11 -0
- package/src/CometChatTabs/index.ts +11 -0
- package/src/CometChatThreadedMessages/CometChatThreadedMessages.tsx +294 -0
- package/src/CometChatThreadedMessages/Header.tsx +57 -0
- package/src/CometChatThreadedMessages/ThreadedMessagesConfiguration.ts +29 -0
- package/src/CometChatThreadedMessages/index.ts +16 -0
- package/src/CometChatThreadedMessages/resources/index.ts +14 -0
- package/src/CometChatThreadedMessages/style.ts +27 -0
- package/src/CometChatTransferOwnership/CometChatTransferOwnership.tsx +144 -0
- package/src/CometChatTransferOwnership/TransferOwnershipConfiguration.ts +59 -0
- package/src/CometChatTransferOwnership/index.ts +15 -0
- package/src/CometChatUsers/CometChatUsers.tsx +173 -0
- package/src/CometChatUsers/UsersConfiguration.tsx +58 -0
- package/src/CometChatUsers/index.ts +14 -0
- package/src/CometChatUsersWithMessages/CometChatUsersWithMessages.tsx +127 -0
- package/src/CometChatUsersWithMessages/index.ts +5 -0
- package/src/CometChatUsersWithMessages/styles.ts +15 -0
- package/src/calls/CallEvents.ts +9 -0
- package/src/calls/CallUtils.ts +71 -0
- package/src/calls/CallingConfiguration.ts +5 -0
- package/src/calls/CallingDetailsUtils.tsx +39 -0
- package/src/calls/CallingExtension.tsx +48 -0
- package/src/calls/CallingExtentionDecorator.tsx +204 -0
- package/src/calls/CallingPackage.ts +8 -0
- package/src/calls/CometChatCallBubble/CallBubbleConfiguration.ts +23 -0
- package/src/calls/CometChatCallBubble/CallBubbleStyle.ts +47 -0
- package/src/calls/CometChatCallBubble/CometChatCallBubble.tsx +54 -0
- package/src/calls/CometChatCallBubble/index.ts +11 -0
- package/src/calls/CometChatCallBubble/resources/index.ts +9 -0
- package/src/calls/CometChatCallBubble/styles.ts +22 -0
- package/src/calls/CometChatCallButtons/CallButtonStyle.ts +35 -0
- package/src/calls/CometChatCallButtons/CometChatCallButtonConfiguration.ts +41 -0
- package/src/calls/CometChatCallButtons/CometChatCallButtons.tsx +340 -0
- package/src/calls/CometChatCallButtons/index.ts +11 -0
- package/src/calls/CometChatCallButtons/resources/index.ts +7 -0
- package/src/calls/CometChatCallButtons/style.ts +14 -0
- package/src/calls/CometChatCallDetails/CallDetailsConfiguration.ts +68 -0
- package/src/calls/CometChatCallDetails/CallDetailsStyle.ts +52 -0
- package/src/calls/CometChatCallDetails/CometChatCallDetails.tsx +268 -0
- package/src/calls/CometChatCallDetails/index.ts +9 -0
- package/src/calls/CometChatCallDetails/resources/index.ts +4 -0
- package/src/calls/CometChatCallDetails/style.ts +14 -0
- package/src/calls/CometChatCallHistory/.DS_Store +0 -0
- package/src/calls/CometChatCallHistory/CallHistoryConfiguration.ts +77 -0
- package/src/calls/CometChatCallHistory/CallHistoryStyle.ts +34 -0
- package/src/calls/CometChatCallHistory/CometChatCallHistory.tsx +422 -0
- package/src/calls/CometChatCallHistory/index.ts +9 -0
- package/src/calls/CometChatCallHistory/resources/index.ts +17 -0
- package/src/calls/CometChatCallHistory/style.ts +23 -0
- package/src/calls/CometChatCallHistoryWithDetails/CometChatCallHistoryWithDetails.tsx +54 -0
- package/src/calls/CometChatCallHistoryWithDetails/HistoryWithDetailsConfiguration.ts +7 -0
- package/src/calls/CometChatCallHistoryWithDetails/HistoryWithDetailsStyle.ts +3 -0
- package/src/calls/CometChatCallHistoryWithDetails/index.ts +8 -0
- package/src/calls/CometChatCallHistoryWithDetails/style.ts +11 -0
- package/src/calls/CometChatIncomingCall/CometChatIncomingCall.tsx +276 -0
- package/src/calls/CometChatIncomingCall/IncomingCallStyle.ts +75 -0
- package/src/calls/CometChatIncomingCall/index.ts +9 -0
- package/src/calls/CometChatIncomingCall/resources/index.ts +11 -0
- package/src/calls/CometChatIncomingCall/styles.ts +11 -0
- package/src/calls/CometChatOngoingCall/CometChatOngoingCall.tsx +67 -0
- package/src/calls/CometChatOngoingCall/OngoingCallStyle.ts +25 -0
- package/src/calls/CometChatOngoingCall/index.ts +8 -0
- package/src/calls/CometChatOutgoingCall/CometChatOutgoingCall.tsx +263 -0
- package/src/calls/CometChatOutgoingCall/OutgoingCallConfiguration.ts +33 -0
- package/src/calls/CometChatOutgoingCall/OutgoingCallStyle.ts +39 -0
- package/src/calls/CometChatOutgoingCall/index.ts +9 -0
- package/src/calls/CometChatOutgoingCall/resources/index.ts +5 -0
- package/src/calls/index.ts +39 -0
- package/src/calls/resources/index.ts +7 -0
- package/src/extensions/CollaborativeBubble/CollaborativeBubbleStyle.ts +97 -0
- package/src/extensions/CollaborativeBubble/CometChatCollaborativeBubble.tsx +106 -0
- package/src/extensions/CollaborativeBubble/resources/index.ts +4 -0
- package/src/extensions/CollaborativeBubble/styles.ts +80 -0
- package/src/extensions/CollaborativeDocument/CollaborativeDocumentConfiguration.tsx +26 -0
- package/src/extensions/CollaborativeDocument/CollaborativeDocumentExtension.tsx +38 -0
- package/src/extensions/CollaborativeDocument/CollaborativeDocumentExtensionDecorator.tsx +204 -0
- package/src/extensions/CollaborativeDocument/index.ts +12 -0
- package/src/extensions/CollaborativeDocument/resources/index.ts +5 -0
- package/src/extensions/CollaborativeWhiteboard/CollaborativeWhiteboardConfiguration.tsx +26 -0
- package/src/extensions/CollaborativeWhiteboard/CollaborativeWhiteboardExtension.tsx +38 -0
- package/src/extensions/CollaborativeWhiteboard/CollaborativeWhiteboardExtensionDecorator.tsx +209 -0
- package/src/extensions/CollaborativeWhiteboard/index.ts +12 -0
- package/src/extensions/CollaborativeWhiteboard/resources/index.ts +5 -0
- package/src/extensions/ExtensionConstants.tsx +54 -0
- package/src/extensions/ExtensionModerator.tsx +60 -0
- package/src/extensions/ImageModeration/ImageModerationDecorator.tsx +82 -0
- package/src/extensions/ImageModeration/ImageModerationExtension.tsx +43 -0
- package/src/extensions/ImageModeration/ImageModerationFilter.tsx +145 -0
- package/src/extensions/ImageModeration/index.ts +10 -0
- package/src/extensions/ImageModeration/resources/index.ts +3 -0
- package/src/extensions/LinkPreview/LInkPreviewBubbleStyle.ts +28 -0
- package/src/extensions/LinkPreview/LinkPreviewBubble.tsx +73 -0
- package/src/extensions/LinkPreview/LinkPreviewConfiguration.ts +27 -0
- package/src/extensions/LinkPreview/LinkPreviewExtention.tsx +25 -0
- package/src/extensions/LinkPreview/LinkPreviewExtentionDecorator.tsx +54 -0
- package/src/extensions/LinkPreview/index.ts +15 -0
- package/src/extensions/LinkPreview/resources/index.ts +5 -0
- package/src/extensions/MessageTranslation/MessageTranslationBubble.tsx +128 -0
- package/src/extensions/MessageTranslation/MessageTranslationDecorator.tsx +216 -0
- package/src/extensions/MessageTranslation/MessageTranslationExtension.tsx +47 -0
- package/src/extensions/MessageTranslation/index.ts +13 -0
- package/src/extensions/MessageTranslation/resources/index.ts +5 -0
- package/src/extensions/Polls/Header.tsx +71 -0
- package/src/extensions/Polls/Polls.tsx +454 -0
- package/src/extensions/Polls/PollsBubble.tsx +330 -0
- package/src/extensions/Polls/PollsConfigurations.ts +16 -0
- package/src/extensions/Polls/PollsDecorator.tsx +172 -0
- package/src/extensions/Polls/PollsExtension.tsx +39 -0
- package/src/extensions/Polls/index.ts +14 -0
- package/src/extensions/Polls/resources/index.ts +14 -0
- package/src/extensions/Polls/style.ts +40 -0
- package/src/extensions/Reactions/CometChatMessageReactions/CometChatMessageReactions.tsx +249 -0
- package/src/extensions/Reactions/CometChatMessageReactions/index.ts +3 -0
- package/src/extensions/Reactions/CometChatMessageReactions/style.ts +42 -0
- package/src/extensions/Reactions/ReactionsDecorator.tsx +164 -0
- package/src/extensions/Reactions/ReactionsExtension.tsx +48 -0
- package/src/extensions/Reactions/index.ts +4 -0
- package/src/extensions/Reactions/resources/index.ts +2 -0
- package/src/extensions/SmartReplies/SmartRepliesDecorator.tsx +135 -0
- package/src/extensions/SmartReplies/SmartRepliesExtension.tsx +52 -0
- package/src/extensions/SmartReplies/SmartRepliesView.tsx +218 -0
- package/src/extensions/SmartReplies/index.ts +3 -0
- package/src/extensions/SmartReplies/resources/index.ts +5 -0
- package/src/extensions/Stickers/CometChatStickerKeyboard/CometChatStickerKeyboard.tsx +152 -0
- package/src/extensions/Stickers/CometChatStickerKeyboard/StickerKeyboardConfiguration.ts +20 -0
- package/src/extensions/Stickers/CometChatStickerKeyboard/StickerKeyboardStyle.ts +52 -0
- package/src/extensions/Stickers/CometChatStickerKeyboard/hooks.ts +93 -0
- package/src/extensions/Stickers/CometChatStickerKeyboard/index.ts +5 -0
- package/src/extensions/Stickers/CometChatStickerKeyboard/resources/close.svg +4 -0
- package/src/extensions/Stickers/CometChatStickerKeyboard/style.ts +55 -0
- package/src/extensions/Stickers/StickerConfiguration.ts +17 -0
- package/src/extensions/Stickers/StickerStyle.ts +15 -0
- package/src/extensions/Stickers/StickersBubble.tsx +54 -0
- package/src/extensions/Stickers/StickersExtension.ts +32 -0
- package/src/extensions/Stickers/StickersExtensionDecorator.tsx +142 -0
- package/src/extensions/Stickers/index.ts +12 -0
- package/src/extensions/Stickers/resources/index.ts +5 -0
- package/src/extensions/TextModeration/TextModerationConfiguration.tsx +25 -0
- package/src/extensions/TextModeration/TextModerationExtension.tsx +50 -0
- package/src/extensions/TextModeration/TextModerationExtensionDecorator.tsx +92 -0
- package/src/extensions/TextModeration/index.ts +5 -0
- package/src/extensions/ThumbnailGeneration/ThumbnailGenerationDecorator.tsx +109 -0
- package/src/extensions/ThumbnailGeneration/ThumbnailGenerationExtension.tsx +45 -0
- package/src/extensions/ThumbnailGeneration/index.ts +3 -0
- package/src/extensions/index.ts +55 -0
- package/src/index.ts +561 -0
- package/src/shared/CometChatContext.tsx +39 -0
- package/src/shared/CometChatUiKit/CometChatUIKit.ts +220 -0
- package/src/shared/CometChatUiKit/CometChatUIKitHelper.ts +121 -0
- package/src/shared/CometChatUiKit/UIKitSettings.ts +39 -0
- package/src/shared/CometChatUiKit/index.ts +9 -0
- package/src/shared/assets/images/index.ts +17 -0
- package/src/shared/base/BaseStyle.ts +40 -0
- package/src/shared/base/BorderStyle.ts +28 -0
- package/src/shared/base/FontStyle.ts +27 -0
- package/src/shared/base/ShadowStyle.ts +40 -0
- package/src/shared/base/Types.ts +21 -0
- package/src/shared/base/index.ts +28 -0
- package/src/shared/constants/UIKitConstants.ts +348 -0
- package/src/shared/events/CometChatMessageEvents/index.ts +100 -0
- package/src/shared/events/CometChatUIEventHandler/CometChatUIEventHandler.ts +332 -0
- package/src/shared/events/CometChatUIEventHandler/Listener.ts +350 -0
- package/src/shared/events/CometChatUIEvents.ts +18 -0
- package/src/shared/events/conversations.ts +3 -0
- package/src/shared/events/groups.ts +10 -0
- package/src/shared/events/index.ts +13 -0
- package/src/shared/events/messages.ts +11 -0
- package/src/shared/framework/.DS_Store +0 -0
- package/src/shared/framework/ChatConfigurator.ts +28 -0
- package/src/shared/framework/DataSource.ts +72 -0
- package/src/shared/framework/DataSourceDecorator.tsx +164 -0
- package/src/shared/framework/ExtensionsDataSource.tsx +20 -0
- package/src/shared/framework/MessageDataSource.tsx +621 -0
- package/src/shared/framework/index.ts +6 -0
- package/src/shared/framework/resources/index.ts +45 -0
- package/src/shared/framework/resources/messageInPrivate.png +0 -0
- package/src/shared/framework/resources/microphone.png +0 -0
- package/src/shared/framework/resources/stop_player.png +0 -0
- package/src/shared/helper/SwipeRow.js +944 -0
- package/src/shared/helper/Toast.tsx +24 -0
- package/src/shared/helper/functions.js +36 -0
- package/src/shared/helper/helperFunctions.ts +18 -0
- package/src/shared/helper/types/index.ts +26 -0
- package/src/shared/helper/useKeyboard.tsx +38 -0
- package/src/shared/index.ts +262 -0
- package/src/shared/modals/CometChatDetailsOption.ts +24 -0
- package/src/shared/modals/CometChatDetailsTemplate.ts +16 -0
- package/src/shared/modals/CometChatMessageOption.ts +14 -0
- package/src/shared/modals/CometChatMessageTemplate.ts +42 -0
- package/src/shared/modals/CometChatOptions.ts +13 -0
- package/src/shared/modals/index.ts +13 -0
- package/src/shared/resources/CometChatLocalize/CometChatLocalize.ts +180 -0
- package/src/shared/resources/CometChatLocalize/index.ts +9 -0
- package/src/shared/resources/CometChatLocalize/resources/ar/translation.json +270 -0
- package/src/shared/resources/CometChatLocalize/resources/de/translation.json +270 -0
- package/src/shared/resources/CometChatLocalize/resources/en/translation.json +270 -0
- package/src/shared/resources/CometChatLocalize/resources/es/translation.json +270 -0
- package/src/shared/resources/CometChatLocalize/resources/fr/translation.json +270 -0
- package/src/shared/resources/CometChatLocalize/resources/hi/translation.json +270 -0
- package/src/shared/resources/CometChatLocalize/resources/lt/translation.json +270 -0
- package/src/shared/resources/CometChatLocalize/resources/ms/translation.json +270 -0
- package/src/shared/resources/CometChatLocalize/resources/pt/translation.json +270 -0
- package/src/shared/resources/CometChatLocalize/resources/ru/translation.json +270 -0
- package/src/shared/resources/CometChatLocalize/resources/sv/translation.json +270 -0
- package/src/shared/resources/CometChatLocalize/resources/zh/translation.json +270 -0
- package/src/shared/resources/CometChatLocalize/resources/zh-tw/translation.json +270 -0
- package/src/shared/resources/CometChatSoundManager/CometChatSoundManager.js +95 -0
- package/src/shared/resources/CometChatSoundManager/index.ts +2 -0
- package/src/shared/resources/CometChatSoundManager/resources/index.js +5 -0
- package/src/shared/resources/CometChatSoundManager/sound.js +336 -0
- package/src/shared/resources/CometChatTheme/CometChatTheme.ts +28 -0
- package/src/shared/resources/CometChatTheme/Palette.ts +501 -0
- package/src/shared/resources/CometChatTheme/Typography.ts +269 -0
- package/src/shared/resources/CometChatTheme/index.ts +2 -0
- package/src/shared/resources/index.ts +12 -0
- package/src/shared/utils/CometChatLiveReactions/CometChatLiveReaction.tsx +120 -0
- package/src/shared/utils/CometChatLiveReactions/LiveReactionstyles.ts +37 -0
- package/src/shared/utils/CometChatLiveReactions/index.ts +1 -0
- package/src/shared/utils/CometChatLiveReactions/resources/index.ts +4 -0
- package/src/shared/utils/CometChatLiveReactions/style.ts +8 -0
- package/src/shared/utils/CometChatMessageHelper/index.ts +55 -0
- package/src/shared/utils/CometChatMessagePreview/CometChatMessagePreview.js +117 -0
- package/src/shared/utils/CometChatMessagePreview/MessagePreviewConfiguration.js +30 -0
- package/src/shared/utils/CometChatMessagePreview/MessagePreviewStyle.js +42 -0
- package/src/shared/utils/CometChatMessagePreview/index.js +5 -0
- package/src/shared/utils/CometChatMessagePreview/resources/index.ts +5 -0
- package/src/shared/utils/CometChatMessagePreview/style.js +71 -0
- package/src/shared/utils/DetailsUtils/DetailsUtils.tsx +353 -0
- package/src/shared/utils/DetailsUtils/resources/index.ts +16 -0
- package/src/shared/utils/MessageUtils.tsx +57 -0
- package/src/shared/utils/conversationUtils.ts +82 -0
- package/src/shared/utils/index.ts +28 -0
- package/src/shared/views/.DS_Store +0 -0
- package/src/shared/views/CometChatActionSheet/ActionItem.ts +60 -0
- package/src/shared/views/CometChatActionSheet/ActionSheetStyle.ts +76 -0
- package/src/shared/views/CometChatActionSheet/CometChatActionSheet.tsx +275 -0
- package/src/shared/views/CometChatActionSheet/hooks.ts +10 -0
- package/src/shared/views/CometChatActionSheet/index.ts +3 -0
- package/src/shared/views/CometChatActionSheet/resources/index.ts +7 -0
- package/src/shared/views/CometChatActionSheet/style.ts +47 -0
- package/src/shared/views/CometChatAudioBubble/.DS_Store +0 -0
- package/src/shared/views/CometChatAudioBubble/AudioBubbleStyle.ts +43 -0
- package/src/shared/views/CometChatAudioBubble/CometChatAudioBubble.tsx +166 -0
- package/src/shared/views/CometChatAudioBubble/index.ts +16 -0
- package/src/shared/views/CometChatAudioBubble/resources/index.ts +7 -0
- package/src/shared/views/CometChatAudioBubble/resources/pause.png +0 -0
- package/src/shared/views/CometChatAudioBubble/style.ts +29 -0
- package/src/shared/views/CometChatAvatar/AvatarConfiguration.ts +27 -0
- package/src/shared/views/CometChatAvatar/AvatarStyle.ts +57 -0
- package/src/shared/views/CometChatAvatar/CometChatAvatar.tsx +122 -0
- package/src/shared/views/CometChatAvatar/index.ts +11 -0
- package/src/shared/views/CometChatAvatar/resources/index.ts +5 -0
- package/src/shared/views/CometChatAvatar/styles.ts +25 -0
- package/src/shared/views/CometChatBadge/BadgeConfiguration.ts +55 -0
- package/src/shared/views/CometChatBadge/BadgeStyle.ts +39 -0
- package/src/shared/views/CometChatBadge/CometChatBadge.tsx +70 -0
- package/src/shared/views/CometChatBadge/index.ts +10 -0
- package/src/shared/views/CometChatBadge/styles.ts +18 -0
- package/src/shared/views/CometChatBottomSheet/CometChatBottomSheet.tsx +173 -0
- package/src/shared/views/CometChatBottomSheet/index.ts +3 -0
- package/src/shared/views/CometChatBottomSheet/style.ts +52 -0
- package/src/shared/views/CometChatButton/CometChatButton.tsx +66 -0
- package/src/shared/views/CometChatButton/CometChatButtonStyle.ts +47 -0
- package/src/shared/views/CometChatButton/index.ts +15 -0
- package/src/shared/views/CometChatButton/style.ts +8 -0
- package/src/shared/views/CometChatCard/CometChatCard.tsx +77 -0
- package/src/shared/views/CometChatCard/CometChatCardStyle.ts +31 -0
- package/src/shared/views/CometChatCard/index.ts +9 -0
- package/src/shared/views/CometChatCard/style.ts +13 -0
- package/src/shared/views/CometChatConfirmDialog/CometChatConfirmDialog.tsx +138 -0
- package/src/shared/views/CometChatConfirmDialog/CometChatConfirmDialogStyle.ts +35 -0
- package/src/shared/views/CometChatConfirmDialog/index.ts +7 -0
- package/src/shared/views/CometChatConfirmDialog/style.ts +63 -0
- package/src/shared/views/CometChatDate/CometChatDate.tsx +188 -0
- package/src/shared/views/CometChatDate/DateConfiguration.ts +28 -0
- package/src/shared/views/CometChatDate/DateStyle.ts +26 -0
- package/src/shared/views/CometChatDate/index.ts +11 -0
- package/src/shared/views/CometChatDate/style.ts +8 -0
- package/src/shared/views/CometChatEmojiKeyboard/CometChatEmojiKeyboard.tsx +242 -0
- package/src/shared/views/CometChatEmojiKeyboard/Emoji.ts +17 -0
- package/src/shared/views/CometChatEmojiKeyboard/EmojiCategory.ts +22 -0
- package/src/shared/views/CometChatEmojiKeyboard/EmojiKeyboardConfiguration.ts +26 -0
- package/src/shared/views/CometChatEmojiKeyboard/EmojiKeyboardStyle.ts +44 -0
- package/src/shared/views/CometChatEmojiKeyboard/emojis.ts +8225 -0
- package/src/shared/views/CometChatEmojiKeyboard/index.ts +5 -0
- package/src/shared/views/CometChatEmojiKeyboard/resources/index.ts +10 -0
- package/src/shared/views/CometChatEmojiKeyboard/style.ts +64 -0
- package/src/shared/views/CometChatFileBubble/.DS_Store +0 -0
- package/src/shared/views/CometChatFileBubble/CometChatFileBubble.tsx +131 -0
- package/src/shared/views/CometChatFileBubble/FileBubbleStyle.ts +58 -0
- package/src/shared/views/CometChatFileBubble/index.ts +9 -0
- package/src/shared/views/CometChatFileBubble/resources/file_upload.png +0 -0
- package/src/shared/views/CometChatFileBubble/resources/index.ts +7 -0
- package/src/shared/views/CometChatFileBubble/style.ts +48 -0
- package/src/shared/views/CometChatImageBubble/CometChatImageBubble.tsx +106 -0
- package/src/shared/views/CometChatImageBubble/ImageBubbleStyle.ts +23 -0
- package/src/shared/views/CometChatImageBubble/index.ts +9 -0
- package/src/shared/views/CometChatList/CometChatList.tsx +727 -0
- package/src/shared/views/CometChatList/Header.tsx +139 -0
- package/src/shared/views/CometChatList/index.ts +12 -0
- package/src/shared/views/CometChatList/resources/Back.png +0 -0
- package/src/shared/views/CometChatList/resources/Spinner.png +0 -0
- package/src/shared/views/CometChatList/resources/checkmark.png +0 -0
- package/src/shared/views/CometChatList/resources/index.ts +12 -0
- package/src/shared/views/CometChatList/styles.ts +103 -0
- package/src/shared/views/CometChatListItem/CometChatListItem.tsx +304 -0
- package/src/shared/views/CometChatListItem/ListItemConfiguration.tsx +20 -0
- package/src/shared/views/CometChatListItem/ListItemStyle.ts +47 -0
- package/src/shared/views/CometChatListItem/index.ts +14 -0
- package/src/shared/views/CometChatListItem/style.ts +65 -0
- package/src/shared/views/CometChatMediaRecorder/CometChatMediaRecorder.tsx +253 -0
- package/src/shared/views/CometChatMediaRecorder/MediaRecorderStyle.ts +63 -0
- package/src/shared/views/CometChatMediaRecorder/index.ts +11 -0
- package/src/shared/views/CometChatMediaRecorder/style.ts +31 -0
- package/src/shared/views/CometChatMessageBubble/CometChatMessageBubble.tsx +94 -0
- package/src/shared/views/CometChatMessageBubble/MessageBubbleStyle.ts +22 -0
- package/src/shared/views/CometChatMessageBubble/index.ts +6 -0
- package/src/shared/views/CometChatMessageBubble/style.ts +0 -0
- package/src/shared/views/CometChatMessageInput/CometChatMessageInput.tsx +184 -0
- package/src/shared/views/CometChatMessageInput/index.ts +2 -0
- package/src/shared/views/CometChatMessageInput/styles.ts +9 -0
- package/src/shared/views/CometChatReceipt/CometChatReceipt.tsx +72 -0
- package/src/shared/views/CometChatReceipt/MessageConfiguration.ts +53 -0
- package/src/shared/views/CometChatReceipt/ReceiptStyle.ts +3 -0
- package/src/shared/views/CometChatReceipt/index.ts +9 -0
- package/src/shared/views/CometChatReceipt/resources/blue-double-tick-icon.png +0 -0
- package/src/shared/views/CometChatReceipt/resources/error.png +0 -0
- package/src/shared/views/CometChatReceipt/resources/grey-double-tick-icon.png +0 -0
- package/src/shared/views/CometChatReceipt/resources/grey-tick-icon.png +0 -0
- package/src/shared/views/CometChatReceipt/resources/index.ts +18 -0
- package/src/shared/views/CometChatReceipt/resources/sending.png +0 -0
- package/src/shared/views/CometChatReceipt/style.ts +9 -0
- package/src/shared/views/CometChatStatusIndicator/CometChatStatusIndicator.tsx +64 -0
- package/src/shared/views/CometChatStatusIndicator/StatusIndicatorConfiguration.ts +25 -0
- package/src/shared/views/CometChatStatusIndicator/StatusIndicatorStyle.ts +37 -0
- package/src/shared/views/CometChatStatusIndicator/index.ts +12 -0
- package/src/shared/views/CometChatStatusIndicator/styles.ts +15 -0
- package/src/shared/views/CometChatTextBubble/CometChatTextBubble.tsx +125 -0
- package/src/shared/views/CometChatTextBubble/TextBubbleStyle.ts +51 -0
- package/src/shared/views/CometChatTextBubble/index.ts +11 -0
- package/src/shared/views/CometChatVideoBubble/CometChatVideoBubble.tsx +113 -0
- package/src/shared/views/CometChatVideoBubble/VideoBubbleStyle.ts +37 -0
- package/src/shared/views/CometChatVideoBubble/index.ts +9 -0
- package/src/shared/views/CometChatVideoBubble/resources/index.ts +5 -0
- package/src/shared/views/CometChatVideoBubble/resources/play.png +0 -0
- package/src/shared/views/CometChatVideoBubble/style.ts +10 -0
- package/src/shared/views/SwipeRow/SwipeRow.tsx +133 -0
- package/src/shared/views/SwipeRow/index.ts +3 -0
- package/src/shared/views/SwipeRow/style.ts +30 -0
- package/src/shared/views/index.ts +163 -0
- /package/{lib → src}/CometChatBannedMembers/resources/clear.png +0 -0
- /package/{lib → src}/CometChatConversations/resources/back.png +0 -0
- /package/{lib → src}/CometChatConversations/resources/blue-double-tick-icon.png +0 -0
- /package/{lib → src}/CometChatConversations/resources/close.png +0 -0
- /package/{lib → src}/CometChatConversations/resources/delete.png +0 -0
- /package/{lib → src}/CometChatConversations/resources/error.png +0 -0
- /package/{lib → src}/CometChatConversations/resources/grey-double-tick-icon.png +0 -0
- /package/{lib → src}/CometChatConversations/resources/grey-tick-icon.png +0 -0
- /package/{lib → src}/CometChatConversations/resources/new.png +0 -0
- /package/{lib → src}/CometChatConversations/resources/password.png +0 -0
- /package/{lib → src}/CometChatConversations/resources/private.png +0 -0
- /package/{lib → src}/CometChatConversations/resources/rightTick.png +0 -0
- /package/{lib → src}/CometChatConversations/resources/sending.png +0 -0
- /package/{lib → src}/CometChatConversations/resources/spineer.png +0 -0
- /package/{lib → src}/CometChatCreateGroup/resources/close.png +0 -0
- /package/{lib → src}/CometChatCreateGroup/resources/rightTick.png +0 -0
- /package/{lib → src}/CometChatCreateGroup/resources/warning.png +0 -0
- /package/{lib → src}/CometChatDetails/resources/Back.png +0 -0
- /package/{lib → src}/CometChatDetails/resources/close.png +0 -0
- /package/{lib → src}/CometChatDetails/resources/password.png +0 -0
- /package/{lib → src}/CometChatDetails/resources/private.png +0 -0
- /package/{lib → src}/CometChatDetails/resources/right-arrow.png +0 -0
- /package/{lib → src}/CometChatGroupMembers/resources/banIcon.png +0 -0
- /package/{lib → src}/CometChatGroupMembers/resources/downArrowIcon.png +0 -0
- /package/{lib → src}/CometChatGroupMembers/resources/kickIcon.png +0 -0
- /package/{lib → src}/CometChatGroupMembers/resources/rightTick.png +0 -0
- /package/{lib → src}/CometChatGroups/resources/back.png +0 -0
- /package/{lib → src}/CometChatGroups/resources/close.png +0 -0
- /package/{lib → src}/CometChatGroups/resources/create.png +0 -0
- /package/{lib → src}/CometChatGroups/resources/more.png +0 -0
- /package/{lib → src}/CometChatGroups/resources/password.png +0 -0
- /package/{lib → src}/CometChatGroups/resources/private.png +0 -0
- /package/{lib → src}/CometChatGroups/resources/rightTick.png +0 -0
- /package/{lib → src}/CometChatGroups/resources/search.png +0 -0
- /package/{lib → src}/CometChatGroups/resources/spineer.png +0 -0
- /package/{lib → src}/CometChatGroupsWithMessages/resources/write.png +0 -0
- /package/{lib → src}/CometChatJoinProtectedGroup/resources/close.png +0 -0
- /package/{lib → src}/CometChatJoinProtectedGroup/resources/rightTick.png +0 -0
- /package/{lib → src}/CometChatMessageComposer/resources/circle_add.png +0 -0
- /package/{lib → src}/CometChatMessageComposer/resources/close.png +0 -0
- /package/{lib → src}/CometChatMessageComposer/resources/emoji.png +0 -0
- /package/{lib → src}/CometChatMessageComposer/resources/heart.png +0 -0
- /package/{lib → src}/CometChatMessageComposer/resources/image.png +0 -0
- /package/{lib → src}/CometChatMessageComposer/resources/send_message.png +0 -0
- /package/{lib → src}/CometChatMessageComposer/resources/stickers.png +0 -0
- /package/{lib → src}/CometChatMessageHeader/resources/Back.png +0 -0
- /package/{lib → src}/CometChatMessageHeader/resources/password.png +0 -0
- /package/{lib → src}/CometChatMessageHeader/resources/private.png +0 -0
- /package/{lib/calls/CometChatCallHistory → src/CometChatMessageInformation}/resources/Spineer.png +0 -0
- /package/{lib → src}/CometChatMessageList/resources/back.png +0 -0
- /package/{lib → src}/CometChatMessageList/resources/close.png +0 -0
- /package/{lib → src}/CometChatMessageList/resources/downArrowIcon.png +0 -0
- /package/{lib → src}/CometChatMessageList/resources/rightArrowIcon.png +0 -0
- /package/{lib → src}/CometChatMessageList/resources/spineer.png +0 -0
- /package/{lib → src}/CometChatMessages/resources/info.png +0 -0
- /package/{lib → src}/CometChatThreadedMessages/resources/Back.png +0 -0
- /package/{lib → src}/CometChatThreadedMessages/resources/close.png +0 -0
- /package/{lib → src}/CometChatThreadedMessages/resources/more.png +0 -0
- /package/{lib → src}/CometChatThreadedMessages/resources/password.png +0 -0
- /package/{lib → src}/CometChatThreadedMessages/resources/private.png +0 -0
- /package/{lib → src}/CometChatThreadedMessages/resources/right-arrow.png +0 -0
- /package/{lib → src}/calls/CometChatCallBubble/resources/avatar.png +0 -0
- /package/{lib → src}/calls/CometChatCallBubble/resources/incomingaudiocall.png +0 -0
- /package/{lib → src}/calls/CometChatCallBubble/resources/incomingvideocall.png +0 -0
- /package/{lib → src}/calls/CometChatCallButtons/resources/Call.png +0 -0
- /package/{lib → src}/calls/CometChatCallButtons/resources/Video.png +0 -0
- /package/{lib → src}/calls/CometChatCallDetails/resources/CloseIcon.png +0 -0
- /package/{lib → src}/calls/CometChatCallHistory/resources/Back.png +0 -0
- /package/{lib → src}/calls/CometChatCallHistory/resources/Call.png +0 -0
- /package/{lib → src}/calls/CometChatCallHistory/resources/Info.png +0 -0
- /package/{lib → src}/calls/CometChatCallHistory/resources/Selection.png +0 -0
- /package/{lib/shared/views/CometChatList/resources/Spinner.png → src/calls/CometChatCallHistory/resources/Spineer.png} +0 -0
- /package/{lib → src}/calls/CometChatCallHistory/resources/Video.png +0 -0
- /package/{lib → src}/calls/CometChatCallHistory/resources/check.png +0 -0
- /package/{lib → src}/calls/CometChatIncomingCall/resources/Call.png +0 -0
- /package/{lib → src}/calls/CometChatIncomingCall/resources/close.png +0 -0
- /package/{lib → src}/calls/CometChatIncomingCall/resources/incomingaudiocall.png +0 -0
- /package/{lib → src}/calls/CometChatIncomingCall/resources/incomingvideocall.png +0 -0
- /package/{lib → src}/calls/CometChatOutgoingCall/resources/Close.png +0 -0
- /package/{lib → src}/calls/resources/Call.png +0 -0
- /package/{lib → src}/calls/resources/Video.png +0 -0
- /package/{lib → src}/extensions/CollaborativeBubble/resources/whiteboard.png +0 -0
- /package/{lib → src}/extensions/CollaborativeDocument/resources/collaborative_document.png +0 -0
- /package/{lib → src}/extensions/CollaborativeDocument/resources/collaborative_document_2x.png +0 -0
- /package/{lib → src}/extensions/CollaborativeWhiteboard/resources/collaborative_whiteboard.png +0 -0
- /package/{lib → src}/extensions/CollaborativeWhiteboard/resources/whiteboard.png +0 -0
- /package/{lib → src}/extensions/ImageModeration/resources/unsafe.png +0 -0
- /package/{lib → src}/extensions/LinkPreview/resources/defaultImage.png +0 -0
- /package/{lib → src}/extensions/MessageTranslation/resources/translate.png +0 -0
- /package/{lib → src}/extensions/Polls/resources/close.png +0 -0
- /package/{lib → src}/extensions/Polls/resources/document.png +0 -0
- /package/{lib → src}/extensions/Polls/resources/kickIcon.png +0 -0
- /package/{lib → src}/extensions/Polls/resources/rightTick.png +0 -0
- /package/{lib → src}/extensions/Polls/resources/warning.png +0 -0
- /package/{lib → src}/extensions/Reactions/resources/AddReactions.png +0 -0
- /package/{lib → src}/extensions/SmartReplies/resources/close.png +0 -0
- /package/{lib → src}/extensions/Stickers/resources/Stickers.png +0 -0
- /package/{lib/shared/views/CometChatList/resources → src/shared/assets/images}/Back.png +0 -0
- /package/{lib/shared/views/CometChatReceipt/resources → src/shared/assets/images}/blue-double-tick-icon.png +0 -0
- /package/{lib/shared/views/CometChatList/resources → src/shared/assets/images}/checkmark.png +0 -0
- /package/{lib/shared/views/CometChatReceipt/resources → src/shared/assets/images}/error.png +0 -0
- /package/{lib/shared/views/CometChatReceipt/resources → src/shared/assets/images}/grey-double-tick-icon.png +0 -0
- /package/{lib/shared/views/CometChatReceipt/resources → src/shared/assets/images}/grey-tick-icon.png +0 -0
- /package/{lib/shared/views/CometChatReceipt/resources → src/shared/assets/images}/sending.png +0 -0
- /package/{lib → src}/shared/framework/resources/audio-file.png +0 -0
- /package/{lib → src}/shared/framework/resources/circle_add.png +0 -0
- /package/{lib → src}/shared/framework/resources/copy.png +0 -0
- /package/{lib → src}/shared/framework/resources/delete.png +0 -0
- /package/{lib → src}/shared/framework/resources/edit.png +0 -0
- /package/{lib → src}/shared/framework/resources/emoji.png +0 -0
- /package/{lib → src}/shared/framework/resources/file_upload.png +0 -0
- /package/{lib → src}/shared/framework/resources/forward.png +0 -0
- /package/{lib → src}/shared/framework/resources/heart.png +0 -0
- /package/{lib → src}/shared/framework/resources/image.png +0 -0
- /package/{lib → src}/shared/framework/resources/info.png +0 -0
- /package/{lib → src}/shared/framework/resources/location.png +0 -0
- /package/{lib/shared/views/CometChatAudioBubble → src/shared/framework}/resources/pause.png +0 -0
- /package/{lib/shared/views/CometChatAudioBubble → src/shared/framework}/resources/play.png +0 -0
- /package/{lib → src}/shared/framework/resources/reply.png +0 -0
- /package/{lib → src}/shared/framework/resources/send_message.png +0 -0
- /package/{lib → src}/shared/framework/resources/share.png +0 -0
- /package/{lib → src}/shared/framework/resources/thread.png +0 -0
- /package/{lib → src}/shared/framework/resources/video_upload.png +0 -0
- /package/{lib → src}/shared/resources/CometChatSoundManager/resources/incomingcall.wav +0 -0
- /package/{lib → src}/shared/resources/CometChatSoundManager/resources/incomingmessage.wav +0 -0
- /package/{lib → src}/shared/resources/CometChatSoundManager/resources/incomingothermessage.wav +0 -0
- /package/{lib → src}/shared/resources/CometChatSoundManager/resources/outgoingcall.wav +0 -0
- /package/{lib → src}/shared/resources/CometChatSoundManager/resources/outgoingmessage.wav +0 -0
- /package/{lib → src}/shared/utils/CometChatLiveReactions/resources/heart.png +0 -0
- /package/{lib → src}/shared/utils/CometChatMessagePreview/resources/close.png +0 -0
- /package/{lib → src}/shared/utils/DetailsUtils/resources/Back.png +0 -0
- /package/{lib → src}/shared/utils/DetailsUtils/resources/banIcon.png +0 -0
- /package/{lib → src}/shared/utils/DetailsUtils/resources/close.png +0 -0
- /package/{lib → src}/shared/utils/DetailsUtils/resources/kickIcon.png +0 -0
- /package/{lib → src}/shared/utils/DetailsUtils/resources/password.png +0 -0
- /package/{lib → src}/shared/utils/DetailsUtils/resources/private.png +0 -0
- /package/{lib → src}/shared/utils/DetailsUtils/resources/right-arrow.png +0 -0
- /package/{lib → src}/shared/views/CometChatActionSheet/resources/grid.png +0 -0
- /package/{lib → src}/shared/views/CometChatActionSheet/resources/list.png +0 -0
- /package/{lib/shared/views/CometChatVideoBubble → src/shared/views/CometChatAudioBubble}/resources/play.png +0 -0
- /package/{lib → src}/shared/views/CometChatAvatar/resources/default.jpg +0 -0
- /package/{lib → src}/shared/views/CometChatEmojiKeyboard/resources/activity.png +0 -0
- /package/{lib → src}/shared/views/CometChatEmojiKeyboard/resources/animals.png +0 -0
- /package/{lib → src}/shared/views/CometChatEmojiKeyboard/resources/flags.png +0 -0
- /package/{lib → src}/shared/views/CometChatEmojiKeyboard/resources/food.png +0 -0
- /package/{lib → src}/shared/views/CometChatEmojiKeyboard/resources/objects.png +0 -0
- /package/{lib → src}/shared/views/CometChatEmojiKeyboard/resources/smileys.png +0 -0
- /package/{lib → src}/shared/views/CometChatEmojiKeyboard/resources/symbols.png +0 -0
- /package/{lib → src}/shared/views/CometChatEmojiKeyboard/resources/travel.png +0 -0
- /package/{lib → src}/shared/views/CometChatFileBubble/resources/download.png +0 -0
- /package/{lib → src}/shared/views/CometChatList/resources/Search.png +0 -0
- /package/{lib → src}/shared/views/CometChatList/resources/check.png +0 -0
|
@@ -0,0 +1,1034 @@
|
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import { View, Text } from "react-native";
|
|
3
|
+
//@ts-ignore
|
|
4
|
+
import { CometChat } from "@cometchat/chat-sdk-react-native";
|
|
5
|
+
import {
|
|
6
|
+
AvatarStyleInterface,
|
|
7
|
+
ChatConfigurator,
|
|
8
|
+
CometChatConfirmDialog,
|
|
9
|
+
CometChatConfirmDialogStyleInterface,
|
|
10
|
+
CometChatContext,
|
|
11
|
+
localize
|
|
12
|
+
} from "../shared";
|
|
13
|
+
import { Style } from "./style";
|
|
14
|
+
import {
|
|
15
|
+
backIcon, passwordGroupIcon,
|
|
16
|
+
privateGroupIcon,
|
|
17
|
+
sentIcon, readIcon, deliveredIcon,
|
|
18
|
+
rightTickIcon, deleteIcon
|
|
19
|
+
} from "./resources";
|
|
20
|
+
import { ConversationsStyle, ConversationsStyleInterface } from "./ConversationsStyle";
|
|
21
|
+
import { ImageType } from "../shared";
|
|
22
|
+
import { GroupTypeConstants, MessageStatusConstants, PASSWORD_GROUP_COLOR, PRIVATE_GROUP_COLOR, ReceiverTypeConstants } from "../shared/constants/UIKitConstants";
|
|
23
|
+
import { AvatarStyle, BadgeStyle, CometChatBadge, CometChatDate, CometChatListItem, CometChatReceipt, DateStyle, StatusIndicatorStyle } from "../shared";
|
|
24
|
+
import { ListItemStyle, ListItemStyleInterface } from "../shared";
|
|
25
|
+
import { CometChatContextType, MessageReceipt, SelectionMode } from "../shared/base/Types";
|
|
26
|
+
import { CometChatSoundManager } from "../shared"
|
|
27
|
+
import { CometChatConversationUtils } from "../shared";
|
|
28
|
+
import { CometChatList } from "../shared";
|
|
29
|
+
import { CometChatOptions } from "../shared";
|
|
30
|
+
import { CometChatUIEventHandler } from "../shared/events/CometChatUIEventHandler/CometChatUIEventHandler";
|
|
31
|
+
import { StatusIndicatorStyleInterface } from "../shared/views/CometChatStatusIndicator/StatusIndicatorStyle";
|
|
32
|
+
import { DateStyleInterface } from "../shared/views/CometChatDate/DateStyle";
|
|
33
|
+
import { BadgeStyleInterface } from "../shared/views/CometChatBadge";
|
|
34
|
+
|
|
35
|
+
const conversationListenerId = "chatlist_" + new Date().getTime();
|
|
36
|
+
const userListenerId = "chatlist_user_" + new Date().getTime();
|
|
37
|
+
const groupListenerId = "chatlist_group_" + new Date().getTime();
|
|
38
|
+
const messageListenerId = "chatlist_message_" + new Date().getTime();
|
|
39
|
+
const callListenerId = "call_" + new Date().getTime();
|
|
40
|
+
|
|
41
|
+
export interface ConversationInterface {
|
|
42
|
+
/**
|
|
43
|
+
* hide selection icon
|
|
44
|
+
*/
|
|
45
|
+
hideSubmitIcon?: boolean,
|
|
46
|
+
/**
|
|
47
|
+
* toggle user presence view
|
|
48
|
+
*/
|
|
49
|
+
disableUsersPresence?: boolean,
|
|
50
|
+
/**
|
|
51
|
+
* toggle react receipt view
|
|
52
|
+
*/
|
|
53
|
+
disableReadReceipt?: boolean,
|
|
54
|
+
/**
|
|
55
|
+
* disable message receipts
|
|
56
|
+
*/
|
|
57
|
+
disableReceipt?: boolean,
|
|
58
|
+
/**
|
|
59
|
+
* toggle typing indicator
|
|
60
|
+
*/
|
|
61
|
+
disableTyping?: boolean,
|
|
62
|
+
/**
|
|
63
|
+
* toggle sound played when message is received
|
|
64
|
+
*/
|
|
65
|
+
disableSoundForMessages?: boolean,
|
|
66
|
+
/**
|
|
67
|
+
* custom sound for received messages
|
|
68
|
+
*/
|
|
69
|
+
customSoundForMessages?: string,
|
|
70
|
+
/**
|
|
71
|
+
* custom icon for protected group
|
|
72
|
+
*/
|
|
73
|
+
protectedGroupIcon?: ImageType,
|
|
74
|
+
/**
|
|
75
|
+
* custom icon for private group
|
|
76
|
+
*/
|
|
77
|
+
privateGroupIcon?: ImageType,
|
|
78
|
+
/**
|
|
79
|
+
* custom icon for read message
|
|
80
|
+
*/
|
|
81
|
+
readIcon?: ImageType,
|
|
82
|
+
/**
|
|
83
|
+
* custom icon for delivered message
|
|
84
|
+
*/
|
|
85
|
+
deliveredIcon?: ImageType,
|
|
86
|
+
/**
|
|
87
|
+
* custom icon for sent message
|
|
88
|
+
*/
|
|
89
|
+
sentIcon?: ImageType,
|
|
90
|
+
/**
|
|
91
|
+
* custom icon for error message
|
|
92
|
+
*/
|
|
93
|
+
errorIcon?: ImageType,
|
|
94
|
+
/**
|
|
95
|
+
* custom icon for waiting message
|
|
96
|
+
*/
|
|
97
|
+
waitingIcon?: ImageType,
|
|
98
|
+
/**
|
|
99
|
+
* call back function which will get an conversation as an argument and returns an string.
|
|
100
|
+
*/
|
|
101
|
+
datePattern?: (conversation: CometChat.Conversation) => string,
|
|
102
|
+
/**
|
|
103
|
+
* pass the custom view for list item
|
|
104
|
+
*/
|
|
105
|
+
ListItemView?: (item: CometChat.Conversation) => JSX.Element,
|
|
106
|
+
/**
|
|
107
|
+
* pass the functional component for options in app bar
|
|
108
|
+
*/
|
|
109
|
+
AppBarOption?: () => JSX.Element,
|
|
110
|
+
/**
|
|
111
|
+
* Pass array of CometChatOptions type
|
|
112
|
+
* Tobe shown on swipe of list item
|
|
113
|
+
*/
|
|
114
|
+
options?: (item: CometChat.Conversation) => CometChatOptions[],
|
|
115
|
+
/**
|
|
116
|
+
* toggle seperator
|
|
117
|
+
*/
|
|
118
|
+
hideSeparator?: boolean,
|
|
119
|
+
/**
|
|
120
|
+
* icon for back button
|
|
121
|
+
*/
|
|
122
|
+
backButtonIcon?: ImageType,
|
|
123
|
+
/**
|
|
124
|
+
* toggle back button view
|
|
125
|
+
*/
|
|
126
|
+
showBackButton?: boolean,
|
|
127
|
+
/**
|
|
128
|
+
* select items pass "none" | "single" | "multitple"
|
|
129
|
+
*/
|
|
130
|
+
selectionMode?: SelectionMode,
|
|
131
|
+
/**
|
|
132
|
+
* call back on seleciton is done
|
|
133
|
+
*/
|
|
134
|
+
onSelection?: (item: Array<CometChat.Conversation>) => void,
|
|
135
|
+
/**
|
|
136
|
+
* title to be shown default "Chats"
|
|
137
|
+
*/
|
|
138
|
+
title?: string,
|
|
139
|
+
/**
|
|
140
|
+
* Text to be displayed if no conversation found.
|
|
141
|
+
*/
|
|
142
|
+
emptyStateText?: string,
|
|
143
|
+
/**
|
|
144
|
+
* Custom Functional component for empty state
|
|
145
|
+
*/
|
|
146
|
+
EmptyStateView?: () => JSX.Element,
|
|
147
|
+
/**
|
|
148
|
+
* Text tobe displayed if there is an error while fetching conversations.
|
|
149
|
+
*/
|
|
150
|
+
errorStateText?: string,
|
|
151
|
+
/**
|
|
152
|
+
* Custom functional component for error state.
|
|
153
|
+
*/
|
|
154
|
+
ErrorStateView?: () => JSX.Element,
|
|
155
|
+
/**
|
|
156
|
+
* Custom functional component for loading state.
|
|
157
|
+
*/
|
|
158
|
+
LoadingStateView?: () => JSX.Element,
|
|
159
|
+
/**
|
|
160
|
+
* Request builder to fetch conversations.
|
|
161
|
+
*/
|
|
162
|
+
conversationsRequestBuilder?: CometChat.ConversationsRequestBuilder,
|
|
163
|
+
/**
|
|
164
|
+
* Custom subtitle view
|
|
165
|
+
*/
|
|
166
|
+
SubtitleView?: (item: CometChat.Conversation) => JSX.Element,
|
|
167
|
+
/**
|
|
168
|
+
* toogle error view
|
|
169
|
+
*/
|
|
170
|
+
hideError?: boolean,
|
|
171
|
+
/**
|
|
172
|
+
* call back function for
|
|
173
|
+
*/
|
|
174
|
+
onItemPress?: (item: CometChat.Conversation) => void,
|
|
175
|
+
/**
|
|
176
|
+
* callback function for long press
|
|
177
|
+
*/
|
|
178
|
+
onItemLongPress?: (item: CometChat.Conversation) => void,
|
|
179
|
+
/**
|
|
180
|
+
* callback function will be called when error occured while fetching conversations
|
|
181
|
+
*/
|
|
182
|
+
onError?: (e: CometChat.CometChatException) => void,
|
|
183
|
+
/**
|
|
184
|
+
* callback function for on back
|
|
185
|
+
*/
|
|
186
|
+
onBack?: () => void,
|
|
187
|
+
/**
|
|
188
|
+
* style object for conversations
|
|
189
|
+
*/
|
|
190
|
+
conversationsStyle?: ConversationsStyleInterface,
|
|
191
|
+
/**
|
|
192
|
+
* style object for list item
|
|
193
|
+
*/
|
|
194
|
+
listItemStyle?: ListItemStyleInterface,
|
|
195
|
+
/**
|
|
196
|
+
* style object for avatar
|
|
197
|
+
*/
|
|
198
|
+
avatarStyle?: AvatarStyleInterface,
|
|
199
|
+
/**
|
|
200
|
+
* style object for status indicator
|
|
201
|
+
*/
|
|
202
|
+
statusIndicatorStyle?: StatusIndicatorStyleInterface,
|
|
203
|
+
/**
|
|
204
|
+
* style object for date
|
|
205
|
+
*/
|
|
206
|
+
dateStyle?: DateStyleInterface,
|
|
207
|
+
/**
|
|
208
|
+
* style object for receipt
|
|
209
|
+
*/
|
|
210
|
+
receiptStyle?: Object,
|
|
211
|
+
/**
|
|
212
|
+
* style object for badge
|
|
213
|
+
*/
|
|
214
|
+
badgeStyle?: BadgeStyleInterface,
|
|
215
|
+
/**
|
|
216
|
+
* style object for confirm dialog
|
|
217
|
+
*/
|
|
218
|
+
confirmDialogStyle?: CometChatConfirmDialogStyleInterface
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
*
|
|
223
|
+
* @version 1.0.0
|
|
224
|
+
* @author CometChatTeam
|
|
225
|
+
* @description CometChatConversations is a container component that wraps and
|
|
226
|
+
* formats CometChatListBase and CometChatConversationList component, with no behavior of its own.
|
|
227
|
+
*
|
|
228
|
+
*/
|
|
229
|
+
export const CometChatConversations = (props: ConversationInterface) => {
|
|
230
|
+
/**
|
|
231
|
+
* Props destructuring
|
|
232
|
+
*/
|
|
233
|
+
const {
|
|
234
|
+
disableUsersPresence = false,
|
|
235
|
+
disableReadReceipt = false,
|
|
236
|
+
disableReceipt = false,
|
|
237
|
+
disableTyping = false,
|
|
238
|
+
disableSoundForMessages = false,
|
|
239
|
+
customSoundForMessages,
|
|
240
|
+
datePattern,
|
|
241
|
+
ListItemView,
|
|
242
|
+
AppBarOption,
|
|
243
|
+
options,
|
|
244
|
+
hideSeparator = true,
|
|
245
|
+
hideSubmitIcon = true,
|
|
246
|
+
backButtonIcon,
|
|
247
|
+
showBackButton = false,
|
|
248
|
+
selectionMode = "multiple",
|
|
249
|
+
onSelection,
|
|
250
|
+
title = localize("CHATS"),
|
|
251
|
+
emptyStateText,
|
|
252
|
+
EmptyStateView,
|
|
253
|
+
errorStateText,
|
|
254
|
+
ErrorStateView,
|
|
255
|
+
LoadingStateView,
|
|
256
|
+
conversationsRequestBuilder,
|
|
257
|
+
SubtitleView,
|
|
258
|
+
hideError = false,
|
|
259
|
+
onItemPress,
|
|
260
|
+
onItemLongPress,
|
|
261
|
+
onError,
|
|
262
|
+
onBack,
|
|
263
|
+
conversationsStyle,
|
|
264
|
+
} = props;
|
|
265
|
+
|
|
266
|
+
//context
|
|
267
|
+
const { theme } = useContext<CometChatContextType>(CometChatContext);
|
|
268
|
+
|
|
269
|
+
const conversationListRef = React.useRef(null);
|
|
270
|
+
const loggedInUser = React.useRef(null);
|
|
271
|
+
const [confirmDelete, setConfirmDelete] = React.useState(undefined);
|
|
272
|
+
const [selecting, setSelecting] = React.useState(false);
|
|
273
|
+
const [selectedConversation, setSelectedConversations] = React.useState([]);
|
|
274
|
+
|
|
275
|
+
const _style = new ConversationsStyle({
|
|
276
|
+
backgroundColor: theme?.palette?.getBackgroundColor(),
|
|
277
|
+
backIconTint: theme?.palette?.getPrimary(),
|
|
278
|
+
emptyTextColor: theme?.palette?.getAccent400(),
|
|
279
|
+
emptyTextFont: theme?.typography?.caption2,
|
|
280
|
+
errorTextColor: theme?.palette?.getError(),
|
|
281
|
+
errorTextFont: theme?.typography?.subtitle1,
|
|
282
|
+
lastMessageTextColor: theme?.palette.getAccent600(),
|
|
283
|
+
lastMessageTextFont: theme?.typography.subtitle1,
|
|
284
|
+
loadingIconTint: theme?.palette.getAccent700(),
|
|
285
|
+
separatorColor: theme?.palette.getAccent100(),
|
|
286
|
+
titleColor: theme?.palette.getAccent(),
|
|
287
|
+
titleFont: theme?.typography.heading,
|
|
288
|
+
typingIndictorTextColor: theme?.palette.getAccent600(),
|
|
289
|
+
typingIndictorTextFont: theme?.typography.subtitle1,
|
|
290
|
+
threadIndicatorTextColor: theme?.palette.getAccent800(),
|
|
291
|
+
threadIndicatorTextFont: theme?.typography.text1,
|
|
292
|
+
...conversationsStyle
|
|
293
|
+
});
|
|
294
|
+
const _statusIndicatorStyle = new StatusIndicatorStyle(props?.statusIndicatorStyle || {});
|
|
295
|
+
const _avatarStyle = new AvatarStyle({
|
|
296
|
+
backgroundColor: theme?.palette?.getAccent600(),
|
|
297
|
+
nameTextColor: theme?.palette?.getAccent(),
|
|
298
|
+
nameTextFont: theme?.typography.body,
|
|
299
|
+
...props?.avatarStyle
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
const _listItemStyle = new ListItemStyle({
|
|
303
|
+
backgroundColor: theme?.palette?.getBackgroundColor(),
|
|
304
|
+
titleColor: theme?.palette.getAccent(),
|
|
305
|
+
titleFont: theme?.typography.name,
|
|
306
|
+
...props?.listItemStyle
|
|
307
|
+
});
|
|
308
|
+
const _badgeStyle = new BadgeStyle({
|
|
309
|
+
backgroundColor: theme?.palette?.getPrimary(),
|
|
310
|
+
textColor: theme?.palette?.getSecondary(),
|
|
311
|
+
textFont: theme?.typography?.caption2,
|
|
312
|
+
...props?.badgeStyle
|
|
313
|
+
});
|
|
314
|
+
// const _receiptStyle = new ReceiptStyle(props?.receiptStyle || {});
|
|
315
|
+
const _dateStyle = new DateStyle({
|
|
316
|
+
textColor: theme?.palette?.getAccent600(),
|
|
317
|
+
textFont: theme?.typography?.caption1,
|
|
318
|
+
...props?.dateStyle
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
const _confirmDialogStyle = (props?.confirmDialogStyle || {});
|
|
322
|
+
|
|
323
|
+
const ErrorView = () => {
|
|
324
|
+
return (
|
|
325
|
+
<View style={Style.listContainer}>
|
|
326
|
+
<Text style={{ ..._style?.errorTextFont, color: _style?.errorTextColor }}>
|
|
327
|
+
{errorStateText || localize("SOMETHING_WRONG")}
|
|
328
|
+
</Text>
|
|
329
|
+
</View>
|
|
330
|
+
);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
const EmptyView = () => {
|
|
334
|
+
if (EmptyStateView)
|
|
335
|
+
return EmptyStateView();
|
|
336
|
+
else
|
|
337
|
+
return (
|
|
338
|
+
<View style={Style.listContainer}>
|
|
339
|
+
<Text style={{ ..._style.emptyTextFont, color: _style.emptyTextColor }}>
|
|
340
|
+
{emptyStateText || localize("NO_CHATS_FOUND")}
|
|
341
|
+
</Text>
|
|
342
|
+
</View>
|
|
343
|
+
)
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
const userEventHandler = (...args) => {
|
|
347
|
+
const { uid, blockedByMe, status } = args[0];
|
|
348
|
+
if (!blockedByMe) {
|
|
349
|
+
let item = conversationListRef.current.getListItem(`${uid}_user_${loggedInUser.current.uid}`);
|
|
350
|
+
if (item) {
|
|
351
|
+
let updatedConversation = {
|
|
352
|
+
...item,
|
|
353
|
+
conversationWith: {
|
|
354
|
+
...item.conversationWith,
|
|
355
|
+
status
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
console.log(JSON.stringify(updatedConversation));
|
|
359
|
+
conversationListRef.current.updateList(updatedConversation);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Listener callback for typing event
|
|
366
|
+
* @param {...any} args
|
|
367
|
+
*/
|
|
368
|
+
const typingEventHandler = (...args) => {
|
|
369
|
+
// console.log("typing event", args[1], args[0].receiverId);
|
|
370
|
+
let conversation = conversationListRef.current.getListItem(`${args[0]['receiverType']}_${args[0]['receiverId']}`);
|
|
371
|
+
// console.log("typing event", conversation);
|
|
372
|
+
let isTyping = args[1];
|
|
373
|
+
let newConversation = conversation
|
|
374
|
+
if (isTyping) {
|
|
375
|
+
newConversation['lastMessage']["typing"] = args[0].receiverType === 'group' ?
|
|
376
|
+
`${args[0].sender.name} : ${localize("IS_TYPING")}` :
|
|
377
|
+
localize("IS_TYPING");
|
|
378
|
+
} else {
|
|
379
|
+
delete newConversation['lastMessage']['typing'];
|
|
380
|
+
}
|
|
381
|
+
conversationListRef.current.updateList(conversation);
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Find conversation from state and udpate its last message object.
|
|
386
|
+
* Also remove from the current location and put it to 1st location.
|
|
387
|
+
*
|
|
388
|
+
* @param newMessage message object
|
|
389
|
+
*/
|
|
390
|
+
const updateLastMessage = (newMessage) => {
|
|
391
|
+
CometChat.CometChatHelper.getConversationFromMessage(newMessage)
|
|
392
|
+
.then(conversation => {
|
|
393
|
+
const oldConversation: CometChat.Conversation = conversationListRef.current.getListItem(conversation['conversationId']);
|
|
394
|
+
if (oldConversation == undefined) {
|
|
395
|
+
CometChat.CometChatHelper.getConversationFromMessage(newMessage)
|
|
396
|
+
.then(newConversation => {
|
|
397
|
+
newConversation.setUnreadMessageCount(1);
|
|
398
|
+
conversationListRef.current.updateAndMoveToFirst(newConversation);
|
|
399
|
+
})
|
|
400
|
+
.catch(err => onError && onError(err))
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
oldConversation['lastMessage'] = newMessage;
|
|
404
|
+
if (newMessage['sender']['uid'] != loggedInUser.current?.['uid'])
|
|
405
|
+
oldConversation.setUnreadMessageCount(oldConversation.getUnreadMessageCount() + 1);
|
|
406
|
+
conversationListRef.current.updateAndMoveToFirst(oldConversation);
|
|
407
|
+
})
|
|
408
|
+
.catch(err => {
|
|
409
|
+
console.log("Error", err);
|
|
410
|
+
})
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* play notification sound for incoming messages
|
|
415
|
+
*/
|
|
416
|
+
const playNotificationSound = () => {
|
|
417
|
+
// code for playing sound need to be added here.
|
|
418
|
+
if (disableSoundForMessages) return;
|
|
419
|
+
CometChatSoundManager.play(
|
|
420
|
+
customSoundForMessages || CometChatSoundManager.SoundOutput.incomingMessageFromOther
|
|
421
|
+
);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
const shouldMarkAsDelivered = (message: object) => {
|
|
425
|
+
return !disableReceipt && !message.hasOwnProperty("deliveredAt");
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* marking the incoming messages as delivered
|
|
430
|
+
*/
|
|
431
|
+
const markMessageAsDelivered = (message) => {
|
|
432
|
+
if (message.hasOwnProperty('deletedAt')) return;
|
|
433
|
+
|
|
434
|
+
if (shouldMarkAsDelivered(message)) {
|
|
435
|
+
CometChat.markAsDelivered(message);
|
|
436
|
+
playNotificationSound();
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
*
|
|
442
|
+
* When a text message / media message / custom message is received
|
|
443
|
+
*/
|
|
444
|
+
const messageEventHandler = (...args) => {
|
|
445
|
+
const message = args[0];
|
|
446
|
+
!disableReadReceipt && markMessageAsDelivered(message);
|
|
447
|
+
updateLastMessage(message);
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* callback handler for group Add / Kicked / Banned / Scope Change
|
|
452
|
+
* @param {obj} message
|
|
453
|
+
*/
|
|
454
|
+
const groupHandler = (message) => {
|
|
455
|
+
let conversation = conversationListRef.current.getListItem(message['conversationId'])
|
|
456
|
+
|
|
457
|
+
if (conversation) {
|
|
458
|
+
conversation.setLastMessage(message);
|
|
459
|
+
conversationListRef.current.updateList(conversation);
|
|
460
|
+
} else {
|
|
461
|
+
CometChat.CometChatHelper.getConversationFromMessage(message)
|
|
462
|
+
.then(newConversation => {
|
|
463
|
+
conversationListRef.current.addItemToList(newConversation, 0);
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
const conversationClicked = (conversation) => {
|
|
469
|
+
if (onItemPress) {
|
|
470
|
+
onItemPress(conversation);
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
if (!selecting) {
|
|
474
|
+
//fire event
|
|
475
|
+
return;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
if (selectionMode == "none") return;
|
|
479
|
+
|
|
480
|
+
let index = selectedConversation.findIndex(tmpConver => tmpConver.conversationWith.conversationId == conversation.conversationWith.conversationId);
|
|
481
|
+
if (index < 0) {
|
|
482
|
+
if (selectionMode == "single")
|
|
483
|
+
setSelectedConversations([conversation])
|
|
484
|
+
|
|
485
|
+
if (selectionMode == "multiple")
|
|
486
|
+
setSelectedConversations([...selectedConversation, conversation]);
|
|
487
|
+
} else {
|
|
488
|
+
selectedConversation.splice(index, 1);
|
|
489
|
+
setSelectedConversations([...selectedConversation]);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
const conversationLongPressed = (conversation) => {
|
|
494
|
+
if (onItemLongPress) {
|
|
495
|
+
onItemLongPress(conversation);
|
|
496
|
+
return;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
if (selectionMode == "none") return;
|
|
500
|
+
|
|
501
|
+
setSelecting(true);
|
|
502
|
+
setSelectedConversations([...selectedConversation, conversation]);
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
const removeItemFromSelectionList = (id) => {
|
|
506
|
+
//remove from selected list if list is in selecting mode.
|
|
507
|
+
if (selecting) {
|
|
508
|
+
let index = selectedConversation.find(member => member['uid'] == id);
|
|
509
|
+
if (index > -1) {
|
|
510
|
+
let tmpSelectedConversations = [...selectedConversation];
|
|
511
|
+
tmpSelectedConversations.splice(index, 1);
|
|
512
|
+
setSelectedConversations(tmpSelectedConversations);
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
const removeConversation = (id) => {
|
|
518
|
+
let conversation = conversationListRef.current.getListItem(id);
|
|
519
|
+
const { conversationWith, conversationType } = conversation;
|
|
520
|
+
let conversationWithId = conversationType == "group" ? conversationWith.guid : conversationWith.uid;
|
|
521
|
+
CometChat.deleteConversation(conversationWithId, conversationType)
|
|
522
|
+
.then(success => {
|
|
523
|
+
conversationListRef.current.removeItemFromList(id);
|
|
524
|
+
removeItemFromSelectionList(id);
|
|
525
|
+
})
|
|
526
|
+
.catch(err => console.log(err))
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
const getMessagePreview = (conversations: CometChat.Conversation, uid) => {
|
|
530
|
+
|
|
531
|
+
let lastMessage: CometChat.BaseMessage = conversations['lastMessage'];
|
|
532
|
+
if (!lastMessage) return null;
|
|
533
|
+
let messageText: string = ChatConfigurator.getDataSource().getLastConversationMessage(conversations);
|
|
534
|
+
|
|
535
|
+
let groupText = "";
|
|
536
|
+
if (lastMessage['receiverType'] == 'group') {
|
|
537
|
+
if (lastMessage['receiverId'] == uid) {
|
|
538
|
+
groupText = "you: "
|
|
539
|
+
} else {
|
|
540
|
+
groupText = lastMessage['sender']['name'] + ": "
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
return (
|
|
545
|
+
<Text numberOfLines={1} ellipsizeMode={"tail"} style={[Style.subtitleTextStyle, { color: theme.palette.getAccent600() }]}>
|
|
546
|
+
{groupText + messageText}
|
|
547
|
+
</Text>
|
|
548
|
+
)
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
const LastMessageView = (params: {
|
|
552
|
+
conversations: CometChat.Conversation,
|
|
553
|
+
typingText: string
|
|
554
|
+
}) => {
|
|
555
|
+
|
|
556
|
+
const lastMessage = params['conversations']['lastMessage'];
|
|
557
|
+
if (!lastMessage) return null;
|
|
558
|
+
let readReceipt;
|
|
559
|
+
if (!disableTyping && params.typingText) {
|
|
560
|
+
return <View style={Style.row}>
|
|
561
|
+
<Text>{params.typingText}</Text>
|
|
562
|
+
</View>
|
|
563
|
+
}
|
|
564
|
+
if (lastMessage && !disableReadReceipt && lastMessage['sender']['uid'] == loggedInUser.current?.uid) {
|
|
565
|
+
let status: MessageReceipt = "ERROR";
|
|
566
|
+
if (lastMessage?.hasOwnProperty('readAt'))
|
|
567
|
+
status = "READ";
|
|
568
|
+
else if (lastMessage?.hasOwnProperty("deliveredAt"))
|
|
569
|
+
status = "DELIVERED";
|
|
570
|
+
else if (lastMessage?.hasOwnProperty("sentAt"))
|
|
571
|
+
status = "SENT";
|
|
572
|
+
readReceipt = disableReceipt ? null : <CometChatReceipt
|
|
573
|
+
receipt={status}
|
|
574
|
+
deliveredIcon={props.deliveredIcon}
|
|
575
|
+
errorIcon={props.errorIcon}
|
|
576
|
+
readIcon={props.readIcon}
|
|
577
|
+
sentIcon={props.sentIcon}
|
|
578
|
+
waitIcon={props.waitingIcon}
|
|
579
|
+
/>;
|
|
580
|
+
}
|
|
581
|
+
return (
|
|
582
|
+
<View style={Style.row}>
|
|
583
|
+
{readReceipt}
|
|
584
|
+
{getMessagePreview(params['conversations'], loggedInUser.current?.uid)}
|
|
585
|
+
</View>
|
|
586
|
+
)
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
const TailView = (params: {
|
|
590
|
+
timestamp: number,
|
|
591
|
+
unreadCount: number,
|
|
592
|
+
customPattern: Function,
|
|
593
|
+
}) => {
|
|
594
|
+
return <View style={{ alignItems: "flex-end" }}>
|
|
595
|
+
<CometChatDate
|
|
596
|
+
timeStamp={(params.timestamp) * 1000}
|
|
597
|
+
style={_dateStyle}
|
|
598
|
+
customDateString={params.customPattern && params.customPattern()}
|
|
599
|
+
pattern={"dayDateTimeFormat"}
|
|
600
|
+
/>
|
|
601
|
+
<CometChatBadge
|
|
602
|
+
count={params.unreadCount}
|
|
603
|
+
style={_badgeStyle}
|
|
604
|
+
/>
|
|
605
|
+
</View>
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
const ConfirmDeletionDialog = () => {
|
|
609
|
+
|
|
610
|
+
if (confirmDelete == undefined) return null;
|
|
611
|
+
|
|
612
|
+
return <CometChatConfirmDialog
|
|
613
|
+
title={localize("CONFIRM")}
|
|
614
|
+
cancelButtonText={localize("CANCEL")}
|
|
615
|
+
confirmButtonText={localize("DELETE")}
|
|
616
|
+
messageText={localize("DELETE_CONFIRM_MESSAGE")}
|
|
617
|
+
isOpen={true}
|
|
618
|
+
onCancel={() => setConfirmDelete(undefined)}
|
|
619
|
+
onConfirm={() => {
|
|
620
|
+
{
|
|
621
|
+
removeConversation(confirmDelete);
|
|
622
|
+
setConfirmDelete(undefined);
|
|
623
|
+
}
|
|
624
|
+
}}
|
|
625
|
+
style={_confirmDialogStyle}
|
|
626
|
+
/>
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
const getDefaultOptions = (conversation) => {
|
|
630
|
+
let _defaultOptions = CometChatConversationUtils.getDefaultOptions();
|
|
631
|
+
_defaultOptions[0].backgroundColor = theme?.palette.getError();
|
|
632
|
+
_defaultOptions[0].icon = deleteIcon;
|
|
633
|
+
_defaultOptions[0].title = localize("DELETE");
|
|
634
|
+
_defaultOptions[0].titleStyle = { fontSize: 14, color: theme?.palette.getSecondary() };
|
|
635
|
+
_defaultOptions[0].iconTint = theme?.palette.getSecondary();
|
|
636
|
+
_defaultOptions[0].onPress = (id) => {
|
|
637
|
+
setConfirmDelete(id);
|
|
638
|
+
};
|
|
639
|
+
return _defaultOptions
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
React.useEffect(() => {
|
|
643
|
+
CometChat.getLoggedinUser()
|
|
644
|
+
.then(u => { loggedInUser.current = u })
|
|
645
|
+
.catch(err => console.log(err));
|
|
646
|
+
|
|
647
|
+
CometChat.addUserListener(
|
|
648
|
+
userListenerId,
|
|
649
|
+
new CometChat.UserListener({
|
|
650
|
+
onUserOnline: (onlineUser: any) => {
|
|
651
|
+
console.log(onlineUser);
|
|
652
|
+
userEventHandler(onlineUser);
|
|
653
|
+
},
|
|
654
|
+
onUserOffline: (offlineUser: any) => {
|
|
655
|
+
console.log(offlineUser);
|
|
656
|
+
userEventHandler(offlineUser);
|
|
657
|
+
},
|
|
658
|
+
})
|
|
659
|
+
);
|
|
660
|
+
|
|
661
|
+
CometChat.addCallListener(
|
|
662
|
+
callListenerId,
|
|
663
|
+
new CometChat.CallListener({
|
|
664
|
+
onIncomingCallReceived: (call) => {
|
|
665
|
+
CometChat.CometChatHelper.getConversationFromMessage(call)
|
|
666
|
+
.then((conversation) => {
|
|
667
|
+
conversationListRef.current.updateList(conversation);
|
|
668
|
+
})
|
|
669
|
+
.catch((e) => {
|
|
670
|
+
onError && onError(e);
|
|
671
|
+
})
|
|
672
|
+
},
|
|
673
|
+
onOutgoingCallAccepted: (call) => {
|
|
674
|
+
CometChat.CometChatHelper.getConversationFromMessage(call)
|
|
675
|
+
.then((conversation) => {
|
|
676
|
+
conversationListRef.current.updateList(conversation);
|
|
677
|
+
})
|
|
678
|
+
.catch((e) => {
|
|
679
|
+
onError && onError(e);
|
|
680
|
+
})
|
|
681
|
+
},
|
|
682
|
+
onOutgoingCallRejected: (call) => {
|
|
683
|
+
CometChat.CometChatHelper.getConversationFromMessage(call)
|
|
684
|
+
.then((conversation) => {
|
|
685
|
+
conversationListRef.current.updateList(conversation);
|
|
686
|
+
})
|
|
687
|
+
.catch((e) => {
|
|
688
|
+
onError && onError(e);
|
|
689
|
+
})
|
|
690
|
+
},
|
|
691
|
+
onIncomingCallCancelled: (call) => {
|
|
692
|
+
CometChat.CometChatHelper.getConversationFromMessage(call)
|
|
693
|
+
.then((conversation) => {
|
|
694
|
+
conversationListRef.current.updateList(conversation);
|
|
695
|
+
})
|
|
696
|
+
.catch((e) => {
|
|
697
|
+
onError && onError(e);
|
|
698
|
+
})
|
|
699
|
+
}
|
|
700
|
+
})
|
|
701
|
+
);
|
|
702
|
+
|
|
703
|
+
CometChat.addGroupListener(
|
|
704
|
+
groupListenerId,
|
|
705
|
+
new CometChat.GroupListener({
|
|
706
|
+
onGroupMemberScopeChanged: (message) => {
|
|
707
|
+
groupHandler(
|
|
708
|
+
message
|
|
709
|
+
);
|
|
710
|
+
},
|
|
711
|
+
onGroupMemberKicked: (message) => {
|
|
712
|
+
groupHandler(
|
|
713
|
+
message
|
|
714
|
+
);
|
|
715
|
+
},
|
|
716
|
+
onGroupMemberLeft: (message) => {
|
|
717
|
+
groupHandler(message);
|
|
718
|
+
},
|
|
719
|
+
onGroupMemberUnbanned: (message) => {
|
|
720
|
+
groupHandler(message);
|
|
721
|
+
},
|
|
722
|
+
onGroupMemberBanned: (message) => {
|
|
723
|
+
groupHandler(
|
|
724
|
+
message
|
|
725
|
+
);
|
|
726
|
+
},
|
|
727
|
+
onMemberAddedToGroup: (message) => {
|
|
728
|
+
groupHandler(
|
|
729
|
+
message
|
|
730
|
+
);
|
|
731
|
+
},
|
|
732
|
+
onGroupMemberJoined: (message) => {
|
|
733
|
+
groupHandler(
|
|
734
|
+
message
|
|
735
|
+
);
|
|
736
|
+
}
|
|
737
|
+
})
|
|
738
|
+
);
|
|
739
|
+
|
|
740
|
+
CometChat.addMessageListener(
|
|
741
|
+
conversationListenerId,
|
|
742
|
+
new CometChat.MessageListener({
|
|
743
|
+
onTextMessageReceived: (textMessage) => {
|
|
744
|
+
messageEventHandler(textMessage);
|
|
745
|
+
CometChatSoundManager.play("incomingMessage");
|
|
746
|
+
},
|
|
747
|
+
onMediaMessageReceived: (mediaMessage) => {
|
|
748
|
+
messageEventHandler(mediaMessage);
|
|
749
|
+
CometChatSoundManager.play("incomingMessage");
|
|
750
|
+
},
|
|
751
|
+
onCustomMessageReceived: (customMessage) => {
|
|
752
|
+
messageEventHandler(customMessage);
|
|
753
|
+
CometChatSoundManager.play("incomingMessage");
|
|
754
|
+
},
|
|
755
|
+
onMessageDeleted: (deletedMessage) => {
|
|
756
|
+
messageEventHandler(deletedMessage);
|
|
757
|
+
},
|
|
758
|
+
onMessageEdited: (editedMessage) => {
|
|
759
|
+
messageEventHandler(editedMessage);
|
|
760
|
+
},
|
|
761
|
+
onMessagesRead: (messageReceipt) => {
|
|
762
|
+
messageEventHandler(messageReceipt);
|
|
763
|
+
},
|
|
764
|
+
onMessagesDelivered: (messageReveipt) => {
|
|
765
|
+
messageEventHandler(messageReveipt);
|
|
766
|
+
},
|
|
767
|
+
onTypingStarted: (typingIndicator) => {
|
|
768
|
+
typingEventHandler(typingIndicator, true);
|
|
769
|
+
},
|
|
770
|
+
onTypingEnded: (typingIndicator) => {
|
|
771
|
+
typingEventHandler(typingIndicator, false);
|
|
772
|
+
},
|
|
773
|
+
})
|
|
774
|
+
);
|
|
775
|
+
|
|
776
|
+
CometChatUIEventHandler.addConversationListener(
|
|
777
|
+
conversationListenerId,
|
|
778
|
+
{
|
|
779
|
+
ccConversationDeleted:
|
|
780
|
+
({ conversation }: { conversation: CometChat.Conversation }) => {
|
|
781
|
+
CometChat.deleteConversation(conversation.getConversationId(), conversation.getConversationType())
|
|
782
|
+
.then(res => {
|
|
783
|
+
conversationListRef.current.removeItemFromList(conversation);
|
|
784
|
+
removeItemFromSelectionList(conversation.getConversationId())
|
|
785
|
+
})
|
|
786
|
+
.catch(err => {
|
|
787
|
+
console.log("Error", err);
|
|
788
|
+
});
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
);
|
|
792
|
+
CometChatUIEventHandler.addMessageListener(
|
|
793
|
+
messageListenerId,
|
|
794
|
+
{
|
|
795
|
+
ccMessageSent: ({ message, status }) => {
|
|
796
|
+
if (status == MessageStatusConstants.success) {
|
|
797
|
+
updateLastMessage(message);
|
|
798
|
+
}
|
|
799
|
+
},
|
|
800
|
+
ccMessageRead: ({ message }) => {
|
|
801
|
+
CometChat.CometChatHelper.getConversationFromMessage(message)
|
|
802
|
+
.then(conversation => {
|
|
803
|
+
let conver = conversationListRef.current.getListItem(conversation.getConversationId())
|
|
804
|
+
if (!conver) return;
|
|
805
|
+
let lastMessageId = conver['lastMessage']['id'];
|
|
806
|
+
if (lastMessageId == message['id']) {
|
|
807
|
+
conversationListRef.current.updateList(conversation)
|
|
808
|
+
}
|
|
809
|
+
})
|
|
810
|
+
},
|
|
811
|
+
ccMessageDeleted: ({ message }) => {
|
|
812
|
+
CometChat.CometChatHelper.getConversationFromMessage(message)
|
|
813
|
+
.then(conversation => {
|
|
814
|
+
let conver = conversationListRef.current.getListItem(conversation.getConversationId())
|
|
815
|
+
if (!conver) return;
|
|
816
|
+
let lastMessageId = conver['lastMessage']['id'];
|
|
817
|
+
if (lastMessageId == message['id']) {
|
|
818
|
+
conversationListRef.current.updateList(conversation)
|
|
819
|
+
}
|
|
820
|
+
})
|
|
821
|
+
},
|
|
822
|
+
ccMessageEdited: ({ message }) => {
|
|
823
|
+
CometChat.CometChatHelper.getConversationFromMessage(message)
|
|
824
|
+
.then(conversation => {
|
|
825
|
+
let conver = conversationListRef.current.getListItem(conversation.getConversationId())
|
|
826
|
+
if (!conver) return;
|
|
827
|
+
let lastMessageId = conver['lastMessage']['id']
|
|
828
|
+
if (lastMessageId == message['id']) {
|
|
829
|
+
conversationListRef.current.updateList(conversation)
|
|
830
|
+
}
|
|
831
|
+
})
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
);
|
|
835
|
+
CometChatUIEventHandler.addGroupListener(
|
|
836
|
+
groupListenerId,
|
|
837
|
+
{
|
|
838
|
+
ccGroupDeleted: ({ group }) => {
|
|
839
|
+
conversationListRef.current?.removeItemFromList(group['conversationId']);
|
|
840
|
+
removeItemFromSelectionList(group['conversationId'])
|
|
841
|
+
},
|
|
842
|
+
ccGroupLeft: ({ leftGroup }) => {
|
|
843
|
+
conversationListRef.current?.removeItemFromList(leftGroup['conversationId']);
|
|
844
|
+
removeItemFromSelectionList(leftGroup['conversationId'])
|
|
845
|
+
},
|
|
846
|
+
ccGroupMemberKicked: ({ message, kickedFrom }: { message: CometChat.BaseMessage, kickedFrom: CometChat.Group }) => {
|
|
847
|
+
CometChat.CometChatHelper.getConversationFromMessage(message)
|
|
848
|
+
.then(conversation => {
|
|
849
|
+
conversationListRef.current?.updateList(conversation);
|
|
850
|
+
})
|
|
851
|
+
.catch(e => {
|
|
852
|
+
onError && onError(e);
|
|
853
|
+
})
|
|
854
|
+
|
|
855
|
+
},
|
|
856
|
+
ccGroupMemberBanned: ({message}) => {
|
|
857
|
+
groupHandler(message);
|
|
858
|
+
},
|
|
859
|
+
ccGroupMemberUnBanned: ({message}) => {
|
|
860
|
+
groupHandler(message)
|
|
861
|
+
},
|
|
862
|
+
ccOwnershipChanged: ({ message }) => {
|
|
863
|
+
CometChat.CometChatHelper.getConversationFromMessage(message)
|
|
864
|
+
.then(conversation => {
|
|
865
|
+
conversationListRef.current?.updateList(conversation);
|
|
866
|
+
})
|
|
867
|
+
.catch(e => {
|
|
868
|
+
onError && onError(e);
|
|
869
|
+
})
|
|
870
|
+
},
|
|
871
|
+
ccGroupMemberAdded: ({ message }: { message: CometChat.BaseMessage }) => {
|
|
872
|
+
CometChat.CometChatHelper.getConversationFromMessage(message)
|
|
873
|
+
.then(conversation => {
|
|
874
|
+
conversationListRef.current?.updateList(conversation);
|
|
875
|
+
})
|
|
876
|
+
.catch(e => onError && onError(e))
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
)
|
|
880
|
+
|
|
881
|
+
CometChatUIEventHandler.addUserListener(
|
|
882
|
+
userListenerId,
|
|
883
|
+
{
|
|
884
|
+
ccUserBlocked: ({ user }) => {
|
|
885
|
+
let conversation = conversationListRef.current?.getListItem(user['conversationId']);
|
|
886
|
+
conversationListRef.current?.updateList(conversation);
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
)
|
|
890
|
+
|
|
891
|
+
CometChatUIEventHandler.addCallListener(
|
|
892
|
+
callListenerId,
|
|
893
|
+
{
|
|
894
|
+
ccOutgoingCall: ({ call }) => {
|
|
895
|
+
CometChat.CometChatHelper.getConversationFromMessage(call)
|
|
896
|
+
.then((conversation) => {
|
|
897
|
+
conversationListRef.current.updateList(conversation);
|
|
898
|
+
})
|
|
899
|
+
.catch((e) => {
|
|
900
|
+
onError && onError(e);
|
|
901
|
+
})
|
|
902
|
+
},
|
|
903
|
+
ccCallAccepted: ({ call }) => {
|
|
904
|
+
CometChat.CometChatHelper.getConversationFromMessage(call)
|
|
905
|
+
.then((conversation) => {
|
|
906
|
+
conversationListRef.current.updateList(conversation);
|
|
907
|
+
})
|
|
908
|
+
.catch((e) => {
|
|
909
|
+
onError && onError(e);
|
|
910
|
+
})
|
|
911
|
+
},
|
|
912
|
+
ccCallRejected: ({ call }) => {
|
|
913
|
+
CometChat.CometChatHelper.getConversationFromMessage(call)
|
|
914
|
+
.then((conversation) => {
|
|
915
|
+
conversationListRef.current.updateList(conversation);
|
|
916
|
+
})
|
|
917
|
+
.catch((e) => {
|
|
918
|
+
onError && onError(e);
|
|
919
|
+
})
|
|
920
|
+
},
|
|
921
|
+
ccCallEnded: ({ call }) => {
|
|
922
|
+
CometChat.CometChatHelper.getConversationFromMessage(call)
|
|
923
|
+
.then((conversation) => {
|
|
924
|
+
conversationListRef.current.updateList(conversation);
|
|
925
|
+
})
|
|
926
|
+
.catch((e) => {
|
|
927
|
+
onError && onError(e);
|
|
928
|
+
})
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
)
|
|
932
|
+
|
|
933
|
+
return () => {
|
|
934
|
+
CometChat.removeMessageListener(conversationListenerId);
|
|
935
|
+
CometChat.removeUserListener(userListenerId);
|
|
936
|
+
CometChat.removeCallListener(callListenerId);
|
|
937
|
+
CometChat.removeGroupListener(groupListenerId);
|
|
938
|
+
CometChatUIEventHandler.removeMessageListener(messageListenerId);
|
|
939
|
+
CometChatUIEventHandler.removeConversationListener(conversationListenerId);
|
|
940
|
+
CometChatUIEventHandler.removeGroupListener(groupListenerId);
|
|
941
|
+
CometChatUIEventHandler.removeUserListener(userListenerId);
|
|
942
|
+
}
|
|
943
|
+
}, []);
|
|
944
|
+
|
|
945
|
+
const ConversationItemView = ({ item: conversation }) => {
|
|
946
|
+
if (!conversation) return null;
|
|
947
|
+
//custom view check
|
|
948
|
+
if (ListItemView)
|
|
949
|
+
return ListItemView(conversation);
|
|
950
|
+
const { conversationWith, conversationType } = conversation;
|
|
951
|
+
const lastMessage = CometChatConversationUtils.getLastMessage(conversation);
|
|
952
|
+
const { name, type, conversationId } = conversationWith || {};
|
|
953
|
+
let image: ImageType, backgroundColor: string, avatarIcon = conversationWith[conversationType == "group" ? 'icon' : "avatar"];
|
|
954
|
+
if (type == GroupTypeConstants.password) {
|
|
955
|
+
image = props?.protectedGroupIcon || passwordGroupIcon;
|
|
956
|
+
backgroundColor = PASSWORD_GROUP_COLOR;
|
|
957
|
+
}
|
|
958
|
+
if (type == GroupTypeConstants.private) {
|
|
959
|
+
image = props?.privateGroupIcon || privateGroupIcon;
|
|
960
|
+
backgroundColor = PRIVATE_GROUP_COLOR;
|
|
961
|
+
}
|
|
962
|
+
if (conversationWith.status == "online") {
|
|
963
|
+
backgroundColor = theme.palette.getSuccess();
|
|
964
|
+
}
|
|
965
|
+
if (selecting) {
|
|
966
|
+
let index: number = selectedConversation.findIndex((value) => value.conversationWith.conversationId == conversationId);
|
|
967
|
+
if (index >= 0) {
|
|
968
|
+
image = rightTickIcon;
|
|
969
|
+
backgroundColor = theme?.palette.getPrimary();
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
return <CometChatListItem
|
|
974
|
+
id={conversation.conversationId}
|
|
975
|
+
avatarName={name}
|
|
976
|
+
avatarURL={avatarIcon}
|
|
977
|
+
hideSeparator={hideSeparator}
|
|
978
|
+
SubtitleView={(SubtitleView && SubtitleView.bind(this, conversation)) || (() => <LastMessageView conversations={conversation} typingText={conversation?.['lastMessage']?.['typing']} />)
|
|
979
|
+
}
|
|
980
|
+
title={name}
|
|
981
|
+
statusIndicatorIcon={image}
|
|
982
|
+
statusIndicatorColor={disableUsersPresence ? "transparent" : backgroundColor}
|
|
983
|
+
listItemStyle={_listItemStyle}
|
|
984
|
+
TailView={() => <TailView
|
|
985
|
+
customPattern={() => datePattern && props.datePattern(conversation)}
|
|
986
|
+
timestamp={lastMessage && lastMessage['updatedAt'] || conversationWith['createdAt'] || conversationWith['lastActiveAt']}
|
|
987
|
+
unreadCount={conversation.unreadMessageCount}
|
|
988
|
+
/>}
|
|
989
|
+
avatarStyle={_avatarStyle}
|
|
990
|
+
statusIndicatorStyle={_statusIndicatorStyle}
|
|
991
|
+
onPress={conversationClicked.bind(this, conversation)}
|
|
992
|
+
onLongPress={conversationLongPressed.bind(this, conversation)}
|
|
993
|
+
options={() => options ? options(conversation) : getDefaultOptions(conversation)}
|
|
994
|
+
/>
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
/**
|
|
998
|
+
* Component template
|
|
999
|
+
*/
|
|
1000
|
+
return (
|
|
1001
|
+
<View style={Style.container}>
|
|
1002
|
+
<ConfirmDeletionDialog />
|
|
1003
|
+
<CometChatList
|
|
1004
|
+
AppBarOptions={AppBarOption}
|
|
1005
|
+
onError={onError}
|
|
1006
|
+
ref={conversationListRef}
|
|
1007
|
+
requestBuilder={conversationsRequestBuilder || new CometChat.ConversationsRequestBuilder().setLimit(30)}
|
|
1008
|
+
title={title}
|
|
1009
|
+
hideSearch={true}
|
|
1010
|
+
hideSubmitIcon={hideSubmitIcon}
|
|
1011
|
+
listItemKey={"conversationId"}
|
|
1012
|
+
LoadingStateView={LoadingStateView}
|
|
1013
|
+
ListItemView={ConversationItemView}
|
|
1014
|
+
EmptyStateView={EmptyStateView ? EmptyStateView : () => <EmptyView />}
|
|
1015
|
+
ErrorStateView={ErrorStateView ? ErrorStateView : () => <ErrorView />}
|
|
1016
|
+
onBack={onBack}
|
|
1017
|
+
backButtonIcon={backButtonIcon}
|
|
1018
|
+
showBackButton={showBackButton}
|
|
1019
|
+
onSelection={(items) => {
|
|
1020
|
+
onSelection && onSelection(items);
|
|
1021
|
+
setSelecting(false);
|
|
1022
|
+
setSelectedConversations([]);
|
|
1023
|
+
}}
|
|
1024
|
+
SubtitleView={props.SubtitleView}
|
|
1025
|
+
disableUsersPresence={disableUsersPresence}
|
|
1026
|
+
options={options}
|
|
1027
|
+
hideSeparator={hideSeparator}
|
|
1028
|
+
listStyle={{ ..._style, background: _style.backgroundColor }}
|
|
1029
|
+
selectionMode={selecting ? selectionMode : "none"}
|
|
1030
|
+
hideError={hideError}
|
|
1031
|
+
/>
|
|
1032
|
+
</View>
|
|
1033
|
+
);
|
|
1034
|
+
}
|