movius-chats 1.9.0 → 1.10.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/README.md +9 -9
- package/lib/commonjs/index.js +4 -4
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +4 -4
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/components/ChatBubble/MediaGrid.d.ts +5 -0
- package/lib/typescript/types/index.d.ts +1 -4
- package/lib/typescript/utils/messageMedia.d.ts +3 -0
- package/package.json +1 -1
- package/src/components/ChatBubble/ChatBubble.tsx +7 -5
- package/src/components/ChatBubble/MediaGrid.tsx +174 -134
- package/src/components/ChatBubble/MessageContent.tsx +5 -14
- package/src/components/ChatInput/ChatInput.tsx +29 -27
- package/src/components/MediaViewer/MediaViewer.tsx +14 -12
- package/src/components/Reply/ReplyPreview.tsx +7 -7
- package/src/types/index.ts +1 -4
- package/src/utils/messageMedia.ts +7 -11
package/README.md
CHANGED
|
@@ -313,7 +313,7 @@ export interface Message {
|
|
|
313
313
|
status: 'read' | 'delivered' | 'sent'; // Message status
|
|
314
314
|
senderName?: string; // Sender display name
|
|
315
315
|
senderAvatar?: string; // Sender avatar URI
|
|
316
|
-
mediaItems?: MessageMediaItem[]; // Array of images
|
|
316
|
+
mediaItems?: MessageMediaItem[]; // Array of images, videos, or audio
|
|
317
317
|
fileAttachments?: MessageFileAttachment[]; // Array of file attachments
|
|
318
318
|
replyTo?: MessageReply; // Reply context
|
|
319
319
|
edited?: boolean; // Whether message was edited
|
|
@@ -322,7 +322,7 @@ export interface Message {
|
|
|
322
322
|
// Media item in album
|
|
323
323
|
export interface MessageMediaItem {
|
|
324
324
|
uri: string;
|
|
325
|
-
kind: 'image' | 'video';
|
|
325
|
+
kind: 'image' | 'video' | 'audio';
|
|
326
326
|
}
|
|
327
327
|
|
|
328
328
|
// File attachment
|
|
@@ -588,7 +588,7 @@ Play audio messages with professional waveform visualization and playback speed
|
|
|
588
588
|
// Add audio to a message
|
|
589
589
|
const audioMessage: Message = {
|
|
590
590
|
id: '123',
|
|
591
|
-
|
|
591
|
+
mediaItems: [{ uri: 'file:///path/to/audio.m4a', kind: 'audio' }],
|
|
592
592
|
senderId: 'user-1',
|
|
593
593
|
time: '10:45 AM',
|
|
594
594
|
status: 'sent',
|
|
@@ -1282,12 +1282,12 @@ const handleScroll = (offset: number) => {
|
|
|
1282
1282
|
```tsx
|
|
1283
1283
|
// Correct
|
|
1284
1284
|
{
|
|
1285
|
-
|
|
1285
|
+
mediaItems: [{ uri: 'file:///documents/voice.m4a', kind: 'audio' }],
|
|
1286
1286
|
}
|
|
1287
1287
|
|
|
1288
1288
|
// Wrong
|
|
1289
1289
|
{
|
|
1290
|
-
|
|
1290
|
+
mediaItems: [{ uri: 'file://documents/voice.m4a', kind: 'audio' }],
|
|
1291
1291
|
} // Missing /
|
|
1292
1292
|
```
|
|
1293
1293
|
|
|
@@ -1670,7 +1670,7 @@ Wrap the screen in `flex: 1`. Load custom fonts in **your** app before passing `
|
|
|
1670
1670
|
```ts
|
|
1671
1671
|
{
|
|
1672
1672
|
uri: string;
|
|
1673
|
-
kind: 'image' | 'video';
|
|
1673
|
+
kind: 'image' | 'video' | 'audio';
|
|
1674
1674
|
}
|
|
1675
1675
|
```
|
|
1676
1676
|
|
|
@@ -1794,7 +1794,7 @@ Requires **`react-native-audio-record`** and **`react-native-fs`** in the host a
|
|
|
1794
1794
|
{
|
|
1795
1795
|
id: String(Date.now()),
|
|
1796
1796
|
senderId: currentUserId,
|
|
1797
|
-
|
|
1797
|
+
mediaItems: [{ uri: result.uri, kind: 'audio' }],
|
|
1798
1798
|
time: '10:56 PM',
|
|
1799
1799
|
status: 'sent',
|
|
1800
1800
|
senderAvatar: myAvatarUri,
|
|
@@ -1845,7 +1845,7 @@ WhatsApp-style row inside the bubble:
|
|
|
1845
1845
|
{
|
|
1846
1846
|
id: 'a1',
|
|
1847
1847
|
senderId: '2',
|
|
1848
|
-
|
|
1848
|
+
mediaItems: [{ uri: 'file:///data/user/0/.../voice.wav', kind: 'audio' }],
|
|
1849
1849
|
senderAvatar: 'https://cdn.example.com/u2.jpg',
|
|
1850
1850
|
senderName: 'Alex',
|
|
1851
1851
|
time: '10:23 pm',
|
|
@@ -1877,7 +1877,7 @@ Tap opens `MediaViewer`. Thumbnail `Video` uses `pointerEvents="none"` so presse
|
|
|
1877
1877
|
|
|
1878
1878
|
### Legacy single fields
|
|
1879
1879
|
|
|
1880
|
-
`image` and `
|
|
1880
|
+
Legacy `image`, `video`, and `audio` fields on `Message` are normalized into `mediaItems` internally via `collectMediaItems()`.
|
|
1881
1881
|
|
|
1882
1882
|
---
|
|
1883
1883
|
|