@cometchat/chat-uikit-react-native 5.0.1 → 5.1.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/.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/src/main/java/com/reactnativecometchatuikit/FileManager.java +87 -41
- package/android/src/main/java/com/reactnativecometchatuikit/SoundPlayer.java +10 -0
- package/ios/SoundPlayer.m +8 -0
- package/lib/CometChatMessageList/CometChatMessageList.js +1 -1
- package/lib/CometChatMessageList/CometChatMessageList.js.map +1 -1
- package/lib/extensions/Stickers/StickersExtensionDecorator.d.ts +1 -2
- package/lib/extensions/Stickers/StickersExtensionDecorator.js +1 -2
- package/lib/extensions/Stickers/StickersExtensionDecorator.js.map +1 -1
- package/lib/shared/CometChatUiKit/CometChatUIKit.d.ts +2 -1
- package/lib/shared/CometChatUiKit/CometChatUIKit.js +2 -1
- package/lib/shared/CometChatUiKit/CometChatUIKit.js.map +1 -1
- package/lib/shared/index.d.ts +15 -13
- package/lib/shared/index.js +30 -12
- package/lib/shared/index.js.map +1 -1
- package/lib/shared/utils/CometChatMessagePreview/CometChatMessagePreview.d.ts +10 -1
- package/lib/shared/utils/CometChatMessagePreview/CometChatMessagePreview.js +8 -0
- package/lib/shared/utils/CometChatMessagePreview/CometChatMessagePreview.js.map +1 -1
- package/lib/shared/utils/CometChatMessagePreview/MessagePreviewStyle.d.ts +29 -0
- package/lib/shared/utils/CometChatMessagePreview/MessagePreviewStyle.js +29 -0
- package/lib/shared/utils/CometChatMessagePreview/MessagePreviewStyle.js.map +1 -0
- package/lib/shared/utils/CometChatMessagePreview/index.d.ts +2 -1
- package/lib/shared/utils/CometChatMessagePreview/index.js +3 -1
- package/lib/shared/utils/CometChatMessagePreview/index.js.map +1 -1
- package/lib/shared/utils/CometChatMessagePreview/style.d.ts +16 -16
- package/lib/shared/utils/MessageUtils.js +11 -10
- package/lib/shared/utils/MessageUtils.js.map +1 -1
- package/lib/shared/utils/index.d.ts +2 -2
- package/lib/shared/utils/index.js +2 -2
- package/lib/shared/utils/index.js.map +1 -1
- package/lib/theme/context.js +1 -1
- package/lib/theme/context.js.map +1 -1
- package/lib/theme/default/index.d.ts +6 -0
- package/lib/theme/default/index.js +178 -0
- package/lib/theme/default/index.js.map +1 -1
- package/lib/theme/provider.js +1 -1
- package/lib/theme/provider.js.map +1 -1
- package/package.json +6 -4
- package/react-native-cometchat-ui-kit.podspec +1 -1
- package/src/CometChatConversations/CometChatConversations.tsx +34 -29
- package/src/CometChatConversations/style.ts +5 -2
- package/src/CometChatGroupMembers/CometChatGroupMembers.tsx +56 -44
- package/src/CometChatGroups/CometChatGroups.tsx +13 -10
- package/src/CometChatMessageComposer/CometChatMessageComposer.tsx +203 -57
- package/src/CometChatMessageComposer/styles.tsx +2 -6
- package/src/CometChatMessageHeader/CometChatMessageHeader.tsx +8 -48
- package/src/CometChatMessageInformation/CometChatMessageInformation.tsx +8 -14
- package/src/CometChatMessageList/CometChatMessageList.tsx +18 -10
- package/src/CometChatMessageList/style.ts +0 -16
- package/src/CometChatThreadHeader/CometChatThreadHeader.tsx +3 -2
- package/src/CometChatUsers/CometChatUsers.tsx +9 -8
- package/src/calls/CallUtils.ts +14 -14
- package/src/calls/CallingExtensionDecorator.tsx +13 -12
- package/src/calls/CometChatCallBubble/CometChatCallBubble.tsx +4 -3
- package/src/calls/CometChatCallLogs/CometChatCallLogs.tsx +15 -12
- package/src/calls/CometChatIncomingCall/CometChatIncomingCall.tsx +8 -6
- package/src/calls/CometChatOutgoingCall/CometChatOutgoingCall.tsx +4 -2
- package/src/extensions/CollaborativeDocument/CollaborativeDocumentExtensionDecorator.tsx +7 -6
- package/src/extensions/CollaborativeWhiteboard/CollaborativeWhiteboardExtensionDecorator.tsx +7 -6
- package/src/extensions/LinkPreview/LinkPreviewBubble.tsx +3 -2
- package/src/extensions/MessageTranslation/MessageTranslationBubble.tsx +3 -2
- package/src/extensions/MessageTranslation/MessageTranslationDecorator.tsx +26 -17
- package/src/extensions/Polls/Polls.tsx +53 -17
- package/src/extensions/Polls/PollsDecorator.tsx +5 -3
- package/src/extensions/Stickers/CometChatStickerKeyboard/CometChatStickerKeyboard.tsx +5 -4
- package/src/extensions/Stickers/CometChatStickerKeyboard/hooks.ts +3 -2
- package/src/extensions/Stickers/StickersExtensionDecorator.tsx +5 -2
- package/src/index.ts +10 -4
- package/src/shared/CometChatUiKit/CometChatUIKit.ts +1 -2
- package/src/shared/formatters/CometChatMentionsFormatter/CometChatMentionsFormatter.tsx +116 -32
- package/src/shared/framework/DataSource.ts +5 -2
- package/src/shared/framework/DataSourceDecorator.tsx +4 -4
- package/src/shared/framework/MessageDataSource.tsx +178 -46
- package/src/shared/helper/LocalizedDateHelper.ts +317 -0
- package/src/shared/helper/functions.js +69 -1
- package/src/shared/helper/useLocalizedDateHook.tsx +16 -0
- package/src/shared/index.ts +7 -2
- package/src/shared/resources/CometChatLocalizeNew/CometChatI18nProvider.tsx +106 -0
- package/src/shared/resources/CometChatLocalizeNew/CometChatLocalizationHelper.ts +99 -0
- package/src/shared/resources/CometChatLocalizeNew/CometChatLocalizeContext.tsx +15 -0
- package/src/shared/resources/CometChatLocalizeNew/LocalizationManager.ts +65 -0
- package/src/shared/resources/CometChatLocalizeNew/index.ts +25 -0
- package/src/shared/resources/{CometChatLocalize → CometChatLocalizeNew}/resources/de/translation.json +10 -1
- package/src/shared/resources/{CometChatLocalize → CometChatLocalizeNew}/resources/en/translation.json +10 -1
- package/src/shared/resources/{CometChatLocalize → CometChatLocalizeNew}/resources/es/translation.json +10 -1
- package/src/shared/resources/{CometChatLocalize → CometChatLocalizeNew}/resources/fr/translation.json +10 -1
- package/src/shared/resources/{CometChatLocalize → CometChatLocalizeNew}/resources/hi/translation.json +11 -1
- package/src/shared/resources/{CometChatLocalize → CometChatLocalizeNew}/resources/hu/translation.json +10 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/it/translation.json +456 -0
- package/src/shared/resources/CometChatLocalizeNew/resources/ja/translation.json +456 -0
- package/src/shared/resources/CometChatLocalizeNew/resources/ko/translation.json +456 -0
- package/src/shared/resources/{CometChatLocalize → CometChatLocalizeNew}/resources/lt/translation.json +10 -1
- package/src/shared/resources/{CometChatLocalize → CometChatLocalizeNew}/resources/ms/translation.json +10 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/nl/translation.json +456 -0
- package/src/shared/resources/{CometChatLocalize → CometChatLocalizeNew}/resources/pt/translation.json +10 -1
- package/src/shared/resources/{CometChatLocalize → CometChatLocalizeNew}/resources/ru/translation.json +10 -1
- package/src/shared/resources/{CometChatLocalize → CometChatLocalizeNew}/resources/sv/translation.json +11 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/tr/translation.json +456 -0
- package/src/shared/resources/{CometChatLocalize → CometChatLocalizeNew}/resources/zh/translation.json +11 -1
- package/src/shared/resources/{CometChatLocalize → CometChatLocalizeNew}/resources/zh-tw/translation.json +10 -1
- package/src/shared/resources/CometChatLocalizeNew/type.ts +7 -0
- package/src/shared/resources/CometChatLocalizeNew/useCometChatTranslationHook.ts +24 -0
- package/src/shared/resources/index.ts +2 -2
- package/src/shared/utils/CommonUtils.ts +2 -1
- package/src/shared/utils/PermissionUtil.ts +5 -4
- package/src/shared/utils/conversationUtils.ts +11 -9
- package/src/shared/views/CometChatAudioBubble/CometChatAudioBubble.tsx +8 -5
- package/src/shared/views/CometChatBottomSheet/CometChatBottomSheet.tsx +1 -1
- package/src/shared/views/CometChatDate/CometChatDate.tsx +17 -14
- package/src/shared/views/CometChatDateSeperator/CometChatDateSeparator.tsx +6 -4
- package/src/shared/views/CometChatDeletedBubble/CometChatDeletedBubble.tsx +3 -2
- package/src/shared/views/CometChatEmojiKeyboard/emojis.ts +11 -8
- package/src/shared/views/CometChatList/CometChatList.tsx +5 -4
- package/src/shared/views/CometChatMediaRecorder/CometChatAudioPreview/CometChatAudioPreview.tsx +15 -9
- package/src/shared/views/CometChatMediaRecorder/CometChatMediaRecorder.tsx +5 -4
- package/src/shared/views/CometChatMessageInput/CometChatMessageInput.tsx +3 -2
- package/src/shared/views/CometChatReactionList/CometChatReactionList.tsx +7 -6
- package/src/shared/views/CometChatTextBubble/CometChatTextBubble.tsx +10 -7
- package/src/shared/views/CometChatTooltipMenu/CometChatTooltipMenu.tsx +1 -0
- package/src/shared/views/CometChatVideoBubble/CometChatVideoBubble.tsx +24 -47
- package/src/shared/views/CometChatVideoPlayer/CometChatVideoPlayer.tsx +68 -73
- package/src/theme/type.ts +0 -2
- package/lib/theme/default/default.d.ts +0 -6
- package/lib/theme/default/default.js +0 -179
- package/lib/theme/default/default.js.map +0 -1
- package/src/shared/resources/CometChatLocalize/CometChatLocalize.ts +0 -183
- package/src/shared/resources/CometChatLocalize/index.ts +0 -3
- package/src/shared/resources/CometChatLocalize/resources/ar/translation.json +0 -447
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/shared/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/shared/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACzF,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,qBAAqB,EACrB,mBAAmB,GACpB,CAAC"}
|
package/lib/theme/context.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createContext } from "react";
|
|
2
|
-
import { defaultDarkTheme, defaultLightTheme } from "./default
|
|
2
|
+
import { defaultDarkTheme, defaultLightTheme } from "./default";
|
|
3
3
|
export const themeProviderDefaultValue = {
|
|
4
4
|
dark: defaultDarkTheme,
|
|
5
5
|
light: defaultLightTheme,
|
package/lib/theme/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/theme/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/theme/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAShE,MAAM,CAAC,MAAM,yBAAyB,GAAuB;IAC3D,IAAI,EAAE,gBAAgB;IACtB,KAAK,EAAE,iBAAiB;IACxB,IAAI,EAAE,MAAM;CACb,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAqB,yBAAyB,CAAC,CAAC;AAEzF,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAA2C,EAAS,CAAC,CAAC"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import { CometChatTheme } from "../type";
|
|
2
|
+
import { DeepPartial } from "../../shared/helper/types";
|
|
3
|
+
export declare const lightThemeMaker: (spacing: CometChatTheme["spacing"], color: CometChatTheme["color"], typography: CometChatTheme["typography"]) => DeepPartial<CometChatTheme>;
|
|
4
|
+
export declare const darkThemeMaker: (spacing: CometChatTheme["spacing"], color: CometChatTheme["color"], typography: CometChatTheme["typography"]) => DeepPartial<CometChatTheme>;
|
|
5
|
+
export declare const defaultLightTheme: DeepPartial<CometChatTheme>;
|
|
6
|
+
export declare const defaultDarkTheme: DeepPartial<CometChatTheme>;
|
|
1
7
|
export * from "./color/dark";
|
|
2
8
|
export * from "./color/light";
|
|
3
9
|
export * from "./spacing";
|
|
@@ -1,3 +1,181 @@
|
|
|
1
|
+
import { getCallButtonStyle } from "../../calls/CometChatCallButtons/style";
|
|
2
|
+
import { getCallLogsItemStyle, getCallLogsStyleLight, getCallLogsStyleDark } from "../../calls/CometChatCallLogs/style";
|
|
3
|
+
import { getIncomingCallStyle } from "../../calls/CometChatIncomingCall/style";
|
|
4
|
+
import { getOutgoingCallStyle } from "../../calls/CometChatOutgoingCall";
|
|
5
|
+
import { getConversationStyleDark, getConversationStyleLight, } from "../../CometChatConversations/style";
|
|
6
|
+
import { getGroupMemberStyleDark, getGroupMemberStyleLight, } from "../../CometChatGroupMembers/style";
|
|
7
|
+
import { getGroupListStyleLight, getUserGroupStyleDark } from "../../CometChatGroups/GroupsStyle";
|
|
8
|
+
import { getComposerStyle } from "../../CometChatMessageComposer/styles";
|
|
9
|
+
import { getMessageHeaderStyle } from "../../CometChatMessageHeader/styles";
|
|
10
|
+
import { getMessageInormationListStyleDark, getMessageInormationListStyleLight, } from "../../CometChatMessageInformation/styles";
|
|
11
|
+
import { getMessageListStylesDark, getMessageListStylesLight, } from "../../CometChatMessageList/style";
|
|
12
|
+
import { getThreadHeaderStyleDark, getThreadHeaderStyleLight, } from "../../CometChatThreadHeader/style";
|
|
13
|
+
import { getUserListStyleDark, getUserListStyleLight } from "../../CometChatUsers/style";
|
|
14
|
+
import { getAvatarStyle } from "../../shared/views/CometChatAvatar";
|
|
15
|
+
import { getBadgeStyle } from "../../shared/views/CometChatBadge";
|
|
16
|
+
import { getConfirmDialogStyleDark, getConfirmDialogStyleLight, } from "../../shared/views/CometChatConfirmDialog/style";
|
|
17
|
+
import { getDateStyleDark, getDateStyleLight } from "../../shared/views/CometChatDate";
|
|
18
|
+
import { getQuickReactionStyleDark, getQuickReactionStyleLight, } from "../../shared/views/CometChatQuickReactions/QuickReactionsStyle";
|
|
19
|
+
import { getReactionListStyleDark, getReactionListStyleLight, } from "../../shared/views/CometChatReactionList/ReactionListStyle";
|
|
20
|
+
import { getMessageReceiptStyle } from "../../shared/views/CometChatReceipt/style";
|
|
21
|
+
import { getStatusIndicatorStyles } from "../../shared/views/CometChatStatusIndicator/styles";
|
|
22
|
+
import { getMentionsListStyleDark, getMentionsListStyleLight, } from "../../shared/views/CometChatSuggestionList/style";
|
|
23
|
+
import { defaultColorDark } from "./color/dark";
|
|
24
|
+
import { defaultColorLight } from "./color/light";
|
|
25
|
+
import { defaultSpacing } from "./spacing";
|
|
26
|
+
import { defaultTypography } from "./typography";
|
|
27
|
+
import { getMediaRecorderStyle } from "../../shared/views/CometChatMediaRecorder/style";
|
|
28
|
+
import { getDateSeparatorStyleDark, getDateSeparatorStyleLight } from "../../shared/views/CometChatDateSeperator";
|
|
29
|
+
const getActionSheetStyle = (color, spacing, typography) => {
|
|
30
|
+
return {
|
|
31
|
+
optionsItemStyle: {
|
|
32
|
+
containerStyle: {
|
|
33
|
+
paddingVertical: spacing.padding.p3,
|
|
34
|
+
paddingHorizontal: spacing.padding.p8,
|
|
35
|
+
backgroundColor: color.background1,
|
|
36
|
+
flexDirection: "row",
|
|
37
|
+
alignItems: "center",
|
|
38
|
+
gap: 5,
|
|
39
|
+
},
|
|
40
|
+
titleStyle: {
|
|
41
|
+
...typography.body.regular,
|
|
42
|
+
color: color.textPrimary,
|
|
43
|
+
},
|
|
44
|
+
iconStyle: {
|
|
45
|
+
height: 24,
|
|
46
|
+
width: 24,
|
|
47
|
+
},
|
|
48
|
+
iconContainerStyle: {},
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
// const getAttachmentOptionsStyle = (
|
|
53
|
+
// color: CometChatTheme["color"],
|
|
54
|
+
// spacing: CometChatTheme["spacing"],
|
|
55
|
+
// typography: CometChatTheme["typography"]
|
|
56
|
+
// ): ActionSheetStyle => {
|
|
57
|
+
// return {
|
|
58
|
+
// optionsItemStyle: {
|
|
59
|
+
// containerStyle: {
|
|
60
|
+
// paddingVertical: spacing.padding.p3,
|
|
61
|
+
// paddingHorizontal: spacing.padding.p4,
|
|
62
|
+
// backgroundColor: color.background1,
|
|
63
|
+
// flexDirection: "row",
|
|
64
|
+
// alignItems: "center",
|
|
65
|
+
// gap: 5,
|
|
66
|
+
// },
|
|
67
|
+
// titleStyle: {
|
|
68
|
+
// ...typography.body.regular,
|
|
69
|
+
// color: color.textPrimary,
|
|
70
|
+
// paddingLeft: spacing.padding.p1,
|
|
71
|
+
// },
|
|
72
|
+
// iconStyle: {
|
|
73
|
+
// height: 24,
|
|
74
|
+
// width: 24,
|
|
75
|
+
// },
|
|
76
|
+
// iconContainerStyle: {},
|
|
77
|
+
// },
|
|
78
|
+
// };
|
|
79
|
+
// };
|
|
80
|
+
const getAIOptionsStyle = (color, spacing, typography) => {
|
|
81
|
+
return {
|
|
82
|
+
optionsItemStyle: {
|
|
83
|
+
containerStyle: {
|
|
84
|
+
padding: spacing.padding.p4,
|
|
85
|
+
backgroundColor: color.background1,
|
|
86
|
+
flexDirection: "row",
|
|
87
|
+
alignItems: "center",
|
|
88
|
+
gap: 5,
|
|
89
|
+
},
|
|
90
|
+
titleStyle: {
|
|
91
|
+
...typography.body.regular,
|
|
92
|
+
color: color.textPrimary,
|
|
93
|
+
paddingLeft: spacing.padding.p1,
|
|
94
|
+
},
|
|
95
|
+
iconStyle: {
|
|
96
|
+
height: 24,
|
|
97
|
+
width: 24,
|
|
98
|
+
},
|
|
99
|
+
iconContainerStyle: {},
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
export const lightThemeMaker = (spacing, color, typography) => {
|
|
104
|
+
return {
|
|
105
|
+
mode: 'light',
|
|
106
|
+
spacing: spacing,
|
|
107
|
+
color: color,
|
|
108
|
+
typography: typography,
|
|
109
|
+
avatarStyle: getAvatarStyle(color, spacing, typography),
|
|
110
|
+
receiptStyles: getMessageReceiptStyle(color, spacing, typography),
|
|
111
|
+
statusIndicatorStyle: getStatusIndicatorStyles(color, spacing, typography),
|
|
112
|
+
badgeStyle: getBadgeStyle(color, spacing, typography),
|
|
113
|
+
dateStyles: getDateStyleLight(color, spacing, typography),
|
|
114
|
+
dateSeparatorStyles: getDateSeparatorStyleLight(color, spacing, typography),
|
|
115
|
+
conversationStyles: getConversationStyleLight(color, spacing, typography),
|
|
116
|
+
confirmDialogStyles: getConfirmDialogStyleLight(color, spacing, typography),
|
|
117
|
+
messageHeaderStyles: getMessageHeaderStyle(color, spacing, typography),
|
|
118
|
+
messageComposerStyles: getComposerStyle(color, spacing, typography),
|
|
119
|
+
userStyles: getUserListStyleLight(color, spacing, typography),
|
|
120
|
+
groupStyles: getGroupListStyleLight(color, spacing, typography),
|
|
121
|
+
groupMemberStyle: getGroupMemberStyleLight(color, spacing, typography),
|
|
122
|
+
callButtonStyles: getCallButtonStyle(color, spacing, typography),
|
|
123
|
+
messageListStyles: getMessageListStylesLight(color, spacing, typography),
|
|
124
|
+
reactionListStyles: getReactionListStyleLight(color, spacing, typography),
|
|
125
|
+
messageInformationStyles: getMessageInormationListStyleLight(color, spacing, typography),
|
|
126
|
+
//messageOptionsStyles: getMessageOptionsStyle(color, spacing, typography),
|
|
127
|
+
//attachmentOptionsStyles: getAttachmentOptionsStyle(color, spacing, typography),
|
|
128
|
+
actionSheetStyle: getActionSheetStyle(color, spacing, typography),
|
|
129
|
+
mentionsListStyle: getMentionsListStyleLight(color, spacing, typography),
|
|
130
|
+
threadHeaderStyles: getThreadHeaderStyleLight(color, spacing, typography),
|
|
131
|
+
aiOptionsStyle: getAIOptionsStyle(color, spacing, typography),
|
|
132
|
+
quickReactionStyle: getQuickReactionStyleLight(color, spacing, typography),
|
|
133
|
+
outgoingCallStyle: getOutgoingCallStyle(color, spacing, typography),
|
|
134
|
+
incomingCallStyle: getIncomingCallStyle(color, spacing, typography),
|
|
135
|
+
callLogsStyles: getCallLogsStyleLight(color, spacing, typography),
|
|
136
|
+
callLogsItemStyle: getCallLogsItemStyle(color, spacing, typography),
|
|
137
|
+
mediaRecorderStyle: getMediaRecorderStyle(color, spacing, typography),
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
export const darkThemeMaker = (spacing, color, typography) => {
|
|
141
|
+
return {
|
|
142
|
+
mode: 'dark',
|
|
143
|
+
spacing: spacing,
|
|
144
|
+
color: color,
|
|
145
|
+
typography: typography,
|
|
146
|
+
avatarStyle: getAvatarStyle(color, spacing, typography),
|
|
147
|
+
receiptStyles: getMessageReceiptStyle(color, spacing, typography),
|
|
148
|
+
statusIndicatorStyle: getStatusIndicatorStyles(color, spacing, typography),
|
|
149
|
+
badgeStyle: getBadgeStyle(color, spacing, typography),
|
|
150
|
+
dateStyles: getDateStyleDark(color, spacing, typography),
|
|
151
|
+
dateSeparatorStyles: getDateSeparatorStyleDark(color, spacing, typography),
|
|
152
|
+
conversationStyles: getConversationStyleDark(color, spacing, typography),
|
|
153
|
+
confirmDialogStyles: getConfirmDialogStyleDark(color, spacing, typography),
|
|
154
|
+
messageHeaderStyles: getMessageHeaderStyle(color, spacing, typography),
|
|
155
|
+
messageComposerStyles: getComposerStyle(color, spacing, typography),
|
|
156
|
+
userStyles: getUserListStyleDark(color, spacing, typography),
|
|
157
|
+
groupMemberStyle: getGroupMemberStyleDark(color, spacing, typography),
|
|
158
|
+
groupStyles: getUserGroupStyleDark(color, spacing, typography),
|
|
159
|
+
callButtonStyles: getCallButtonStyle(color, spacing, typography),
|
|
160
|
+
messageListStyles: getMessageListStylesDark(color, spacing, typography),
|
|
161
|
+
reactionListStyles: getReactionListStyleDark(color, spacing, typography),
|
|
162
|
+
messageInformationStyles: getMessageInormationListStyleDark(color, spacing, typography),
|
|
163
|
+
//messageOptionsStyles: getMessageOptionsStyle(color, spacing, typography),
|
|
164
|
+
//attachmentOptionsStyles: getAttachmentOptionsStyle(color, spacing, typography),
|
|
165
|
+
actionSheetStyle: getActionSheetStyle(color, spacing, typography),
|
|
166
|
+
mentionsListStyle: getMentionsListStyleDark(color, spacing, typography),
|
|
167
|
+
threadHeaderStyles: getThreadHeaderStyleDark(color, spacing, typography),
|
|
168
|
+
aiOptionsStyle: getAIOptionsStyle(color, spacing, typography),
|
|
169
|
+
quickReactionStyle: getQuickReactionStyleDark(color, spacing, typography),
|
|
170
|
+
outgoingCallStyle: getOutgoingCallStyle(color, spacing, typography),
|
|
171
|
+
incomingCallStyle: getIncomingCallStyle(color, spacing, typography),
|
|
172
|
+
callLogsStyles: getCallLogsStyleDark(color, spacing, typography),
|
|
173
|
+
callLogsItemStyle: getCallLogsItemStyle(color, spacing, typography),
|
|
174
|
+
mediaRecorderStyle: getMediaRecorderStyle(color, spacing, typography),
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
export const defaultLightTheme = lightThemeMaker(defaultSpacing, defaultColorLight, defaultTypography);
|
|
178
|
+
export const defaultDarkTheme = darkThemeMaker(defaultSpacing, defaultColorDark, defaultTypography);
|
|
1
179
|
export * from "./color/dark";
|
|
2
180
|
export * from "./color/light";
|
|
3
181
|
export * from "./spacing";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/theme/default/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/theme/default/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AACxH,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAm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iB,EACjB,iBAAiB,CAClB,CAAC;AACF,MAAM,CAAC,MAAM,gBAAgB,GAAgC,cAAc,CACzE,cAAc,EACd,gBAAgB,EAChB,iBAAiB,CAClB,CAAC;AAEF,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC"}
|
package/lib/theme/provider.js
CHANGED
|
@@ -3,7 +3,7 @@ import { useColorScheme, Platform } from "react-native";
|
|
|
3
3
|
import { deepMerge } from "../shared/helper/helperFunctions";
|
|
4
4
|
import { Brightness, CometChatThemeHelper } from "./CometChatThemeHelper";
|
|
5
5
|
import { CompThemeContext, ThemeContext, } from "./context";
|
|
6
|
-
import { darkThemeMaker, lightThemeMaker } from "./default
|
|
6
|
+
import { darkThemeMaker, lightThemeMaker } from "./default";
|
|
7
7
|
import { useThemeInternal } from "./hook";
|
|
8
8
|
function useDebounce(value, delay) {
|
|
9
9
|
const [debouncedValue, setDebouncedValue] = useState(value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src/theme/provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,OAAO,EACP,QAAQ,EACR,SAAS,GACV,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAE7D,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EACL,gBAAgB,EAChB,YAAY,GAEb,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src/theme/provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,OAAO,EACP,QAAQ,EACR,SAAS,GACV,MAAM,OAAO,CAAC;AAC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CAC7B,CAAC;AACJ,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cometchat/chat-uikit-react-native",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "Ready-to-use Chat UI Components for React Native",
|
|
5
5
|
"main": "src/index",
|
|
6
6
|
"module": "src/index",
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
"Uikit",
|
|
40
40
|
"SDK"
|
|
41
41
|
],
|
|
42
|
-
"repository": "https://github.com/cometchat
|
|
42
|
+
"repository": "https://github.com/cometchat/cometchat-uikit-react-native",
|
|
43
43
|
"author": "Inscripts",
|
|
44
44
|
"license": "https://www.cometchat.com/legal-terms-of-service",
|
|
45
45
|
"bugs": {
|
|
46
|
-
"url": "https://github.com/cometchat
|
|
46
|
+
"url": "https://github.com/cometchat/cometchat-uikit-react-native/issues"
|
|
47
47
|
},
|
|
48
48
|
"homepage": "https://www.cometchat.com",
|
|
49
49
|
"publishConfig": {
|
|
@@ -66,7 +66,9 @@
|
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"@types/prop-types": "^15.7.14",
|
|
69
|
-
"
|
|
69
|
+
"dayjs": "^1.11.18",
|
|
70
|
+
"prop-types": "^15.8.1",
|
|
71
|
+
"react-native-localize": "^3.5.2"
|
|
70
72
|
},
|
|
71
73
|
"peerDependencies": {
|
|
72
74
|
"@cometchat/chat-sdk-react-native": "*",
|
|
@@ -13,7 +13,7 @@ Pod::Spec.new do |s|
|
|
|
13
13
|
s.authors = package["author"].is_a?(Hash) ? [package["author"]] : package["author"]
|
|
14
14
|
|
|
15
15
|
s.platforms = { :ios => "11.0" }
|
|
16
|
-
s.source = { :git => "https://github.com/cometchat
|
|
16
|
+
s.source = { :git => "https://github.com/cometchat/cometchat-uikit-react-native.git", :tag => "#{s.version}" }
|
|
17
17
|
|
|
18
18
|
s.source_files = "ios/**/*.{h,m,mm}"
|
|
19
19
|
|
|
@@ -25,7 +25,6 @@ import {
|
|
|
25
25
|
CometChatUIKit,
|
|
26
26
|
CometChatUiKitConstants,
|
|
27
27
|
CometChatUrlsFormatter,
|
|
28
|
-
localize,
|
|
29
28
|
} from "../shared";
|
|
30
29
|
import { SelectionMode } from "../shared/base/Types";
|
|
31
30
|
import {
|
|
@@ -56,6 +55,7 @@ import { DeepPartial } from "../shared/helper/types";
|
|
|
56
55
|
import { CometChatTheme } from "../theme/type";
|
|
57
56
|
import { MenuItemInterface } from "../shared/views/CometChatTooltipMenu/CometChatTooltipMenu";
|
|
58
57
|
import { JSX } from "react";
|
|
58
|
+
import { useCometChatTranslation } from "../shared/resources/CometChatLocalizeNew";
|
|
59
59
|
|
|
60
60
|
// Unique listener IDs for conversation, user, group, message and call events.
|
|
61
61
|
const conversationListenerId = "chatlist_" + new Date().getTime();
|
|
@@ -291,6 +291,7 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
291
291
|
|
|
292
292
|
// Merge theme styles with provided style overrides.
|
|
293
293
|
const theme = useTheme();
|
|
294
|
+
const {t}=useCometChatTranslation()
|
|
294
295
|
const mergedStyles = useMemo(() => {
|
|
295
296
|
return deepMerge(theme.conversationStyles, style ?? {});
|
|
296
297
|
}, [theme.conversationStyles, style]);
|
|
@@ -301,9 +302,9 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
301
302
|
const ErrorStateView = useCallback(() => {
|
|
302
303
|
return (
|
|
303
304
|
<ErrorEmptyView
|
|
304
|
-
title={
|
|
305
|
-
subTitle={
|
|
306
|
-
tertiaryTitle={
|
|
305
|
+
title={t("OOPS")}
|
|
306
|
+
subTitle={t("SOMETHING_WENT_WRONG")}
|
|
307
|
+
tertiaryTitle={t("WRONG_TEXT_TRY_AGAIN")}
|
|
307
308
|
Icon={
|
|
308
309
|
<Icon
|
|
309
310
|
name='error-state'
|
|
@@ -329,8 +330,8 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
329
330
|
const EmptyStateView = useCallback(() => {
|
|
330
331
|
return (
|
|
331
332
|
<ErrorEmptyView
|
|
332
|
-
title=
|
|
333
|
-
subTitle=
|
|
333
|
+
title={t("NO_CONVERSATIONS")}
|
|
334
|
+
subTitle={t("CONVERSATIONS_EMPTY_MESSAGE")}
|
|
334
335
|
Icon={
|
|
335
336
|
<Icon
|
|
336
337
|
name='empty-state'
|
|
@@ -408,8 +409,8 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
408
409
|
if (isTyping && !newConversation?.["lastMessage"]?.["typing"]) {
|
|
409
410
|
newConversation["lastMessage"]["typing"] =
|
|
410
411
|
args[0]?.receiverType === "group"
|
|
411
|
-
? `${args[0].sender.name} ${
|
|
412
|
-
:
|
|
412
|
+
? `${args[0].sender.name} ${t("IS_TYPING")}`
|
|
413
|
+
: t("IS_TYPING");
|
|
413
414
|
} else {
|
|
414
415
|
delete newConversation["lastMessage"]["typing"];
|
|
415
416
|
}
|
|
@@ -764,7 +765,7 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
764
765
|
.substr(0, 50)
|
|
765
766
|
.match(/http[s]{0,1}:\/\//)
|
|
766
767
|
) {
|
|
767
|
-
messageText = getMessagePreviewInternal("link-fill",
|
|
768
|
+
messageText = getMessagePreviewInternal("link-fill", t("LINK"), { theme });
|
|
768
769
|
} else {
|
|
769
770
|
// Ensure ellipsis is applied if the text is too long.
|
|
770
771
|
messageText = (
|
|
@@ -783,7 +784,7 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
783
784
|
if (!(lastMessage instanceof CometChat.Action)) {
|
|
784
785
|
if (lastMessage.getReceiverType() == ReceiverTypeConstants.group) {
|
|
785
786
|
if (lastMessage.getSender().getUid() == loggedInUserId) {
|
|
786
|
-
groupText =
|
|
787
|
+
groupText = t("YOU") + ": ";
|
|
787
788
|
} else {
|
|
788
789
|
groupText = lastMessage.getSender().getName() + ": ";
|
|
789
790
|
}
|
|
@@ -818,6 +819,7 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
818
819
|
|
|
819
820
|
if (message.getMentionedUsers().length) {
|
|
820
821
|
let mentionsFormatter = ChatConfigurator.getDataSource().getMentionsFormatter();
|
|
822
|
+
mentionsFormatter.setContext('conversation');
|
|
821
823
|
mentionsFormatter.setLoggedInUser(CometChatUIKit.loggedInUser!);
|
|
822
824
|
mentionsFormatter.setMentionsStyle(mergedStyles.mentionsStyles);
|
|
823
825
|
mentionsFormatter.setTargetElement(MentionsTargetElement.conversation);
|
|
@@ -871,7 +873,7 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
871
873
|
numberOfLines={1}
|
|
872
874
|
ellipsizeMode={"tail"}
|
|
873
875
|
>
|
|
874
|
-
{
|
|
876
|
+
{t("TAP_TO_START_CONVERSATION")}
|
|
875
877
|
</Text>
|
|
876
878
|
);
|
|
877
879
|
let readReceipt;
|
|
@@ -951,7 +953,7 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
951
953
|
<CometChatDate
|
|
952
954
|
timeStamp={timestamp * 1000}
|
|
953
955
|
customDateString={customPattern && customPattern()}
|
|
954
|
-
pattern={"
|
|
956
|
+
pattern={"conversationDate"}
|
|
955
957
|
style={mergedStyles?.itemStyle?.dateStyle}
|
|
956
958
|
/>
|
|
957
959
|
<CometChatBadge
|
|
@@ -1363,24 +1365,27 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
1363
1365
|
CometChatUIEventHandler.addUserListener(userListenerId, {
|
|
1364
1366
|
ccUserBlocked: ({ user }: { user: CometChat.User }) => {
|
|
1365
1367
|
const uid = user.getUid();
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
)
|
|
1368
|
+
const loggedInUid = loggedInUser.current?.getUid();
|
|
1369
|
+
if (!loggedInUid) return;
|
|
1370
|
+
|
|
1371
|
+
const candidateIds = [`${uid}_user_${loggedInUid}`, `${loggedInUid}_user_${uid}`];
|
|
1372
|
+
|
|
1373
|
+
const item: CometChat.Conversation | undefined = candidateIds
|
|
1374
|
+
.map((id) => conversationListRef.current?.getListItem(id))
|
|
1375
|
+
.find(Boolean);
|
|
1376
|
+
|
|
1377
|
+
if (!item) return;
|
|
1378
|
+
|
|
1373
1379
|
if (
|
|
1374
1380
|
conversationsRequestBuilder &&
|
|
1375
1381
|
conversationsRequestBuilder.build().isIncludeBlockedUsers()
|
|
1376
1382
|
) {
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
conversationListRef.current?.updateList(updatedConversation);
|
|
1381
|
-
}
|
|
1383
|
+
const updatedConversation = CommonUtils.clone(item);
|
|
1384
|
+
updatedConversation.setConversationWith(user);
|
|
1385
|
+
conversationListRef.current?.updateList(updatedConversation);
|
|
1382
1386
|
return;
|
|
1383
1387
|
}
|
|
1388
|
+
|
|
1384
1389
|
conversationListRef?.current?.removeItemFromList(item.getConversationId());
|
|
1385
1390
|
removeItemFromSelectionList(item.getConversationId());
|
|
1386
1391
|
},
|
|
@@ -1575,11 +1580,11 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
1575
1580
|
}
|
|
1576
1581
|
/>
|
|
1577
1582
|
<CometChatConfirmDialog
|
|
1578
|
-
titleText={
|
|
1583
|
+
titleText={t("DELETE_THIS_CONVERSATION")}
|
|
1579
1584
|
icon={<Icon name='delete' size={theme.spacing.spacing.s12} color={theme.color.error} />}
|
|
1580
|
-
cancelButtonText={
|
|
1581
|
-
confirmButtonText={
|
|
1582
|
-
messageText={
|
|
1585
|
+
cancelButtonText={t("CANCEL")}
|
|
1586
|
+
confirmButtonText={t("DELETE")}
|
|
1587
|
+
messageText={t("SURE_TO_DELETE_CHAT")}
|
|
1583
1588
|
isOpen={confirmDelete != undefined}
|
|
1584
1589
|
onCancel={() => setConfirmDelete(undefined)}
|
|
1585
1590
|
onConfirm={() => {
|
|
@@ -1600,7 +1605,7 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
1600
1605
|
conversationsRequestBuilder || new CometChat.ConversationsRequestBuilder().setLimit(30)
|
|
1601
1606
|
}
|
|
1602
1607
|
hideStickyHeader={true}
|
|
1603
|
-
title={
|
|
1608
|
+
title={t("CHATS")}
|
|
1604
1609
|
listStyle={mergedStyles}
|
|
1605
1610
|
hideSearch={true}
|
|
1606
1611
|
hideSubmitButton={hideSubmitButton}
|
|
@@ -39,7 +39,10 @@ export const Style = StyleSheet.create({
|
|
|
39
39
|
},
|
|
40
40
|
});
|
|
41
41
|
|
|
42
|
-
export type ConversationStyle = Omit<
|
|
42
|
+
export type ConversationStyle = Omit<
|
|
43
|
+
CometChatListStylesInterface,
|
|
44
|
+
"searchStyle" | "sectionHeaderTextStyle"
|
|
45
|
+
> & {
|
|
43
46
|
containerStyle: ViewStyle;
|
|
44
47
|
statusIndicatorStyles?: StatusIndicatorStyles;
|
|
45
48
|
typingIndicatorStyle: TextStyle;
|
|
@@ -78,7 +81,7 @@ export type ConversationStyle = Omit<CometChatListStylesInterface, "searchStyle"
|
|
|
78
81
|
};
|
|
79
82
|
mentionsStyles: CometChatTheme["mentionsStyle"];
|
|
80
83
|
headerContainerStyle?: ViewStyle;
|
|
81
|
-
confirmDialogStyle: DeepPartial<ConfirmDialogStyle
|
|
84
|
+
confirmDialogStyle: DeepPartial<ConfirmDialogStyle>;
|
|
82
85
|
};
|
|
83
86
|
|
|
84
87
|
export const getConversationStyleLight = (
|