@cometchat/chat-uikit-react-native 5.6.0 → 5.7.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/android/src/main/java/com/reactnativecometchatuikit/CometChatKeyboardModule.kt +101 -0
- package/android/src/main/java/com/reactnativecometchatuikit/CometchatUiKitPackage.java +1 -0
- package/android/src/main/java/com/reactnativecometchatuikit/KeyboardDirectionWatcher.kt +64 -0
- package/android/src/main/java/com/reactnativecometchatuikit/KeyboardLanguageDirection.kt +44 -0
- package/android/src/main/java/com/reactnativecometchatuikit/RichTextEditorView.kt +287 -49
- package/ios/CometChatKeyboardModule.m +9 -0
- package/ios/CometChatKeyboardModule.swift +71 -0
- package/ios/KeyboardLanguageDirection.swift +24 -0
- package/ios/RichTextEditorView.swift +253 -51
- package/ios/RichTextEditorViewManager.m +1 -0
- package/package.json +1 -1
- package/src/CometChatAIAssistantChatHistory/CometChatAIAssistantChatHistory.tsx +41 -57
- package/src/CometChatAIAssistantChatHistory/Skeleton.tsx +4 -1
- package/src/CometChatAIAssistantChatHistory/style.ts +5 -2
- package/src/CometChatCompactMessageComposer/CometChatCompactMessageComposer.tsx +21 -8
- package/src/CometChatCompactMessageComposer/styles.ts +7 -7
- package/src/CometChatConversations/CometChatConversations.tsx +36 -30
- package/src/CometChatConversations/Skeleton.tsx +4 -1
- package/src/CometChatConversations/style.ts +1 -1
- package/src/CometChatGroupMembers/CometChatGroupMembers.tsx +35 -18
- package/src/CometChatGroupMembers/Skeleton.tsx +4 -1
- package/src/CometChatGroupMembers/style.ts +6 -4
- package/src/CometChatGroups/CometChatGroups.tsx +13 -6
- package/src/CometChatGroups/GroupsStyle.ts +1 -1
- package/src/CometChatGroups/Skeleton.tsx +4 -1
- package/src/CometChatMessageComposer/CometChatMessageComposer.tsx +44 -30
- package/src/CometChatMessageComposer/styles.tsx +1 -1
- package/src/CometChatMessageHeader/CometChatMessageHeader.tsx +22 -13
- package/src/CometChatMessageInformation/CometChatMessageInformation.tsx +8 -1
- package/src/CometChatMessageInformation/Skeleton.tsx +4 -1
- package/src/CometChatMessageList/CometChatMessageList.tsx +97 -128
- package/src/CometChatMessageList/SwipeToReplyView.tsx +61 -0
- package/src/CometChatMessageList/style.ts +32 -32
- package/src/CometChatMessageList/swipeToReply.ts +25 -0
- package/src/CometChatNotificationFeed/CometChatNotificationFeed.tsx +10 -3
- package/src/CometChatNotificationFeed/style.ts +1 -1
- package/src/CometChatNotificationFeed/utils.ts +17 -18
- package/src/CometChatPinnedMessages/CometChatPinnedMessages.tsx +8 -1
- package/src/CometChatPinnedMessages/style.ts +5 -5
- package/src/CometChatRichTextEditor/RichTextEditorViewNativeComponent.ts +2 -0
- package/src/CometChatRichTextEditor/index.tsx +3 -0
- package/src/CometChatSavedMessages/CometChatSavedMessages.tsx +14 -11
- package/src/CometChatSavedMessages/style.ts +3 -3
- package/src/CometChatSearch/CometChatSearch.tsx +38 -35
- package/src/CometChatSearch/Skeleton.tsx +4 -1
- package/src/CometChatSearch/searchLabels.ts +26 -0
- package/src/CometChatSearch/style.ts +7 -7
- package/src/CometChatThreadHeader/CometChatThreadHeader.tsx +11 -7
- package/src/CometChatThreadHeader/Header.tsx +2 -2
- package/src/CometChatUsers/CometChatUsers.tsx +8 -1
- package/src/CometChatUsers/Skeleton.tsx +4 -1
- package/src/CometChatUsers/style.ts +1 -1
- package/src/calls/CometChatCallButtons/CometChatCallButtons.tsx +8 -1
- package/src/calls/CometChatCallLogs/CometChatCallLogs.tsx +16 -4
- package/src/calls/CometChatCallLogs/Skeleton.tsx +4 -1
- package/src/calls/CometChatIncomingCall/CometChatIncomingCall.tsx +11 -3
- package/src/calls/CometChatOutgoingCall/CometChatOutgoingCall.tsx +10 -2
- package/src/extensions/CollaborativeBubble/style.ts +4 -4
- package/src/extensions/CollaborativeDocument/CollaborativeDocumentExtensionDecorator.tsx +1 -1
- package/src/extensions/CollaborativeWhiteboard/CollaborativeWhiteboardExtensionDecorator.tsx +1 -1
- package/src/extensions/LinkPreview/LinkPreviewBubble.tsx +11 -6
- package/src/extensions/LinkPreview/style.ts +6 -6
- package/src/extensions/Polls/Header.tsx +1 -1
- package/src/extensions/Polls/Polls.tsx +25 -12
- package/src/extensions/Polls/PollsBubble.tsx +10 -6
- package/src/extensions/Polls/style.ts +4 -4
- package/src/extensions/Stickers/CometChatStickerKeyboard/CometChatStickerKeyboard.tsx +2 -2
- package/src/extensions/Stickers/CometChatStickerKeyboard/Skeleton.tsx +1 -1
- package/src/extensions/Stickers/CometChatStickerKeyboard/style.ts +1 -1
- package/src/extensions/Stickers/StickersExtensionDecorator.tsx +2 -2
- package/src/index.ts +5 -1
- package/src/shared/CometChatUiKit/CometChatUIKit.ts +17 -0
- package/src/shared/CometChatUiKit/UIKitSettings.ts +8 -0
- package/src/shared/formatters/CometChatMentionsFormatter/CometChatMentionsFormatter.tsx +13 -10
- package/src/shared/formatters/CometChatRichTextFormatter/index.tsx +15 -7
- package/src/shared/formatters/CometChatTextFormatter.ts +11 -0
- package/src/shared/formatters/CometChatUrlsFormatter/index.tsx +7 -4
- package/src/shared/framework/MessageDataSource.tsx +17 -94
- package/src/shared/helper/LocalizedDateHelper.ts +64 -4
- package/src/shared/helper/helperFunctions.ts +71 -4
- package/src/shared/helper/keyboardDirection.ts +54 -0
- package/src/shared/helper/layoutDirection.ts +205 -0
- package/src/shared/helper/pluralRules.ts +67 -0
- package/src/shared/helper/textDirection.ts +118 -0
- package/src/shared/icons/Icon.tsx +37 -2
- package/src/shared/icons/components/format-list-numbered-rtl.tsx +15 -0
- package/src/shared/offline/OfflineViews.tsx +5 -1
- package/src/shared/offline/notices.ts +15 -21
- package/src/shared/resources/CometChatLocalizeNew/CometChatLocalizationHelper.ts +2 -0
- package/src/shared/resources/CometChatLocalizeNew/resources/ar/translation.json +720 -0
- package/src/shared/resources/CometChatLocalizeNew/resources/de/translation.json +50 -2
- package/src/shared/resources/CometChatLocalizeNew/resources/en/translation.json +51 -3
- package/src/shared/resources/CometChatLocalizeNew/resources/es/translation.json +50 -2
- package/src/shared/resources/CometChatLocalizeNew/resources/fr/translation.json +51 -3
- package/src/shared/resources/CometChatLocalizeNew/resources/hi/translation.json +50 -2
- package/src/shared/resources/CometChatLocalizeNew/resources/hu/translation.json +50 -2
- package/src/shared/resources/CometChatLocalizeNew/resources/it/translation.json +50 -2
- package/src/shared/resources/CometChatLocalizeNew/resources/ja/translation.json +50 -2
- package/src/shared/resources/CometChatLocalizeNew/resources/ko/translation.json +50 -2
- package/src/shared/resources/CometChatLocalizeNew/resources/lt/translation.json +58 -2
- package/src/shared/resources/CometChatLocalizeNew/resources/ms/translation.json +50 -2
- package/src/shared/resources/CometChatLocalizeNew/resources/nl/translation.json +50 -2
- package/src/shared/resources/CometChatLocalizeNew/resources/pt/translation.json +50 -2
- package/src/shared/resources/CometChatLocalizeNew/resources/ru/translation.json +66 -2
- package/src/shared/resources/CometChatLocalizeNew/resources/sv/translation.json +50 -2
- package/src/shared/resources/CometChatLocalizeNew/resources/tr/translation.json +50 -2
- package/src/shared/resources/CometChatLocalizeNew/resources/zh/translation.json +50 -2
- package/src/shared/resources/CometChatLocalizeNew/resources/zh-tw/translation.json +50 -2
- package/src/shared/utils/CometChatMessagePreview/CometChatMessagePreview.tsx +13 -12
- package/src/shared/utils/CometChatMessagePreview/style.ts +1 -1
- package/src/shared/utils/MessageUtils.tsx +14 -14
- package/src/shared/utils/PermissionUtil.ts +16 -5
- package/src/shared/utils/attachmentLimits.ts +3 -2
- package/src/shared/utils/conversationUtils.ts +3 -5
- package/src/shared/utils/fileIconFontSize.ts +10 -0
- package/src/shared/utils/fileSizeLabel.ts +16 -0
- package/src/shared/utils/groupActionText.ts +75 -0
- package/src/shared/views/CometChatAIAssistantMessageBubble/CometChatAIAssistantMessageBubble.tsx +12 -8
- package/src/shared/views/CometChatAttachmentPreview/CometChatAttachmentPreview.style.ts +1 -1
- package/src/shared/views/CometChatAttachmentPreview/CometChatAttachmentPreviewItem.tsx +5 -3
- package/src/shared/views/CometChatAttachmentPreview/CometChatAttachmentTile.tsx +22 -17
- package/src/shared/views/CometChatAttachmentViewer/CometChatAttachmentViewer.tsx +13 -9
- package/src/shared/views/CometChatAudioBubble/CometChatAudioBubble.tsx +16 -10
- package/src/shared/views/CometChatAudiosBubble/CometChatAudiosBubble.tsx +10 -6
- package/src/shared/views/CometChatBadge/CometChatBadge.tsx +8 -4
- package/src/shared/views/CometChatBottomSheet/CometChatBottomSheet.tsx +6 -2
- package/src/shared/views/CometChatComposerErrorBanner.tsx +3 -1
- package/src/shared/views/CometChatConfirmDialog/CometChatConfirmDialog.tsx +8 -3
- package/src/shared/views/CometChatConversationStarter/CometChatConversationStarter.tsx +2 -2
- package/src/shared/views/CometChatEmojiKeyboard/CometChatEmojiKeyboard.tsx +5 -3
- package/src/shared/views/CometChatEmojiKeyboard/emojis.ts +8 -8
- package/src/shared/views/CometChatEmojiKeyboard/style.ts +2 -2
- package/src/shared/views/CometChatFilesBubble/CometChatFilesBubble.tsx +5 -4
- package/src/shared/views/CometChatImageViewerModal/ImageViewerModal.tsx +7 -3
- package/src/shared/views/CometChatImagesBubble/CometChatImagesBubble.tsx +29 -23
- package/src/shared/views/CometChatInlineAudioRecorder/CometChatInlineAudioRecorder.tsx +41 -21
- package/src/shared/views/CometChatInlineAudioRecorder/useAudioRecorder.ts +7 -3
- package/src/shared/views/CometChatLinkConfirmPopup/CometChatLinkConfirmPopup.tsx +7 -3
- package/src/shared/views/CometChatList/CometChatList.tsx +10 -14
- package/src/shared/views/CometChatList/Header.tsx +5 -2
- package/src/shared/views/CometChatList/sectionLetter.ts +44 -0
- package/src/shared/views/CometChatList/styles.ts +7 -7
- package/src/shared/views/CometChatListItem/CometChatListItem.tsx +6 -4
- package/src/shared/views/CometChatMediaRecorder/CometChatAudioPlayer.tsx +16 -10
- package/src/shared/views/CometChatMediaRecorder/Timer.tsx +5 -1
- package/src/shared/views/CometChatMediaViewer/CometChatMediaViewer.tsx +16 -11
- package/src/shared/views/CometChatMessageBubble/CometChatMessageBubble.tsx +24 -4
- package/src/shared/views/CometChatMessageInput/CometChatMessageInput.tsx +18 -2
- package/src/shared/views/CometChatNewMessageIndicator/CometChatNewMessageIndicator.tsx +3 -2
- package/src/shared/views/CometChatReactionList/CometChatReactionList.tsx +3 -2
- package/src/shared/views/CometChatReactionList/ReactionListStyle.tsx +2 -2
- package/src/shared/views/CometChatReactionList/Skeleton.tsx +4 -1
- package/src/shared/views/CometChatReactions/CometChatReactions.tsx +6 -2
- package/src/shared/views/CometChatReportDialog/CometChatReportDialog.tsx +7 -3
- package/src/shared/views/CometChatReportDialog/style.ts +1 -1
- package/src/shared/views/CometChatSmartReplies/CometChatSmartReplies.tsx +1 -1
- package/src/shared/views/CometChatStreamMessageBubble/CometChatStreamMessageBubble.tsx +20 -13
- package/src/shared/views/CometChatSuggestionList/CometChatSuggestionList.tsx +3 -2
- package/src/shared/views/CometChatSuggestionList/Skeleton.tsx +1 -1
- package/src/shared/views/CometChatTextBubble/CometChatTextBubble.tsx +29 -3
- package/src/shared/views/CometChatTooltipMenu/CometChatTooltipMenu.tsx +20 -30
- package/src/shared/views/CometChatTooltipMenu/tooltipPosition.ts +43 -0
- package/src/shared/views/CometChatVideoBubble/style.ts +2 -2
- package/src/shared/views/CometChatVideoPlayer/CometChatVideoPlayer.tsx +4 -1
- package/src/shared/views/CometChatVideosBubble/CometChatVideosBubble.tsx +22 -22
- package/src/shared/views/SenderLabel.tsx +41 -0
- package/src/theme/default/default.ts +1 -1
|
@@ -17,6 +17,7 @@ import Svg, { Defs, G, LinearGradient, Path, Stop } from "react-native-svg";
|
|
|
17
17
|
|
|
18
18
|
import { useTheme } from "../theme";
|
|
19
19
|
import { CometChatTheme } from "../theme/type";
|
|
20
|
+
import { useRtlMirror } from "../shared/helper/layoutDirection";
|
|
20
21
|
|
|
21
22
|
// ───────────────────────────────────────────────────────────────
|
|
22
23
|
// Consts & Types
|
|
@@ -112,6 +113,8 @@ const SkeletonItemTop: React.FC<SkeletonProps> = ({ style }) => {
|
|
|
112
113
|
// ───────────────────────────────────────────────────────────────
|
|
113
114
|
export const Skeleton: React.FC<SkeletonProps> = ({ style }) => {
|
|
114
115
|
const theme = useTheme();
|
|
116
|
+
// ENG-41390: SVG shapes and the shimmer use fixed x positions; flip the whole skeleton in RTL.
|
|
117
|
+
const rtlMirror = useRtlMirror();
|
|
115
118
|
const animatedValue = useRef(new Animated.Value(0)).current;
|
|
116
119
|
|
|
117
120
|
/* Kick-off the shimmer animation once on mount */
|
|
@@ -135,7 +138,7 @@ export const Skeleton: React.FC<SkeletonProps> = ({ style }) => {
|
|
|
135
138
|
|
|
136
139
|
/* Render ----------------------------------------------------- */
|
|
137
140
|
return (
|
|
138
|
-
<ScrollView showsVerticalScrollIndicator={false} scrollEnabled={false}>
|
|
141
|
+
<ScrollView style={rtlMirror} showsVerticalScrollIndicator={false} scrollEnabled={false}>
|
|
139
142
|
{/* Bottom layer rectangles */}
|
|
140
143
|
{Array.from({ length: SKELETON_ROW_COUNT }, (_, i) => (
|
|
141
144
|
<SkeletonItemBottom style={style} key={`bottom-${i}`} />
|
|
@@ -19,6 +19,7 @@ import { CometChat } from "@cometchat/chat-sdk-react-native";
|
|
|
19
19
|
import { CometChatList, CometChatListProps } from "../shared";
|
|
20
20
|
import { MessageTypeConstants } from "../shared/constants/UIKitConstants";
|
|
21
21
|
import { deepMerge } from "../shared/helper/helperFunctions";
|
|
22
|
+
import { sentenceWithNames } from "../shared/helper/textDirection";
|
|
22
23
|
import { DeepPartial } from "../shared/helper/types";
|
|
23
24
|
import { Icon } from "../shared/icons/Icon";
|
|
24
25
|
import {
|
|
@@ -38,6 +39,7 @@ import Block from "../shared/icons/components/block";
|
|
|
38
39
|
import Cancel from "../shared/icons/components/cancel";
|
|
39
40
|
import { JSX } from "react";
|
|
40
41
|
import { useCometChatTranslation } from "../shared/resources/CometChatLocalizeNew";
|
|
42
|
+
import { LayoutDirectionContext, directionStyle, useComponentLayoutDirection } from "../shared/helper/layoutDirection";
|
|
41
43
|
|
|
42
44
|
/**
|
|
43
45
|
* Props for the CometChatGroupMembers component.
|
|
@@ -63,6 +65,8 @@ export interface CometChatGroupMembersInterface
|
|
|
63
65
|
| "statusIndicatorType"
|
|
64
66
|
| "hideStickyHeader"
|
|
65
67
|
> {
|
|
68
|
+
/** Lays this component out `"ltr"` or `"rtl"`, overriding the kit's global `layoutDirection`. Not set = inherit. */
|
|
69
|
+
layoutDirection?: "ltr" | "rtl";
|
|
66
70
|
/**
|
|
67
71
|
* Custom view for subtitle.
|
|
68
72
|
* @param item - Object of CometChat.GroupMember.
|
|
@@ -251,6 +255,8 @@ export const CometChatGroupMembers = (props: CometChatGroupMembersInterface) =>
|
|
|
251
255
|
hideSubmitButton = false,
|
|
252
256
|
...newProps
|
|
253
257
|
} = props;
|
|
258
|
+
// ENG-41333: own setting → enclosing component → global; drives the root and the context.
|
|
259
|
+
const direction = useComponentLayoutDirection(props.layoutDirection);
|
|
254
260
|
|
|
255
261
|
// Get theme information and merge with provided style overrides.
|
|
256
262
|
const theme = useTheme();
|
|
@@ -624,7 +630,8 @@ export const CometChatGroupMembers = (props: CometChatGroupMembersInterface) =>
|
|
|
624
630
|
};
|
|
625
631
|
|
|
626
632
|
return (
|
|
627
|
-
<
|
|
633
|
+
<LayoutDirectionContext.Provider value={direction}>
|
|
634
|
+
<View style={[mergedStyle.containerStyle as ViewStyle, directionStyle(direction)]}>
|
|
628
635
|
<CometChatList
|
|
629
636
|
ref={listRef}
|
|
630
637
|
hideHeader={hideHeader}
|
|
@@ -827,6 +834,8 @@ export const CometChatGroupMembers = (props: CometChatGroupMembersInterface) =>
|
|
|
827
834
|
<TouchableOpacity
|
|
828
835
|
key={role.value}
|
|
829
836
|
activeOpacity={isDisabled ? 1 : 0.7}
|
|
837
|
+
accessibilityRole="radio"
|
|
838
|
+
accessibilityState={{ checked: selectedRole === role.value, disabled: isDisabled }}
|
|
830
839
|
onPress={() => {
|
|
831
840
|
if (!isDisabled) {
|
|
832
841
|
setSelectedRole(role.value);
|
|
@@ -837,14 +846,7 @@ export const CometChatGroupMembers = (props: CometChatGroupMembersInterface) =>
|
|
|
837
846
|
mergedStyle?.changeScope?.actionListStyle,
|
|
838
847
|
]}
|
|
839
848
|
>
|
|
840
|
-
|
|
841
|
-
style={[
|
|
842
|
-
theme.typography.heading4.medium,
|
|
843
|
-
{ color: theme.color.textPrimary },
|
|
844
|
-
]}
|
|
845
|
-
>
|
|
846
|
-
{role.display}
|
|
847
|
-
</Text>
|
|
849
|
+
{/* Android ENG-57439 / design: the radio at the start of the row, then the name. */}
|
|
848
850
|
<View
|
|
849
851
|
style={{
|
|
850
852
|
height: 24,
|
|
@@ -867,6 +869,15 @@ export const CometChatGroupMembers = (props: CometChatGroupMembersInterface) =>
|
|
|
867
869
|
/>
|
|
868
870
|
)}
|
|
869
871
|
</View>
|
|
872
|
+
<Text
|
|
873
|
+
style={[
|
|
874
|
+
theme.typography.heading4.medium,
|
|
875
|
+
// A long translated role name wraps beside the radio instead of overflowing.
|
|
876
|
+
{ color: theme.color.textPrimary, flexShrink: 1 },
|
|
877
|
+
]}
|
|
878
|
+
>
|
|
879
|
+
{role.display}
|
|
880
|
+
</Text>
|
|
870
881
|
</TouchableOpacity>
|
|
871
882
|
);
|
|
872
883
|
})}
|
|
@@ -985,6 +996,8 @@ export const CometChatGroupMembers = (props: CometChatGroupMembersInterface) =>
|
|
|
985
996
|
{modalType && (
|
|
986
997
|
<View
|
|
987
998
|
style={{
|
|
999
|
+
// Modal content is a new native root: re-apply this component's direction.
|
|
1000
|
+
...directionStyle(direction),
|
|
988
1001
|
...(modalType === "ban"
|
|
989
1002
|
? mergedStyle.banModalStyle?.containerStyle
|
|
990
1003
|
: mergedStyle.removeModalStyle?.containerStyle),
|
|
@@ -997,8 +1010,9 @@ export const CometChatGroupMembers = (props: CometChatGroupMembersInterface) =>
|
|
|
997
1010
|
: mergedStyle.removeModalStyle?.iconContainerStyle),
|
|
998
1011
|
}}
|
|
999
1012
|
>
|
|
1013
|
+
{/* ENG-57318: the design's icons: plain ✕ for Kick, ⊘ for Ban (as the long-press menu). */}
|
|
1000
1014
|
<Icon
|
|
1001
|
-
name=
|
|
1015
|
+
name={modalType === "ban" ? "block" : "close"}
|
|
1002
1016
|
icon={
|
|
1003
1017
|
modalType === "ban"
|
|
1004
1018
|
? mergedStyle.banModalStyle?.icon
|
|
@@ -1034,9 +1048,8 @@ export const CometChatGroupMembers = (props: CometChatGroupMembersInterface) =>
|
|
|
1034
1048
|
: mergedStyle.removeModalStyle?.titleTextStyle
|
|
1035
1049
|
}
|
|
1036
1050
|
>
|
|
1037
|
-
{
|
|
1038
|
-
|
|
1039
|
-
: `${t("KICK")} ${selectedItem.getName()} ?`}
|
|
1051
|
+
{/* ENG-57318: the design's Kick / Ban Member titles; they name no member. */}
|
|
1052
|
+
{modalType === "ban" ? t("BAN_MEMBER_TITLE") : t("KICK_MEMBER_TITLE")}
|
|
1040
1053
|
</Text>
|
|
1041
1054
|
|
|
1042
1055
|
<Text
|
|
@@ -1046,9 +1059,12 @@ export const CometChatGroupMembers = (props: CometChatGroupMembersInterface) =>
|
|
|
1046
1059
|
: mergedStyle.removeModalStyle?.subTitleTextStyle
|
|
1047
1060
|
}
|
|
1048
1061
|
>
|
|
1049
|
-
{
|
|
1050
|
-
|
|
1051
|
-
|
|
1062
|
+
{/* ENG-57318: one whole translated sentence with a ${name} slot (as Android),
|
|
1063
|
+
not a prefix glued to the name, which ran into the Arabic word. */}
|
|
1064
|
+
{sentenceWithNames(
|
|
1065
|
+
t(modalType === "ban" ? "BAN_MEMBER_CONFIRM_MESSAGE" : "KICK_MEMBER_CONFIRM_MESSAGE"),
|
|
1066
|
+
{ name: selectedItem.getName() }
|
|
1067
|
+
)}
|
|
1052
1068
|
</Text>
|
|
1053
1069
|
|
|
1054
1070
|
<View
|
|
@@ -1073,7 +1089,7 @@ export const CometChatGroupMembers = (props: CometChatGroupMembersInterface) =>
|
|
|
1073
1089
|
: mergedStyle.removeModalStyle?.cancelStyle?.textStyle),
|
|
1074
1090
|
}}
|
|
1075
1091
|
>
|
|
1076
|
-
{t("
|
|
1092
|
+
{t("CANCEL")}
|
|
1077
1093
|
</Text>
|
|
1078
1094
|
</TouchableOpacity>
|
|
1079
1095
|
<TouchableOpacity
|
|
@@ -1099,7 +1115,7 @@ export const CometChatGroupMembers = (props: CometChatGroupMembersInterface) =>
|
|
|
1099
1115
|
: mergedStyle.removeModalStyle?.confirmStyle?.textStyle),
|
|
1100
1116
|
}}
|
|
1101
1117
|
>
|
|
1102
|
-
{t("
|
|
1118
|
+
{modalType === "ban" ? t("BAN") : t("KICK")}
|
|
1103
1119
|
</Text>
|
|
1104
1120
|
</TouchableOpacity>
|
|
1105
1121
|
</View>
|
|
@@ -1111,5 +1127,6 @@ export const CometChatGroupMembers = (props: CometChatGroupMembersInterface) =>
|
|
|
1111
1127
|
</Modal>
|
|
1112
1128
|
|
|
1113
1129
|
</View>
|
|
1130
|
+
</LayoutDirectionContext.Provider>
|
|
1114
1131
|
);
|
|
1115
1132
|
};
|
|
@@ -2,6 +2,7 @@ import React, { useEffect, useRef } from "react";
|
|
|
2
2
|
import { Animated, Dimensions, Easing, ScrollView, StyleSheet, View } from "react-native";
|
|
3
3
|
import Svg, { Circle, Defs, LinearGradient, Rect, Stop } from "react-native-svg";
|
|
4
4
|
import { useTheme } from "../theme";
|
|
5
|
+
import { useRtlMirror } from "../shared/helper/layoutDirection";
|
|
5
6
|
|
|
6
7
|
const { width: screenWidth } = Dimensions.get("window");
|
|
7
8
|
|
|
@@ -108,6 +109,8 @@ const SkeletonItemTop = () => {
|
|
|
108
109
|
|
|
109
110
|
export const Skeleton = () => {
|
|
110
111
|
const theme = useTheme();
|
|
112
|
+
// ENG-41390: SVG shapes and the shimmer use fixed x positions; flip the whole skeleton in RTL.
|
|
113
|
+
const rtlMirror = useRtlMirror();
|
|
111
114
|
const animatedValue = useRef(new Animated.Value(0)).current;
|
|
112
115
|
|
|
113
116
|
useEffect(() => {
|
|
@@ -135,7 +138,7 @@ export const Skeleton = () => {
|
|
|
135
138
|
<ScrollView
|
|
136
139
|
scrollEnabled={false}
|
|
137
140
|
showsVerticalScrollIndicator={false}
|
|
138
|
-
style={{ backgroundColor: theme.groupMemberStyle?.containerStyle?.backgroundColor }}
|
|
141
|
+
style={[{ backgroundColor: theme.groupMemberStyle?.containerStyle?.backgroundColor }, rtlMirror]}
|
|
139
142
|
>
|
|
140
143
|
<SkeletonItemBottom />
|
|
141
144
|
<Animated.View
|
|
@@ -375,7 +375,7 @@ export const getGroupMemberStyleLight = (
|
|
|
375
375
|
},
|
|
376
376
|
confirmStyle: {
|
|
377
377
|
containerStyle: {
|
|
378
|
-
|
|
378
|
+
marginStart: 2,
|
|
379
379
|
flex: 1,
|
|
380
380
|
paddingVertical: 10,
|
|
381
381
|
borderWidth: 1,
|
|
@@ -392,12 +392,14 @@ export const getGroupMemberStyleLight = (
|
|
|
392
392
|
actionListStyle: {
|
|
393
393
|
flexDirection: "row",
|
|
394
394
|
alignItems: "center",
|
|
395
|
-
|
|
395
|
+
// Radio then role name from the start edge (design, Android ENG-57439).
|
|
396
|
+
justifyContent: "flex-start",
|
|
397
|
+
gap: spacing.spacing.s2,
|
|
396
398
|
paddingVertical: 10,
|
|
397
399
|
},
|
|
398
400
|
cancelStyle: {
|
|
399
401
|
containerStyle: {
|
|
400
|
-
|
|
402
|
+
marginEnd: 2,
|
|
401
403
|
flex: 1,
|
|
402
404
|
paddingVertical: 10,
|
|
403
405
|
borderWidth: 1,
|
|
@@ -429,7 +431,7 @@ export const getGroupMemberStyleLight = (
|
|
|
429
431
|
onlineStatusColor: color.success,
|
|
430
432
|
titleViewStyle: {
|
|
431
433
|
paddingVertical: spacing.spacing.s3,
|
|
432
|
-
|
|
434
|
+
paddingStart: spacing.spacing.s3,
|
|
433
435
|
margin: spacing.spacing.s0,
|
|
434
436
|
},
|
|
435
437
|
titleStyle: {
|
|
@@ -20,6 +20,8 @@ import { Skeleton } from "./Skeleton";
|
|
|
20
20
|
import { Style } from "./style";
|
|
21
21
|
import { JSX } from "react";
|
|
22
22
|
import { useCometChatTranslation } from "../shared/resources/CometChatLocalizeNew";
|
|
23
|
+
import { pluralCountLabel } from "../shared/helper/pluralRules";
|
|
24
|
+
import { LayoutDirectionContext, directionStyle, useComponentLayoutDirection, TEXT_START } from "../shared/helper/layoutDirection";
|
|
23
25
|
import { OfflineHub } from "../shared/offline/OfflineHub";
|
|
24
26
|
import { dispatchSweptGroupAction } from "../shared/offline/groupActions";
|
|
25
27
|
|
|
@@ -31,6 +33,8 @@ const uiEventListener = "uiEvents_" + Date.now() + "_" + (++__listenerIdCounter)
|
|
|
31
33
|
* Props for the CometChatGroups component.
|
|
32
34
|
*/
|
|
33
35
|
export interface CometChatGroupsInterface {
|
|
36
|
+
/** Lays this component out `"ltr"` or `"rtl"`, overriding the kit's global `layoutDirection`. Not set = inherit. */
|
|
37
|
+
layoutDirection?: "ltr" | "rtl";
|
|
34
38
|
/**
|
|
35
39
|
* Custom title view for a group item.
|
|
36
40
|
* @param group - The group object.
|
|
@@ -181,7 +185,7 @@ export interface CometChatGroupsInterface {
|
|
|
181
185
|
* error/empty/loading views, and a long-press tooltip menu (if you provide menu items).
|
|
182
186
|
*/
|
|
183
187
|
export const CometChatGroups = React.forwardRef((props: CometChatGroupsInterface, ref: any) => {
|
|
184
|
-
const { t } = useCometChatTranslation();
|
|
188
|
+
const { t, language } = useCometChatTranslation();
|
|
185
189
|
|
|
186
190
|
const {
|
|
187
191
|
AppBarOptions,
|
|
@@ -214,6 +218,8 @@ export const CometChatGroups = React.forwardRef((props: CometChatGroupsInterface
|
|
|
214
218
|
hideHeader,
|
|
215
219
|
...newProps
|
|
216
220
|
} = props;
|
|
221
|
+
// ENG-41333: own setting → enclosing component → global; drives the root and the context.
|
|
222
|
+
const direction = useComponentLayoutDirection(props.layoutDirection);
|
|
217
223
|
|
|
218
224
|
// Theme references.
|
|
219
225
|
const theme = useTheme();
|
|
@@ -525,15 +531,14 @@ export const CometChatGroups = React.forwardRef((props: CometChatGroupsInterface
|
|
|
525
531
|
const DefaultSubtitleView = useCallback((group: CometChat.Group) => (
|
|
526
532
|
<Text
|
|
527
533
|
style={[
|
|
534
|
+
TEXT_START,
|
|
528
535
|
style.itemStyle?.subtitleStyle,
|
|
529
536
|
theme.groupStyles.itemStyle?.subtitleStyle,
|
|
530
537
|
]}
|
|
531
538
|
>
|
|
532
|
-
{group.getMembersCount()
|
|
533
|
-
" " +
|
|
534
|
-
t(group.getMembersCount() === 1 ? "MEMBER" : "MEMBERS")}
|
|
539
|
+
{pluralCountLabel(t, "MEMBER_COUNT", group.getMembersCount(), language)}
|
|
535
540
|
</Text>
|
|
536
|
-
), [style, theme, t]);
|
|
541
|
+
), [style, theme, t, language]);
|
|
537
542
|
|
|
538
543
|
// Stable onListFetched callback
|
|
539
544
|
const handleListFetched = useCallback((fetchedList: CometChat.GroupMember[]) => {
|
|
@@ -552,7 +557,8 @@ export const CometChatGroups = React.forwardRef((props: CometChatGroupsInterface
|
|
|
552
557
|
);
|
|
553
558
|
|
|
554
559
|
return (
|
|
555
|
-
<
|
|
560
|
+
<LayoutDirectionContext.Provider value={direction}>
|
|
561
|
+
<View style={[Style.container, theme.groupStyles.containerStyle, directionStyle(direction)]}>
|
|
556
562
|
<CometChatList
|
|
557
563
|
hideHeader={hideHeader ?? hideHeader}
|
|
558
564
|
onItemPress={onItemPress}
|
|
@@ -630,5 +636,6 @@ export const CometChatGroups = React.forwardRef((props: CometChatGroupsInterface
|
|
|
630
636
|
</View>
|
|
631
637
|
)}
|
|
632
638
|
</View>
|
|
639
|
+
</LayoutDirectionContext.Provider>
|
|
633
640
|
);
|
|
634
641
|
});
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
import Svg, { Circle, Defs, LinearGradient, Rect, Stop } from "react-native-svg";
|
|
11
11
|
import { useTheme } from "../theme";
|
|
12
12
|
import { CometChatTheme } from "../theme/type";
|
|
13
|
+
import { useRtlMirror } from "../shared/helper/layoutDirection";
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* React‑Native skeleton list with animated shimmer.
|
|
@@ -137,6 +138,8 @@ const useRowShapes = (fill: string) =>
|
|
|
137
138
|
|
|
138
139
|
export const Skeleton: React.FC<SkeletonProps> = ({ style }) => {
|
|
139
140
|
const theme = useTheme();
|
|
141
|
+
// ENG-41390: SVG shapes and the shimmer use fixed x positions; flip the whole skeleton in RTL.
|
|
142
|
+
const rtlMirror = useRtlMirror();
|
|
140
143
|
|
|
141
144
|
/** Resolved style helpers (with theme‑fallback). */
|
|
142
145
|
const get = <K extends keyof SkeletonStyle>(key: K) =>
|
|
@@ -180,7 +183,7 @@ export const Skeleton: React.FC<SkeletonProps> = ({ style }) => {
|
|
|
180
183
|
<ScrollView
|
|
181
184
|
scrollEnabled={false}
|
|
182
185
|
showsVerticalScrollIndicator={false}
|
|
183
|
-
style={{ backgroundColor: get("containerBackgroundColor") }}
|
|
186
|
+
style={[{ backgroundColor: get("containerBackgroundColor") }, rtlMirror]}
|
|
184
187
|
>
|
|
185
188
|
{/* Bottom gradient layer */}
|
|
186
189
|
<Svg height={TOTAL_HEIGHT} width={SCREEN_WIDTH} fill="none" preserveAspectRatio="xMidYMid meet">
|
|
@@ -85,6 +85,7 @@ import { getFileUploadLimits, clampToServer, acceptPickedAttachments, toastAttac
|
|
|
85
85
|
import { partitionAttachmentsByKind, AttachmentKindGroup } from "../shared/utils/partitionAttachmentsByKind";
|
|
86
86
|
import { attachmentCountLabel } from "../shared/utils/conversationUtils";
|
|
87
87
|
import { CometChatComposerErrorBanner } from "../shared/views/CometChatComposerErrorBanner";
|
|
88
|
+
import { LayoutDirectionContext, directionStyle, useComponentLayoutDirection } from "../shared/helper/layoutDirection";
|
|
88
89
|
|
|
89
90
|
type MentionOverlap = {
|
|
90
91
|
key: string;
|
|
@@ -179,6 +180,8 @@ type IntRange<F extends number, T extends number> = Exclude<Enumerate<T>, Enumer
|
|
|
179
180
|
* Properties for the CometChat message composer component.
|
|
180
181
|
*/
|
|
181
182
|
export interface CometChatMessageComposerInterface {
|
|
183
|
+
/** Lays this component out `"ltr"` or `"rtl"`, overriding the kit's global `layoutDirection`. Not set = inherit. */
|
|
184
|
+
layoutDirection?: "ltr" | "rtl";
|
|
182
185
|
/**
|
|
183
186
|
* Message composer identifier.
|
|
184
187
|
*
|
|
@@ -541,6 +544,8 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
541
544
|
// §1 — false → legacy single-select, send-immediately attachments (no tray/fan-out).
|
|
542
545
|
enableMultipleAttachments = true,
|
|
543
546
|
} = props;
|
|
547
|
+
// ENG-41333: own setting → enclosing component → global; drives the root and the context.
|
|
548
|
+
const direction = useComponentLayoutDirection(props.layoutDirection);
|
|
544
549
|
|
|
545
550
|
// Helper function to check if user is agentic
|
|
546
551
|
const isAgenticUser = useCallback(() => {
|
|
@@ -639,6 +644,16 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
639
644
|
const [trayViewerVisible, setTrayViewerVisible] = React.useState(false);
|
|
640
645
|
const [trayViewerIndex, setTrayViewerIndex] = React.useState(0);
|
|
641
646
|
const [plainText, setPlainText] = React.useState(initialComposertext ?? "");
|
|
647
|
+
/**
|
|
648
|
+
* The raw input (no formatting) lives twice: a ref, which handlers read synchronously, and state,
|
|
649
|
+
* which renders read (send button, CometChatMessageInput's caret side). One write path keeps them
|
|
650
|
+
* equal. Only clearInputBox/clearEditPreview write one of them (the state) on their own; see the
|
|
651
|
+
* composer tests.
|
|
652
|
+
*/
|
|
653
|
+
const setRawText = (value: string) => {
|
|
654
|
+
plainTextInput.current = value;
|
|
655
|
+
setPlainText(value);
|
|
656
|
+
};
|
|
642
657
|
const bottomSheetRef = React.useRef<any>(null);
|
|
643
658
|
const [showStopButton, setShowStopButton] = React.useState(false);
|
|
644
659
|
const [isSendButtonDisabledForDelay, setIsSendButtonDisabledForDelay] = React.useState(false);
|
|
@@ -855,8 +870,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
855
870
|
sendTextMessage,
|
|
856
871
|
getText: () => messageInputRef.current?.getText?.() ?? "",
|
|
857
872
|
setText: (text: string) => {
|
|
858
|
-
|
|
859
|
-
setPlainText(text);
|
|
873
|
+
setRawText(text);
|
|
860
874
|
messageInputRef.current?.setNativeProps?.({ text });
|
|
861
875
|
},
|
|
862
876
|
clear: () => messageInputRef.current?.clear?.(),
|
|
@@ -891,7 +905,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
891
905
|
<Icon name='info-fill' color={theme.color.error}></Icon>
|
|
892
906
|
<Text
|
|
893
907
|
style={{
|
|
894
|
-
|
|
908
|
+
marginStart: 5,
|
|
895
909
|
color: theme.color.error,
|
|
896
910
|
...theme.typography.caption1.regular,
|
|
897
911
|
}}
|
|
@@ -975,8 +989,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
975
989
|
// Sort edits by startIndex to apply them in order
|
|
976
990
|
edits.sort((a: any, b: any) => a.startIndex - b.startIndex);
|
|
977
991
|
|
|
978
|
-
|
|
979
|
-
setPlainText(plainTextInput.current);
|
|
992
|
+
setRawText(getPlainString(editSourceText, edits) ?? "");
|
|
980
993
|
setOriginalText(plainTextInput.current.trim());
|
|
981
994
|
setHasEdited(false);
|
|
982
995
|
const hashMap = new Map();
|
|
@@ -1011,7 +1024,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1011
1024
|
if (messagePreview) {
|
|
1012
1025
|
setMessagePreview(null);
|
|
1013
1026
|
mentionMap.current = new Map();
|
|
1014
|
-
|
|
1027
|
+
// The edit text stays in the input and in the raw text, so Send sends what is shown, as a reply.
|
|
1015
1028
|
setOriginalText("");
|
|
1016
1029
|
}
|
|
1017
1030
|
|
|
@@ -1248,9 +1261,8 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1248
1261
|
// Clear composer state immediately
|
|
1249
1262
|
setSelectedAttachments([]);
|
|
1250
1263
|
selectedAttachmentsRef.current = []; // keep the ref exact so a pick right after send isn't gated on a stale count
|
|
1251
|
-
|
|
1264
|
+
setRawText('');
|
|
1252
1265
|
inputValueRef.current = '';
|
|
1253
|
-
setPlainText('');
|
|
1254
1266
|
setInputMessage('');
|
|
1255
1267
|
setReplyMessage(null);
|
|
1256
1268
|
|
|
@@ -1359,11 +1371,10 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1359
1371
|
});
|
|
1360
1372
|
|
|
1361
1373
|
setMentionsSearchData([]);
|
|
1362
|
-
|
|
1374
|
+
setRawText("");
|
|
1363
1375
|
|
|
1364
1376
|
// Clear input and reply message immediately for better UX
|
|
1365
1377
|
inputValueRef.current = "";
|
|
1366
|
-
setPlainText("");
|
|
1367
1378
|
setHasEdited(false);
|
|
1368
1379
|
setInputMessage("");
|
|
1369
1380
|
setWarningMessage("");
|
|
@@ -1994,6 +2005,8 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1994
2005
|
if (trackingCharacter) trackingCharacters.current.push(trackingCharacter);
|
|
1995
2006
|
|
|
1996
2007
|
let newFormatter = CommonUtils.clone(formatter);
|
|
2008
|
+
// Only the composer's copy draws the input box; the app's instance may also draw the list.
|
|
2009
|
+
newFormatter.markAsComposerInput?.();
|
|
1997
2010
|
// A formatter with no tracking character has no suggestion list, but it still takes part in
|
|
1998
2011
|
// the send and edit-preview lifecycle — so key it by id instead of letting an empty key
|
|
1999
2012
|
// collapse them all into one entry. The prefix keeps it clear of tracking-character lookups.
|
|
@@ -2237,8 +2250,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
2237
2250
|
|
|
2238
2251
|
inputValueRef.current = text?.text;
|
|
2239
2252
|
setInputMessage(text?.text);
|
|
2240
|
-
|
|
2241
|
-
setPlainText(text?.text || "");
|
|
2253
|
+
setRawText(text?.text || "");
|
|
2242
2254
|
},
|
|
2243
2255
|
ccSuggestionData(item: { id: string | number; data: Array<SuggestionItem> }) {
|
|
2244
2256
|
if (activeCharacter.current && id === item?.id) {
|
|
@@ -2509,8 +2521,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
2509
2521
|
|
|
2510
2522
|
shiftRemainingMentionKeys(deletionMentionMap, range.start, totalShift);
|
|
2511
2523
|
|
|
2512
|
-
|
|
2513
|
-
setPlainText(finalText);
|
|
2524
|
+
setRawText(finalText);
|
|
2514
2525
|
onTextChange?.(finalText);
|
|
2515
2526
|
mentionMap.current = deletionMentionMap;
|
|
2516
2527
|
|
|
@@ -2549,8 +2560,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
2549
2560
|
|
|
2550
2561
|
let decr = 0;
|
|
2551
2562
|
|
|
2552
|
-
|
|
2553
|
-
setPlainText(newText);
|
|
2563
|
+
setRawText(newText);
|
|
2554
2564
|
|
|
2555
2565
|
const newMentionMap: Map<string, SuggestionItem> = new Map(mentionMap.current);
|
|
2556
2566
|
|
|
@@ -2672,7 +2682,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
2672
2682
|
selectionPosition.end,
|
|
2673
2683
|
plainTextInput.current?.length
|
|
2674
2684
|
)}`;
|
|
2675
|
-
|
|
2685
|
+
setRawText(updatedPlainTextInput);
|
|
2676
2686
|
|
|
2677
2687
|
let key =
|
|
2678
2688
|
selectionPosition.start -
|
|
@@ -2819,6 +2829,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
2819
2829
|
};
|
|
2820
2830
|
|
|
2821
2831
|
return (
|
|
2832
|
+
<LayoutDirectionContext.Provider value={direction}>
|
|
2822
2833
|
<>
|
|
2823
2834
|
{/* {!isVisible && typeof CustomView === "function" && <CustomView />} TODOM */}
|
|
2824
2835
|
<Modal
|
|
@@ -2843,6 +2854,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
2843
2854
|
>
|
|
2844
2855
|
<View
|
|
2845
2856
|
style={[
|
|
2857
|
+
directionStyle(direction),
|
|
2846
2858
|
Style.container,
|
|
2847
2859
|
{
|
|
2848
2860
|
paddingTop: CustomViewHeader ? theme.spacing.padding.p0 : theme.spacing.padding.p2,
|
|
@@ -2936,8 +2948,8 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
2936
2948
|
backgroundColor: theme.color.background1,
|
|
2937
2949
|
// radius.r2 + borderDefault + (s0_5 / 2) width — the SAME tokens the input's
|
|
2938
2950
|
// messageInputStyles.containerStyle uses, so the tray joins it seamlessly.
|
|
2939
|
-
|
|
2940
|
-
|
|
2951
|
+
borderTopEndRadius: theme.spacing.radius.r2,
|
|
2952
|
+
borderTopStartRadius: theme.spacing.radius.r2,
|
|
2941
2953
|
paddingHorizontal: theme.spacing.padding.p1,
|
|
2942
2954
|
borderWidth: theme.spacing.spacing.s0_5 / 2,
|
|
2943
2955
|
borderColor: theme.color.borderDefault,
|
|
@@ -2979,14 +2991,14 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
2979
2991
|
setMessagePreview(null);
|
|
2980
2992
|
clearEditPreview();
|
|
2981
2993
|
mentionMap.current = new Map();
|
|
2982
|
-
|
|
2994
|
+
setRawText("");
|
|
2983
2995
|
setOriginalText("");
|
|
2984
2996
|
}}
|
|
2985
2997
|
style={{
|
|
2986
2998
|
borderRadius: 8,
|
|
2987
2999
|
borderWidth: 0,
|
|
2988
|
-
|
|
2989
|
-
|
|
3000
|
+
borderStartWidth: 3,
|
|
3001
|
+
borderStartColor: theme.color.borderHighlight,
|
|
2990
3002
|
margin:theme.spacing.padding.p1,
|
|
2991
3003
|
}}
|
|
2992
3004
|
/>
|
|
@@ -3003,8 +3015,8 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
3003
3015
|
titleStyle={{ color: theme.color.textHighlight }}
|
|
3004
3016
|
style={{
|
|
3005
3017
|
borderRadius: 8,
|
|
3006
|
-
|
|
3007
|
-
|
|
3018
|
+
borderStartWidth: 3,
|
|
3019
|
+
borderStartColor: theme.color.borderHighlight,
|
|
3008
3020
|
margin:theme.spacing.padding.p1,
|
|
3009
3021
|
}}
|
|
3010
3022
|
/>
|
|
@@ -3021,6 +3033,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
3021
3033
|
<CometChatMessageInput
|
|
3022
3034
|
messageInputRef={messageInputRef}
|
|
3023
3035
|
text={inputMessage as string}
|
|
3036
|
+
plainText={plainText}
|
|
3024
3037
|
placeHolderText={isAgenticUser()? t("ASK_ANYTHING") : t("ENTER_YOUR_MESSAGE_HERE")}
|
|
3025
3038
|
style={{
|
|
3026
3039
|
...mergedComposerStyle.messageInputStyles,
|
|
@@ -3029,12 +3042,12 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
3029
3042
|
// Square the TOP for previews above (edit/reply) and the BOTTOM for the tray below,
|
|
3030
3043
|
// so the input joins whichever surface is attached into one continuous composer.
|
|
3031
3044
|
...(messagePreview || replyMessage ? {
|
|
3032
|
-
|
|
3033
|
-
|
|
3045
|
+
borderTopStartRadius: 0,
|
|
3046
|
+
borderTopEndRadius: 0,
|
|
3034
3047
|
} : {}),
|
|
3035
3048
|
...(selectedAttachments.length > 0 ? {
|
|
3036
|
-
|
|
3037
|
-
|
|
3049
|
+
borderBottomStartRadius: 0,
|
|
3050
|
+
borderBottomEndRadius: 0,
|
|
3038
3051
|
// No bottom edge either — the tray surface below closes the box, so input + tray
|
|
3039
3052
|
// read as one seamless container (like the single-line composer), not two pieces.
|
|
3040
3053
|
borderBottomWidth: 0,
|
|
@@ -3084,8 +3097,8 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
3084
3097
|
<View
|
|
3085
3098
|
style={{
|
|
3086
3099
|
backgroundColor: theme.color.background1,
|
|
3087
|
-
|
|
3088
|
-
|
|
3100
|
+
borderBottomEndRadius: theme.spacing.radius.r2,
|
|
3101
|
+
borderBottomStartRadius: theme.spacing.radius.r2,
|
|
3089
3102
|
paddingHorizontal: theme.spacing.padding.p1,
|
|
3090
3103
|
borderWidth: theme.spacing.spacing.s0_5 / 2,
|
|
3091
3104
|
borderColor: theme.color.borderDefault,
|
|
@@ -3111,6 +3124,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
3111
3124
|
)
|
|
3112
3125
|
) : null}
|
|
3113
3126
|
</>
|
|
3127
|
+
</LayoutDirectionContext.Provider>
|
|
3114
3128
|
);
|
|
3115
3129
|
}
|
|
3116
3130
|
);
|