@droppii-org/chat-mobile 0.2.15 → 0.2.17
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/AttachmentPreview.js +9 -7
- package/lib/module/components/AttachmentPreview.js.map +1 -1
- package/lib/module/components/MergedImageGrid.js +28 -18
- package/lib/module/components/MergedImageGrid.js.map +1 -1
- 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/components/messages/mergedMessage/index.js +4 -7
- package/lib/module/components/messages/mergedMessage/index.js.map +1 -1
- package/lib/module/hooks/useImageAttachment.js +50 -71
- package/lib/module/hooks/useImageAttachment.js.map +1 -1
- package/lib/module/hooks/useVideoAttachment.js +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/screens/MediaView/VideoPlayer.js +1 -0
- package/lib/module/screens/MediaView/VideoPlayer.js.map +1 -1
- package/lib/module/screens/MediaView/index.js +8 -10
- package/lib/module/screens/MediaView/index.js.map +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/ChatListLegend.js +11 -2
- package/lib/module/screens/chat-detail/ChatListLegend.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/attachmentHandlers/videoAttachmentHandler.js +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/translation/resources/i18n.js +1 -0
- package/lib/module/translation/resources/i18n.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 +86 -7
- package/lib/module/utils/videoThumbnail.js.map +1 -1
- package/lib/typescript/src/components/AttachmentPreview.d.ts.map +1 -1
- package/lib/typescript/src/components/MergedImageGrid.d.ts +2 -2
- package/lib/typescript/src/components/MergedImageGrid.d.ts.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/components/messages/mergedMessage/index.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useImageAttachment.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/MediaView/VideoPlayer.d.ts.map +1 -1
- package/lib/typescript/src/screens/MediaView/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/ChatListLegend.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/translation/resources/i18n.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 +2 -2
- package/src/components/AttachmentPreview.tsx +11 -5
- package/src/components/MergedImageGrid.tsx +36 -23
- package/src/components/ThreadCard/ThreadCard.tsx +2 -1
- package/src/components/messages/imageMessage/index.tsx +0 -1
- package/src/components/messages/mergedMessage/index.tsx +5 -7
- package/src/hooks/useImageAttachment.ts +67 -82
- package/src/hooks/useVideoAttachment.ts +1 -1
- package/src/index.tsx +8 -1
- package/src/screens/MediaView/VideoPlayer.tsx +1 -0
- package/src/screens/MediaView/index.tsx +8 -7
- package/src/screens/chat-detail/ChatComposer.tsx +9 -3
- package/src/screens/chat-detail/ChatListLegend.tsx +9 -2
- package/src/screens/chat-detail/hooks/useAttachmentSendHandler.ts +81 -25
- package/src/services/attachmentHandlers/imageAttachmentHandler.ts +11 -1
- package/src/services/attachmentHandlers/videoAttachmentHandler.ts +1 -1
- package/src/services/auth.ts +77 -0
- package/src/services/imageUpload.ts +116 -73
- package/src/translation/resources/i18n.ts +1 -0
- 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 +90 -5
- 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
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Message formatting and preview utilities
|
|
5
|
+
*/
|
|
6
|
+
|
|
3
7
|
import { MessageType } from '@droppii/openim-rn-client-sdk';
|
|
4
|
-
import { DChatMessageType } from "
|
|
5
|
-
|
|
8
|
+
import { DChatMessageType } from "../types/message.js";
|
|
9
|
+
import { formatDuration } from "./dateTimeUtils.js";
|
|
10
|
+
export const extractTextContent = message => {
|
|
6
11
|
if (message.textElem?.content) return message.textElem.content;
|
|
7
12
|
try {
|
|
8
13
|
const parsed = JSON.parse(message.content);
|
|
@@ -11,12 +16,7 @@ const extractTextContent = message => {
|
|
|
11
16
|
return message.content ?? '';
|
|
12
17
|
}
|
|
13
18
|
};
|
|
14
|
-
const
|
|
15
|
-
const mins = Math.floor(seconds / 60);
|
|
16
|
-
const secs = seconds % 60;
|
|
17
|
-
return `${mins}:${secs.toString().padStart(2, '0')}`;
|
|
18
|
-
};
|
|
19
|
-
const getMessagePreview = message => {
|
|
19
|
+
export const getMessagePreview = message => {
|
|
20
20
|
// Check custom message type first
|
|
21
21
|
if (message.contentType === MessageType.CustomMessage) {
|
|
22
22
|
try {
|
|
@@ -43,8 +43,8 @@ const getMessagePreview = message => {
|
|
|
43
43
|
return '[Hình ảnh]';
|
|
44
44
|
case MessageType.VideoMessage:
|
|
45
45
|
try {
|
|
46
|
-
const videoData =
|
|
47
|
-
const duration = videoData
|
|
46
|
+
const videoData = message?.videoElem;
|
|
47
|
+
const duration = videoData?.duration || 0;
|
|
48
48
|
const durationStr = duration > 0 ? ` ${formatDuration(duration)}` : '';
|
|
49
49
|
return `[Video]${durationStr}`;
|
|
50
50
|
} catch {
|
|
@@ -65,7 +65,7 @@ const getMessagePreview = message => {
|
|
|
65
65
|
if (mergeData?.multiMessage) {
|
|
66
66
|
const imageCount = mergeData.multiMessage.filter(msg => msg.contentType === MessageType.PictureMessage).length;
|
|
67
67
|
if (imageCount > 0) {
|
|
68
|
-
return
|
|
68
|
+
return '[Hình ảnh]';
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
} catch {
|
|
@@ -89,39 +89,15 @@ export const getLastMessageText = (message, currentUserId) => {
|
|
|
89
89
|
const preview = getMessagePreview(message);
|
|
90
90
|
if (!preview) return '';
|
|
91
91
|
|
|
92
|
-
// Add sender name
|
|
92
|
+
// Add sender name for outgoing messages
|
|
93
93
|
if (currentUserId && message.sendID === currentUserId) {
|
|
94
94
|
return `Bạn: ${preview}`;
|
|
95
95
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
try {
|
|
101
|
-
const date = new Date(ts);
|
|
102
|
-
if (isNaN(date.getTime())) return '';
|
|
103
|
-
const now = new Date();
|
|
104
|
-
const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
|
105
|
-
const yesterday = new Date(today.getTime() - 24 * 60 * 60 * 1000);
|
|
106
|
-
const dateOnly = new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
107
|
-
if (dateOnly.getTime() === today.getTime()) {
|
|
108
|
-
const h = date.getHours().toString().padStart(2, '0');
|
|
109
|
-
const m = date.getMinutes().toString().padStart(2, '0');
|
|
110
|
-
return `${h}:${m}`;
|
|
111
|
-
}
|
|
112
|
-
if (dateOnly.getTime() === yesterday.getTime()) {
|
|
113
|
-
return 'Hôm qua';
|
|
114
|
-
}
|
|
115
|
-
const daysAgo = Math.floor((today.getTime() - dateOnly.getTime()) / (24 * 60 * 60 * 1000));
|
|
116
|
-
if (daysAgo > 0 && daysAgo < 7) {
|
|
117
|
-
const dayNames = ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'];
|
|
118
|
-
return dayNames[date.getDay()] ?? '';
|
|
119
|
-
}
|
|
120
|
-
const d = date.getDate().toString().padStart(2, '0');
|
|
121
|
-
const mo = (date.getMonth() + 1).toString().padStart(2, '0');
|
|
122
|
-
return `${d}/${mo}`;
|
|
123
|
-
} catch {
|
|
124
|
-
return '';
|
|
96
|
+
|
|
97
|
+
// Add sender nickname for incoming messages
|
|
98
|
+
if (message.senderNickname) {
|
|
99
|
+
return `${message.senderNickname}: ${preview}`;
|
|
125
100
|
}
|
|
101
|
+
return preview;
|
|
126
102
|
};
|
|
127
|
-
//# sourceMappingURL=
|
|
103
|
+
//# sourceMappingURL=messageUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MessageType","DChatMessageType","formatDuration","extractTextContent","message","textElem","content","parsed","JSON","parse","getMessagePreview","contentType","CustomMessage","data","dataType","type","Link","linkText","title","Order","orderCode","code","TextMessage","PictureMessage","VideoMessage","videoData","videoElem","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","senderNickname"],"sourceRoot":"../../../src","sources":["utils/messageUtils.ts"],"mappings":";;AAAA;AACA;AACA;;AAEA,SAASA,WAAW,QAAQ,+BAA+B;AAE3D,SAASC,gBAAgB,QAAQ,qBAAkB;AACnD,SAASC,cAAc,QAAQ,oBAAiB;AAEhD,OAAO,MAAMC,kBAAkB,GAAIC,OAAqB,IAAa;EACnE,IAAIA,OAAO,CAACC,QAAQ,EAAEC,OAAO,EAAE,OAAOF,OAAO,CAACC,QAAQ,CAACC,OAAO;EAC9D,IAAI;IACF,MAAMC,MAAM,GAAGC,IAAI,CAACC,KAAK,CAACL,OAAO,CAACE,OAAO,CAAyB;IAClE,OAAOC,MAAM,CAACD,OAAO,IAAI,EAAE;EAC7B,CAAC,CAAC,MAAM;IACN,OAAOF,OAAO,CAACE,OAAO,IAAI,EAAE;EAC9B;AACF,CA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CAAC;EAC1C,IAAI,CAAC+C,OAAO,EAAE,OAAO,EAAE;;EAEvB;EACA,IAAID,aAAa,IAAI9C,OAAO,CAACgD,MAAM,KAAKF,aAAa,EAAE;IACrD,OAAO,QAAQC,OAAO,EAAE;EAC1B;;EAEA;EACA,IAAI/C,OAAO,CAACiD,cAAc,EAAE;IAC1B,OAAO,GAAGjD,OAAO,CAACiD,cAAc,KAAKF,OAAO,EAAE;EAChD;EAEA,OAAOA,OAAO;AAChB,CAAC","ignoreList":[]}
|
|
@@ -1,26 +1,100 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import { Platform } from 'react-native';
|
|
3
4
|
import RNFS from 'react-native-fs';
|
|
4
5
|
import { createThumbnail } from 'react-native-create-thumbnail';
|
|
6
|
+
/**
|
|
7
|
+
* Routes the video source so react-native-create-thumbnail picks the correct
|
|
8
|
+
* native MediaMetadataRetriever.setDataSource overload.
|
|
9
|
+
*
|
|
10
|
+
* Root cause of the Android crash: CreateThumbnailModule.getBitmapAtTime branches
|
|
11
|
+
* on the URL scheme —
|
|
12
|
+
* - "file://..." -> setDataSource(String) ✅ works for local files
|
|
13
|
+
* - "content://" -> setDataSource(Context, Uri)
|
|
14
|
+
* - otherwise -> setDataSource(String, Map headers) ❌ this overload is for
|
|
15
|
+
* REMOTE URIs; a bare local path makes it throw an uncaught
|
|
16
|
+
* RuntimeException (status 0xFFFFFFEA / EINVAL) → app crash.
|
|
17
|
+
* The app strips "file://" before calling, so local videos fall into the broken
|
|
18
|
+
* branch. The fix is to KEEP the file:// scheme so the working overload is used.
|
|
19
|
+
*
|
|
20
|
+
* For Android photo-picker synthetic paths we additionally copy the file into the
|
|
21
|
+
* app cache first (a clean, app-private file the retriever can always open) and
|
|
22
|
+
* still hand it back with a file:// prefix. Returns the path to pass to
|
|
23
|
+
* createThumbnail plus a raw cleanup path for any temp copy.
|
|
24
|
+
*/
|
|
25
|
+
const ensureRetrievableVideoPath = async videoPath => {
|
|
26
|
+
// iOS (and any non-Android platform) is left completely untouched.
|
|
27
|
+
if (Platform.OS !== 'android') {
|
|
28
|
+
return {
|
|
29
|
+
path: videoPath,
|
|
30
|
+
cleanupPath: null
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// content:// is handled by a dedicated native branch — pass through unchanged.
|
|
35
|
+
if (videoPath.startsWith('content://')) {
|
|
36
|
+
return {
|
|
37
|
+
path: videoPath,
|
|
38
|
+
cleanupPath: null
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const rawPath = videoPath.startsWith('file://') ? videoPath.replace('file://', '') : videoPath;
|
|
42
|
+
const isSynthetic = rawPath.includes('/.transforms/') || rawPath.includes('/synthetic/');
|
|
43
|
+
if (isSynthetic) {
|
|
44
|
+
const ext = (rawPath.split('.').pop() || 'mp4').split('?')[0];
|
|
45
|
+
const dest = `${RNFS.CachesDirectoryPath}/video-thumb-src-${Date.now()}-${Math.floor(Math.random() * 1e6)}.${ext}`;
|
|
46
|
+
console.log('[VideoThumbnail] Copying picker video to cache before thumbnail', {
|
|
47
|
+
from: rawPath,
|
|
48
|
+
to: dest
|
|
49
|
+
});
|
|
50
|
+
await RNFS.copyFile(rawPath, dest);
|
|
51
|
+
return {
|
|
52
|
+
path: `file://${dest}`,
|
|
53
|
+
cleanupPath: dest
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Any other local path: ensure the file:// scheme so the native module routes
|
|
58
|
+
// to setDataSource(String) instead of the broken (String, Map) overload.
|
|
59
|
+
return {
|
|
60
|
+
path: `file://${rawPath}`,
|
|
61
|
+
cleanupPath: null
|
|
62
|
+
};
|
|
63
|
+
};
|
|
5
64
|
export const VideoThumbnailUtil = {
|
|
6
65
|
generateThumbnail: async (videoPath, options = {}) => {
|
|
7
66
|
const {
|
|
8
|
-
time =
|
|
9
|
-
quality = 80
|
|
67
|
+
time = 800,
|
|
68
|
+
quality = 80,
|
|
69
|
+
cacheId
|
|
10
70
|
} = options; // time in milliseconds
|
|
11
71
|
|
|
72
|
+
let tempSourcePath = null;
|
|
12
73
|
try {
|
|
74
|
+
// Normalize the source so the native MediaMetadataRetriever can open it.
|
|
75
|
+
// Android picker paths crash the app otherwise (see ensureRetrievableVideoPath).
|
|
76
|
+
const {
|
|
77
|
+
path: retrievablePath,
|
|
78
|
+
cleanupPath
|
|
79
|
+
} = await ensureRetrievableVideoPath(videoPath);
|
|
80
|
+
tempSourcePath = cleanupPath;
|
|
81
|
+
|
|
82
|
+
// Generate unique cache name per video to avoid conflicts with concurrent generations
|
|
83
|
+
// Uses provided cacheId or generates one from videoPath filename
|
|
84
|
+
const fileName = retrievablePath.split('/').pop() || String(Date.now());
|
|
85
|
+
const cacheName = cacheId || `thumb-${fileName.replace(/[^a-zA-Z0-9-_]/g, '')}-${Math.abs(fileName.charCodeAt(0) + fileName.charCodeAt(fileName.length - 1))}`;
|
|
13
86
|
console.log('[VideoThumbnail] Generating thumbnail', {
|
|
14
|
-
videoPath,
|
|
87
|
+
videoPath: retrievablePath,
|
|
15
88
|
timeMs: time,
|
|
16
|
-
quality
|
|
89
|
+
quality,
|
|
90
|
+
cacheName
|
|
17
91
|
});
|
|
18
92
|
const result = await createThumbnail({
|
|
19
|
-
url:
|
|
93
|
+
url: retrievablePath,
|
|
20
94
|
timeStamp: time,
|
|
21
|
-
format: '
|
|
95
|
+
format: 'png',
|
|
22
96
|
dirSize: 100,
|
|
23
|
-
cacheName
|
|
97
|
+
cacheName
|
|
24
98
|
});
|
|
25
99
|
console.log('✅ [VideoThumbnail] THUMBNAIL PATH:', result.path);
|
|
26
100
|
console.log('[VideoThumbnail] Thumbnail generated', {
|
|
@@ -36,6 +110,11 @@ export const VideoThumbnailUtil = {
|
|
|
36
110
|
} catch (error) {
|
|
37
111
|
console.error('[VideoThumbnail] Failed to generate thumbnail', error);
|
|
38
112
|
return null;
|
|
113
|
+
} finally {
|
|
114
|
+
// Remove the temporary video copy made for synthetic/content sources.
|
|
115
|
+
if (tempSourcePath) {
|
|
116
|
+
RNFS.unlink(tempSourcePath).catch(err => console.warn('[VideoThumbnail] Temp source cleanup failed:', err));
|
|
117
|
+
}
|
|
39
118
|
}
|
|
40
119
|
},
|
|
41
120
|
cleanupThumbnail: async thumbnailPath => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["RNFS","createThumbnail","
|
|
1
|
+
{"version":3,"names":["Platform","RNFS","createThumbnail","ensureRetrievableVideoPath","videoPath","OS","path","cleanupPath","startsWith","rawPath","replace","isSynthetic","includes","ext","split","pop","dest","CachesDirectoryPath","Date","now","Math","floor","random","console","log","from","to","copyFile","VideoThumbnailUtil","generateThumbnail","options","time","quality","cacheId","tempSourcePath","retrievablePath","fileName","String","cacheName","abs","charCodeAt","length","timeMs","result","url","timeStamp","format","dirSize","width","height","error","unlink","catch","err","warn","cleanupThumbnail","thumbnailPath","batchGenerateThumbnails","videoPaths","results","thumbnail","push"],"sourceRoot":"../../../src","sources":["utils/videoThumbnail.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,OAAOC,IAAI,MAAM,iBAAiB;AAClC,SAASC,eAAe,QAAQ,+BAA+B;AAc/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,0BAA0B,GAAG,MACjCC,SAAiB,IACyC;EAC1D;EACA,IAAIJ,QAAQ,CAACK,EAAE,KAAK,SAAS,EAAE;IAC7B,OAAO;MAAEC,IAAI,EAAEF,SAAS;MAAEG,WAAW,EAAE;IAAK,CAAC;EAC/C;;EAEA;EACA,IAAIH,SAAS,CAACI,UAAU,CAAC,YAAY,CAAC,EAAE;IACtC,OAAO;MAAEF,IAAI,EAAEF,SAAS;MAAEG,WAAW,EAAE;IAAK,CAAC;EAC/C;EAEA,MAAME,OAAO,GAAGL,SAAS,CAACI,UAAU,CAAC,SAAS,CAAC,GAC3CJ,SAAS,CAACM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B,CAAC;IACH,CAAC,CAAC,OAAOC,KAAK,EAAE;MACd3B,OAAO,CAAC2B,KAAK,CAAC,+CAA+C,EAAEA,KAAK,CAAC;MACrE,OAAO,IAAI;IACb,CAAC,SAAS;MACR;MACA,IAAIhB,cAAc,EAAE;QAClBjC,IAAI,CAACkD,MAAM,CAACjB,cAAc,CAAC,CAACkB,KAAK,CAAEC,GAAG,IACpC9B,OAAO,CAAC+B,IAAI,CAAC,8CAA8C,EAAED,GAAG,CAClE,CAAC;MACH;IACF;EACF,CAAC;EAEDE,gBAAgB,EAAE,MAAOC,aAAqB,IAAoB;IAChE,IAAI;MACF,IAAI,CAACA,aAAa,EAAE;MACpB,MAAMvD,IAAI,CAACkD,MAAM,CAACK,aAAa,CAAC;MAChCjC,OAAO,CAACC,GAAG,CAAC,8BAA8B,EAAEgC,aAAa,CAAC;IAC5D,CAAC,CAAC,OAAOH,GAAG,EAAE;MACZ9B,OAAO,CAAC+B,IAAI,CAAC,kCAAkC,EAAED,GAAG,CAAC;IACvD;EACF,CAAC;EAEDI,uBAAuB,EAAE,MAAAA,CACvBC,UAAoB,EACpB5B,OAAyB,GAAG,CAAC,CAAC,KACC;IAC/B,MAAM6B,OAA0B,GAAG,EAAE;IAErC,KAAK,MAAMvD,SAAS,IAAIsD,UAAU,EAAE;MAClC,MAAME,SAAS,GAAG,MAAMhC,kBAAkB,CAACC,iBAAiB,CAC1DzB,SAAS,EACT0B,OACF,CAAC;MACD,IAAI8B,SAAS,EAAE;QACbD,OAAO,CAACE,IAAI,CAACD,SAAS,CAAC;MACzB;IACF;IAEA,OAAOD,OAAO;EAChB;AACF,CAAC;AAED,eAAe/B,kBAAkB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentPreview.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentPreview.tsx"],"names":[],"mappings":"AAIA,KAAK,cAAc,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,UAAU,G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Ac;IACtB,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,sBAAsB;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,KAAK,CAAC,cAAc,GAAG;QAAE,IAAI,EAAE,cAAc,CAAA;KAAE,CAAC,CAAC;IAC/D,QAAQ,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzD;AA2BD,eAAO,MAAM,iBAAiB,2EACS,sBAAsB,iCA4J5D,CAAC"}
|
|
@@ -8,8 +8,8 @@ interface MergedImageGridProps {
|
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
10
|
* Generic image grid for merged messages
|
|
11
|
-
* Layout:
|
|
12
|
-
* Shows "+N more" overlay on last cell if images exceed limit
|
|
11
|
+
* Layout: always a single horizontal row (1xN), N capped at maxDisplay (default 3)
|
|
12
|
+
* Shows "+N more" overlay on last cell if images exceed limit (e.g. 4 images → 3 + "+1")
|
|
13
13
|
*/
|
|
14
14
|
export declare const MergedImageGrid: import("react").MemoExoticComponent<({ images, maxDisplay, onMediaPress }: MergedImageGridProps) => import("react").JSX.Element>;
|
|
15
15
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MergedImageGrid.d.ts","sourceRoot":"","sources":["../../../../src/components/MergedImageGrid.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MergedImageGrid.d.ts","sourceRoot":"","sources":["../../../../src/components/MergedImageGrid.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEzD,UAAU,oBAAoB;IAC5B,MAAM,EAAE,KAAK,CAAC;QACZ,WAAW,CAAC,EAAE,GAAG,CAAC;KACnB,CAAC,CAAC;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7D;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,6EACiB,oBAAoB,iCAyLhE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThreadCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/ThreadCard/ThreadCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"ThreadCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/ThreadCard/ThreadCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAS1D,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,qBAAqB,CAAA;KAAE,KAAK,IAAI,CAAC;CAC5E;AAED,QAAA,MAAM,UAAU,0DAA4B,eAAe,iCAgHzD,CAAC;AAIH,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/messages/imageMessage/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEvD,eAAO,MAAM,YAAY,kEACK,sBAAsB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/messages/imageMessage/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEvD,eAAO,MAAM,YAAY,kEACK,sBAAsB,iCAwGnD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/messages/mergedMessage/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEvD,eAAO,MAAM,aAAa,8EACgB,sBAAsB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/messages/mergedMessage/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEvD,eAAO,MAAM,aAAa,8EACgB,sBAAsB,iCAiC/D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useImageAttachment.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useImageAttachment.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useImageAttachment.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useImageAttachment.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAQ3E,UAAU,qBAAqB;IAC7B,KAAK,EAAE,WAAW,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,wBAAwB;IACvC,cAAc,EAAE,qBAAqB,EAAE,CAAC;IACxC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,iBAAiB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED,eAAO,MAAM,kBAAkB,QAAO,wBAiTrC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ChatAPI } from './services';
|
|
2
|
-
export { setAuthToken, getAuthToken, clearAuthToken } from './services/auth';
|
|
2
|
+
export { setAuthToken, getAuthToken, clearAuthToken, setTokenRefreshCallback, setTokenRefreshFailedCallback, refreshAuthToken, } from './services/auth';
|
|
3
3
|
export { initBaseUrl, getBaseUrl } from './config/configuration';
|
|
4
4
|
export { Config } from './config';
|
|
5
5
|
export * from './core';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,uBAAuB,EACvB,6BAA6B,EAC7B,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,YAAY,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,cAAc,cAAc,CAAC;A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AAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B;AAUD,QAAA,MAAM,WAAW,8CAAgB,KAAK,
|
|
1
|
+
{"version":3,"file":"VideoPlayer.d.ts","sourceRoot":"","sources":["../../../../../src/screens/MediaView/VideoPlayer.tsx"],"names":[],"mappings":"AAUA,OAAc,EAA0B,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAK/E,UAAU,KAAK;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B;AAUD,QAAA,MAAM,WAAW,8CAAgB,KAAK,iCA+IpC,CAAC;AAGH,eAAe,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/screens/MediaView/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/screens/MediaView/index.tsx"],"names":[],"mappings":"AAgCA,UAAU,iBAAiB;IACzB,MAAM,EAAE,GAAG,EAAE,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,GAAG,CAAC;IAChB,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,QAAA,MAAM,iBAAiB,GAAI,OAAO,iBAAiB,gCA0LlD,CAAC;AAIF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatComposer.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat-detail/ChatComposer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChatComposer.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat-detail/ChatComposer.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAajD,eAAO,MAAM,YAAY,+TAkBpB,iBAAiB,iCAgWrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatListLegend.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat-detail/ChatListLegend.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAW7C,eAAO,MAAM,cAAc,kNActB,aAAa,
|
|
1
|
+
{"version":3,"file":"ChatListLegend.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat-detail/ChatListLegend.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAW7C,eAAO,MAAM,cAAc,kNActB,aAAa,iCA0WjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAttachmentSendHandler.d.ts","sourceRoot":"","sources":["../../../../../../src/screens/chat-detail/hooks/useAttachmentSendHandler.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,UAAU,cAAc;IACtB,KAAK,EAAE,GAAG,CAAC;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,UAAU,6BAA6B;IACrC,cAAc,EAAE,cAAc,EAAE,CAAC;IACjC,eAAe,EAAE,CACf,KAAK,EAAE,GAAG,EAAE,EACZ,CAAC,EAAE,GAAG,EACN,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,KAC5C,OAAO,CAAC,OAAO,CAAC,CAAC;IACtB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CACxD;AAED,eAAO,MAAM,wBAAwB,GAAI,mHAStC,6BAA6B;;
|
|
1
|
+
{"version":3,"file":"useAttachmentSendHandler.d.ts","sourceRoot":"","sources":["../../../../../../src/screens/chat-detail/hooks/useAttachmentSendHandler.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,UAAU,cAAc;IACtB,KAAK,EAAE,GAAG,CAAC;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,UAAU,6BAA6B;IACrC,cAAc,EAAE,cAAc,EAAE,CAAC;IACjC,eAAe,EAAE,CACf,KAAK,EAAE,GAAG,EAAE,EACZ,CAAC,EAAE,GAAG,EACN,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,KAC5C,OAAO,CAAC,OAAO,CAAC,CAAC;IACtB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CACxD;AAED,eAAO,MAAM,wBAAwB,GAAI,mHAStC,6BAA6B;;CAkT/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imageAttachmentHandler.d.ts","sourceRoot":"","sources":["../../../../../src/services/attachmentHandlers/imageAttachmentHandler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAGxE,eAAO,MAAM,sBAAsB,EAAE,
|
|
1
|
+
{"version":3,"file":"imageAttachmentHandler.d.ts","sourceRoot":"","sources":["../../../../../src/services/attachmentHandlers/imageAttachmentHandler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAGxE,eAAO,MAAM,sBAAsB,EAAE,kBA2DpC,CAAC"}
|
|
@@ -12,6 +12,38 @@ export declare const setAuthToken: (token: string) => void;
|
|
|
12
12
|
* @throws Error if token not set
|
|
13
13
|
*/
|
|
14
14
|
export declare const getAuthToken: () => string;
|
|
15
|
+
/**
|
|
16
|
+
* Set callback for token refresh when 401 Unauthorized occurs
|
|
17
|
+
* Callback should refresh token from server and return the new token
|
|
18
|
+
* Example:
|
|
19
|
+
* setTokenRefreshCallback(async () => {
|
|
20
|
+
* const newToken = await api.post('/auth/refresh');
|
|
21
|
+
* return newToken;
|
|
22
|
+
* });
|
|
23
|
+
*/
|
|
24
|
+
export declare const setTokenRefreshCallback: (callback: () => Promise<string>) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Set callback when token refresh fails
|
|
27
|
+
* Called when token refresh throws error or returns invalid token
|
|
28
|
+
* Use this to redirect to login, show error message, etc.
|
|
29
|
+
* Example:
|
|
30
|
+
* setTokenRefreshFailedCallback(() => {
|
|
31
|
+
* navigation.navigate('Login');
|
|
32
|
+
* showToast('Your session expired. Please login again.');
|
|
33
|
+
* });
|
|
34
|
+
*/
|
|
35
|
+
export declare const setTokenRefreshFailedCallback: (callback: () => void) => void;
|
|
36
|
+
/**
|
|
37
|
+
* Refresh auth token when 401 Unauthorized occurs
|
|
38
|
+
* Calls the refresh callback and updates the stored token
|
|
39
|
+
* If refresh fails:
|
|
40
|
+
* 1. Clears the invalid token
|
|
41
|
+
* 2. Calls tokenRefreshFailedCallback (if set) to notify app
|
|
42
|
+
* 3. Throws error
|
|
43
|
+
* @returns new auth token
|
|
44
|
+
* @throws Error if callback not set or refresh fails
|
|
45
|
+
*/
|
|
46
|
+
export declare const refreshAuthToken: () => Promise<string>;
|
|
15
47
|
/**
|
|
16
48
|
* Clear token (logout)
|
|
17
49
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../../src/services/auth.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../../src/services/auth.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,SAEzC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,QAAO,MAO/B,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,GAClC,UAAU,MAAM,OAAO,CAAC,MAAM,CAAC,KAC9B,IAEF,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,6BAA6B,GAAI,UAAU,MAAM,IAAI,KAAG,IAEpE,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,QAAa,OAAO,CAAC,MAAM,CAiCvD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,YAG1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imageUpload.d.ts","sourceRoot":"","sources":["../../../../src/services/imageUpload.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EACb,iBAAiB,EAClB,MAAM,sBAAsB,CAAC;AAE9B,yBAAiB,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"imageUpload.d.ts","sourceRoot":"","sources":["../../../../src/services/imageUpload.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EACb,iBAAiB,EAClB,MAAM,sBAAsB,CAAC;AAE9B,yBAAiB,cAAc,CAAC;IAqDvB,MAAM,eAAe,GAC1B,MAAM,SAAS,EACf,aAAa,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,KACtC,OAAO,CAAC,aAAa,CAoFvB,CAAC;IAEK,MAAM,gBAAgB,GAC3B,OAAO,SAAS,EAAE,EAClB,SAAQ,iBAAsB,EAC9B,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,KACtD,OAAO,CAAC,aAAa,EAAE,CAqCzB,CAAC;IAEK,MAAM,gBAAgB,GAAU,UAAU,MAAM,KAAG,OAAO,CAAC,IAAI,CAMrE,CAAC;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../../../src/translation/resources/i18n.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../../../src/translation/resources/i18n.ts"],"names":[],"mappings":";;;AA4BA,wBAEE"}
|
|
@@ -27,6 +27,7 @@ declare class ChatImageDimens {
|
|
|
27
27
|
/**
|
|
28
28
|
* Get optimized image URL with custom dimensions (generic approach)
|
|
29
29
|
* Useful for dynamic sizing based on actual content
|
|
30
|
+
* Automatically applies pixel ratio for high-DPI displays
|
|
30
31
|
*/
|
|
31
32
|
static getOptimizedImageUrlWithDimensions(url: string | undefined, width: number, height: number): string;
|
|
32
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatImageDimens.d.ts","sourceRoot":"","sources":["../../../../src/utils/chatImageDimens.ts"],"names":[],"mappings":"AAGA;;;GAGG;AAEH,oBAAY,sBAAsB;IAChC,oBAAoB,yBAAyB;IAC7C,mBAAmB,wBAAwB;IAC3C,iBAAiB,sBAAsB;IACvC,kBAAkB,uBAAuB;IACzC,iBAAiB,sBAAsB;CACxC;AAED,UAAU,cAAc;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAsDD,cAAM,eAAe;IACnB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAkB;IACzC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAa;IAClC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAuC;IAC9D,OAAO,CAAC,MAAM,CAAC,MAAM,CAE4B;gBAErC,MAAM,EAAE,MAAM;IAK1B,OAAO,CAAC,mBAAmB;WAeb,WAAW;WAOX,YAAY,CAAC,MAAM,EAAE,MAAM;WAO3B,aAAa,CAAC,MAAM,EAAE,sBAAsB,GAAG,cAAc;WAO7D,oBAAoB,CAChC,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,MAAM,EAAE,sBAAsB,GAC7B,MAAM;IAaT
|
|
1
|
+
{"version":3,"file":"chatImageDimens.d.ts","sourceRoot":"","sources":["../../../../src/utils/chatImageDimens.ts"],"names":[],"mappings":"AAGA;;;GAGG;AAEH,oBAAY,sBAAsB;IAChC,oBAAoB,yBAAyB;IAC7C,mBAAmB,wBAAwB;IAC3C,iBAAiB,sBAAsB;IACvC,kBAAkB,uBAAuB;IACzC,iBAAiB,sBAAsB;CACxC;AAED,UAAU,cAAc;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAsDD,cAAM,eAAe;IACnB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAkB;IACzC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAa;IAClC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAuC;IAC9D,OAAO,CAAC,MAAM,CAAC,MAAM,CAE4B;gBAErC,MAAM,EAAE,MAAM;IAK1B,OAAO,CAAC,mBAAmB;WAeb,WAAW;WAOX,YAAY,CAAC,MAAM,EAAE,MAAM;WAO3B,aAAa,CAAC,MAAM,EAAE,sBAAsB,GAAG,cAAc;WAO7D,oBAAoB,CAChC,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,MAAM,EAAE,sBAAsB,GAC7B,MAAM;IAaT;;;;OAIG;WACW,kCAAkC,CAC9C,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,MAAM;CAgDV;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateTimeUtils.d.ts","sourceRoot":"","sources":["../../../../src/utils/dateTimeUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,cAAc,GAAI,YAAY,MAAM,KAAG,MAMnD,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,IAAI,MAAM,GAAG,MAAM,GAAG,IAAI,KAAG,MAmC5D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../../../src/utils/device.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,WAAW;iCACmB,OAAO;
|
|
1
|
+
{"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../../../src/utils/device.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,WAAW;iCACmB,OAAO;iCAmCP,OAAO;CAgC1C,CAAC;AAEF,eAAe,WAAW,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imageUtils.d.ts","sourceRoot":"","sources":["../../../../src/utils/imageUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,eAAO,MAAM,YAAY,QAAO,MAE/B,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,UAAU,MAAM,GAAG,SAAS,KAAG,OAI1D,CAAC;AAGF,eAAO,MAAM,iBAAiB,GAAI,YAAY,GAAG,KAAG,OAInD,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,UAAU,MAAM,KAAG,
|
|
1
|
+
{"version":3,"file":"imageUtils.d.ts","sourceRoot":"","sources":["../../../../src/utils/imageUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,eAAO,MAAM,YAAY,QAAO,MAE/B,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,UAAU,MAAM,GAAG,SAAS,KAAG,OAI1D,CAAC;AAGF,eAAO,MAAM,iBAAiB,GAAI,YAAY,GAAG,KAAG,OAInD,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,UAAU,MAAM,KAAG,MA+B9C,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,KAAG,MAM9C,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,MAAM,SAAS,KAAG,MAAM,GAAG,IAmB5D,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,SAAS,MAAM,KAAG,MAExD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Message formatting and preview utilities
|
|
3
|
+
*/
|
|
4
|
+
import type { DMessageItem } from '../types/chat';
|
|
5
|
+
export declare const extractTextContent: (message: DMessageItem) => string;
|
|
6
|
+
export declare const getMessagePreview: (message: DMessageItem) => string;
|
|
7
|
+
export declare const getLastMessageText: (message: DMessageItem | undefined, currentUserId?: string) => string;
|
|
8
|
+
//# sourceMappingURL=messageUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messageUtils.d.ts","sourceRoot":"","sources":["../../../../src/utils/messageUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAIlD,eAAO,MAAM,kBAAkB,GAAI,SAAS,YAAY,KAAG,MAQ1D,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,SAAS,YAAY,KAAG,MA+EzD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,SAAS,YAAY,GAAG,SAAS,EACjC,gBAAgB,MAAM,KACrB,MAiBF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"videoThumbnail.d.ts","sourceRoot":"","sources":["../../../../src/utils/videoThumbnail.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"videoThumbnail.d.ts","sourceRoot":"","sources":["../../../../src/utils/videoThumbnail.ts"],"names":[],"mappings":"AAIA,UAAU,gBAAgB;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AA4DD,eAAO,MAAM,kBAAkB;mCAEhB,MAAM,YACR,gBAAgB,KACxB,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;sCA6DM,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC;0CAWhD,MAAM,EAAE,YACX,gBAAgB,KACxB,OAAO,CAAC,eAAe,EAAE,CAAC;CAe9B,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@droppii-org/chat-mobile",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.17",
|
|
4
4
|
"description": "Droppii chat mobile",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"react-native-mmkv": "4.0.0",
|
|
120
120
|
"react-native-permissions": "^5.6.0",
|
|
121
121
|
"react-native-photo-view": "git+ssh://git@github.com/droppii/react-native-photo-view.git",
|
|
122
|
-
"react-native-reanimated": "
|
|
122
|
+
"react-native-reanimated": "^4.4.0",
|
|
123
123
|
"react-native-safe-area-context": "^5.8.0",
|
|
124
124
|
"react-native-snap-carousel": "3.9.0",
|
|
125
125
|
"react-native-svg": "^15.15.5",
|
|
@@ -30,9 +30,12 @@ interface AttachmentPreviewProps {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
const formatDuration = (seconds: number): string => {
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
|
|
33
|
+
const totalSecs = Math.floor(seconds);
|
|
34
|
+
const mins = Math.floor(totalSecs / 60);
|
|
35
|
+
const secs = totalSecs % 60;
|
|
36
|
+
return `${mins.toString().padStart(2, '0')}:${secs
|
|
37
|
+
.toString()
|
|
38
|
+
.padStart(2, '0')}`;
|
|
36
39
|
};
|
|
37
40
|
|
|
38
41
|
const getAttachmentIcon = (type: AttachmentType): string => {
|
|
@@ -72,7 +75,7 @@ export const AttachmentPreview = memo(
|
|
|
72
75
|
horizontal
|
|
73
76
|
showsHorizontalScrollIndicator={false}
|
|
74
77
|
scrollEventThrottle={16}
|
|
75
|
-
contentContainerStyle={
|
|
78
|
+
contentContainerStyle={styles.scrollContent}
|
|
76
79
|
>
|
|
77
80
|
{attachments.map((item, index) => {
|
|
78
81
|
const {
|
|
@@ -134,7 +137,7 @@ export const AttachmentPreview = memo(
|
|
|
134
137
|
)}
|
|
135
138
|
|
|
136
139
|
{/* Video duration badge */}
|
|
137
|
-
{isVideo && metadata.duration && (
|
|
140
|
+
{isVideo && !!metadata.duration && (
|
|
138
141
|
<KContainer.View style={styles.durationBadge} center>
|
|
139
142
|
<KLabel.Text
|
|
140
143
|
typo="TextXsNormal"
|
|
@@ -216,6 +219,9 @@ const styles = StyleSheet.create({
|
|
|
216
219
|
container: {
|
|
217
220
|
// minHeight: 80,
|
|
218
221
|
},
|
|
222
|
+
scrollContent: {
|
|
223
|
+
alignItems: 'center',
|
|
224
|
+
},
|
|
219
225
|
thumbnail: {
|
|
220
226
|
position: 'relative',
|
|
221
227
|
width: 48,
|