@cometchat/chat-uikit-react-native 5.2.3 → 5.2.5
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/package.json +1 -1
- package/src/CometChatConversations/CometChatConversations.tsx +167 -86
- package/src/CometChatMessageComposer/CometChatMessageComposer.tsx +312 -116
- package/src/CometChatMessageComposer/styles.tsx +2 -1
- package/src/CometChatMessageHeader/CometChatMessageHeader.tsx +83 -17
- package/src/CometChatMessageList/CometChatMessageList.tsx +675 -122
- package/src/CometChatMessageList/style.ts +4 -2
- package/src/CometChatSearch/CometChatSearch.tsx +2165 -0
- package/src/CometChatSearch/SearchConstants.ts +46 -0
- package/src/CometChatSearch/Skeleton.tsx +192 -0
- package/src/CometChatSearch/index.ts +1 -0
- package/src/CometChatSearch/style.ts +414 -0
- package/src/extensions/CollaborativeDocument/CollaborativeDocumentExtensionDecorator.tsx +43 -7
- package/src/extensions/CollaborativeWhiteboard/CollaborativeWhiteboardExtensionDecorator.tsx +45 -7
- package/src/extensions/Polls/Polls.tsx +36 -2
- package/src/extensions/Polls/PollsBubble.tsx +13 -9
- package/src/extensions/Polls/PollsDecorator.tsx +13 -1
- package/src/extensions/Stickers/StickersExtensionDecorator.tsx +50 -11
- package/src/extensions/Stickers/style.ts +0 -1
- package/src/index.ts +5 -0
- package/src/shared/base/Types.ts +8 -0
- package/src/shared/constants/UIKitConstants.ts +2 -0
- package/src/shared/events/CometChatMessageEvents/index.ts +8 -7
- package/src/shared/events/CometChatUIEventHandler/Listener.ts +4 -0
- package/src/shared/formatters/CometChatMentionsFormatter/CometChatMentionsFormatter.tsx +158 -27
- package/src/shared/framework/DataSource.ts +7 -0
- package/src/shared/framework/DataSourceDecorator.tsx +12 -0
- package/src/shared/framework/MessageDataSource.tsx +182 -1
- package/src/shared/helper/functions.js +0 -67
- package/src/shared/helper/helperFunctions.ts +72 -0
- package/src/shared/icons/components/documents.tsx +23 -0
- package/src/shared/icons/components/empty-search.tsx +52 -0
- package/src/shared/icons/components/message-blocked.tsx +1 -1
- package/src/shared/icons/components/unread.tsx +29 -0
- package/src/shared/icons/icon-mapping.tsx +7 -0
- package/src/shared/index.ts +2 -1
- package/src/shared/modals/CometChatMessageTemplate.ts +23 -0
- package/src/shared/resources/CometChatLocalizeNew/CometChatLocalizationHelper.ts +4 -4
- package/src/shared/resources/CometChatLocalizeNew/resources/de/translation.json +17 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/en/translation.json +70 -34
- package/src/shared/resources/CometChatLocalizeNew/resources/es/translation.json +60 -24
- package/src/shared/resources/CometChatLocalizeNew/resources/fr/translation.json +37 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/hi/translation.json +60 -24
- package/src/shared/resources/CometChatLocalizeNew/resources/hu/translation.json +37 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/it/translation.json +37 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/ja/translation.json +37 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/ko/translation.json +37 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/lt/translation.json +40 -4
- package/src/shared/resources/CometChatLocalizeNew/resources/ms/translation.json +37 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/nl/translation.json +37 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/pt/translation.json +37 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/ru/translation.json +37 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/sv/translation.json +38 -2
- package/src/shared/resources/CometChatLocalizeNew/resources/tr/translation.json +37 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/zh/translation.json +37 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/zh-tw/translation.json +40 -4
- package/src/shared/utils/CometChatMessagePreview/CometChatMessagePreview.tsx +274 -23
- package/src/shared/utils/MessageUtils.tsx +0 -1
- package/src/shared/views/CometChatAudioBubble/style.ts +0 -2
- package/src/shared/views/CometChatFileBubble/style.ts +0 -4
- package/src/shared/views/CometChatImageBubble/CometChatImageLoader.tsx +1 -0
- package/src/shared/views/CometChatList/CometChatList.tsx +12 -0
- package/src/shared/views/CometChatList/Header.tsx +79 -49
- package/src/shared/views/CometChatMessageBubble/CometChatMessageBubble.tsx +14 -4
- package/src/shared/views/CometChatReportDialog/CometChatReportDialog.tsx +390 -0
- package/src/shared/views/CometChatReportDialog/index.ts +3 -0
- package/src/shared/views/CometChatReportDialog/style.ts +164 -0
- 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 +2 -2
- package/src/shared/views/CometChatSuggestionList/CometChatSuggestionList.tsx +18 -2
- package/src/shared/views/index.ts +6 -0
- package/src/theme/default/default.ts +3 -0
- package/src/theme/provider.tsx +23 -12
- package/src/theme/type.ts +2 -0
package/src/theme/provider.tsx
CHANGED
|
@@ -56,6 +56,7 @@ export const CometChatThemeProvider = ({
|
|
|
56
56
|
|
|
57
57
|
const lightTheme = useMemo(() => {
|
|
58
58
|
if (light) {
|
|
59
|
+
const isColorAvailable = light.color !== undefined;
|
|
59
60
|
const updatedColors = light.color
|
|
60
61
|
? CometChatThemeHelper.updateColors(
|
|
61
62
|
light.color as Partial<CometChatTheme["color"]>,
|
|
@@ -65,21 +66,27 @@ export const CometChatThemeProvider = ({
|
|
|
65
66
|
const updatedSpacing = light.spacing
|
|
66
67
|
? CometChatThemeHelper.updateSpacing(light.spacing)
|
|
67
68
|
: {} as any;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
|
|
69
|
+
|
|
70
|
+
// Create a new object cause react native will know the theme has changed
|
|
71
|
+
const updatedLight = {
|
|
72
|
+
...light,
|
|
73
|
+
color: updatedColors,
|
|
74
|
+
spacing: updatedSpacing
|
|
75
|
+
};
|
|
76
|
+
const mergedTheme = deepMerge(parentProviderTheme.light, updatedLight);
|
|
77
|
+
const defaultLightThemeWithOverridesApplied = isColorAvailable ? lightThemeMaker(
|
|
72
78
|
mergedTheme.spacing as CometChatTheme["spacing"],
|
|
73
79
|
mergedTheme.color as CometChatTheme["color"],
|
|
74
80
|
mergedTheme.typography as CometChatTheme["typography"]
|
|
75
|
-
);
|
|
76
|
-
return deepMerge(defaultLightThemeWithOverridesApplied,
|
|
81
|
+
) : mergedTheme;
|
|
82
|
+
return deepMerge(defaultLightThemeWithOverridesApplied, updatedLight);
|
|
77
83
|
}
|
|
78
84
|
return parentProviderTheme.light;
|
|
79
85
|
}, [light, parentProviderTheme.light]);
|
|
80
86
|
|
|
81
87
|
const darkTheme = useMemo(() => {
|
|
82
88
|
if (dark) {
|
|
89
|
+
const isColorAvailable = dark.color !== undefined;
|
|
83
90
|
const updatedColors = dark.color
|
|
84
91
|
? CometChatThemeHelper.updateColors(
|
|
85
92
|
dark.color as Partial<CometChatTheme["color"]>,
|
|
@@ -89,15 +96,19 @@ export const CometChatThemeProvider = ({
|
|
|
89
96
|
const updatedSpacing = dark.spacing
|
|
90
97
|
? CometChatThemeHelper.updateSpacing(dark.spacing)
|
|
91
98
|
: {} as any;
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
99
|
+
// Create a new object cause react native will know the theme has changed
|
|
100
|
+
const updatedDark = {
|
|
101
|
+
...dark,
|
|
102
|
+
color: updatedColors,
|
|
103
|
+
spacing: updatedSpacing
|
|
104
|
+
};
|
|
105
|
+
const mergedTheme = deepMerge(parentProviderTheme.dark, updatedDark);
|
|
106
|
+
const defaultDarkThemeWithOverridesApplied = isColorAvailable ? darkThemeMaker(
|
|
96
107
|
mergedTheme.spacing as CometChatTheme["spacing"],
|
|
97
108
|
mergedTheme.color as CometChatTheme["color"],
|
|
98
109
|
mergedTheme.typography as CometChatTheme["typography"]
|
|
99
|
-
);
|
|
100
|
-
return deepMerge(defaultDarkThemeWithOverridesApplied,
|
|
110
|
+
) : mergedTheme;
|
|
111
|
+
return deepMerge(defaultDarkThemeWithOverridesApplied, updatedDark);
|
|
101
112
|
}
|
|
102
113
|
return parentProviderTheme.dark;
|
|
103
114
|
}, [dark, parentProviderTheme.dark]);
|
package/src/theme/type.ts
CHANGED
|
@@ -23,6 +23,7 @@ import { DeepPartial } from "../shared/helper/types";
|
|
|
23
23
|
import { DateSeparatorStyle } from "../shared/views/CometChatDateSeperator/styles";
|
|
24
24
|
import { JSX } from "react";
|
|
25
25
|
import { ChatHistoryStyle } from "../CometChatAIAssistantChatHistory/style";
|
|
26
|
+
import { ReportDialogStyle } from "../shared/views/CometChatReportDialog/style";
|
|
26
27
|
|
|
27
28
|
export type BubbleStyles = {
|
|
28
29
|
containerStyle: ViewStyle;
|
|
@@ -468,6 +469,7 @@ export interface CometChatTheme {
|
|
|
468
469
|
callLogsStyles: CallLogsStyle;
|
|
469
470
|
conversationStyles: ConversationStyle;
|
|
470
471
|
confirmDialogStyles: ConfirmDialogStyle;
|
|
472
|
+
reportDialogStyles: ReportDialogStyle;
|
|
471
473
|
quickReactionStyle: {
|
|
472
474
|
containerStyle: ViewStyle;
|
|
473
475
|
emojiContainerStyle: ViewStyle;
|