@cometchat/chat-uikit-react-native 4.3.25 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -3
- 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/CometChatSoundModule.java +29 -44
- package/android/src/main/java/com/reactnativecometchatuikit/FileManager.java +172 -28
- package/android/src/main/java/com/reactnativecometchatuikit/SoundPlayer.java +43 -15
- package/ios/CometchatUiKit.mm +27 -14
- package/ios/FileManager.m +134 -20
- package/ios/SoundPlayer.m +32 -5
- package/package.json +18 -59
- package/react-native-cometchat-ui-kit.podspec +16 -0
- package/src/CometChatConversations/CometChatConversations.tsx +1520 -1293
- package/src/CometChatConversations/Skeleton.tsx +186 -0
- package/src/CometChatConversations/index.ts +7 -21
- package/src/CometChatConversations/resources/index.ts +22 -36
- package/src/CometChatConversations/style.ts +230 -60
- package/src/CometChatGroupMembers/CometChatGroupMembers.tsx +1032 -659
- 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 +530 -22
- package/src/CometChatGroups/CometChatGroups.tsx +509 -550
- package/src/CometChatGroups/GroupsStyle.ts +179 -109
- package/src/CometChatGroups/Skeleton.tsx +238 -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 +730 -1058
- 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 +370 -482
- 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 +333 -316
- 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 +2464 -2076
- 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 +274 -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 +436 -122
- package/src/CometChatUsers/Skeleton.tsx +210 -0
- package/src/CometChatUsers/index.ts +3 -11
- package/src/CometChatUsers/style.ts +184 -0
- package/src/calls/CallEvents.ts +9 -9
- package/src/calls/CallUtils.ts +102 -31
- package/src/calls/CallingConfiguration.ts +23 -4
- package/src/calls/CallingExtension.tsx +43 -40
- package/src/calls/CallingExtensionDecorator.tsx +418 -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 +19 -36
- package/src/calls/CometChatCallButtons/CometChatCallButtons.tsx +321 -323
- package/src/calls/CometChatCallButtons/index.ts +9 -11
- package/src/calls/CometChatCallButtons/style.ts +34 -12
- package/src/calls/CometChatCallLogs/CometChatCallLogs.tsx +571 -376
- package/src/calls/CometChatCallLogs/Skeleton.tsx +227 -0
- package/src/calls/CometChatCallLogs/index.ts +5 -15
- package/src/calls/CometChatCallLogs/resources/index.ts +20 -31
- package/src/calls/CometChatCallLogs/style.ts +207 -18
- package/src/calls/CometChatIncomingCall/CometChatIncomingCall.tsx +278 -222
- 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 +225 -176
- 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 +246 -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 +323 -197
- 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 +238 -154
- 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 +164 -72
- 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 +307 -103
- 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 +194 -688
- 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 +45 -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 +225 -92
- package/src/shared/framework/DataSourceDecorator.tsx +316 -233
- package/src/shared/framework/ExtensionsDataSource.tsx +8 -11
- package/src/shared/framework/MessageDataSource.tsx +1556 -857
- 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 +116 -337
- 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 -151
- package/src/shared/resources/CometChatLocalize/index.ts +2 -8
- package/src/shared/resources/CometChatLocalize/resources/ar/translation.json +446 -316
- package/src/shared/resources/CometChatLocalize/resources/de/translation.json +446 -317
- package/src/shared/resources/CometChatLocalize/resources/en/translation.json +446 -316
- package/src/shared/resources/CometChatLocalize/resources/es/translation.json +446 -317
- package/src/shared/resources/CometChatLocalize/resources/fr/translation.json +445 -317
- package/src/shared/resources/CometChatLocalize/resources/hi/translation.json +446 -316
- package/src/shared/resources/CometChatLocalize/resources/hu/translation.json +445 -316
- package/src/shared/resources/CometChatLocalize/resources/lt/translation.json +446 -317
- package/src/shared/resources/CometChatLocalize/resources/ms/translation.json +446 -317
- package/src/shared/resources/CometChatLocalize/resources/pt/translation.json +446 -317
- package/src/shared/resources/CometChatLocalize/resources/ru/translation.json +446 -317
- package/src/shared/resources/CometChatLocalize/resources/sv/translation.json +446 -317
- package/src/shared/resources/CometChatLocalize/resources/zh/translation.json +446 -317
- package/src/shared/resources/CometChatLocalize/resources/zh-tw/translation.json +445 -317
- 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 +349 -148
- 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 +46 -103
- 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 +46 -53
- 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 +164 -129
- package/src/shared/views/CometChatBottomSheet/index.ts +2 -5
- package/src/shared/views/CometChatConfirmDialog/CometChatConfirmDialog.tsx +174 -110
- 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 +43 -169
- 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 +54 -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 +54 -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 +227 -167
- 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 +69 -252
- package/src/shared/views/CometChatImageBubble/CometChatImageLoader.tsx +183 -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 +696 -726
- package/src/shared/views/CometChatList/Header.tsx +271 -111
- 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 +59 -44
- package/src/shared/views/CometChatListItem/CometChatListItem.tsx +221 -261
- 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 +135 -126
- package/src/shared/views/CometChatMessageBubble/index.ts +2 -5
- package/src/shared/views/CometChatMessageInput/CometChatMessageInput.tsx +78 -105
- package/src/shared/views/CometChatMessageInput/index.ts +10 -3
- package/src/shared/views/CometChatMessageInput/styles.ts +2 -2
- package/src/shared/views/CometChatQuickReactions/CometChatQuickReactions.tsx +77 -71
- 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 +477 -308
- 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 +132 -172
- 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 +85 -82
- package/src/shared/views/CometChatReceipt/index.ts +3 -11
- 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 +67 -63
- 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 +59 -14
- package/src/shared/views/CometChatSuggestionList/CometChatSuggestionList.tsx +97 -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 +121 -96
- package/src/shared/views/CometChatTextBubble/index.ts +8 -7
- package/src/shared/views/CometChatTooltipMenu/CometChatTooltipMenu.tsx +202 -0
- package/src/shared/views/CometChatTooltipMenu/index.ts +4 -0
- package/src/shared/views/CometChatTooltipMenu/styles.ts +24 -0
- package/src/shared/views/CometChatVideoBubble/CometChatVideoBubble.tsx +175 -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 +154 -91
- package/src/shared/views/CometChatVideoPlayer/index.tsx +1 -1
- package/src/shared/views/ErrorEmptyView/ErrorEmptyView.tsx +62 -0
- package/src/shared/views/index.ts +74 -218
- 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 -229
- 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 -1026
- 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 -231
- 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 -344
- 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 -349
- 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/CometChatPanel/CometChatPanel.tsx +0 -51
- package/src/shared/views/CometChatPanel/PanelStyle.tsx +0 -43
- package/src/shared/views/CometChatPanel/resources/CloseIcon.png +0 -0
- package/src/shared/views/CometChatPanel/resources/index.ts +0 -6
- 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 -41
- 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,90 +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
|
-
|
|
17
|
-
|
|
14
|
+
TouchableOpacity,
|
|
15
|
+
TouchableWithoutFeedbackProps,
|
|
16
|
+
View,
|
|
17
|
+
ViewStyle,
|
|
18
|
+
} from "react-native";
|
|
18
19
|
import {
|
|
19
|
-
localize,
|
|
20
|
-
CometChatLiveReactions,
|
|
21
|
-
CometChatBottomSheet,
|
|
22
|
-
CometChatMessagePreview,
|
|
23
|
-
MessagePreviewStyle,
|
|
24
20
|
CometChatActionSheet,
|
|
25
|
-
|
|
26
|
-
CometChatContext,
|
|
21
|
+
CometChatBottomSheet,
|
|
27
22
|
CometChatMentionsFormatter,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
MentionTextStyle,
|
|
23
|
+
CometChatMessageInput,
|
|
24
|
+
CometChatMessagePreview,
|
|
31
25
|
CometChatSuggestionList,
|
|
32
|
-
|
|
26
|
+
CometChatTextFormatter,
|
|
33
27
|
CometChatUIKit,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
import { CometChat } from '@cometchat/chat-sdk-react-native';
|
|
28
|
+
CometChatUrlsFormatter,
|
|
29
|
+
localize,
|
|
30
|
+
SuggestionItem,
|
|
31
|
+
} from "../shared";
|
|
32
|
+
import { Style } from "./styles";
|
|
40
33
|
|
|
41
|
-
import {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
} from '../shared/utils/CometChatMessageHelper';
|
|
46
|
-
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";
|
|
47
38
|
import {
|
|
48
39
|
ConversationOptionConstants,
|
|
40
|
+
MentionsTargetElement,
|
|
49
41
|
MentionsVisibility,
|
|
50
42
|
MessageTypeConstants,
|
|
51
|
-
MetadataConstants,
|
|
52
43
|
ReceiverTypeConstants,
|
|
53
44
|
ViewAlignment,
|
|
54
|
-
} from
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
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";
|
|
57
50
|
import {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
} from
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
CometChatMediaRecorder,
|
|
69
|
-
MediaRecorderStyle,
|
|
70
|
-
} from '../shared/views/CometChatMediaRecorder';
|
|
71
|
-
import { AIOptionsStyle } from '../AI/AIOptionsStyle';
|
|
72
|
-
import { CommonUtils } from '../shared/utils/CommonUtils';
|
|
73
|
-
import { permissionUtil } from '../shared/utils/PermissionUtil';
|
|
74
|
-
import { commonVars } from '../shared/base/vars';
|
|
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";
|
|
75
61
|
const { FileManager, CommonUtil } = NativeModules;
|
|
76
62
|
|
|
77
|
-
const uiEventListenerShow =
|
|
78
|
-
const uiEventListenerHide =
|
|
63
|
+
const uiEventListenerShow = "uiEvent_show_" + new Date().getTime();
|
|
64
|
+
const uiEventListenerHide = "uiEvent_hide_" + new Date().getTime();
|
|
79
65
|
|
|
80
66
|
const MessagePreviewTray = (props: any) => {
|
|
81
|
-
const { shouldShow = false, text =
|
|
67
|
+
const { shouldShow = false, text = "", onClose = () => {} } = props;
|
|
82
68
|
return shouldShow ? (
|
|
83
69
|
<CometChatMessagePreview
|
|
84
|
-
|
|
85
|
-
new MessagePreviewStyle({ width: '95%', backgroundColor: 'white' })
|
|
86
|
-
}
|
|
87
|
-
messagePreviewTitle={localize('EDIT_MESSAGE')}
|
|
70
|
+
messagePreviewTitle={localize("EDIT_MESSAGE")}
|
|
88
71
|
messagePreviewSubtitle={text}
|
|
89
72
|
closeIconURL={ICONS.CLOSE}
|
|
90
73
|
onCloseClick={onClose}
|
|
@@ -105,57 +88,37 @@ const ImageButton = (props: any) => {
|
|
|
105
88
|
);
|
|
106
89
|
};
|
|
107
90
|
|
|
108
|
-
const AttachIconButton = (props:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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}
|
|
116
105
|
/>
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
return <View style={[Style.imageStyle, style]} />;
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
const EmojiBoard = (props: any) => {
|
|
124
|
-
const {
|
|
125
|
-
shouldShow = false,
|
|
126
|
-
onClose = () => {},
|
|
127
|
-
emojiSelection = (emoji?: any) => {},
|
|
128
|
-
...otherProps
|
|
129
|
-
} = props;
|
|
130
|
-
return shouldShow ? (
|
|
131
|
-
<CometChatBottomSheet onClose={onClose}>
|
|
132
|
-
{/* <CometChatEmojiKeyboard onClick={emojiSelection} {...otherProps} /> */}
|
|
133
|
-
</CometChatBottomSheet>
|
|
134
|
-
) : null;
|
|
106
|
+
</TouchableOpacity>
|
|
107
|
+
);
|
|
135
108
|
};
|
|
136
109
|
|
|
137
110
|
const ActionSheetBoard = (props: any) => {
|
|
138
|
-
const {
|
|
139
|
-
|
|
140
|
-
onClose = () => {},
|
|
141
|
-
options = [],
|
|
142
|
-
cometChatBottomSheetStyle = {},
|
|
143
|
-
sheetRef,
|
|
144
|
-
...otherProps
|
|
145
|
-
} = props;
|
|
146
|
-
return shouldShow ? (
|
|
111
|
+
const { shouldShow = false, onClose = () => {}, options = [], sheetRef, style } = props;
|
|
112
|
+
return (
|
|
147
113
|
<CometChatBottomSheet
|
|
114
|
+
style={{ maxHeight: Dimensions.get("window").height * 0.49 }}
|
|
148
115
|
ref={sheetRef}
|
|
149
116
|
onClose={onClose}
|
|
150
|
-
|
|
117
|
+
isOpen={shouldShow}
|
|
151
118
|
>
|
|
152
|
-
<CometChatActionSheet
|
|
153
|
-
actions={options}
|
|
154
|
-
{...otherProps}
|
|
155
|
-
onPress={props.onClick}
|
|
156
|
-
/>
|
|
119
|
+
<CometChatActionSheet actions={options} style={style} />
|
|
157
120
|
</CometChatBottomSheet>
|
|
158
|
-
)
|
|
121
|
+
);
|
|
159
122
|
};
|
|
160
123
|
|
|
161
124
|
const RecordAudio = (props: any) => {
|
|
@@ -171,19 +134,14 @@ const RecordAudio = (props: any) => {
|
|
|
171
134
|
onStop = (recordedFile: String) => {},
|
|
172
135
|
onStart = () => {},
|
|
173
136
|
mediaRecorderStyle,
|
|
174
|
-
pauseIconUrl,
|
|
175
|
-
playIconUrl,
|
|
176
|
-
recordIconUrl,
|
|
177
|
-
deleteIconUrl,
|
|
178
|
-
stopIconUrl,
|
|
179
|
-
submitIconUrl,
|
|
180
137
|
...otherProps
|
|
181
138
|
} = props;
|
|
182
|
-
return
|
|
139
|
+
return (
|
|
183
140
|
<CometChatBottomSheet
|
|
184
141
|
ref={sheetRef}
|
|
185
142
|
onClose={onClose}
|
|
186
143
|
style={cometChatBottomSheetStyle}
|
|
144
|
+
isOpen={shouldShow}
|
|
187
145
|
>
|
|
188
146
|
<CometChatMediaRecorder
|
|
189
147
|
onClose={onClose}
|
|
@@ -192,186 +150,96 @@ const RecordAudio = (props: any) => {
|
|
|
192
150
|
onSend={onSend}
|
|
193
151
|
onStop={onStop}
|
|
194
152
|
onStart={onStart}
|
|
195
|
-
|
|
196
|
-
pauseIconUrl={pauseIconUrl}
|
|
197
|
-
playIconUrl={playIconUrl}
|
|
198
|
-
recordIconUrl={recordIconUrl}
|
|
199
|
-
deleteIconUrl={deleteIconUrl}
|
|
200
|
-
stopIconUrl={stopIconUrl}
|
|
201
|
-
submitIconUrl={submitIconUrl}
|
|
202
|
-
/>
|
|
203
|
-
</CometChatBottomSheet>
|
|
204
|
-
) : null;
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
const AIOptions = (props: any) => {
|
|
208
|
-
const {
|
|
209
|
-
aiStyle,
|
|
210
|
-
shouldShow = false,
|
|
211
|
-
onClose = () => {},
|
|
212
|
-
cometChatBottomSheetStyle = {
|
|
213
|
-
backgroundColor: aiStyle.backgroundColor,
|
|
214
|
-
paddingHorizontal: 0,
|
|
215
|
-
},
|
|
216
|
-
sheetRef,
|
|
217
|
-
aiOptions,
|
|
218
|
-
...otherProps
|
|
219
|
-
} = props;
|
|
220
|
-
|
|
221
|
-
return shouldShow ? (
|
|
222
|
-
<CometChatBottomSheet
|
|
223
|
-
ref={sheetRef}
|
|
224
|
-
onClose={onClose}
|
|
225
|
-
style={cometChatBottomSheetStyle}
|
|
226
|
-
>
|
|
227
|
-
<CometChatActionSheet
|
|
228
|
-
actions={aiOptions}
|
|
229
|
-
style={{ ...aiStyle, paddingHorizontal: 0 }}
|
|
230
|
-
{...otherProps}
|
|
231
|
-
onPress={props.onClick}
|
|
232
|
-
hideHeader={true}
|
|
153
|
+
style={mediaRecorderStyle}
|
|
233
154
|
/>
|
|
234
155
|
</CometChatBottomSheet>
|
|
235
|
-
)
|
|
236
|
-
};
|
|
237
|
-
|
|
238
|
-
const LiveReaction = (props: any) => {
|
|
239
|
-
const { show = false, reaction } = props;
|
|
240
|
-
if (show) {
|
|
241
|
-
return <CometChatLiveReactions reaction={reaction} />;
|
|
242
|
-
}
|
|
243
|
-
return null;
|
|
156
|
+
);
|
|
244
157
|
};
|
|
245
158
|
|
|
246
|
-
|
|
247
|
-
timerIntervalId = null;
|
|
248
|
-
|
|
249
|
-
export interface MessageComposerStyleInterface extends BaseStyle {
|
|
250
|
-
attachIconTint?: string;
|
|
251
|
-
sendIconTint?: string;
|
|
252
|
-
voiceRecordingIconTint?: string;
|
|
253
|
-
inputBackground?: string;
|
|
254
|
-
inputBorder?: BorderStyleInterface;
|
|
255
|
-
dividerTint?: string;
|
|
256
|
-
textFont?: FontStyleInterface;
|
|
257
|
-
textColor?: string;
|
|
258
|
-
placeholderTextColor?: string;
|
|
259
|
-
placeholderTextFont?: FontStyleInterface;
|
|
260
|
-
|
|
261
|
-
actionSheetSeparatorTint?: string;
|
|
262
|
-
actionSheetTitleColor?: string;
|
|
263
|
-
actionSheetTitleFont?: FontStyleInterface;
|
|
264
|
-
actionSheetLayoutModeIconTint?: string;
|
|
265
|
-
actionSheetCancelButtonIconTint?: string;
|
|
266
|
-
}
|
|
267
|
-
type Enumerate<
|
|
268
|
-
N extends number,
|
|
269
|
-
Acc extends number[] = []
|
|
270
|
-
> = Acc['length'] extends N
|
|
159
|
+
type Enumerate<N extends number, Acc extends number[] = []> = Acc["length"] extends N
|
|
271
160
|
? Acc[number]
|
|
272
|
-
: Enumerate<N, [...Acc, Acc[
|
|
161
|
+
: Enumerate<N, [...Acc, Acc["length"]]>;
|
|
273
162
|
|
|
274
|
-
type IntRange<F extends number, T extends number> = Exclude<
|
|
275
|
-
Enumerate<T>,
|
|
276
|
-
Enumerate<F>
|
|
277
|
-
>;
|
|
163
|
+
type IntRange<F extends number, T extends number> = Exclude<Enumerate<T>, Enumerate<F>>;
|
|
278
164
|
|
|
165
|
+
/**
|
|
166
|
+
* Properties for the CometChat message composer component.
|
|
167
|
+
*/
|
|
279
168
|
export interface CometChatMessageComposerInterface {
|
|
280
169
|
/**
|
|
170
|
+
* Message composer identifier.
|
|
281
171
|
*
|
|
282
|
-
*
|
|
283
|
-
* @type {(string | number)}
|
|
284
|
-
* @description Message composer identifier
|
|
172
|
+
* @type {string | number}
|
|
285
173
|
*/
|
|
286
174
|
id?: string | number;
|
|
175
|
+
|
|
287
176
|
/**
|
|
288
|
-
*
|
|
177
|
+
* CometChat SDK’s user object.
|
|
289
178
|
*
|
|
290
179
|
* @type {CometChat.User}
|
|
291
|
-
* @description CometChat SDK’s user object
|
|
292
180
|
*/
|
|
293
181
|
user?: CometChat.User;
|
|
182
|
+
|
|
294
183
|
/**
|
|
295
|
-
*
|
|
184
|
+
* CometChat SDK’s group object.
|
|
296
185
|
*
|
|
297
186
|
* @type {CometChat.Group}
|
|
298
|
-
* @description CometChat SDK’s group object
|
|
299
187
|
*/
|
|
300
188
|
group?: CometChat.Group;
|
|
189
|
+
|
|
301
190
|
/**
|
|
302
|
-
*
|
|
191
|
+
* Flag to turn off sound for outgoing messages.
|
|
303
192
|
*
|
|
304
193
|
* @type {boolean}
|
|
305
|
-
* @description Turn off sound for outgoing messages
|
|
306
194
|
*/
|
|
307
|
-
|
|
195
|
+
disableSoundForOutgoingMessages?: boolean;
|
|
196
|
+
|
|
308
197
|
/**
|
|
309
|
-
*
|
|
198
|
+
* Custom audio sound to be played while sending messages.
|
|
310
199
|
*
|
|
311
200
|
* @type {*}
|
|
312
|
-
* @description Custom audio sound to be played while sending messages
|
|
313
201
|
*/
|
|
314
|
-
|
|
202
|
+
customSoundForOutgoingMessage?: any;
|
|
203
|
+
|
|
315
204
|
/**
|
|
316
|
-
*
|
|
205
|
+
* Flag to disable typing events.
|
|
317
206
|
*
|
|
318
207
|
* @type {boolean}
|
|
319
|
-
* @description Disable typing events
|
|
320
208
|
*/
|
|
321
209
|
disableTypingEvents?: boolean;
|
|
210
|
+
|
|
322
211
|
/**
|
|
323
|
-
*
|
|
324
|
-
*
|
|
325
|
-
* @type {string}
|
|
326
|
-
* @description CometChatMessageComposerInterface
|
|
327
|
-
*/
|
|
328
|
-
text?: string;
|
|
329
|
-
/**
|
|
330
|
-
*
|
|
212
|
+
* Initial text to be displayed in the composer.
|
|
331
213
|
*
|
|
332
214
|
* @type {string}
|
|
333
|
-
* @description Text shown in the composer when the input message is empty
|
|
334
|
-
*/
|
|
335
|
-
placeHolderText?: string;
|
|
336
|
-
/**
|
|
337
|
-
*
|
|
338
|
-
*
|
|
339
|
-
* @type {React.FC}
|
|
340
|
-
* @description Preview section at the top of the composer
|
|
341
215
|
*/
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
*
|
|
345
|
-
*
|
|
346
|
-
* @type {React.FC}
|
|
347
|
-
* @description Preview section at the bottom of the composer
|
|
348
|
-
*/
|
|
349
|
-
FooterView?: React.FC;
|
|
216
|
+
initialComposertext?: string;
|
|
217
|
+
|
|
350
218
|
/**
|
|
219
|
+
* Renders a preview section at the top of the composer.
|
|
351
220
|
*
|
|
352
|
-
*
|
|
353
|
-
* @
|
|
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.
|
|
354
225
|
*/
|
|
355
|
-
|
|
226
|
+
HeaderView?: ({ user, group }: { user?: CometChat.User; group?: CometChat.Group }) => JSX.Element;
|
|
227
|
+
|
|
356
228
|
/**
|
|
229
|
+
* Callback triggered when the input text changes.
|
|
357
230
|
*
|
|
358
|
-
*
|
|
359
|
-
* @type {number}
|
|
360
|
-
* @description Threshold value when reached, input will not expand further, causing it to scroll
|
|
231
|
+
* @param {string} text - The updated text.
|
|
361
232
|
*/
|
|
362
|
-
|
|
233
|
+
onTextChange?: (text: string) => void;
|
|
234
|
+
|
|
363
235
|
/**
|
|
236
|
+
* Returns the attachment options for the composer.
|
|
364
237
|
*
|
|
365
|
-
*
|
|
366
|
-
* @
|
|
367
|
-
* @
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
/**
|
|
371
|
-
*
|
|
372
|
-
*
|
|
373
|
-
* @type {*}
|
|
374
|
-
* @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.
|
|
375
243
|
*/
|
|
376
244
|
attachmentOptions?: ({
|
|
377
245
|
user,
|
|
@@ -381,28 +249,16 @@ export interface CometChatMessageComposerInterface {
|
|
|
381
249
|
user?: CometChat.User;
|
|
382
250
|
group?: CometChat.Group;
|
|
383
251
|
composerId: Map<any, any>;
|
|
384
|
-
}) =>
|
|
252
|
+
}) => CometChatMessageComposerAction[];
|
|
385
253
|
|
|
386
254
|
/**
|
|
255
|
+
* Replaces the default Auxiliary Button.
|
|
387
256
|
*
|
|
388
|
-
*
|
|
389
|
-
* @
|
|
390
|
-
* @
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
user,
|
|
394
|
-
group,
|
|
395
|
-
composerId,
|
|
396
|
-
}: {
|
|
397
|
-
user?: CometChat.User;
|
|
398
|
-
group?: CometChat.Group;
|
|
399
|
-
composerId: string | number;
|
|
400
|
-
}) => JSX.Element;
|
|
401
|
-
/**
|
|
402
|
-
*
|
|
403
|
-
*
|
|
404
|
-
* @type {FunctionComponent}
|
|
405
|
-
* @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.
|
|
406
262
|
*/
|
|
407
263
|
AuxiliaryButtonView?: ({
|
|
408
264
|
user,
|
|
@@ -413,18 +269,15 @@ export interface CometChatMessageComposerInterface {
|
|
|
413
269
|
group?: CometChat.Group;
|
|
414
270
|
composerId: string | number;
|
|
415
271
|
}) => JSX.Element;
|
|
272
|
+
|
|
416
273
|
/**
|
|
274
|
+
* Replaces the default Send Button.
|
|
417
275
|
*
|
|
418
|
-
*
|
|
419
|
-
* @
|
|
420
|
-
* @
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
/**
|
|
424
|
-
*
|
|
425
|
-
*
|
|
426
|
-
* @type {FunctionComponent}
|
|
427
|
-
* @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.
|
|
428
281
|
*/
|
|
429
282
|
SendButtonView?: ({
|
|
430
283
|
user,
|
|
@@ -435,241 +288,257 @@ export interface CometChatMessageComposerInterface {
|
|
|
435
288
|
group?: CometChat.Group;
|
|
436
289
|
composerId: string | number;
|
|
437
290
|
}) => JSX.Element;
|
|
291
|
+
|
|
438
292
|
/**
|
|
293
|
+
* Message id required for threaded messages.
|
|
439
294
|
*
|
|
440
|
-
*
|
|
441
|
-
* @type {(string | number)}
|
|
442
|
-
* @description Message id required for threaded messages
|
|
295
|
+
* @type {string | number}
|
|
443
296
|
*/
|
|
444
297
|
parentMessageId?: string | number;
|
|
298
|
+
|
|
445
299
|
/**
|
|
446
|
-
*
|
|
300
|
+
* Custom styles for the message composer component.
|
|
301
|
+
*/
|
|
302
|
+
style?: DeepPartial<CometChatTheme["messageComposerStyles"]>;
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Flag to hide the voice recording button.
|
|
447
306
|
*
|
|
448
307
|
* @type {boolean}
|
|
449
|
-
* @description Hide the live reaction button
|
|
450
308
|
*/
|
|
451
|
-
|
|
309
|
+
hideVoiceRecordingButton?: boolean;
|
|
310
|
+
|
|
452
311
|
/**
|
|
312
|
+
* Callback triggered when the send button is pressed.
|
|
453
313
|
*
|
|
454
|
-
*
|
|
455
|
-
* @type {ImageType}
|
|
456
|
-
* @description Live reaction Icon
|
|
314
|
+
* @param {CometChat.BaseMessage} message - The base message object.
|
|
457
315
|
*/
|
|
458
|
-
|
|
316
|
+
onSendButtonPress?: (message: CometChat.BaseMessage) => void;
|
|
317
|
+
|
|
459
318
|
/**
|
|
319
|
+
* Callback triggered when an error occurs.
|
|
460
320
|
*
|
|
461
|
-
*
|
|
462
|
-
* @type {MessageComposerStyleInterface}
|
|
463
|
-
* @description Message Composer Styles
|
|
321
|
+
* @param {CometChat.CometChatException} error - The error object.
|
|
464
322
|
*/
|
|
465
|
-
|
|
323
|
+
onError?: (error: CometChat.CometChatException) => void;
|
|
324
|
+
|
|
466
325
|
/**
|
|
467
|
-
*
|
|
468
|
-
*
|
|
469
|
-
* @type {boolean}
|
|
470
|
-
* @description Hide the record voice button
|
|
326
|
+
* Override properties for the KeyboardAvoidingView.
|
|
471
327
|
*/
|
|
472
|
-
|
|
328
|
+
keyboardAvoidingViewProps?: KeyboardAvoidingViewProps;
|
|
329
|
+
|
|
473
330
|
/**
|
|
331
|
+
* Collection of text formatter classes to apply custom formatting.
|
|
474
332
|
*
|
|
475
|
-
*
|
|
476
|
-
* @type {string}
|
|
477
|
-
* @description Image URL for the voice recording icon
|
|
333
|
+
* @type {Array<CometChatMentionsFormatter | CometChatUrlsFormatter | CometChatTextFormatter>}
|
|
478
334
|
*/
|
|
479
|
-
|
|
335
|
+
textFormatters?: Array<
|
|
336
|
+
CometChatMentionsFormatter | CometChatUrlsFormatter | CometChatTextFormatter
|
|
337
|
+
>;
|
|
338
|
+
|
|
480
339
|
/**
|
|
481
|
-
*
|
|
482
|
-
*
|
|
483
|
-
* @type {MediaRecorderStyle}
|
|
484
|
-
* @description Voice Recording Styles
|
|
340
|
+
* Flag to disable mention functionality.
|
|
485
341
|
*/
|
|
486
|
-
|
|
342
|
+
disableMentions?: boolean;
|
|
343
|
+
|
|
487
344
|
/**
|
|
345
|
+
* Controls image quality when taking pictures from the camera.
|
|
346
|
+
* A value of 100 means no compression.
|
|
488
347
|
*
|
|
489
|
-
*
|
|
490
|
-
* @type {
|
|
491
|
-
* @description Pause Icon Icon
|
|
348
|
+
* @default 20
|
|
349
|
+
* @type {IntRange<1, 100>}
|
|
492
350
|
*/
|
|
493
|
-
|
|
351
|
+
imageQuality?: IntRange<1, 100>;
|
|
352
|
+
|
|
494
353
|
/**
|
|
495
|
-
*
|
|
496
|
-
*
|
|
497
|
-
* @type {ImageType}
|
|
498
|
-
* @description Play Icon Icon
|
|
354
|
+
* If true, hides the camera option from the attachment options.
|
|
499
355
|
*/
|
|
500
|
-
|
|
356
|
+
hideCameraOption?: boolean;
|
|
357
|
+
|
|
501
358
|
/**
|
|
502
|
-
*
|
|
503
|
-
*
|
|
504
|
-
* @type {ImageType}
|
|
505
|
-
* @description Record Icon Icon
|
|
359
|
+
* If true, hides the image attachment option from the attachment options.
|
|
506
360
|
*/
|
|
507
|
-
|
|
361
|
+
hideImageAttachmentOption?: boolean;
|
|
362
|
+
|
|
508
363
|
/**
|
|
509
|
-
*
|
|
510
|
-
*
|
|
511
|
-
* @type {ImageType}
|
|
512
|
-
* @description Delete Icon Icon
|
|
364
|
+
* If true, hides the video attachment option from the attachment options.
|
|
513
365
|
*/
|
|
514
|
-
|
|
366
|
+
hideVideoAttachmentOption?: boolean;
|
|
367
|
+
|
|
515
368
|
/**
|
|
516
|
-
*
|
|
517
|
-
*
|
|
518
|
-
* @type {ImageType}
|
|
519
|
-
* @description Stop Icon Icon
|
|
369
|
+
* If true, hides the audio attachment option from the attachment options.
|
|
520
370
|
*/
|
|
521
|
-
|
|
371
|
+
hideAudioAttachmentOption?: boolean;
|
|
372
|
+
|
|
522
373
|
/**
|
|
523
|
-
*
|
|
524
|
-
*
|
|
525
|
-
* @type {ImageType}
|
|
526
|
-
* @description Submit Icon Icon
|
|
374
|
+
* If true, hides the file/document attachment option from the attachment options.
|
|
527
375
|
*/
|
|
528
|
-
|
|
376
|
+
hideFileAttachmentOption?: boolean;
|
|
377
|
+
|
|
529
378
|
/**
|
|
530
|
-
*
|
|
531
|
-
* @type {Function}
|
|
532
|
-
* @description callback(BaseMessage)→ void
|
|
379
|
+
* If true, hides the polls option from the attachment options.
|
|
533
380
|
*/
|
|
534
|
-
|
|
381
|
+
hidePollsAttachmentOption?: boolean;
|
|
382
|
+
|
|
535
383
|
/**
|
|
536
|
-
*
|
|
537
|
-
* @type {ErrorCallback}
|
|
538
|
-
* @description callback(error)→ void
|
|
384
|
+
* If true, hides the collaborative document option (e.g., shared document editing).
|
|
539
385
|
*/
|
|
540
|
-
|
|
386
|
+
hideCollaborativeDocumentOption?: boolean;
|
|
387
|
+
|
|
541
388
|
/**
|
|
542
|
-
*
|
|
389
|
+
* If true, hides the collaborative whiteboard option.
|
|
543
390
|
*/
|
|
544
|
-
|
|
391
|
+
hideCollaborativeWhiteboardOption?: boolean;
|
|
392
|
+
|
|
545
393
|
/**
|
|
546
|
-
*
|
|
394
|
+
* If true, hides the entire attachment button from the composer.
|
|
547
395
|
*/
|
|
548
|
-
|
|
396
|
+
hideAttachmentButton?: boolean;
|
|
397
|
+
|
|
549
398
|
/**
|
|
550
|
-
*
|
|
399
|
+
* If true, hides the stickers button from the composer.
|
|
551
400
|
*/
|
|
552
|
-
|
|
401
|
+
hideStickersButton?: boolean;
|
|
402
|
+
|
|
553
403
|
/**
|
|
554
|
-
*
|
|
555
|
-
* @type {Array<CometChatMentionsFormatter | CometChatUrlsFormatter | CometChatTextFormatter>}
|
|
404
|
+
* If true, hides the send button from the composer.
|
|
556
405
|
*/
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
/*
|
|
562
|
-
* To manually manage image quality taken from the camera (100 means no compression).
|
|
563
|
-
* @default 20
|
|
406
|
+
hideSendButton?: boolean;
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* If true, hides all auxiliary buttons (such as voice input, GIFs, or other plugin buttons).
|
|
564
410
|
*/
|
|
565
|
-
|
|
411
|
+
hideAuxiliaryButtons?: boolean;
|
|
412
|
+
/**
|
|
413
|
+
* Returns the attachment options for the composer.
|
|
414
|
+
*
|
|
415
|
+
* @param {Object} props - The function properties.
|
|
416
|
+
* @param {CometChat.User} [props.user] - The user object.
|
|
417
|
+
* @param {CometChat.Group} [props.group] - The group object.
|
|
418
|
+
* @param {Map<any, any>} props.composerId - The composer identifier as a Map.
|
|
419
|
+
* @returns {CometChatMessageComposerAction[]} An array of composer actions.
|
|
420
|
+
*/
|
|
421
|
+
addAttachmentOptions?: ({
|
|
422
|
+
user,
|
|
423
|
+
group,
|
|
424
|
+
composerId,
|
|
425
|
+
}: {
|
|
426
|
+
user?: CometChat.User;
|
|
427
|
+
group?: CometChat.Group;
|
|
428
|
+
composerId: Map<any, any>;
|
|
429
|
+
}) => CometChatMessageComposerAction[];
|
|
430
|
+
/**
|
|
431
|
+
* Determines the alignment of auxiliary buttons (e.g., sticker button).
|
|
432
|
+
* Can be either "left" or "right".
|
|
433
|
+
*
|
|
434
|
+
* @default "left"
|
|
435
|
+
*/
|
|
436
|
+
auxiliaryButtonsAlignment?: "left" | "right";
|
|
566
437
|
}
|
|
438
|
+
|
|
567
439
|
export const CometChatMessageComposer = React.forwardRef(
|
|
568
440
|
(props: CometChatMessageComposerInterface, ref) => {
|
|
569
|
-
const editMessageListenerID =
|
|
570
|
-
const UiEventListenerID =
|
|
441
|
+
const editMessageListenerID = "editMessageListener_" + new Date().getTime();
|
|
442
|
+
const UiEventListenerID = "UiEventListener_" + new Date().getTime();
|
|
571
443
|
|
|
572
|
-
const
|
|
444
|
+
const theme = useTheme();
|
|
573
445
|
const {
|
|
574
446
|
id,
|
|
575
447
|
user,
|
|
576
448
|
group,
|
|
577
|
-
|
|
449
|
+
disableSoundForOutgoingMessages = true,
|
|
450
|
+
customSoundForOutgoingMessage,
|
|
578
451
|
disableTypingEvents,
|
|
579
|
-
|
|
580
|
-
placeHolderText,
|
|
452
|
+
initialComposertext,
|
|
581
453
|
HeaderView,
|
|
582
|
-
|
|
583
|
-
onChangeText,
|
|
584
|
-
maxHeight,
|
|
454
|
+
onTextChange,
|
|
585
455
|
attachmentOptions,
|
|
586
|
-
SecondaryButtonView,
|
|
587
456
|
AuxiliaryButtonView,
|
|
588
|
-
auxiliaryButtonsAlignment,
|
|
589
457
|
SendButtonView,
|
|
590
458
|
parentMessageId,
|
|
459
|
+
style = {},
|
|
591
460
|
onSendButtonPress,
|
|
592
461
|
onError,
|
|
593
|
-
|
|
594
|
-
voiceRecordingIconURL,
|
|
595
|
-
mediaRecorderStyle,
|
|
596
|
-
pauseIconUrl,
|
|
597
|
-
playIconUrl,
|
|
598
|
-
recordIconUrl,
|
|
599
|
-
deleteIconUrl,
|
|
600
|
-
stopIconUrl,
|
|
601
|
-
submitIconUrl,
|
|
602
|
-
AIIconURL,
|
|
603
|
-
aiOptionsStyle,
|
|
462
|
+
hideVoiceRecordingButton,
|
|
604
463
|
keyboardAvoidingViewProps,
|
|
605
464
|
textFormatters,
|
|
606
465
|
disableMentions,
|
|
607
466
|
imageQuality = 20,
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
467
|
+
hideCameraOption = false,
|
|
468
|
+
hideImageAttachmentOption = false,
|
|
469
|
+
hideVideoAttachmentOption = false,
|
|
470
|
+
hideAudioAttachmentOption = false,
|
|
471
|
+
hideFileAttachmentOption = false,
|
|
472
|
+
hidePollsAttachmentOption = false,
|
|
473
|
+
hideCollaborativeDocumentOption = false,
|
|
474
|
+
hideCollaborativeWhiteboardOption = false,
|
|
475
|
+
hideAttachmentButton = false,
|
|
476
|
+
hideStickersButton = false,
|
|
477
|
+
hideSendButton = false,
|
|
478
|
+
hideAuxiliaryButtons = false,
|
|
479
|
+
addAttachmentOptions,
|
|
480
|
+
auxiliaryButtonsAlignment = "left",
|
|
614
481
|
} = props;
|
|
615
482
|
|
|
616
|
-
const
|
|
483
|
+
const composerIdMap = new Map().set("parentMessageId", parentMessageId);
|
|
617
484
|
|
|
618
|
-
const
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
485
|
+
const mergedComposerStyle: CometChatTheme["messageComposerStyles"] = useMemo(() => {
|
|
486
|
+
return deepMerge(theme.messageComposerStyles, style);
|
|
487
|
+
}, [theme, style]);
|
|
488
|
+
|
|
489
|
+
const defaultAuxiliaryButtonOptions = useMemo(() => {
|
|
490
|
+
if (hideAuxiliaryButtons) return [];
|
|
491
|
+
return ChatConfigurator.getDataSource().getAuxiliaryOptions(user, group, composerIdMap, {
|
|
492
|
+
stickerIcon: mergedComposerStyle.stickerIcon as ImageSourcePropType | JSX.Element,
|
|
493
|
+
stickerIconStyle: mergedComposerStyle.stickerIconStyle as {
|
|
494
|
+
active: ImageStyle;
|
|
495
|
+
inactive: ImageStyle;
|
|
496
|
+
},
|
|
497
|
+
hideStickersButton,
|
|
498
|
+
});
|
|
499
|
+
}, [mergedComposerStyle, hideStickersButton, hideAuxiliaryButtons]);
|
|
626
500
|
|
|
627
501
|
const loggedInUser = React.useRef<any>({});
|
|
628
502
|
const chatWith = React.useRef<any>(null);
|
|
629
503
|
const chatWithId = React.useRef<any>(null);
|
|
630
|
-
const messageInputRef = React.useRef<
|
|
504
|
+
const messageInputRef = React.useRef<any>(null);
|
|
631
505
|
const chatRef = React.useRef<any>(chatWith);
|
|
632
506
|
const inputValueRef = React.useRef<any>(null);
|
|
633
|
-
const plainTextInput = React.useRef<string>(
|
|
507
|
+
const plainTextInput = React.useRef<string>(initialComposertext || "");
|
|
634
508
|
let mentionMap = React.useRef<Map<string, SuggestionItem>>(new Map());
|
|
635
509
|
let trackingCharacters = React.useRef<string[]>([]);
|
|
636
510
|
let allFormatters = React.useRef<
|
|
637
511
|
Map<string, CometChatTextFormatter | CometChatMentionsFormatter>
|
|
638
512
|
>(new Map());
|
|
639
|
-
let activeCharacter = React.useRef(
|
|
640
|
-
let searchStringRef = React.useRef(
|
|
513
|
+
let activeCharacter = React.useRef("");
|
|
514
|
+
let searchStringRef = React.useRef("");
|
|
641
515
|
|
|
642
516
|
const [selectionPosition, setSelectionPosition] = React.useState<any>({});
|
|
643
|
-
const [inputMessage, setInputMessage] = React.useState<
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
const [showReaction, setShowReaction] = React.useState(false);
|
|
647
|
-
const [showEmojiboard, setShowEmojiboard] = React.useState(false);
|
|
517
|
+
const [inputMessage, setInputMessage] = React.useState<string | JSX.Element>(
|
|
518
|
+
initialComposertext || ""
|
|
519
|
+
);
|
|
648
520
|
const [showActionSheet, setShowActionSheet] = React.useState(false);
|
|
649
521
|
const [showRecordAudio, setShowRecordAudio] = React.useState(false);
|
|
650
|
-
const [
|
|
651
|
-
const [
|
|
652
|
-
const [
|
|
653
|
-
const [
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
const [
|
|
657
|
-
const [CustomViewFooter, setCustomViewFooter] = React.useState<any>(null);
|
|
522
|
+
const [actionSheetItems, setActionSheetItems] = React.useState<any[]>([]);
|
|
523
|
+
const [messagePreview, setMessagePreview] = React.useState<any>();
|
|
524
|
+
const [CustomView, setCustomView] = React.useState(null);
|
|
525
|
+
const [CustomViewHeader, setCustomViewHeader] = React.useState<React.FC | React.ReactNode>(
|
|
526
|
+
null
|
|
527
|
+
);
|
|
528
|
+
const [CustomViewFooter, setCustomViewFooter] = React.useState<React.FC | React.ReactNode>();
|
|
658
529
|
const [isVisible, setIsVisible] = React.useState(false);
|
|
659
530
|
const [kbOffset, setKbOffset] = React.useState(59);
|
|
660
531
|
const [showMentionList, setShowMentionList] = React.useState(false);
|
|
661
|
-
const [mentionsSearchData, setMentionsSearchData] = React.useState<
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
const [suggestionListLoader, setSuggestionListLoader] =
|
|
665
|
-
React.useState(false);
|
|
532
|
+
const [mentionsSearchData, setMentionsSearchData] = React.useState<Array<SuggestionItem>>([]);
|
|
533
|
+
const [suggestionListLoader, setSuggestionListLoader] = React.useState(false);
|
|
534
|
+
const [warningMessage, setWarningMessage] = React.useState("");
|
|
666
535
|
|
|
667
536
|
const bottomSheetRef = React.useRef<any>(null);
|
|
668
537
|
|
|
669
538
|
useLayoutEffect(() => {
|
|
670
|
-
if (Platform.OS ===
|
|
539
|
+
if (Platform.OS === "ios") {
|
|
671
540
|
if (Number.isInteger(commonVars.safeAreaInsets.top)) {
|
|
672
|
-
setKbOffset(commonVars.safeAreaInsets.top
|
|
541
|
+
setKbOffset(commonVars.safeAreaInsets.top ?? 0);
|
|
673
542
|
return;
|
|
674
543
|
}
|
|
675
544
|
CommonUtil.getSafeAreaInsets().then((res: any) => {
|
|
@@ -682,19 +551,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
682
551
|
}
|
|
683
552
|
}, []);
|
|
684
553
|
|
|
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);
|
|
554
|
+
const isTyping = useRef<NodeJS.Timeout | null>(null);
|
|
698
555
|
|
|
699
556
|
/**
|
|
700
557
|
* Event callback
|
|
@@ -703,6 +560,40 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
703
560
|
previewMessageForEdit: previewMessage,
|
|
704
561
|
}));
|
|
705
562
|
|
|
563
|
+
useLayoutEffect(() => {
|
|
564
|
+
if (warningMessage) {
|
|
565
|
+
setCustomViewHeader(
|
|
566
|
+
<View
|
|
567
|
+
style={
|
|
568
|
+
{
|
|
569
|
+
flexDirection: "row",
|
|
570
|
+
alignItems: "center",
|
|
571
|
+
padding: theme.spacing.padding.p2,
|
|
572
|
+
borderRadius: mergedComposerStyle?.containerStyle?.borderRadius,
|
|
573
|
+
backgroundColor: mergedComposerStyle?.containerStyle?.backgroundColor,
|
|
574
|
+
borderColor: mergedComposerStyle?.containerStyle?.borderColor,
|
|
575
|
+
borderWidth: mergedComposerStyle?.containerStyle?.borderWidth,
|
|
576
|
+
marginBottom: 2,
|
|
577
|
+
} as ViewStyle
|
|
578
|
+
}
|
|
579
|
+
>
|
|
580
|
+
<Icon name='info-fill' color={theme.color.error}></Icon>
|
|
581
|
+
<Text
|
|
582
|
+
style={{
|
|
583
|
+
marginLeft: 5,
|
|
584
|
+
color: theme.color.error,
|
|
585
|
+
...theme.typography.caption1.regular,
|
|
586
|
+
}}
|
|
587
|
+
>
|
|
588
|
+
{warningMessage}
|
|
589
|
+
</Text>
|
|
590
|
+
</View>
|
|
591
|
+
);
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
594
|
+
setCustomViewHeader(null);
|
|
595
|
+
}, [warningMessage, theme]);
|
|
596
|
+
|
|
706
597
|
const previewMessage = ({ message, status }: any) => {
|
|
707
598
|
if (status === messageStatus.inprogress) {
|
|
708
599
|
let textComponents = message?.text;
|
|
@@ -712,25 +603,25 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
712
603
|
let users: any = {};
|
|
713
604
|
let regexes: Array<RegExp> = [];
|
|
714
605
|
|
|
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;
|
|
606
|
+
allFormatters.current.forEach((formatter: CometChatTextFormatter, key) => {
|
|
607
|
+
formatter.handleComposerPreview(message);
|
|
608
|
+
if (!regexes.includes(formatter.getRegexPattern())) {
|
|
609
|
+
regexes.push(formatter.getRegexPattern());
|
|
727
610
|
}
|
|
728
|
-
|
|
611
|
+
let suggestionUsers = formatter.getSuggestionItems();
|
|
612
|
+
suggestionUsers.forEach((item) => (users[item.underlyingText] = item));
|
|
613
|
+
let resp = formatter.getFormattedText(textComponents);
|
|
614
|
+
if (formatter instanceof CometChatMentionsFormatter) {
|
|
615
|
+
getMentionLimitView(formatter);
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
textComponents = resp;
|
|
619
|
+
});
|
|
729
620
|
|
|
730
|
-
let edits: any
|
|
621
|
+
let edits: any = [];
|
|
731
622
|
|
|
732
623
|
regexes.forEach((regex) => {
|
|
733
|
-
let match;
|
|
624
|
+
let match: any;
|
|
734
625
|
while ((match = regex.exec(rawText)) !== null) {
|
|
735
626
|
const user = users[match[0]];
|
|
736
627
|
if (user) {
|
|
@@ -745,41 +636,38 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
745
636
|
});
|
|
746
637
|
|
|
747
638
|
// Sort edits by startIndex to apply them in order
|
|
748
|
-
edits.sort((a, b) => a.startIndex - b.startIndex);
|
|
639
|
+
edits.sort((a: any, b: any) => a.startIndex - b.startIndex);
|
|
749
640
|
|
|
750
641
|
plainTextInput.current = getPlainString(message?.text, edits);
|
|
751
642
|
|
|
752
643
|
const hashMap = new Map();
|
|
753
644
|
let offset = 0; // Tracks shift in position due to replacements
|
|
754
645
|
|
|
755
|
-
edits.forEach((edit) => {
|
|
646
|
+
edits.forEach((edit: any) => {
|
|
756
647
|
const adjustedStartIndex = edit.startIndex + offset;
|
|
757
648
|
rawText =
|
|
758
649
|
rawText.substring(0, adjustedStartIndex) +
|
|
759
650
|
edit.replacement +
|
|
760
651
|
rawText.substring(edit.endIndex);
|
|
761
652
|
offset += edit.replacement.length - (edit.endIndex - edit.startIndex);
|
|
762
|
-
const rangeKey = `${adjustedStartIndex}_${
|
|
763
|
-
adjustedStartIndex + edit.replacement.length
|
|
764
|
-
}`;
|
|
653
|
+
const rangeKey = `${adjustedStartIndex}_${adjustedStartIndex + edit.replacement.length}`;
|
|
765
654
|
hashMap.set(rangeKey, edit.user);
|
|
766
655
|
});
|
|
767
656
|
|
|
768
657
|
mentionMap.current = hashMap;
|
|
769
|
-
|
|
770
658
|
setMessagePreview({
|
|
771
659
|
message: { ...message, text: textComponents },
|
|
772
660
|
mode: ConversationOptionConstants.edit,
|
|
773
661
|
});
|
|
774
662
|
|
|
775
|
-
inputValueRef.current = textComponents ??
|
|
776
|
-
setInputMessage(textComponents ??
|
|
663
|
+
inputValueRef.current = textComponents ?? "";
|
|
664
|
+
setInputMessage(textComponents ?? "");
|
|
777
665
|
messageInputRef.current.focus();
|
|
778
666
|
}
|
|
779
667
|
};
|
|
780
668
|
|
|
781
669
|
const cameraCallback = async (cameraImage: any) => {
|
|
782
|
-
if (CheckPropertyExists(cameraImage,
|
|
670
|
+
if (CheckPropertyExists(cameraImage, "error")) {
|
|
783
671
|
return;
|
|
784
672
|
}
|
|
785
673
|
const { name, uri, type } = cameraImage;
|
|
@@ -788,32 +676,24 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
788
676
|
type,
|
|
789
677
|
uri,
|
|
790
678
|
};
|
|
791
|
-
sendMediaMessage(
|
|
792
|
-
chatWithId.current,
|
|
793
|
-
file,
|
|
794
|
-
MessageTypeConstants.image,
|
|
795
|
-
chatWith.current
|
|
796
|
-
);
|
|
679
|
+
sendMediaMessage(chatWithId.current, file, MessageTypeConstants.image, chatWith.current);
|
|
797
680
|
};
|
|
798
681
|
|
|
799
682
|
const fileInputHandler = async (fileType: string) => {
|
|
800
683
|
if (fileType === MessageTypeConstants.takePhoto) {
|
|
801
|
-
if (!(await permissionUtil.startResourceBasedTask([
|
|
684
|
+
if (!(await permissionUtil.startResourceBasedTask(["camera"]))) {
|
|
802
685
|
return;
|
|
803
686
|
}
|
|
804
687
|
let quality = imageQuality;
|
|
805
688
|
if (isNaN(imageQuality) || imageQuality < 1 || imageQuality > 100) {
|
|
806
689
|
quality = 20;
|
|
807
690
|
}
|
|
808
|
-
if (Platform.OS ===
|
|
691
|
+
if (Platform.OS === "android") {
|
|
809
692
|
FileManager.openCamera(fileType, Math.round(quality), cameraCallback);
|
|
810
693
|
} else {
|
|
811
694
|
FileManager.openCamera(fileType, cameraCallback);
|
|
812
695
|
}
|
|
813
|
-
} else if (
|
|
814
|
-
Platform.OS === 'ios' &&
|
|
815
|
-
fileType === MessageTypeConstants.video
|
|
816
|
-
) {
|
|
696
|
+
} else if (Platform.OS === "ios" && fileType === MessageTypeConstants.video) {
|
|
817
697
|
NativeModules.VideoPickerModule.pickVideo((file: any) => {
|
|
818
698
|
if (file.uri)
|
|
819
699
|
sendMediaMessage(
|
|
@@ -825,7 +705,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
825
705
|
});
|
|
826
706
|
} else
|
|
827
707
|
FileManager.openFileChooser(fileType, async (fileInfo: any) => {
|
|
828
|
-
if (CheckPropertyExists(fileInfo,
|
|
708
|
+
if (CheckPropertyExists(fileInfo, "error")) {
|
|
829
709
|
return;
|
|
830
710
|
}
|
|
831
711
|
let { name, uri, type } = fileInfo;
|
|
@@ -834,65 +714,25 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
834
714
|
type,
|
|
835
715
|
uri,
|
|
836
716
|
};
|
|
837
|
-
sendMediaMessage(
|
|
838
|
-
chatWithId.current,
|
|
839
|
-
file,
|
|
840
|
-
fileType,
|
|
841
|
-
chatWith.current
|
|
842
|
-
);
|
|
717
|
+
sendMediaMessage(chatWithId.current, file, fileType, chatWith.current);
|
|
843
718
|
});
|
|
844
719
|
};
|
|
845
720
|
|
|
846
721
|
const playAudio = () => {
|
|
847
|
-
if (
|
|
722
|
+
if (customSoundForOutgoingMessage) {
|
|
848
723
|
CometChatSoundManager.play(
|
|
849
724
|
CometChatSoundManager.SoundOutput.outgoingMessage,
|
|
850
|
-
|
|
725
|
+
customSoundForOutgoingMessage
|
|
851
726
|
);
|
|
852
727
|
} 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);
|
|
728
|
+
CometChatSoundManager.play(CometChatSoundManager.SoundOutput.outgoingMessage);
|
|
886
729
|
}
|
|
887
730
|
};
|
|
888
731
|
|
|
889
732
|
const clearInputBox = () => {
|
|
890
|
-
inputValueRef.current =
|
|
891
|
-
setInputMessage(
|
|
892
|
-
|
|
893
|
-
messageInputRef.current.clear();
|
|
894
|
-
setInputMessage('');
|
|
895
|
-
}, 100);
|
|
733
|
+
inputValueRef.current = "";
|
|
734
|
+
setInputMessage("");
|
|
735
|
+
setWarningMessage("");
|
|
896
736
|
};
|
|
897
737
|
|
|
898
738
|
const sendTextMessage = () => {
|
|
@@ -903,28 +743,31 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
903
743
|
}
|
|
904
744
|
|
|
905
745
|
let finalTextInput = getRegexString(plainTextInput.current);
|
|
746
|
+
// Trim the trailing spaces and store in a variable
|
|
747
|
+
let trimmedTextInput = finalTextInput.trim();
|
|
906
748
|
|
|
907
|
-
|
|
749
|
+
// Create the text message with the trimmed text
|
|
750
|
+
let textMessage = new CometChat.TextMessage(
|
|
908
751
|
chatWithId.current,
|
|
909
|
-
|
|
752
|
+
trimmedTextInput,
|
|
910
753
|
chatWith.current
|
|
911
754
|
);
|
|
912
755
|
|
|
913
756
|
textMessage.setSender(loggedInUser.current);
|
|
914
757
|
textMessage.setReceiver(chatWith.current);
|
|
915
|
-
|
|
758
|
+
// Use the trimmed text here as well
|
|
759
|
+
textMessage.setText(trimmedTextInput);
|
|
916
760
|
textMessage.setMuid(String(getUnixTimestampInMilliseconds()));
|
|
917
|
-
parentMessageId &&
|
|
918
|
-
textMessage.setParentMessageId(parentMessageId as number);
|
|
761
|
+
parentMessageId && textMessage.setParentMessageId(parentMessageId as number);
|
|
919
762
|
|
|
920
763
|
allFormatters.current.forEach((item) => {
|
|
921
764
|
textMessage = item.handlePreMessageSend(textMessage);
|
|
922
765
|
});
|
|
923
766
|
|
|
924
767
|
setMentionsSearchData([]);
|
|
925
|
-
plainTextInput.current =
|
|
768
|
+
plainTextInput.current = "";
|
|
926
769
|
|
|
927
|
-
if (
|
|
770
|
+
if (trimmedTextInput.trim().length === 0) {
|
|
928
771
|
return;
|
|
929
772
|
}
|
|
930
773
|
|
|
@@ -940,28 +783,22 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
940
783
|
status: messageStatus.inprogress,
|
|
941
784
|
});
|
|
942
785
|
|
|
943
|
-
if (!
|
|
786
|
+
if (!disableSoundForOutgoingMessages) playAudio();
|
|
944
787
|
|
|
945
788
|
CometChat.sendMessage(textMessage)
|
|
946
789
|
.then((message: any) => {
|
|
947
|
-
CometChatUIEventHandler.emitMessageEvent(
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
status: messageStatus.success,
|
|
952
|
-
}
|
|
953
|
-
);
|
|
790
|
+
CometChatUIEventHandler.emitMessageEvent(MessageEvents.ccMessageSent, {
|
|
791
|
+
message: message,
|
|
792
|
+
status: messageStatus.success,
|
|
793
|
+
});
|
|
954
794
|
})
|
|
955
795
|
.catch((error: any) => {
|
|
956
796
|
onError && onError(error);
|
|
957
|
-
textMessage.
|
|
958
|
-
CometChatUIEventHandler.emitMessageEvent(
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
status: messageStatus.error,
|
|
963
|
-
}
|
|
964
|
-
);
|
|
797
|
+
textMessage.setMetadata({ error: true });
|
|
798
|
+
CometChatUIEventHandler.emitMessageEvent(MessageEvents.ccMessageSent, {
|
|
799
|
+
message: textMessage,
|
|
800
|
+
status: messageStatus.error,
|
|
801
|
+
});
|
|
965
802
|
clearInputBox();
|
|
966
803
|
});
|
|
967
804
|
};
|
|
@@ -979,12 +816,11 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
979
816
|
chatWith.current
|
|
980
817
|
);
|
|
981
818
|
textMessage.setId(message.id);
|
|
982
|
-
parentMessageId &&
|
|
983
|
-
textMessage.setParentMessageId(parentMessageId as number);
|
|
819
|
+
parentMessageId && textMessage.setParentMessageId(parentMessageId as number);
|
|
984
820
|
|
|
985
|
-
inputValueRef.current =
|
|
986
|
-
|
|
987
|
-
messageInputRef.current.
|
|
821
|
+
inputValueRef.current = "";
|
|
822
|
+
clearInputBox();
|
|
823
|
+
messageInputRef.current.textContent = "";
|
|
988
824
|
|
|
989
825
|
setMessagePreview(null);
|
|
990
826
|
|
|
@@ -993,19 +829,16 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
993
829
|
return;
|
|
994
830
|
}
|
|
995
831
|
|
|
996
|
-
if (!
|
|
832
|
+
if (!disableSoundForOutgoingMessages) playAudio();
|
|
997
833
|
|
|
998
834
|
CometChat.editMessage(textMessage)
|
|
999
835
|
.then((editedMessage: any) => {
|
|
1000
|
-
inputValueRef.current =
|
|
1001
|
-
setInputMessage(
|
|
1002
|
-
CometChatUIEventHandler.emitMessageEvent(
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
status: messageStatus.success,
|
|
1007
|
-
}
|
|
1008
|
-
);
|
|
836
|
+
inputValueRef.current = "";
|
|
837
|
+
setInputMessage("");
|
|
838
|
+
CometChatUIEventHandler.emitMessageEvent(MessageEvents.ccMessageEdited, {
|
|
839
|
+
message: editedMessage,
|
|
840
|
+
status: messageStatus.success,
|
|
841
|
+
});
|
|
1009
842
|
})
|
|
1010
843
|
.catch((error: any) => {
|
|
1011
844
|
onError && onError(error);
|
|
@@ -1020,7 +853,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1020
853
|
receiverType?: any
|
|
1021
854
|
) => {
|
|
1022
855
|
setShowActionSheet(false);
|
|
1023
|
-
let mediaMessage
|
|
856
|
+
let mediaMessage = new CometChat.MediaMessage(
|
|
1024
857
|
receiverId,
|
|
1025
858
|
messageInput,
|
|
1026
859
|
messageType,
|
|
@@ -1034,15 +867,14 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1034
867
|
mediaMessage.setData({
|
|
1035
868
|
type: messageType,
|
|
1036
869
|
category: CometChat.CATEGORY_MESSAGE,
|
|
1037
|
-
name: messageInput[
|
|
870
|
+
name: messageInput["name"],
|
|
1038
871
|
file: messageInput,
|
|
1039
|
-
url: messageInput[
|
|
872
|
+
url: messageInput["uri"],
|
|
1040
873
|
sender: loggedInUser.current,
|
|
1041
874
|
});
|
|
1042
|
-
parentMessageId &&
|
|
1043
|
-
mediaMessage.setParentMessageId(parentMessageId as number);
|
|
875
|
+
parentMessageId && mediaMessage.setParentMessageId(parentMessageId as number);
|
|
1044
876
|
|
|
1045
|
-
let localMessage
|
|
877
|
+
let localMessage = new CometChat.MediaMessage(
|
|
1046
878
|
receiverId,
|
|
1047
879
|
messageInput,
|
|
1048
880
|
messageType,
|
|
@@ -1050,25 +882,24 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1050
882
|
);
|
|
1051
883
|
|
|
1052
884
|
localMessage.setSender(loggedInUser.current);
|
|
1053
|
-
localMessage.setReceiver(
|
|
885
|
+
localMessage.setReceiver(receiverType);
|
|
1054
886
|
localMessage.setType(messageType);
|
|
1055
887
|
localMessage.setMuid(String(getUnixTimestampInMilliseconds()));
|
|
1056
888
|
localMessage.setData({
|
|
1057
889
|
type: messageType,
|
|
1058
890
|
category: CometChat.CATEGORY_MESSAGE,
|
|
1059
|
-
name: messageInput[
|
|
891
|
+
name: messageInput["name"],
|
|
1060
892
|
file: messageInput,
|
|
1061
|
-
url: messageInput[
|
|
893
|
+
url: messageInput["uri"],
|
|
1062
894
|
sender: loggedInUser.current,
|
|
1063
895
|
});
|
|
1064
|
-
parentMessageId &&
|
|
1065
|
-
localMessage.setParentMessageId(parentMessageId as number);
|
|
896
|
+
parentMessageId && localMessage.setParentMessageId(parentMessageId as number);
|
|
1066
897
|
localMessage.setData({
|
|
1067
898
|
type: messageType,
|
|
1068
899
|
category: CometChat.CATEGORY_MESSAGE,
|
|
1069
|
-
name: messageInput[
|
|
900
|
+
name: messageInput["name"],
|
|
1070
901
|
file: messageInput,
|
|
1071
|
-
url: messageInput[
|
|
902
|
+
url: messageInput["uri"],
|
|
1072
903
|
sender: loggedInUser.current,
|
|
1073
904
|
attachments: [messageInput],
|
|
1074
905
|
});
|
|
@@ -1078,30 +909,24 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1078
909
|
status: messageStatus.inprogress,
|
|
1079
910
|
});
|
|
1080
911
|
|
|
1081
|
-
if (!
|
|
912
|
+
if (!disableSoundForOutgoingMessages) playAudio();
|
|
1082
913
|
CometChat.sendMediaMessage(mediaMessage)
|
|
1083
914
|
.then((message: any) => {
|
|
1084
|
-
CometChatUIEventHandler.emitMessageEvent(
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
status: messageStatus.success,
|
|
1089
|
-
}
|
|
1090
|
-
);
|
|
915
|
+
CometChatUIEventHandler.emitMessageEvent(MessageEvents.ccMessageSent, {
|
|
916
|
+
message: message,
|
|
917
|
+
status: messageStatus.success,
|
|
918
|
+
});
|
|
1091
919
|
setShowRecordAudio(false);
|
|
1092
920
|
})
|
|
1093
921
|
.catch((error: any) => {
|
|
1094
922
|
setShowRecordAudio(false);
|
|
1095
923
|
onError && onError(error);
|
|
1096
|
-
localMessage.
|
|
1097
|
-
CometChatUIEventHandler.emitMessageEvent(
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
}
|
|
1103
|
-
);
|
|
1104
|
-
console.log('media message sent error', error);
|
|
924
|
+
localMessage.setMetadata({ error: true });
|
|
925
|
+
CometChatUIEventHandler.emitMessageEvent(MessageEvents.ccMessageSent, {
|
|
926
|
+
message: localMessage,
|
|
927
|
+
status: messageStatus.error,
|
|
928
|
+
});
|
|
929
|
+
console.log("media message sent error", error);
|
|
1105
930
|
});
|
|
1106
931
|
};
|
|
1107
932
|
|
|
@@ -1156,160 +981,121 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1156
981
|
return false;
|
|
1157
982
|
};
|
|
1158
983
|
|
|
1159
|
-
const
|
|
984
|
+
const SecondaryButtonViewElem = useMemo(() => {
|
|
985
|
+
if (hideAttachmentButton || !actionSheetItems.length) return <></>;
|
|
1160
986
|
return (
|
|
1161
|
-
<
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
987
|
+
<AttachIconButton
|
|
988
|
+
onPress={() => setShowActionSheet(true)}
|
|
989
|
+
icon={mergedComposerStyle.attachmentIcon as JSX.Element | ImageSourcePropType}
|
|
990
|
+
iconStyle={mergedComposerStyle.attachmentIconStyle as ImageStyle}
|
|
1165
991
|
/>
|
|
1166
992
|
);
|
|
993
|
+
}, [mergedComposerStyle]);
|
|
994
|
+
|
|
995
|
+
const RecordAudioButtonView = ({
|
|
996
|
+
icon,
|
|
997
|
+
iconStyle,
|
|
998
|
+
}: {
|
|
999
|
+
icon: JSX.Element | ImageSourcePropType;
|
|
1000
|
+
iconStyle?: ImageStyle;
|
|
1001
|
+
}) => {
|
|
1002
|
+
return (
|
|
1003
|
+
<TouchableOpacity onPress={() => setShowRecordAudio(true)}>
|
|
1004
|
+
<Icon
|
|
1005
|
+
name='mic'
|
|
1006
|
+
height={24}
|
|
1007
|
+
width={24}
|
|
1008
|
+
icon={icon}
|
|
1009
|
+
color={iconStyle?.tintColor ?? theme.color.iconSecondary}
|
|
1010
|
+
imageStyle={iconStyle}
|
|
1011
|
+
/>
|
|
1012
|
+
</TouchableOpacity>
|
|
1013
|
+
);
|
|
1167
1014
|
};
|
|
1168
1015
|
|
|
1169
|
-
const
|
|
1170
|
-
return
|
|
1171
|
-
|
|
1016
|
+
const voiceRecoringButtonElem = useMemo(() => {
|
|
1017
|
+
return hideVoiceRecordingButton ? undefined : (
|
|
1018
|
+
<RecordAudioButtonView
|
|
1019
|
+
icon={mergedComposerStyle.voiceRecordingIcon as ImageSourcePropType | JSX.Element}
|
|
1020
|
+
iconStyle={mergedComposerStyle.voiceRecordingIconStyle as ImageStyle}
|
|
1021
|
+
/>
|
|
1022
|
+
);
|
|
1023
|
+
}, [hideVoiceRecordingButton, mergedComposerStyle]);
|
|
1172
1024
|
|
|
1173
|
-
const AuxiliaryButtonViewElem = () => {
|
|
1174
|
-
if (AuxiliaryButtonView
|
|
1175
|
-
return
|
|
1176
|
-
<AuxiliaryButtonView user={user} group={group} composerId={messageComposerId} />
|
|
1177
|
-
);
|
|
1025
|
+
const AuxiliaryButtonViewElem = useCallback(() => {
|
|
1026
|
+
if (AuxiliaryButtonView)
|
|
1027
|
+
return <AuxiliaryButtonView user={user} group={group} composerId={id!} />;
|
|
1178
1028
|
else if (defaultAuxiliaryButtonOptions)
|
|
1179
1029
|
return (
|
|
1180
|
-
<View
|
|
1030
|
+
<View
|
|
1031
|
+
style={{
|
|
1032
|
+
flexDirection: "row",
|
|
1033
|
+
alignItems: "center",
|
|
1034
|
+
gap: theme.spacing.spacing.s2,
|
|
1035
|
+
}}
|
|
1036
|
+
>
|
|
1181
1037
|
{defaultAuxiliaryButtonOptions}
|
|
1182
|
-
{shouldShowAIOptions() && <AIOptionsButtonView />}
|
|
1183
|
-
{!hideVoiceRecording && <RecordAudioButtonView />}
|
|
1184
1038
|
</View>
|
|
1185
1039
|
);
|
|
1186
1040
|
|
|
1187
|
-
return
|
|
1188
|
-
};
|
|
1041
|
+
return <></>;
|
|
1042
|
+
}, [defaultAuxiliaryButtonOptions]);
|
|
1189
1043
|
|
|
1190
|
-
const SendButtonViewElem = () => {
|
|
1191
|
-
if (
|
|
1192
|
-
|
|
1044
|
+
const SendButtonViewElem = useCallback(() => {
|
|
1045
|
+
if (hideSendButton) return <></>;
|
|
1046
|
+
if (SendButtonView) return <SendButtonView user={user} group={group} composerId={id!} />;
|
|
1047
|
+
const disabled = typeof inputMessage === "string" && inputMessage.length === 0;
|
|
1193
1048
|
return (
|
|
1194
|
-
<
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
Style.imageStyle,
|
|
1049
|
+
<TouchableOpacity
|
|
1050
|
+
onPress={sendTextMessage}
|
|
1051
|
+
style={[
|
|
1198
1052
|
{
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
: messageComposerStyle?.sendIconTint ||
|
|
1203
|
-
theme.palette.getPrimary(),
|
|
1053
|
+
borderRadius: theme.spacing.radius.max,
|
|
1054
|
+
padding: 4,
|
|
1055
|
+
backgroundColor: disabled ? theme.color.background4 : theme.color.fabButtonBackground,
|
|
1204
1056
|
},
|
|
1057
|
+
mergedComposerStyle.sendIconContainerStyle as ViewStyle,
|
|
1205
1058
|
]}
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
<AttachIconButton
|
|
1219
|
-
icon={attachmentIcon}
|
|
1220
|
-
show={true}
|
|
1221
|
-
onClick={() => setShowActionSheet(true)}
|
|
1222
|
-
style={{
|
|
1223
|
-
height: 23,
|
|
1224
|
-
width: 23,
|
|
1225
|
-
resizeMode: 'contain',
|
|
1226
|
-
tintColor: messageComposerStyle?.attachIconTint
|
|
1227
|
-
? messageComposerStyle.attachIconTint
|
|
1228
|
-
: theme.palette.getAccent(),
|
|
1229
|
-
}}
|
|
1230
|
-
/>
|
|
1231
|
-
);
|
|
1232
|
-
};
|
|
1233
|
-
const PrimaryButtonView = () => {
|
|
1234
|
-
return (inputMessage as String).length !== 0 || hideLiveReaction ? (
|
|
1235
|
-
<SendButtonViewElem />
|
|
1236
|
-
) : (
|
|
1237
|
-
<View>
|
|
1238
|
-
<View style={Style.liveReactionStyle}>
|
|
1239
|
-
<LiveReaction show={showReaction} reaction={liveReactionIcon} />
|
|
1240
|
-
</View>
|
|
1241
|
-
<ImageButton
|
|
1242
|
-
image={liveReactionIcon}
|
|
1243
|
-
imageStyle={[Style.imageStyle, Style.liveReactionBtnStyle]}
|
|
1244
|
-
onClick={liveReactionHandler}
|
|
1059
|
+
disabled={disabled}
|
|
1060
|
+
>
|
|
1061
|
+
<Icon
|
|
1062
|
+
name='send-fill'
|
|
1063
|
+
icon={mergedComposerStyle.sendIcon as ImageSourcePropType | JSX.Element}
|
|
1064
|
+
color={
|
|
1065
|
+
(mergedComposerStyle.sendIconStyle?.tintColor ??
|
|
1066
|
+
theme.color.fabButtonIcon) as ColorValue
|
|
1067
|
+
}
|
|
1068
|
+
imageStyle={mergedComposerStyle.sendIconStyle as ImageStyle}
|
|
1069
|
+
height={24}
|
|
1070
|
+
width={24}
|
|
1245
1071
|
/>
|
|
1246
|
-
</
|
|
1072
|
+
</TouchableOpacity>
|
|
1247
1073
|
);
|
|
1248
|
-
};
|
|
1249
|
-
|
|
1250
|
-
const RecordAudioButtonView = () => {
|
|
1251
|
-
return (
|
|
1252
|
-
<ImageButton
|
|
1253
|
-
image={voiceRecordingIconURL || ICONS.MICROPHONE}
|
|
1254
|
-
imageStyle={[
|
|
1255
|
-
Style.imageStyle,
|
|
1256
|
-
messageComposerStyle?.voiceRecordingIconTint
|
|
1257
|
-
? { tintColor: messageComposerStyle?.voiceRecordingIconTint }
|
|
1258
|
-
: {},
|
|
1259
|
-
]}
|
|
1260
|
-
onClick={() => setShowRecordAudio(true)}
|
|
1261
|
-
/>
|
|
1262
|
-
);
|
|
1263
|
-
};
|
|
1264
|
-
const AIOptionsButtonView = () => {
|
|
1265
|
-
return (
|
|
1266
|
-
<ImageButton
|
|
1267
|
-
image={AIIconURL || ICONS.AI}
|
|
1268
|
-
imageStyle={Style.imageStyle}
|
|
1269
|
-
onClick={() => {
|
|
1270
|
-
setShowAIOptions(true);
|
|
1271
|
-
setAIOptionItems(rootAIOptionItems);
|
|
1272
|
-
}}
|
|
1273
|
-
/>
|
|
1274
|
-
);
|
|
1275
|
-
};
|
|
1074
|
+
}, [mergedComposerStyle, inputMessage]);
|
|
1276
1075
|
|
|
1277
1076
|
//fetch logged in user
|
|
1278
1077
|
useEffect(() => {
|
|
1279
|
-
CometChat.getLoggedinUser().then(
|
|
1280
|
-
|
|
1281
|
-
);
|
|
1282
|
-
let _formatter = [...(textFormatters ?? [])];
|
|
1078
|
+
CometChat.getLoggedinUser().then((user) => (loggedInUser.current = user));
|
|
1079
|
+
let _formatter = [...(textFormatters || [])];
|
|
1283
1080
|
|
|
1284
1081
|
if (!disableMentions) {
|
|
1285
|
-
let mentionsFormatter =
|
|
1286
|
-
|
|
1287
|
-
CometChatUIKit.loggedInUser &&
|
|
1288
|
-
mentionsFormatter.setLoggedInUser(CometChatUIKit.loggedInUser);
|
|
1082
|
+
let mentionsFormatter = ChatConfigurator.getDataSource().getMentionsFormatter();
|
|
1083
|
+
mentionsFormatter.setLoggedInUser(CometChatUIKit.loggedInUser!);
|
|
1289
1084
|
mentionsFormatter.setMentionsStyle(
|
|
1290
|
-
|
|
1291
|
-
loggedInUserTextStyle: {
|
|
1292
|
-
color: theme.palette.getPrimary(),
|
|
1293
|
-
...theme.typography.title2,
|
|
1294
|
-
fontSize: 17,
|
|
1295
|
-
} as TextStyle,
|
|
1296
|
-
textStyle: {
|
|
1297
|
-
color: theme.palette.getPrimary(),
|
|
1298
|
-
...theme.typography.subtitle1,
|
|
1299
|
-
fontSize: 17,
|
|
1300
|
-
} as TextStyle,
|
|
1301
|
-
})
|
|
1085
|
+
mergedComposerStyle.mentionsStyle as CometChatTheme["mentionsStyle"]
|
|
1302
1086
|
);
|
|
1303
|
-
|
|
1304
|
-
|
|
1087
|
+
mentionsFormatter.setTargetElement(MentionsTargetElement.textinput);
|
|
1088
|
+
|
|
1089
|
+
if (user) mentionsFormatter.setUser(user);
|
|
1090
|
+
if (group) mentionsFormatter.setGroup(group);
|
|
1305
1091
|
|
|
1306
1092
|
_formatter.unshift(mentionsFormatter);
|
|
1307
1093
|
}
|
|
1308
1094
|
|
|
1309
1095
|
_formatter.forEach((formatter) => {
|
|
1310
|
-
|
|
1311
|
-
user
|
|
1312
|
-
group
|
|
1096
|
+
formatter.setComposerId(id!);
|
|
1097
|
+
if (user) formatter.setUser(user);
|
|
1098
|
+
if (group) formatter.setGroup(group);
|
|
1313
1099
|
let trackingCharacter = formatter.getTrackingCharacter();
|
|
1314
1100
|
trackingCharacters.current.push(trackingCharacter);
|
|
1315
1101
|
|
|
@@ -1359,22 +1145,51 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1359
1145
|
};
|
|
1360
1146
|
|
|
1361
1147
|
useEffect(() => {
|
|
1362
|
-
const defaultAttachmentOptions =
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1148
|
+
const defaultAttachmentOptions = ChatConfigurator.dataSource.getAttachmentOptions(
|
|
1149
|
+
theme,
|
|
1150
|
+
user,
|
|
1151
|
+
group,
|
|
1152
|
+
composerIdMap,
|
|
1153
|
+
{
|
|
1154
|
+
hideCameraOption,
|
|
1155
|
+
hideImageAttachmentOption,
|
|
1156
|
+
hideVideoAttachmentOption,
|
|
1157
|
+
hideAudioAttachmentOption,
|
|
1158
|
+
hideFileAttachmentOption,
|
|
1159
|
+
hidePollsAttachmentOption,
|
|
1160
|
+
hideCollaborativeDocumentOption,
|
|
1161
|
+
hideCollaborativeWhiteboardOption,
|
|
1162
|
+
}
|
|
1163
|
+
);
|
|
1368
1164
|
setActionSheetItems(() =>
|
|
1369
|
-
attachmentOptions && typeof attachmentOptions ===
|
|
1370
|
-
? attachmentOptions({ user, group, composerId: composerIdMap })?.map(
|
|
1371
|
-
(item
|
|
1372
|
-
|
|
1165
|
+
attachmentOptions && typeof attachmentOptions === "function"
|
|
1166
|
+
? attachmentOptions({ user, group, composerId: composerIdMap })?.map((item) => {
|
|
1167
|
+
if (typeof item.CustomView === "function")
|
|
1168
|
+
return {
|
|
1169
|
+
...item,
|
|
1170
|
+
onPress: () => handleOnClick(item.CustomView),
|
|
1171
|
+
};
|
|
1172
|
+
if (typeof item.onPress == "function")
|
|
1173
|
+
return {
|
|
1174
|
+
...item,
|
|
1175
|
+
onPress: () => {
|
|
1176
|
+
setShowActionSheet(false);
|
|
1177
|
+
item.onPress?.(user, group);
|
|
1178
|
+
},
|
|
1179
|
+
};
|
|
1180
|
+
return {
|
|
1181
|
+
...item,
|
|
1182
|
+
onPress: () => fileInputHandler(item.id),
|
|
1183
|
+
};
|
|
1184
|
+
})
|
|
1185
|
+
: [
|
|
1186
|
+
...defaultAttachmentOptions.map((item: any) => {
|
|
1187
|
+
if (typeof item.CustomView === "function")
|
|
1373
1188
|
return {
|
|
1374
1189
|
...item,
|
|
1375
1190
|
onPress: () => handleOnClick(item.CustomView),
|
|
1376
1191
|
};
|
|
1377
|
-
if (typeof item.onPress
|
|
1192
|
+
if (typeof item.onPress === "function")
|
|
1378
1193
|
return {
|
|
1379
1194
|
...item,
|
|
1380
1195
|
onPress: () => {
|
|
@@ -1386,61 +1201,45 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1386
1201
|
...item,
|
|
1387
1202
|
onPress: () => fileInputHandler(item.id),
|
|
1388
1203
|
};
|
|
1389
|
-
}
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1204
|
+
}),
|
|
1205
|
+
...(addAttachmentOptions && typeof addAttachmentOptions === "function"
|
|
1206
|
+
? addAttachmentOptions({ user, group, composerId: composerIdMap })?.map((item) => {
|
|
1207
|
+
if (typeof item.CustomView === "function")
|
|
1208
|
+
return {
|
|
1209
|
+
...item,
|
|
1210
|
+
onPress: () => handleOnClick(item.CustomView),
|
|
1211
|
+
};
|
|
1212
|
+
if (typeof item.onPress == "function")
|
|
1213
|
+
return {
|
|
1214
|
+
...item,
|
|
1215
|
+
onPress: () => {
|
|
1216
|
+
setShowActionSheet(false);
|
|
1217
|
+
item.onPress?.(user, group);
|
|
1218
|
+
},
|
|
1219
|
+
};
|
|
1220
|
+
return {
|
|
1221
|
+
...item,
|
|
1222
|
+
onPress: () => fileInputHandler(item.id),
|
|
1223
|
+
};
|
|
1224
|
+
})
|
|
1225
|
+
: []),
|
|
1226
|
+
]
|
|
1407
1227
|
);
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
| CometChatMessageOption
|
|
1424
|
-
| CometChatMessageComposerActionInterface
|
|
1425
|
-
)[]
|
|
1426
|
-
) => {
|
|
1427
|
-
let newOptions = [...options];
|
|
1428
|
-
let newAiOptions = newOptions.map((item: any) => {
|
|
1429
|
-
if (typeof item.onPress === 'function')
|
|
1430
|
-
return {
|
|
1431
|
-
...item,
|
|
1432
|
-
onPress: () => {
|
|
1433
|
-
setShowAIOptions(false);
|
|
1434
|
-
item?.onPress?.(user);
|
|
1435
|
-
},
|
|
1436
|
-
};
|
|
1437
|
-
return {
|
|
1438
|
-
...item,
|
|
1439
|
-
onPress: () => {},
|
|
1440
|
-
};
|
|
1441
|
-
});
|
|
1442
|
-
return newAiOptions;
|
|
1443
|
-
};
|
|
1228
|
+
}, [
|
|
1229
|
+
user,
|
|
1230
|
+
group,
|
|
1231
|
+
id,
|
|
1232
|
+
parentMessageId,
|
|
1233
|
+
hideCameraOption,
|
|
1234
|
+
hideImageAttachmentOption,
|
|
1235
|
+
hideVideoAttachmentOption,
|
|
1236
|
+
hideAudioAttachmentOption,
|
|
1237
|
+
hideFileAttachmentOption,
|
|
1238
|
+
hidePollsAttachmentOption,
|
|
1239
|
+
hideCollaborativeDocumentOption,
|
|
1240
|
+
hideCollaborativeWhiteboardOption,
|
|
1241
|
+
addAttachmentOptions,
|
|
1242
|
+
]);
|
|
1444
1243
|
|
|
1445
1244
|
useEffect(() => {
|
|
1446
1245
|
CometChatUIEventHandler.addMessageListener(editMessageListenerID, {
|
|
@@ -1449,9 +1248,9 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1449
1248
|
CometChatUIEventHandler.addUIListener(UiEventListenerID, {
|
|
1450
1249
|
ccToggleBottomSheet: (item) => {
|
|
1451
1250
|
if (item?.bots) {
|
|
1452
|
-
let newAiOptions
|
|
1453
|
-
setAIOptionItems(newAiOptions);
|
|
1454
|
-
setShowAIOptions(true);
|
|
1251
|
+
// let newAiOptions = _getAIOptions(item.bots);
|
|
1252
|
+
// setAIOptionItems(newAiOptions);
|
|
1253
|
+
// setShowAIOptions(true);
|
|
1455
1254
|
return;
|
|
1456
1255
|
} else if (item?.botView) {
|
|
1457
1256
|
setCustomView(() => item.child);
|
|
@@ -1465,14 +1264,14 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1465
1264
|
bottomSheetRef.current?.togglePanel();
|
|
1466
1265
|
|
|
1467
1266
|
inputValueRef.current = text?.text;
|
|
1468
|
-
plainTextInput.current = text?.text;
|
|
1469
1267
|
setInputMessage(text?.text);
|
|
1470
1268
|
},
|
|
1471
|
-
ccSuggestionData(item: {
|
|
1472
|
-
id
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1269
|
+
ccSuggestionData(item: { id: string | number; data: Array<SuggestionItem> }) {
|
|
1270
|
+
if (activeCharacter.current && id === item?.id) {
|
|
1271
|
+
const warningView = getMentionLimitView();
|
|
1272
|
+
if (warningView) {
|
|
1273
|
+
return;
|
|
1274
|
+
}
|
|
1476
1275
|
setMentionsSearchData(item?.data);
|
|
1477
1276
|
setSuggestionListLoader(false);
|
|
1478
1277
|
}
|
|
@@ -1486,15 +1285,12 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1486
1285
|
|
|
1487
1286
|
const handlePannel = (item: any) => {
|
|
1488
1287
|
if (item.child) {
|
|
1489
|
-
if (item.alignment === ViewAlignment.composerTop)
|
|
1490
|
-
setCustomViewHeader(() => item.child);
|
|
1288
|
+
if (item.alignment === ViewAlignment.composerTop) setCustomViewHeader(() => item.child);
|
|
1491
1289
|
else if (item.alignment === ViewAlignment.composerBottom)
|
|
1492
1290
|
setCustomViewFooter(() => item.child);
|
|
1493
1291
|
} else {
|
|
1494
|
-
if (item.alignment === ViewAlignment.composerTop)
|
|
1495
|
-
|
|
1496
|
-
else if (item.alignment === ViewAlignment.composerBottom)
|
|
1497
|
-
setCustomViewFooter(null);
|
|
1292
|
+
if (item.alignment === ViewAlignment.composerTop) setCustomViewHeader(null);
|
|
1293
|
+
else if (item.alignment === ViewAlignment.composerBottom) setCustomViewFooter(undefined);
|
|
1498
1294
|
}
|
|
1499
1295
|
};
|
|
1500
1296
|
|
|
@@ -1513,26 +1309,18 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1513
1309
|
|
|
1514
1310
|
const _sendRecordedAudio = (recordedFile: String) => {
|
|
1515
1311
|
let fileObj = {
|
|
1516
|
-
name:
|
|
1517
|
-
type:
|
|
1312
|
+
name: "audio-recording" + recordedFile.split("/audio-recording")[1],
|
|
1313
|
+
type: "audio/mp4",
|
|
1518
1314
|
uri: recordedFile,
|
|
1519
1315
|
};
|
|
1520
|
-
console.log(
|
|
1521
|
-
sendMediaMessage(
|
|
1522
|
-
|
|
1523
|
-
fileObj,
|
|
1524
|
-
MessageTypeConstants.audio,
|
|
1525
|
-
chatWith.current
|
|
1526
|
-
);
|
|
1527
|
-
console.log('Send Audio');
|
|
1316
|
+
console.log("fileObj", fileObj);
|
|
1317
|
+
sendMediaMessage(chatWithId.current, fileObj, MessageTypeConstants.audio, chatWith.current);
|
|
1318
|
+
console.log("Send Audio");
|
|
1528
1319
|
};
|
|
1529
1320
|
|
|
1530
|
-
function isCursorWithinMentionRange(
|
|
1531
|
-
mentionRanges: any,
|
|
1532
|
-
cursorPosition: number
|
|
1533
|
-
) {
|
|
1321
|
+
function isCursorWithinMentionRange(mentionRanges: any, cursorPosition: number) {
|
|
1534
1322
|
for (let [range, mention] of mentionRanges) {
|
|
1535
|
-
const [start, end] = range.split(
|
|
1323
|
+
const [start, end] = range.split("_").map(Number);
|
|
1536
1324
|
if (cursorPosition >= start && cursorPosition <= end) {
|
|
1537
1325
|
return true; // Cursor is within the range of a mention
|
|
1538
1326
|
}
|
|
@@ -1550,15 +1338,11 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1550
1338
|
) {
|
|
1551
1339
|
return (
|
|
1552
1340
|
selection.start === selection.end &&
|
|
1553
|
-
!isCursorWithinMentionRange(
|
|
1554
|
-
mentionMap.current,
|
|
1555
|
-
selection.start - searchString.length
|
|
1556
|
-
) &&
|
|
1341
|
+
!isCursorWithinMentionRange(mentionMap.current, selection.start - searchString.length) &&
|
|
1557
1342
|
trackingCharacters.current.includes(tracker) &&
|
|
1558
|
-
(searchString ===
|
|
1343
|
+
(searchString === ""
|
|
1559
1344
|
? (plainTextInput.current[selection.start - 2]?.length === 1 &&
|
|
1560
|
-
plainTextInput.current[selection.start - 2]?.trim()?.length ===
|
|
1561
|
-
0) ||
|
|
1345
|
+
plainTextInput.current[selection.start - 2]?.trim()?.length === 0) ||
|
|
1562
1346
|
plainTextInput.current[selection.start - 2] === undefined
|
|
1563
1347
|
: true) &&
|
|
1564
1348
|
(plainTextInput.current[selection.start - 1]?.length === 1 &&
|
|
@@ -1568,14 +1352,11 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1568
1352
|
);
|
|
1569
1353
|
}
|
|
1570
1354
|
|
|
1571
|
-
let timeoutId:
|
|
1355
|
+
let timeoutId: NodeJS.Timeout;
|
|
1572
1356
|
const openList = (selection: { start: number; end: number }) => {
|
|
1573
1357
|
clearTimeout(timeoutId);
|
|
1574
1358
|
timeoutId = setTimeout(() => {
|
|
1575
|
-
let searchString = extractTextFromCursor(
|
|
1576
|
-
plainTextInput.current,
|
|
1577
|
-
selection.start
|
|
1578
|
-
);
|
|
1359
|
+
let searchString = extractTextFromCursor(plainTextInput.current, selection.start);
|
|
1579
1360
|
let tracker = searchString
|
|
1580
1361
|
? plainTextInput.current[selection.start - (searchString.length + 1)]
|
|
1581
1362
|
: plainTextInput.current[selection.start - 1];
|
|
@@ -1589,21 +1370,17 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1589
1370
|
if (formatter instanceof CometChatMentionsFormatter) {
|
|
1590
1371
|
let shouldShowMentionList =
|
|
1591
1372
|
formatter.getVisibleIn() === MentionsVisibility.both ||
|
|
1592
|
-
(formatter.getVisibleIn() ===
|
|
1593
|
-
|
|
1594
|
-
user) ||
|
|
1595
|
-
(formatter.getVisibleIn() ===
|
|
1596
|
-
MentionsVisibility.groupsConversationOnly &&
|
|
1597
|
-
group);
|
|
1373
|
+
(formatter.getVisibleIn() === MentionsVisibility.usersConversationOnly && user) ||
|
|
1374
|
+
(formatter.getVisibleIn() === MentionsVisibility.groupsConversationOnly && group);
|
|
1598
1375
|
if (shouldShowMentionList) {
|
|
1599
|
-
formatter
|
|
1376
|
+
formatter?.search(searchString);
|
|
1600
1377
|
}
|
|
1601
1378
|
} else {
|
|
1602
1379
|
formatter?.search(searchString);
|
|
1603
1380
|
}
|
|
1604
1381
|
} else {
|
|
1605
|
-
activeCharacter.current =
|
|
1606
|
-
searchStringRef.current =
|
|
1382
|
+
activeCharacter.current = "";
|
|
1383
|
+
searchStringRef.current = "";
|
|
1607
1384
|
setShowMentionList(false);
|
|
1608
1385
|
setMentionsSearchData([]);
|
|
1609
1386
|
}
|
|
@@ -1618,7 +1395,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1618
1395
|
|
|
1619
1396
|
// Iterate over the array in reverse order
|
|
1620
1397
|
entries.forEach(([key, value]) => {
|
|
1621
|
-
let [start, end] = key.split(
|
|
1398
|
+
let [start, end] = key.split("_").map(Number);
|
|
1622
1399
|
|
|
1623
1400
|
let pre = uidInput.substring(0, start);
|
|
1624
1401
|
let post = uidInput.substring(end);
|
|
@@ -1655,24 +1432,21 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1655
1432
|
};
|
|
1656
1433
|
|
|
1657
1434
|
const textChangeHandler = (txt: string) => {
|
|
1658
|
-
let removing = plainTextInput.current
|
|
1659
|
-
let adding = plainTextInput.current
|
|
1660
|
-
let textDiff = txt.length - plainTextInput.current
|
|
1435
|
+
let removing = plainTextInput.current?.length ?? 0 > txt.length;
|
|
1436
|
+
let adding = plainTextInput.current?.length < txt.length;
|
|
1437
|
+
let textDiff = txt.length - (plainTextInput.current?.length ?? 0);
|
|
1661
1438
|
let notAtLast = selectionPosition.start + textDiff < txt.length;
|
|
1662
1439
|
|
|
1663
1440
|
plainTextInput.current = txt;
|
|
1664
|
-
|
|
1441
|
+
onTextChange && onTextChange(txt);
|
|
1665
1442
|
startTyping();
|
|
1666
1443
|
|
|
1667
1444
|
let decr = 0;
|
|
1668
1445
|
|
|
1669
|
-
let newMentionMap = new Map(mentionMap.current);
|
|
1446
|
+
let newMentionMap: any = new Map(mentionMap.current);
|
|
1670
1447
|
|
|
1671
1448
|
mentionMap.current.forEach((value, key) => {
|
|
1672
|
-
let position = {
|
|
1673
|
-
start: parseInt(key.split('_')[0]),
|
|
1674
|
-
end: parseInt(key.split('_')[1]),
|
|
1675
|
-
};
|
|
1449
|
+
let position = { start: parseInt(key.split("_")[0]), end: parseInt(key.split("_")[1]) };
|
|
1676
1450
|
|
|
1677
1451
|
//Runs when cursor before the mention and before the last position
|
|
1678
1452
|
|
|
@@ -1683,16 +1457,10 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1683
1457
|
) {
|
|
1684
1458
|
if (removing) {
|
|
1685
1459
|
decr = selectionPosition.end - selectionPosition.start - textDiff;
|
|
1686
|
-
position = {
|
|
1687
|
-
start: position.start - decr,
|
|
1688
|
-
end: position.end - decr,
|
|
1689
|
-
};
|
|
1460
|
+
position = { start: position.start - decr, end: position.end - decr };
|
|
1690
1461
|
} else if (adding) {
|
|
1691
1462
|
decr = selectionPosition.end - selectionPosition.start + textDiff;
|
|
1692
|
-
position = {
|
|
1693
|
-
start: position.start + decr,
|
|
1694
|
-
end: position.end + decr,
|
|
1695
|
-
};
|
|
1463
|
+
position = { start: position.start + decr, end: position.end + decr };
|
|
1696
1464
|
}
|
|
1697
1465
|
if (removing || adding) {
|
|
1698
1466
|
let newKey = `${position.start}_${position.end}`;
|
|
@@ -1702,28 +1470,28 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1702
1470
|
}
|
|
1703
1471
|
|
|
1704
1472
|
// Code to delete mention from hashmap 👇
|
|
1705
|
-
let expctedMentionPos = plainTextInput.current
|
|
1706
|
-
position.start,
|
|
1707
|
-
position.end
|
|
1708
|
-
);
|
|
1473
|
+
let expctedMentionPos = plainTextInput.current?.substring(position.start, position.end);
|
|
1709
1474
|
|
|
1710
1475
|
if (expctedMentionPos !== `${value.promptText}`) {
|
|
1711
1476
|
let newKey = `${position.start}_${position.end}`;
|
|
1712
1477
|
newMentionMap.delete(newKey);
|
|
1713
1478
|
|
|
1714
1479
|
if (!ifIdExists(value.id, newMentionMap)) {
|
|
1715
|
-
let targetedFormatter
|
|
1716
|
-
|
|
1717
|
-
);
|
|
1480
|
+
let targetedFormatter = allFormatters.current.get(value.trackingCharacter!);
|
|
1481
|
+
if (!targetedFormatter) return;
|
|
1718
1482
|
let existingCCUsers = [...targetedFormatter.getSuggestionItems()];
|
|
1719
1483
|
let userPosition = existingCCUsers.findIndex(
|
|
1720
1484
|
(item: SuggestionItem) => item.id === value.id
|
|
1721
1485
|
);
|
|
1722
1486
|
if (userPosition !== -1) {
|
|
1723
1487
|
existingCCUsers.splice(userPosition, 1);
|
|
1724
|
-
(
|
|
1725
|
-
|
|
1726
|
-
|
|
1488
|
+
(targetedFormatter as CometChatMentionsFormatter).setSuggestionItems(existingCCUsers);
|
|
1489
|
+
}
|
|
1490
|
+
if (targetedFormatter instanceof CometChatMentionsFormatter) {
|
|
1491
|
+
let showWarning = getMentionLimitView(targetedFormatter);
|
|
1492
|
+
if (!showWarning) {
|
|
1493
|
+
setWarningMessage("");
|
|
1494
|
+
}
|
|
1727
1495
|
}
|
|
1728
1496
|
}
|
|
1729
1497
|
}
|
|
@@ -1738,23 +1506,21 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1738
1506
|
setShowMentionList(false);
|
|
1739
1507
|
setMentionsSearchData([]);
|
|
1740
1508
|
|
|
1741
|
-
let notAtLast = selectionPosition.start < plainTextInput.current
|
|
1509
|
+
let notAtLast = selectionPosition.start < (plainTextInput.current?.length ?? 0);
|
|
1742
1510
|
|
|
1743
1511
|
let textDiff =
|
|
1744
|
-
plainTextInput.current
|
|
1745
|
-
item.promptText
|
|
1512
|
+
(plainTextInput.current?.length ?? 0) +
|
|
1513
|
+
(item.promptText?.length ?? 0) -
|
|
1746
1514
|
searchStringRef.current.length -
|
|
1747
|
-
plainTextInput.current
|
|
1515
|
+
(plainTextInput.current?.length ?? 0);
|
|
1748
1516
|
|
|
1749
1517
|
let incr = 0;
|
|
1750
1518
|
let mentionPos = 0;
|
|
1751
1519
|
|
|
1752
1520
|
let newMentionMap = new Map(mentionMap.current);
|
|
1753
1521
|
|
|
1754
|
-
let targetedFormatter
|
|
1755
|
-
|
|
1756
|
-
);
|
|
1757
|
-
|
|
1522
|
+
let targetedFormatter = allFormatters.current.get(activeCharacter.current);
|
|
1523
|
+
if (!targetedFormatter) return;
|
|
1758
1524
|
let existingCCUsers = [...targetedFormatter.getSuggestionItems()];
|
|
1759
1525
|
let userAlreadyExists = existingCCUsers.find(
|
|
1760
1526
|
(existingUser: SuggestionItem) => existingUser.id === item.id
|
|
@@ -1762,15 +1528,10 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1762
1528
|
if (!userAlreadyExists) {
|
|
1763
1529
|
let cometchatUIUserArray: Array<SuggestionItem> = [...existingCCUsers];
|
|
1764
1530
|
cometchatUIUserArray.push(item);
|
|
1765
|
-
(targetedFormatter as CometChatMentionsFormatter).setSuggestionItems(
|
|
1766
|
-
cometchatUIUserArray
|
|
1767
|
-
);
|
|
1531
|
+
(targetedFormatter as CometChatMentionsFormatter).setSuggestionItems(cometchatUIUserArray);
|
|
1768
1532
|
}
|
|
1769
1533
|
mentionMap.current.forEach((value, key) => {
|
|
1770
|
-
let position = {
|
|
1771
|
-
start: parseInt(key.split('_')[0]),
|
|
1772
|
-
end: parseInt(key.split('_')[1]),
|
|
1773
|
-
};
|
|
1534
|
+
let position = { start: parseInt(key.split("_")[0]), end: parseInt(key.split("_")[1]) };
|
|
1774
1535
|
|
|
1775
1536
|
if (!(selectionPosition.start <= position.start)) {
|
|
1776
1537
|
mentionPos += 1;
|
|
@@ -1779,8 +1540,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1779
1540
|
// Code to delete mention from hashmap 👇
|
|
1780
1541
|
if (
|
|
1781
1542
|
position.end === selectionPosition.end ||
|
|
1782
|
-
(selectionPosition.start > position.start &&
|
|
1783
|
-
selectionPosition.end <= position.end)
|
|
1543
|
+
(selectionPosition.start > position.start && selectionPosition.end <= position.end)
|
|
1784
1544
|
) {
|
|
1785
1545
|
let newKey = `${position.start}_${position.end}`;
|
|
1786
1546
|
newMentionMap.delete(newKey);
|
|
@@ -1797,36 +1557,45 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1797
1557
|
mentionMap.current = newMentionMap;
|
|
1798
1558
|
|
|
1799
1559
|
// When updating the input text, just get the latest plain text input and replace the selected text with the new mention
|
|
1800
|
-
const updatedPlainTextInput = `${plainTextInput.current
|
|
1560
|
+
const updatedPlainTextInput = `${plainTextInput.current?.substring(
|
|
1801
1561
|
0,
|
|
1802
1562
|
selectionPosition.start - (1 + searchStringRef.current.length)
|
|
1803
|
-
)}${item.promptText +
|
|
1563
|
+
)}${item.promptText + " "}${plainTextInput.current?.substring(
|
|
1804
1564
|
selectionPosition.end,
|
|
1805
|
-
plainTextInput.current
|
|
1565
|
+
plainTextInput.current?.length
|
|
1806
1566
|
)}`;
|
|
1807
1567
|
plainTextInput.current = updatedPlainTextInput;
|
|
1808
1568
|
|
|
1809
1569
|
let key =
|
|
1810
1570
|
selectionPosition.start -
|
|
1811
1571
|
(1 + searchStringRef.current.length) +
|
|
1812
|
-
|
|
1572
|
+
"_" +
|
|
1813
1573
|
(selectionPosition.start -
|
|
1814
1574
|
(searchStringRef.current.length + 1) +
|
|
1815
|
-
item.promptText
|
|
1575
|
+
(item.promptText?.length ?? 0));
|
|
1816
1576
|
|
|
1817
1577
|
let updatedMap = insertMentionAt(mentionMap.current, mentionPos, key, {
|
|
1818
1578
|
...item,
|
|
1819
1579
|
trackingCharacter: activeCharacter.current,
|
|
1820
1580
|
});
|
|
1821
1581
|
mentionMap.current = updatedMap;
|
|
1822
|
-
|
|
1582
|
+
setSelectionPosition({
|
|
1583
|
+
start:
|
|
1584
|
+
selectionPosition.start -
|
|
1585
|
+
(searchStringRef.current.length + 1) +
|
|
1586
|
+
(item.promptText?.length ?? 0),
|
|
1587
|
+
end:
|
|
1588
|
+
selectionPosition.start -
|
|
1589
|
+
(searchStringRef.current.length + 1) +
|
|
1590
|
+
(item.promptText?.length ?? 0),
|
|
1591
|
+
});
|
|
1823
1592
|
setFormattedInputMessage();
|
|
1824
1593
|
};
|
|
1825
1594
|
|
|
1826
1595
|
const setFormattedInputMessage = () => {
|
|
1827
1596
|
let textComponents: any = getRegexString(plainTextInput.current);
|
|
1828
1597
|
|
|
1829
|
-
allFormatters.current.forEach((formatter, key) => {
|
|
1598
|
+
allFormatters.current.forEach((formatter: CometChatTextFormatter, key) => {
|
|
1830
1599
|
let resp = formatter.getFormattedText(textComponents);
|
|
1831
1600
|
textComponents = resp;
|
|
1832
1601
|
});
|
|
@@ -1836,16 +1605,14 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1836
1605
|
};
|
|
1837
1606
|
|
|
1838
1607
|
function escapeRegExp(string: string) {
|
|
1839
|
-
return string.replace(/[.*+?^${}()|[\]\\]/g,
|
|
1608
|
+
return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1840
1609
|
}
|
|
1841
1610
|
|
|
1842
1611
|
function extractTextFromCursor(inputText: string, cursorPosition: number) {
|
|
1843
1612
|
const leftText = inputText.substring(0, cursorPosition);
|
|
1844
1613
|
|
|
1845
1614
|
// Escape the mentionPrefixes to safely use them in a regex pattern
|
|
1846
|
-
const escapedPrefixes = trackingCharacters.current
|
|
1847
|
-
.map(escapeRegExp)
|
|
1848
|
-
.join('|');
|
|
1615
|
+
const escapedPrefixes = trackingCharacters.current.map(escapeRegExp).join("|");
|
|
1849
1616
|
|
|
1850
1617
|
// Build a dynamic regex pattern that matches any of the mention prefixes.
|
|
1851
1618
|
// This pattern will match a prefix followed by any combination of word characters
|
|
@@ -1856,12 +1623,12 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1856
1623
|
const match = leftText.match(mentionRegex);
|
|
1857
1624
|
|
|
1858
1625
|
// If a match is found, return the first capturing group, which is the username
|
|
1859
|
-
return (match && substringUpToNthSpace(match[2], 4)) ||
|
|
1626
|
+
return (match && substringUpToNthSpace(match[2], 4)) || "";
|
|
1860
1627
|
}
|
|
1861
1628
|
|
|
1862
1629
|
function substringUpToNthSpace(str: string, n: number) {
|
|
1863
1630
|
// Split the string by spaces, slice to the (n-1) elements, and then rejoin with spaces
|
|
1864
|
-
return str.split(
|
|
1631
|
+
return str.split(" ", n).join(" ");
|
|
1865
1632
|
}
|
|
1866
1633
|
|
|
1867
1634
|
const insertMentionAt = (
|
|
@@ -1893,18 +1660,18 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1893
1660
|
};
|
|
1894
1661
|
|
|
1895
1662
|
const onSuggestionListEndReached = () => {
|
|
1896
|
-
let targetedFormatter = allFormatters.current.get(
|
|
1897
|
-
activeCharacter.current
|
|
1898
|
-
);
|
|
1663
|
+
let targetedFormatter = allFormatters.current.get(activeCharacter.current);
|
|
1899
1664
|
if (!targetedFormatter) return;
|
|
1900
1665
|
let fetchingNext = targetedFormatter.fetchNext();
|
|
1901
1666
|
fetchingNext !== null && setSuggestionListLoader(true);
|
|
1902
1667
|
};
|
|
1903
1668
|
|
|
1904
|
-
const getMentionLimitView = () => {
|
|
1905
|
-
let targetedFormatter
|
|
1906
|
-
activeCharacter.current
|
|
1907
|
-
)
|
|
1669
|
+
const getMentionLimitView = (targettedFormatterParam?: CometChatMentionsFormatter) => {
|
|
1670
|
+
let targetedFormatter =
|
|
1671
|
+
allFormatters.current.get(activeCharacter.current) ?? targettedFormatterParam;
|
|
1672
|
+
if (!(targetedFormatter instanceof CometChatMentionsFormatter)) {
|
|
1673
|
+
return;
|
|
1674
|
+
}
|
|
1908
1675
|
let shouldWarn;
|
|
1909
1676
|
let limit;
|
|
1910
1677
|
if (targetedFormatter?.getLimit && targetedFormatter?.getLimit()) {
|
|
@@ -1916,128 +1683,58 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1916
1683
|
shouldWarn = true;
|
|
1917
1684
|
}
|
|
1918
1685
|
}
|
|
1919
|
-
if (!shouldWarn)
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
alignItems: 'center',
|
|
1930
|
-
paddingTop: 5,
|
|
1931
|
-
paddingLeft: 5,
|
|
1932
|
-
borderTopWidth: 1,
|
|
1933
|
-
borderTopColor: theme.palette.getAccent300(),
|
|
1934
|
-
}}
|
|
1935
|
-
>
|
|
1936
|
-
<Image
|
|
1937
|
-
style={{
|
|
1938
|
-
tintColor: theme.palette.getAccent500(),
|
|
1939
|
-
height: 20,
|
|
1940
|
-
width: 20,
|
|
1941
|
-
}}
|
|
1942
|
-
source={ICONS.INFO}
|
|
1943
|
-
/>
|
|
1944
|
-
<Text
|
|
1945
|
-
style={
|
|
1946
|
-
{
|
|
1947
|
-
marginLeft: 5,
|
|
1948
|
-
color: theme.palette.getAccent500(),
|
|
1949
|
-
...theme.typography.text1,
|
|
1950
|
-
} as TextStyle
|
|
1951
|
-
}
|
|
1952
|
-
>
|
|
1953
|
-
{errorString}
|
|
1954
|
-
</Text>
|
|
1955
|
-
</View>
|
|
1686
|
+
if (!shouldWarn) {
|
|
1687
|
+
setWarningMessage("");
|
|
1688
|
+
return false;
|
|
1689
|
+
}
|
|
1690
|
+
setWarningMessage(
|
|
1691
|
+
targetedFormatter?.getErrorString
|
|
1692
|
+
? targetedFormatter?.getErrorString()
|
|
1693
|
+
: `${localize("MENTION_UPTO")} ${limit} ${
|
|
1694
|
+
limit === 1 ? localize("TIME") : localize("TIMES")
|
|
1695
|
+
} ${localize("AT_A_TIME")}.`
|
|
1956
1696
|
);
|
|
1697
|
+
return true;
|
|
1957
1698
|
};
|
|
1958
1699
|
|
|
1959
1700
|
return (
|
|
1960
1701
|
<>
|
|
1961
|
-
{!isVisible && typeof CustomView ===
|
|
1702
|
+
{/* {!isVisible && typeof CustomView === "function" && <CustomView />} TODOM */}
|
|
1962
1703
|
<Modal
|
|
1963
|
-
|
|
1704
|
+
transparent={true}
|
|
1705
|
+
// animationType='slide'
|
|
1964
1706
|
visible={isVisible}
|
|
1965
1707
|
onRequestClose={() => {
|
|
1966
1708
|
setIsVisible(false);
|
|
1967
1709
|
}}
|
|
1968
|
-
presentationStyle={'pageSheet'}
|
|
1969
1710
|
>
|
|
1970
1711
|
{CustomView && CustomView}
|
|
1971
1712
|
</Modal>
|
|
1972
1713
|
<KeyboardAvoidingView
|
|
1973
|
-
key={
|
|
1974
|
-
behavior={Platform.OS ===
|
|
1714
|
+
key={id}
|
|
1715
|
+
behavior={Platform.OS === "ios" ? "padding" : "height"}
|
|
1975
1716
|
keyboardVerticalOffset={Platform.select({ ios: kbOffset })}
|
|
1976
1717
|
{...keyboardAvoidingViewProps}
|
|
1977
1718
|
>
|
|
1978
1719
|
<View
|
|
1979
|
-
style={
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1720
|
+
style={[
|
|
1721
|
+
Style.container,
|
|
1722
|
+
{
|
|
1723
|
+
paddingTop: CustomViewHeader ? theme.spacing.padding.p0 : theme.spacing.padding.p2,
|
|
1724
|
+
paddingHorizontal: theme.spacing.padding.p2,
|
|
1725
|
+
},
|
|
1726
|
+
{
|
|
1727
|
+
backgroundColor: theme.messageListStyles.containerStyle.backgroundColor,
|
|
1728
|
+
},
|
|
1729
|
+
mergedComposerStyle.containerStyle as ViewStyle,
|
|
1730
|
+
]}
|
|
1988
1731
|
>
|
|
1989
|
-
<EmojiBoard
|
|
1990
|
-
hideSearch={true}
|
|
1991
|
-
shouldShow={showEmojiboard}
|
|
1992
|
-
onClose={() => setShowEmojiboard(false)}
|
|
1993
|
-
emojiSelection={(emoji: any) => {
|
|
1994
|
-
let pre = plainTextInput.current.substring(
|
|
1995
|
-
0,
|
|
1996
|
-
selectionPosition.start
|
|
1997
|
-
);
|
|
1998
|
-
let post = plainTextInput.current.substring(
|
|
1999
|
-
selectionPosition.end,
|
|
2000
|
-
plainTextInput.current.length
|
|
2001
|
-
);
|
|
2002
|
-
inputValueRef.current =
|
|
2003
|
-
selectionPosition.start && selectionPosition.end
|
|
2004
|
-
? `${pre}${emoji}${post}`
|
|
2005
|
-
: `${inputValueRef.current}${emoji}`;
|
|
2006
|
-
setInputMessage((prev) =>
|
|
2007
|
-
selectionPosition.start && selectionPosition.end
|
|
2008
|
-
? `${pre}${emoji}${post}`
|
|
2009
|
-
: `${prev}${emoji}`
|
|
2010
|
-
);
|
|
2011
|
-
setShowEmojiboard(false);
|
|
2012
|
-
}}
|
|
2013
|
-
/>
|
|
2014
1732
|
<ActionSheetBoard
|
|
2015
1733
|
sheetRef={bottomSheetRef}
|
|
2016
1734
|
options={actionSheetItems}
|
|
2017
1735
|
shouldShow={showActionSheet}
|
|
2018
1736
|
onClose={() => setShowActionSheet(false)}
|
|
2019
|
-
style={
|
|
2020
|
-
// ...getActionSheetStyle(),
|
|
2021
|
-
...(messageComposerStyle?.actionSheetSeparatorTint
|
|
2022
|
-
? {
|
|
2023
|
-
actionSheetSeparatorTint:
|
|
2024
|
-
messageComposerStyle.actionSheetSeparatorTint,
|
|
2025
|
-
}
|
|
2026
|
-
: {}),
|
|
2027
|
-
layoutModeIconTint:
|
|
2028
|
-
messageComposerStyle?.actionSheetLayoutModeIconTint,
|
|
2029
|
-
titleColor: messageComposerStyle?.actionSheetTitleColor,
|
|
2030
|
-
listItemIconTint: messageComposerStyle?.attachIconTint,
|
|
2031
|
-
listItemTitleFont: messageComposerStyle?.actionSheetTitleFont,
|
|
2032
|
-
}}
|
|
2033
|
-
cometChatBottomSheetStyle={
|
|
2034
|
-
messageComposerStyle?.actionSheetCancelButtonIconTint
|
|
2035
|
-
? {
|
|
2036
|
-
lineColor:
|
|
2037
|
-
messageComposerStyle.actionSheetCancelButtonIconTint,
|
|
2038
|
-
}
|
|
2039
|
-
: {}
|
|
2040
|
-
}
|
|
1737
|
+
style={mergedComposerStyle.attachmentOptionsStyles}
|
|
2041
1738
|
/>
|
|
2042
1739
|
<RecordAudio
|
|
2043
1740
|
sheetRef={bottomSheetRef}
|
|
@@ -2046,72 +1743,46 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
2046
1743
|
onClose={() => {
|
|
2047
1744
|
setShowRecordAudio(false);
|
|
2048
1745
|
}}
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
messageComposerStyle?.actionSheetCancelButtonIconTint
|
|
2052
|
-
? {
|
|
2053
|
-
lineColor:
|
|
2054
|
-
messageComposerStyle.actionSheetCancelButtonIconTint,
|
|
2055
|
-
}
|
|
2056
|
-
: {}
|
|
2057
|
-
}
|
|
2058
|
-
mediaRecorderStyle={mediaRecorderStyle}
|
|
2059
|
-
pauseIconUrl={pauseIconUrl}
|
|
2060
|
-
playIconUrl={playIconUrl}
|
|
2061
|
-
recordIconUrl={recordIconUrl}
|
|
2062
|
-
deleteIconUrl={deleteIconUrl}
|
|
2063
|
-
stopIconUrl={stopIconUrl}
|
|
2064
|
-
submitIconUrl={submitIconUrl}
|
|
2065
|
-
/>
|
|
2066
|
-
<AIOptions
|
|
2067
|
-
sheetRef={bottomSheetRef}
|
|
2068
|
-
shouldShow={showAIOptions}
|
|
2069
|
-
onClose={() => {
|
|
2070
|
-
setShowAIOptions(false);
|
|
1746
|
+
cometChatBottomSheetStyle={{
|
|
1747
|
+
maxHeight: Dimensions.get("window").height * 0.4,
|
|
2071
1748
|
}}
|
|
2072
|
-
|
|
2073
|
-
|
|
1749
|
+
onSend={_sendRecordedAudio}
|
|
1750
|
+
mediaRecorderStyle={mergedComposerStyle.mediaRecorderStyle}
|
|
2074
1751
|
/>
|
|
2075
1752
|
|
|
2076
|
-
{mentionsSearchData.length > 0 &&
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
}
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
data={mentionsSearchData}
|
|
2092
|
-
avatarStyle={{
|
|
2093
|
-
height: 33,
|
|
2094
|
-
width: 33,
|
|
2095
|
-
}}
|
|
2096
|
-
listItemStyle={{
|
|
2097
|
-
height: 50,
|
|
2098
|
-
}}
|
|
2099
|
-
separatorColor={theme.palette.getAccent100()}
|
|
2100
|
-
onPress={onMentionPress}
|
|
2101
|
-
onEndReached={onSuggestionListEndReached}
|
|
2102
|
-
loading={suggestionListLoader}
|
|
2103
|
-
theme={theme}
|
|
2104
|
-
/>
|
|
2105
|
-
{getMentionLimitView()}
|
|
2106
|
-
</View>
|
|
2107
|
-
)}
|
|
2108
|
-
|
|
2109
|
-
{HeaderView ? (
|
|
2110
|
-
<HeaderView />
|
|
2111
|
-
) : (
|
|
2112
|
-
CustomViewHeader && <CustomViewHeader />
|
|
1753
|
+
{mentionsSearchData.length > 0 && (plainTextInput.current?.length ?? 0) > 0 && (
|
|
1754
|
+
<View
|
|
1755
|
+
style={[
|
|
1756
|
+
theme.mentionsListStyle.containerStyle,
|
|
1757
|
+
messagePreview ? { maxHeight: Dimensions.get("window").height * 0.2 } : {},
|
|
1758
|
+
]}
|
|
1759
|
+
>
|
|
1760
|
+
<CometChatSuggestionList
|
|
1761
|
+
data={mentionsSearchData}
|
|
1762
|
+
listStyle={theme.mentionsListStyle}
|
|
1763
|
+
onPress={onMentionPress}
|
|
1764
|
+
onEndReached={onSuggestionListEndReached}
|
|
1765
|
+
loading={suggestionListLoader}
|
|
1766
|
+
/>
|
|
1767
|
+
</View>
|
|
2113
1768
|
)}
|
|
2114
|
-
|
|
1769
|
+
|
|
1770
|
+
<View
|
|
1771
|
+
style={[
|
|
1772
|
+
{ flexDirection: "column" },
|
|
1773
|
+
mentionsSearchData.length
|
|
1774
|
+
? { maxHeight: Dimensions.get("window").height * 0.2 }
|
|
1775
|
+
: { maxHeight: Dimensions.get("window").height * 0.3 },
|
|
1776
|
+
]}
|
|
1777
|
+
>
|
|
1778
|
+
{HeaderView
|
|
1779
|
+
? HeaderView({ user, group })
|
|
1780
|
+
: CustomViewHeader &&
|
|
1781
|
+
(typeof CustomViewHeader === "function" ? (
|
|
1782
|
+
<CustomViewHeader /> // Invoke CustomViewHeader if it's a functional component
|
|
1783
|
+
) : (
|
|
1784
|
+
CustomViewHeader // Render it directly if it's a React node
|
|
1785
|
+
))}
|
|
2115
1786
|
<MessagePreviewTray
|
|
2116
1787
|
onClose={() => setMessagePreview(null)}
|
|
2117
1788
|
text={messagePreview?.message?.text}
|
|
@@ -2121,26 +1792,27 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
2121
1792
|
<CometChatMessageInput
|
|
2122
1793
|
messageInputRef={messageInputRef}
|
|
2123
1794
|
text={inputMessage as string}
|
|
2124
|
-
placeHolderText={
|
|
2125
|
-
style={
|
|
1795
|
+
placeHolderText={localize("ENTER_YOUR_MESSAGE_HERE")}
|
|
1796
|
+
style={mergedComposerStyle.messageInputStyles}
|
|
2126
1797
|
onSelectionChange={({ nativeEvent: { selection } }) => {
|
|
2127
1798
|
setSelectionPosition(selection);
|
|
2128
1799
|
openList(selection);
|
|
2129
1800
|
}}
|
|
2130
|
-
maxHeight={maxHeight ?? undefined}
|
|
2131
1801
|
onChangeText={textChangeHandler}
|
|
1802
|
+
VoiceRecordingButtonView={voiceRecoringButtonElem}
|
|
2132
1803
|
SecondaryButtonView={SecondaryButtonViewElem}
|
|
2133
|
-
AuxiliaryButtonView={AuxiliaryButtonViewElem}
|
|
2134
|
-
PrimaryButtonView={
|
|
2135
|
-
auxiliaryButtonAlignment={
|
|
2136
|
-
auxiliaryButtonsAlignment ? auxiliaryButtonsAlignment : 'right'
|
|
2137
|
-
}
|
|
1804
|
+
AuxiliaryButtonView={AuxiliaryButtonViewElem()}
|
|
1805
|
+
PrimaryButtonView={SendButtonViewElem}
|
|
1806
|
+
auxiliaryButtonAlignment={auxiliaryButtonsAlignment}
|
|
2138
1807
|
/>
|
|
2139
|
-
{
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
1808
|
+
{CustomViewFooter ? (
|
|
1809
|
+
// If CustomViewFooter is a function component (React.FC)
|
|
1810
|
+
typeof CustomViewFooter === "function" ? (
|
|
1811
|
+
<CustomViewFooter /> // Invoke the function component
|
|
1812
|
+
) : (
|
|
1813
|
+
CustomViewFooter // Render it directly if it's a React node (JSX or element)
|
|
1814
|
+
)
|
|
1815
|
+
) : null}
|
|
2144
1816
|
</View>
|
|
2145
1817
|
</KeyboardAvoidingView>
|
|
2146
1818
|
</>
|