@droppii-org/chat-mobile 0.2.14 → 0.2.16
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/lib/module/components/ThreadCard/ThreadCard.js +2 -1
- package/lib/module/components/ThreadCard/ThreadCard.js.map +1 -1
- package/lib/module/components/messages/imageMessage/index.js.map +1 -1
- package/lib/module/hooks/useImageAttachment.js +34 -63
- package/lib/module/hooks/useImageAttachment.js.map +1 -1
- package/lib/module/hooks/useLinkPreview/useFetchUrlMetadata.js +3 -2
- package/lib/module/hooks/useLinkPreview/useFetchUrlMetadata.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/screens/MediaView/index.js +1 -1
- package/lib/module/screens/chat-detail/ChatComposer.js +10 -3
- package/lib/module/screens/chat-detail/ChatComposer.js.map +1 -1
- package/lib/module/screens/chat-detail/hooks/useAttachmentSendHandler.js +66 -25
- package/lib/module/screens/chat-detail/hooks/useAttachmentSendHandler.js.map +1 -1
- package/lib/module/services/attachmentHandlers/imageAttachmentHandler.js +6 -3
- package/lib/module/services/attachmentHandlers/imageAttachmentHandler.js.map +1 -1
- package/lib/module/services/auth.js +69 -0
- package/lib/module/services/auth.js.map +1 -1
- package/lib/module/services/imageUpload.js +84 -58
- package/lib/module/services/imageUpload.js.map +1 -1
- package/lib/module/utils/chatImageDimens.js +18 -1
- package/lib/module/utils/chatImageDimens.js.map +1 -1
- package/lib/module/utils/dateTimeUtils.js +44 -0
- package/lib/module/utils/dateTimeUtils.js.map +1 -0
- package/lib/module/utils/device.js +2 -1
- package/lib/module/utils/device.js.map +1 -1
- package/lib/module/utils/imageUtils.js +4 -2
- package/lib/module/utils/imageUtils.js.map +1 -1
- package/lib/module/{components/ThreadCard/thread-card.utils.js → utils/messageUtils.js} +18 -42
- package/lib/module/utils/messageUtils.js.map +1 -0
- package/lib/module/utils/videoThumbnail.js +11 -5
- package/lib/module/utils/videoThumbnail.js.map +1 -1
- package/lib/typescript/src/components/ThreadCard/ThreadCard.d.ts.map +1 -1
- package/lib/typescript/src/components/messages/imageMessage/index.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useImageAttachment.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useLinkPreview/useFetchUrlMetadata.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatComposer.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/hooks/useAttachmentSendHandler.d.ts.map +1 -1
- package/lib/typescript/src/services/attachmentHandlers/imageAttachmentHandler.d.ts.map +1 -1
- package/lib/typescript/src/services/auth.d.ts +32 -0
- package/lib/typescript/src/services/auth.d.ts.map +1 -1
- package/lib/typescript/src/services/imageUpload.d.ts.map +1 -1
- package/lib/typescript/src/utils/chatImageDimens.d.ts +1 -0
- package/lib/typescript/src/utils/chatImageDimens.d.ts.map +1 -1
- package/lib/typescript/src/utils/dateTimeUtils.d.ts +6 -0
- package/lib/typescript/src/utils/dateTimeUtils.d.ts.map +1 -0
- package/lib/typescript/src/utils/device.d.ts.map +1 -1
- package/lib/typescript/src/utils/imageUtils.d.ts.map +1 -1
- package/lib/typescript/src/utils/messageUtils.d.ts +8 -0
- package/lib/typescript/src/utils/messageUtils.d.ts.map +1 -0
- package/lib/typescript/src/utils/videoThumbnail.d.ts +1 -0
- package/lib/typescript/src/utils/videoThumbnail.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/ThreadCard/ThreadCard.tsx +2 -1
- package/src/components/messages/imageMessage/index.tsx +0 -1
- package/src/hooks/useImageAttachment.ts +45 -70
- package/src/hooks/useLinkPreview/useFetchUrlMetadata.ts +3 -2
- package/src/index.tsx +8 -1
- package/src/screens/MediaView/index.tsx +1 -1
- package/src/screens/chat-detail/ChatComposer.tsx +9 -3
- package/src/screens/chat-detail/hooks/useAttachmentSendHandler.ts +81 -25
- package/src/services/attachmentHandlers/imageAttachmentHandler.ts +11 -1
- package/src/services/auth.ts +77 -0
- package/src/services/imageUpload.ts +116 -73
- package/src/utils/chatImageDimens.ts +21 -1
- package/src/utils/dateTimeUtils.ts +48 -0
- package/src/utils/device.ts +1 -0
- package/src/utils/imageUtils.ts +10 -2
- package/src/{components/ThreadCard/thread-card.utils.ts → utils/messageUtils.ts} +18 -56
- package/src/utils/videoThumbnail.ts +14 -3
- package/lib/module/components/ThreadCard/thread-card.utils.js.map +0 -1
- package/lib/typescript/src/components/ThreadCard/thread-card.utils.d.ts +0 -4
- package/lib/typescript/src/components/ThreadCard/thread-card.utils.d.ts.map +0 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Date and time formatting utilities
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export const formatDuration = (durationMs: number): string => {
|
|
6
|
+
// Convert milliseconds to seconds
|
|
7
|
+
const totalSeconds = Math.floor(durationMs / 1000);
|
|
8
|
+
const mins = Math.floor(totalSeconds / 60);
|
|
9
|
+
const secs = totalSeconds % 60;
|
|
10
|
+
return `${mins}:${secs.toString().padStart(2, '0')}`;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const formatTimestamp = (ts: number | string | null): string => {
|
|
14
|
+
if (!ts) return '';
|
|
15
|
+
|
|
16
|
+
try {
|
|
17
|
+
const date = new Date(ts);
|
|
18
|
+
if (isNaN(date.getTime())) return '';
|
|
19
|
+
|
|
20
|
+
const now = new Date();
|
|
21
|
+
const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
|
22
|
+
// const yesterday = new Date(today.getTime() - 24 * 60 * 60 * 1000);
|
|
23
|
+
const dateOnly = new Date(
|
|
24
|
+
date.getFullYear(),
|
|
25
|
+
date.getMonth(),
|
|
26
|
+
date.getDate()
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
// Today: show time (HH:mm)
|
|
30
|
+
if (dateOnly.getTime() === today.getTime()) {
|
|
31
|
+
const h = date.getHours().toString().padStart(2, '0');
|
|
32
|
+
const m = date.getMinutes().toString().padStart(2, '0');
|
|
33
|
+
return `${h}:${m}`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// // Yesterday: show "Hôm qua"
|
|
37
|
+
// if (dateOnly.getTime() === yesterday.getTime()) {
|
|
38
|
+
// return 'Hôm qua';
|
|
39
|
+
// }
|
|
40
|
+
|
|
41
|
+
// All previous days: show dd/mm format (no weekday)
|
|
42
|
+
const d = date.getDate().toString().padStart(2, '0');
|
|
43
|
+
const mo = (date.getMonth() + 1).toString().padStart(2, '0');
|
|
44
|
+
return `${d}/${mo}`;
|
|
45
|
+
} catch {
|
|
46
|
+
return '';
|
|
47
|
+
}
|
|
48
|
+
};
|
package/src/utils/device.ts
CHANGED
package/src/utils/imageUtils.ts
CHANGED
|
@@ -24,6 +24,8 @@ export const getMimeType = (fileName: string): string => {
|
|
|
24
24
|
jpeg: 'image/jpeg',
|
|
25
25
|
png: 'image/png',
|
|
26
26
|
webp: 'image/webp',
|
|
27
|
+
heic: 'image/heic',
|
|
28
|
+
heif: 'image/heif',
|
|
27
29
|
mp4: 'video/mp4',
|
|
28
30
|
mov: 'video/quicktime',
|
|
29
31
|
avi: 'video/x-msvideo',
|
|
@@ -63,9 +65,15 @@ export const validateImageFile = (file: ImageFile): string | null => {
|
|
|
63
65
|
return `Image too large. Max ${formatFileSize(MAX_SIZE)}`;
|
|
64
66
|
}
|
|
65
67
|
|
|
66
|
-
const validMimes = [
|
|
68
|
+
const validMimes = [
|
|
69
|
+
'image/jpeg',
|
|
70
|
+
'image/png',
|
|
71
|
+
'image/webp',
|
|
72
|
+
'image/heic',
|
|
73
|
+
'image/heif',
|
|
74
|
+
];
|
|
67
75
|
if (!validMimes.includes(file.mime)) {
|
|
68
|
-
return 'Unsupported format. Only JPEG, PNG, WebP';
|
|
76
|
+
return 'Unsupported format. Only JPEG, PNG, WebP, HEIC';
|
|
69
77
|
}
|
|
70
78
|
|
|
71
79
|
return null;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Message formatting and preview utilities
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
import { MessageType } from '@droppii/openim-rn-client-sdk';
|
|
2
|
-
import type { DMessageItem } from '
|
|
3
|
-
import { DChatMessageType } from '
|
|
6
|
+
import type { DMessageItem } from '../types/chat';
|
|
7
|
+
import { DChatMessageType } from '../types/message';
|
|
8
|
+
import { formatDuration } from './dateTimeUtils';
|
|
4
9
|
|
|
5
|
-
const extractTextContent = (message: DMessageItem): string => {
|
|
10
|
+
export const extractTextContent = (message: DMessageItem): string => {
|
|
6
11
|
if (message.textElem?.content) return message.textElem.content;
|
|
7
12
|
try {
|
|
8
13
|
const parsed = JSON.parse(message.content) as { content?: string };
|
|
@@ -12,13 +17,7 @@ const extractTextContent = (message: DMessageItem): string => {
|
|
|
12
17
|
}
|
|
13
18
|
};
|
|
14
19
|
|
|
15
|
-
const
|
|
16
|
-
const mins = Math.floor(seconds / 60);
|
|
17
|
-
const secs = seconds % 60;
|
|
18
|
-
return `${mins}:${secs.toString().padStart(2, '0')}`;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const getMessagePreview = (message: DMessageItem): string => {
|
|
20
|
+
export const getMessagePreview = (message: DMessageItem): string => {
|
|
22
21
|
// Check custom message type first
|
|
23
22
|
if (message.contentType === MessageType.CustomMessage) {
|
|
24
23
|
try {
|
|
@@ -49,8 +48,8 @@ const getMessagePreview = (message: DMessageItem): string => {
|
|
|
49
48
|
|
|
50
49
|
case MessageType.VideoMessage:
|
|
51
50
|
try {
|
|
52
|
-
const videoData =
|
|
53
|
-
const duration = videoData
|
|
51
|
+
const videoData = message?.videoElem;
|
|
52
|
+
const duration = videoData?.duration || 0;
|
|
54
53
|
const durationStr = duration > 0 ? ` ${formatDuration(duration)}` : '';
|
|
55
54
|
return `[Video]${durationStr}`;
|
|
56
55
|
} catch {
|
|
@@ -75,7 +74,7 @@ const getMessagePreview = (message: DMessageItem): string => {
|
|
|
75
74
|
(msg: any) => msg.contentType === MessageType.PictureMessage
|
|
76
75
|
).length;
|
|
77
76
|
if (imageCount > 0) {
|
|
78
|
-
return
|
|
77
|
+
return '[Hình ảnh]';
|
|
79
78
|
}
|
|
80
79
|
}
|
|
81
80
|
} catch {
|
|
@@ -108,52 +107,15 @@ export const getLastMessageText = (
|
|
|
108
107
|
const preview = getMessagePreview(message);
|
|
109
108
|
if (!preview) return '';
|
|
110
109
|
|
|
111
|
-
// Add sender name
|
|
110
|
+
// Add sender name for outgoing messages
|
|
112
111
|
if (currentUserId && message.sendID === currentUserId) {
|
|
113
112
|
return `Bạn: ${preview}`;
|
|
114
113
|
}
|
|
115
114
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
export const formatTimestamp = (ts: number | string | null): string => {
|
|
120
|
-
if (!ts) return '';
|
|
121
|
-
|
|
122
|
-
try {
|
|
123
|
-
const date = new Date(ts);
|
|
124
|
-
if (isNaN(date.getTime())) return '';
|
|
125
|
-
|
|
126
|
-
const now = new Date();
|
|
127
|
-
const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
|
128
|
-
const yesterday = new Date(today.getTime() - 24 * 60 * 60 * 1000);
|
|
129
|
-
const dateOnly = new Date(
|
|
130
|
-
date.getFullYear(),
|
|
131
|
-
date.getMonth(),
|
|
132
|
-
date.getDate()
|
|
133
|
-
);
|
|
134
|
-
|
|
135
|
-
if (dateOnly.getTime() === today.getTime()) {
|
|
136
|
-
const h = date.getHours().toString().padStart(2, '0');
|
|
137
|
-
const m = date.getMinutes().toString().padStart(2, '0');
|
|
138
|
-
return `${h}:${m}`;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
if (dateOnly.getTime() === yesterday.getTime()) {
|
|
142
|
-
return 'Hôm qua';
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
const daysAgo = Math.floor(
|
|
146
|
-
(today.getTime() - dateOnly.getTime()) / (24 * 60 * 60 * 1000)
|
|
147
|
-
);
|
|
148
|
-
if (daysAgo > 0 && daysAgo < 7) {
|
|
149
|
-
const dayNames = ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'];
|
|
150
|
-
return dayNames[date.getDay()] ?? '';
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
const d = date.getDate().toString().padStart(2, '0');
|
|
154
|
-
const mo = (date.getMonth() + 1).toString().padStart(2, '0');
|
|
155
|
-
return `${d}/${mo}`;
|
|
156
|
-
} catch {
|
|
157
|
-
return '';
|
|
115
|
+
// Add sender nickname for incoming messages
|
|
116
|
+
if (message.senderNickname) {
|
|
117
|
+
return `${message.senderNickname}: ${preview}`;
|
|
158
118
|
}
|
|
119
|
+
|
|
120
|
+
return preview;
|
|
159
121
|
};
|
|
@@ -4,6 +4,7 @@ import { createThumbnail } from 'react-native-create-thumbnail';
|
|
|
4
4
|
interface ThumbnailOptions {
|
|
5
5
|
time?: number; // timestamp in milliseconds (default: 0)
|
|
6
6
|
quality?: number; // 0-100 (default: 100)
|
|
7
|
+
cacheId?: string; // unique cache identifier for this thumbnail (optional)
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
interface ThumbnailResult {
|
|
@@ -17,21 +18,31 @@ export const VideoThumbnailUtil = {
|
|
|
17
18
|
videoPath: string,
|
|
18
19
|
options: ThumbnailOptions = {}
|
|
19
20
|
): Promise<ThumbnailResult | null> => {
|
|
20
|
-
const { time =
|
|
21
|
+
const { time = 800, quality = 80, cacheId } = options; // time in milliseconds
|
|
21
22
|
|
|
22
23
|
try {
|
|
24
|
+
// Generate unique cache name per video to avoid conflicts with concurrent generations
|
|
25
|
+
// Uses provided cacheId or generates one from videoPath filename
|
|
26
|
+
const fileName = videoPath.split('/').pop() || String(Date.now());
|
|
27
|
+
const cacheName =
|
|
28
|
+
cacheId ||
|
|
29
|
+
`thumb-${fileName.replace(/[^a-zA-Z0-9-_]/g, '')}-${Math.abs(
|
|
30
|
+
fileName.charCodeAt(0) + fileName.charCodeAt(fileName.length - 1)
|
|
31
|
+
)}`;
|
|
32
|
+
|
|
23
33
|
console.log('[VideoThumbnail] Generating thumbnail', {
|
|
24
34
|
videoPath,
|
|
25
35
|
timeMs: time,
|
|
26
36
|
quality,
|
|
37
|
+
cacheName,
|
|
27
38
|
});
|
|
28
39
|
|
|
29
40
|
const result = await createThumbnail({
|
|
30
41
|
url: videoPath,
|
|
31
42
|
timeStamp: time,
|
|
32
|
-
format: '
|
|
43
|
+
format: 'png',
|
|
33
44
|
dirSize: 100,
|
|
34
|
-
cacheName
|
|
45
|
+
cacheName,
|
|
35
46
|
});
|
|
36
47
|
|
|
37
48
|
console.log('✅ [VideoThumbnail] THUMBNAIL PATH:', result.path);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["MessageType","DChatMessageType","extractTextContent","message","textElem","content","parsed","JSON","parse","formatDuration","seconds","mins","Math","floor","secs","toString","padStart","getMessagePreview","contentType","CustomMessage","data","dataType","type","Link","linkText","title","Order","orderCode","code","TextMessage","PictureMessage","VideoMessage","videoData","duration","durationStr","FileMessage","fileData","fileName","name","MergeMessage","mergeData","mergeElem","multiMessage","imageCount","filter","msg","length","UrlTextMessage","urlText","urlTextElem","urls","console","log","AtTextMessage","QuoteMessage","getLastMessageText","currentUserId","preview","sendID","formatTimestamp","ts","date","Date","isNaN","getTime","now","today","getFullYear","getMonth","getDate","yesterday","dateOnly","h","getHours","m","getMinutes","daysAgo","dayNames","getDay","d","mo"],"sourceRoot":"../../../../src","sources":["components/ThreadCard/thread-card.utils.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,+BAA+B;AAE3D,SAASC,gBAAgB,QAAQ,wBAAqB;AAEtD,MAAMC,kBAAkB,GAAIC,OAAqB,IAAa;EAC5D,IAAIA,OAAO,CAACC,QAAQ,EAAEC,OAAO,EAAE,OAAOF,OAAO,CAACC,QAAQ,CAACC,OAAO;EAC9D,IAAI;IACF,MAAMC,MAAM,GAAGC,IAAI,CAACC,K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,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;IACpD,MAAMgE,EAAE,GAAG,CAACnB,IAAI,CAACO,QAAQ,CAAC,CAAC,GAAG,CAAC,EAAErD,QAAQ,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;IAC5D,OAAO,GAAG+D,CAAC,IAAIC,EAAE,EAAE;EACrB,CAAC,CAAC,MAAM;IACN,OAAO,EAAE;EACX;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { DMessageItem } from '../../types/chat';
|
|
2
|
-
export declare const getLastMessageText: (message: DMessageItem | undefined, currentUserId?: string) => string;
|
|
3
|
-
export declare const formatTimestamp: (ts: number | string | null) => string;
|
|
4
|
-
//# sourceMappingURL=thread-card.utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"thread-card.utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/ThreadCard/thread-card.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAoGrD,eAAO,MAAM,kBAAkB,GAC7B,SAAS,YAAY,GAAG,SAAS,EACjC,gBAAgB,MAAM,KACrB,MAYF,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,IAAI,MAAM,GAAG,MAAM,GAAG,IAAI,KAAG,MAwC5D,CAAC"}
|