@cometchat/chat-uikit-react-native 4.0.0-beta.1.1 → 4.0.1
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/LICENSE.md +3 -0
- package/README.md +10 -4
- 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/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/AI/AIConversationStarter/AIConversationStarter.d.ts +12 -0
- package/lib/AI/AIConversationStarter/AIConversationStarter.js +31 -0
- package/lib/AI/AIConversationStarter/AIConversationStarter.js.map +1 -0
- package/lib/AI/AIConversationStarter/AIConversationStarterDecorator.d.ts +25 -0
- package/lib/AI/AIConversationStarter/AIConversationStarterDecorator.js +175 -0
- package/lib/AI/AIConversationStarter/AIConversationStarterDecorator.js.map +1 -0
- package/lib/AI/AIConversationStarter/AIConversationStarterStyle.d.ts +4 -0
- package/lib/AI/AIConversationStarter/AIConversationStarterStyle.js +8 -0
- package/lib/AI/AIConversationStarter/AIConversationStarterStyle.js.map +1 -0
- package/lib/AI/AIConversationStarter/configuration.d.ts +14 -0
- package/lib/AI/AIConversationStarter/configuration.js +16 -0
- package/lib/AI/AIConversationStarter/configuration.js.map +1 -0
- package/lib/AI/AIConversationStarter/style.d.ts +31 -0
- package/lib/AI/AIConversationStarter/style.js +62 -0
- package/lib/AI/AIConversationStarter/style.js.map +1 -0
- package/lib/AI/AIEnabler.d.ts +10 -0
- package/lib/AI/AIEnabler.js +102 -0
- package/lib/AI/AIEnabler.js.map +1 -0
- package/lib/AI/AIEnablerDecorator.d.ts +43 -0
- package/lib/AI/AIEnablerDecorator.js +251 -0
- package/lib/AI/AIEnablerDecorator.js.map +1 -0
- package/lib/AI/AIExtensionDataSource.d.ts +6 -0
- package/lib/AI/AIExtensionDataSource.js +10 -0
- package/lib/AI/AIExtensionDataSource.js.map +1 -0
- package/lib/AI/AISmartReplies/AISmartReplies.d.ts +10 -0
- package/lib/AI/AISmartReplies/AISmartReplies.js +23 -0
- package/lib/AI/AISmartReplies/AISmartReplies.js.map +1 -0
- package/lib/AI/AISmartReplies/AISmartRepliesDecorator.d.ts +7 -0
- package/lib/AI/AISmartReplies/AISmartRepliesDecorator.js +12 -0
- package/lib/AI/AISmartReplies/AISmartRepliesDecorator.js.map +1 -0
- package/lib/AI/AISmartReplies/AISmartRepliesStyle.d.ts +12 -0
- package/lib/AI/AISmartReplies/AISmartRepliesStyle.js +15 -0
- package/lib/AI/AISmartReplies/AISmartRepliesStyle.js.map +1 -0
- package/lib/AI/AISmartReplies/configuration.d.ts +14 -0
- package/lib/AI/AISmartReplies/configuration.js +16 -0
- package/lib/AI/AISmartReplies/configuration.js.map +1 -0
- package/lib/AI/CardView.d.ts +19 -0
- package/lib/AI/CardView.js +45 -0
- package/lib/AI/CardView.js.map +1 -0
- package/lib/AI/CardViewStyle.d.ts +29 -0
- package/lib/AI/CardViewStyle.js +36 -0
- package/lib/AI/CardViewStyle.js.map +1 -0
- package/lib/AI/configuration.d.ts +14 -0
- package/lib/AI/configuration.js +16 -0
- package/lib/AI/configuration.js.map +1 -0
- package/lib/AI/resources/index.d.ts +5 -0
- package/lib/AI/resources/index.js +6 -0
- package/lib/AI/resources/index.js.map +1 -0
- package/lib/AI/style.d.ts +115 -0
- package/lib/AI/style.js +139 -0
- package/lib/AI/style.js.map +1 -0
- package/lib/AI/utils.d.ts +38 -0
- package/lib/AI/utils.js +28 -0
- package/lib/AI/utils.js.map +1 -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 -2
- 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 -2
- 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 -2
- 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 -2
- 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 +46 -6
- 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 -2
- 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 +303 -29
- package/lib/CometChatMessageList/CometChatMessageList.js.map +1 -1
- package/lib/CometChatMessageList/MessageListConfiguration.d.ts +1 -2
- 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 -2
- 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/CometChatTabs/TabItems.d.ts +0 -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 -2
- 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 -2
- package/lib/calls/CometChatCallDetails/CometChatCallDetails.js +1 -1
- package/lib/calls/CometChatCallHistory/CallHistoryConfiguration.d.ts +1 -2
- 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 +4 -4
- package/lib/calls/CometChatIncomingCall/CometChatIncomingCall.js.map +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 -2
- 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/ImageModeration/ImageModerationFilter.js +4 -4
- package/lib/extensions/ImageModeration/ImageModerationFilter.js.map +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 -2
- package/lib/extensions/MessageTranslation/MessageTranslationDecorator.d.ts +1 -2
- 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 +2 -2
- package/lib/extensions/SmartReplies/SmartRepliesDecorator.js.map +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 +2 -2
- package/lib/extensions/Stickers/StickersExtensionDecorator.js +5 -3
- package/lib/extensions/Stickers/StickersExtensionDecorator.js.map +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 -2
- 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 +17 -2
- package/lib/index.js +20 -4
- package/lib/index.js.map +1 -1
- package/lib/shared/CometChatUiKit/CometChatUIKit.d.ts +10 -1
- package/lib/shared/CometChatUiKit/CometChatUIKit.js +63 -16
- 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 +6 -2
- package/lib/shared/CometChatUiKit/UIKitSettings.js +5 -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 +8 -0
- package/lib/shared/events/CometChatUIEventHandler/CometChatUIEventHandler.js.map +1 -1
- package/lib/shared/events/CometChatUIEventHandler/Listener.d.ts +6 -2
- package/lib/shared/events/CometChatUIEventHandler/Listener.js +12 -2
- package/lib/shared/events/CometChatUIEventHandler/Listener.js.map +1 -1
- package/lib/shared/events/CometChatUIEvents.d.ts +3 -1
- package/lib/shared/events/CometChatUIEvents.js +2 -0
- package/lib/shared/events/CometChatUIEvents.js.map +1 -1
- package/lib/shared/framework/DataSource.d.ts +2 -3
- package/lib/shared/framework/DataSourceDecorator.d.ts +2 -3
- package/lib/shared/framework/DataSourceDecorator.js +2 -2
- package/lib/shared/framework/DataSourceDecorator.js.map +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 +3 -3
- package/lib/shared/framework/MessageDataSource.js +41 -19
- 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 -5
- 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/CometChatDetailsOption.d.ts +0 -1
- package/lib/shared/modals/CometChatMessageOption.d.ts +1 -2
- package/lib/shared/modals/CometChatMessageTemplate.d.ts +1 -2
- package/lib/shared/modals/CometChatMessageTemplate.js +1 -1
- package/lib/shared/resources/CometChatLocalize/CometChatLocalize.d.ts +308 -153
- package/lib/shared/resources/CometChatLocalize/resources/ar/translation.json +11 -1
- package/lib/shared/resources/CometChatLocalize/resources/de/translation.json +11 -1
- package/lib/shared/resources/CometChatLocalize/resources/en/translation.json +13 -3
- package/lib/shared/resources/CometChatLocalize/resources/es/translation.json +11 -1
- package/lib/shared/resources/CometChatLocalize/resources/fr/translation.json +11 -1
- package/lib/shared/resources/CometChatLocalize/resources/hi/translation.json +11 -1
- package/lib/shared/resources/CometChatLocalize/resources/lt/translation.json +11 -1
- package/lib/shared/resources/CometChatLocalize/resources/ms/translation.json +11 -1
- package/lib/shared/resources/CometChatLocalize/resources/pt/translation.json +11 -1
- package/lib/shared/resources/CometChatLocalize/resources/ru/translation.json +11 -1
- package/lib/shared/resources/CometChatLocalize/resources/sv/translation.json +11 -1
- package/lib/shared/resources/CometChatLocalize/resources/zh/translation.json +11 -1
- package/lib/shared/resources/CometChatLocalize/resources/zh-tw/translation.json +11 -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 +8 -7
- package/src/AI/AIConversationStarter/AIConversationStarter.ts +33 -0
- package/src/AI/AIConversationStarter/AIConversationStarterDecorator.tsx +232 -0
- package/src/AI/AIConversationStarter/AIConversationStarterStyle.ts +8 -0
- package/src/AI/AIConversationStarter/configuration.ts +18 -0
- package/src/AI/AIConversationStarter/style.ts +76 -0
- package/src/AI/AIEnabler.ts +115 -0
- package/src/AI/AIEnablerDecorator.tsx +324 -0
- package/src/AI/AIExtensionDataSource.ts +12 -0
- package/src/AI/AISmartReplies/AISmartReplies.ts +28 -0
- package/src/AI/AISmartReplies/AISmartRepliesDecorator.ts +18 -0
- package/src/AI/AISmartReplies/AISmartRepliesStyle.ts +16 -0
- package/src/AI/AISmartReplies/configuration.ts +17 -0
- package/src/AI/CardView.tsx +81 -0
- package/src/AI/CardViewStyle.ts +37 -0
- package/src/AI/configuration.ts +17 -0
- package/src/AI/resources/ai-empty.png +0 -0
- package/src/AI/resources/ai-error.png +0 -0
- package/src/AI/resources/ai.png +0 -0
- package/src/AI/resources/index.ts +11 -0
- package/src/AI/style.ts +177 -0
- package/src/AI/utils.ts +39 -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/resources/spineer.png +0 -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 +1271 -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/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 +1415 -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/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 +144 -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 +576 -0
- package/src/shared/CometChatContext.tsx +39 -0
- package/src/shared/CometChatUiKit/CometChatUIKit.ts +233 -0
- package/src/shared/CometChatUiKit/CometChatUIKitHelper.ts +121 -0
- package/src/shared/CometChatUiKit/UIKitSettings.ts +47 -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 +334 -0
- package/src/shared/events/CometChatUIEventHandler/Listener.ts +354 -0
- package/src/shared/events/CometChatUIEvents.ts +19 -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/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 +274 -0
- package/src/shared/resources/CometChatLocalize/resources/de/translation.json +274 -0
- package/src/shared/resources/CometChatLocalize/resources/en/translation.json +274 -0
- package/src/shared/resources/CometChatLocalize/resources/es/translation.json +274 -0
- package/src/shared/resources/CometChatLocalize/resources/fr/translation.json +274 -0
- package/src/shared/resources/CometChatLocalize/resources/hi/translation.json +274 -0
- package/src/shared/resources/CometChatLocalize/resources/lt/translation.json +274 -0
- package/src/shared/resources/CometChatLocalize/resources/ms/translation.json +274 -0
- package/src/shared/resources/CometChatLocalize/resources/pt/translation.json +274 -0
- package/src/shared/resources/CometChatLocalize/resources/ru/translation.json +274 -0
- package/src/shared/resources/CometChatLocalize/resources/sv/translation.json +274 -0
- package/src/shared/resources/CometChatLocalize/resources/zh/translation.json +274 -0
- package/src/shared/resources/CometChatLocalize/resources/zh-tw/translation.json +274 -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/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/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/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/LICENSE +0 -21
- /package/{lib/CometChatConversations → src/AI}/resources/spineer.png +0 -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/CometChatGroups → 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}/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,1271 @@
|
|
|
1
|
+
import React, { useContext, useEffect, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
View,
|
|
4
|
+
Image,
|
|
5
|
+
TouchableOpacity,
|
|
6
|
+
NativeModules,
|
|
7
|
+
Platform,
|
|
8
|
+
KeyboardAvoidingView,
|
|
9
|
+
Modal,
|
|
10
|
+
} from 'react-native';
|
|
11
|
+
import { Style } from './styles';
|
|
12
|
+
import {
|
|
13
|
+
localize,
|
|
14
|
+
CometChatLiveReactions,
|
|
15
|
+
CometChatBottomSheet,
|
|
16
|
+
CometChatMessagePreview,
|
|
17
|
+
MessagePreviewStyle,
|
|
18
|
+
CometChatActionSheet,
|
|
19
|
+
ActionSheetStyles,
|
|
20
|
+
CometChatContext,
|
|
21
|
+
} from '../shared';
|
|
22
|
+
|
|
23
|
+
import { CheckPropertyExists } from '../shared/helper/functions';
|
|
24
|
+
//@ts-ignore
|
|
25
|
+
import { CometChat } from '@cometchat/chat-sdk-react-native';
|
|
26
|
+
|
|
27
|
+
import {
|
|
28
|
+
getUnixTimestamp,
|
|
29
|
+
messageStatus,
|
|
30
|
+
} from '../shared/utils/CometChatMessageHelper';
|
|
31
|
+
import { CometChatSoundManager, ChatConfigurator } from '../shared';
|
|
32
|
+
import {
|
|
33
|
+
ConversationOptionConstants,
|
|
34
|
+
MessageTypeConstants,
|
|
35
|
+
MetadataConstants,
|
|
36
|
+
ReceiverTypeConstants,
|
|
37
|
+
ViewAlignment,
|
|
38
|
+
} from '../shared/constants/UIKitConstants';
|
|
39
|
+
import { ICONS } from './resources';
|
|
40
|
+
import { CometChatMessageInput } from '../shared';
|
|
41
|
+
import {
|
|
42
|
+
BaseStyle,
|
|
43
|
+
BorderStyleInterface,
|
|
44
|
+
FontStyleInterface,
|
|
45
|
+
} from '../shared/base';
|
|
46
|
+
import { ImageType } from '../shared';
|
|
47
|
+
import { MessageEvents } from '../shared/events';
|
|
48
|
+
import { CometChatContextType } from '../shared/base/Types';
|
|
49
|
+
import { CometChatUIEventHandler } from '../shared/events/CometChatUIEventHandler/CometChatUIEventHandler';
|
|
50
|
+
import { CometChatMessageComposerActionInterface } from '../shared/helper/types';
|
|
51
|
+
import { CometChatMediaRecorder, MediaRecorderStyle } from '../shared/views/CometChatMediaRecorder';
|
|
52
|
+
const { FileManager } = NativeModules;
|
|
53
|
+
|
|
54
|
+
const uiEventListenerShow = 'uiEvent_show_' + new Date().getTime();
|
|
55
|
+
const uiEventListenerHide = 'uiEvent_hide_' + new Date().getTime();
|
|
56
|
+
|
|
57
|
+
const MessagePreviewTray = (props: any) => {
|
|
58
|
+
const { shouldShow = false, text = '', onClose = () => { } } = props;
|
|
59
|
+
return shouldShow ? (
|
|
60
|
+
<CometChatMessagePreview
|
|
61
|
+
style={new MessagePreviewStyle({ width: '95%', backgroundColor: "white" })}
|
|
62
|
+
messagePreviewTitle={localize('EDIT_MESSAGE')}
|
|
63
|
+
messagePreviewSubtitle={text}
|
|
64
|
+
closeIconURL={ICONS.CLOSE}
|
|
65
|
+
onCloseClick={onClose}
|
|
66
|
+
/>
|
|
67
|
+
) : null;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const ImageButton = (props: any) => {
|
|
71
|
+
const { image, onClick, buttonStyle, imageStyle } = props;
|
|
72
|
+
return (
|
|
73
|
+
<TouchableOpacity onPress={onClick} style={buttonStyle}>
|
|
74
|
+
<Image source={image} style={[{ height: 24, width: 24 }, imageStyle]} />
|
|
75
|
+
</TouchableOpacity>
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const AttachIconButton = (props: any) => {
|
|
80
|
+
const { icon, show = false, onClick = () => { }, style, theme } = props;
|
|
81
|
+
if (show) {
|
|
82
|
+
return (
|
|
83
|
+
<ImageButton
|
|
84
|
+
image={icon}
|
|
85
|
+
imageStyle={[Style.imageStyle, style]}
|
|
86
|
+
onClick={onClick}
|
|
87
|
+
/>
|
|
88
|
+
);
|
|
89
|
+
} else {
|
|
90
|
+
return <View style={[Style.imageStyle, style]} />;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const EmojiBoard = (props: any) => {
|
|
95
|
+
const {
|
|
96
|
+
shouldShow = false,
|
|
97
|
+
onClose = () => { },
|
|
98
|
+
emojiSelection = (emoji?: any) => { },
|
|
99
|
+
...otherProps
|
|
100
|
+
} = props;
|
|
101
|
+
return shouldShow ? (
|
|
102
|
+
<CometChatBottomSheet onClose={onClose}>
|
|
103
|
+
{/* <CometChatEmojiKeyboard onClick={emojiSelection} {...otherProps} /> */}
|
|
104
|
+
</CometChatBottomSheet>
|
|
105
|
+
) : null;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
const ActionSheetBoard = (props: any) => {
|
|
109
|
+
const {
|
|
110
|
+
shouldShow = false,
|
|
111
|
+
onClose = () => { },
|
|
112
|
+
options = [],
|
|
113
|
+
cometChatBottomSheetStyle = {},
|
|
114
|
+
sheetRef,
|
|
115
|
+
...otherProps
|
|
116
|
+
} = props;
|
|
117
|
+
return shouldShow ? (
|
|
118
|
+
<CometChatBottomSheet
|
|
119
|
+
ref={sheetRef}
|
|
120
|
+
onClose={onClose}
|
|
121
|
+
style={cometChatBottomSheetStyle}
|
|
122
|
+
>
|
|
123
|
+
<CometChatActionSheet
|
|
124
|
+
actions={options}
|
|
125
|
+
{...otherProps}
|
|
126
|
+
onPress={props.onClick}
|
|
127
|
+
/>
|
|
128
|
+
</CometChatBottomSheet>
|
|
129
|
+
) : null;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const RecordAudio = (props: any) => {
|
|
133
|
+
const {
|
|
134
|
+
shouldShow = false,
|
|
135
|
+
onClose = () => { },
|
|
136
|
+
options = [],
|
|
137
|
+
cometChatBottomSheetStyle = {},
|
|
138
|
+
sheetRef,
|
|
139
|
+
onPause = () => { },
|
|
140
|
+
onPlay = () => { },
|
|
141
|
+
onSend = (recordedFile: String) => { },
|
|
142
|
+
onStop = (recordedFile: String) => { },
|
|
143
|
+
onStart = () => { },
|
|
144
|
+
mediaRecorderStyle,
|
|
145
|
+
pauseIconUrl,
|
|
146
|
+
playIconUrl,
|
|
147
|
+
recordIconUrl,
|
|
148
|
+
deleteIconUrl,
|
|
149
|
+
stopIconUrl,
|
|
150
|
+
submitIconUrl,
|
|
151
|
+
...otherProps
|
|
152
|
+
} = props;
|
|
153
|
+
return shouldShow ? (
|
|
154
|
+
<CometChatBottomSheet
|
|
155
|
+
ref={sheetRef}
|
|
156
|
+
onClose={onClose}
|
|
157
|
+
style={cometChatBottomSheetStyle}
|
|
158
|
+
>
|
|
159
|
+
<CometChatMediaRecorder
|
|
160
|
+
onClose={onClose}
|
|
161
|
+
onPause={onPause}
|
|
162
|
+
onPlay={onPlay}
|
|
163
|
+
onSend={onSend}
|
|
164
|
+
onStop={onStop}
|
|
165
|
+
onStart={onStart}
|
|
166
|
+
mediaRecorderStyle={mediaRecorderStyle}
|
|
167
|
+
pauseIconUrl={pauseIconUrl}
|
|
168
|
+
playIconUrl={playIconUrl}
|
|
169
|
+
recordIconUrl={recordIconUrl}
|
|
170
|
+
deleteIconUrl={deleteIconUrl}
|
|
171
|
+
stopIconUrl={stopIconUrl}
|
|
172
|
+
submitIconUrl={submitIconUrl}
|
|
173
|
+
/>
|
|
174
|
+
</CometChatBottomSheet>
|
|
175
|
+
) : null;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
const LiveReaction = (props: any) => {
|
|
179
|
+
const { show = false, reaction } = props;
|
|
180
|
+
if (show) {
|
|
181
|
+
return <CometChatLiveReactions reaction={reaction} />;
|
|
182
|
+
}
|
|
183
|
+
return null;
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
let recordedTime = 0, timerIntervalId = null;
|
|
187
|
+
|
|
188
|
+
export interface MessageComposerStyleInterface extends BaseStyle {
|
|
189
|
+
attachIcontint?: string;
|
|
190
|
+
sendIconTint?: string;
|
|
191
|
+
inputBackground?: string;
|
|
192
|
+
inputBorder?: BorderStyleInterface;
|
|
193
|
+
dividerTint?: string;
|
|
194
|
+
textFont?: FontStyleInterface;
|
|
195
|
+
textColor?: string;
|
|
196
|
+
placeholderTextColor?: string;
|
|
197
|
+
placeholderTextFont?: FontStyleInterface;
|
|
198
|
+
|
|
199
|
+
actionSheetSeparatorTint?: string;
|
|
200
|
+
actionSheetTitleColor?: string;
|
|
201
|
+
actionSheetTitleFont?: FontStyleInterface;
|
|
202
|
+
actionSheetLayoutModeIconTint?: string;
|
|
203
|
+
actionSheetCancelButtonIconTint?: string;
|
|
204
|
+
}
|
|
205
|
+
export interface CometChatMessageComposerInterface {
|
|
206
|
+
/**
|
|
207
|
+
*
|
|
208
|
+
*
|
|
209
|
+
* @type {(string | number)}
|
|
210
|
+
* @description Message composer identifier
|
|
211
|
+
*/
|
|
212
|
+
id?: string | number;
|
|
213
|
+
/**
|
|
214
|
+
*
|
|
215
|
+
*
|
|
216
|
+
* @type {CometChat.User}
|
|
217
|
+
* @description CometChat SDK’s user object
|
|
218
|
+
*/
|
|
219
|
+
user?: CometChat.User;
|
|
220
|
+
/**
|
|
221
|
+
*
|
|
222
|
+
*
|
|
223
|
+
* @type {CometChat.Group}
|
|
224
|
+
* @description CometChat SDK’s group object
|
|
225
|
+
*/
|
|
226
|
+
group?: CometChat.Group;
|
|
227
|
+
/**
|
|
228
|
+
*
|
|
229
|
+
*
|
|
230
|
+
* @type {boolean}
|
|
231
|
+
* @description Turn off sound for outgoing messages
|
|
232
|
+
*/
|
|
233
|
+
disableSoundForMessages?: boolean;
|
|
234
|
+
/**
|
|
235
|
+
*
|
|
236
|
+
*
|
|
237
|
+
* @type {*}
|
|
238
|
+
* @description Custom audio sound to be played while sending messages
|
|
239
|
+
*/
|
|
240
|
+
customSoundForMessage?: any;
|
|
241
|
+
/**
|
|
242
|
+
*
|
|
243
|
+
*
|
|
244
|
+
* @type {boolean}
|
|
245
|
+
* @description Disable typing events
|
|
246
|
+
*/
|
|
247
|
+
disableTypingEvents?: boolean;
|
|
248
|
+
/**
|
|
249
|
+
*
|
|
250
|
+
*
|
|
251
|
+
* @type {string}
|
|
252
|
+
* @description CometChatMessageComposerInterface
|
|
253
|
+
*/
|
|
254
|
+
text?: string;
|
|
255
|
+
/**
|
|
256
|
+
*
|
|
257
|
+
*
|
|
258
|
+
* @type {string}
|
|
259
|
+
* @description Text shown in the composer when the input message is empty
|
|
260
|
+
*/
|
|
261
|
+
placeHolderText?: string;
|
|
262
|
+
/**
|
|
263
|
+
*
|
|
264
|
+
*
|
|
265
|
+
* @type {React.FC}
|
|
266
|
+
* @description Preview section at the top of the composer
|
|
267
|
+
*/
|
|
268
|
+
HeaderView?: React.FC;
|
|
269
|
+
/**
|
|
270
|
+
*
|
|
271
|
+
*
|
|
272
|
+
* @type {React.FC}
|
|
273
|
+
* @description Preview section at the bottom of the composer
|
|
274
|
+
*/
|
|
275
|
+
FooterView?: React.FC;
|
|
276
|
+
/**
|
|
277
|
+
*
|
|
278
|
+
*
|
|
279
|
+
* @description onChange event triggered when the input changes
|
|
280
|
+
*/
|
|
281
|
+
onChangeText?: (text: string) => void;
|
|
282
|
+
/**
|
|
283
|
+
*
|
|
284
|
+
*
|
|
285
|
+
* @type {number}
|
|
286
|
+
* @description Threshold value when reached, input will not expand further, causing it to scroll
|
|
287
|
+
*/
|
|
288
|
+
maxHeight?: number;
|
|
289
|
+
/**
|
|
290
|
+
*
|
|
291
|
+
*
|
|
292
|
+
* @type {ImageType}
|
|
293
|
+
* @description Attachment Icon
|
|
294
|
+
*/
|
|
295
|
+
attachmentIcon?: ImageType;
|
|
296
|
+
/**
|
|
297
|
+
*
|
|
298
|
+
*
|
|
299
|
+
* @type {*}
|
|
300
|
+
* @description CometChatMessageComposerInterface
|
|
301
|
+
*/
|
|
302
|
+
attachmentOptions?: ({
|
|
303
|
+
user,
|
|
304
|
+
group,
|
|
305
|
+
composerId,
|
|
306
|
+
}: {
|
|
307
|
+
user?: CometChat.User;
|
|
308
|
+
group?: CometChat.Group;
|
|
309
|
+
composerId: Map<any, any>;
|
|
310
|
+
}) => CometChatMessageComposerActionInterface[];
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
*
|
|
314
|
+
*
|
|
315
|
+
* @type {FunctionComponent}
|
|
316
|
+
* @description function which return a JSX Element which replaces the default Secondary Button
|
|
317
|
+
*/
|
|
318
|
+
SecondaryButtonView?: ({
|
|
319
|
+
user,
|
|
320
|
+
group,
|
|
321
|
+
composerId,
|
|
322
|
+
}: {
|
|
323
|
+
user?: CometChat.User;
|
|
324
|
+
group?: CometChat.Group;
|
|
325
|
+
composerId: string | number;
|
|
326
|
+
}) => JSX.Element;
|
|
327
|
+
/**
|
|
328
|
+
*
|
|
329
|
+
*
|
|
330
|
+
* @type {FunctionComponent}
|
|
331
|
+
* @description Function which return a JSX Element which replaces the default Auxiliary Button
|
|
332
|
+
*/
|
|
333
|
+
AuxiliaryButtonView?: ({
|
|
334
|
+
user,
|
|
335
|
+
group,
|
|
336
|
+
composerId,
|
|
337
|
+
}: {
|
|
338
|
+
user?: CometChat.User;
|
|
339
|
+
group?: CometChat.Group;
|
|
340
|
+
composerId: string | number;
|
|
341
|
+
}) => JSX.Element;
|
|
342
|
+
/**
|
|
343
|
+
*
|
|
344
|
+
*
|
|
345
|
+
* @type {('left' | 'right')}
|
|
346
|
+
* @description Alignment for auxiliary buttons
|
|
347
|
+
*/
|
|
348
|
+
auxiliaryButtonsAlignment?: 'left' | 'right';
|
|
349
|
+
/**
|
|
350
|
+
*
|
|
351
|
+
*
|
|
352
|
+
* @type {FunctionComponent}
|
|
353
|
+
* @description Function which return a JSX Element which replaces the default Send Button
|
|
354
|
+
*/
|
|
355
|
+
SendButtonView?: ({
|
|
356
|
+
user,
|
|
357
|
+
group,
|
|
358
|
+
composerId,
|
|
359
|
+
}: {
|
|
360
|
+
user?: CometChat.User;
|
|
361
|
+
group?: CometChat.Group;
|
|
362
|
+
composerId: string | number;
|
|
363
|
+
}) => JSX.Element;
|
|
364
|
+
/**
|
|
365
|
+
*
|
|
366
|
+
*
|
|
367
|
+
* @type {(string | number)}
|
|
368
|
+
* @description Message id required for threaded messages
|
|
369
|
+
*/
|
|
370
|
+
parentMessageId?: string | number;
|
|
371
|
+
/**
|
|
372
|
+
*
|
|
373
|
+
*
|
|
374
|
+
* @type {boolean}
|
|
375
|
+
* @description Hide the live reaction button
|
|
376
|
+
*/
|
|
377
|
+
hideLiveReaction?: boolean;
|
|
378
|
+
/**
|
|
379
|
+
*
|
|
380
|
+
*
|
|
381
|
+
* @type {ImageType}
|
|
382
|
+
* @description Live reaction Icon
|
|
383
|
+
*/
|
|
384
|
+
liveReactionIcon?: ImageType;
|
|
385
|
+
/**
|
|
386
|
+
*
|
|
387
|
+
*
|
|
388
|
+
* @type {MessageComposerStyleInterface}
|
|
389
|
+
* @description Message Composer Styles
|
|
390
|
+
*/
|
|
391
|
+
messageComposerStyle?: MessageComposerStyleInterface;
|
|
392
|
+
/**
|
|
393
|
+
*
|
|
394
|
+
*
|
|
395
|
+
* @type {boolean}
|
|
396
|
+
* @description Hide the record voice button
|
|
397
|
+
*/
|
|
398
|
+
hideVoiceRecording?: boolean;
|
|
399
|
+
/**
|
|
400
|
+
*
|
|
401
|
+
*
|
|
402
|
+
* @type {string}
|
|
403
|
+
* @description Image URL for the voice recording icon
|
|
404
|
+
*/
|
|
405
|
+
voiceRecordingIconURL?: string;
|
|
406
|
+
/**
|
|
407
|
+
*
|
|
408
|
+
*
|
|
409
|
+
* @type {MediaRecorderStyle}
|
|
410
|
+
* @description Voice Recording Styles
|
|
411
|
+
*/
|
|
412
|
+
mediaRecorderStyle?: MediaRecorderStyle;
|
|
413
|
+
/**
|
|
414
|
+
*
|
|
415
|
+
*
|
|
416
|
+
* @type {ImageType}
|
|
417
|
+
* @description Pause Icon Icon
|
|
418
|
+
*/
|
|
419
|
+
pauseIconUrl?: ImageType;
|
|
420
|
+
/**
|
|
421
|
+
*
|
|
422
|
+
*
|
|
423
|
+
* @type {ImageType}
|
|
424
|
+
* @description Play Icon Icon
|
|
425
|
+
*/
|
|
426
|
+
playIconUrl?: ImageType;
|
|
427
|
+
/**
|
|
428
|
+
*
|
|
429
|
+
*
|
|
430
|
+
* @type {ImageType}
|
|
431
|
+
* @description Record Icon Icon
|
|
432
|
+
*/
|
|
433
|
+
recordIconUrl?: ImageType;
|
|
434
|
+
/**
|
|
435
|
+
*
|
|
436
|
+
*
|
|
437
|
+
* @type {ImageType}
|
|
438
|
+
* @description Delete Icon Icon
|
|
439
|
+
*/
|
|
440
|
+
deleteIconUrl?: ImageType;
|
|
441
|
+
/**
|
|
442
|
+
*
|
|
443
|
+
*
|
|
444
|
+
* @type {ImageType}
|
|
445
|
+
* @description Stop Icon Icon
|
|
446
|
+
*/
|
|
447
|
+
stopIconUrl?: ImageType;
|
|
448
|
+
/**
|
|
449
|
+
*
|
|
450
|
+
*
|
|
451
|
+
* @type {ImageType}
|
|
452
|
+
* @description Submit Icon Icon
|
|
453
|
+
*/
|
|
454
|
+
submitIconUrl?: ImageType;
|
|
455
|
+
/**
|
|
456
|
+
*
|
|
457
|
+
* @type {Function}
|
|
458
|
+
* @description callback(BaseMessage)→ void
|
|
459
|
+
*/
|
|
460
|
+
onSendButtonPress?: (message: CometChat.BaseMessage) => void;
|
|
461
|
+
/**
|
|
462
|
+
*
|
|
463
|
+
* @type {ErrorCallback}
|
|
464
|
+
* @description callback(error)→ void
|
|
465
|
+
*/
|
|
466
|
+
onError?: (error: any) => void;
|
|
467
|
+
}
|
|
468
|
+
export const CometChatMessageComposer = React.forwardRef(
|
|
469
|
+
(props: CometChatMessageComposerInterface, ref) => {
|
|
470
|
+
const editMessageListenerID = 'editMessageListener_' + new Date().getTime();
|
|
471
|
+
const UiEventListenerID = 'UiEventListener_' + new Date().getTime();
|
|
472
|
+
|
|
473
|
+
const { theme } = useContext<CometChatContextType>(CometChatContext);
|
|
474
|
+
const {
|
|
475
|
+
id,
|
|
476
|
+
user,
|
|
477
|
+
group,
|
|
478
|
+
disableSoundForMessages,
|
|
479
|
+
customSoundForMessage,
|
|
480
|
+
disableTypingEvents,
|
|
481
|
+
text,
|
|
482
|
+
placeHolderText,
|
|
483
|
+
HeaderView,
|
|
484
|
+
FooterView,
|
|
485
|
+
onChangeText,
|
|
486
|
+
maxHeight,
|
|
487
|
+
attachmentIcon,
|
|
488
|
+
attachmentOptions,
|
|
489
|
+
SecondaryButtonView,
|
|
490
|
+
AuxiliaryButtonView,
|
|
491
|
+
auxiliaryButtonsAlignment,
|
|
492
|
+
SendButtonView,
|
|
493
|
+
parentMessageId,
|
|
494
|
+
hideLiveReaction,
|
|
495
|
+
liveReactionIcon,
|
|
496
|
+
messageComposerStyle,
|
|
497
|
+
onSendButtonPress,
|
|
498
|
+
onError,
|
|
499
|
+
hideVoiceRecording,
|
|
500
|
+
voiceRecordingIconURL,
|
|
501
|
+
mediaRecorderStyle,
|
|
502
|
+
pauseIconUrl,
|
|
503
|
+
playIconUrl,
|
|
504
|
+
recordIconUrl,
|
|
505
|
+
deleteIconUrl,
|
|
506
|
+
stopIconUrl,
|
|
507
|
+
submitIconUrl,
|
|
508
|
+
} = props;
|
|
509
|
+
|
|
510
|
+
const defaultAttachmentOptions =
|
|
511
|
+
ChatConfigurator.dataSource.getAttachmentOptions(user, group, id);
|
|
512
|
+
|
|
513
|
+
const composerIdMap = new Map().set('parentMessageId', parentMessageId);
|
|
514
|
+
const defaultAuxiliaryButtonOptions =
|
|
515
|
+
ChatConfigurator.getDataSource().getAuxiliaryOptions(
|
|
516
|
+
user,
|
|
517
|
+
group,
|
|
518
|
+
composerIdMap,
|
|
519
|
+
theme
|
|
520
|
+
);
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
const loggedInUser = React.useRef<any>({});
|
|
524
|
+
const chatWith = React.useRef<any>(null);
|
|
525
|
+
const chatWithId = React.useRef<any>(null);
|
|
526
|
+
const messageInputRef = React.useRef<any>(null);
|
|
527
|
+
const chatRef = React.useRef<any>(chatWith);
|
|
528
|
+
const [selectionPosition, setSelectionPosition] = React.useState<any>({});
|
|
529
|
+
const [inputMessage, setInputMessage] = React.useState(text || '');
|
|
530
|
+
const [showReaction, setShowReaction] = React.useState(false);
|
|
531
|
+
const [showEmojiboard, setShowEmojiboard] = React.useState(false);
|
|
532
|
+
const [showActionSheet, setShowActionSheet] = React.useState(false);
|
|
533
|
+
const [showRecordAudio, setShowRecordAudio] = React.useState(false);
|
|
534
|
+
const [actionSheetItems, setActionSheetItems] = React.useState([]);
|
|
535
|
+
const [messagePreview, setMessagePreview] = React.useState(null);
|
|
536
|
+
const [CustomView, setCustomView] = React.useState(null);
|
|
537
|
+
const [CustomViewHeader, setCustomViewHeader] = React.useState(null);
|
|
538
|
+
const [CustomViewFooter, setCustomViewFooter] = React.useState(null);
|
|
539
|
+
const [isVisible, setIsVisible] = React.useState(false);
|
|
540
|
+
|
|
541
|
+
const bottomSheetRef = React.useRef<any>(null);
|
|
542
|
+
|
|
543
|
+
let isTyping = null;
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* Event callback
|
|
547
|
+
*/
|
|
548
|
+
React.useImperativeHandle(ref, () => ({
|
|
549
|
+
previewMessageForEdit: previewMessage,
|
|
550
|
+
}));
|
|
551
|
+
|
|
552
|
+
const previewMessage = ({ message, status }: any) => {
|
|
553
|
+
if (status === messageStatus.inprogress) {
|
|
554
|
+
setMessagePreview({
|
|
555
|
+
message: message,
|
|
556
|
+
mode: ConversationOptionConstants.edit,
|
|
557
|
+
});
|
|
558
|
+
|
|
559
|
+
setInputMessage(message.text ?? '');
|
|
560
|
+
messageInputRef.current.focus();
|
|
561
|
+
}
|
|
562
|
+
};
|
|
563
|
+
|
|
564
|
+
const fileInputHandler = async (fileType: string) => {
|
|
565
|
+
if (fileType === MessageTypeConstants.takePhoto)
|
|
566
|
+
FileManager.openCamera(fileType, async (cameraImage: any) => {
|
|
567
|
+
if (CheckPropertyExists(cameraImage, 'error')) {
|
|
568
|
+
return;
|
|
569
|
+
}
|
|
570
|
+
const { name, uri, type } = cameraImage;
|
|
571
|
+
let file = {
|
|
572
|
+
name,
|
|
573
|
+
type,
|
|
574
|
+
uri,
|
|
575
|
+
};
|
|
576
|
+
sendMediaMessage(
|
|
577
|
+
chatWithId.current,
|
|
578
|
+
file,
|
|
579
|
+
MessageTypeConstants.image,
|
|
580
|
+
chatWith.current
|
|
581
|
+
);
|
|
582
|
+
});
|
|
583
|
+
else
|
|
584
|
+
FileManager.openFileChooser(fileType, async (fileInfo: any) => {
|
|
585
|
+
if (CheckPropertyExists(fileInfo, 'error')) {
|
|
586
|
+
return;
|
|
587
|
+
}
|
|
588
|
+
let { name, uri, type } = fileInfo;
|
|
589
|
+
let file = {
|
|
590
|
+
name,
|
|
591
|
+
type,
|
|
592
|
+
uri,
|
|
593
|
+
};
|
|
594
|
+
sendMediaMessage(
|
|
595
|
+
chatWithId.current,
|
|
596
|
+
file,
|
|
597
|
+
fileType,
|
|
598
|
+
chatWith.current
|
|
599
|
+
);
|
|
600
|
+
});
|
|
601
|
+
};
|
|
602
|
+
|
|
603
|
+
const playAudio = () => {
|
|
604
|
+
if (customSoundForMessage) {
|
|
605
|
+
CometChatSoundManager.play(
|
|
606
|
+
CometChatSoundManager.SoundOutput.outgoingMessage,
|
|
607
|
+
customSoundForMessage
|
|
608
|
+
);
|
|
609
|
+
} else {
|
|
610
|
+
CometChatSoundManager.play(
|
|
611
|
+
CometChatSoundManager.SoundOutput.outgoingMessage
|
|
612
|
+
);
|
|
613
|
+
}
|
|
614
|
+
};
|
|
615
|
+
|
|
616
|
+
const textChangeHandler = (txt: string) => {
|
|
617
|
+
onChangeText && onChangeText(txt);
|
|
618
|
+
startTyping();
|
|
619
|
+
setInputMessage(txt);
|
|
620
|
+
};
|
|
621
|
+
|
|
622
|
+
const liveReactionHandler = () => {
|
|
623
|
+
if (hideLiveReaction) return;
|
|
624
|
+
if (!showReaction) {
|
|
625
|
+
setShowReaction(true);
|
|
626
|
+
|
|
627
|
+
//send reaction event
|
|
628
|
+
const data = {
|
|
629
|
+
type: MetadataConstants.liveReaction,
|
|
630
|
+
reaction: liveReactionIcon,
|
|
631
|
+
};
|
|
632
|
+
|
|
633
|
+
/*** send transient message */
|
|
634
|
+
let transientMessage = new CometChat.TransientMessage(
|
|
635
|
+
chatWithId.current,
|
|
636
|
+
chatWith.current,
|
|
637
|
+
data
|
|
638
|
+
);
|
|
639
|
+
|
|
640
|
+
CometChat.sendTransientMessage(transientMessage);
|
|
641
|
+
|
|
642
|
+
setTimeout(() => {
|
|
643
|
+
setShowReaction(false);
|
|
644
|
+
CometChatUIEventHandler.emitMessageEvent(
|
|
645
|
+
MessageEvents.ccMessageLiveReaction,
|
|
646
|
+
{ liveReactionIcon }
|
|
647
|
+
);
|
|
648
|
+
}, 1500);
|
|
649
|
+
}
|
|
650
|
+
};
|
|
651
|
+
|
|
652
|
+
const clearInputBox = () => {
|
|
653
|
+
setInputMessage('');
|
|
654
|
+
};
|
|
655
|
+
|
|
656
|
+
const sendTextMessage = () => {
|
|
657
|
+
|
|
658
|
+
//ignore sending new message
|
|
659
|
+
if (messagePreview != null) {
|
|
660
|
+
editMessage(messagePreview.message);
|
|
661
|
+
return;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
let textMessage = new CometChat.TextMessage(
|
|
665
|
+
chatWithId.current,
|
|
666
|
+
inputMessage,
|
|
667
|
+
chatWith.current
|
|
668
|
+
);
|
|
669
|
+
|
|
670
|
+
textMessage.setSender(loggedInUser.current);
|
|
671
|
+
textMessage.setReceiver(chatWith.current);
|
|
672
|
+
textMessage.setText(inputMessage);
|
|
673
|
+
textMessage.setMuid(String(getUnixTimestamp()));
|
|
674
|
+
parentMessageId && textMessage.setParentMessageId(parentMessageId as number);
|
|
675
|
+
|
|
676
|
+
onSendButtonPress && onSendButtonPress(textMessage);
|
|
677
|
+
if (inputMessage.trim().length == 0) {
|
|
678
|
+
return;
|
|
679
|
+
}
|
|
680
|
+
CometChatUIEventHandler.emitMessageEvent(MessageEvents.ccMessageSent, {
|
|
681
|
+
message: textMessage,
|
|
682
|
+
status: messageStatus.inprogress,
|
|
683
|
+
});
|
|
684
|
+
|
|
685
|
+
if (!disableSoundForMessages) playAudio();
|
|
686
|
+
clearInputBox();
|
|
687
|
+
CometChat.sendMessage(textMessage)
|
|
688
|
+
.then((message: any) => {
|
|
689
|
+
CometChatUIEventHandler.emitMessageEvent(
|
|
690
|
+
MessageEvents.ccMessageSent,
|
|
691
|
+
{
|
|
692
|
+
message: message,
|
|
693
|
+
status: messageStatus.success,
|
|
694
|
+
}
|
|
695
|
+
);
|
|
696
|
+
})
|
|
697
|
+
.catch((error: any) => {
|
|
698
|
+
onError && onError(error);
|
|
699
|
+
clearInputBox();
|
|
700
|
+
});
|
|
701
|
+
};
|
|
702
|
+
|
|
703
|
+
/** edit message */
|
|
704
|
+
const editMessage = (message: any) => {
|
|
705
|
+
endTyping(null, null);
|
|
706
|
+
|
|
707
|
+
let messageText = inputMessage.trim();
|
|
708
|
+
let textMessage = new CometChat.TextMessage(
|
|
709
|
+
chatWithId.current,
|
|
710
|
+
messageText,
|
|
711
|
+
chatWith.current
|
|
712
|
+
);
|
|
713
|
+
textMessage.setId(message.id);
|
|
714
|
+
parentMessageId && textMessage.setParentMessageId(parentMessageId as number);
|
|
715
|
+
|
|
716
|
+
setInputMessage('');
|
|
717
|
+
messageInputRef.current.textContent = '';
|
|
718
|
+
|
|
719
|
+
if (!disableSoundForMessages) playAudio();
|
|
720
|
+
|
|
721
|
+
setMessagePreview(null);
|
|
722
|
+
|
|
723
|
+
CometChat.editMessage(textMessage)
|
|
724
|
+
.then((editedMessage: any) => {
|
|
725
|
+
setInputMessage('');
|
|
726
|
+
CometChatUIEventHandler.emitMessageEvent(
|
|
727
|
+
MessageEvents.ccMessageEdited,
|
|
728
|
+
{
|
|
729
|
+
message: editedMessage,
|
|
730
|
+
status: messageStatus.success,
|
|
731
|
+
}
|
|
732
|
+
);
|
|
733
|
+
})
|
|
734
|
+
.catch((error: any) => {
|
|
735
|
+
onError && onError(error);
|
|
736
|
+
});
|
|
737
|
+
};
|
|
738
|
+
|
|
739
|
+
/** send media message */
|
|
740
|
+
const sendMediaMessage = (
|
|
741
|
+
receiverId?: any,
|
|
742
|
+
messageInput?: any,
|
|
743
|
+
messageType?: any,
|
|
744
|
+
receiverType?: any
|
|
745
|
+
) => {
|
|
746
|
+
setShowActionSheet(false);
|
|
747
|
+
let mediaMessage = new CometChat.MediaMessage(
|
|
748
|
+
receiverId,
|
|
749
|
+
messageInput,
|
|
750
|
+
messageType,
|
|
751
|
+
receiverType
|
|
752
|
+
);
|
|
753
|
+
|
|
754
|
+
mediaMessage.setSender(loggedInUser.current);
|
|
755
|
+
mediaMessage.setReceiver(receiverType);
|
|
756
|
+
mediaMessage.setType(messageType);
|
|
757
|
+
mediaMessage['_composedAt'] = Date.now();
|
|
758
|
+
mediaMessage['_id'] = '_' + Math.random().toString(36).substr(2, 9);
|
|
759
|
+
mediaMessage.setId(mediaMessage['_id']);
|
|
760
|
+
mediaMessage.setMuid(String(getUnixTimestamp()));
|
|
761
|
+
mediaMessage.setData({
|
|
762
|
+
type: messageType,
|
|
763
|
+
category: CometChat.CATEGORY_MESSAGE,
|
|
764
|
+
name: messageInput['name'],
|
|
765
|
+
file: messageInput,
|
|
766
|
+
url: messageInput['uri'],
|
|
767
|
+
sender: loggedInUser.current,
|
|
768
|
+
});
|
|
769
|
+
parentMessageId && mediaMessage.setParentMessageId(parentMessageId as number);
|
|
770
|
+
|
|
771
|
+
let localMessage = new CometChat.MediaMessage(
|
|
772
|
+
receiverId,
|
|
773
|
+
messageInput,
|
|
774
|
+
messageType,
|
|
775
|
+
receiverType
|
|
776
|
+
);
|
|
777
|
+
|
|
778
|
+
localMessage.setSender(loggedInUser.current);
|
|
779
|
+
localMessage.setReceiver(receiverType);
|
|
780
|
+
localMessage.setType(messageType);
|
|
781
|
+
localMessage['_composedAt'] = Date.now();
|
|
782
|
+
localMessage['_id'] = '_' + Math.random().toString(36).substr(2, 9);
|
|
783
|
+
localMessage.setId(localMessage['_id']);
|
|
784
|
+
localMessage.setMuid(String(getUnixTimestamp()));
|
|
785
|
+
localMessage.setData({
|
|
786
|
+
type: messageType,
|
|
787
|
+
category: CometChat.CATEGORY_MESSAGE,
|
|
788
|
+
name: messageInput['name'],
|
|
789
|
+
file: messageInput,
|
|
790
|
+
url: messageInput['uri'],
|
|
791
|
+
sender: loggedInUser.current,
|
|
792
|
+
});
|
|
793
|
+
parentMessageId && localMessage.setParentMessageId(parentMessageId as number);
|
|
794
|
+
localMessage.setData({
|
|
795
|
+
type: messageType,
|
|
796
|
+
category: CometChat.CATEGORY_MESSAGE,
|
|
797
|
+
name: messageInput['name'],
|
|
798
|
+
file: messageInput,
|
|
799
|
+
url: messageInput['uri'],
|
|
800
|
+
sender: loggedInUser.current,
|
|
801
|
+
attachments: [messageInput],
|
|
802
|
+
});
|
|
803
|
+
|
|
804
|
+
CometChatUIEventHandler.emitMessageEvent(MessageEvents.ccMessageSent, {
|
|
805
|
+
message: localMessage,
|
|
806
|
+
status: messageStatus.inprogress,
|
|
807
|
+
});
|
|
808
|
+
|
|
809
|
+
if (!disableSoundForMessages) playAudio();
|
|
810
|
+
CometChat.sendMediaMessage(mediaMessage)
|
|
811
|
+
.then((message: any) => {
|
|
812
|
+
CometChatUIEventHandler.emitMessageEvent(
|
|
813
|
+
MessageEvents.ccMessageSent,
|
|
814
|
+
{
|
|
815
|
+
message: message,
|
|
816
|
+
status: messageStatus.success,
|
|
817
|
+
}
|
|
818
|
+
);
|
|
819
|
+
setShowRecordAudio(false);
|
|
820
|
+
})
|
|
821
|
+
.catch((error: any) => {
|
|
822
|
+
setShowRecordAudio(false);
|
|
823
|
+
onError && onError(error);
|
|
824
|
+
console.log('media message sent error', error);
|
|
825
|
+
});
|
|
826
|
+
};
|
|
827
|
+
|
|
828
|
+
const startTyping = (endTypingTimeout?: any, typingMetadata?: any) => {
|
|
829
|
+
//if typing is disabled
|
|
830
|
+
if (disableTypingEvents) {
|
|
831
|
+
return false;
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
//if typing is in progress
|
|
835
|
+
if (isTyping) {
|
|
836
|
+
return false;
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
let typingInterval = endTypingTimeout || 5000;
|
|
840
|
+
let metadata = typingMetadata || undefined;
|
|
841
|
+
|
|
842
|
+
let typingNotification = new CometChat.TypingIndicator(
|
|
843
|
+
chatWithId.current,
|
|
844
|
+
chatWith.current,
|
|
845
|
+
metadata
|
|
846
|
+
);
|
|
847
|
+
CometChat.startTyping(typingNotification);
|
|
848
|
+
|
|
849
|
+
isTyping = setTimeout(() => {
|
|
850
|
+
endTyping(null, typingMetadata);
|
|
851
|
+
}, typingInterval);
|
|
852
|
+
return false;
|
|
853
|
+
};
|
|
854
|
+
|
|
855
|
+
const endTyping = (event: any, typingMetadata: any) => {
|
|
856
|
+
if (event) {
|
|
857
|
+
event.persist();
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
if (disableTypingEvents) {
|
|
861
|
+
return false;
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
let metadata = typingMetadata || undefined;
|
|
865
|
+
|
|
866
|
+
let typingNotification = new CometChat.TypingIndicator(
|
|
867
|
+
chatWithId.current,
|
|
868
|
+
chatWith.current,
|
|
869
|
+
metadata
|
|
870
|
+
);
|
|
871
|
+
CometChat.endTyping(typingNotification);
|
|
872
|
+
|
|
873
|
+
clearTimeout(isTyping);
|
|
874
|
+
isTyping = null;
|
|
875
|
+
return false;
|
|
876
|
+
};
|
|
877
|
+
|
|
878
|
+
// const getActionSheetStyle = () => {
|
|
879
|
+
// return new ActionSheetStyles({
|
|
880
|
+
// layoutModeIconTint:
|
|
881
|
+
// messageComposerStyle.actionSheetLayoutModeIconTint ??
|
|
882
|
+
// theme.palette.getPrimary(),
|
|
883
|
+
// titleFont:
|
|
884
|
+
// messageComposerStyle.actionSheetTitleFont ?? theme.typography.text1,
|
|
885
|
+
// titleColor:
|
|
886
|
+
// messageComposerStyle.actionSheetTitleColor ??
|
|
887
|
+
// theme.palette.getAccent800(),
|
|
888
|
+
// });
|
|
889
|
+
// };
|
|
890
|
+
|
|
891
|
+
const GetEmojiIconView = () => {
|
|
892
|
+
return (
|
|
893
|
+
<ImageButton
|
|
894
|
+
image={ICONS.EMOJI}
|
|
895
|
+
imageStyle={Style.imageStyle}
|
|
896
|
+
onClick={() => setShowEmojiboard(true)}
|
|
897
|
+
/>
|
|
898
|
+
);
|
|
899
|
+
};
|
|
900
|
+
|
|
901
|
+
const AuxiliaryButtonViewElem = () => {
|
|
902
|
+
if (AuxiliaryButtonView)
|
|
903
|
+
return (
|
|
904
|
+
<AuxiliaryButtonView user={user} group={group} composerId={id} />
|
|
905
|
+
);
|
|
906
|
+
else if (defaultAuxiliaryButtonOptions)
|
|
907
|
+
return <View style={{ flexDirection: "row", alignItems: "center" }}>
|
|
908
|
+
{defaultAuxiliaryButtonOptions}
|
|
909
|
+
{!hideVoiceRecording && <RecordAudioButtonView />}
|
|
910
|
+
</View>;
|
|
911
|
+
|
|
912
|
+
return hideVoiceRecording ? null : <RecordAudioButtonView />;
|
|
913
|
+
};
|
|
914
|
+
|
|
915
|
+
const SendButtonViewElem = () => {
|
|
916
|
+
if (SendButtonView)
|
|
917
|
+
return <SendButtonView user={user} group={group} composerId={id} />;
|
|
918
|
+
return (
|
|
919
|
+
<ImageButton
|
|
920
|
+
image={ICONS.SEND}
|
|
921
|
+
imageStyle={[
|
|
922
|
+
Style.imageStyle,
|
|
923
|
+
{
|
|
924
|
+
tintColor:
|
|
925
|
+
messageComposerStyle.sendIconTint ||
|
|
926
|
+
theme.palette.getPrimary(),
|
|
927
|
+
},
|
|
928
|
+
]}
|
|
929
|
+
onClick={sendTextMessage}
|
|
930
|
+
/>
|
|
931
|
+
);
|
|
932
|
+
};
|
|
933
|
+
|
|
934
|
+
const SecondaryButtonViewElem = () => {
|
|
935
|
+
if (SecondaryButtonView)
|
|
936
|
+
return (
|
|
937
|
+
<SecondaryButtonView user={user} group={group} composerId={id} />
|
|
938
|
+
);
|
|
939
|
+
return (
|
|
940
|
+
<AttachIconButton
|
|
941
|
+
icon={attachmentIcon}
|
|
942
|
+
show={true}
|
|
943
|
+
onClick={() => setShowActionSheet(true)}
|
|
944
|
+
style={{
|
|
945
|
+
height: 23,
|
|
946
|
+
width: 23,
|
|
947
|
+
resizeMode: 'contain',
|
|
948
|
+
tintColor: messageComposerStyle.attachIcontint
|
|
949
|
+
? messageComposerStyle.attachIcontint
|
|
950
|
+
: theme.palette.getAccent500(),
|
|
951
|
+
}}
|
|
952
|
+
/>
|
|
953
|
+
);
|
|
954
|
+
};
|
|
955
|
+
const PrimaryButtonView = () => {
|
|
956
|
+
return inputMessage.length || hideLiveReaction ? (
|
|
957
|
+
<SendButtonViewElem />
|
|
958
|
+
) : (
|
|
959
|
+
<View>
|
|
960
|
+
<View style={Style.liveReactionStyle}>
|
|
961
|
+
<LiveReaction show={showReaction} reaction={liveReactionIcon} />
|
|
962
|
+
</View>
|
|
963
|
+
<ImageButton
|
|
964
|
+
image={liveReactionIcon}
|
|
965
|
+
imageStyle={[Style.imageStyle, Style.liveReactionBtnStyle]}
|
|
966
|
+
onClick={liveReactionHandler}
|
|
967
|
+
/>
|
|
968
|
+
</View>
|
|
969
|
+
);
|
|
970
|
+
};
|
|
971
|
+
|
|
972
|
+
const RecordAudioButtonView = () => {
|
|
973
|
+
return <ImageButton
|
|
974
|
+
image={voiceRecordingIconURL || ICONS.MICROPHONE}
|
|
975
|
+
imageStyle={Style.imageStyle}
|
|
976
|
+
onClick={() => setShowRecordAudio(true)}
|
|
977
|
+
/>
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
//fetch logged in user
|
|
981
|
+
useEffect(() => {
|
|
982
|
+
CometChat.getLoggedinUser().then((user) => (loggedInUser.current = user));
|
|
983
|
+
}, []);
|
|
984
|
+
|
|
985
|
+
useEffect(() => {
|
|
986
|
+
//update receiver user
|
|
987
|
+
if (user && user.getUid()) {
|
|
988
|
+
chatRef.current = {
|
|
989
|
+
chatWith: ReceiverTypeConstants.user,
|
|
990
|
+
chatWithId: user.getUid(),
|
|
991
|
+
};
|
|
992
|
+
chatWith.current = ReceiverTypeConstants.user;
|
|
993
|
+
chatWithId.current = user.getUid();
|
|
994
|
+
} else if (group && group.getGuid()) {
|
|
995
|
+
chatRef.current = {
|
|
996
|
+
chatWith: ReceiverTypeConstants.group,
|
|
997
|
+
chatWithId: group.getGuid(),
|
|
998
|
+
};
|
|
999
|
+
chatWith.current = ReceiverTypeConstants.group;
|
|
1000
|
+
chatWithId.current = group.getGuid();
|
|
1001
|
+
}
|
|
1002
|
+
}, [user, group, chatRef]);
|
|
1003
|
+
|
|
1004
|
+
const handleOnClick = (CustomView) => {
|
|
1005
|
+
let view = CustomView(
|
|
1006
|
+
user,
|
|
1007
|
+
group,
|
|
1008
|
+
{
|
|
1009
|
+
uid: user?.getUid(),
|
|
1010
|
+
guid: group?.getGuid(),
|
|
1011
|
+
parentMessageId: parentMessageId,
|
|
1012
|
+
},
|
|
1013
|
+
{
|
|
1014
|
+
onClose: () => setIsVisible(false),
|
|
1015
|
+
}
|
|
1016
|
+
);
|
|
1017
|
+
bottomSheetRef.current?.togglePanel();
|
|
1018
|
+
setTimeout(() => {
|
|
1019
|
+
setCustomView(() => view);
|
|
1020
|
+
setIsVisible(true);
|
|
1021
|
+
}, 200);
|
|
1022
|
+
};
|
|
1023
|
+
|
|
1024
|
+
useEffect(() => {
|
|
1025
|
+
const defaultAttachmentOptions =
|
|
1026
|
+
ChatConfigurator.dataSource.getAttachmentOptions(user, group, composerIdMap);
|
|
1027
|
+
setActionSheetItems(() =>
|
|
1028
|
+
attachmentOptions && typeof attachmentOptions === 'function'
|
|
1029
|
+
? attachmentOptions({ user, group, composerId: composerIdMap })?.map((item) => {
|
|
1030
|
+
if (typeof item.CustomView === 'function')
|
|
1031
|
+
return {
|
|
1032
|
+
...item,
|
|
1033
|
+
onPress: () => handleOnClick(item.CustomView),
|
|
1034
|
+
};
|
|
1035
|
+
if (typeof item.onPress == 'function')
|
|
1036
|
+
return {
|
|
1037
|
+
...item,
|
|
1038
|
+
onPress: () => item.onPress(user, group),
|
|
1039
|
+
};
|
|
1040
|
+
return {
|
|
1041
|
+
...item,
|
|
1042
|
+
onPress: () => fileInputHandler(item.id),
|
|
1043
|
+
};
|
|
1044
|
+
})
|
|
1045
|
+
: defaultAttachmentOptions.map((item) => {
|
|
1046
|
+
if (typeof item.CustomView === 'function')
|
|
1047
|
+
return {
|
|
1048
|
+
...item,
|
|
1049
|
+
onPress: () => handleOnClick(item.CustomView),
|
|
1050
|
+
};
|
|
1051
|
+
if (typeof item.onPress === 'function')
|
|
1052
|
+
return {
|
|
1053
|
+
...item,
|
|
1054
|
+
onPress: () => item.onPress(user, group),
|
|
1055
|
+
};
|
|
1056
|
+
return {
|
|
1057
|
+
...item,
|
|
1058
|
+
onPress: () => fileInputHandler(item.id),
|
|
1059
|
+
};
|
|
1060
|
+
})
|
|
1061
|
+
);
|
|
1062
|
+
}, [user, group, id, parentMessageId]);
|
|
1063
|
+
|
|
1064
|
+
useEffect(() => {
|
|
1065
|
+
CometChatUIEventHandler.addMessageListener(editMessageListenerID, {
|
|
1066
|
+
ccMessageEdited: (item) => previewMessage(item),
|
|
1067
|
+
});
|
|
1068
|
+
CometChatUIEventHandler.addUIListener(UiEventListenerID, {
|
|
1069
|
+
ccToggleBottomSheet: (item) => {
|
|
1070
|
+
setIsVisible(false);
|
|
1071
|
+
bottomSheetRef.current?.togglePanel();
|
|
1072
|
+
},
|
|
1073
|
+
ccComposeMessage: (text)=>{
|
|
1074
|
+
setIsVisible(false);
|
|
1075
|
+
bottomSheetRef.current?.togglePanel();
|
|
1076
|
+
|
|
1077
|
+
setInputMessage(text?.text)
|
|
1078
|
+
|
|
1079
|
+
}
|
|
1080
|
+
})
|
|
1081
|
+
return () => {
|
|
1082
|
+
CometChatUIEventHandler.removeMessageListener(editMessageListenerID);
|
|
1083
|
+
CometChatUIEventHandler.removeUIListener(UiEventListenerID);
|
|
1084
|
+
}
|
|
1085
|
+
}, []);
|
|
1086
|
+
|
|
1087
|
+
const handlePannel = (item) => {
|
|
1088
|
+
if (item.child) {
|
|
1089
|
+
if (item.alignment === ViewAlignment.composerTop)
|
|
1090
|
+
setCustomViewHeader(() => item.child);
|
|
1091
|
+
else if (item.alignment === ViewAlignment.composerBottom)
|
|
1092
|
+
setCustomViewFooter(() => item.child);
|
|
1093
|
+
} else {
|
|
1094
|
+
if (item.alignment === ViewAlignment.composerTop)
|
|
1095
|
+
setCustomViewHeader(null);
|
|
1096
|
+
else if (item.alignment === ViewAlignment.composerBottom)
|
|
1097
|
+
setCustomViewFooter(null);
|
|
1098
|
+
}
|
|
1099
|
+
};
|
|
1100
|
+
|
|
1101
|
+
useEffect(() => {
|
|
1102
|
+
CometChatUIEventHandler.addUIListener(uiEventListenerShow, {
|
|
1103
|
+
showPanel: (item) => handlePannel(item),
|
|
1104
|
+
});
|
|
1105
|
+
CometChatUIEventHandler.addUIListener(uiEventListenerHide, {
|
|
1106
|
+
hidePanel: (item) => handlePannel(item),
|
|
1107
|
+
});
|
|
1108
|
+
return () => {
|
|
1109
|
+
CometChatUIEventHandler.removeUIListener(uiEventListenerShow);
|
|
1110
|
+
CometChatUIEventHandler.removeUIListener(uiEventListenerHide);
|
|
1111
|
+
};
|
|
1112
|
+
}, []);
|
|
1113
|
+
|
|
1114
|
+
const _sendRecordedAudio = (recordedFile: String) => {
|
|
1115
|
+
let fileObj = {
|
|
1116
|
+
"name": "audio-recording" + recordedFile.split("/audio-recording")[1],
|
|
1117
|
+
"type": "audio/mp4",
|
|
1118
|
+
"uri": recordedFile
|
|
1119
|
+
}
|
|
1120
|
+
console.log("fileObj", fileObj);
|
|
1121
|
+
sendMediaMessage(
|
|
1122
|
+
chatWithId.current,
|
|
1123
|
+
fileObj,
|
|
1124
|
+
MessageTypeConstants.audio,
|
|
1125
|
+
chatWith.current
|
|
1126
|
+
);
|
|
1127
|
+
console.log("Send Audio");
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
return (
|
|
1131
|
+
<>
|
|
1132
|
+
<Modal
|
|
1133
|
+
visible={isVisible}
|
|
1134
|
+
onRequestClose={() => {
|
|
1135
|
+
setIsVisible(false);
|
|
1136
|
+
}}
|
|
1137
|
+
presentationStyle={'pageSheet'}
|
|
1138
|
+
>
|
|
1139
|
+
{CustomView && CustomView}
|
|
1140
|
+
</Modal>
|
|
1141
|
+
<KeyboardAvoidingView
|
|
1142
|
+
key={id}
|
|
1143
|
+
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
|
|
1144
|
+
keyboardVerticalOffset={Platform.select({ ios: 60 })}
|
|
1145
|
+
>
|
|
1146
|
+
<View
|
|
1147
|
+
style={[
|
|
1148
|
+
Style.container,
|
|
1149
|
+
{
|
|
1150
|
+
backgroundColor: theme.palette.getAccent100(),
|
|
1151
|
+
paddingTop: CustomViewHeader ? 0 : 8
|
|
1152
|
+
},
|
|
1153
|
+
messageComposerStyle,
|
|
1154
|
+
]}
|
|
1155
|
+
>
|
|
1156
|
+
<EmojiBoard
|
|
1157
|
+
hideSearch={true}
|
|
1158
|
+
shouldShow={showEmojiboard}
|
|
1159
|
+
onClose={() => setShowEmojiboard(false)}
|
|
1160
|
+
emojiSelection={(emoji: any) => {
|
|
1161
|
+
let pre = inputMessage.substring(0, selectionPosition.start);
|
|
1162
|
+
let post = inputMessage.substring(
|
|
1163
|
+
selectionPosition.end,
|
|
1164
|
+
inputMessage.length
|
|
1165
|
+
);
|
|
1166
|
+
setInputMessage((prev) =>
|
|
1167
|
+
selectionPosition.start && selectionPosition.end
|
|
1168
|
+
? `${pre}${emoji}${post}`
|
|
1169
|
+
: `${prev}${emoji}`
|
|
1170
|
+
);
|
|
1171
|
+
setShowEmojiboard(false);
|
|
1172
|
+
}}
|
|
1173
|
+
/>
|
|
1174
|
+
<ActionSheetBoard
|
|
1175
|
+
sheetRef={bottomSheetRef}
|
|
1176
|
+
options={actionSheetItems}
|
|
1177
|
+
shouldShow={showActionSheet}
|
|
1178
|
+
onClose={() => setShowActionSheet(false)}
|
|
1179
|
+
style={{
|
|
1180
|
+
// ...getActionSheetStyle(),
|
|
1181
|
+
...(messageComposerStyle.actionSheetSeparatorTint
|
|
1182
|
+
? {
|
|
1183
|
+
actionSheetSeparatorTint:
|
|
1184
|
+
messageComposerStyle.actionSheetSeparatorTint,
|
|
1185
|
+
}
|
|
1186
|
+
: {}),
|
|
1187
|
+
}}
|
|
1188
|
+
cometChatBottomSheetStyle={
|
|
1189
|
+
messageComposerStyle.actionSheetCancelButtonIconTint
|
|
1190
|
+
? {
|
|
1191
|
+
lineColor:
|
|
1192
|
+
messageComposerStyle.actionSheetCancelButtonIconTint,
|
|
1193
|
+
}
|
|
1194
|
+
: {}
|
|
1195
|
+
}
|
|
1196
|
+
/>
|
|
1197
|
+
<RecordAudio
|
|
1198
|
+
sheetRef={bottomSheetRef}
|
|
1199
|
+
options={actionSheetItems}
|
|
1200
|
+
shouldShow={showRecordAudio}
|
|
1201
|
+
onClose={() => {
|
|
1202
|
+
setShowRecordAudio(false)
|
|
1203
|
+
}}
|
|
1204
|
+
onSend={_sendRecordedAudio}
|
|
1205
|
+
cometChatBottomSheetStyle={
|
|
1206
|
+
messageComposerStyle.actionSheetCancelButtonIconTint
|
|
1207
|
+
? {
|
|
1208
|
+
lineColor:
|
|
1209
|
+
messageComposerStyle.actionSheetCancelButtonIconTint,
|
|
1210
|
+
}
|
|
1211
|
+
: {}
|
|
1212
|
+
}
|
|
1213
|
+
mediaRecorderStyle={mediaRecorderStyle}
|
|
1214
|
+
pauseIconUrl={pauseIconUrl}
|
|
1215
|
+
playIconUrl={playIconUrl}
|
|
1216
|
+
recordIconUrl={recordIconUrl}
|
|
1217
|
+
deleteIconUrl={deleteIconUrl}
|
|
1218
|
+
stopIconUrl={stopIconUrl}
|
|
1219
|
+
submitIconUrl={submitIconUrl}
|
|
1220
|
+
/>
|
|
1221
|
+
{HeaderView ? (
|
|
1222
|
+
<HeaderView />
|
|
1223
|
+
) : (
|
|
1224
|
+
CustomViewHeader && <CustomViewHeader />
|
|
1225
|
+
)}
|
|
1226
|
+
<View>
|
|
1227
|
+
<MessagePreviewTray
|
|
1228
|
+
onClose={() => setMessagePreview(null)}
|
|
1229
|
+
text={messagePreview?.message?.text}
|
|
1230
|
+
shouldShow={messagePreview != null}
|
|
1231
|
+
/>
|
|
1232
|
+
</View >
|
|
1233
|
+
<CometChatMessageInput
|
|
1234
|
+
messageInputRef={messageInputRef}
|
|
1235
|
+
text={inputMessage}
|
|
1236
|
+
placeHolderText={placeHolderText}
|
|
1237
|
+
style={messageComposerStyle}
|
|
1238
|
+
onSelectionChange={({ nativeEvent: { selection } }) =>
|
|
1239
|
+
setSelectionPosition(selection)
|
|
1240
|
+
}
|
|
1241
|
+
maxHeight={maxHeight ?? null}
|
|
1242
|
+
onChangeText={textChangeHandler}
|
|
1243
|
+
SecondaryButtonView={SecondaryButtonViewElem}
|
|
1244
|
+
AuxiliaryButtonView={AuxiliaryButtonViewElem}
|
|
1245
|
+
PrimaryButtonView={PrimaryButtonView}
|
|
1246
|
+
auxiliaryButtonAlignment={
|
|
1247
|
+
auxiliaryButtonsAlignment ? auxiliaryButtonsAlignment : 'right'
|
|
1248
|
+
}
|
|
1249
|
+
/>
|
|
1250
|
+
{FooterView ? (
|
|
1251
|
+
<FooterView />
|
|
1252
|
+
) : (
|
|
1253
|
+
CustomViewFooter && <CustomViewFooter />
|
|
1254
|
+
)}
|
|
1255
|
+
</View>
|
|
1256
|
+
</KeyboardAvoidingView>
|
|
1257
|
+
</>
|
|
1258
|
+
);
|
|
1259
|
+
}
|
|
1260
|
+
);
|
|
1261
|
+
|
|
1262
|
+
CometChatMessageComposer.defaultProps = {
|
|
1263
|
+
user: undefined,
|
|
1264
|
+
group: undefined,
|
|
1265
|
+
// style: new MessageComposerStyle({}),
|
|
1266
|
+
attachmentIcon: ICONS.ADD,
|
|
1267
|
+
liveReactionIcon: ICONS.HEART,
|
|
1268
|
+
hideLiveReaction: false,
|
|
1269
|
+
disableSoundForMessages: true,
|
|
1270
|
+
messageComposerStyle: {},
|
|
1271
|
+
};
|