@cometchat/chat-uikit-react-native 4.3.24 → 5.0.0-beta.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/android/.gradle/7.4/checksums/checksums.lock +0 -0
- package/android/.gradle/7.4/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.4/gc.properties +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.settings/org.eclipse.buildship.core.prefs +2 -0
- package/android/src/main/AndroidManifest.xml +0 -6
- package/android/src/main/java/com/reactnativecometchatuikit/FileManager.java +171 -27
- package/android/src/main/java/com/reactnativecometchatuikit/SoundPlayer.java +31 -15
- package/ios/CometchatUiKit.mm +25 -25
- package/ios/FileManager.m +108 -4
- package/ios/SoundPlayer.m +32 -5
- package/package.json +13 -29
- package/react-native-cometchat-ui-kit.podspec +6 -6
- package/src/CometChatConversations/CometChatConversations.tsx +1376 -1263
- package/src/CometChatConversations/Skeleton.tsx +143 -0
- package/src/CometChatConversations/index.ts +7 -21
- package/src/CometChatConversations/resources/index.ts +22 -36
- package/src/CometChatConversations/style.ts +237 -62
- package/src/CometChatGroupMembers/CometChatGroupMembers.tsx +844 -683
- package/src/CometChatGroupMembers/Skeleton.tsx +197 -0
- package/src/CometChatGroupMembers/index.ts +2 -8
- package/src/CometChatGroupMembers/resources/index.ts +3 -14
- package/src/CometChatGroupMembers/style.ts +532 -22
- package/src/CometChatGroups/CometChatGroups.tsx +417 -562
- package/src/CometChatGroups/GroupsStyle.ts +176 -109
- package/src/CometChatGroups/Skeleton.tsx +328 -0
- package/src/CometChatGroups/index.ts +3 -11
- package/src/CometChatGroups/resources/index.ts +17 -24
- package/src/CometChatGroups/style.ts +15 -16
- package/src/CometChatMessageComposer/CometChatMessageComposer.tsx +586 -1045
- package/src/CometChatMessageComposer/index.ts +4 -8
- package/src/CometChatMessageComposer/resources/index.ts +21 -31
- package/src/CometChatMessageComposer/styles.tsx +152 -0
- package/src/CometChatMessageHeader/CometChatMessageHeader.tsx +315 -422
- package/src/CometChatMessageHeader/index.ts +3 -15
- package/src/CometChatMessageHeader/listners.ts +50 -26
- package/src/CometChatMessageHeader/styles.ts +57 -10
- package/src/CometChatMessageInformation/CometChatMessageInformation.tsx +350 -295
- package/src/CometChatMessageInformation/Skeleton.tsx +143 -0
- package/src/CometChatMessageInformation/index.ts +5 -9
- package/src/CometChatMessageInformation/resources/index.ts +1 -4
- package/src/CometChatMessageInformation/styles.ts +147 -16
- package/src/CometChatMessageList/CometChatMessageList.tsx +2344 -2080
- package/src/CometChatMessageList/Skeleton.tsx +98 -0
- package/src/CometChatMessageList/index.ts +5 -12
- package/src/CometChatMessageList/resources/index.ts +13 -20
- package/src/CometChatMessageList/style.ts +989 -51
- package/src/CometChatThreadHeader/CometChatThreadHeader.tsx +208 -0
- package/src/CometChatThreadHeader/Header.tsx +47 -0
- package/src/CometChatThreadHeader/index.ts +8 -0
- package/src/CometChatThreadHeader/resources/index.ts +14 -0
- package/src/CometChatThreadHeader/style.ts +70 -0
- package/src/CometChatUsers/CometChatUsers.tsx +276 -114
- package/src/CometChatUsers/Skeleton.tsx +195 -0
- package/src/CometChatUsers/index.ts +3 -11
- package/src/CometChatUsers/style.ts +181 -0
- package/src/calls/CallEvents.ts +9 -9
- package/src/calls/CallUtils.ts +102 -31
- package/src/calls/CallingConfiguration.ts +22 -4
- package/src/calls/CallingExtension.tsx +43 -40
- package/src/calls/CallingExtensionDecorator.tsx +416 -0
- package/src/calls/CallingPackage.ts +11 -12
- package/src/calls/CometChatCallBubble/CometChatCallBubble.tsx +121 -52
- package/src/calls/CometChatCallBubble/index.ts +8 -13
- package/src/calls/CometChatCallBubble/resources/index.ts +1 -8
- package/src/calls/CometChatCallBubble/styles.ts +155 -22
- package/src/calls/CometChatCallButtons/CometChatCallButtonConfiguration.ts +17 -36
- package/src/calls/CometChatCallButtons/CometChatCallButtons.tsx +319 -323
- package/src/calls/CometChatCallButtons/index.ts +9 -11
- package/src/calls/CometChatCallButtons/style.ts +34 -12
- package/src/calls/CometChatCallLogs/CometChatCallLogs.tsx +429 -377
- package/src/calls/CometChatCallLogs/Skeleton.tsx +143 -0
- package/src/calls/CometChatCallLogs/index.ts +4 -15
- package/src/calls/CometChatCallLogs/resources/index.ts +20 -31
- package/src/calls/CometChatCallLogs/style.ts +169 -22
- package/src/calls/CometChatIncomingCall/CometChatIncomingCall.tsx +279 -217
- package/src/calls/CometChatIncomingCall/index.ts +7 -9
- package/src/calls/CometChatIncomingCall/resources/index.ts +3 -12
- package/src/calls/CometChatIncomingCall/style.ts +75 -0
- package/src/calls/CometChatOngoingCall/CometChatOngoingCall.tsx +74 -56
- package/src/calls/CometChatOngoingCall/index.ts +3 -7
- package/src/calls/CometChatOutgoingCall/CometChatOutgoingCall.tsx +207 -171
- package/src/calls/CometChatOutgoingCall/OutgoingCallConfiguration.ts +31 -31
- package/src/calls/CometChatOutgoingCall/index.ts +5 -11
- package/src/calls/CometChatOutgoingCall/resources/index.ts +1 -4
- package/src/calls/CometChatOutgoingCall/styles.ts +58 -0
- package/src/calls/index.ts +14 -88
- package/src/calls/resources/index.ts +1 -8
- package/src/extensions/CollaborativeBubble/CometChatCollaborativeBubble.tsx +72 -96
- package/src/extensions/CollaborativeBubble/resources/index.ts +2 -4
- package/src/extensions/CollaborativeBubble/style.ts +112 -0
- package/src/extensions/CollaborativeDocument/CollaborativeDocumentExtension.tsx +21 -35
- package/src/extensions/CollaborativeDocument/CollaborativeDocumentExtensionDecorator.tsx +220 -189
- package/src/extensions/CollaborativeDocument/index.ts +2 -8
- package/src/extensions/CollaborativeDocument/resources/index.ts +4 -6
- package/src/extensions/CollaborativeWhiteboard/CollaborativeWhiteboardExtension.tsx +25 -35
- package/src/extensions/CollaborativeWhiteboard/CollaborativeWhiteboardExtensionDecorator.tsx +298 -199
- package/src/extensions/CollaborativeWhiteboard/index.ts +2 -8
- package/src/extensions/CollaborativeWhiteboard/resources/index.ts +4 -6
- package/src/extensions/ExtensionConstants.tsx +3 -4
- package/src/extensions/ExtensionModerator.tsx +47 -47
- package/src/extensions/LinkPreview/LinkPreviewBubble.tsx +187 -116
- package/src/extensions/LinkPreview/LinkPreviewExtension.tsx +22 -0
- package/src/extensions/LinkPreview/LinkPreviewExtensionDecorator.tsx +94 -0
- package/src/extensions/LinkPreview/index.ts +6 -16
- package/src/extensions/LinkPreview/resources/index.ts +1 -4
- package/src/extensions/LinkPreview/style.ts +100 -0
- package/src/extensions/MessageTranslation/MessageTranslationBubble.tsx +112 -116
- package/src/extensions/MessageTranslation/MessageTranslationDecorator.tsx +235 -152
- package/src/extensions/MessageTranslation/MessageTranslationExtension.tsx +7 -25
- package/src/extensions/MessageTranslation/index.ts +3 -5
- package/src/extensions/MessageTranslation/resources/index.ts +2 -3
- package/src/extensions/Polls/Header.tsx +56 -21
- package/src/extensions/Polls/Polls.tsx +368 -332
- package/src/extensions/Polls/PollsBubble.tsx +250 -205
- package/src/extensions/Polls/PollsConfigurations.ts +0 -9
- package/src/extensions/Polls/PollsDecorator.tsx +148 -77
- package/src/extensions/Polls/PollsExtension.tsx +5 -12
- package/src/extensions/Polls/index.ts +6 -8
- package/src/extensions/Polls/resources/index.ts +6 -12
- package/src/extensions/Polls/style.ts +185 -1
- package/src/extensions/Stickers/CometChatStickerKeyboard/CometChatStickerKeyboard.tsx +249 -115
- package/src/extensions/Stickers/CometChatStickerKeyboard/Skeleton.tsx +167 -0
- package/src/extensions/Stickers/CometChatStickerKeyboard/StickerKeyboardConfiguration.ts +2 -6
- package/src/extensions/Stickers/CometChatStickerKeyboard/hooks.ts +58 -64
- package/src/extensions/Stickers/CometChatStickerKeyboard/index.ts +2 -3
- package/src/extensions/Stickers/CometChatStickerKeyboard/style.ts +67 -41
- package/src/extensions/Stickers/StickerConfiguration.ts +5 -9
- package/src/extensions/Stickers/StickersBubble.tsx +22 -46
- package/src/extensions/Stickers/StickersExtension.ts +5 -6
- package/src/extensions/Stickers/StickersExtensionDecorator.tsx +290 -104
- package/src/extensions/Stickers/index.ts +7 -9
- package/src/extensions/Stickers/resources/index.ts +1 -4
- package/src/extensions/Stickers/style.ts +53 -0
- package/src/extensions/ThumbnailGeneration/ThumbnailGenerationDecorator.tsx +83 -64
- package/src/extensions/ThumbnailGeneration/ThumbnailGenerationExtension.tsx +5 -25
- package/src/extensions/ThumbnailGeneration/index.ts +1 -3
- package/src/extensions/ThumbnailGeneration/resources/index.ts +1 -4
- package/src/extensions/index.ts +11 -50
- package/src/index.ts +193 -670
- package/src/shared/CometChatUiKit/CometChatUIKit.ts +342 -486
- package/src/shared/CometChatUiKit/CometChatUIKitHelper.ts +147 -117
- package/src/shared/CometChatUiKit/UIKitSettings.ts +38 -38
- package/src/shared/CometChatUiKit/index.ts +2 -6
- package/src/shared/assets/images/index.ts +13 -29
- package/src/shared/base/BaseStyle.ts +9 -8
- package/src/shared/base/BorderStyle.ts +4 -4
- package/src/shared/base/FontStyle.ts +25 -3
- package/src/shared/base/ShadowStyle.ts +1 -1
- package/src/shared/base/Types.ts +15 -26
- package/src/shared/base/index.ts +7 -25
- package/src/shared/base/vars.ts +5 -5
- package/src/shared/constants/UIKitConstants.ts +322 -294
- package/src/shared/events/CometChatMessageEvents/index.ts +83 -87
- package/src/shared/events/CometChatUIEventHandler/CometChatUIEventHandler.ts +260 -238
- package/src/shared/events/CometChatUIEventHandler/Listener.ts +412 -377
- package/src/shared/events/CometChatUIEvents.ts +15 -16
- package/src/shared/events/ListenerInitializer.ts +79 -80
- package/src/shared/events/conversations.ts +2 -2
- package/src/shared/events/groups.ts +8 -8
- package/src/shared/events/index.ts +6 -6
- package/src/shared/events/messages.ts +26 -29
- package/src/shared/formatters/CometChatMentionsFormatter/CometChatMentionsFormatter.tsx +191 -121
- package/src/shared/formatters/CometChatMentionsFormatter/MentionTextStyle.ts +3 -3
- package/src/shared/formatters/CometChatMentionsFormatter/index.ts +3 -6
- package/src/shared/formatters/CometChatTextFormatter.ts +15 -14
- package/src/shared/formatters/CometChatUrlsFormatter/index.tsx +127 -131
- package/src/shared/formatters/index.ts +7 -8
- package/src/shared/framework/ChatConfigurator.ts +3 -4
- package/src/shared/framework/DataSource.ts +181 -92
- package/src/shared/framework/DataSourceDecorator.tsx +307 -233
- package/src/shared/framework/ExtensionsDataSource.tsx +8 -11
- package/src/shared/framework/MessageDataSource.tsx +1364 -867
- package/src/shared/framework/index.ts +8 -6
- package/src/shared/framework/resources/index.ts +37 -57
- package/src/shared/helper/Toast.tsx +20 -18
- package/src/shared/helper/dateHelper.ts +138 -0
- package/src/shared/helper/functions.js +1 -1
- package/src/shared/helper/helperFunctions.ts +71 -19
- package/src/shared/helper/types/index.ts +49 -15
- package/src/shared/helper/useKeyboard.tsx +12 -23
- package/src/shared/icons/Icon.tsx +73 -0
- package/src/shared/icons/components/ListItemCheck.tsx +18 -0
- package/src/shared/icons/components/StickerBase-icon.tsx +16 -0
- package/src/shared/icons/components/account-circle-fill.tsx +26 -0
- package/src/shared/icons/components/account-circle.tsx +11 -0
- package/src/shared/icons/components/activity.tsx +20 -0
- package/src/shared/icons/components/add-a-photo-fill.tsx +26 -0
- package/src/shared/icons/components/add-a-photo.tsx +11 -0
- package/src/shared/icons/components/add-box-fill.tsx +26 -0
- package/src/shared/icons/components/add-box.tsx +11 -0
- package/src/shared/icons/components/add-call-fill.tsx +26 -0
- package/src/shared/icons/components/add-call.tsx +11 -0
- package/src/shared/icons/components/add-circle-fill.tsx +11 -0
- package/src/shared/icons/components/add-circle.tsx +11 -0
- package/src/shared/icons/components/add-comment-fill.tsx +26 -0
- package/src/shared/icons/components/add-comment.tsx +11 -0
- package/src/shared/icons/components/add-fill.tsx +26 -0
- package/src/shared/icons/components/add-reaction-fill.tsx +26 -0
- package/src/shared/icons/components/add-reaction.tsx +11 -0
- package/src/shared/icons/components/add.tsx +11 -0
- package/src/shared/icons/components/ai-conversation-summary-fill.tsx +13 -0
- package/src/shared/icons/components/ai-conversation-summary.tsx +13 -0
- package/src/shared/icons/components/ai-fill.tsx +11 -0
- package/src/shared/icons/components/ai-suggest-reply-fill.tsx +13 -0
- package/src/shared/icons/components/ai-suggest-reply.tsx +20 -0
- package/src/shared/icons/components/ai.tsx +12 -0
- package/src/shared/icons/components/alternate-email-fill.tsx +26 -0
- package/src/shared/icons/components/alternate-email.tsx +11 -0
- package/src/shared/icons/components/animals-&-nature.tsx +18 -0
- package/src/shared/icons/components/archive-fill.tsx +26 -0
- package/src/shared/icons/components/archive.tsx +11 -0
- package/src/shared/icons/components/arrow-back-fill.tsx +26 -0
- package/src/shared/icons/components/arrow-back.tsx +11 -0
- package/src/shared/icons/components/arrow-forward-fill.tsx +26 -0
- package/src/shared/icons/components/arrow-forward.tsx +11 -0
- package/src/shared/icons/components/attach-file-fill.tsx +26 -0
- package/src/shared/icons/components/attach-file.tsx +11 -0
- package/src/shared/icons/components/audio-file-type.tsx +36 -0
- package/src/shared/icons/components/bar-chart-fill.tsx +11 -0
- package/src/shared/icons/components/bar-chart.tsx +11 -0
- package/src/shared/icons/components/base-icon.tsx +16 -0
- package/src/shared/icons/components/bedtime-fill.tsx +26 -0
- package/src/shared/icons/components/bedtime.tsx +11 -0
- package/src/shared/icons/components/block-fill.tsx +26 -0
- package/src/shared/icons/components/block.tsx +11 -0
- package/src/shared/icons/components/bookmark-add-fill.tsx +26 -0
- package/src/shared/icons/components/bookmark-add.tsx +11 -0
- package/src/shared/icons/components/bookmark-fill.tsx +26 -0
- package/src/shared/icons/components/bookmark.tsx +11 -0
- package/src/shared/icons/components/calendar-add-on-fill.tsx +26 -0
- package/src/shared/icons/components/calendar-add-on.tsx +11 -0
- package/src/shared/icons/components/calendar-today-fill.tsx +26 -0
- package/src/shared/icons/components/calendar-today.tsx +11 -0
- package/src/shared/icons/components/call-end-fill.tsx +26 -0
- package/src/shared/icons/components/call-end.tsx +11 -0
- package/src/shared/icons/components/call-fill.tsx +26 -0
- package/src/shared/icons/components/call-log-fill.tsx +26 -0
- package/src/shared/icons/components/call-log.tsx +11 -0
- package/src/shared/icons/components/call-made-fill.tsx +26 -0
- package/src/shared/icons/components/call-made.tsx +11 -0
- package/src/shared/icons/components/call-missed-fill.tsx +26 -0
- package/src/shared/icons/components/call-missed-outgoing-fill.tsx +26 -0
- package/src/shared/icons/components/call-missed-outgoing.tsx +11 -0
- package/src/shared/icons/components/call-missed.tsx +11 -0
- package/src/shared/icons/components/call-received-fill.tsx +26 -0
- package/src/shared/icons/components/call-received.tsx +11 -0
- package/src/shared/icons/components/call.tsx +11 -0
- package/src/shared/icons/components/cancel-fill.tsx +26 -0
- package/src/shared/icons/components/cancel.tsx +11 -0
- package/src/shared/icons/components/change-circle-fill.tsx +11 -0
- package/src/shared/icons/components/change-circle.tsx +11 -0
- package/src/shared/icons/components/chat-bot-fill.tsx +13 -0
- package/src/shared/icons/components/chat-bot.tsx +17 -0
- package/src/shared/icons/components/chat-fill.tsx +26 -0
- package/src/shared/icons/components/chat.tsx +11 -0
- package/src/shared/icons/components/check-circle-fill.tsx +11 -0
- package/src/shared/icons/components/check-circle.tsx +11 -0
- package/src/shared/icons/components/check-fill.tsx +26 -0
- package/src/shared/icons/components/check.tsx +11 -0
- package/src/shared/icons/components/chevron-left-fill.tsx +26 -0
- package/src/shared/icons/components/chevron-left.tsx +11 -0
- package/src/shared/icons/components/chevron-right-fill.tsx +26 -0
- package/src/shared/icons/components/chevron-right.tsx +11 -0
- package/src/shared/icons/components/close-fill.tsx +26 -0
- package/src/shared/icons/components/close.tsx +11 -0
- package/src/shared/icons/components/collaborative-document-fill.tsx +17 -0
- package/src/shared/icons/components/collaborative-document-icon.tsx +11 -0
- package/src/shared/icons/components/collaborative-document.tsx +13 -0
- package/src/shared/icons/components/collaborative-whiteboard-fill.tsx +15 -0
- package/src/shared/icons/components/collaborative-whiteboard-icon.tsx +15 -0
- package/src/shared/icons/components/collaborative-whiteboard.tsx +12 -0
- package/src/shared/icons/components/content-copy-fill.tsx +26 -0
- package/src/shared/icons/components/content-copy.tsx +11 -0
- package/src/shared/icons/components/crop-fill.tsx +26 -0
- package/src/shared/icons/components/crop.tsx +11 -0
- package/src/shared/icons/components/delete-fill.tsx +26 -0
- package/src/shared/icons/components/delete.tsx +11 -0
- package/src/shared/icons/components/description-fill.tsx +26 -0
- package/src/shared/icons/components/description.tsx +11 -0
- package/src/shared/icons/components/document-file-type.tsx +38 -0
- package/src/shared/icons/components/done-all-fill.tsx +26 -0
- package/src/shared/icons/components/done-all.tsx +11 -0
- package/src/shared/icons/components/download-fill.tsx +26 -0
- package/src/shared/icons/components/download.tsx +11 -0
- package/src/shared/icons/components/edit-calendar-fill.tsx +26 -0
- package/src/shared/icons/components/edit-calendar.tsx +11 -0
- package/src/shared/icons/components/edit-fill.tsx +26 -0
- package/src/shared/icons/components/edit-square-fill.tsx +11 -0
- package/src/shared/icons/components/edit-square.tsx +11 -0
- package/src/shared/icons/components/edit.tsx +11 -0
- package/src/shared/icons/components/empty-state.tsx +82 -0
- package/src/shared/icons/components/error-fill.tsx +34 -0
- package/src/shared/icons/components/error-state.tsx +92 -0
- package/src/shared/icons/components/error.tsx +11 -0
- package/src/shared/icons/components/event-available-fill.tsx +11 -0
- package/src/shared/icons/components/event-available.tsx +11 -0
- package/src/shared/icons/components/event-fill.tsx +26 -0
- package/src/shared/icons/components/event.tsx +11 -0
- package/src/shared/icons/components/favorite-fill.tsx +26 -0
- package/src/shared/icons/components/favorite.tsx +11 -0
- package/src/shared/icons/components/filter-list-fill.tsx +26 -0
- package/src/shared/icons/components/filter-list-off-fill.tsx +26 -0
- package/src/shared/icons/components/filter-list-off.tsx +11 -0
- package/src/shared/icons/components/filter-list.tsx +11 -0
- package/src/shared/icons/components/flags.tsx +13 -0
- package/src/shared/icons/components/flip-camera-ios-fill.tsx +26 -0
- package/src/shared/icons/components/flip-camera-ios.tsx +11 -0
- package/src/shared/icons/components/food-&-drink.tsx +18 -0
- package/src/shared/icons/components/forward-fill.tsx +26 -0
- package/src/shared/icons/components/forward.tsx +11 -0
- package/src/shared/icons/components/gif-fill.tsx +13 -0
- package/src/shared/icons/components/gif.tsx +12 -0
- package/src/shared/icons/components/graphic-eq-fill.tsx +11 -0
- package/src/shared/icons/components/graphic-eq.tsx +11 -0
- package/src/shared/icons/components/group-add.tsx +11 -0
- package/src/shared/icons/components/group-fill.tsx +26 -0
- package/src/shared/icons/components/group.tsx +11 -0
- package/src/shared/icons/components/help-fill.tsx +26 -0
- package/src/shared/icons/components/help.tsx +11 -0
- package/src/shared/icons/components/history-fill.tsx +26 -0
- package/src/shared/icons/components/history.tsx +11 -0
- package/src/shared/icons/components/image-file-type.tsx +35 -0
- package/src/shared/icons/components/incoming-audio-fill.tsx +11 -0
- package/src/shared/icons/components/incoming-audio.tsx +13 -0
- package/src/shared/icons/components/incoming-video-fill.tsx +28 -0
- package/src/shared/icons/components/incoming-video.tsx +15 -0
- package/src/shared/icons/components/info-fill.tsx +26 -0
- package/src/shared/icons/components/info.tsx +11 -0
- package/src/shared/icons/components/keep-fill.tsx +26 -0
- package/src/shared/icons/components/keep-off-fill.tsx +26 -0
- package/src/shared/icons/components/keep-off.tsx +11 -0
- package/src/shared/icons/components/keep.tsx +11 -0
- package/src/shared/icons/components/keyboard-arrow-down-fill.tsx +26 -0
- package/src/shared/icons/components/keyboard-arrow-down.tsx +11 -0
- package/src/shared/icons/components/keyboard-arrow-up-fill.tsx +26 -0
- package/src/shared/icons/components/keyboard-arrow-up.tsx +11 -0
- package/src/shared/icons/components/keyboard-fill.tsx +26 -0
- package/src/shared/icons/components/keyboard.tsx +11 -0
- package/src/shared/icons/components/language-fill.tsx +26 -0
- package/src/shared/icons/components/language.tsx +11 -0
- package/src/shared/icons/components/link-fill.tsx +26 -0
- package/src/shared/icons/components/link.tsx +11 -0
- package/src/shared/icons/components/loading-fill.tsx +12 -0
- package/src/shared/icons/components/loading.tsx +12 -0
- package/src/shared/icons/components/location-on-fill.tsx +26 -0
- package/src/shared/icons/components/location-on.tsx +11 -0
- package/src/shared/icons/components/lock-fill.tsx +26 -0
- package/src/shared/icons/components/lock-open-fill.tsx +26 -0
- package/src/shared/icons/components/lock-open.tsx +11 -0
- package/src/shared/icons/components/lock.tsx +11 -0
- package/src/shared/icons/components/logout-fill.tsx +11 -0
- package/src/shared/icons/components/logout.tsx +11 -0
- package/src/shared/icons/components/mail-fill.tsx +26 -0
- package/src/shared/icons/components/mail.tsx +11 -0
- package/src/shared/icons/components/mic-fill.tsx +26 -0
- package/src/shared/icons/components/mic-off-fill.tsx +26 -0
- package/src/shared/icons/components/mic-off.tsx +11 -0
- package/src/shared/icons/components/mic.tsx +11 -0
- package/src/shared/icons/components/missed-video-call-fill.tsx +26 -0
- package/src/shared/icons/components/missed-video-call.tsx +11 -0
- package/src/shared/icons/components/mood-fill.tsx +26 -0
- package/src/shared/icons/components/mood.tsx +11 -0
- package/src/shared/icons/components/more-vert-fill.tsx +26 -0
- package/src/shared/icons/components/more-vert.tsx +11 -0
- package/src/shared/icons/components/near-me-fill.tsx +11 -0
- package/src/shared/icons/components/near-me.tsx +11 -0
- package/src/shared/icons/components/no-photography-fill.tsx +26 -0
- package/src/shared/icons/components/no-photography.tsx +11 -0
- package/src/shared/icons/components/notifications-fill.tsx +26 -0
- package/src/shared/icons/components/notifications-off-fill.tsx +26 -0
- package/src/shared/icons/components/notifications-off.tsx +11 -0
- package/src/shared/icons/components/notifications.tsx +11 -0
- package/src/shared/icons/components/objects.tsx +20 -0
- package/src/shared/icons/components/outgoing-audio-fill.tsx +15 -0
- package/src/shared/icons/components/outgoing-audio.tsx +15 -0
- package/src/shared/icons/components/outgoing-video-fill.tsx +28 -0
- package/src/shared/icons/components/outgoing-video.tsx +15 -0
- package/src/shared/icons/components/pause-fill.tsx +26 -0
- package/src/shared/icons/components/pause.tsx +11 -0
- package/src/shared/icons/components/pdf-file-type.tsx +36 -0
- package/src/shared/icons/components/person-add-fill.tsx +26 -0
- package/src/shared/icons/components/person-add.tsx +11 -0
- package/src/shared/icons/components/person-fill.tsx +26 -0
- package/src/shared/icons/components/person-off.tsx +16 -0
- package/src/shared/icons/components/person.tsx +11 -0
- package/src/shared/icons/components/phone-in-talk-fill.tsx +26 -0
- package/src/shared/icons/components/phone-in-talk.tsx +11 -0
- package/src/shared/icons/components/phone-incoming-fill.tsx +11 -0
- package/src/shared/icons/components/phone-incoming.tsx +11 -0
- package/src/shared/icons/components/phone-missed-fill.tsx +26 -0
- package/src/shared/icons/components/phone-missed.tsx +11 -0
- package/src/shared/icons/components/phone-outgoing-fill.tsx +15 -0
- package/src/shared/icons/components/phone-outgoing.tsx +15 -0
- package/src/shared/icons/components/photo-camera-fill.tsx +26 -0
- package/src/shared/icons/components/photo-camera.tsx +11 -0
- package/src/shared/icons/components/photo-fill.tsx +26 -0
- package/src/shared/icons/components/photo.tsx +11 -0
- package/src/shared/icons/components/play-arrow-fill.tsx +26 -0
- package/src/shared/icons/components/play-arrow.tsx +11 -0
- package/src/shared/icons/components/play-circle-fill.tsx +26 -0
- package/src/shared/icons/components/play-circle.tsx +11 -0
- package/src/shared/icons/components/poll-Icon.tsx +10 -0
- package/src/shared/icons/components/poll-fill.tsx +11 -0
- package/src/shared/icons/components/poll.tsx +11 -0
- package/src/shared/icons/components/presentation-file-type.tsx +38 -0
- package/src/shared/icons/components/rearrange-fill.tsx +13 -0
- package/src/shared/icons/components/rearrange.tsx +13 -0
- package/src/shared/icons/components/refresh-fill.tsx +26 -0
- package/src/shared/icons/components/refresh.tsx +11 -0
- package/src/shared/icons/components/reply-all-fill.tsx +26 -0
- package/src/shared/icons/components/reply-all.tsx +11 -0
- package/src/shared/icons/components/reply-fill.tsx +26 -0
- package/src/shared/icons/components/reply.tsx +11 -0
- package/src/shared/icons/components/retry-fill.tsx +11 -0
- package/src/shared/icons/components/retry.tsx +11 -0
- package/src/shared/icons/components/schedule-fill.tsx +26 -0
- package/src/shared/icons/components/schedule.tsx +11 -0
- package/src/shared/icons/components/screen-share-fill.tsx +26 -0
- package/src/shared/icons/components/screen-share.tsx +11 -0
- package/src/shared/icons/components/search-fill.tsx +26 -0
- package/src/shared/icons/components/search.tsx +11 -0
- package/src/shared/icons/components/send-fill.tsx +26 -0
- package/src/shared/icons/components/send.tsx +11 -0
- package/src/shared/icons/components/settings-fill.tsx +26 -0
- package/src/shared/icons/components/settings.tsx +11 -0
- package/src/shared/icons/components/share-fill.tsx +26 -0
- package/src/shared/icons/components/share.tsx +11 -0
- package/src/shared/icons/components/shield-fill.tsx +11 -0
- package/src/shared/icons/components/shield.tsx +11 -0
- package/src/shared/icons/components/smileys-&-people.tsx +18 -0
- package/src/shared/icons/components/spreadsheet-file-type.tsx +38 -0
- package/src/shared/icons/components/star-fill.tsx +26 -0
- package/src/shared/icons/components/star.tsx +11 -0
- package/src/shared/icons/components/sticker-fill.tsx +12 -0
- package/src/shared/icons/components/sticker.tsx +11 -0
- package/src/shared/icons/components/stop-circle-fill.tsx +26 -0
- package/src/shared/icons/components/stop-circle.tsx +11 -0
- package/src/shared/icons/components/stop-fill.tsx +26 -0
- package/src/shared/icons/components/stop-screen-share-fill.tsx +26 -0
- package/src/shared/icons/components/stop-screen-share.tsx +11 -0
- package/src/shared/icons/components/stop.tsx +11 -0
- package/src/shared/icons/components/subdirectory-arrow-left-fill.tsx +26 -0
- package/src/shared/icons/components/subdirectory-arrow-left.tsx +11 -0
- package/src/shared/icons/components/subdirectory-arrow-right-fill.tsx +26 -0
- package/src/shared/icons/components/subdirectory-arrow-right.tsx +11 -0
- package/src/shared/icons/components/sunny-fill.tsx +26 -0
- package/src/shared/icons/components/sunny.tsx +11 -0
- package/src/shared/icons/components/symbols.tsx +15 -0
- package/src/shared/icons/components/text-file-type.tsx +35 -0
- package/src/shared/icons/components/thumb-down-fill.tsx +26 -0
- package/src/shared/icons/components/thumb-down.tsx +11 -0
- package/src/shared/icons/components/thumb-up-fill.tsx +26 -0
- package/src/shared/icons/components/thumb-up.tsx +11 -0
- package/src/shared/icons/components/translate-fill.tsx +11 -0
- package/src/shared/icons/components/translate.tsx +11 -0
- package/src/shared/icons/components/travel-&-places.tsx +18 -0
- package/src/shared/icons/components/unknown-file-type.tsx +38 -0
- package/src/shared/icons/components/upload-fill.tsx +11 -0
- package/src/shared/icons/components/upload.tsx +11 -0
- package/src/shared/icons/components/user-empty-icon.tsx +26 -0
- package/src/shared/icons/components/video-call-fill.tsx +26 -0
- package/src/shared/icons/components/video-call.tsx +11 -0
- package/src/shared/icons/components/video-file-type.tsx +38 -0
- package/src/shared/icons/components/videocam-fill.tsx +26 -0
- package/src/shared/icons/components/videocam-off-fill.tsx +26 -0
- package/src/shared/icons/components/videocam-off.tsx +11 -0
- package/src/shared/icons/components/videocam.tsx +11 -0
- package/src/shared/icons/components/visibility-off-fill.tsx +11 -0
- package/src/shared/icons/components/visibility-off.tsx +11 -0
- package/src/shared/icons/components/volume-down-fill.tsx +26 -0
- package/src/shared/icons/components/volume-down.tsx +11 -0
- package/src/shared/icons/components/volume-mute-fill.tsx +26 -0
- package/src/shared/icons/components/volume-mute.tsx +11 -0
- package/src/shared/icons/components/volume-off-fill.tsx +26 -0
- package/src/shared/icons/components/volume-off.tsx +11 -0
- package/src/shared/icons/components/volume-up-fill.tsx +26 -0
- package/src/shared/icons/components/volume-up.tsx +11 -0
- package/src/shared/icons/components/warning-fill.tsx +26 -0
- package/src/shared/icons/components/warning.tsx +11 -0
- package/src/shared/icons/components/wifi-fill.tsx +26 -0
- package/src/shared/icons/components/wifi.tsx +11 -0
- package/src/shared/icons/components/zip-file-type.tsx +38 -0
- package/src/shared/icons/components/zoom-in-map-fill.tsx +26 -0
- package/src/shared/icons/components/zoom-in-map.tsx +11 -0
- package/src/shared/icons/components/zoom-out-map-fill.tsx +26 -0
- package/src/shared/icons/components/zoom-out-map.tsx +11 -0
- package/src/shared/icons/icon-mapping.tsx +620 -0
- package/src/shared/index.ts +114 -333
- package/src/shared/libs/ImageZoom/ReactNativeZoomableView.tsx +0 -1
- package/src/shared/libs/ImageZoom/ReactNativeZoomableViewWithGestures.tsx +19 -26
- package/src/shared/libs/ImageZoom/helper.ts +11 -27
- package/src/shared/libs/ImageZoom/index.tsx +4 -7
- package/src/shared/libs/ImageZoom/types/index.ts +7 -17
- package/src/shared/libs/VideoPlayer/VideoResizeMode.js +1 -1
- package/src/shared/modals/CometChatMessageOption.ts +11 -8
- package/src/shared/modals/CometChatMessageTemplate.ts +180 -140
- package/src/shared/modals/index.ts +2 -57
- package/src/shared/resources/CometChatLocalize/CometChatLocalize.ts +153 -152
- package/src/shared/resources/CometChatLocalize/index.ts +2 -8
- package/src/shared/resources/CometChatLocalize/resources/ar/translation.json +445 -315
- package/src/shared/resources/CometChatLocalize/resources/de/translation.json +445 -316
- package/src/shared/resources/CometChatLocalize/resources/en/translation.json +445 -315
- package/src/shared/resources/CometChatLocalize/resources/es/translation.json +445 -316
- package/src/shared/resources/CometChatLocalize/resources/fr/translation.json +444 -316
- package/src/shared/resources/CometChatLocalize/resources/hi/translation.json +445 -315
- package/src/shared/resources/CometChatLocalize/resources/hu/translation.json +444 -315
- package/src/shared/resources/CometChatLocalize/resources/lt/translation.json +445 -316
- package/src/shared/resources/CometChatLocalize/resources/ms/translation.json +445 -316
- package/src/shared/resources/CometChatLocalize/resources/pt/translation.json +445 -316
- package/src/shared/resources/CometChatLocalize/resources/ru/translation.json +445 -316
- package/src/shared/resources/CometChatLocalize/resources/sv/translation.json +445 -316
- package/src/shared/resources/CometChatLocalize/resources/zh/translation.json +445 -316
- package/src/shared/resources/CometChatLocalize/resources/zh-tw/translation.json +444 -316
- package/src/shared/resources/CometChatSoundManager/index.ts +1 -2
- package/src/shared/resources/index.ts +1 -9
- package/src/shared/utils/CometChatMessageHelper/index.ts +16 -14
- package/src/shared/utils/CometChatMessagePreview/CometChatMessagePreview.tsx +50 -0
- package/src/shared/utils/CometChatMessagePreview/MessagePreviewStyle.js +1 -1
- package/src/shared/utils/CometChatMessagePreview/index.ts +1 -5
- package/src/shared/utils/CometChatMessagePreview/resources/index.ts +1 -4
- package/src/shared/utils/CometChatMessagePreview/style.ts +45 -0
- package/src/shared/utils/CommonUtils.ts +163 -172
- package/src/shared/utils/MessageUtils.tsx +326 -146
- package/src/shared/utils/NetworkUtils.tsx +32 -24
- package/src/shared/utils/PermissionUtil.ts +30 -30
- package/src/shared/utils/conversationUtils.ts +93 -86
- package/src/shared/utils/index.ts +4 -25
- package/src/shared/views/CometChatAICard/CometChatAICard.tsx +100 -66
- package/src/shared/views/CometChatAICard/resources/index.ts +2 -4
- package/src/shared/views/CometChatActionSheet/ActionItem.ts +12 -57
- package/src/shared/views/CometChatActionSheet/CometChatActionSheet.tsx +68 -249
- package/src/shared/views/CometChatActionSheet/hooks.ts +5 -3
- package/src/shared/views/CometChatActionSheet/index.ts +1 -4
- package/src/shared/views/CometChatActionSheet/resources/index.ts +5 -7
- package/src/shared/views/CometChatActionSheet/style.ts +2 -41
- package/src/shared/views/CometChatAudioBubble/AnimatedAudioWaves.tsx +131 -0
- package/src/shared/views/CometChatAudioBubble/CometChatAudioBubble.tsx +211 -189
- package/src/shared/views/CometChatAudioBubble/index.ts +10 -10
- package/src/shared/views/CometChatAudioBubble/resources/index.ts +2 -7
- package/src/shared/views/CometChatAudioBubble/style.ts +203 -27
- package/src/shared/views/CometChatAvatar/CometChatAvatar.tsx +26 -104
- package/src/shared/views/CometChatAvatar/index.ts +3 -9
- package/src/shared/views/CometChatAvatar/styles.ts +37 -24
- package/src/shared/views/CometChatBadge/CometChatBadge.tsx +27 -46
- package/src/shared/views/CometChatBadge/index.ts +4 -8
- package/src/shared/views/CometChatBadge/styles.ts +29 -16
- package/src/shared/views/CometChatBottomSheet/CometChatBottomSheet.tsx +133 -152
- package/src/shared/views/CometChatBottomSheet/index.ts +2 -5
- package/src/shared/views/CometChatConfirmDialog/CometChatConfirmDialog.tsx +104 -106
- package/src/shared/views/CometChatConfirmDialog/index.ts +2 -9
- package/src/shared/views/CometChatConfirmDialog/style.ts +121 -62
- package/src/shared/views/CometChatDate/CometChatDate.tsx +23 -157
- package/src/shared/views/CometChatDate/index.ts +4 -12
- package/src/shared/views/CometChatDate/styles.ts +36 -0
- package/src/shared/views/CometChatDateSeperator/CometChatDateSeparator.tsx +48 -0
- package/src/shared/views/CometChatDateSeperator/index.ts +6 -0
- package/src/shared/views/CometChatDateSeperator/styles.ts +52 -0
- package/src/shared/views/CometChatDeletedBubble/CometChatDeletedBubble.tsx +42 -0
- package/src/shared/views/CometChatDeletedBubble/index.ts +5 -0
- package/src/shared/views/CometChatDeletedBubble/styles.ts +42 -0
- package/src/shared/views/CometChatEmojiKeyboard/CometChatEmojiKeyboard.tsx +284 -205
- package/src/shared/views/CometChatEmojiKeyboard/Emoji.ts +1 -1
- package/src/shared/views/CometChatEmojiKeyboard/EmojiCategory.ts +1 -1
- package/src/shared/views/CometChatEmojiKeyboard/emojis.ts +169 -1405
- package/src/shared/views/CometChatEmojiKeyboard/index.ts +1 -3
- package/src/shared/views/CometChatEmojiKeyboard/resources/index.ts +8 -16
- package/src/shared/views/CometChatEmojiKeyboard/style.ts +72 -61
- package/src/shared/views/CometChatFileBubble/CometChatFileBubble.tsx +203 -173
- package/src/shared/views/CometChatFileBubble/index.ts +10 -6
- package/src/shared/views/CometChatFileBubble/resources/index.ts +1 -6
- package/src/shared/views/CometChatFileBubble/style.ts +120 -47
- package/src/shared/views/CometChatImageBubble/CometChatImageBubble.tsx +57 -251
- package/src/shared/views/CometChatImageBubble/CometChatImageLoader.tsx +154 -0
- package/src/shared/views/CometChatImageBubble/assets/index.ts +1 -5
- package/src/shared/views/CometChatImageBubble/index.ts +7 -9
- package/src/shared/views/CometChatImageViewerModal/ImageViewerModal.tsx +28 -43
- package/src/shared/views/CometChatImageViewerModal/index.tsx +1 -1
- package/src/shared/views/CometChatImageViewerModal/resources/index.ts +1 -2
- package/src/shared/views/CometChatList/CometChatList.tsx +669 -702
- package/src/shared/views/CometChatList/Header.tsx +185 -110
- package/src/shared/views/CometChatList/index.ts +7 -4
- package/src/shared/views/CometChatList/resources/index.ts +4 -13
- package/src/shared/views/CometChatList/styles.ts +58 -44
- package/src/shared/views/CometChatListItem/CometChatListItem.tsx +132 -258
- package/src/shared/views/CometChatListItem/index.ts +3 -15
- package/src/shared/views/CometChatListItem/style.ts +25 -29
- package/src/shared/views/CometChatMediaRecorder/AnimatingMic.tsx +129 -0
- package/src/shared/views/CometChatMediaRecorder/CometChatAudioPlayer.tsx +115 -0
- package/src/shared/views/CometChatMediaRecorder/CometChatAudioPreview/CometChatAudioPreview.tsx +233 -0
- package/src/shared/views/CometChatMediaRecorder/CometChatMediaRecorder.tsx +359 -284
- package/src/shared/views/CometChatMediaRecorder/Timer.tsx +83 -0
- package/src/shared/views/CometChatMediaRecorder/index.ts +4 -10
- package/src/shared/views/CometChatMediaRecorder/style.ts +69 -23
- package/src/shared/views/CometChatMessageBubble/CometChatMessageBubble.tsx +111 -124
- package/src/shared/views/CometChatMessageBubble/index.ts +2 -5
- package/src/shared/views/CometChatMessageInput/CometChatMessageInput.tsx +44 -85
- package/src/shared/views/CometChatMessageInput/index.ts +10 -3
- package/src/shared/views/CometChatMessageInput/styles.ts +2 -2
- package/src/shared/views/CometChatPanel/CometChatPanel.tsx +51 -45
- package/src/shared/views/CometChatPanel/PanelStyle.tsx +36 -36
- package/src/shared/views/CometChatPanel/resources/index.ts +1 -4
- package/src/shared/views/CometChatQuickReactions/CometChatQuickReactions.tsx +51 -73
- package/src/shared/views/CometChatQuickReactions/QuickReactionsStyle.tsx +33 -33
- package/src/shared/views/CometChatQuickReactions/index.ts +4 -5
- package/src/shared/views/CometChatQuickReactions/resources/index.ts +1 -2
- package/src/shared/views/CometChatReactionList/CometChatReactionList.tsx +365 -311
- package/src/shared/views/CometChatReactionList/ReactionListStyle.tsx +152 -64
- package/src/shared/views/CometChatReactionList/Skeleton.tsx +143 -0
- package/src/shared/views/CometChatReactionList/index.ts +6 -5
- package/src/shared/views/CometChatReactionList/resources/index.ts +1 -4
- package/src/shared/views/CometChatReactions/CometChatReactions.tsx +103 -171
- package/src/shared/views/CometChatReactions/index.ts +7 -14
- package/src/shared/views/CometChatReactions/style.ts +193 -41
- package/src/shared/views/CometChatReceipt/CometChatReceipt.tsx +75 -76
- package/src/shared/views/CometChatReceipt/index.ts +4 -10
- 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 +5 -10
- package/src/shared/views/CometChatReceipt/resources/sending.png +0 -0
- package/src/shared/views/CometChatReceipt/style.ts +50 -9
- package/src/shared/views/CometChatStatusIndicator/CometChatStatusIndicator.tsx +56 -59
- package/src/shared/views/CometChatStatusIndicator/index.ts +6 -22
- package/src/shared/views/CometChatStatusIndicator/private.png +0 -0
- package/src/shared/views/CometChatStatusIndicator/protected.png +0 -0
- package/src/shared/views/CometChatStatusIndicator/styles.ts +47 -15
- package/src/shared/views/CometChatSuggestionList/CometChatSuggestionList.tsx +74 -56
- package/src/shared/views/CometChatSuggestionList/Skeleton.tsx +185 -0
- package/src/shared/views/CometChatSuggestionList/SuggestionItem.ts +44 -46
- package/src/shared/views/CometChatSuggestionList/index.ts +3 -7
- package/src/shared/views/CometChatSuggestionList/style.ts +69 -0
- package/src/shared/views/CometChatTextBubble/CometChatTextBubble.tsx +46 -101
- package/src/shared/views/CometChatTextBubble/index.ts +8 -7
- package/src/shared/views/CometChatTooltipMenu/CometChatTooltipMenu.tsx +166 -0
- package/src/shared/views/CometChatTooltipMenu/index.ts +3 -0
- package/src/shared/views/CometChatTooltipMenu/styles.ts +24 -0
- package/src/shared/views/CometChatVideoBubble/CometChatVideoBubble.tsx +155 -195
- package/src/shared/views/CometChatVideoBubble/index.ts +7 -9
- package/src/shared/views/CometChatVideoBubble/resources/index.ts +2 -7
- package/src/shared/views/CometChatVideoBubble/style.ts +101 -5
- package/src/shared/views/CometChatVideoPlayer/CometChatVideoPlayer.tsx +135 -90
- package/src/shared/views/CometChatVideoPlayer/index.tsx +1 -1
- package/src/shared/views/ErrorEmptyView/ErrorEmptyView.tsx +47 -0
- package/src/shared/views/index.ts +72 -214
- package/src/theme/CometChatThemeHelper.ts +427 -0
- package/src/theme/context.ts +20 -0
- package/src/theme/default/color/dark.ts +99 -0
- package/src/theme/default/color/light.ts +105 -0
- package/src/theme/default/index.ts +242 -0
- package/src/theme/default/resources/icons/Base_Icon.png +0 -0
- package/src/theme/default/resources/icons/collaborative_document_1x.png +0 -0
- package/src/theme/default/resources/icons/collaborative_document_2x.png +0 -0
- package/src/theme/default/resources/icons/collaborative_document_3x.png +0 -0
- package/src/theme/default/resources/icons/collaborative_whiteboard_1x.png +0 -0
- package/src/theme/default/resources/icons/collaborative_whiteboard_2x.png +0 -0
- package/src/theme/default/resources/icons/collaborative_whiteboard_3x.png +0 -0
- package/src/theme/default/resources/icons/dark_error_icon.png +0 -0
- package/src/theme/default/resources/icons/index.ts +19 -0
- package/src/theme/default/resources/icons/light_error_icon.png +0 -0
- package/src/theme/default/resources/icons/thread_replies.png +0 -0
- package/src/theme/default/spacing.ts +86 -0
- package/src/theme/default/typography.ts +184 -0
- package/src/theme/hook.ts +19 -0
- package/src/theme/index.ts +3 -0
- package/src/theme/provider.tsx +135 -0
- package/src/theme/type.ts +446 -0
- package/screenshots/logo.png +0 -0
- package/src/AI/AIAssistBot/AIAssistBotDecorator.tsx +0 -166
- package/src/AI/AIAssistBot/AIAssistBotExtension.tsx +0 -22
- package/src/AI/AIAssistBot/AIAssistBotStyle.ts +0 -43
- package/src/AI/AIAssistBot/AIAssistBotView.tsx +0 -297
- package/src/AI/AIAssistBot/configuration.ts +0 -23
- package/src/AI/AIAssistBot/resources/CloseIcon.png +0 -0
- package/src/AI/AIAssistBot/resources/index.ts +0 -6
- package/src/AI/AIBaseConfiguration.ts +0 -15
- package/src/AI/AIBaseStyle.ts +0 -58
- package/src/AI/AIConversationStarter/AIConversationStarter.ts +0 -19
- package/src/AI/AIConversationStarter/AIConversationStarterDecorator.tsx +0 -249
- package/src/AI/AIConversationStarter/AIConversationStarterStyle.ts +0 -14
- package/src/AI/AIConversationStarter/configuration.ts +0 -11
- package/src/AI/AIConversationStarter/style.ts +0 -74
- package/src/AI/AIConversationSummary/AIConversationSummaryDecorator.tsx +0 -179
- package/src/AI/AIConversationSummary/AIConversationSummaryExtension.ts +0 -21
- package/src/AI/AIConversationSummary/AIConversationSummaryStyle.tsx +0 -20
- package/src/AI/AIConversationSummary/AIConversationSummaryView.tsx +0 -195
- package/src/AI/AIConversationSummary/configuration.ts +0 -14
- package/src/AI/AIConversationSummary/resources/index.ts +0 -6
- package/src/AI/AIExtensionDataSource.ts +0 -18
- package/src/AI/AIOptionsStyle.ts +0 -14
- package/src/AI/AISmartReplies/AISmartReplies.ts +0 -19
- package/src/AI/AISmartReplies/AISmartRepliesDecorator.tsx +0 -306
- package/src/AI/AISmartReplies/AISmartRepliesStyle.ts +0 -16
- package/src/AI/AISmartReplies/configuration.ts +0 -12
- package/src/AI/CardView.tsx +0 -83
- package/src/AI/CardViewStyle.ts +0 -37
- package/src/AI/resources/ai-empty.png +0 -0
- package/src/AI/resources/ai-error.png +0 -0
- package/src/AI/resources/index.ts +0 -12
- package/src/AI/resources/spineer.png +0 -0
- package/src/AI/style.ts +0 -165
- package/src/AI/utils.ts +0 -39
- package/src/CometChatAddMembers/AddMembersConfiguration.tsx +0 -58
- package/src/CometChatAddMembers/CometChatAddMembers.tsx +0 -114
- package/src/CometChatAddMembers/index.ts +0 -10
- package/src/CometChatBannedMembers/BannedMembersConfiguration.tsx +0 -61
- package/src/CometChatBannedMembers/CometChatBannedMembers.tsx +0 -148
- package/src/CometChatBannedMembers/index.ts +0 -13
- package/src/CometChatBannedMembers/resources/clear.png +0 -0
- package/src/CometChatBannedMembers/resources/index.ts +0 -4
- package/src/CometChatContacts/CometChatContacts.tsx +0 -229
- package/src/CometChatContacts/ContactsConfiguration.tsx +0 -69
- package/src/CometChatContacts/ContactsStyle.ts +0 -60
- package/src/CometChatContacts/Header.tsx +0 -167
- package/src/CometChatContacts/index.ts +0 -13
- package/src/CometChatContacts/styles.ts +0 -105
- package/src/CometChatConversations/ConversationsConfiguration.ts +0 -226
- package/src/CometChatConversations/ConversationsStyle.ts +0 -88
- package/src/CometChatConversationsWithMessages/CometChatConversationsWithMessages.tsx +0 -232
- package/src/CometChatConversationsWithMessages/index.ts +0 -6
- package/src/CometChatConversationsWithMessages/resources/index.ts +0 -6
- package/src/CometChatConversationsWithMessages/resources/start.png +0 -0
- package/src/CometChatConversationsWithMessages/styles.ts +0 -15
- package/src/CometChatCreateGroup/CometChatCreateGroup.tsx +0 -382
- package/src/CometChatCreateGroup/CreateGroupConfiguration.ts +0 -36
- package/src/CometChatCreateGroup/Header.tsx +0 -60
- package/src/CometChatCreateGroup/index.ts +0 -15
- package/src/CometChatCreateGroup/resources/close.png +0 -0
- package/src/CometChatCreateGroup/resources/index.ts +0 -11
- package/src/CometChatCreateGroup/resources/rightTick.png +0 -0
- package/src/CometChatCreateGroup/resources/warning.png +0 -0
- package/src/CometChatCreateGroup/style.ts +0 -44
- package/src/CometChatDetails/CometChatDetails.tsx +0 -983
- package/src/CometChatDetails/DetailsConfiguration.tsx +0 -72
- package/src/CometChatDetails/Header.tsx +0 -42
- package/src/CometChatDetails/index.ts +0 -19
- package/src/CometChatDetails/listners.ts +0 -109
- package/src/CometChatDetails/resources/close.png +0 -0
- package/src/CometChatDetails/resources/index.ts +0 -17
- package/src/CometChatDetails/styles.ts +0 -23
- package/src/CometChatGroupMembers/GroupMemberConfiguration.ts +0 -118
- package/src/CometChatGroupMembers/GroupMemberStyle.ts +0 -91
- package/src/CometChatGroupMembers/GroupScopeStyle.ts +0 -68
- package/src/CometChatGroups/GroupsConfiguration.ts +0 -93
- package/src/CometChatGroupsWithMessages/CometChatGroupsWithMessages.tsx +0 -234
- package/src/CometChatGroupsWithMessages/index.ts +0 -6
- package/src/CometChatGroupsWithMessages/resources/index.ts +0 -5
- package/src/CometChatGroupsWithMessages/resources/write.png +0 -0
- package/src/CometChatGroupsWithMessages/styles.ts +0 -15
- package/src/CometChatJoinProtectedGroup/CometChatJoinProtectedGroup.tsx +0 -268
- package/src/CometChatJoinProtectedGroup/Header.tsx +0 -52
- package/src/CometChatJoinProtectedGroup/JoinProtectedGroupConfiguration.ts +0 -30
- package/src/CometChatJoinProtectedGroup/index.ts +0 -15
- package/src/CometChatJoinProtectedGroup/resources/close.png +0 -0
- package/src/CometChatJoinProtectedGroup/resources/index.ts +0 -8
- package/src/CometChatJoinProtectedGroup/resources/rightTick.png +0 -0
- package/src/CometChatJoinProtectedGroup/style.ts +0 -11
- package/src/CometChatMessageComposer/MessageComposerConfiguration.tsx +0 -96
- package/src/CometChatMessageComposer/styles.ts +0 -28
- package/src/CometChatMessageHeader/MessageHeaderConfiguration.tsx +0 -62
- package/src/CometChatMessageHeader/resources/Back.png +0 -0
- package/src/CometChatMessageHeader/resources/index.ts +0 -11
- package/src/CometChatMessageHeader/resources/password.png +0 -0
- package/src/CometChatMessageHeader/resources/private.png +0 -0
- package/src/CometChatMessageInformation/MessageInformationConfiguration.tsx +0 -32
- package/src/CometChatMessageInformation/MessageInformationStyle.ts +0 -12
- package/src/CometChatMessageList/MessageListConfiguration.ts +0 -250
- package/src/CometChatMessageList/MessageListStyle.ts +0 -75
- package/src/CometChatMessages/CometChatMessages.tsx +0 -347
- package/src/CometChatMessages/MessageStyle.ts +0 -34
- package/src/CometChatMessages/MessagesConfiguration.ts +0 -55
- package/src/CometChatMessages/index.ts +0 -16
- package/src/CometChatMessages/resources/index.ts +0 -6
- package/src/CometChatMessages/resources/info.png +0 -0
- package/src/CometChatMessages/style.ts +0 -23
- package/src/CometChatTabs/CometChatTabs.tsx +0 -178
- package/src/CometChatTabs/CometChatTabsStyle.ts +0 -45
- package/src/CometChatTabs/TabItemStyle.ts +0 -55
- package/src/CometChatTabs/TabItems.ts +0 -11
- package/src/CometChatTabs/index.ts +0 -6
- package/src/CometChatThreadedMessages/CometChatThreadedMessages.tsx +0 -345
- package/src/CometChatThreadedMessages/Header.tsx +0 -57
- package/src/CometChatThreadedMessages/ThreadedMessagesConfiguration.ts +0 -45
- package/src/CometChatThreadedMessages/index.ts +0 -15
- package/src/CometChatThreadedMessages/resources/Back.png +0 -0
- package/src/CometChatThreadedMessages/resources/close.png +0 -0
- package/src/CometChatThreadedMessages/resources/index.ts +0 -20
- package/src/CometChatThreadedMessages/resources/password.png +0 -0
- package/src/CometChatThreadedMessages/resources/private.png +0 -0
- package/src/CometChatThreadedMessages/resources/right-arrow.png +0 -0
- package/src/CometChatThreadedMessages/style.ts +0 -29
- package/src/CometChatTransferOwnership/CometChatTransferOwnership.tsx +0 -145
- package/src/CometChatTransferOwnership/TransferOwnershipConfiguration.ts +0 -60
- package/src/CometChatTransferOwnership/index.ts +0 -14
- package/src/CometChatUsers/UsersConfiguration.tsx +0 -59
- package/src/CometChatUsers/UsersStyle.ts +0 -101
- package/src/CometChatUsersWithMessages/CometChatUsersWithMessages.tsx +0 -130
- package/src/CometChatUsersWithMessages/index.ts +0 -6
- package/src/CometChatUsersWithMessages/styles.ts +0 -15
- package/src/calls/CallingDetailsUtils.tsx +0 -158
- package/src/calls/CallingExtentionDecorator.tsx +0 -222
- package/src/calls/CometChatCallBubble/CallBubbleConfiguration.ts +0 -23
- package/src/calls/CometChatCallBubble/CallBubbleStyle.ts +0 -47
- package/src/calls/CometChatCallButtons/CallButtonStyle.ts +0 -35
- package/src/calls/CometChatCallButtons/resources/Call.png +0 -0
- package/src/calls/CometChatCallButtons/resources/Video.png +0 -0
- package/src/calls/CometChatCallButtons/resources/index.ts +0 -9
- package/src/calls/CometChatCallLogDetails/CallLogDetailsConfiguration.ts +0 -118
- package/src/calls/CometChatCallLogDetails/CallLogDetailsStyle.ts +0 -36
- package/src/calls/CometChatCallLogDetails/CometChatCallLogDetails.tsx +0 -309
- package/src/calls/CometChatCallLogDetails/index.ts +0 -23
- package/src/calls/CometChatCallLogDetails/resources/CloseIcon.png +0 -0
- package/src/calls/CometChatCallLogDetails/resources/index.ts +0 -5
- package/src/calls/CometChatCallLogDetails/style.ts +0 -15
- package/src/calls/CometChatCallLogHistory/CallLogHistoryConfiguration.ts +0 -67
- package/src/calls/CometChatCallLogHistory/CallLogHistoryStyle.ts +0 -46
- package/src/calls/CometChatCallLogHistory/CometChatCallLogHistory.tsx +0 -350
- package/src/calls/CometChatCallLogHistory/index.ts +0 -23
- package/src/calls/CometChatCallLogHistory/resources/Back.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/Call.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/Info.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/Selection.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/Spineer.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/Video.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/check.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/incomingcall.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/incomingvideo.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/index.ts +0 -42
- package/src/calls/CometChatCallLogHistory/resources/missedcall.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/missedvideo.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/outgoingcall.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/outgoingvideo.png +0 -0
- package/src/calls/CometChatCallLogHistory/style.ts +0 -24
- package/src/calls/CometChatCallLogParticipants/CallLogParticipantsConfiguration.ts +0 -63
- package/src/calls/CometChatCallLogParticipants/CallLogParticipantsStyle.ts +0 -59
- package/src/calls/CometChatCallLogParticipants/CometChatCallLogParticipants.tsx +0 -221
- package/src/calls/CometChatCallLogParticipants/index.ts +0 -23
- package/src/calls/CometChatCallLogParticipants/resources/Back.png +0 -0
- package/src/calls/CometChatCallLogParticipants/resources/index.ts +0 -5
- package/src/calls/CometChatCallLogParticipants/style.ts +0 -24
- package/src/calls/CometChatCallLogRecordings/CallLogRecordingsConfiguration.ts +0 -65
- package/src/calls/CometChatCallLogRecordings/CallLogRecordingsStyle.ts +0 -63
- package/src/calls/CometChatCallLogRecordings/CometChatCallLogRecordings.tsx +0 -254
- package/src/calls/CometChatCallLogRecordings/index.ts +0 -23
- package/src/calls/CometChatCallLogRecordings/resources/Back.png +0 -0
- package/src/calls/CometChatCallLogRecordings/resources/download.png +0 -0
- package/src/calls/CometChatCallLogRecordings/resources/index.ts +0 -8
- package/src/calls/CometChatCallLogRecordings/style.ts +0 -24
- package/src/calls/CometChatCallLogs/CallLogsConfiguration.ts +0 -89
- package/src/calls/CometChatCallLogs/CallLogsStyle.ts +0 -95
- package/src/calls/CometChatCallLogsWithDetails/CallLogsWithDetailsConfiguration.ts +0 -10
- package/src/calls/CometChatCallLogsWithDetails/CometChatCallLogsWithDetails.tsx +0 -56
- package/src/calls/CometChatCallLogsWithDetails/index.ts +0 -5
- package/src/calls/CometChatCallLogsWithDetails/style.ts +0 -11
- package/src/calls/CometChatIncomingCall/IncomingCallStyle.ts +0 -75
- package/src/calls/CometChatIncomingCall/styles.ts +0 -10
- package/src/calls/CometChatOngoingCall/OngoingCallStyle.ts +0 -25
- package/src/calls/CometChatOutgoingCall/OutgoingCallStyle.ts +0 -39
- package/src/extensions/CollaborativeBubble/CollaborativeBubbleStyle.ts +0 -97
- package/src/extensions/CollaborativeBubble/styles.ts +0 -82
- package/src/extensions/CollaborativeDocument/CollaborativeDocumentConfiguration.tsx +0 -26
- package/src/extensions/CollaborativeWhiteboard/CollaborativeWhiteboardConfiguration.tsx +0 -26
- package/src/extensions/ImageModeration/ImageModerationDecorator.tsx +0 -82
- package/src/extensions/ImageModeration/ImageModerationExtension.tsx +0 -43
- package/src/extensions/ImageModeration/ImageModerationFilter.tsx +0 -145
- package/src/extensions/ImageModeration/index.ts +0 -18
- package/src/extensions/ImageModeration/resources/index.ts +0 -4
- package/src/extensions/ImageModeration/resources/unsafe.png +0 -0
- package/src/extensions/LinkPreview/LInkPreviewBubbleStyle.ts +0 -28
- package/src/extensions/LinkPreview/LinkPreviewConfiguration.ts +0 -27
- package/src/extensions/LinkPreview/LinkPreviewExtention.tsx +0 -25
- package/src/extensions/LinkPreview/LinkPreviewExtentionDecorator.tsx +0 -55
- package/src/extensions/SmartReplies/SmartRepliesDecorator.tsx +0 -144
- package/src/extensions/SmartReplies/SmartRepliesExtension.tsx +0 -52
- package/src/extensions/SmartReplies/SmartRepliesView.tsx +0 -213
- package/src/extensions/SmartReplies/index.ts +0 -7
- package/src/extensions/SmartReplies/resources/close.png +0 -0
- package/src/extensions/SmartReplies/resources/index.ts +0 -6
- package/src/extensions/Stickers/CometChatStickerKeyboard/StickerKeyboardStyle.ts +0 -52
- package/src/extensions/Stickers/StickerStyle.ts +0 -15
- package/src/extensions/TextModeration/TextModerationConfiguration.tsx +0 -25
- package/src/extensions/TextModeration/TextModerationExtension.tsx +0 -51
- package/src/extensions/TextModeration/TextModerationExtensionDecorator.tsx +0 -93
- package/src/extensions/TextModeration/index.ts +0 -6
- package/src/shared/CometChatContext.tsx +0 -43
- package/src/shared/helper/SwipeRow.js +0 -944
- package/src/shared/libs/CometChatCalendar/Calendars/BaseCalendar.tsx +0 -229
- package/src/shared/libs/CometChatCalendar/Calendars/DateSelectionCalendar.tsx +0 -90
- package/src/shared/libs/CometChatCalendar/Calendars/MultiDateSelectionCalendar.tsx +0 -108
- package/src/shared/libs/CometChatCalendar/Calendars/Providers.tsx +0 -27
- package/src/shared/libs/CometChatCalendar/Calendars/index.ts +0 -3
- package/src/shared/libs/CometChatCalendar/Components/Arrow.tsx +0 -46
- package/src/shared/libs/CometChatCalendar/Components/Day.tsx +0 -95
- package/src/shared/libs/CometChatCalendar/Components/Days.tsx +0 -110
- package/src/shared/libs/CometChatCalendar/Components/Month.tsx +0 -47
- package/src/shared/libs/CometChatCalendar/Components/Months.tsx +0 -79
- package/src/shared/libs/CometChatCalendar/Components/Title.tsx +0 -47
- package/src/shared/libs/CometChatCalendar/Components/Weekdays.tsx +0 -29
- package/src/shared/libs/CometChatCalendar/Components/index.ts +0 -7
- package/src/shared/libs/CometChatCalendar/Constants/View.ts +0 -4
- package/src/shared/libs/CometChatCalendar/Constants/index.ts +0 -1
- package/src/shared/libs/CometChatCalendar/Contexts/LocaleContext.tsx +0 -7
- package/src/shared/libs/CometChatCalendar/Contexts/ThemeContext.tsx +0 -7
- package/src/shared/libs/CometChatCalendar/Contexts/index.ts +0 -2
- package/src/shared/libs/CometChatCalendar/Entities/ArrowDirections.ts +0 -1
- package/src/shared/libs/CometChatCalendar/Entities/Calendar.ts +0 -26
- package/src/shared/libs/CometChatCalendar/Entities/Components.ts +0 -13
- package/src/shared/libs/CometChatCalendar/Entities/DateProperties.ts +0 -6
- package/src/shared/libs/CometChatCalendar/Entities/Locale.ts +0 -12
- package/src/shared/libs/CometChatCalendar/Entities/Theme.ts +0 -70
- package/src/shared/libs/CometChatCalendar/Entities/index.ts +0 -6
- package/src/shared/libs/CometChatCalendar/Hooks/index.ts +0 -1
- package/src/shared/libs/CometChatCalendar/Hooks/useSurroundingTimeUnits.ts +0 -63
- package/src/shared/libs/CometChatCalendar/Icons/BackArrow.png +0 -0
- package/src/shared/libs/CometChatCalendar/Icons/chevron-left-16.png +0 -0
- package/src/shared/libs/CometChatCalendar/Icons/index.ts +0 -7
- package/src/shared/libs/CometChatCalendar/Locales/index.ts +0 -4
- package/src/shared/libs/CometChatCalendar/Themes/Colors.ts +0 -31
- package/src/shared/libs/CometChatCalendar/Themes/DarkTheme.ts +0 -79
- package/src/shared/libs/CometChatCalendar/Themes/DefaultTheme.ts +0 -164
- package/src/shared/libs/CometChatCalendar/Themes/index.ts +0 -3
- package/src/shared/libs/CometChatCalendar/Utils/addOpacity.ts +0 -15
- package/src/shared/libs/CometChatCalendar/Utils/checkChangedProps.ts +0 -10
- package/src/shared/libs/CometChatCalendar/Utils/clamp.ts +0 -5
- package/src/shared/libs/CometChatCalendar/Utils/dateRange.ts +0 -23
- package/src/shared/libs/CometChatCalendar/Utils/getExtraDays.ts +0 -25
- package/src/shared/libs/CometChatCalendar/Utils/getSurroundingTimeUnits.ts +0 -20
- package/src/shared/libs/CometChatCalendar/Utils/index.ts +0 -6
- package/src/shared/libs/CometChatCalendar/index.ts +0 -5
- package/src/shared/libs/VideoPlayer/Video.js +0 -494
- package/src/shared/libs/VideoPlayerControls/OSSupport/PlatformSupport.tsx +0 -43
- package/src/shared/libs/VideoPlayerControls/OSSupport/TVOSSupport.tsx +0 -17
- package/src/shared/libs/VideoPlayerControls/OSSupport/index.tsx +0 -1
- package/src/shared/libs/VideoPlayerControls/VideoPlayer.tsx +0 -512
- package/src/shared/libs/VideoPlayerControls/assets/img/back.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/bottom-vignette.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/bottom-vignette@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/bottom-vignette@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/error-icon.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/error-icon@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/error-icon@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/expand.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/expand@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/expand@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/forward.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/forward@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/forward@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/loader-icon.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/loader-icon@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/loader-icon@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/pause.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/pause@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/pause@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/play.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/play@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/play@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/rewind.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/rewind@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/rewind@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/shrink.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/shrink@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/shrink@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/top-vignette.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/top-vignette@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/top-vignette@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/volume.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/volume@2x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/assets/img/volume@3x.png +0 -0
- package/src/shared/libs/VideoPlayerControls/components/Back/Back.tsx +0 -28
- package/src/shared/libs/VideoPlayerControls/components/Back/index.ts +0 -1
- package/src/shared/libs/VideoPlayerControls/components/BottomControls.tsx +0 -142
- package/src/shared/libs/VideoPlayerControls/components/Control.tsx +0 -45
- package/src/shared/libs/VideoPlayerControls/components/Error/Error.tsx +0 -22
- package/src/shared/libs/VideoPlayerControls/components/Error/index.ts +0 -1
- package/src/shared/libs/VideoPlayerControls/components/Error/styles.ts +0 -21
- package/src/shared/libs/VideoPlayerControls/components/Fullscreen.tsx +0 -36
- package/src/shared/libs/VideoPlayerControls/components/Loader/Loader.tsx +0 -15
- package/src/shared/libs/VideoPlayerControls/components/Loader/index.ts +0 -1
- package/src/shared/libs/VideoPlayerControls/components/Loader/styles.ts +0 -16
- package/src/shared/libs/VideoPlayerControls/components/NullControl.tsx +0 -7
- package/src/shared/libs/VideoPlayerControls/components/Overlay.tsx +0 -23
- package/src/shared/libs/VideoPlayerControls/components/PlayPause/PlayPause.tsx +0 -109
- package/src/shared/libs/VideoPlayerControls/components/PlayPause/index.ts +0 -1
- package/src/shared/libs/VideoPlayerControls/components/PlayPause/styles.ts +0 -21
- package/src/shared/libs/VideoPlayerControls/components/Seekbar/Seekbar.tsx +0 -47
- package/src/shared/libs/VideoPlayerControls/components/Seekbar/index.ts +0 -1
- package/src/shared/libs/VideoPlayerControls/components/Seekbar/styles.ts +0 -37
- package/src/shared/libs/VideoPlayerControls/components/Timer/Timer.tsx +0 -28
- package/src/shared/libs/VideoPlayerControls/components/Timer/index.ts +0 -1
- package/src/shared/libs/VideoPlayerControls/components/Timer/styles.ts +0 -12
- package/src/shared/libs/VideoPlayerControls/components/Title.tsx +0 -35
- package/src/shared/libs/VideoPlayerControls/components/TopControls.tsx +0 -110
- package/src/shared/libs/VideoPlayerControls/components/Volume/Volume.tsx +0 -37
- package/src/shared/libs/VideoPlayerControls/components/Volume/index.ts +0 -1
- package/src/shared/libs/VideoPlayerControls/components/Volume/styles.ts +0 -31
- package/src/shared/libs/VideoPlayerControls/components/index.ts +0 -14
- package/src/shared/libs/VideoPlayerControls/components/styles.ts +0 -30
- package/src/shared/libs/VideoPlayerControls/hooks/index.ts +0 -3
- package/src/shared/libs/VideoPlayerControls/hooks/useAnimations.ts +0 -68
- package/src/shared/libs/VideoPlayerControls/hooks/useControlTimeout.tsx +0 -67
- package/src/shared/libs/VideoPlayerControls/hooks/usePanResponders.tsx +0 -96
- package/src/shared/libs/VideoPlayerControls/index.ts +0 -4
- package/src/shared/libs/VideoPlayerControls/styles.ts +0 -19
- package/src/shared/libs/VideoPlayerControls/types.ts +0 -290
- package/src/shared/libs/VideoPlayerControls/utils.ts +0 -76
- package/src/shared/libs/datePickerModal/DateTimePickerModal.android.js +0 -75
- package/src/shared/libs/datePickerModal/DateTimePickerModal.ios.js +0 -363
- package/src/shared/libs/datePickerModal/DateTimePickerModal.js +0 -9
- package/src/shared/libs/datePickerModal/Modal.js +0 -180
- package/src/shared/libs/datePickerModal/index.d.ts +0 -310
- package/src/shared/libs/datePickerModal/index.js +0 -5
- package/src/shared/libs/datePickerModal/utils.js +0 -25
- package/src/shared/libs/luxon/src/datetime.js +0 -2422
- package/src/shared/libs/luxon/src/duration.js +0 -990
- package/src/shared/libs/luxon/src/errors.js +0 -61
- package/src/shared/libs/luxon/src/impl/conversions.js +0 -206
- package/src/shared/libs/luxon/src/impl/diff.js +0 -95
- package/src/shared/libs/luxon/src/impl/digits.js +0 -75
- package/src/shared/libs/luxon/src/impl/english.js +0 -233
- package/src/shared/libs/luxon/src/impl/formats.js +0 -176
- package/src/shared/libs/luxon/src/impl/formatter.js +0 -409
- package/src/shared/libs/luxon/src/impl/invalid.js +0 -14
- package/src/shared/libs/luxon/src/impl/locale.js +0 -542
- package/src/shared/libs/luxon/src/impl/regexParser.js +0 -335
- package/src/shared/libs/luxon/src/impl/tokenParser.js +0 -473
- package/src/shared/libs/luxon/src/impl/util.js +0 -309
- package/src/shared/libs/luxon/src/impl/zoneUtil.js +0 -30
- package/src/shared/libs/luxon/src/info.js +0 -205
- package/src/shared/libs/luxon/src/interval.js +0 -657
- package/src/shared/libs/luxon/src/luxon.js +0 -26
- package/src/shared/libs/luxon/src/package.json +0 -4
- package/src/shared/libs/luxon/src/settings.js +0 -175
- package/src/shared/libs/luxon/src/zone.js +0 -91
- package/src/shared/libs/luxon/src/zones/IANAZone.js +0 -189
- package/src/shared/libs/luxon/src/zones/fixedOffsetZone.js +0 -102
- package/src/shared/libs/luxon/src/zones/invalidZone.js +0 -53
- package/src/shared/libs/luxon/src/zones/systemZone.js +0 -61
- package/src/shared/modals/CometChatCallLogDetailsOptions.ts +0 -23
- package/src/shared/modals/CometChatCallLogDetailsTemplate.ts +0 -16
- package/src/shared/modals/CometChatDetailsOption.ts +0 -24
- package/src/shared/modals/CometChatDetailsTemplate.ts +0 -16
- package/src/shared/modals/CometChatOptions.ts +0 -13
- package/src/shared/modals/InteractiveData/InteractiveActions/APIAction.ts +0 -118
- package/src/shared/modals/InteractiveData/InteractiveActions/CustomAction.ts +0 -19
- package/src/shared/modals/InteractiveData/InteractiveActions/URLNavigationAction.ts +0 -34
- package/src/shared/modals/InteractiveData/InteractiveActions/index.ts +0 -3
- package/src/shared/modals/InteractiveData/InteractiveData/InteractiveCardData.ts +0 -69
- package/src/shared/modals/InteractiveData/InteractiveData/InteractiveFormData.ts +0 -119
- package/src/shared/modals/InteractiveData/InteractiveData/index.ts +0 -2
- package/src/shared/modals/InteractiveData/InteractiveElements/BaseInputElement.ts +0 -102
- package/src/shared/modals/InteractiveData/InteractiveElements/BaseInteractiveElement.ts +0 -45
- package/src/shared/modals/InteractiveData/InteractiveElements/ButtonElement.ts +0 -61
- package/src/shared/modals/InteractiveData/InteractiveElements/CheckboxElement.ts +0 -75
- package/src/shared/modals/InteractiveData/InteractiveElements/DateTimeElement.ts +0 -103
- package/src/shared/modals/InteractiveData/InteractiveElements/DropdownElement.ts +0 -83
- package/src/shared/modals/InteractiveData/InteractiveElements/LabelElement.ts +0 -32
- package/src/shared/modals/InteractiveData/InteractiveElements/OptionElement.ts +0 -39
- package/src/shared/modals/InteractiveData/InteractiveElements/RadioButtonElement.ts +0 -76
- package/src/shared/modals/InteractiveData/InteractiveElements/SingleSelectElement.ts +0 -76
- package/src/shared/modals/InteractiveData/InteractiveElements/TextInputElement.ts +0 -101
- package/src/shared/modals/InteractiveData/InteractiveElements/index.ts +0 -11
- package/src/shared/modals/InteractiveData/InteractiveEntities/ActionEntity.ts +0 -41
- package/src/shared/modals/InteractiveData/InteractiveEntities/ElementEntity.ts +0 -66
- package/src/shared/modals/InteractiveData/InteractiveEntities/index.ts +0 -2
- package/src/shared/modals/InteractiveData/InteractiveMessage/CardMessage.ts +0 -143
- package/src/shared/modals/InteractiveData/InteractiveMessage/CustomInteractiveMessage.ts +0 -39
- package/src/shared/modals/InteractiveData/InteractiveMessage/FormMessage.ts +0 -153
- package/src/shared/modals/InteractiveData/InteractiveMessage/SchedulerMessage.ts +0 -150
- package/src/shared/modals/InteractiveData/InteractiveMessage/index.ts +0 -4
- package/src/shared/modals/InteractiveData/index.ts +0 -30
- package/src/shared/resources/CometChatTheme/CometChatTheme.ts +0 -28
- package/src/shared/resources/CometChatTheme/Palette.ts +0 -584
- package/src/shared/resources/CometChatTheme/Typography.ts +0 -396
- package/src/shared/resources/CometChatTheme/index.ts +0 -2
- package/src/shared/utils/CometChatLiveReactions/CometChatLiveReaction.tsx +0 -124
- package/src/shared/utils/CometChatLiveReactions/LiveReactionstyles.ts +0 -37
- package/src/shared/utils/CometChatLiveReactions/index.ts +0 -1
- package/src/shared/utils/CometChatLiveReactions/resources/heart.png +0 -0
- package/src/shared/utils/CometChatLiveReactions/resources/index.ts +0 -5
- package/src/shared/utils/CometChatLiveReactions/style.ts +0 -8
- package/src/shared/utils/CometChatMessagePreview/CometChatMessagePreview.js +0 -109
- package/src/shared/utils/CometChatMessagePreview/MessagePreviewConfiguration.js +0 -30
- package/src/shared/utils/CometChatMessagePreview/style.js +0 -71
- package/src/shared/utils/DetailsUtils/DetailsUtils.tsx +0 -399
- package/src/shared/utils/DetailsUtils/resources/Back.png +0 -0
- package/src/shared/utils/DetailsUtils/resources/banIcon.png +0 -0
- package/src/shared/utils/DetailsUtils/resources/close.png +0 -0
- package/src/shared/utils/DetailsUtils/resources/index.ts +0 -23
- package/src/shared/utils/DetailsUtils/resources/kickIcon.png +0 -0
- package/src/shared/utils/DetailsUtils/resources/password.png +0 -0
- package/src/shared/utils/DetailsUtils/resources/private.png +0 -0
- package/src/shared/utils/DetailsUtils/resources/right-arrow.png +0 -0
- package/src/shared/utils/InteractiveMessageUtils.ts +0 -60
- package/src/shared/utils/SchedulerUtils.ts +0 -198
- package/src/shared/utils/TypeUtils.ts +0 -3
- package/src/shared/views/CometChatActionSheet/ActionSheetStyle.ts +0 -61
- package/src/shared/views/CometChatAudioBubble/AudioBubbleStyle.ts +0 -43
- package/src/shared/views/CometChatAvatar/AvatarConfiguration.ts +0 -27
- package/src/shared/views/CometChatAvatar/AvatarStyle.ts +0 -57
- package/src/shared/views/CometChatAvatar/resources/default.jpg +0 -0
- package/src/shared/views/CometChatAvatar/resources/index.ts +0 -5
- package/src/shared/views/CometChatBadge/BadgeConfiguration.ts +0 -55
- package/src/shared/views/CometChatBadge/BadgeStyle.ts +0 -39
- package/src/shared/views/CometChatBottomSheet/style.ts +0 -50
- package/src/shared/views/CometChatButton/CometChatButton.tsx +0 -76
- package/src/shared/views/CometChatButton/CometChatButtonStyle.ts +0 -47
- package/src/shared/views/CometChatButton/index.ts +0 -5
- package/src/shared/views/CometChatButton/style.ts +0 -8
- package/src/shared/views/CometChatCard/CometChatCard.tsx +0 -77
- package/src/shared/views/CometChatCard/CometChatCardStyle.ts +0 -31
- package/src/shared/views/CometChatCard/index.ts +0 -8
- package/src/shared/views/CometChatCard/style.ts +0 -13
- package/src/shared/views/CometChatCardBubble/CardBubbleStyle.tsx +0 -47
- package/src/shared/views/CometChatCardBubble/CometChatCardBubble.tsx +0 -174
- package/src/shared/views/CometChatCardBubble/index.tsx +0 -2
- package/src/shared/views/CometChatCheckBox/CheckBoxStyle.tsx +0 -43
- package/src/shared/views/CometChatCheckBox/CometChatCheckBox.tsx +0 -79
- package/src/shared/views/CometChatConfirmDialog/CometChatConfirmDialogStyle.ts +0 -36
- package/src/shared/views/CometChatDate/DateConfiguration.ts +0 -32
- package/src/shared/views/CometChatDate/DateStyle.ts +0 -26
- package/src/shared/views/CometChatDate/style.ts +0 -8
- package/src/shared/views/CometChatDateTimePicker/CometChatDateTimePicker.tsx +0 -206
- package/src/shared/views/CometChatDateTimePicker/DateTimePickerStyle.ts +0 -19
- package/src/shared/views/CometChatDateTimePicker/index.ts +0 -3
- package/src/shared/views/CometChatDropDown/CometChatDropDown.tsx +0 -127
- package/src/shared/views/CometChatDropDown/DropDownStyle.tsx +0 -39
- package/src/shared/views/CometChatDropDown/resources/downArrowIcon.png +0 -0
- package/src/shared/views/CometChatDropDown/resources/index.js +0 -5
- package/src/shared/views/CometChatEmojiKeyboard/EmojiKeyboardConfiguration.ts +0 -27
- package/src/shared/views/CometChatEmojiKeyboard/EmojiKeyboardStyle.ts +0 -44
- package/src/shared/views/CometChatFileBubble/FileBubbleStyle.ts +0 -58
- package/src/shared/views/CometChatFormBubble/CometChatFormBubble.tsx +0 -542
- package/src/shared/views/CometChatFormBubble/FormBubbleStyle.tsx +0 -96
- package/src/shared/views/CometChatFormBubble/index.tsx +0 -2
- package/src/shared/views/CometChatImageBubble/ImageBubbleStyle.ts +0 -34
- package/src/shared/views/CometChatImageBubble/assets/default_image.png +0 -0
- package/src/shared/views/CometChatLabel/CometChatLabel.tsx +0 -27
- package/src/shared/views/CometChatLabel/LabelStyle.ts +0 -19
- package/src/shared/views/CometChatList/resources/Back.png +0 -0
- package/src/shared/views/CometChatList/resources/Search.png +0 -0
- package/src/shared/views/CometChatListItem/ListItemConfiguration.tsx +0 -21
- package/src/shared/views/CometChatListItem/ListItemStyle.ts +0 -47
- package/src/shared/views/CometChatMediaRecorder/MediaRecorderStyle.ts +0 -63
- package/src/shared/views/CometChatMessageBubble/MessageBubbleStyle.ts +0 -26
- package/src/shared/views/CometChatQuickReactions/QuickReactionsConfiguration.tsx +0 -13
- package/src/shared/views/CometChatQuickView/CometChatQuickView.tsx +0 -66
- package/src/shared/views/CometChatQuickView/QuickViewStyle.ts +0 -55
- package/src/shared/views/CometChatRadioButton/CometChatRadioButton.tsx +0 -67
- package/src/shared/views/CometChatRadioButton/RadioButtonStyle.tsx +0 -38
- package/src/shared/views/CometChatReactionList/ReactionListConfiguration.tsx +0 -15
- package/src/shared/views/CometChatReactions/ReactionsConfiguration.tsx +0 -13
- package/src/shared/views/CometChatReactions/ReactionsStyle.tsx +0 -43
- package/src/shared/views/CometChatReceipt/MessageConfiguration.ts +0 -65
- package/src/shared/views/CometChatReceipt/ReceiptStyle.ts +0 -3
- package/src/shared/views/CometChatSchedulerBubble/CometChatSchedulerBubble.tsx +0 -1519
- package/src/shared/views/CometChatSchedulerBubble/index.ts +0 -3
- package/src/shared/views/CometChatSchedulerBubble/styles.ts +0 -92
- package/src/shared/views/CometChatSingleSelect/CometChatSingleSelect.tsx +0 -63
- package/src/shared/views/CometChatSingleSelect/SingleStyle.tsx +0 -35
- package/src/shared/views/CometChatStatusIndicator/StatusIndicatorConfiguration.ts +0 -25
- package/src/shared/views/CometChatStatusIndicator/StatusIndicatorStyle.ts +0 -37
- package/src/shared/views/CometChatSuggestionList/SuggestionListConfiguration.ts +0 -23
- package/src/shared/views/CometChatTextBubble/TextBubbleStyle.ts +0 -37
- package/src/shared/views/CometChatTextInput/CometChatTextInput.tsx +0 -67
- package/src/shared/views/CometChatTextInput/TextInputStyle.tsx +0 -26
- package/src/shared/views/CometChatTimeSlotSelector/CometChatTimeSlotSelector.tsx +0 -113
- package/src/shared/views/CometChatTimeSlotSelector/index.ts +0 -3
- package/src/shared/views/CometChatTimeSlotSelector/styles.ts +0 -30
- package/src/shared/views/CometChatVideoBubble/VideoBubbleStyle.ts +0 -87
- package/src/shared/views/SwipeRow/SwipeRow.tsx +0 -126
- package/src/shared/views/SwipeRow/index.ts +0 -3
- package/src/shared/views/SwipeRow/style.ts +0 -30
- /package/src/{shared/assets/images → CometChatGroups/resources}/search.png +0 -0
- /package/src/{CometChatDetails → CometChatThreadHeader}/resources/Back.png +0 -0
- /package/src/{AI/AIConversationSummary → CometChatThreadHeader}/resources/close.png +0 -0
- /package/src/{CometChatThreadedMessages → CometChatThreadHeader}/resources/more.png +0 -0
- /package/src/{CometChatDetails → CometChatThreadHeader}/resources/password.png +0 -0
- /package/src/{CometChatDetails → CometChatThreadHeader}/resources/private.png +0 -0
- /package/src/{CometChatDetails → CometChatThreadHeader}/resources/right-arrow.png +0 -0
|
@@ -1,89 +1,73 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef } from "react";
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
ColorValue,
|
|
4
|
+
Dimensions,
|
|
4
5
|
Image,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Platform,
|
|
6
|
+
ImageSourcePropType,
|
|
7
|
+
ImageStyle,
|
|
8
8
|
KeyboardAvoidingView,
|
|
9
|
-
Modal,
|
|
10
9
|
KeyboardAvoidingViewProps,
|
|
11
|
-
|
|
10
|
+
Modal,
|
|
11
|
+
NativeModules,
|
|
12
|
+
Platform,
|
|
12
13
|
Text,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
TouchableOpacity,
|
|
15
|
+
TouchableWithoutFeedbackProps,
|
|
16
|
+
View,
|
|
17
|
+
ViewStyle,
|
|
18
|
+
} from "react-native";
|
|
17
19
|
import {
|
|
18
|
-
localize,
|
|
19
|
-
CometChatLiveReactions,
|
|
20
|
-
CometChatBottomSheet,
|
|
21
|
-
CometChatMessagePreview,
|
|
22
|
-
MessagePreviewStyle,
|
|
23
20
|
CometChatActionSheet,
|
|
24
|
-
|
|
25
|
-
CometChatContext,
|
|
21
|
+
CometChatBottomSheet,
|
|
26
22
|
CometChatMentionsFormatter,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
MentionTextStyle,
|
|
23
|
+
CometChatMessageInput,
|
|
24
|
+
CometChatMessagePreview,
|
|
30
25
|
CometChatSuggestionList,
|
|
31
|
-
|
|
26
|
+
CometChatTextFormatter,
|
|
32
27
|
CometChatUIKit,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
import { CometChat } from '@cometchat/chat-sdk-react-native';
|
|
28
|
+
CometChatUrlsFormatter,
|
|
29
|
+
localize,
|
|
30
|
+
SuggestionItem,
|
|
31
|
+
} from "../shared";
|
|
32
|
+
import { Style } from "./styles";
|
|
39
33
|
|
|
40
|
-
import {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
} from '../shared/utils/CometChatMessageHelper';
|
|
45
|
-
import { CometChatSoundManager, ChatConfigurator } from '../shared';
|
|
34
|
+
import { CheckPropertyExists } from "../shared/helper/functions";
|
|
35
|
+
import { CometChat } from "@cometchat/chat-sdk-react-native";
|
|
36
|
+
import { ChatConfigurator, CometChatSoundManager } from "../shared";
|
|
37
|
+
import { commonVars } from "../shared/base/vars";
|
|
46
38
|
import {
|
|
47
39
|
ConversationOptionConstants,
|
|
40
|
+
MentionsTargetElement,
|
|
48
41
|
MentionsVisibility,
|
|
49
42
|
MessageTypeConstants,
|
|
50
|
-
MetadataConstants,
|
|
51
43
|
ReceiverTypeConstants,
|
|
52
44
|
ViewAlignment,
|
|
53
|
-
} from
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
|
|
58
|
-
BorderStyleInterface,
|
|
59
|
-
FontStyleInterface,
|
|
60
|
-
} from '../shared/base';
|
|
61
|
-
import { ImageType } from '../shared';
|
|
62
|
-
import { MessageEvents } from '../shared/events';
|
|
63
|
-
import { CometChatContextType } from '../shared/base/Types';
|
|
64
|
-
import { CometChatUIEventHandler } from '../shared/events/CometChatUIEventHandler/CometChatUIEventHandler';
|
|
65
|
-
import { CometChatMessageComposerActionInterface } from '../shared/helper/types';
|
|
45
|
+
} from "../shared/constants/UIKitConstants";
|
|
46
|
+
import { MessageEvents } from "../shared/events";
|
|
47
|
+
import { CometChatUIEventHandler } from "../shared/events/CometChatUIEventHandler/CometChatUIEventHandler";
|
|
48
|
+
import { CometChatMessageComposerAction, DeepPartial } from "../shared/helper/types";
|
|
49
|
+
import { Icon } from "../shared/icons/Icon";
|
|
66
50
|
import {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
} from
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
51
|
+
getUnixTimestampInMilliseconds,
|
|
52
|
+
messageStatus,
|
|
53
|
+
} from "../shared/utils/CometChatMessageHelper";
|
|
54
|
+
import { CommonUtils } from "../shared/utils/CommonUtils";
|
|
55
|
+
import { permissionUtil } from "../shared/utils/PermissionUtil";
|
|
56
|
+
import { CometChatMediaRecorder } from "../shared/views/CometChatMediaRecorder";
|
|
57
|
+
import { useTheme } from "../theme";
|
|
58
|
+
import { ICONS } from "./resources";
|
|
59
|
+
import { CometChatTheme } from "../theme/type";
|
|
60
|
+
import { deepMerge } from "../shared/helper/helperFunctions";
|
|
74
61
|
const { FileManager, CommonUtil } = NativeModules;
|
|
75
62
|
|
|
76
|
-
const uiEventListenerShow =
|
|
77
|
-
const uiEventListenerHide =
|
|
63
|
+
const uiEventListenerShow = "uiEvent_show_" + new Date().getTime();
|
|
64
|
+
const uiEventListenerHide = "uiEvent_hide_" + new Date().getTime();
|
|
78
65
|
|
|
79
66
|
const MessagePreviewTray = (props: any) => {
|
|
80
|
-
const { shouldShow = false, text =
|
|
67
|
+
const { shouldShow = false, text = "", onClose = () => {} } = props;
|
|
81
68
|
return shouldShow ? (
|
|
82
69
|
<CometChatMessagePreview
|
|
83
|
-
|
|
84
|
-
new MessagePreviewStyle({ width: '95%', backgroundColor: 'white' })
|
|
85
|
-
}
|
|
86
|
-
messagePreviewTitle={localize('EDIT_MESSAGE')}
|
|
70
|
+
messagePreviewTitle={localize("EDIT_MESSAGE")}
|
|
87
71
|
messagePreviewSubtitle={text}
|
|
88
72
|
closeIconURL={ICONS.CLOSE}
|
|
89
73
|
onCloseClick={onClose}
|
|
@@ -104,57 +88,37 @@ const ImageButton = (props: any) => {
|
|
|
104
88
|
);
|
|
105
89
|
};
|
|
106
90
|
|
|
107
|
-
const AttachIconButton = (props:
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
91
|
+
const AttachIconButton = (props: {
|
|
92
|
+
onPress: TouchableWithoutFeedbackProps["onPress"];
|
|
93
|
+
icon: ImageSourcePropType | JSX.Element;
|
|
94
|
+
iconStyle: ImageStyle;
|
|
95
|
+
}) => {
|
|
96
|
+
return (
|
|
97
|
+
<TouchableOpacity onPress={props.onPress}>
|
|
98
|
+
<Icon
|
|
99
|
+
name='add-circle'
|
|
100
|
+
icon={props.icon}
|
|
101
|
+
color={props.iconStyle.tintColor}
|
|
102
|
+
height={props.iconStyle.height}
|
|
103
|
+
width={props.iconStyle.width}
|
|
104
|
+
imageStyle={props.iconStyle}
|
|
115
105
|
/>
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
return <View style={[Style.imageStyle, style]} />;
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
const EmojiBoard = (props: any) => {
|
|
123
|
-
const {
|
|
124
|
-
shouldShow = false,
|
|
125
|
-
onClose = () => {},
|
|
126
|
-
emojiSelection = (emoji?: any) => {},
|
|
127
|
-
...otherProps
|
|
128
|
-
} = props;
|
|
129
|
-
return shouldShow ? (
|
|
130
|
-
<CometChatBottomSheet onClose={onClose}>
|
|
131
|
-
{/* <CometChatEmojiKeyboard onClick={emojiSelection} {...otherProps} /> */}
|
|
132
|
-
</CometChatBottomSheet>
|
|
133
|
-
) : null;
|
|
106
|
+
</TouchableOpacity>
|
|
107
|
+
);
|
|
134
108
|
};
|
|
135
109
|
|
|
136
110
|
const ActionSheetBoard = (props: any) => {
|
|
137
|
-
const {
|
|
138
|
-
|
|
139
|
-
onClose = () => {},
|
|
140
|
-
options = [],
|
|
141
|
-
cometChatBottomSheetStyle = {},
|
|
142
|
-
sheetRef,
|
|
143
|
-
...otherProps
|
|
144
|
-
} = props;
|
|
145
|
-
return shouldShow ? (
|
|
111
|
+
const { shouldShow = false, onClose = () => {}, options = [], sheetRef, style } = props;
|
|
112
|
+
return (
|
|
146
113
|
<CometChatBottomSheet
|
|
114
|
+
style={{ maxHeight: Dimensions.get("window").height * 0.49 }}
|
|
147
115
|
ref={sheetRef}
|
|
148
116
|
onClose={onClose}
|
|
149
|
-
|
|
117
|
+
isOpen={shouldShow}
|
|
150
118
|
>
|
|
151
|
-
<CometChatActionSheet
|
|
152
|
-
actions={options}
|
|
153
|
-
{...otherProps}
|
|
154
|
-
onPress={props.onClick}
|
|
155
|
-
/>
|
|
119
|
+
<CometChatActionSheet actions={options} style={style} />
|
|
156
120
|
</CometChatBottomSheet>
|
|
157
|
-
)
|
|
121
|
+
);
|
|
158
122
|
};
|
|
159
123
|
|
|
160
124
|
const RecordAudio = (props: any) => {
|
|
@@ -170,19 +134,14 @@ const RecordAudio = (props: any) => {
|
|
|
170
134
|
onStop = (recordedFile: String) => {},
|
|
171
135
|
onStart = () => {},
|
|
172
136
|
mediaRecorderStyle,
|
|
173
|
-
pauseIconUrl,
|
|
174
|
-
playIconUrl,
|
|
175
|
-
recordIconUrl,
|
|
176
|
-
deleteIconUrl,
|
|
177
|
-
stopIconUrl,
|
|
178
|
-
submitIconUrl,
|
|
179
137
|
...otherProps
|
|
180
138
|
} = props;
|
|
181
|
-
return
|
|
139
|
+
return (
|
|
182
140
|
<CometChatBottomSheet
|
|
183
141
|
ref={sheetRef}
|
|
184
142
|
onClose={onClose}
|
|
185
143
|
style={cometChatBottomSheetStyle}
|
|
144
|
+
isOpen={shouldShow}
|
|
186
145
|
>
|
|
187
146
|
<CometChatMediaRecorder
|
|
188
147
|
onClose={onClose}
|
|
@@ -191,186 +150,96 @@ const RecordAudio = (props: any) => {
|
|
|
191
150
|
onSend={onSend}
|
|
192
151
|
onStop={onStop}
|
|
193
152
|
onStart={onStart}
|
|
194
|
-
|
|
195
|
-
pauseIconUrl={pauseIconUrl}
|
|
196
|
-
playIconUrl={playIconUrl}
|
|
197
|
-
recordIconUrl={recordIconUrl}
|
|
198
|
-
deleteIconUrl={deleteIconUrl}
|
|
199
|
-
stopIconUrl={stopIconUrl}
|
|
200
|
-
submitIconUrl={submitIconUrl}
|
|
201
|
-
/>
|
|
202
|
-
</CometChatBottomSheet>
|
|
203
|
-
) : null;
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
const AIOptions = (props: any) => {
|
|
207
|
-
const {
|
|
208
|
-
aiStyle,
|
|
209
|
-
shouldShow = false,
|
|
210
|
-
onClose = () => {},
|
|
211
|
-
cometChatBottomSheetStyle = {
|
|
212
|
-
backgroundColor: aiStyle.backgroundColor,
|
|
213
|
-
paddingHorizontal: 0,
|
|
214
|
-
},
|
|
215
|
-
sheetRef,
|
|
216
|
-
aiOptions,
|
|
217
|
-
...otherProps
|
|
218
|
-
} = props;
|
|
219
|
-
|
|
220
|
-
return shouldShow ? (
|
|
221
|
-
<CometChatBottomSheet
|
|
222
|
-
ref={sheetRef}
|
|
223
|
-
onClose={onClose}
|
|
224
|
-
style={cometChatBottomSheetStyle}
|
|
225
|
-
>
|
|
226
|
-
<CometChatActionSheet
|
|
227
|
-
actions={aiOptions}
|
|
228
|
-
style={{ ...aiStyle, paddingHorizontal: 0 }}
|
|
229
|
-
{...otherProps}
|
|
230
|
-
onPress={props.onClick}
|
|
231
|
-
hideHeader={true}
|
|
153
|
+
style={mediaRecorderStyle}
|
|
232
154
|
/>
|
|
233
155
|
</CometChatBottomSheet>
|
|
234
|
-
)
|
|
235
|
-
};
|
|
236
|
-
|
|
237
|
-
const LiveReaction = (props: any) => {
|
|
238
|
-
const { show = false, reaction } = props;
|
|
239
|
-
if (show) {
|
|
240
|
-
return <CometChatLiveReactions reaction={reaction} />;
|
|
241
|
-
}
|
|
242
|
-
return null;
|
|
156
|
+
);
|
|
243
157
|
};
|
|
244
158
|
|
|
245
|
-
|
|
246
|
-
timerIntervalId = null;
|
|
247
|
-
|
|
248
|
-
export interface MessageComposerStyleInterface extends BaseStyle {
|
|
249
|
-
attachIconTint?: string;
|
|
250
|
-
sendIconTint?: string;
|
|
251
|
-
voiceRecordingIconTint?: string;
|
|
252
|
-
inputBackground?: string;
|
|
253
|
-
inputBorder?: BorderStyleInterface;
|
|
254
|
-
dividerTint?: string;
|
|
255
|
-
textFont?: FontStyleInterface;
|
|
256
|
-
textColor?: string;
|
|
257
|
-
placeholderTextColor?: string;
|
|
258
|
-
placeholderTextFont?: FontStyleInterface;
|
|
259
|
-
|
|
260
|
-
actionSheetSeparatorTint?: string;
|
|
261
|
-
actionSheetTitleColor?: string;
|
|
262
|
-
actionSheetTitleFont?: FontStyleInterface;
|
|
263
|
-
actionSheetLayoutModeIconTint?: string;
|
|
264
|
-
actionSheetCancelButtonIconTint?: string;
|
|
265
|
-
}
|
|
266
|
-
type Enumerate<
|
|
267
|
-
N extends number,
|
|
268
|
-
Acc extends number[] = []
|
|
269
|
-
> = Acc['length'] extends N
|
|
159
|
+
type Enumerate<N extends number, Acc extends number[] = []> = Acc["length"] extends N
|
|
270
160
|
? Acc[number]
|
|
271
|
-
: Enumerate<N, [...Acc, Acc[
|
|
161
|
+
: Enumerate<N, [...Acc, Acc["length"]]>;
|
|
272
162
|
|
|
273
|
-
type IntRange<F extends number, T extends number> = Exclude<
|
|
274
|
-
Enumerate<T>,
|
|
275
|
-
Enumerate<F>
|
|
276
|
-
>;
|
|
163
|
+
type IntRange<F extends number, T extends number> = Exclude<Enumerate<T>, Enumerate<F>>;
|
|
277
164
|
|
|
165
|
+
/**
|
|
166
|
+
* Properties for the CometChat message composer component.
|
|
167
|
+
*/
|
|
278
168
|
export interface CometChatMessageComposerInterface {
|
|
279
169
|
/**
|
|
170
|
+
* Message composer identifier.
|
|
280
171
|
*
|
|
281
|
-
*
|
|
282
|
-
* @type {(string | number)}
|
|
283
|
-
* @description Message composer identifier
|
|
172
|
+
* @type {string | number}
|
|
284
173
|
*/
|
|
285
174
|
id?: string | number;
|
|
175
|
+
|
|
286
176
|
/**
|
|
287
|
-
*
|
|
177
|
+
* CometChat SDK’s user object.
|
|
288
178
|
*
|
|
289
179
|
* @type {CometChat.User}
|
|
290
|
-
* @description CometChat SDK’s user object
|
|
291
180
|
*/
|
|
292
181
|
user?: CometChat.User;
|
|
182
|
+
|
|
293
183
|
/**
|
|
294
|
-
*
|
|
184
|
+
* CometChat SDK’s group object.
|
|
295
185
|
*
|
|
296
186
|
* @type {CometChat.Group}
|
|
297
|
-
* @description CometChat SDK’s group object
|
|
298
187
|
*/
|
|
299
188
|
group?: CometChat.Group;
|
|
189
|
+
|
|
300
190
|
/**
|
|
301
|
-
*
|
|
191
|
+
* Flag to turn off sound for outgoing messages.
|
|
302
192
|
*
|
|
303
193
|
* @type {boolean}
|
|
304
|
-
* @description Turn off sound for outgoing messages
|
|
305
194
|
*/
|
|
306
|
-
|
|
195
|
+
disableSoundForOutgoingMessages?: boolean;
|
|
196
|
+
|
|
307
197
|
/**
|
|
308
|
-
*
|
|
198
|
+
* Custom audio sound to be played while sending messages.
|
|
309
199
|
*
|
|
310
200
|
* @type {*}
|
|
311
|
-
* @description Custom audio sound to be played while sending messages
|
|
312
201
|
*/
|
|
313
|
-
|
|
202
|
+
customSoundForOutgoingMessage?: any;
|
|
203
|
+
|
|
314
204
|
/**
|
|
315
|
-
*
|
|
205
|
+
* Flag to disable typing events.
|
|
316
206
|
*
|
|
317
207
|
* @type {boolean}
|
|
318
|
-
* @description Disable typing events
|
|
319
208
|
*/
|
|
320
209
|
disableTypingEvents?: boolean;
|
|
210
|
+
|
|
321
211
|
/**
|
|
322
|
-
*
|
|
212
|
+
* Initial text to be displayed in the composer.
|
|
323
213
|
*
|
|
324
214
|
* @type {string}
|
|
325
|
-
* @description CometChatMessageComposerInterface
|
|
326
215
|
*/
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
*
|
|
330
|
-
*
|
|
331
|
-
* @type {string}
|
|
332
|
-
* @description Text shown in the composer when the input message is empty
|
|
333
|
-
*/
|
|
334
|
-
placeHolderText?: string;
|
|
335
|
-
/**
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
* @type {React.FC}
|
|
339
|
-
* @description Preview section at the top of the composer
|
|
340
|
-
*/
|
|
341
|
-
HeaderView?: React.FC;
|
|
342
|
-
/**
|
|
343
|
-
*
|
|
344
|
-
*
|
|
345
|
-
* @type {React.FC}
|
|
346
|
-
* @description Preview section at the bottom of the composer
|
|
347
|
-
*/
|
|
348
|
-
FooterView?: React.FC;
|
|
216
|
+
initialComposertext?: string;
|
|
217
|
+
|
|
349
218
|
/**
|
|
219
|
+
* Renders a preview section at the top of the composer.
|
|
350
220
|
*
|
|
351
|
-
*
|
|
352
|
-
* @
|
|
221
|
+
* @param {Object} props - The component properties.
|
|
222
|
+
* @param {CometChat.User} [props.user] - The user object.
|
|
223
|
+
* @param {CometChat.Group} [props.group] - The group object.
|
|
224
|
+
* @returns {JSX.Element} The header view element.
|
|
353
225
|
*/
|
|
354
|
-
|
|
226
|
+
HeaderView?: ({ user, group }: { user?: CometChat.User; group?: CometChat.Group }) => JSX.Element;
|
|
227
|
+
|
|
355
228
|
/**
|
|
229
|
+
* Callback triggered when the input text changes.
|
|
356
230
|
*
|
|
357
|
-
*
|
|
358
|
-
* @type {number}
|
|
359
|
-
* @description Threshold value when reached, input will not expand further, causing it to scroll
|
|
231
|
+
* @param {string} text - The updated text.
|
|
360
232
|
*/
|
|
361
|
-
|
|
233
|
+
onTextChange?: (text: string) => void;
|
|
234
|
+
|
|
362
235
|
/**
|
|
236
|
+
* Returns the attachment options for the composer.
|
|
363
237
|
*
|
|
364
|
-
*
|
|
365
|
-
* @
|
|
366
|
-
* @
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
/**
|
|
370
|
-
*
|
|
371
|
-
*
|
|
372
|
-
* @type {*}
|
|
373
|
-
* @description CometChatMessageComposerInterface
|
|
238
|
+
* @param {Object} props - The function properties.
|
|
239
|
+
* @param {CometChat.User} [props.user] - The user object.
|
|
240
|
+
* @param {CometChat.Group} [props.group] - The group object.
|
|
241
|
+
* @param {Map<any, any>} props.composerId - The composer identifier as a Map.
|
|
242
|
+
* @returns {CometChatMessageComposerAction[]} An array of composer actions.
|
|
374
243
|
*/
|
|
375
244
|
attachmentOptions?: ({
|
|
376
245
|
user,
|
|
@@ -380,28 +249,16 @@ export interface CometChatMessageComposerInterface {
|
|
|
380
249
|
user?: CometChat.User;
|
|
381
250
|
group?: CometChat.Group;
|
|
382
251
|
composerId: Map<any, any>;
|
|
383
|
-
}) =>
|
|
252
|
+
}) => CometChatMessageComposerAction[];
|
|
384
253
|
|
|
385
254
|
/**
|
|
255
|
+
* Replaces the default Auxiliary Button.
|
|
386
256
|
*
|
|
387
|
-
*
|
|
388
|
-
* @
|
|
389
|
-
* @
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
user,
|
|
393
|
-
group,
|
|
394
|
-
composerId,
|
|
395
|
-
}: {
|
|
396
|
-
user?: CometChat.User;
|
|
397
|
-
group?: CometChat.Group;
|
|
398
|
-
composerId: string | number;
|
|
399
|
-
}) => JSX.Element;
|
|
400
|
-
/**
|
|
401
|
-
*
|
|
402
|
-
*
|
|
403
|
-
* @type {FunctionComponent}
|
|
404
|
-
* @description Function which return a JSX Element which replaces the default Auxiliary Button
|
|
257
|
+
* @param {Object} props - The function properties.
|
|
258
|
+
* @param {CometChat.User} [props.user] - The user object.
|
|
259
|
+
* @param {CometChat.Group} [props.group] - The group object.
|
|
260
|
+
* @param {string | number} props.composerId - The composer identifier.
|
|
261
|
+
* @returns {JSX.Element} A custom auxiliary button component.
|
|
405
262
|
*/
|
|
406
263
|
AuxiliaryButtonView?: ({
|
|
407
264
|
user,
|
|
@@ -412,18 +269,15 @@ export interface CometChatMessageComposerInterface {
|
|
|
412
269
|
group?: CometChat.Group;
|
|
413
270
|
composerId: string | number;
|
|
414
271
|
}) => JSX.Element;
|
|
272
|
+
|
|
415
273
|
/**
|
|
274
|
+
* Replaces the default Send Button.
|
|
416
275
|
*
|
|
417
|
-
*
|
|
418
|
-
* @
|
|
419
|
-
* @
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
/**
|
|
423
|
-
*
|
|
424
|
-
*
|
|
425
|
-
* @type {FunctionComponent}
|
|
426
|
-
* @description Function which return a JSX Element which replaces the default Send Button
|
|
276
|
+
* @param {Object} props - The function properties.
|
|
277
|
+
* @param {CometChat.User} [props.user] - The user object.
|
|
278
|
+
* @param {CometChat.Group} [props.group] - The group object.
|
|
279
|
+
* @param {string | number} props.composerId - The composer identifier.
|
|
280
|
+
* @returns {JSX.Element} A custom send button component.
|
|
427
281
|
*/
|
|
428
282
|
SendButtonView?: ({
|
|
429
283
|
user,
|
|
@@ -434,195 +288,114 @@ export interface CometChatMessageComposerInterface {
|
|
|
434
288
|
group?: CometChat.Group;
|
|
435
289
|
composerId: string | number;
|
|
436
290
|
}) => JSX.Element;
|
|
291
|
+
|
|
437
292
|
/**
|
|
293
|
+
* Message id required for threaded messages.
|
|
438
294
|
*
|
|
439
|
-
*
|
|
440
|
-
* @type {(string | number)}
|
|
441
|
-
* @description Message id required for threaded messages
|
|
295
|
+
* @type {string | number}
|
|
442
296
|
*/
|
|
443
297
|
parentMessageId?: string | number;
|
|
298
|
+
|
|
444
299
|
/**
|
|
445
|
-
*
|
|
446
|
-
*
|
|
447
|
-
* @type {boolean}
|
|
448
|
-
* @description Hide the live reaction button
|
|
449
|
-
*/
|
|
450
|
-
hideLiveReaction?: boolean;
|
|
451
|
-
/**
|
|
452
|
-
*
|
|
453
|
-
*
|
|
454
|
-
* @type {ImageType}
|
|
455
|
-
* @description Live reaction Icon
|
|
456
|
-
*/
|
|
457
|
-
liveReactionIcon?: ImageType;
|
|
458
|
-
/**
|
|
459
|
-
*
|
|
460
|
-
*
|
|
461
|
-
* @type {MessageComposerStyleInterface}
|
|
462
|
-
* @description Message Composer Styles
|
|
300
|
+
* Custom styles for the message composer component.
|
|
463
301
|
*/
|
|
464
|
-
|
|
302
|
+
style?: DeepPartial<CometChatTheme["messageComposerStyles"]>;
|
|
303
|
+
|
|
465
304
|
/**
|
|
466
|
-
*
|
|
305
|
+
* Flag to hide the voice recording button.
|
|
467
306
|
*
|
|
468
307
|
* @type {boolean}
|
|
469
|
-
* @description Hide the record voice button
|
|
470
|
-
*/
|
|
471
|
-
hideVoiceRecording?: boolean;
|
|
472
|
-
/**
|
|
473
|
-
*
|
|
474
|
-
*
|
|
475
|
-
* @type {string}
|
|
476
|
-
* @description Image URL for the voice recording icon
|
|
477
|
-
*/
|
|
478
|
-
voiceRecordingIconURL?: string;
|
|
479
|
-
/**
|
|
480
|
-
*
|
|
481
|
-
*
|
|
482
|
-
* @type {MediaRecorderStyle}
|
|
483
|
-
* @description Voice Recording Styles
|
|
484
|
-
*/
|
|
485
|
-
mediaRecorderStyle?: MediaRecorderStyle;
|
|
486
|
-
/**
|
|
487
|
-
*
|
|
488
|
-
*
|
|
489
|
-
* @type {ImageType}
|
|
490
|
-
* @description Pause Icon Icon
|
|
491
|
-
*/
|
|
492
|
-
pauseIconUrl?: ImageType;
|
|
493
|
-
/**
|
|
494
|
-
*
|
|
495
|
-
*
|
|
496
|
-
* @type {ImageType}
|
|
497
|
-
* @description Play Icon Icon
|
|
498
|
-
*/
|
|
499
|
-
playIconUrl?: ImageType;
|
|
500
|
-
/**
|
|
501
|
-
*
|
|
502
|
-
*
|
|
503
|
-
* @type {ImageType}
|
|
504
|
-
* @description Record Icon Icon
|
|
505
|
-
*/
|
|
506
|
-
recordIconUrl?: ImageType;
|
|
507
|
-
/**
|
|
508
|
-
*
|
|
509
|
-
*
|
|
510
|
-
* @type {ImageType}
|
|
511
|
-
* @description Delete Icon Icon
|
|
512
|
-
*/
|
|
513
|
-
deleteIconUrl?: ImageType;
|
|
514
|
-
/**
|
|
515
|
-
*
|
|
516
|
-
*
|
|
517
|
-
* @type {ImageType}
|
|
518
|
-
* @description Stop Icon Icon
|
|
519
308
|
*/
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
*
|
|
523
|
-
*
|
|
524
|
-
* @type {ImageType}
|
|
525
|
-
* @description Submit Icon Icon
|
|
526
|
-
*/
|
|
527
|
-
submitIconUrl?: ImageType;
|
|
309
|
+
hideVoiceRecordingButton?: boolean;
|
|
310
|
+
|
|
528
311
|
/**
|
|
312
|
+
* Callback triggered when the send button is pressed.
|
|
529
313
|
*
|
|
530
|
-
* @
|
|
531
|
-
* @description callback(BaseMessage)→ void
|
|
314
|
+
* @param {CometChat.BaseMessage} message - The base message object.
|
|
532
315
|
*/
|
|
533
316
|
onSendButtonPress?: (message: CometChat.BaseMessage) => void;
|
|
317
|
+
|
|
534
318
|
/**
|
|
319
|
+
* Callback triggered when an error occurs.
|
|
535
320
|
*
|
|
536
|
-
* @
|
|
537
|
-
* @description callback(error)→ void
|
|
321
|
+
* @param {CometChat.CometChatException} error - The error object.
|
|
538
322
|
*/
|
|
539
|
-
onError?: (error:
|
|
540
|
-
|
|
541
|
-
* AI Icon URL.
|
|
542
|
-
*/
|
|
543
|
-
AIIconURL?: string;
|
|
544
|
-
/**
|
|
545
|
-
* AI Options Style.
|
|
546
|
-
*/
|
|
547
|
-
aiOptionsStyle?: AIOptionsStyle;
|
|
323
|
+
onError?: (error: CometChat.CometChatException) => void;
|
|
324
|
+
|
|
548
325
|
/**
|
|
549
|
-
*
|
|
326
|
+
* Override properties for the KeyboardAvoidingView.
|
|
550
327
|
*/
|
|
551
328
|
keyboardAvoidingViewProps?: KeyboardAvoidingViewProps;
|
|
329
|
+
|
|
552
330
|
/**
|
|
553
|
-
* Collection of text formatter
|
|
331
|
+
* Collection of text formatter classes to apply custom formatting.
|
|
332
|
+
*
|
|
554
333
|
* @type {Array<CometChatMentionsFormatter | CometChatUrlsFormatter | CometChatTextFormatter>}
|
|
555
334
|
*/
|
|
556
335
|
textFormatters?: Array<
|
|
557
336
|
CometChatMentionsFormatter | CometChatUrlsFormatter | CometChatTextFormatter
|
|
558
337
|
>;
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* Flag to disable mention functionality.
|
|
341
|
+
*/
|
|
559
342
|
disableMentions?: boolean;
|
|
560
|
-
|
|
561
|
-
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Controls image quality when taking pictures from the camera.
|
|
346
|
+
* A value of 100 means no compression.
|
|
347
|
+
*
|
|
562
348
|
* @default 20
|
|
349
|
+
* @type {IntRange<1, 100>}
|
|
563
350
|
*/
|
|
564
351
|
imageQuality?: IntRange<1, 100>;
|
|
565
352
|
}
|
|
353
|
+
|
|
566
354
|
export const CometChatMessageComposer = React.forwardRef(
|
|
567
355
|
(props: CometChatMessageComposerInterface, ref) => {
|
|
568
|
-
const editMessageListenerID =
|
|
569
|
-
const UiEventListenerID =
|
|
356
|
+
const editMessageListenerID = "editMessageListener_" + new Date().getTime();
|
|
357
|
+
const UiEventListenerID = "UiEventListener_" + new Date().getTime();
|
|
570
358
|
|
|
571
|
-
const
|
|
359
|
+
const theme = useTheme();
|
|
572
360
|
const {
|
|
573
361
|
id,
|
|
574
362
|
user,
|
|
575
363
|
group,
|
|
576
|
-
|
|
364
|
+
disableSoundForOutgoingMessages = true,
|
|
365
|
+
customSoundForOutgoingMessage,
|
|
577
366
|
disableTypingEvents,
|
|
578
|
-
|
|
579
|
-
placeHolderText,
|
|
367
|
+
initialComposertext,
|
|
580
368
|
HeaderView,
|
|
581
|
-
|
|
582
|
-
onChangeText,
|
|
583
|
-
maxHeight,
|
|
369
|
+
onTextChange,
|
|
584
370
|
attachmentOptions,
|
|
585
|
-
SecondaryButtonView,
|
|
586
371
|
AuxiliaryButtonView,
|
|
587
|
-
auxiliaryButtonsAlignment,
|
|
588
372
|
SendButtonView,
|
|
589
373
|
parentMessageId,
|
|
374
|
+
style = {},
|
|
590
375
|
onSendButtonPress,
|
|
591
376
|
onError,
|
|
592
|
-
|
|
593
|
-
voiceRecordingIconURL,
|
|
594
|
-
mediaRecorderStyle,
|
|
595
|
-
pauseIconUrl,
|
|
596
|
-
playIconUrl,
|
|
597
|
-
recordIconUrl,
|
|
598
|
-
deleteIconUrl,
|
|
599
|
-
stopIconUrl,
|
|
600
|
-
submitIconUrl,
|
|
601
|
-
AIIconURL,
|
|
602
|
-
aiOptionsStyle,
|
|
377
|
+
hideVoiceRecordingButton,
|
|
603
378
|
keyboardAvoidingViewProps,
|
|
604
379
|
textFormatters,
|
|
605
380
|
disableMentions,
|
|
606
381
|
imageQuality = 20,
|
|
607
|
-
|
|
608
|
-
attachmentIcon = ICONS.ADD,
|
|
609
|
-
liveReactionIcon = ICONS.HEART,
|
|
610
|
-
hideLiveReaction = true,
|
|
611
|
-
disableSoundForMessages = true,
|
|
612
|
-
messageComposerStyle = {},
|
|
613
382
|
} = props;
|
|
614
383
|
|
|
615
|
-
const
|
|
616
|
-
ChatConfigurator.dataSource.getAttachmentOptions(user, group, id);
|
|
384
|
+
const composerIdMap = new Map().set("parentMessageId", parentMessageId);
|
|
617
385
|
|
|
618
|
-
const
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
386
|
+
const mergedComposerStyle: CometChatTheme["messageComposerStyles"] = useMemo(() => {
|
|
387
|
+
return deepMerge(theme.messageComposerStyles, style);
|
|
388
|
+
}, [theme, style]);
|
|
389
|
+
|
|
390
|
+
const defaultAuxiliaryButtonOptions = useMemo(() => {
|
|
391
|
+
return ChatConfigurator.getDataSource().getAuxiliaryOptions(user, group, composerIdMap, {
|
|
392
|
+
stickerIcon: mergedComposerStyle.stickerIcon as ImageSourcePropType | JSX.Element,
|
|
393
|
+
stickerIconStyle: mergedComposerStyle.stickerIconStyle as {
|
|
394
|
+
active: ImageStyle;
|
|
395
|
+
inactive: ImageStyle;
|
|
396
|
+
},
|
|
397
|
+
});
|
|
398
|
+
}, [mergedComposerStyle]);
|
|
626
399
|
|
|
627
400
|
const loggedInUser = React.useRef<any>({});
|
|
628
401
|
const chatWith = React.useRef<any>(null);
|
|
@@ -630,46 +403,45 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
630
403
|
const messageInputRef = React.useRef<any>(null);
|
|
631
404
|
const chatRef = React.useRef<any>(chatWith);
|
|
632
405
|
const inputValueRef = React.useRef<any>(null);
|
|
633
|
-
const plainTextInput = React.useRef<string>(
|
|
406
|
+
const plainTextInput = React.useRef<string>("");
|
|
634
407
|
let mentionMap = React.useRef<Map<string, SuggestionItem>>(new Map());
|
|
635
408
|
let trackingCharacters = React.useRef<string[]>([]);
|
|
636
409
|
let allFormatters = React.useRef<
|
|
637
410
|
Map<string, CometChatTextFormatter | CometChatMentionsFormatter>
|
|
638
411
|
>(new Map());
|
|
639
|
-
let activeCharacter = React.useRef(
|
|
640
|
-
let searchStringRef = React.useRef(
|
|
412
|
+
let activeCharacter = React.useRef("");
|
|
413
|
+
let searchStringRef = React.useRef("");
|
|
641
414
|
|
|
642
415
|
const [selectionPosition, setSelectionPosition] = React.useState<any>({});
|
|
643
|
-
const [inputMessage, setInputMessage] = React.useState<
|
|
644
|
-
|
|
645
|
-
|
|
416
|
+
const [inputMessage, setInputMessage] = React.useState<string | JSX.Element>(
|
|
417
|
+
initialComposertext || ""
|
|
418
|
+
);
|
|
646
419
|
const [showReaction, setShowReaction] = React.useState(false);
|
|
647
|
-
const [showEmojiboard, setShowEmojiboard] = React.useState(false);
|
|
648
420
|
const [showActionSheet, setShowActionSheet] = React.useState(false);
|
|
649
421
|
const [showRecordAudio, setShowRecordAudio] = React.useState(false);
|
|
650
422
|
const [showAIOptions, setShowAIOptions] = React.useState(false);
|
|
651
423
|
const [AIOptionItems, setAIOptionItems] = React.useState([]);
|
|
652
424
|
const [rootAIOptionItems, setRootAIOptionItems] = React.useState([]);
|
|
653
425
|
const [actionSheetItems, setActionSheetItems] = React.useState([]);
|
|
654
|
-
const [messagePreview, setMessagePreview] = React.useState<any>(
|
|
655
|
-
const [CustomView, setCustomView] = React.useState
|
|
656
|
-
const [CustomViewHeader, setCustomViewHeader] = React.useState<
|
|
657
|
-
|
|
426
|
+
const [messagePreview, setMessagePreview] = React.useState<any>();
|
|
427
|
+
const [CustomView, setCustomView] = React.useState(null);
|
|
428
|
+
const [CustomViewHeader, setCustomViewHeader] = React.useState<React.FC | React.ReactNode>(
|
|
429
|
+
null
|
|
430
|
+
);
|
|
431
|
+
const [CustomViewFooter, setCustomViewFooter] = React.useState<React.FC | React.ReactNode>();
|
|
658
432
|
const [isVisible, setIsVisible] = React.useState(false);
|
|
659
433
|
const [kbOffset, setKbOffset] = React.useState(59);
|
|
660
434
|
const [showMentionList, setShowMentionList] = React.useState(false);
|
|
661
|
-
const [mentionsSearchData, setMentionsSearchData] = React.useState<
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
const [suggestionListLoader, setSuggestionListLoader] =
|
|
665
|
-
React.useState(false);
|
|
435
|
+
const [mentionsSearchData, setMentionsSearchData] = React.useState<Array<SuggestionItem>>([]);
|
|
436
|
+
const [suggestionListLoader, setSuggestionListLoader] = React.useState(false);
|
|
437
|
+
const [warningMessage, setWarningMessage] = React.useState("");
|
|
666
438
|
|
|
667
439
|
const bottomSheetRef = React.useRef<any>(null);
|
|
668
440
|
|
|
669
441
|
useLayoutEffect(() => {
|
|
670
|
-
if (Platform.OS ===
|
|
442
|
+
if (Platform.OS === "ios") {
|
|
671
443
|
if (Number.isInteger(commonVars.safeAreaInsets.top)) {
|
|
672
|
-
setKbOffset(commonVars.safeAreaInsets.top
|
|
444
|
+
setKbOffset(commonVars.safeAreaInsets.top ?? 0);
|
|
673
445
|
return;
|
|
674
446
|
}
|
|
675
447
|
CommonUtil.getSafeAreaInsets().then((res: any) => {
|
|
@@ -682,19 +454,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
682
454
|
}
|
|
683
455
|
}, []);
|
|
684
456
|
|
|
685
|
-
const
|
|
686
|
-
//NEED TO ADD DEFAULT STYLE HERE
|
|
687
|
-
backgroundColor: theme.palette.getBackgroundColor(),
|
|
688
|
-
listItemBackground: theme.palette.getBackgroundColor(),
|
|
689
|
-
listItemTitleFont: theme.typography.subtitle1,
|
|
690
|
-
listItemTitleColor: theme.palette.getAccent(),
|
|
691
|
-
listItemBorderRadius: 0,
|
|
692
|
-
optionsSeparatorTint: theme.palette.getAccent200(),
|
|
693
|
-
borderRadius: 0,
|
|
694
|
-
...aiOptionsStyle,
|
|
695
|
-
});
|
|
696
|
-
|
|
697
|
-
let isTyping = useRef<any>(null);
|
|
457
|
+
const isTyping = useRef<NodeJS.Timeout | null>(null);
|
|
698
458
|
|
|
699
459
|
/**
|
|
700
460
|
* Event callback
|
|
@@ -703,6 +463,40 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
703
463
|
previewMessageForEdit: previewMessage,
|
|
704
464
|
}));
|
|
705
465
|
|
|
466
|
+
useLayoutEffect(() => {
|
|
467
|
+
if (warningMessage) {
|
|
468
|
+
setCustomViewHeader(
|
|
469
|
+
<View
|
|
470
|
+
style={
|
|
471
|
+
{
|
|
472
|
+
flexDirection: "row",
|
|
473
|
+
alignItems: "center",
|
|
474
|
+
padding: theme.spacing.padding.p2,
|
|
475
|
+
borderRadius: mergedComposerStyle?.containerStyle?.borderRadius,
|
|
476
|
+
backgroundColor: mergedComposerStyle?.containerStyle?.backgroundColor,
|
|
477
|
+
borderColor: mergedComposerStyle?.containerStyle?.borderColor,
|
|
478
|
+
borderWidth: mergedComposerStyle?.containerStyle?.borderWidth,
|
|
479
|
+
marginBottom: 2,
|
|
480
|
+
} as ViewStyle
|
|
481
|
+
}
|
|
482
|
+
>
|
|
483
|
+
<Icon name='info-fill' color={theme.color.error}></Icon>
|
|
484
|
+
<Text
|
|
485
|
+
style={{
|
|
486
|
+
marginLeft: 5,
|
|
487
|
+
color: theme.color.error,
|
|
488
|
+
...theme.typography.caption1.regular,
|
|
489
|
+
}}
|
|
490
|
+
>
|
|
491
|
+
{warningMessage}
|
|
492
|
+
</Text>
|
|
493
|
+
</View>
|
|
494
|
+
);
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
497
|
+
setCustomViewHeader(null);
|
|
498
|
+
}, [warningMessage, theme]);
|
|
499
|
+
|
|
706
500
|
const previewMessage = ({ message, status }: any) => {
|
|
707
501
|
if (status === messageStatus.inprogress) {
|
|
708
502
|
let textComponents = message?.text;
|
|
@@ -712,25 +506,25 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
712
506
|
let users: any = {};
|
|
713
507
|
let regexes: Array<RegExp> = [];
|
|
714
508
|
|
|
715
|
-
allFormatters.current.forEach(
|
|
716
|
-
(
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
regexes.push(formatter.getRegexPattern());
|
|
720
|
-
}
|
|
721
|
-
let suggestionUsers = formatter.getSuggestionItems();
|
|
722
|
-
suggestionUsers.forEach(
|
|
723
|
-
(item) => (users[item.underlyingText] = item)
|
|
724
|
-
);
|
|
725
|
-
let resp = formatter.getFormattedText(textComponents);
|
|
726
|
-
textComponents = resp;
|
|
509
|
+
allFormatters.current.forEach((formatter: CometChatTextFormatter, key) => {
|
|
510
|
+
formatter.handleComposerPreview(message);
|
|
511
|
+
if (!regexes.includes(formatter.getRegexPattern())) {
|
|
512
|
+
regexes.push(formatter.getRegexPattern());
|
|
727
513
|
}
|
|
728
|
-
|
|
514
|
+
let suggestionUsers = formatter.getSuggestionItems();
|
|
515
|
+
suggestionUsers.forEach((item) => (users[item.underlyingText] = item));
|
|
516
|
+
let resp = formatter.getFormattedText(textComponents);
|
|
517
|
+
if (formatter instanceof CometChatMentionsFormatter) {
|
|
518
|
+
getMentionLimitView(formatter);
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
textComponents = resp;
|
|
522
|
+
});
|
|
729
523
|
|
|
730
|
-
let edits: any
|
|
524
|
+
let edits: any = [];
|
|
731
525
|
|
|
732
526
|
regexes.forEach((regex) => {
|
|
733
|
-
let match;
|
|
527
|
+
let match: any;
|
|
734
528
|
while ((match = regex.exec(rawText)) !== null) {
|
|
735
529
|
const user = users[match[0]];
|
|
736
530
|
if (user) {
|
|
@@ -745,41 +539,38 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
745
539
|
});
|
|
746
540
|
|
|
747
541
|
// Sort edits by startIndex to apply them in order
|
|
748
|
-
edits.sort((a, b) => a.startIndex - b.startIndex);
|
|
542
|
+
edits.sort((a: any, b: any) => a.startIndex - b.startIndex);
|
|
749
543
|
|
|
750
544
|
plainTextInput.current = getPlainString(message?.text, edits);
|
|
751
545
|
|
|
752
546
|
const hashMap = new Map();
|
|
753
547
|
let offset = 0; // Tracks shift in position due to replacements
|
|
754
548
|
|
|
755
|
-
edits.forEach((edit) => {
|
|
549
|
+
edits.forEach((edit: any) => {
|
|
756
550
|
const adjustedStartIndex = edit.startIndex + offset;
|
|
757
551
|
rawText =
|
|
758
552
|
rawText.substring(0, adjustedStartIndex) +
|
|
759
553
|
edit.replacement +
|
|
760
554
|
rawText.substring(edit.endIndex);
|
|
761
555
|
offset += edit.replacement.length - (edit.endIndex - edit.startIndex);
|
|
762
|
-
const rangeKey = `${adjustedStartIndex}_${
|
|
763
|
-
adjustedStartIndex + edit.replacement.length
|
|
764
|
-
}`;
|
|
556
|
+
const rangeKey = `${adjustedStartIndex}_${adjustedStartIndex + edit.replacement.length}`;
|
|
765
557
|
hashMap.set(rangeKey, edit.user);
|
|
766
558
|
});
|
|
767
559
|
|
|
768
560
|
mentionMap.current = hashMap;
|
|
769
|
-
|
|
770
561
|
setMessagePreview({
|
|
771
562
|
message: { ...message, text: textComponents },
|
|
772
563
|
mode: ConversationOptionConstants.edit,
|
|
773
564
|
});
|
|
774
565
|
|
|
775
|
-
inputValueRef.current = textComponents ??
|
|
776
|
-
setInputMessage(textComponents ??
|
|
566
|
+
inputValueRef.current = textComponents ?? "";
|
|
567
|
+
setInputMessage(textComponents ?? "");
|
|
777
568
|
messageInputRef.current.focus();
|
|
778
569
|
}
|
|
779
570
|
};
|
|
780
571
|
|
|
781
572
|
const cameraCallback = async (cameraImage: any) => {
|
|
782
|
-
if (CheckPropertyExists(cameraImage,
|
|
573
|
+
if (CheckPropertyExists(cameraImage, "error")) {
|
|
783
574
|
return;
|
|
784
575
|
}
|
|
785
576
|
const { name, uri, type } = cameraImage;
|
|
@@ -788,32 +579,24 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
788
579
|
type,
|
|
789
580
|
uri,
|
|
790
581
|
};
|
|
791
|
-
sendMediaMessage(
|
|
792
|
-
chatWithId.current,
|
|
793
|
-
file,
|
|
794
|
-
MessageTypeConstants.image,
|
|
795
|
-
chatWith.current
|
|
796
|
-
);
|
|
582
|
+
sendMediaMessage(chatWithId.current, file, MessageTypeConstants.image, chatWith.current);
|
|
797
583
|
};
|
|
798
584
|
|
|
799
585
|
const fileInputHandler = async (fileType: string) => {
|
|
800
586
|
if (fileType === MessageTypeConstants.takePhoto) {
|
|
801
|
-
if (!(await permissionUtil.startResourceBasedTask([
|
|
587
|
+
if (!(await permissionUtil.startResourceBasedTask(["camera"]))) {
|
|
802
588
|
return;
|
|
803
589
|
}
|
|
804
590
|
let quality = imageQuality;
|
|
805
591
|
if (isNaN(imageQuality) || imageQuality < 1 || imageQuality > 100) {
|
|
806
592
|
quality = 20;
|
|
807
593
|
}
|
|
808
|
-
if (Platform.OS ===
|
|
594
|
+
if (Platform.OS === "android") {
|
|
809
595
|
FileManager.openCamera(fileType, Math.round(quality), cameraCallback);
|
|
810
596
|
} else {
|
|
811
597
|
FileManager.openCamera(fileType, cameraCallback);
|
|
812
598
|
}
|
|
813
|
-
} else if (
|
|
814
|
-
Platform.OS === 'ios' &&
|
|
815
|
-
fileType === MessageTypeConstants.video
|
|
816
|
-
) {
|
|
599
|
+
} else if (Platform.OS === "ios" && fileType === MessageTypeConstants.video) {
|
|
817
600
|
NativeModules.VideoPickerModule.pickVideo((file: any) => {
|
|
818
601
|
if (file.uri)
|
|
819
602
|
sendMediaMessage(
|
|
@@ -825,7 +608,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
825
608
|
});
|
|
826
609
|
} else
|
|
827
610
|
FileManager.openFileChooser(fileType, async (fileInfo: any) => {
|
|
828
|
-
if (CheckPropertyExists(fileInfo,
|
|
611
|
+
if (CheckPropertyExists(fileInfo, "error")) {
|
|
829
612
|
return;
|
|
830
613
|
}
|
|
831
614
|
let { name, uri, type } = fileInfo;
|
|
@@ -834,61 +617,24 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
834
617
|
type,
|
|
835
618
|
uri,
|
|
836
619
|
};
|
|
837
|
-
sendMediaMessage(
|
|
838
|
-
chatWithId.current,
|
|
839
|
-
file,
|
|
840
|
-
fileType,
|
|
841
|
-
chatWith.current
|
|
842
|
-
);
|
|
620
|
+
sendMediaMessage(chatWithId.current, file, fileType, chatWith.current);
|
|
843
621
|
});
|
|
844
622
|
};
|
|
845
623
|
|
|
846
624
|
const playAudio = () => {
|
|
847
|
-
if (
|
|
625
|
+
if (customSoundForOutgoingMessage) {
|
|
848
626
|
CometChatSoundManager.play(
|
|
849
627
|
CometChatSoundManager.SoundOutput.outgoingMessage,
|
|
850
|
-
|
|
628
|
+
customSoundForOutgoingMessage
|
|
851
629
|
);
|
|
852
630
|
} else {
|
|
853
|
-
CometChatSoundManager.play(
|
|
854
|
-
CometChatSoundManager.SoundOutput.outgoingMessage
|
|
855
|
-
);
|
|
856
|
-
}
|
|
857
|
-
};
|
|
858
|
-
|
|
859
|
-
const liveReactionHandler = () => {
|
|
860
|
-
if (hideLiveReaction) return;
|
|
861
|
-
if (!showReaction) {
|
|
862
|
-
setShowReaction(true);
|
|
863
|
-
|
|
864
|
-
//send reaction event
|
|
865
|
-
const data = {
|
|
866
|
-
type: MetadataConstants.liveReaction,
|
|
867
|
-
reaction: liveReactionIcon,
|
|
868
|
-
};
|
|
869
|
-
|
|
870
|
-
/*** send transient message */
|
|
871
|
-
let transientMessage = new CometChat.TransientMessage(
|
|
872
|
-
chatWithId.current,
|
|
873
|
-
chatWith.current,
|
|
874
|
-
data
|
|
875
|
-
);
|
|
876
|
-
|
|
877
|
-
CometChat.sendTransientMessage(transientMessage);
|
|
878
|
-
|
|
879
|
-
setTimeout(() => {
|
|
880
|
-
setShowReaction(false);
|
|
881
|
-
CometChatUIEventHandler.emitMessageEvent(
|
|
882
|
-
MessageEvents.ccMessageLiveReaction,
|
|
883
|
-
{ liveReactionIcon }
|
|
884
|
-
);
|
|
885
|
-
}, 1500);
|
|
631
|
+
CometChatSoundManager.play(CometChatSoundManager.SoundOutput.outgoingMessage);
|
|
886
632
|
}
|
|
887
633
|
};
|
|
888
634
|
|
|
889
635
|
const clearInputBox = () => {
|
|
890
|
-
inputValueRef.current =
|
|
891
|
-
setInputMessage(
|
|
636
|
+
inputValueRef.current = "";
|
|
637
|
+
setInputMessage("");
|
|
892
638
|
};
|
|
893
639
|
|
|
894
640
|
const sendTextMessage = () => {
|
|
@@ -899,28 +645,31 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
899
645
|
}
|
|
900
646
|
|
|
901
647
|
let finalTextInput = getRegexString(plainTextInput.current);
|
|
648
|
+
// Trim the trailing spaces and store in a variable
|
|
649
|
+
let trimmedTextInput = finalTextInput.trim();
|
|
902
650
|
|
|
903
|
-
|
|
651
|
+
// Create the text message with the trimmed text
|
|
652
|
+
let textMessage = new CometChat.TextMessage(
|
|
904
653
|
chatWithId.current,
|
|
905
|
-
|
|
654
|
+
trimmedTextInput,
|
|
906
655
|
chatWith.current
|
|
907
656
|
);
|
|
908
657
|
|
|
909
658
|
textMessage.setSender(loggedInUser.current);
|
|
910
659
|
textMessage.setReceiver(chatWith.current);
|
|
911
|
-
|
|
660
|
+
// Use the trimmed text here as well
|
|
661
|
+
textMessage.setText(trimmedTextInput);
|
|
912
662
|
textMessage.setMuid(String(getUnixTimestampInMilliseconds()));
|
|
913
|
-
parentMessageId &&
|
|
914
|
-
textMessage.setParentMessageId(parentMessageId as number);
|
|
663
|
+
parentMessageId && textMessage.setParentMessageId(parentMessageId as number);
|
|
915
664
|
|
|
916
665
|
allFormatters.current.forEach((item) => {
|
|
917
666
|
textMessage = item.handlePreMessageSend(textMessage);
|
|
918
667
|
});
|
|
919
668
|
|
|
920
669
|
setMentionsSearchData([]);
|
|
921
|
-
plainTextInput.current =
|
|
670
|
+
plainTextInput.current = "";
|
|
922
671
|
|
|
923
|
-
if (
|
|
672
|
+
if (trimmedTextInput.trim().length === 0) {
|
|
924
673
|
return;
|
|
925
674
|
}
|
|
926
675
|
|
|
@@ -936,28 +685,22 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
936
685
|
status: messageStatus.inprogress,
|
|
937
686
|
});
|
|
938
687
|
|
|
939
|
-
if (!
|
|
688
|
+
if (!disableSoundForOutgoingMessages) playAudio();
|
|
940
689
|
|
|
941
690
|
CometChat.sendMessage(textMessage)
|
|
942
691
|
.then((message: any) => {
|
|
943
|
-
CometChatUIEventHandler.emitMessageEvent(
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
status: messageStatus.success,
|
|
948
|
-
}
|
|
949
|
-
);
|
|
692
|
+
CometChatUIEventHandler.emitMessageEvent(MessageEvents.ccMessageSent, {
|
|
693
|
+
message: message,
|
|
694
|
+
status: messageStatus.success,
|
|
695
|
+
});
|
|
950
696
|
})
|
|
951
697
|
.catch((error: any) => {
|
|
952
698
|
onError && onError(error);
|
|
953
|
-
textMessage.
|
|
954
|
-
CometChatUIEventHandler.emitMessageEvent(
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
status: messageStatus.error,
|
|
959
|
-
}
|
|
960
|
-
);
|
|
699
|
+
textMessage.setMetadata({ error: true });
|
|
700
|
+
CometChatUIEventHandler.emitMessageEvent(MessageEvents.ccMessageSent, {
|
|
701
|
+
message: textMessage,
|
|
702
|
+
status: messageStatus.error,
|
|
703
|
+
});
|
|
961
704
|
clearInputBox();
|
|
962
705
|
});
|
|
963
706
|
};
|
|
@@ -975,12 +718,11 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
975
718
|
chatWith.current
|
|
976
719
|
);
|
|
977
720
|
textMessage.setId(message.id);
|
|
978
|
-
parentMessageId &&
|
|
979
|
-
textMessage.setParentMessageId(parentMessageId as number);
|
|
721
|
+
parentMessageId && textMessage.setParentMessageId(parentMessageId as number);
|
|
980
722
|
|
|
981
|
-
inputValueRef.current =
|
|
982
|
-
setInputMessage(
|
|
983
|
-
messageInputRef.current.textContent =
|
|
723
|
+
inputValueRef.current = "";
|
|
724
|
+
setInputMessage("");
|
|
725
|
+
messageInputRef.current.textContent = "";
|
|
984
726
|
|
|
985
727
|
setMessagePreview(null);
|
|
986
728
|
|
|
@@ -989,19 +731,16 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
989
731
|
return;
|
|
990
732
|
}
|
|
991
733
|
|
|
992
|
-
if (!
|
|
734
|
+
if (!disableSoundForOutgoingMessages) playAudio();
|
|
993
735
|
|
|
994
736
|
CometChat.editMessage(textMessage)
|
|
995
737
|
.then((editedMessage: any) => {
|
|
996
|
-
inputValueRef.current =
|
|
997
|
-
setInputMessage(
|
|
998
|
-
CometChatUIEventHandler.emitMessageEvent(
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
status: messageStatus.success,
|
|
1003
|
-
}
|
|
1004
|
-
);
|
|
738
|
+
inputValueRef.current = "";
|
|
739
|
+
setInputMessage("");
|
|
740
|
+
CometChatUIEventHandler.emitMessageEvent(MessageEvents.ccMessageEdited, {
|
|
741
|
+
message: editedMessage,
|
|
742
|
+
status: messageStatus.success,
|
|
743
|
+
});
|
|
1005
744
|
})
|
|
1006
745
|
.catch((error: any) => {
|
|
1007
746
|
onError && onError(error);
|
|
@@ -1016,7 +755,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1016
755
|
receiverType?: any
|
|
1017
756
|
) => {
|
|
1018
757
|
setShowActionSheet(false);
|
|
1019
|
-
let mediaMessage
|
|
758
|
+
let mediaMessage = new CometChat.MediaMessage(
|
|
1020
759
|
receiverId,
|
|
1021
760
|
messageInput,
|
|
1022
761
|
messageType,
|
|
@@ -1030,15 +769,14 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1030
769
|
mediaMessage.setData({
|
|
1031
770
|
type: messageType,
|
|
1032
771
|
category: CometChat.CATEGORY_MESSAGE,
|
|
1033
|
-
name: messageInput[
|
|
772
|
+
name: messageInput["name"],
|
|
1034
773
|
file: messageInput,
|
|
1035
|
-
url: messageInput[
|
|
774
|
+
url: messageInput["uri"],
|
|
1036
775
|
sender: loggedInUser.current,
|
|
1037
776
|
});
|
|
1038
|
-
parentMessageId &&
|
|
1039
|
-
mediaMessage.setParentMessageId(parentMessageId as number);
|
|
777
|
+
parentMessageId && mediaMessage.setParentMessageId(parentMessageId as number);
|
|
1040
778
|
|
|
1041
|
-
let localMessage
|
|
779
|
+
let localMessage = new CometChat.MediaMessage(
|
|
1042
780
|
receiverId,
|
|
1043
781
|
messageInput,
|
|
1044
782
|
messageType,
|
|
@@ -1046,25 +784,24 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1046
784
|
);
|
|
1047
785
|
|
|
1048
786
|
localMessage.setSender(loggedInUser.current);
|
|
1049
|
-
localMessage.setReceiver(
|
|
787
|
+
localMessage.setReceiver(receiverType);
|
|
1050
788
|
localMessage.setType(messageType);
|
|
1051
789
|
localMessage.setMuid(String(getUnixTimestampInMilliseconds()));
|
|
1052
790
|
localMessage.setData({
|
|
1053
791
|
type: messageType,
|
|
1054
792
|
category: CometChat.CATEGORY_MESSAGE,
|
|
1055
|
-
name: messageInput[
|
|
793
|
+
name: messageInput["name"],
|
|
1056
794
|
file: messageInput,
|
|
1057
|
-
url: messageInput[
|
|
795
|
+
url: messageInput["uri"],
|
|
1058
796
|
sender: loggedInUser.current,
|
|
1059
797
|
});
|
|
1060
|
-
parentMessageId &&
|
|
1061
|
-
localMessage.setParentMessageId(parentMessageId as number);
|
|
798
|
+
parentMessageId && localMessage.setParentMessageId(parentMessageId as number);
|
|
1062
799
|
localMessage.setData({
|
|
1063
800
|
type: messageType,
|
|
1064
801
|
category: CometChat.CATEGORY_MESSAGE,
|
|
1065
|
-
name: messageInput[
|
|
802
|
+
name: messageInput["name"],
|
|
1066
803
|
file: messageInput,
|
|
1067
|
-
url: messageInput[
|
|
804
|
+
url: messageInput["uri"],
|
|
1068
805
|
sender: loggedInUser.current,
|
|
1069
806
|
attachments: [messageInput],
|
|
1070
807
|
});
|
|
@@ -1074,30 +811,24 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1074
811
|
status: messageStatus.inprogress,
|
|
1075
812
|
});
|
|
1076
813
|
|
|
1077
|
-
if (!
|
|
814
|
+
if (!disableSoundForOutgoingMessages) playAudio();
|
|
1078
815
|
CometChat.sendMediaMessage(mediaMessage)
|
|
1079
816
|
.then((message: any) => {
|
|
1080
|
-
CometChatUIEventHandler.emitMessageEvent(
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
status: messageStatus.success,
|
|
1085
|
-
}
|
|
1086
|
-
);
|
|
817
|
+
CometChatUIEventHandler.emitMessageEvent(MessageEvents.ccMessageSent, {
|
|
818
|
+
message: message,
|
|
819
|
+
status: messageStatus.success,
|
|
820
|
+
});
|
|
1087
821
|
setShowRecordAudio(false);
|
|
1088
822
|
})
|
|
1089
823
|
.catch((error: any) => {
|
|
1090
824
|
setShowRecordAudio(false);
|
|
1091
825
|
onError && onError(error);
|
|
1092
|
-
localMessage.
|
|
1093
|
-
CometChatUIEventHandler.emitMessageEvent(
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
}
|
|
1099
|
-
);
|
|
1100
|
-
console.log('media message sent error', error);
|
|
826
|
+
localMessage.setMetadata({ error: true });
|
|
827
|
+
CometChatUIEventHandler.emitMessageEvent(MessageEvents.ccMessageSent, {
|
|
828
|
+
message: localMessage,
|
|
829
|
+
status: messageStatus.error,
|
|
830
|
+
});
|
|
831
|
+
console.log("media message sent error", error);
|
|
1101
832
|
});
|
|
1102
833
|
};
|
|
1103
834
|
|
|
@@ -1152,160 +883,141 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1152
883
|
return false;
|
|
1153
884
|
};
|
|
1154
885
|
|
|
1155
|
-
const
|
|
886
|
+
const SecondaryButtonViewElem = useMemo(() => {
|
|
1156
887
|
return (
|
|
1157
|
-
<
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
888
|
+
<AttachIconButton
|
|
889
|
+
onPress={() => setShowActionSheet(true)}
|
|
890
|
+
icon={mergedComposerStyle.attachmentIcon as JSX.Element | ImageSourcePropType}
|
|
891
|
+
iconStyle={mergedComposerStyle.attachmentIconStyle as ImageStyle}
|
|
1161
892
|
/>
|
|
1162
893
|
);
|
|
894
|
+
}, [mergedComposerStyle]);
|
|
895
|
+
|
|
896
|
+
const RecordAudioButtonView = ({
|
|
897
|
+
icon,
|
|
898
|
+
iconStyle,
|
|
899
|
+
}: {
|
|
900
|
+
icon: JSX.Element | ImageSourcePropType;
|
|
901
|
+
iconStyle?: ImageStyle;
|
|
902
|
+
}) => {
|
|
903
|
+
return (
|
|
904
|
+
<TouchableOpacity onPress={() => setShowRecordAudio(true)}>
|
|
905
|
+
<Icon
|
|
906
|
+
name='mic'
|
|
907
|
+
height={24}
|
|
908
|
+
width={24}
|
|
909
|
+
icon={icon}
|
|
910
|
+
color={iconStyle?.tintColor ?? theme.color.iconSecondary}
|
|
911
|
+
imageStyle={iconStyle}
|
|
912
|
+
/>
|
|
913
|
+
</TouchableOpacity>
|
|
914
|
+
);
|
|
1163
915
|
};
|
|
1164
916
|
|
|
1165
|
-
const
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
const AuxiliaryButtonViewElem = () => {
|
|
1170
|
-
if (AuxiliaryButtonView && id)
|
|
1171
|
-
return (
|
|
1172
|
-
<AuxiliaryButtonView user={user} group={group} composerId={id} />
|
|
1173
|
-
);
|
|
917
|
+
const AuxiliaryButtonViewElem = useCallback(() => {
|
|
918
|
+
if (AuxiliaryButtonView)
|
|
919
|
+
return <AuxiliaryButtonView user={user} group={group} composerId={id!} />;
|
|
1174
920
|
else if (defaultAuxiliaryButtonOptions)
|
|
1175
921
|
return (
|
|
1176
|
-
<View
|
|
922
|
+
<View
|
|
923
|
+
style={{
|
|
924
|
+
flexDirection: "row",
|
|
925
|
+
alignItems: "center",
|
|
926
|
+
gap: theme.spacing.spacing.s2,
|
|
927
|
+
}}
|
|
928
|
+
>
|
|
929
|
+
{!hideVoiceRecordingButton && (
|
|
930
|
+
<RecordAudioButtonView
|
|
931
|
+
icon={mergedComposerStyle.voiceRecordingIcon as ImageSourcePropType | JSX.Element}
|
|
932
|
+
iconStyle={mergedComposerStyle.voiceRecordingIconStyle as ImageStyle}
|
|
933
|
+
/>
|
|
934
|
+
)}
|
|
1177
935
|
{defaultAuxiliaryButtonOptions}
|
|
1178
|
-
{
|
|
1179
|
-
{!hideVoiceRecording && <RecordAudioButtonView />}
|
|
936
|
+
{AIOptionItems.length > 0 && mentionsSearchData.length == 0 && <AIOptionsButtonView />}
|
|
1180
937
|
</View>
|
|
1181
938
|
);
|
|
1182
939
|
|
|
1183
|
-
return
|
|
1184
|
-
|
|
940
|
+
return hideVoiceRecordingButton ? undefined : (
|
|
941
|
+
<RecordAudioButtonView
|
|
942
|
+
icon={mergedComposerStyle.voiceRecordingIcon as ImageSourcePropType | JSX.Element}
|
|
943
|
+
iconStyle={mergedComposerStyle.voiceRecordingIconStyle as ImageStyle}
|
|
944
|
+
/>
|
|
945
|
+
);
|
|
946
|
+
}, [AIOptionItems, mentionsSearchData, mergedComposerStyle, defaultAuxiliaryButtonOptions]);
|
|
1185
947
|
|
|
1186
|
-
const SendButtonViewElem = () => {
|
|
1187
|
-
if (SendButtonView
|
|
1188
|
-
|
|
948
|
+
const SendButtonViewElem = useCallback(() => {
|
|
949
|
+
if (SendButtonView) return <SendButtonView user={user} group={group} composerId={id!} />;
|
|
950
|
+
const disabled = typeof inputMessage === "string" && inputMessage.length === 0;
|
|
1189
951
|
return (
|
|
1190
|
-
<
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
Style.imageStyle,
|
|
952
|
+
<TouchableOpacity
|
|
953
|
+
onPress={sendTextMessage}
|
|
954
|
+
style={[
|
|
1194
955
|
{
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
: messageComposerStyle?.sendIconTint ||
|
|
1199
|
-
theme.palette.getPrimary(),
|
|
956
|
+
borderRadius: theme.spacing.radius.max,
|
|
957
|
+
padding: 4,
|
|
958
|
+
backgroundColor: disabled ? theme.color.background4 : theme.color.fabButtonBackground,
|
|
1200
959
|
},
|
|
960
|
+
mergedComposerStyle.sendIconContainerStyle as ViewStyle,
|
|
1201
961
|
]}
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
<AttachIconButton
|
|
1215
|
-
icon={attachmentIcon}
|
|
1216
|
-
show={true}
|
|
1217
|
-
onClick={() => setShowActionSheet(true)}
|
|
1218
|
-
style={{
|
|
1219
|
-
height: 23,
|
|
1220
|
-
width: 23,
|
|
1221
|
-
resizeMode: 'contain',
|
|
1222
|
-
tintColor: messageComposerStyle?.attachIconTint
|
|
1223
|
-
? messageComposerStyle.attachIconTint
|
|
1224
|
-
: theme.palette.getAccent(),
|
|
1225
|
-
}}
|
|
1226
|
-
/>
|
|
1227
|
-
);
|
|
1228
|
-
};
|
|
1229
|
-
const PrimaryButtonView = () => {
|
|
1230
|
-
return (inputMessage as String).length !== 0 || hideLiveReaction ? (
|
|
1231
|
-
<SendButtonViewElem />
|
|
1232
|
-
) : (
|
|
1233
|
-
<View>
|
|
1234
|
-
<View style={Style.liveReactionStyle}>
|
|
1235
|
-
<LiveReaction show={showReaction} reaction={liveReactionIcon} />
|
|
1236
|
-
</View>
|
|
1237
|
-
<ImageButton
|
|
1238
|
-
image={liveReactionIcon}
|
|
1239
|
-
imageStyle={[Style.imageStyle, Style.liveReactionBtnStyle]}
|
|
1240
|
-
onClick={liveReactionHandler}
|
|
962
|
+
disabled={disabled}
|
|
963
|
+
>
|
|
964
|
+
<Icon
|
|
965
|
+
name='send-fill'
|
|
966
|
+
icon={mergedComposerStyle.sendIcon as ImageSourcePropType | JSX.Element}
|
|
967
|
+
color={
|
|
968
|
+
(mergedComposerStyle.sendIconStyle?.tintColor ??
|
|
969
|
+
theme.color.fabButtonIcon) as ColorValue
|
|
970
|
+
}
|
|
971
|
+
imageStyle={mergedComposerStyle.sendIconStyle as ImageStyle}
|
|
972
|
+
height={24}
|
|
973
|
+
width={24}
|
|
1241
974
|
/>
|
|
1242
|
-
</
|
|
975
|
+
</TouchableOpacity>
|
|
1243
976
|
);
|
|
1244
|
-
};
|
|
977
|
+
}, [mergedComposerStyle]);
|
|
1245
978
|
|
|
1246
|
-
const RecordAudioButtonView = () => {
|
|
1247
|
-
return (
|
|
1248
|
-
<ImageButton
|
|
1249
|
-
image={voiceRecordingIconURL || ICONS.MICROPHONE}
|
|
1250
|
-
imageStyle={[
|
|
1251
|
-
Style.imageStyle,
|
|
1252
|
-
messageComposerStyle?.voiceRecordingIconTint
|
|
1253
|
-
? { tintColor: messageComposerStyle?.voiceRecordingIconTint }
|
|
1254
|
-
: {},
|
|
1255
|
-
]}
|
|
1256
|
-
onClick={() => setShowRecordAudio(true)}
|
|
1257
|
-
/>
|
|
1258
|
-
);
|
|
1259
|
-
};
|
|
1260
979
|
const AIOptionsButtonView = () => {
|
|
1261
980
|
return (
|
|
1262
|
-
<
|
|
1263
|
-
|
|
1264
|
-
imageStyle={Style.imageStyle}
|
|
1265
|
-
onClick={() => {
|
|
981
|
+
<TouchableOpacity
|
|
982
|
+
onPress={() => {
|
|
1266
983
|
setShowAIOptions(true);
|
|
1267
984
|
setAIOptionItems(rootAIOptionItems);
|
|
1268
985
|
}}
|
|
1269
|
-
|
|
986
|
+
>
|
|
987
|
+
<Icon
|
|
988
|
+
name='ai'
|
|
989
|
+
height={24}
|
|
990
|
+
width={24}
|
|
991
|
+
color={theme.color.iconSecondary}
|
|
992
|
+
containerStyle={{ paddingBottom: 2 }}
|
|
993
|
+
/>
|
|
994
|
+
</TouchableOpacity>
|
|
1270
995
|
);
|
|
1271
996
|
};
|
|
1272
997
|
|
|
1273
998
|
//fetch logged in user
|
|
1274
999
|
useEffect(() => {
|
|
1275
|
-
CometChat.getLoggedinUser().then(
|
|
1276
|
-
|
|
1277
|
-
);
|
|
1278
|
-
let _formatter = [...(textFormatters ?? [])];
|
|
1000
|
+
CometChat.getLoggedinUser().then((user) => (loggedInUser.current = user));
|
|
1001
|
+
let _formatter = [...(textFormatters || [])];
|
|
1279
1002
|
|
|
1280
1003
|
if (!disableMentions) {
|
|
1281
|
-
let mentionsFormatter =
|
|
1282
|
-
|
|
1283
|
-
CometChatUIKit.loggedInUser &&
|
|
1284
|
-
mentionsFormatter.setLoggedInUser(CometChatUIKit.loggedInUser);
|
|
1004
|
+
let mentionsFormatter = ChatConfigurator.getDataSource().getMentionsFormatter();
|
|
1005
|
+
mentionsFormatter.setLoggedInUser(CometChatUIKit.loggedInUser!);
|
|
1285
1006
|
mentionsFormatter.setMentionsStyle(
|
|
1286
|
-
|
|
1287
|
-
loggedInUserTextStyle: {
|
|
1288
|
-
color: theme.palette.getPrimary(),
|
|
1289
|
-
...theme.typography.title2,
|
|
1290
|
-
fontSize: 17,
|
|
1291
|
-
} as TextStyle,
|
|
1292
|
-
textStyle: {
|
|
1293
|
-
color: theme.palette.getPrimary(),
|
|
1294
|
-
...theme.typography.subtitle1,
|
|
1295
|
-
fontSize: 17,
|
|
1296
|
-
} as TextStyle,
|
|
1297
|
-
})
|
|
1007
|
+
mergedComposerStyle.mentionsStyle as CometChatTheme["mentionsStyle"]
|
|
1298
1008
|
);
|
|
1299
|
-
|
|
1300
|
-
|
|
1009
|
+
mentionsFormatter.setTargetElement(MentionsTargetElement.textinput);
|
|
1010
|
+
|
|
1011
|
+
if (user) mentionsFormatter.setUser(user);
|
|
1012
|
+
if (group) mentionsFormatter.setGroup(group);
|
|
1301
1013
|
|
|
1302
1014
|
_formatter.unshift(mentionsFormatter);
|
|
1303
1015
|
}
|
|
1304
1016
|
|
|
1305
1017
|
_formatter.forEach((formatter) => {
|
|
1306
|
-
|
|
1307
|
-
user
|
|
1308
|
-
group
|
|
1018
|
+
formatter.setComposerId(id!);
|
|
1019
|
+
if (user) formatter.setUser(user);
|
|
1020
|
+
if (group) formatter.setGroup(group);
|
|
1309
1021
|
let trackingCharacter = formatter.getTrackingCharacter();
|
|
1310
1022
|
trackingCharacters.current.push(trackingCharacter);
|
|
1311
1023
|
|
|
@@ -1355,45 +1067,46 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1355
1067
|
};
|
|
1356
1068
|
|
|
1357
1069
|
useEffect(() => {
|
|
1358
|
-
const defaultAttachmentOptions =
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1070
|
+
const defaultAttachmentOptions = ChatConfigurator.dataSource.getAttachmentOptions(
|
|
1071
|
+
theme,
|
|
1072
|
+
user,
|
|
1073
|
+
group,
|
|
1074
|
+
composerIdMap
|
|
1075
|
+
);
|
|
1364
1076
|
setActionSheetItems(() =>
|
|
1365
|
-
attachmentOptions && typeof attachmentOptions ===
|
|
1366
|
-
? attachmentOptions({ user, group, composerId: composerIdMap })?.map(
|
|
1367
|
-
(item
|
|
1368
|
-
if (typeof item.CustomView === 'function')
|
|
1369
|
-
return {
|
|
1370
|
-
...item,
|
|
1371
|
-
onPress: () => handleOnClick(item.CustomView),
|
|
1372
|
-
};
|
|
1373
|
-
if (typeof item.onPress == 'function')
|
|
1374
|
-
return {
|
|
1375
|
-
...item,
|
|
1376
|
-
onPress: () => {
|
|
1377
|
-
setShowActionSheet(false);
|
|
1378
|
-
item.onPress?.(user, group);
|
|
1379
|
-
},
|
|
1380
|
-
};
|
|
1077
|
+
attachmentOptions && typeof attachmentOptions === "function"
|
|
1078
|
+
? attachmentOptions({ user, group, composerId: composerIdMap })?.map((item) => {
|
|
1079
|
+
if (typeof item.CustomView === "function")
|
|
1381
1080
|
return {
|
|
1382
1081
|
...item,
|
|
1383
|
-
onPress: () =>
|
|
1082
|
+
onPress: () => handleOnClick(item.CustomView),
|
|
1384
1083
|
};
|
|
1385
|
-
|
|
1386
|
-
|
|
1084
|
+
if (typeof item.onPress == "function")
|
|
1085
|
+
return {
|
|
1086
|
+
...item,
|
|
1087
|
+
onPress: () => {
|
|
1088
|
+
setShowActionSheet(false);
|
|
1089
|
+
item.onPress?.(user, group);
|
|
1090
|
+
},
|
|
1091
|
+
};
|
|
1092
|
+
return {
|
|
1093
|
+
...item,
|
|
1094
|
+
onPress: () => fileInputHandler(item.id),
|
|
1095
|
+
};
|
|
1096
|
+
})
|
|
1387
1097
|
: defaultAttachmentOptions.map((item: any) => {
|
|
1388
|
-
if (typeof item.CustomView ===
|
|
1098
|
+
if (typeof item.CustomView === "function")
|
|
1389
1099
|
return {
|
|
1390
1100
|
...item,
|
|
1391
1101
|
onPress: () => handleOnClick(item.CustomView),
|
|
1392
1102
|
};
|
|
1393
|
-
if (typeof item.onPress ===
|
|
1103
|
+
if (typeof item.onPress === "function")
|
|
1394
1104
|
return {
|
|
1395
1105
|
...item,
|
|
1396
|
-
onPress: () =>
|
|
1106
|
+
onPress: () => {
|
|
1107
|
+
setShowActionSheet(false);
|
|
1108
|
+
item.onPress?.(user, group);
|
|
1109
|
+
},
|
|
1397
1110
|
};
|
|
1398
1111
|
return {
|
|
1399
1112
|
...item,
|
|
@@ -1401,43 +1114,8 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1401
1114
|
};
|
|
1402
1115
|
})
|
|
1403
1116
|
);
|
|
1404
|
-
|
|
1405
|
-
const aiOptions = ChatConfigurator.dataSource.getAIOptions(
|
|
1406
|
-
user as CometChat.User,
|
|
1407
|
-
group as CometChat.Group,
|
|
1408
|
-
theme,
|
|
1409
|
-
composerIdMap,
|
|
1410
|
-
AIStyles
|
|
1411
|
-
);
|
|
1412
|
-
let newAiOptions: any = _getAIOptions(aiOptions);
|
|
1413
|
-
setAIOptionItems(newAiOptions);
|
|
1414
|
-
setRootAIOptionItems(newAiOptions);
|
|
1415
1117
|
}, [user, group, id, parentMessageId]);
|
|
1416
1118
|
|
|
1417
|
-
const _getAIOptions = (
|
|
1418
|
-
options: (
|
|
1419
|
-
| CometChatMessageOption
|
|
1420
|
-
| CometChatMessageComposerActionInterface
|
|
1421
|
-
)[]
|
|
1422
|
-
) => {
|
|
1423
|
-
let newOptions = [...options];
|
|
1424
|
-
let newAiOptions = newOptions.map((item: any) => {
|
|
1425
|
-
if (typeof item.onPress === 'function')
|
|
1426
|
-
return {
|
|
1427
|
-
...item,
|
|
1428
|
-
onPress: () => {
|
|
1429
|
-
setShowAIOptions(false);
|
|
1430
|
-
item?.onPress?.(user);
|
|
1431
|
-
},
|
|
1432
|
-
};
|
|
1433
|
-
return {
|
|
1434
|
-
...item,
|
|
1435
|
-
onPress: () => {},
|
|
1436
|
-
};
|
|
1437
|
-
});
|
|
1438
|
-
return newAiOptions;
|
|
1439
|
-
};
|
|
1440
|
-
|
|
1441
1119
|
useEffect(() => {
|
|
1442
1120
|
CometChatUIEventHandler.addMessageListener(editMessageListenerID, {
|
|
1443
1121
|
ccMessageEdited: (item: any) => previewMessage(item),
|
|
@@ -1445,9 +1123,9 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1445
1123
|
CometChatUIEventHandler.addUIListener(UiEventListenerID, {
|
|
1446
1124
|
ccToggleBottomSheet: (item) => {
|
|
1447
1125
|
if (item?.bots) {
|
|
1448
|
-
let newAiOptions
|
|
1449
|
-
setAIOptionItems(newAiOptions);
|
|
1450
|
-
setShowAIOptions(true);
|
|
1126
|
+
// let newAiOptions = _getAIOptions(item.bots);
|
|
1127
|
+
// setAIOptionItems(newAiOptions);
|
|
1128
|
+
// setShowAIOptions(true);
|
|
1451
1129
|
return;
|
|
1452
1130
|
} else if (item?.botView) {
|
|
1453
1131
|
setCustomView(() => item.child);
|
|
@@ -1461,14 +1139,14 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1461
1139
|
bottomSheetRef.current?.togglePanel();
|
|
1462
1140
|
|
|
1463
1141
|
inputValueRef.current = text?.text;
|
|
1464
|
-
plainTextInput.current = text?.text;
|
|
1465
1142
|
setInputMessage(text?.text);
|
|
1466
1143
|
},
|
|
1467
|
-
ccSuggestionData(item: {
|
|
1468
|
-
id: string | number;
|
|
1469
|
-
data: Array<SuggestionItem>;
|
|
1470
|
-
}) {
|
|
1144
|
+
ccSuggestionData(item: { id: string | number; data: Array<SuggestionItem> }) {
|
|
1471
1145
|
if (activeCharacter.current && id === item?.id) {
|
|
1146
|
+
const warningView = getMentionLimitView();
|
|
1147
|
+
if (warningView) {
|
|
1148
|
+
return;
|
|
1149
|
+
}
|
|
1472
1150
|
setMentionsSearchData(item?.data);
|
|
1473
1151
|
setSuggestionListLoader(false);
|
|
1474
1152
|
}
|
|
@@ -1482,15 +1160,12 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1482
1160
|
|
|
1483
1161
|
const handlePannel = (item: any) => {
|
|
1484
1162
|
if (item.child) {
|
|
1485
|
-
if (item.alignment === ViewAlignment.composerTop)
|
|
1486
|
-
setCustomViewHeader(() => item.child);
|
|
1163
|
+
if (item.alignment === ViewAlignment.composerTop) setCustomViewHeader(() => item.child);
|
|
1487
1164
|
else if (item.alignment === ViewAlignment.composerBottom)
|
|
1488
1165
|
setCustomViewFooter(() => item.child);
|
|
1489
1166
|
} else {
|
|
1490
|
-
if (item.alignment === ViewAlignment.composerTop)
|
|
1491
|
-
|
|
1492
|
-
else if (item.alignment === ViewAlignment.composerBottom)
|
|
1493
|
-
setCustomViewFooter(null);
|
|
1167
|
+
if (item.alignment === ViewAlignment.composerTop) setCustomViewHeader(null);
|
|
1168
|
+
else if (item.alignment === ViewAlignment.composerBottom) setCustomViewFooter(undefined);
|
|
1494
1169
|
}
|
|
1495
1170
|
};
|
|
1496
1171
|
|
|
@@ -1509,26 +1184,18 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1509
1184
|
|
|
1510
1185
|
const _sendRecordedAudio = (recordedFile: String) => {
|
|
1511
1186
|
let fileObj = {
|
|
1512
|
-
name:
|
|
1513
|
-
type:
|
|
1187
|
+
name: "audio-recording" + recordedFile.split("/audio-recording")[1],
|
|
1188
|
+
type: "audio/mp4",
|
|
1514
1189
|
uri: recordedFile,
|
|
1515
1190
|
};
|
|
1516
|
-
console.log(
|
|
1517
|
-
sendMediaMessage(
|
|
1518
|
-
|
|
1519
|
-
fileObj,
|
|
1520
|
-
MessageTypeConstants.audio,
|
|
1521
|
-
chatWith.current
|
|
1522
|
-
);
|
|
1523
|
-
console.log('Send Audio');
|
|
1191
|
+
console.log("fileObj", fileObj);
|
|
1192
|
+
sendMediaMessage(chatWithId.current, fileObj, MessageTypeConstants.audio, chatWith.current);
|
|
1193
|
+
console.log("Send Audio");
|
|
1524
1194
|
};
|
|
1525
1195
|
|
|
1526
|
-
function isCursorWithinMentionRange(
|
|
1527
|
-
mentionRanges: any,
|
|
1528
|
-
cursorPosition: number
|
|
1529
|
-
) {
|
|
1196
|
+
function isCursorWithinMentionRange(mentionRanges: any, cursorPosition: number) {
|
|
1530
1197
|
for (let [range, mention] of mentionRanges) {
|
|
1531
|
-
const [start, end] = range.split(
|
|
1198
|
+
const [start, end] = range.split("_").map(Number);
|
|
1532
1199
|
if (cursorPosition >= start && cursorPosition <= end) {
|
|
1533
1200
|
return true; // Cursor is within the range of a mention
|
|
1534
1201
|
}
|
|
@@ -1546,15 +1213,11 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1546
1213
|
) {
|
|
1547
1214
|
return (
|
|
1548
1215
|
selection.start === selection.end &&
|
|
1549
|
-
!isCursorWithinMentionRange(
|
|
1550
|
-
mentionMap.current,
|
|
1551
|
-
selection.start - searchString.length
|
|
1552
|
-
) &&
|
|
1216
|
+
!isCursorWithinMentionRange(mentionMap.current, selection.start - searchString.length) &&
|
|
1553
1217
|
trackingCharacters.current.includes(tracker) &&
|
|
1554
|
-
(searchString ===
|
|
1218
|
+
(searchString === ""
|
|
1555
1219
|
? (plainTextInput.current[selection.start - 2]?.length === 1 &&
|
|
1556
|
-
plainTextInput.current[selection.start - 2]?.trim()?.length ===
|
|
1557
|
-
0) ||
|
|
1220
|
+
plainTextInput.current[selection.start - 2]?.trim()?.length === 0) ||
|
|
1558
1221
|
plainTextInput.current[selection.start - 2] === undefined
|
|
1559
1222
|
: true) &&
|
|
1560
1223
|
(plainTextInput.current[selection.start - 1]?.length === 1 &&
|
|
@@ -1564,14 +1227,11 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1564
1227
|
);
|
|
1565
1228
|
}
|
|
1566
1229
|
|
|
1567
|
-
let timeoutId:
|
|
1230
|
+
let timeoutId: NodeJS.Timeout;
|
|
1568
1231
|
const openList = (selection: { start: number; end: number }) => {
|
|
1569
1232
|
clearTimeout(timeoutId);
|
|
1570
1233
|
timeoutId = setTimeout(() => {
|
|
1571
|
-
let searchString = extractTextFromCursor(
|
|
1572
|
-
plainTextInput.current,
|
|
1573
|
-
selection.start
|
|
1574
|
-
);
|
|
1234
|
+
let searchString = extractTextFromCursor(plainTextInput.current, selection.start);
|
|
1575
1235
|
let tracker = searchString
|
|
1576
1236
|
? plainTextInput.current[selection.start - (searchString.length + 1)]
|
|
1577
1237
|
: plainTextInput.current[selection.start - 1];
|
|
@@ -1585,21 +1245,17 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1585
1245
|
if (formatter instanceof CometChatMentionsFormatter) {
|
|
1586
1246
|
let shouldShowMentionList =
|
|
1587
1247
|
formatter.getVisibleIn() === MentionsVisibility.both ||
|
|
1588
|
-
(formatter.getVisibleIn() ===
|
|
1589
|
-
|
|
1590
|
-
user) ||
|
|
1591
|
-
(formatter.getVisibleIn() ===
|
|
1592
|
-
MentionsVisibility.groupsConversationOnly &&
|
|
1593
|
-
group);
|
|
1248
|
+
(formatter.getVisibleIn() === MentionsVisibility.usersConversationOnly && user) ||
|
|
1249
|
+
(formatter.getVisibleIn() === MentionsVisibility.groupsConversationOnly && group);
|
|
1594
1250
|
if (shouldShowMentionList) {
|
|
1595
|
-
formatter
|
|
1251
|
+
formatter?.search(searchString);
|
|
1596
1252
|
}
|
|
1597
1253
|
} else {
|
|
1598
1254
|
formatter?.search(searchString);
|
|
1599
1255
|
}
|
|
1600
1256
|
} else {
|
|
1601
|
-
activeCharacter.current =
|
|
1602
|
-
searchStringRef.current =
|
|
1257
|
+
activeCharacter.current = "";
|
|
1258
|
+
searchStringRef.current = "";
|
|
1603
1259
|
setShowMentionList(false);
|
|
1604
1260
|
setMentionsSearchData([]);
|
|
1605
1261
|
}
|
|
@@ -1614,7 +1270,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1614
1270
|
|
|
1615
1271
|
// Iterate over the array in reverse order
|
|
1616
1272
|
entries.forEach(([key, value]) => {
|
|
1617
|
-
let [start, end] = key.split(
|
|
1273
|
+
let [start, end] = key.split("_").map(Number);
|
|
1618
1274
|
|
|
1619
1275
|
let pre = uidInput.substring(0, start);
|
|
1620
1276
|
let post = uidInput.substring(end);
|
|
@@ -1657,18 +1313,15 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1657
1313
|
let notAtLast = selectionPosition.start + textDiff < txt.length;
|
|
1658
1314
|
|
|
1659
1315
|
plainTextInput.current = txt;
|
|
1660
|
-
|
|
1316
|
+
onTextChange && onTextChange(txt);
|
|
1661
1317
|
startTyping();
|
|
1662
1318
|
|
|
1663
1319
|
let decr = 0;
|
|
1664
1320
|
|
|
1665
|
-
let newMentionMap = new Map(mentionMap.current);
|
|
1321
|
+
let newMentionMap: any = new Map(mentionMap.current);
|
|
1666
1322
|
|
|
1667
1323
|
mentionMap.current.forEach((value, key) => {
|
|
1668
|
-
let position = {
|
|
1669
|
-
start: parseInt(key.split('_')[0]),
|
|
1670
|
-
end: parseInt(key.split('_')[1]),
|
|
1671
|
-
};
|
|
1324
|
+
let position = { start: parseInt(key.split("_")[0]), end: parseInt(key.split("_")[1]) };
|
|
1672
1325
|
|
|
1673
1326
|
//Runs when cursor before the mention and before the last position
|
|
1674
1327
|
|
|
@@ -1679,16 +1332,10 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1679
1332
|
) {
|
|
1680
1333
|
if (removing) {
|
|
1681
1334
|
decr = selectionPosition.end - selectionPosition.start - textDiff;
|
|
1682
|
-
position = {
|
|
1683
|
-
start: position.start - decr,
|
|
1684
|
-
end: position.end - decr,
|
|
1685
|
-
};
|
|
1335
|
+
position = { start: position.start - decr, end: position.end - decr };
|
|
1686
1336
|
} else if (adding) {
|
|
1687
1337
|
decr = selectionPosition.end - selectionPosition.start + textDiff;
|
|
1688
|
-
position = {
|
|
1689
|
-
start: position.start + decr,
|
|
1690
|
-
end: position.end + decr,
|
|
1691
|
-
};
|
|
1338
|
+
position = { start: position.start + decr, end: position.end + decr };
|
|
1692
1339
|
}
|
|
1693
1340
|
if (removing || adding) {
|
|
1694
1341
|
let newKey = `${position.start}_${position.end}`;
|
|
@@ -1698,28 +1345,28 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1698
1345
|
}
|
|
1699
1346
|
|
|
1700
1347
|
// Code to delete mention from hashmap 👇
|
|
1701
|
-
let expctedMentionPos = plainTextInput.current.substring(
|
|
1702
|
-
position.start,
|
|
1703
|
-
position.end
|
|
1704
|
-
);
|
|
1348
|
+
let expctedMentionPos = plainTextInput.current.substring(position.start, position.end);
|
|
1705
1349
|
|
|
1706
1350
|
if (expctedMentionPos !== `${value.promptText}`) {
|
|
1707
1351
|
let newKey = `${position.start}_${position.end}`;
|
|
1708
1352
|
newMentionMap.delete(newKey);
|
|
1709
1353
|
|
|
1710
1354
|
if (!ifIdExists(value.id, newMentionMap)) {
|
|
1711
|
-
let targetedFormatter
|
|
1712
|
-
|
|
1713
|
-
);
|
|
1355
|
+
let targetedFormatter = allFormatters.current.get(value.trackingCharacter!);
|
|
1356
|
+
if (!targetedFormatter) return;
|
|
1714
1357
|
let existingCCUsers = [...targetedFormatter.getSuggestionItems()];
|
|
1715
1358
|
let userPosition = existingCCUsers.findIndex(
|
|
1716
1359
|
(item: SuggestionItem) => item.id === value.id
|
|
1717
1360
|
);
|
|
1718
1361
|
if (userPosition !== -1) {
|
|
1719
1362
|
existingCCUsers.splice(userPosition, 1);
|
|
1720
|
-
(
|
|
1721
|
-
|
|
1722
|
-
|
|
1363
|
+
(targetedFormatter as CometChatMentionsFormatter).setSuggestionItems(existingCCUsers);
|
|
1364
|
+
}
|
|
1365
|
+
if (targetedFormatter instanceof CometChatMentionsFormatter) {
|
|
1366
|
+
let showWarning = getMentionLimitView(targetedFormatter);
|
|
1367
|
+
if (!showWarning) {
|
|
1368
|
+
setWarningMessage("");
|
|
1369
|
+
}
|
|
1723
1370
|
}
|
|
1724
1371
|
}
|
|
1725
1372
|
}
|
|
@@ -1738,7 +1385,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1738
1385
|
|
|
1739
1386
|
let textDiff =
|
|
1740
1387
|
plainTextInput.current.length +
|
|
1741
|
-
item.promptText
|
|
1388
|
+
(item.promptText?.length ?? 0) -
|
|
1742
1389
|
searchStringRef.current.length -
|
|
1743
1390
|
plainTextInput.current.length;
|
|
1744
1391
|
|
|
@@ -1747,10 +1394,8 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1747
1394
|
|
|
1748
1395
|
let newMentionMap = new Map(mentionMap.current);
|
|
1749
1396
|
|
|
1750
|
-
let targetedFormatter
|
|
1751
|
-
|
|
1752
|
-
);
|
|
1753
|
-
|
|
1397
|
+
let targetedFormatter = allFormatters.current.get(activeCharacter.current);
|
|
1398
|
+
if (!targetedFormatter) return;
|
|
1754
1399
|
let existingCCUsers = [...targetedFormatter.getSuggestionItems()];
|
|
1755
1400
|
let userAlreadyExists = existingCCUsers.find(
|
|
1756
1401
|
(existingUser: SuggestionItem) => existingUser.id === item.id
|
|
@@ -1758,15 +1403,10 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1758
1403
|
if (!userAlreadyExists) {
|
|
1759
1404
|
let cometchatUIUserArray: Array<SuggestionItem> = [...existingCCUsers];
|
|
1760
1405
|
cometchatUIUserArray.push(item);
|
|
1761
|
-
(targetedFormatter as CometChatMentionsFormatter).setSuggestionItems(
|
|
1762
|
-
cometchatUIUserArray
|
|
1763
|
-
);
|
|
1406
|
+
(targetedFormatter as CometChatMentionsFormatter).setSuggestionItems(cometchatUIUserArray);
|
|
1764
1407
|
}
|
|
1765
1408
|
mentionMap.current.forEach((value, key) => {
|
|
1766
|
-
let position = {
|
|
1767
|
-
start: parseInt(key.split('_')[0]),
|
|
1768
|
-
end: parseInt(key.split('_')[1]),
|
|
1769
|
-
};
|
|
1409
|
+
let position = { start: parseInt(key.split("_")[0]), end: parseInt(key.split("_")[1]) };
|
|
1770
1410
|
|
|
1771
1411
|
if (!(selectionPosition.start <= position.start)) {
|
|
1772
1412
|
mentionPos += 1;
|
|
@@ -1775,8 +1415,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1775
1415
|
// Code to delete mention from hashmap 👇
|
|
1776
1416
|
if (
|
|
1777
1417
|
position.end === selectionPosition.end ||
|
|
1778
|
-
(selectionPosition.start > position.start &&
|
|
1779
|
-
selectionPosition.end <= position.end)
|
|
1418
|
+
(selectionPosition.start > position.start && selectionPosition.end <= position.end)
|
|
1780
1419
|
) {
|
|
1781
1420
|
let newKey = `${position.start}_${position.end}`;
|
|
1782
1421
|
newMentionMap.delete(newKey);
|
|
@@ -1796,7 +1435,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1796
1435
|
const updatedPlainTextInput = `${plainTextInput.current.substring(
|
|
1797
1436
|
0,
|
|
1798
1437
|
selectionPosition.start - (1 + searchStringRef.current.length)
|
|
1799
|
-
)}${item.promptText +
|
|
1438
|
+
)}${item.promptText + " "}${plainTextInput.current.substring(
|
|
1800
1439
|
selectionPosition.end,
|
|
1801
1440
|
plainTextInput.current.length
|
|
1802
1441
|
)}`;
|
|
@@ -1805,10 +1444,10 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1805
1444
|
let key =
|
|
1806
1445
|
selectionPosition.start -
|
|
1807
1446
|
(1 + searchStringRef.current.length) +
|
|
1808
|
-
|
|
1447
|
+
"_" +
|
|
1809
1448
|
(selectionPosition.start -
|
|
1810
1449
|
(searchStringRef.current.length + 1) +
|
|
1811
|
-
item.promptText
|
|
1450
|
+
(item.promptText?.length ?? 0));
|
|
1812
1451
|
|
|
1813
1452
|
let updatedMap = insertMentionAt(mentionMap.current, mentionPos, key, {
|
|
1814
1453
|
...item,
|
|
@@ -1822,7 +1461,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1822
1461
|
const setFormattedInputMessage = () => {
|
|
1823
1462
|
let textComponents: any = getRegexString(plainTextInput.current);
|
|
1824
1463
|
|
|
1825
|
-
allFormatters.current.forEach((formatter, key) => {
|
|
1464
|
+
allFormatters.current.forEach((formatter: CometChatTextFormatter, key) => {
|
|
1826
1465
|
let resp = formatter.getFormattedText(textComponents);
|
|
1827
1466
|
textComponents = resp;
|
|
1828
1467
|
});
|
|
@@ -1832,16 +1471,14 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1832
1471
|
};
|
|
1833
1472
|
|
|
1834
1473
|
function escapeRegExp(string: string) {
|
|
1835
|
-
return string.replace(/[.*+?^${}()|[\]\\]/g,
|
|
1474
|
+
return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1836
1475
|
}
|
|
1837
1476
|
|
|
1838
1477
|
function extractTextFromCursor(inputText: string, cursorPosition: number) {
|
|
1839
1478
|
const leftText = inputText.substring(0, cursorPosition);
|
|
1840
1479
|
|
|
1841
1480
|
// Escape the mentionPrefixes to safely use them in a regex pattern
|
|
1842
|
-
const escapedPrefixes = trackingCharacters.current
|
|
1843
|
-
.map(escapeRegExp)
|
|
1844
|
-
.join('|');
|
|
1481
|
+
const escapedPrefixes = trackingCharacters.current.map(escapeRegExp).join("|");
|
|
1845
1482
|
|
|
1846
1483
|
// Build a dynamic regex pattern that matches any of the mention prefixes.
|
|
1847
1484
|
// This pattern will match a prefix followed by any combination of word characters
|
|
@@ -1852,12 +1489,12 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1852
1489
|
const match = leftText.match(mentionRegex);
|
|
1853
1490
|
|
|
1854
1491
|
// If a match is found, return the first capturing group, which is the username
|
|
1855
|
-
return (match && substringUpToNthSpace(match[2], 4)) ||
|
|
1492
|
+
return (match && substringUpToNthSpace(match[2], 4)) || "";
|
|
1856
1493
|
}
|
|
1857
1494
|
|
|
1858
1495
|
function substringUpToNthSpace(str: string, n: number) {
|
|
1859
1496
|
// Split the string by spaces, slice to the (n-1) elements, and then rejoin with spaces
|
|
1860
|
-
return str.split(
|
|
1497
|
+
return str.split(" ", n).join(" ");
|
|
1861
1498
|
}
|
|
1862
1499
|
|
|
1863
1500
|
const insertMentionAt = (
|
|
@@ -1889,18 +1526,18 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1889
1526
|
};
|
|
1890
1527
|
|
|
1891
1528
|
const onSuggestionListEndReached = () => {
|
|
1892
|
-
let targetedFormatter = allFormatters.current.get(
|
|
1893
|
-
activeCharacter.current
|
|
1894
|
-
);
|
|
1529
|
+
let targetedFormatter = allFormatters.current.get(activeCharacter.current);
|
|
1895
1530
|
if (!targetedFormatter) return;
|
|
1896
1531
|
let fetchingNext = targetedFormatter.fetchNext();
|
|
1897
1532
|
fetchingNext !== null && setSuggestionListLoader(true);
|
|
1898
1533
|
};
|
|
1899
1534
|
|
|
1900
|
-
const getMentionLimitView = () => {
|
|
1901
|
-
let targetedFormatter
|
|
1902
|
-
activeCharacter.current
|
|
1903
|
-
)
|
|
1535
|
+
const getMentionLimitView = (targettedFormatterParam?: CometChatMentionsFormatter) => {
|
|
1536
|
+
let targetedFormatter =
|
|
1537
|
+
allFormatters.current.get(activeCharacter.current) ?? targettedFormatterParam;
|
|
1538
|
+
if (!(targetedFormatter instanceof CometChatMentionsFormatter)) {
|
|
1539
|
+
return;
|
|
1540
|
+
}
|
|
1904
1541
|
let shouldWarn;
|
|
1905
1542
|
let limit;
|
|
1906
1543
|
if (targetedFormatter?.getLimit && targetedFormatter?.getLimit()) {
|
|
@@ -1912,128 +1549,58 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1912
1549
|
shouldWarn = true;
|
|
1913
1550
|
}
|
|
1914
1551
|
}
|
|
1915
|
-
if (!shouldWarn)
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
alignItems: 'center',
|
|
1926
|
-
paddingTop: 5,
|
|
1927
|
-
paddingLeft: 5,
|
|
1928
|
-
borderTopWidth: 1,
|
|
1929
|
-
borderTopColor: theme.palette.getAccent300(),
|
|
1930
|
-
}}
|
|
1931
|
-
>
|
|
1932
|
-
<Image
|
|
1933
|
-
style={{
|
|
1934
|
-
tintColor: theme.palette.getAccent500(),
|
|
1935
|
-
height: 20,
|
|
1936
|
-
width: 20,
|
|
1937
|
-
}}
|
|
1938
|
-
source={ICONS.INFO}
|
|
1939
|
-
/>
|
|
1940
|
-
<Text
|
|
1941
|
-
style={
|
|
1942
|
-
{
|
|
1943
|
-
marginLeft: 5,
|
|
1944
|
-
color: theme.palette.getAccent500(),
|
|
1945
|
-
...theme.typography.text1,
|
|
1946
|
-
} as TextStyle
|
|
1947
|
-
}
|
|
1948
|
-
>
|
|
1949
|
-
{errorString}
|
|
1950
|
-
</Text>
|
|
1951
|
-
</View>
|
|
1552
|
+
if (!shouldWarn) {
|
|
1553
|
+
setWarningMessage("");
|
|
1554
|
+
return false;
|
|
1555
|
+
}
|
|
1556
|
+
setWarningMessage(
|
|
1557
|
+
targetedFormatter?.getErrorString
|
|
1558
|
+
? targetedFormatter?.getErrorString()
|
|
1559
|
+
: `${localize("MENTION_UPTO")} ${limit} ${
|
|
1560
|
+
limit === 1 ? localize("TIME") : localize("TIMES")
|
|
1561
|
+
} ${localize("AT_A_TIME")}.`
|
|
1952
1562
|
);
|
|
1563
|
+
return true;
|
|
1953
1564
|
};
|
|
1954
1565
|
|
|
1955
1566
|
return (
|
|
1956
1567
|
<>
|
|
1957
|
-
{!isVisible && typeof CustomView ===
|
|
1568
|
+
{/* {!isVisible && typeof CustomView === "function" && <CustomView />} TODOM */}
|
|
1958
1569
|
<Modal
|
|
1959
|
-
|
|
1570
|
+
transparent={true}
|
|
1571
|
+
// animationType='slide'
|
|
1960
1572
|
visible={isVisible}
|
|
1961
1573
|
onRequestClose={() => {
|
|
1962
1574
|
setIsVisible(false);
|
|
1963
1575
|
}}
|
|
1964
|
-
presentationStyle={'pageSheet'}
|
|
1965
1576
|
>
|
|
1966
1577
|
{CustomView && CustomView}
|
|
1967
1578
|
</Modal>
|
|
1968
1579
|
<KeyboardAvoidingView
|
|
1969
1580
|
key={id}
|
|
1970
|
-
behavior={Platform.OS ===
|
|
1581
|
+
behavior={Platform.OS === "ios" ? "padding" : "height"}
|
|
1971
1582
|
keyboardVerticalOffset={Platform.select({ ios: kbOffset })}
|
|
1972
1583
|
{...keyboardAvoidingViewProps}
|
|
1973
1584
|
>
|
|
1974
1585
|
<View
|
|
1975
|
-
style={
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1586
|
+
style={[
|
|
1587
|
+
Style.container,
|
|
1588
|
+
{
|
|
1589
|
+
paddingTop: CustomViewHeader ? theme.spacing.padding.p0 : theme.spacing.padding.p2,
|
|
1590
|
+
paddingHorizontal: theme.spacing.padding.p2,
|
|
1591
|
+
},
|
|
1592
|
+
{
|
|
1593
|
+
backgroundColor: theme.messageListStyles.containerStyle.backgroundColor,
|
|
1594
|
+
},
|
|
1595
|
+
mergedComposerStyle.containerStyle as ViewStyle,
|
|
1596
|
+
]}
|
|
1984
1597
|
>
|
|
1985
|
-
<EmojiBoard
|
|
1986
|
-
hideSearch={true}
|
|
1987
|
-
shouldShow={showEmojiboard}
|
|
1988
|
-
onClose={() => setShowEmojiboard(false)}
|
|
1989
|
-
emojiSelection={(emoji: any) => {
|
|
1990
|
-
let pre = plainTextInput.current.substring(
|
|
1991
|
-
0,
|
|
1992
|
-
selectionPosition.start
|
|
1993
|
-
);
|
|
1994
|
-
let post = plainTextInput.current.substring(
|
|
1995
|
-
selectionPosition.end,
|
|
1996
|
-
plainTextInput.current.length
|
|
1997
|
-
);
|
|
1998
|
-
inputValueRef.current =
|
|
1999
|
-
selectionPosition.start && selectionPosition.end
|
|
2000
|
-
? `${pre}${emoji}${post}`
|
|
2001
|
-
: `${inputValueRef.current}${emoji}`;
|
|
2002
|
-
setInputMessage((prev) =>
|
|
2003
|
-
selectionPosition.start && selectionPosition.end
|
|
2004
|
-
? `${pre}${emoji}${post}`
|
|
2005
|
-
: `${prev}${emoji}`
|
|
2006
|
-
);
|
|
2007
|
-
setShowEmojiboard(false);
|
|
2008
|
-
}}
|
|
2009
|
-
/>
|
|
2010
1598
|
<ActionSheetBoard
|
|
2011
1599
|
sheetRef={bottomSheetRef}
|
|
2012
1600
|
options={actionSheetItems}
|
|
2013
1601
|
shouldShow={showActionSheet}
|
|
2014
1602
|
onClose={() => setShowActionSheet(false)}
|
|
2015
|
-
style={
|
|
2016
|
-
// ...getActionSheetStyle(),
|
|
2017
|
-
...(messageComposerStyle?.actionSheetSeparatorTint
|
|
2018
|
-
? {
|
|
2019
|
-
actionSheetSeparatorTint:
|
|
2020
|
-
messageComposerStyle.actionSheetSeparatorTint,
|
|
2021
|
-
}
|
|
2022
|
-
: {}),
|
|
2023
|
-
layoutModeIconTint:
|
|
2024
|
-
messageComposerStyle?.actionSheetLayoutModeIconTint,
|
|
2025
|
-
titleColor: messageComposerStyle?.actionSheetTitleColor,
|
|
2026
|
-
listItemIconTint: messageComposerStyle?.attachIconTint,
|
|
2027
|
-
listItemTitleFont: messageComposerStyle?.actionSheetTitleFont,
|
|
2028
|
-
}}
|
|
2029
|
-
cometChatBottomSheetStyle={
|
|
2030
|
-
messageComposerStyle?.actionSheetCancelButtonIconTint
|
|
2031
|
-
? {
|
|
2032
|
-
lineColor:
|
|
2033
|
-
messageComposerStyle.actionSheetCancelButtonIconTint,
|
|
2034
|
-
}
|
|
2035
|
-
: {}
|
|
2036
|
-
}
|
|
1603
|
+
style={mergedComposerStyle.attachmentOptionsStyles}
|
|
2037
1604
|
/>
|
|
2038
1605
|
<RecordAudio
|
|
2039
1606
|
sheetRef={bottomSheetRef}
|
|
@@ -2042,72 +1609,46 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
2042
1609
|
onClose={() => {
|
|
2043
1610
|
setShowRecordAudio(false);
|
|
2044
1611
|
}}
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
messageComposerStyle?.actionSheetCancelButtonIconTint
|
|
2048
|
-
? {
|
|
2049
|
-
lineColor:
|
|
2050
|
-
messageComposerStyle.actionSheetCancelButtonIconTint,
|
|
2051
|
-
}
|
|
2052
|
-
: {}
|
|
2053
|
-
}
|
|
2054
|
-
mediaRecorderStyle={mediaRecorderStyle}
|
|
2055
|
-
pauseIconUrl={pauseIconUrl}
|
|
2056
|
-
playIconUrl={playIconUrl}
|
|
2057
|
-
recordIconUrl={recordIconUrl}
|
|
2058
|
-
deleteIconUrl={deleteIconUrl}
|
|
2059
|
-
stopIconUrl={stopIconUrl}
|
|
2060
|
-
submitIconUrl={submitIconUrl}
|
|
2061
|
-
/>
|
|
2062
|
-
<AIOptions
|
|
2063
|
-
sheetRef={bottomSheetRef}
|
|
2064
|
-
shouldShow={showAIOptions}
|
|
2065
|
-
onClose={() => {
|
|
2066
|
-
setShowAIOptions(false);
|
|
1612
|
+
cometChatBottomSheetStyle={{
|
|
1613
|
+
maxHeight: Dimensions.get("window").height * 0.4,
|
|
2067
1614
|
}}
|
|
2068
|
-
|
|
2069
|
-
|
|
1615
|
+
onSend={_sendRecordedAudio}
|
|
1616
|
+
mediaRecorderStyle={mergedComposerStyle.mediaRecorderStyle}
|
|
2070
1617
|
/>
|
|
2071
1618
|
|
|
2072
|
-
{mentionsSearchData.length > 0 &&
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
}
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
data={mentionsSearchData}
|
|
2088
|
-
avatarStyle={{
|
|
2089
|
-
height: 33,
|
|
2090
|
-
width: 33,
|
|
2091
|
-
}}
|
|
2092
|
-
listItemStyle={{
|
|
2093
|
-
height: 50,
|
|
2094
|
-
}}
|
|
2095
|
-
separatorColor={theme.palette.getAccent100()}
|
|
2096
|
-
onPress={onMentionPress}
|
|
2097
|
-
onEndReached={onSuggestionListEndReached}
|
|
2098
|
-
loading={suggestionListLoader}
|
|
2099
|
-
theme={theme}
|
|
2100
|
-
/>
|
|
2101
|
-
{getMentionLimitView()}
|
|
2102
|
-
</View>
|
|
2103
|
-
)}
|
|
2104
|
-
|
|
2105
|
-
{HeaderView ? (
|
|
2106
|
-
<HeaderView />
|
|
2107
|
-
) : (
|
|
2108
|
-
CustomViewHeader && <CustomViewHeader />
|
|
1619
|
+
{mentionsSearchData.length > 0 && plainTextInput.current.length > 0 && (
|
|
1620
|
+
<View
|
|
1621
|
+
style={[
|
|
1622
|
+
theme.mentionsListStyle.containerStyle,
|
|
1623
|
+
messagePreview ? { maxHeight: Dimensions.get("window").height * 0.2 } : {},
|
|
1624
|
+
]}
|
|
1625
|
+
>
|
|
1626
|
+
<CometChatSuggestionList
|
|
1627
|
+
data={mentionsSearchData}
|
|
1628
|
+
listStyle={theme.mentionsListStyle}
|
|
1629
|
+
onPress={onMentionPress}
|
|
1630
|
+
onEndReached={onSuggestionListEndReached}
|
|
1631
|
+
loading={suggestionListLoader}
|
|
1632
|
+
/>
|
|
1633
|
+
</View>
|
|
2109
1634
|
)}
|
|
2110
|
-
|
|
1635
|
+
|
|
1636
|
+
<View
|
|
1637
|
+
style={[
|
|
1638
|
+
{ flexDirection: "column" },
|
|
1639
|
+
mentionsSearchData.length
|
|
1640
|
+
? { maxHeight: Dimensions.get("window").height * 0.2 }
|
|
1641
|
+
: { maxHeight: Dimensions.get("window").height * 0.3 },
|
|
1642
|
+
]}
|
|
1643
|
+
>
|
|
1644
|
+
{HeaderView
|
|
1645
|
+
? HeaderView({ user, group })
|
|
1646
|
+
: CustomViewHeader &&
|
|
1647
|
+
(typeof CustomViewHeader === "function" ? (
|
|
1648
|
+
<CustomViewHeader /> // Invoke CustomViewHeader if it's a functional component
|
|
1649
|
+
) : (
|
|
1650
|
+
CustomViewHeader // Render it directly if it's a React node
|
|
1651
|
+
))}
|
|
2111
1652
|
<MessagePreviewTray
|
|
2112
1653
|
onClose={() => setMessagePreview(null)}
|
|
2113
1654
|
text={messagePreview?.message?.text}
|
|
@@ -2117,26 +1658,26 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
2117
1658
|
<CometChatMessageInput
|
|
2118
1659
|
messageInputRef={messageInputRef}
|
|
2119
1660
|
text={inputMessage as string}
|
|
2120
|
-
placeHolderText={
|
|
2121
|
-
style={
|
|
1661
|
+
placeHolderText={localize("ENTER_YOUR_MESSAGE_HERE")}
|
|
1662
|
+
style={mergedComposerStyle.messageInputStyles}
|
|
2122
1663
|
onSelectionChange={({ nativeEvent: { selection } }) => {
|
|
2123
1664
|
setSelectionPosition(selection);
|
|
2124
1665
|
openList(selection);
|
|
2125
1666
|
}}
|
|
2126
|
-
maxHeight={maxHeight ?? undefined}
|
|
2127
1667
|
onChangeText={textChangeHandler}
|
|
2128
1668
|
SecondaryButtonView={SecondaryButtonViewElem}
|
|
2129
|
-
AuxiliaryButtonView={AuxiliaryButtonViewElem}
|
|
2130
|
-
PrimaryButtonView={
|
|
2131
|
-
auxiliaryButtonAlignment={
|
|
2132
|
-
auxiliaryButtonsAlignment ? auxiliaryButtonsAlignment : 'right'
|
|
2133
|
-
}
|
|
1669
|
+
AuxiliaryButtonView={AuxiliaryButtonViewElem()}
|
|
1670
|
+
PrimaryButtonView={SendButtonViewElem}
|
|
1671
|
+
auxiliaryButtonAlignment={"left"}
|
|
2134
1672
|
/>
|
|
2135
|
-
{
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
1673
|
+
{CustomViewFooter ? (
|
|
1674
|
+
// If CustomViewFooter is a function component (React.FC)
|
|
1675
|
+
typeof CustomViewFooter === "function" ? (
|
|
1676
|
+
<CustomViewFooter /> // Invoke the function component
|
|
1677
|
+
) : (
|
|
1678
|
+
CustomViewFooter // Render it directly if it's a React node (JSX or element)
|
|
1679
|
+
)
|
|
1680
|
+
) : null}
|
|
2140
1681
|
</View>
|
|
2141
1682
|
</KeyboardAvoidingView>
|
|
2142
1683
|
</>
|