@cometchat/chat-uikit-react-native 5.3.3 → 5.3.4
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/CometChatWebView.java +9 -0
- package/ios/WebViewManager.m +13 -2
- package/package.json +1 -1
- package/src/CometChatMessageComposer/CometChatMessageComposer.tsx +1 -1
- package/src/CometChatMessageList/CometChatMessageList.tsx +13 -5
- package/src/shared/resources/CometChatLocalizeNew/resources/de/translation.json +2 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/en/translation.json +2 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/es/translation.json +2 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/fr/translation.json +2 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/hi/translation.json +2 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/hu/translation.json +2 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/it/translation.json +2 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/ja/translation.json +2 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/ko/translation.json +2 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/lt/translation.json +2 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/ms/translation.json +2 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/nl/translation.json +2 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/pt/translation.json +2 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/ru/translation.json +2 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/sv/translation.json +2 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/tr/translation.json +2 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/zh/translation.json +2 -1
- package/src/shared/resources/CometChatLocalizeNew/resources/zh-tw/translation.json +2 -1
- package/src/shared/utils/MarkdownUtils.ts +2 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
package com.reactnativecometchatuikit;
|
|
2
2
|
|
|
3
|
+
import android.os.Build;
|
|
3
4
|
import android.os.Bundle;
|
|
4
5
|
import android.util.Log;
|
|
5
6
|
import android.view.ViewGroup;
|
|
@@ -15,8 +16,16 @@ public class CometChatWebView extends AppCompatActivity {
|
|
|
15
16
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
16
17
|
super.onCreate(savedInstanceState);
|
|
17
18
|
getSupportActionBar().hide();
|
|
19
|
+
|
|
20
|
+
// On API 30+ the default changed to edge-to-edge; restore classic behavior
|
|
21
|
+
// so the layout respects system bar insets (status bar, navigation bar).
|
|
22
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
|
23
|
+
getWindow().setDecorFitsSystemWindows(true);
|
|
24
|
+
}
|
|
25
|
+
|
|
18
26
|
String urlToLoad = getIntent().getStringExtra("load_url");
|
|
19
27
|
RelativeLayout layout = new RelativeLayout(this);
|
|
28
|
+
layout.setFitsSystemWindows(true);
|
|
20
29
|
layout.setLayoutParams(new RelativeLayout.LayoutParams(
|
|
21
30
|
ViewGroup.LayoutParams.MATCH_PARENT,
|
|
22
31
|
ViewGroup.LayoutParams.MATCH_PARENT
|
package/ios/WebViewManager.m
CHANGED
|
@@ -13,14 +13,25 @@ RCT_EXPORT_METHOD(openUrl: (NSString *) url) {
|
|
|
13
13
|
|
|
14
14
|
// Create a web view controller
|
|
15
15
|
UIViewController *webViewController = [[UIViewController alloc] init];
|
|
16
|
+
webViewController.view.backgroundColor = [UIColor whiteColor];
|
|
16
17
|
|
|
17
|
-
// Create a web view
|
|
18
|
-
WKWebView *webView = [[WKWebView alloc] initWithFrame:
|
|
18
|
+
// Create a web view with CGRectZero — Auto Layout will size it
|
|
19
|
+
WKWebView *webView = [[WKWebView alloc] initWithFrame:CGRectZero];
|
|
20
|
+
webView.translatesAutoresizingMaskIntoConstraints = NO;
|
|
19
21
|
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
|
|
20
22
|
|
|
21
23
|
// Add the web view to the view controller's view
|
|
22
24
|
[webViewController.view addSubview:webView];
|
|
23
25
|
|
|
26
|
+
// Constrain to safe area layout guide so content respects notch and home indicator
|
|
27
|
+
UILayoutGuide *safeArea = webViewController.view.safeAreaLayoutGuide;
|
|
28
|
+
[NSLayoutConstraint activateConstraints:@[
|
|
29
|
+
[webView.topAnchor constraintEqualToAnchor:safeArea.topAnchor],
|
|
30
|
+
[webView.bottomAnchor constraintEqualToAnchor:safeArea.bottomAnchor],
|
|
31
|
+
[webView.leadingAnchor constraintEqualToAnchor:safeArea.leadingAnchor],
|
|
32
|
+
[webView.trailingAnchor constraintEqualToAnchor:safeArea.trailingAnchor]
|
|
33
|
+
]];
|
|
34
|
+
|
|
24
35
|
// Present the web view controller
|
|
25
36
|
UIViewController *rootViewController = [UIApplication sharedApplication].delegate.window.rootViewController;
|
|
26
37
|
[rootViewController presentViewController:webViewController animated:YES completion:^{
|
package/package.json
CHANGED
|
@@ -1274,7 +1274,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1274
1274
|
iconStyle={mergedComposerStyle.attachmentIconStyle as ImageStyle}
|
|
1275
1275
|
/>
|
|
1276
1276
|
);
|
|
1277
|
-
}, [mergedComposerStyle]);
|
|
1277
|
+
}, [mergedComposerStyle, actionSheetItems, hideAttachmentButton]);
|
|
1278
1278
|
|
|
1279
1279
|
const RecordAudioButtonView = ({
|
|
1280
1280
|
icon,
|
|
@@ -3431,9 +3431,11 @@ export const CometChatMessageList = memo(
|
|
|
3431
3431
|
};
|
|
3432
3432
|
|
|
3433
3433
|
const shareMedia = async (messageObject: CometChat.MediaMessage | any) => {
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
let
|
|
3434
|
+
// Strip markdown/HTML from raw text BEFORE mention replacement,
|
|
3435
|
+
// because getPlainString can break HTML tags (e.g., </u> becomes /u>)
|
|
3436
|
+
let rawText = messageObject?.getData()["text"] || "";
|
|
3437
|
+
let strippedText = stripMarkdown(rawText);
|
|
3438
|
+
let textMessage = getPlainString(strippedText, messageObject);
|
|
3437
3439
|
let fileUrl = messageObject.getData()["url"];
|
|
3438
3440
|
|
|
3439
3441
|
const getFileName = () => {
|
|
@@ -3452,8 +3454,14 @@ export const CometChatMessageList = memo(
|
|
|
3452
3454
|
: (messageObject as CometChat.MediaMessage)?.getAttachment()?.getMimeType(), // get Mime Type
|
|
3453
3455
|
};
|
|
3454
3456
|
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
+
// Dismiss message options modal before presenting native share sheet
|
|
3458
|
+
// to prevent screen freeze when share sheet is dismissed on iOS (Fabric).
|
|
3459
|
+
// Use setTimeout with enough delay for the modal dismiss animation to complete.
|
|
3460
|
+
setShowMessageOptions([]);
|
|
3461
|
+
setTimeout(() => {
|
|
3462
|
+
NativeModules.FileManager.shareMessage(shareObj, (callback: any) => {
|
|
3463
|
+
});
|
|
3464
|
+
}, 600);
|
|
3457
3465
|
};
|
|
3458
3466
|
|
|
3459
3467
|
const openOptionsForMessage = useCallback(
|
|
@@ -509,5 +509,6 @@
|
|
|
509
509
|
"SEARCH_NO_MESSAGES": "No messages",
|
|
510
510
|
"MESSAGE_REPORTED": "Message reported",
|
|
511
511
|
"MARK_AS_UNREAD": "Mark Unread",
|
|
512
|
-
"NEW": "New"
|
|
512
|
+
"NEW": "New",
|
|
513
|
+
"GROUP_NO_LONGER_MEMBER": "You can't send message to this group because you're no longer a member."
|
|
513
514
|
}
|
|
@@ -509,5 +509,6 @@
|
|
|
509
509
|
"EDIT_LINK": "Редактировать ссылку",
|
|
510
510
|
"LINK_TEXT": "Текст ссылки",
|
|
511
511
|
"URL": "URL",
|
|
512
|
-
"INSERT": "Вставить"
|
|
512
|
+
"INSERT": "Вставить",
|
|
513
|
+
"GROUP_NO_LONGER_MEMBER": "Вы не можете отправить сообщение в эту группу, так как вы больше не являетесь участником."
|
|
513
514
|
}
|
|
@@ -61,8 +61,9 @@ export function stripMarkdown(text: string): string {
|
|
|
61
61
|
result = result.replace(/^\d+\.\s/gm, '');
|
|
62
62
|
|
|
63
63
|
// 10. Strip HTML tags (e.g., <u>, <b>, <i>, <s>, <em>, <strong>, <del>, <br>, etc.)
|
|
64
|
+
// Preserve CometChat mention tokens <@uid:xxx> and <@all:xxx> which look like HTML tags
|
|
64
65
|
result = result.replace(/<br\s*\/?>/gi, '\n');
|
|
65
|
-
result = result.replace(/<[^>]+>/g, '');
|
|
66
|
+
result = result.replace(/<(?!@(?:uid|all):)[^>]+>/g, '');
|
|
66
67
|
|
|
67
68
|
// 11. Remove any remaining backslash escapes (e.g., \* \_ \` \~)
|
|
68
69
|
result = result.replace(/\\([*_`~>\\])/g, '$1');
|