movius-chats 1.0.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.
Files changed (150) hide show
  1. package/README.md +249 -0
  2. package/lib/commonjs/assets/Icons/ArrowBack2RoundedIcon.js +2 -0
  3. package/lib/commonjs/assets/Icons/ArrowBack2RoundedIcon.js.map +1 -0
  4. package/lib/commonjs/assets/Icons/CameraIcon.js +2 -0
  5. package/lib/commonjs/assets/Icons/CameraIcon.js.map +1 -0
  6. package/lib/commonjs/assets/Icons/CheckAllIcon.js +2 -0
  7. package/lib/commonjs/assets/Icons/CheckAllIcon.js.map +1 -0
  8. package/lib/commonjs/assets/Icons/CheckIcon.js +2 -0
  9. package/lib/commonjs/assets/Icons/CheckIcon.js.map +1 -0
  10. package/lib/commonjs/assets/Icons/EmojiFunnySquareIcon.js +2 -0
  11. package/lib/commonjs/assets/Icons/EmojiFunnySquareIcon.js.map +1 -0
  12. package/lib/commonjs/assets/Icons/LoadingIcon.js +2 -0
  13. package/lib/commonjs/assets/Icons/LoadingIcon.js.map +1 -0
  14. package/lib/commonjs/assets/Icons/MicrophoneIcon.js +2 -0
  15. package/lib/commonjs/assets/Icons/MicrophoneIcon.js.map +1 -0
  16. package/lib/commonjs/assets/Icons/PaperClipIcon.js +2 -0
  17. package/lib/commonjs/assets/Icons/PaperClipIcon.js.map +1 -0
  18. package/lib/commonjs/assets/Icons/PaperPlaneIcon.js +2 -0
  19. package/lib/commonjs/assets/Icons/PaperPlaneIcon.js.map +1 -0
  20. package/lib/commonjs/assets/Icons/PauseIcon.js +2 -0
  21. package/lib/commonjs/assets/Icons/PauseIcon.js.map +1 -0
  22. package/lib/commonjs/assets/Icons/PlayIcon.js +2 -0
  23. package/lib/commonjs/assets/Icons/PlayIcon.js.map +1 -0
  24. package/lib/commonjs/assets/Icons/XIcon.js +2 -0
  25. package/lib/commonjs/assets/Icons/XIcon.js.map +1 -0
  26. package/lib/commonjs/components/AudioPlayer/AudioPlayer.js +2 -0
  27. package/lib/commonjs/components/AudioPlayer/AudioPlayer.js.map +1 -0
  28. package/lib/commonjs/components/ChatBubble/ChatBubble.js +2 -0
  29. package/lib/commonjs/components/ChatBubble/ChatBubble.js.map +1 -0
  30. package/lib/commonjs/components/ChatBubble/MessageContent.js +2 -0
  31. package/lib/commonjs/components/ChatBubble/MessageContent.js.map +1 -0
  32. package/lib/commonjs/components/ChatBubble/MessageStatus.js +2 -0
  33. package/lib/commonjs/components/ChatBubble/MessageStatus.js.map +1 -0
  34. package/lib/commonjs/components/ChatInput/ChatInput.js +2 -0
  35. package/lib/commonjs/components/ChatInput/ChatInput.js.map +1 -0
  36. package/lib/commonjs/components/MediaViewer/MediaViewer.js +2 -0
  37. package/lib/commonjs/components/MediaViewer/MediaViewer.js.map +1 -0
  38. package/lib/commonjs/components/TypingComponent/TypingIndicator.js +2 -0
  39. package/lib/commonjs/components/TypingComponent/TypingIndicator.js.map +1 -0
  40. package/lib/commonjs/context/AudioContext.js +2 -0
  41. package/lib/commonjs/context/AudioContext.js.map +1 -0
  42. package/lib/commonjs/context/ChatContext.js +2 -0
  43. package/lib/commonjs/context/ChatContext.js.map +1 -0
  44. package/lib/commonjs/index.js +2 -0
  45. package/lib/commonjs/index.js.map +1 -0
  46. package/lib/commonjs/utils/datefunc.js +2 -0
  47. package/lib/commonjs/utils/datefunc.js.map +1 -0
  48. package/lib/module/assets/Icons/ArrowBack2RoundedIcon.js +2 -0
  49. package/lib/module/assets/Icons/ArrowBack2RoundedIcon.js.map +1 -0
  50. package/lib/module/assets/Icons/CameraIcon.js +2 -0
  51. package/lib/module/assets/Icons/CameraIcon.js.map +1 -0
  52. package/lib/module/assets/Icons/CheckAllIcon.js +2 -0
  53. package/lib/module/assets/Icons/CheckAllIcon.js.map +1 -0
  54. package/lib/module/assets/Icons/CheckIcon.js +2 -0
  55. package/lib/module/assets/Icons/CheckIcon.js.map +1 -0
  56. package/lib/module/assets/Icons/EmojiFunnySquareIcon.js +2 -0
  57. package/lib/module/assets/Icons/EmojiFunnySquareIcon.js.map +1 -0
  58. package/lib/module/assets/Icons/LoadingIcon.js +2 -0
  59. package/lib/module/assets/Icons/LoadingIcon.js.map +1 -0
  60. package/lib/module/assets/Icons/MicrophoneIcon.js +2 -0
  61. package/lib/module/assets/Icons/MicrophoneIcon.js.map +1 -0
  62. package/lib/module/assets/Icons/PaperClipIcon.js +2 -0
  63. package/lib/module/assets/Icons/PaperClipIcon.js.map +1 -0
  64. package/lib/module/assets/Icons/PaperPlaneIcon.js +2 -0
  65. package/lib/module/assets/Icons/PaperPlaneIcon.js.map +1 -0
  66. package/lib/module/assets/Icons/PauseIcon.js +2 -0
  67. package/lib/module/assets/Icons/PauseIcon.js.map +1 -0
  68. package/lib/module/assets/Icons/PlayIcon.js +2 -0
  69. package/lib/module/assets/Icons/PlayIcon.js.map +1 -0
  70. package/lib/module/assets/Icons/XIcon.js +2 -0
  71. package/lib/module/assets/Icons/XIcon.js.map +1 -0
  72. package/lib/module/components/AudioPlayer/AudioPlayer.js +2 -0
  73. package/lib/module/components/AudioPlayer/AudioPlayer.js.map +1 -0
  74. package/lib/module/components/ChatBubble/ChatBubble.js +2 -0
  75. package/lib/module/components/ChatBubble/ChatBubble.js.map +1 -0
  76. package/lib/module/components/ChatBubble/MessageContent.js +2 -0
  77. package/lib/module/components/ChatBubble/MessageContent.js.map +1 -0
  78. package/lib/module/components/ChatBubble/MessageStatus.js +2 -0
  79. package/lib/module/components/ChatBubble/MessageStatus.js.map +1 -0
  80. package/lib/module/components/ChatInput/ChatInput.js +2 -0
  81. package/lib/module/components/ChatInput/ChatInput.js.map +1 -0
  82. package/lib/module/components/MediaViewer/MediaViewer.js +2 -0
  83. package/lib/module/components/MediaViewer/MediaViewer.js.map +1 -0
  84. package/lib/module/components/TypingComponent/TypingIndicator.js +2 -0
  85. package/lib/module/components/TypingComponent/TypingIndicator.js.map +1 -0
  86. package/lib/module/context/AudioContext.js +2 -0
  87. package/lib/module/context/AudioContext.js.map +1 -0
  88. package/lib/module/context/ChatContext.js +2 -0
  89. package/lib/module/context/ChatContext.js.map +1 -0
  90. package/lib/module/index.js +2 -0
  91. package/lib/module/index.js.map +1 -0
  92. package/lib/module/utils/datefunc.js +2 -0
  93. package/lib/module/utils/datefunc.js.map +1 -0
  94. package/lib/typescript/assets/Icons/ArrowBack2RoundedIcon.d.ts +5 -0
  95. package/lib/typescript/assets/Icons/CameraIcon.d.ts +5 -0
  96. package/lib/typescript/assets/Icons/CheckAllIcon.d.ts +4 -0
  97. package/lib/typescript/assets/Icons/CheckIcon.d.ts +4 -0
  98. package/lib/typescript/assets/Icons/EmojiFunnySquareIcon.d.ts +5 -0
  99. package/lib/typescript/assets/Icons/LoadingIcon.d.ts +4 -0
  100. package/lib/typescript/assets/Icons/MicrophoneIcon.d.ts +5 -0
  101. package/lib/typescript/assets/Icons/PaperClipIcon.d.ts +5 -0
  102. package/lib/typescript/assets/Icons/PaperPlaneIcon.d.ts +5 -0
  103. package/lib/typescript/assets/Icons/PauseIcon.d.ts +5 -0
  104. package/lib/typescript/assets/Icons/PlayIcon.d.ts +5 -0
  105. package/lib/typescript/assets/Icons/XIcon.d.ts +4 -0
  106. package/lib/typescript/components/AudioPlayer/AudioPlayer.d.ts +4 -0
  107. package/lib/typescript/components/AudioPlayer/types.d.ts +5 -0
  108. package/lib/typescript/components/ChatBubble/ChatBubble.d.ts +4 -0
  109. package/lib/typescript/components/ChatBubble/MessageContent.d.ts +4 -0
  110. package/lib/typescript/components/ChatBubble/MessageStatus.d.ts +4 -0
  111. package/lib/typescript/components/ChatBubble/types.d.ts +18 -0
  112. package/lib/typescript/components/ChatInput/ChatInput.d.ts +4 -0
  113. package/lib/typescript/components/ChatInput/types.d.ts +20 -0
  114. package/lib/typescript/components/MediaViewer/MediaViewer.d.ts +4 -0
  115. package/lib/typescript/components/MediaViewer/types.d.ts +5 -0
  116. package/lib/typescript/components/TypingComponent/TypingIndicator.d.ts +11 -0
  117. package/lib/typescript/context/AudioContext.d.ts +10 -0
  118. package/lib/typescript/context/ChatContext.d.ts +19 -0
  119. package/lib/typescript/index.d.ts +4 -0
  120. package/lib/typescript/types/index.d.ts +85 -0
  121. package/lib/typescript/utils/datefunc.d.ts +1 -0
  122. package/package.json +93 -0
  123. package/src/assets/Icons/ArrowBack2RoundedIcon.tsx +25 -0
  124. package/src/assets/Icons/CameraIcon.tsx +20 -0
  125. package/src/assets/Icons/CheckAllIcon.tsx +13 -0
  126. package/src/assets/Icons/CheckIcon.tsx +11 -0
  127. package/src/assets/Icons/EmojiFunnySquareIcon.tsx +41 -0
  128. package/src/assets/Icons/LoadingIcon.tsx +15 -0
  129. package/src/assets/Icons/MicrophoneIcon.tsx +24 -0
  130. package/src/assets/Icons/PaperClipIcon.tsx +17 -0
  131. package/src/assets/Icons/PaperPlaneIcon.tsx +24 -0
  132. package/src/assets/Icons/PauseIcon.tsx +21 -0
  133. package/src/assets/Icons/PlayIcon.tsx +20 -0
  134. package/src/assets/Icons/XIcon.tsx +20 -0
  135. package/src/components/AudioPlayer/AudioPlayer.tsx +259 -0
  136. package/src/components/AudioPlayer/types.ts +5 -0
  137. package/src/components/ChatBubble/ChatBubble.tsx +137 -0
  138. package/src/components/ChatBubble/MessageContent.tsx +143 -0
  139. package/src/components/ChatBubble/MessageStatus.tsx +68 -0
  140. package/src/components/ChatBubble/types.ts +21 -0
  141. package/src/components/ChatInput/ChatInput.tsx +207 -0
  142. package/src/components/ChatInput/types.ts +22 -0
  143. package/src/components/MediaViewer/MediaViewer.tsx +101 -0
  144. package/src/components/MediaViewer/types.ts +5 -0
  145. package/src/components/TypingComponent/TypingIndicator.tsx +119 -0
  146. package/src/context/AudioContext.tsx +30 -0
  147. package/src/context/ChatContext.tsx +40 -0
  148. package/src/index.tsx +103 -0
  149. package/src/types/index.ts +94 -0
  150. package/src/utils/datefunc.ts +5 -0
package/README.md ADDED
@@ -0,0 +1,249 @@
1
+ # React Native Modern Chats UI
2
+
3
+ A highly customizable, feature-rich chats interface component for React Native applications. Built with performance and flexibility in mind, this component provides a complete solution for implementing chats functionality in your mobile applications.
4
+
5
+ ## Features
6
+
7
+ - 🚀 Full TypeScript support
8
+ - 📱 Native performance optimizations
9
+ - 🎨 Extensive theme customization
10
+ - 🖼️ Multi-media message support (text, images, video, audio)
11
+ - 👤 Avatar and username display options
12
+ - ⌨️ Typing indicators
13
+ - 📎 File attachments
14
+ - 🎥 Camera integration
15
+ - 🎤 Voice messages
16
+ - 💬 Message status indicators (sent, delivered, read)
17
+ - 🎯 Custom component injection
18
+ - 🔧 Comprehensive styling API
19
+
20
+ ## Installation
21
+
22
+ ```bash
23
+ npm install movius-chats
24
+ # or
25
+ yarn add movius-chats
26
+ ```
27
+
28
+ ### Required Dependencies
29
+
30
+ The following packages are required for movius-chats to function properly. Install them using npm or yarn:
31
+
32
+ ```bash
33
+ # Using npm
34
+ npm install react-native-image-zoom-viewer react-native-reanimated react-native-sound react-native-svg react-native-video twrnc
35
+
36
+ # Using yarn
37
+ yarn add react-native-image-zoom-viewer react-native-reanimated react-native-sound react-native-svg react-native-video twrnc
38
+ ```
39
+
40
+ ### Additional Setup
41
+
42
+ For react-native-reanimated, add this line to your `babel.config.js`:
43
+
44
+ ```javascript
45
+ module.exports = {
46
+ plugins: ['react-native-reanimated/plugin'],
47
+ };
48
+ ```
49
+
50
+ ## Basic Usage
51
+
52
+ ```typescript
53
+ import { ChatScreen, Message } from 'movius-chats';
54
+ import { useState } from 'react';
55
+
56
+ const App = () => {
57
+ const [messages, setMessages] = useState<Message[]>([]);
58
+
59
+ const handleSendMessage = (message: Omit<Message, "id" | "time" | "status">) => {
60
+ // Handle sending message
61
+ const newMessage: Message = {
62
+ ...message,
63
+ id: Date.now().toString(),
64
+ time: new Date().toLocaleTimeString(),
65
+ status: 'sent'
66
+ };
67
+ setMessages(prev => [newMessage, ...prev]);
68
+ };
69
+
70
+ return (
71
+ <ChatScreen
72
+ messages={messages}
73
+ currentUserId="user123"
74
+ onSendMessage={handleSendMessage}
75
+ showAvatars
76
+ />
77
+ );
78
+ };
79
+ ```
80
+
81
+ ## Props
82
+
83
+ ### Core Props
84
+
85
+ | Prop | Type | Required | Description |
86
+ |------|------|----------|-------------|
87
+ | messages | Message[] | Yes | Array of message objects to display |
88
+ | currentUserId | string | Yes | ID of the current user |
89
+ | onSendMessage | (message: Omit<Message, "id" \| "time" \| "status">) => void | Yes | Callback when a message is sent |
90
+
91
+ ### Message Type
92
+
93
+ ```typescript
94
+ interface Message {
95
+ id: string;
96
+ text?: string;
97
+ image?: string;
98
+ video?: string;
99
+ audio?: string;
100
+ senderId: string;
101
+ time: string;
102
+ status: "read" | "delivered" | "sent";
103
+ senderName?: string;
104
+ senderAvatar?: string;
105
+ }
106
+ ```
107
+
108
+ ### Feature Flags
109
+
110
+ | Prop | Type | Default | Description |
111
+ |------|------|---------|-------------|
112
+ | showAvatars | boolean | false | Show user avatars |
113
+ | showUserNames | boolean | false | Display usernames above messages |
114
+ | showEmojiButton | boolean | true | Show emoji picker button |
115
+ | showAttachmentsButton | boolean | true | Show attachments button |
116
+ | showCameraButton | boolean | true | Show camera access button |
117
+ | showVoiceRecordButton | boolean | true | Show voice recording button |
118
+ | showBubbleTail | boolean | true | Show message bubble tails |
119
+ | showMessageStatus | boolean | true | Show message status indicators |
120
+
121
+ ### Event Handlers
122
+
123
+ | Prop | Type | Description |
124
+ |------|------|-------------|
125
+ | onMessageLongPress | (message: Message) => void | Callback for long-pressing a message |
126
+ | onAttachmentPress | () => void | Callback for attachment button press |
127
+ | onAudioRecordStart | () => void | Callback when audio recording starts |
128
+ | onAudioRecordEnd | () => void | Callback when audio recording ends |
129
+ | onCameraPress | () => void | Callback for camera button press |
130
+ | onTypingStart | () => void | Callback when user starts typing |
131
+ | onTypingEnd | () => void | Callback when user stops typing |
132
+
133
+ ### Theming
134
+
135
+ The component supports extensive theming through the `theme` prop:
136
+
137
+ ```typescript
138
+ theme?: {
139
+ colors?: {
140
+ sentMessageTailColor?: string;
141
+ receivedMessageTailColor?: string;
142
+ timestamp?: string;
143
+ inputsIconsColor?: string;
144
+ sendIconsColor?: string;
145
+ placeholderTextColor?: string;
146
+ audioPlayIconColor?: string;
147
+ audioPauseIconColor?: string;
148
+ videoPlayIconColor?: string;
149
+ };
150
+ bubbleStyle?: {
151
+ sent?: ViewStyle;
152
+ received?: ViewStyle;
153
+ // ... other bubble styles
154
+ };
155
+ messageStyle?: {
156
+ textStyle?: TextStyle;
157
+ // ... other message styles
158
+ };
159
+ inputStyles?: {
160
+ inputSectionContainerStyle?: ViewStyle;
161
+ // ... other input styles
162
+ };
163
+ }
164
+ ```
165
+
166
+ ### Custom Components
167
+
168
+ You can provide custom components for various elements:
169
+
170
+ | Prop | Type | Description |
171
+ |------|------|-------------|
172
+ | renderCustomInput | () => React.ReactNode | Custom input component |
173
+ | renderCustomVideoBubbleError | () => React.ReactNode | Custom video error display |
174
+ | renderCustomTyping | () => React.ReactNode | Custom typing indicator |
175
+ | CustomEmojiIcon | () => React.ReactNode | Custom emoji picker icon |
176
+ | CustomAttachmentIcon | () => React.ReactNode | Custom attachment icon |
177
+ | CustomCameraIcon | () => React.ReactNode | Custom camera icon |
178
+ | CustomSendIcon | () => React.ReactNode | Custom send button icon |
179
+ | CustomMicrophoneIcon | () => React.ReactNode | Custom microphone icon |
180
+ | CustomPlayIcon | () => React.ReactNode | Custom play icon |
181
+ | CustomPauseIcon | () => React.ReactNode | Custom pause icon |
182
+
183
+ ## Advanced Usage
184
+
185
+ ### Custom Theme Example
186
+
187
+ ```typescript
188
+ <ChatScreen
189
+ messages={messages}
190
+ currentUserId="user123"
191
+ onSendMessage={handleSendMessage}
192
+ theme={{
193
+ colors: {
194
+ sentMessageTailColor: '#007AFF',
195
+ receivedMessageTailColor: '#E9E9EB',
196
+ timestamp: '#8E8E93',
197
+ },
198
+ bubbleStyle: {
199
+ sent: {
200
+ backgroundColor: '#007AFF',
201
+ borderRadius: 20,
202
+ },
203
+ received: {
204
+ backgroundColor: '#E9E9EB',
205
+ borderRadius: 20,
206
+ },
207
+ },
208
+ }}
209
+ />
210
+ ```
211
+
212
+ ### Custom Input Component
213
+
214
+ ```typescript
215
+ <ChatScreen
216
+ messages={messages}
217
+ currentUserId="user123"
218
+ onSendMessage={handleSendMessage}
219
+ renderCustomInput={() => (
220
+ <YourCustomInputComponent
221
+ onSend={(text) => {
222
+ handleSendMessage({
223
+ text,
224
+ senderId: 'user123',
225
+ });
226
+ }}
227
+ />
228
+ )}
229
+ />
230
+ ```
231
+
232
+ ## Performance Considerations
233
+
234
+ - Messages are rendered using `FlatList` for optimal performance
235
+ - Avatar images are cached automatically
236
+ - Media messages use lazy loading
237
+ - Typing indicators are debounced
238
+
239
+ ## Contributing
240
+
241
+ We welcome contributions! Please see our contributing guide for details.
242
+
243
+ ## License
244
+
245
+ MIT
246
+
247
+ ## Support
248
+
249
+ For issues and feature requests, please file an issue on the GitHub repository.
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react-native-svg"),r=require("react/jsx-runtime");exports.ArrowBack2RoundedIcon=({style:o,color:t})=>r.jsx(e,{style:o,fill:t,viewBox:"0 0 48 48",children:r.jsx(e.Path,{fillRule:"evenodd",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4",d:"M8 9.115c0-1.82 2.235-2.694 3.47-1.356l29.432 31.884c1.182 1.282.273 3.357-1.47 3.357H10a2 2 0 0 1-2-2z",clipRule:"evenodd"})});
2
+ //# sourceMappingURL=ArrowBack2RoundedIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArrowBack2RoundedIcon.js","sources":["../../../../src/assets/Icons/ArrowBack2RoundedIcon.tsx"],"sourcesContent":["\nimport { ViewStyle } from \"react-native\";\nimport Svg, { Path } from \"react-native-svg\";\n\nexport const ArrowBack2RoundedIcon = ({\n style,\n color,\n}: {\n style?: ViewStyle;\n color?: string;\n}) => {\n return (\n <Svg style={style} fill={color} viewBox=\"0 0 48 48\">\n <Path\n fillRule=\"evenodd\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"4\"\n d=\"M8 9.115c0-1.82 2.235-2.694 3.47-1.356l29.432 31.884c1.182 1.282.273 3.357-1.47 3.357H10a2 2 0 0 1-2-2z\"\n clipRule=\"evenodd\"\n ></Path>\n </Svg>\n );\n};\n"],"names":["ArrowBack2RoundedIcon","style","color","_jsx","Svg","fill","viewBox","children","jsx","Path","fillRule","stroke","strokeLinecap","strokeLinejoin","strokeWidth","d","clipRule"],"mappings":"4GAIqCA,EACnCC,QACAC,WAMEC,EAAAA,IAACC,EAAG,CAACH,MAAOA,EAAOI,KAAMH,EAAOI,QAAQ,YAAWC,SACjDJ,EAAAK,IAACC,OAAI,CACHC,SAAS,UACTC,OAAO,eACPC,cAAc,QACdC,eAAe,QACfC,YAAY,IACZC,EAAE,0GACFC,SAAS"}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react-native-svg"),r=require("react/jsx-runtime");exports.CameraIcon=({style:c,color:s})=>r.jsx(e.Svg,{style:c,viewBox:"0 0 24 24",children:r.jsxs(e.G,{fill:"none",strokeWidth:"1.5",stroke:s,children:[r.jsx(e.Circle,{cx:"12",cy:"13",r:"3"}),r.jsx(e.Path,{d:"M9.778 21h4.444c3.121 0 4.682 0 5.803-.735a4.4 4.4 0 0 0 1.226-1.204c.749-1.1.749-2.633.749-5.697s0-4.597-.749-5.697a4.4 4.4 0 0 0-1.226-1.204c-.72-.473-1.622-.642-3.003-.702c-.659 0-1.226-.49-1.355-1.125A2.064 2.064 0 0 0 13.634 3h-3.268c-.988 0-1.839.685-2.033 1.636c-.129.635-.696 1.125-1.355 1.125c-1.38.06-2.282.23-3.003.702A4.4 4.4 0 0 0 2.75 7.667C2 8.767 2 10.299 2 13.364s0 4.596.749 5.697c.324.476.74.885 1.226 1.204C5.096 21 6.657 21 9.778 21Z"}),r.jsx(e.Path,{strokeLinecap:"round",d:"M19 10h-1"})]})});
2
+ //# sourceMappingURL=CameraIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CameraIcon.js","sources":["../../../../src/assets/Icons/CameraIcon.tsx"],"sourcesContent":["import { ViewStyle } from \"react-native\";\nimport { Circle, G, Path, Svg } from \"react-native-svg\";\n\nexport const CameraIcon = ({\n style,\n color\n}: {\n style?: ViewStyle;\n color?: string;\n}) => {\n return (\n <Svg style={style} viewBox=\"0 0 24 24\">\n <G fill=\"none\" strokeWidth=\"1.5\" stroke={color}>\n <Circle cx=\"12\" cy=\"13\" r=\"3\"></Circle>\n <Path d=\"M9.778 21h4.444c3.121 0 4.682 0 5.803-.735a4.4 4.4 0 0 0 1.226-1.204c.749-1.1.749-2.633.749-5.697s0-4.597-.749-5.697a4.4 4.4 0 0 0-1.226-1.204c-.72-.473-1.622-.642-3.003-.702c-.659 0-1.226-.49-1.355-1.125A2.064 2.064 0 0 0 13.634 3h-3.268c-.988 0-1.839.685-2.033 1.636c-.129.635-.696 1.125-1.355 1.125c-1.38.06-2.282.23-3.003.702A4.4 4.4 0 0 0 2.75 7.667C2 8.767 2 10.299 2 13.364s0 4.596.749 5.697c.324.476.74.885 1.226 1.204C5.096 21 6.657 21 9.778 21Z\"></Path>\n <Path strokeLinecap=\"round\" d=\"M19 10h-1\"></Path>\n </G>\n </Svg>\n );\n};\n"],"names":["CameraIcon","style","color","_jsx","Svg","viewBox","children","_jsxs","jsxs","G","fill","strokeWidth","stroke","jsx","Circle","cx","cy","r","Path","d","strokeLinecap"],"mappings":"iGAG0BA,EACxBC,QACAC,WAMEC,EAAAA,IAACC,EAAAA,IAAG,CAACH,MAAOA,EAAOI,QAAQ,YAAWC,SACpCC,EAAAC,KAACC,IAAC,CAACC,KAAK,OAAOC,YAAY,MAAMC,OAAQV,EAAMI,SAAA,CAC7CH,EAAAU,IAACC,SAAM,CAACC,GAAG,KAAKC,GAAG,KAAKC,EAAE,MAC1Bd,EAAAU,IAACK,OAAI,CAACC,EAAE,2cACRhB,EAAAU,IAACK,OAAI,CAACE,cAAc,QAAQD,EAAE"}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react-native-svg"),l=require("react/jsx-runtime");exports.CheckAllIcon=({style:r})=>l.jsx(e,{style:r,viewBox:"0 0 24 24",children:l.jsx(e.Path,{d:"M.41 13.41L6 19l1.41-1.42L1.83 12m20.41-6.42L11.66 16.17L7.5 12l-1.43 1.41L11.66 19l12-12M18 7l-1.41-1.42l-6.35 6.35l1.42 1.41z"})});
2
+ //# sourceMappingURL=CheckAllIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckAllIcon.js","sources":["../../../../src/assets/Icons/CheckAllIcon.tsx"],"sourcesContent":["\nimport { ViewStyle } from \"react-native\";\nimport Svg, { Path } from \"react-native-svg\";\n\nexport const CheckAllIcon = ({ style }: { style?: ViewStyle }) => {\n return (\n <Svg style={style} viewBox=\"0 0 24 24\">\n <Path\n d=\"M.41 13.41L6 19l1.41-1.42L1.83 12m20.41-6.42L11.66 16.17L7.5 12l-1.43 1.41L11.66 19l12-12M18 7l-1.41-1.42l-6.35 6.35l1.42 1.41z\"\n ></Path>\n </Svg>\n );\n};\n"],"names":["CheckAllIcon","style","_jsx","Svg","viewBox","children","jsx","Path","d"],"mappings":"mGAI4BA,EAAGC,WAE3BC,EAAAA,IAACC,EAAG,CAACF,MAAOA,EAAOG,QAAQ,YAAWC,SACpCH,EAAAI,IAACC,OAAI,CACHC,EAAE"}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react-native-svg"),r=require("react/jsx-runtime");exports.CheckIcon=({style:t})=>r.jsx(e,{style:t,viewBox:"0 0 24 24",children:r.jsx(e.Path,{d:"m9.55 18l-5.7-5.7l1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"})});
2
+ //# sourceMappingURL=CheckIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckIcon.js","sources":["../../../../src/assets/Icons/CheckIcon.tsx"],"sourcesContent":["\nimport { ViewStyle } from \"react-native\";\nimport Svg, { Path } from \"react-native-svg\";\n\nexport const CheckIcon = ({ style }: { style?: ViewStyle }) => {\n return (\n <Svg style={style} viewBox=\"0 0 24 24\">\n <Path d=\"m9.55 18l-5.7-5.7l1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z\"></Path>\n </Svg>\n );\n};\n"],"names":["CheckIcon","style","_jsx","Svg","viewBox","children","jsx","Path","d"],"mappings":"gGAIyBA,EAAGC,WAExBC,EAAAA,IAACC,EAAG,CAACF,MAAOA,EAAOG,QAAQ,YAAWC,SACpCH,EAAAI,IAACC,OAAI,CAACC,EAAE"}
@@ -0,0 +1,2 @@
1
+ "use strict";var r=require("react-native-svg"),e=require("react/jsx-runtime");exports.EmojiFunnySquareIcon=({style:s,color:t})=>e.jsx(r,{style:s,viewBox:"0 0 24 24",children:e.jsxs(r.G,{fill:"none",stroke:t,children:[e.jsx(r.Path,{strokeLinecap:"round",strokeWidth:"1.5",d:"M8.913 15.934c1.258.315 2.685.315 4.122-.07s2.673-1.099 3.605-2.001"}),e.jsx(r.Ellipse,{cx:"14.509",cy:"9.774",fill:"currentColor",rx:"1",ry:"1.5",transform:"rotate(-15 14.51 9.774)"}),e.jsx(r.Ellipse,{cx:"8.714",cy:"11.328",fill:"currentColor",rx:"1",ry:"1.5",transform:"rotate(-15 8.714 11.328)"}),e.jsx(r.Path,{strokeWidth:"1.5",d:"M3.204 14.357c-1.112-4.147-1.667-6.22-.724-7.853s3.016-2.19 7.163-3.3c4.147-1.112 6.22-1.667 7.853-.724s2.19 3.016 3.3 7.163c1.111 4.147 1.667 6.22.724 7.853s-3.016 2.19-7.163 3.3c-4.147 1.111-6.22 1.667-7.853.724s-2.19-3.016-3.3-7.163Z"}),e.jsx(r.Path,{strokeWidth:"1.5",d:"m13 16l.478.974a1.5 1.5 0 1 0 2.693-1.322l-.46-.935"})]})});
2
+ //# sourceMappingURL=EmojiFunnySquareIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmojiFunnySquareIcon.js","sources":["../../../../src/assets/Icons/EmojiFunnySquareIcon.tsx"],"sourcesContent":["\nimport { ViewStyle } from \"react-native\";\nimport Svg, { Ellipse, G, Path } from \"react-native-svg\";\n\nexport const EmojiFunnySquareIcon = ({ style ,color}: { style?: ViewStyle,color?: string }) => {\n return (\n <Svg style={style} viewBox=\"0 0 24 24\">\n <G fill=\"none\" stroke={color}>\n <Path\n strokeLinecap=\"round\"\n strokeWidth=\"1.5\"\n d=\"M8.913 15.934c1.258.315 2.685.315 4.122-.07s2.673-1.099 3.605-2.001\"\n ></Path>\n <Ellipse\n cx=\"14.509\"\n cy=\"9.774\"\n fill=\"currentColor\"\n rx=\"1\"\n ry=\"1.5\"\n transform=\"rotate(-15 14.51 9.774)\"\n ></Ellipse>\n <Ellipse\n cx=\"8.714\"\n cy=\"11.328\"\n fill=\"currentColor\"\n rx=\"1\"\n ry=\"1.5\"\n transform=\"rotate(-15 8.714 11.328)\"\n ></Ellipse>\n <Path\n strokeWidth=\"1.5\"\n d=\"M3.204 14.357c-1.112-4.147-1.667-6.22-.724-7.853s3.016-2.19 7.163-3.3c4.147-1.112 6.22-1.667 7.853-.724s2.19 3.016 3.3 7.163c1.111 4.147 1.667 6.22.724 7.853s-3.016 2.19-7.163 3.3c-4.147 1.111-6.22 1.667-7.853.724s-2.19-3.016-3.3-7.163Z\"\n ></Path>\n <Path\n strokeWidth=\"1.5\"\n d=\"m13 16l.478.974a1.5 1.5 0 1 0 2.693-1.322l-.46-.935\"\n ></Path>\n </G>\n </Svg>\n );\n};\n"],"names":["EmojiFunnySquareIcon","style","color","_jsx","Svg","viewBox","children","_jsxs","jsxs","G","fill","stroke","jsx","Path","strokeLinecap","strokeWidth","d","Ellipse","cx","cy","rx","ry","transform"],"mappings":"2GAIoCA,EAAGC,QAAOC,WAE1CC,EAAAA,IAACC,EAAG,CAACH,MAAOA,EAAOI,QAAQ,YAAWC,SACpCC,EAAAC,KAACC,IAAC,CAACC,KAAK,OAAOC,OAAQT,EAAMI,SAAA,CAC3BH,EAAAS,IAACC,OAAI,CACHC,cAAc,QACdC,YAAY,MACZC,EAAE,wEAEJb,EAAAS,IAACK,UAAO,CACNC,GAAG,SACHC,GAAG,QACHT,KAAK,eACLU,GAAG,IACHC,GAAG,MACHC,UAAU,4BAEZnB,EAAAS,IAACK,UAAO,CACNC,GAAG,QACHC,GAAG,SACHT,KAAK,eACLU,GAAG,IACHC,GAAG,MACHC,UAAU,6BAEZnB,EAAAS,IAACC,OAAI,CACHE,YAAY,MACZC,EAAE,iPAEJb,EAAAS,IAACC,OAAI,CACHE,YAAY,MACZC,EAAE"}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react-native-svg"),c=require("react/jsx-runtime");exports.LoadingIcon=({style:r})=>c.jsx(e,{style:r,viewBox:"0 0 1024 1024",children:c.jsx(e.Path,{d:"M988 548c-19.9 0-36-16.1-36-36c0-59.4-11.6-117-34.6-171.3a440.5 440.5 0 0 0-94.3-139.9a437.7 437.7 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150s83.9 101.8 109.7 162.7c26.7 63.1 40.2 130.2 40.2 199.3c.1 19.9-16 36-35.9 36"})});
2
+ //# sourceMappingURL=LoadingIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LoadingIcon.js","sources":["../../../../src/assets/Icons/LoadingIcon.tsx"],"sourcesContent":["import { ViewStyle } from \"react-native\";\nimport Svg, { Path } from \"react-native-svg\";\n\nexport const LoadingIcon = ({ style }: { style?: ViewStyle }) => {\n return (\n <Svg\n style={style}\n viewBox=\"0 0 1024 1024\"\n >\n <Path\n d=\"M988 548c-19.9 0-36-16.1-36-36c0-59.4-11.6-117-34.6-171.3a440.5 440.5 0 0 0-94.3-139.9a437.7 437.7 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150s83.9 101.8 109.7 162.7c26.7 63.1 40.2 130.2 40.2 199.3c.1 19.9-16 36-35.9 36\"\n ></Path>\n </Svg>\n );\n};\n"],"names":["LoadingIcon","style","_jsx","Svg","viewBox","children","jsx","Path","d"],"mappings":"kGAG2BA,EAAGC,WAE1BC,EAAAA,IAACC,EAAG,CACHF,MAAOA,EACNG,QAAQ,gBAAeC,SAEvBH,EAAAI,IAACC,OAAI,CACHC,EAAE"}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react-native-svg"),r=require("react/jsx-runtime");exports.MicrophoneIcon=({style:t,color:s})=>r.jsx(e,{style:t,viewBox:"0 0 24 24",children:r.jsxs(e.G,{fill:"none",strokeWidth:"1.5",stroke:s,children:[r.jsx(e.Path,{d:"M7 8a5 5 0 0 1 10 0v3a5 5 0 0 1-10 0z"}),r.jsx(e.Path,{strokeLinecap:"round",d:"M13.5 8H17m-3.5 3H17M7 8h2m-2 3h2m11-1v1a8 8 0 0 1-8 8m-8-9v1a8 8 0 0 0 8 8m0 0v3",opacity:".5"})]})});
2
+ //# sourceMappingURL=MicrophoneIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MicrophoneIcon.js","sources":["../../../../src/assets/Icons/MicrophoneIcon.tsx"],"sourcesContent":["\nimport { ViewStyle } from \"react-native\";\nimport Svg, { G, Path } from \"react-native-svg\";\n\nexport const MicrophoneIcon = ({\n style,\n color,\n}: {\n style?: ViewStyle;\n color?: string;\n}) => {\n return (\n <Svg style={style} viewBox=\"0 0 24 24\">\n <G fill=\"none\" strokeWidth=\"1.5\" stroke={color}>\n <Path d=\"M7 8a5 5 0 0 1 10 0v3a5 5 0 0 1-10 0z\"></Path>\n <Path\n strokeLinecap=\"round\"\n d=\"M13.5 8H17m-3.5 3H17M7 8h2m-2 3h2m11-1v1a8 8 0 0 1-8 8m-8-9v1a8 8 0 0 0 8 8m0 0v3\"\n opacity=\".5\"\n ></Path>\n </G>\n </Svg>\n );\n};\n"],"names":["MicrophoneIcon","style","color","_jsx","Svg","viewBox","children","_jsxs","jsxs","G","fill","strokeWidth","stroke","jsx","Path","d","strokeLinecap","opacity"],"mappings":"qGAI8BA,EAC5BC,QACAC,WAMEC,EAAAA,IAACC,EAAG,CAACH,MAAOA,EAAOI,QAAQ,YAAWC,SACpCC,EAAAC,KAACC,IAAC,CAACC,KAAK,OAAOC,YAAY,MAAMC,OAAQV,EAAMI,SAAA,CAC7CH,EAAAU,IAACC,OAAI,CAACC,EAAE,0CACRZ,EAAAU,IAACC,OAAI,CACHE,cAAc,QACdD,EAAE,oFACFE,QAAQ"}
@@ -0,0 +1,2 @@
1
+ "use strict";var t=require("react-native-svg"),e=require("react/jsx-runtime");exports.PaperClipIcon=({style:q,color:r})=>e.jsx(t,{style:q,fill:r,viewBox:"0 0 24 24",children:e.jsx(t.Path,{d:"M17.346 15.539q0 2.271-1.565 3.866T11.952 21t-3.838-1.595t-1.576-3.867v-8.73q0-1.587 1.092-2.697Q8.72 3 10.308 3t2.678 1.11t1.091 2.698v8.269q0 .88-.615 1.517q-.614.637-1.498.637t-1.52-.627t-.636-1.527V6.769h1v8.308q0 .479.327.816q.328.338.807.338t.807-.338t.328-.816V6.789q-.006-1.166-.802-1.977Q11.48 4 10.308 4q-1.163 0-1.966.821q-.804.821-.804 1.987v8.73q-.005 1.853 1.283 3.157Q10.11 20 11.96 20q1.823 0 3.1-1.305t1.287-3.156v-8.77h1z"})});
2
+ //# sourceMappingURL=PaperClipIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PaperClipIcon.js","sources":["../../../../src/assets/Icons/PaperClipIcon.tsx"],"sourcesContent":["\nimport { ViewStyle } from \"react-native\";\nimport Svg, { Path } from \"react-native-svg\";\n\nexport const PaperClipIcon = ({\n style,\n color,\n}: {\n style?: ViewStyle;\n color?: string;\n}) => {\n return (\n <Svg style={style} fill={color} viewBox=\"0 0 24 24\">\n <Path d=\"M17.346 15.539q0 2.271-1.565 3.866T11.952 21t-3.838-1.595t-1.576-3.867v-8.73q0-1.587 1.092-2.697Q8.72 3 10.308 3t2.678 1.11t1.091 2.698v8.269q0 .88-.615 1.517q-.614.637-1.498.637t-1.52-.627t-.636-1.527V6.769h1v8.308q0 .479.327.816q.328.338.807.338t.807-.338t.328-.816V6.789q-.006-1.166-.802-1.977Q11.48 4 10.308 4q-1.163 0-1.966.821q-.804.821-.804 1.987v8.73q-.005 1.853 1.283 3.157Q10.11 20 11.96 20q1.823 0 3.1-1.305t1.287-3.156v-8.77h1z\"></Path>\n </Svg>\n );\n};\n"],"names":["PaperClipIcon","style","color","_jsx","Svg","fill","viewBox","children","jsx","Path","d"],"mappings":"oGAI6BA,EAC3BC,QACAC,WAMEC,EAAAA,IAACC,EAAG,CAACH,MAAOA,EAAOI,KAAMH,EAAOI,QAAQ,YAAWC,SACjDJ,EAAAK,IAACC,OAAI,CAACC,EAAE"}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react-native-svg"),r=require("react/jsx-runtime");exports.PaperPlaneIcon=({style:c,color:s})=>r.jsx(e,{style:c,viewBox:"0 0 24 24",children:r.jsxs(e.G,{fill:"none",strokeWidth:"1.5",stroke:s,children:[r.jsx(e.Path,{d:"m18.636 15.67l1.716-5.15c1.5-4.498 2.25-6.747 1.062-7.934s-3.436-.438-7.935 1.062L8.33 5.364C4.7 6.574 2.885 7.18 2.37 8.067a2.72 2.72 0 0 0 0 2.73c.515.888 2.33 1.493 5.96 2.704c.584.194.875.291 1.119.454c.236.158.439.361.597.597c.163.244.26.535.454 1.118c1.21 3.63 1.816 5.446 2.703 5.962a2.72 2.72 0 0 0 2.731 0c.887-.516 1.492-2.331 2.703-5.962Z"}),r.jsx(e.Path,{strokeLinecap:"round",d:"m17.79 6.21l-4.211 4.165",opacity:".5"})]})});
2
+ //# sourceMappingURL=PaperPlaneIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PaperPlaneIcon.js","sources":["../../../../src/assets/Icons/PaperPlaneIcon.tsx"],"sourcesContent":["import { ViewStyle } from \"react-native\";\n\nimport Svg, { G, Path } from \"react-native-svg\";\n\nexport const PaperPlaneIcon = ({\n style,\n color,\n}: {\n style?: ViewStyle;\n color?: string;\n}) => {\n return (\n <Svg style={style} viewBox=\"0 0 24 24\">\n <G fill=\"none\" strokeWidth=\"1.5\" stroke={color}>\n <Path d=\"m18.636 15.67l1.716-5.15c1.5-4.498 2.25-6.747 1.062-7.934s-3.436-.438-7.935 1.062L8.33 5.364C4.7 6.574 2.885 7.18 2.37 8.067a2.72 2.72 0 0 0 0 2.73c.515.888 2.33 1.493 5.96 2.704c.584.194.875.291 1.119.454c.236.158.439.361.597.597c.163.244.26.535.454 1.118c1.21 3.63 1.816 5.446 2.703 5.962a2.72 2.72 0 0 0 2.731 0c.887-.516 1.492-2.331 2.703-5.962Z\"></Path>\n <Path\n strokeLinecap=\"round\"\n d=\"m17.79 6.21l-4.211 4.165\"\n opacity=\".5\"\n ></Path>\n </G>\n </Svg>\n );\n};\n"],"names":["PaperPlaneIcon","style","color","_jsx","Svg","viewBox","children","_jsxs","jsxs","G","fill","strokeWidth","stroke","jsx","Path","d","strokeLinecap","opacity"],"mappings":"qGAI8BA,EAC5BC,QACAC,WAMEC,EAAAA,IAACC,EAAG,CAACH,MAAOA,EAAOI,QAAQ,YAAWC,SACpCC,EAAAC,KAACC,IAAC,CAACC,KAAK,OAAOC,YAAY,MAAMC,OAAQV,EAAMI,SAAA,CAC7CH,EAAAU,IAACC,OAAI,CAACC,EAAE,kWACRZ,EAAAU,IAACC,OAAI,CACHE,cAAc,QACdD,EAAE,2BACFE,QAAQ"}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react-native-svg"),r=require("react/jsx-runtime");exports.PauseIcon=({style:l,color:a})=>r.jsx(e,{style:l,viewBox:"0 0 15 15",children:r.jsx(e.Path,{fill:a,fillRule:"evenodd",d:"M6.05 2.75a.55.55 0 0 0-1.1 0v9.5a.55.55 0 0 0 1.1 0zm4 0a.55.55 0 0 0-1.1 0v9.5a.55.55 0 0 0 1.1 0z",clipRule:"evenodd"})});
2
+ //# sourceMappingURL=PauseIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PauseIcon.js","sources":["../../../../src/assets/Icons/PauseIcon.tsx"],"sourcesContent":["import { ViewStyle } from \"react-native\";\nimport Svg, { Path } from \"react-native-svg\";\n\nexport const PauseIcon = ({\n style,\n color,\n}: {\n style?: ViewStyle;\n color?: string;\n}) => {\n return (\n <Svg style={style} viewBox=\"0 0 15 15\">\n <Path\n fill={color}\n fillRule=\"evenodd\"\n d=\"M6.05 2.75a.55.55 0 0 0-1.1 0v9.5a.55.55 0 0 0 1.1 0zm4 0a.55.55 0 0 0-1.1 0v9.5a.55.55 0 0 0 1.1 0z\"\n clipRule=\"evenodd\"\n ></Path>\n </Svg>\n );\n};\n"],"names":["PauseIcon","style","color","_jsx","Svg","viewBox","children","jsx","Path","fill","fillRule","d","clipRule"],"mappings":"gGAGyBA,EACvBC,QACAC,WAMEC,EAAAA,IAACC,EAAG,CAACH,MAAOA,EAAOI,QAAQ,YAAWC,SACpCH,EAAAI,IAACC,OAAI,CACHC,KAAMP,EACNQ,SAAS,UACTC,EAAE,uGACFC,SAAS"}
@@ -0,0 +1,2 @@
1
+ "use strict";var t=require("react-native-svg"),e=require("react/jsx-runtime");exports.PlayIcon=({style:r,color:l})=>e.jsx(t,{style:r,viewBox:"0 0 24 24",children:e.jsx(t.Path,{fill:l,d:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"})});
2
+ //# sourceMappingURL=PlayIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlayIcon.js","sources":["../../../../src/assets/Icons/PlayIcon.tsx"],"sourcesContent":["import { ViewStyle } from \"react-native\";\n\nimport Svg, { Path } from \"react-native-svg\";\n\nexport const PlayIcon = ({\n style,\n color,\n}: {\n style?: ViewStyle;\n color?: string;\n}) => {\n return (\n <Svg style={style} viewBox=\"0 0 24 24\">\n <Path\n fill={color}\n d=\"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712\"\n ></Path>\n </Svg>\n );\n};\n"],"names":["PlayIcon","style","color","_jsx","Svg","viewBox","children","jsx","Path","fill","d"],"mappings":"+FAIwBA,EACtBC,QACAC,WAMEC,EAAAA,IAACC,EAAG,CAACH,MAAOA,EAAOI,QAAQ,YAAWC,SACpCH,EAAAI,IAACC,OAAI,CACHC,KAAMP,EACNQ,EAAE"}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react-native-svg"),r=require("twrnc"),t=require("react/jsx-runtime");exports.XIcon=function({style:n}){return t.jsxs(e.Svg,{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:r.style("feather feather-x",n),children:[t.jsx(e.Line,{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx(e.Line,{x1:"6",y1:"6",x2:"18",y2:"18"})]})};
2
+ //# sourceMappingURL=XIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"XIcon.js","sources":["../../../../src/assets/Icons/XIcon.tsx"],"sourcesContent":["import { ViewStyle } from \"react-native\";\nimport { Line, Svg } from \"react-native-svg\";\nimport tw from \"twrnc\"; // assuming you're using twrnc for styling\n\nexport function XIcon({ style }: { style?: ViewStyle }) {\n return (\n <Svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={tw.style(\"feather feather-x\", style)} \n >\n <Line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"></Line>\n <Line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"></Line>\n </Svg>\n );\n}\n"],"names":["style","_jsxs","Svg","viewBox","fill","stroke","strokeWidth","strokeLinecap","strokeLinejoin","tw","children","_jsx","jsx","Line","x1","y1","x2","y2"],"mappings":"+GAIO,UAAeA,MAAEA,IACtB,OACEC,EAAAA,KAACC,EAAAA,IAAG,CACFC,QAAQ,YACRC,KAAK,OACLC,OAAO,eACPC,YAAY,IACZC,cAAc,QACdC,eAAe,QACfR,MAAOS,EAAGT,MAAM,oBAAqBA,GAAOU,SAAA,CAE5CC,EAAAC,IAACC,OAAI,CAACC,GAAG,KAAKC,GAAG,IAAIC,GAAG,IAAIC,GAAG,OAC/BN,EAAAC,IAACC,OAAI,CAACC,GAAG,IAAIC,GAAG,IAAIC,GAAG,KAAKC,GAAG,SAGrC"}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react"),t=require("react-native"),s=require("react-native-reanimated"),r=require("react-native-sound"),n=require("twrnc"),a=require("../../assets/Icons/PauseIcon.js"),o=require("../../assets/Icons/PlayIcon.js"),u=require("../../context/AudioContext.js"),i=require("../../context/ChatContext.js"),l=require("../../utils/datefunc.js"),c=require("react/jsx-runtime");const d={code:"function AudioPlayerTsx1(){const{knobPosition}=this.__closure;return{transform:[{translateX:knobPosition.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/AudioPlayer/AudioPlayer.tsx",sourceMap:'{"version":3,"names":["AudioPlayerTsx1","knobPosition","__closure","transform","translateX","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/AudioPlayer/AudioPlayer.tsx"],"mappings":"AAoIyC,SAAAA,eAAMA,CAAA,QAAAC,YAAA,OAAAC,SAAA,CAC3C,MAAO,CACLC,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEH,YAAY,CAACI,KAAM,CAAC,CAChD,CAAC,CACH","ignoreList":[]}',version:"3.16.7"},A=({audioUrl:A,audioId:y,isVideoPlaying:h})=>{const{theme:C,CustomPlayIcon:p,CustomPauseIcon:m}=i.useChatContext(),{currentlyPlayingId:v,setCurrentlyPlayingId:f}=u.useAudio(),[P,g]=e.useState(null),[x,w]=e.useState(!1),[S,j]=e.useState(0),[b,I]=e.useState(0),[R,_]=e.useState(!1),q=e.useRef(null),E=e.useRef(0),k=e.useRef(0),M=e.useRef(0),N=s.useSharedValue(0);e.useEffect((()=>{let e=!0;const t=new r(A,"",(s=>{!s&&e&&I(t.getDuration())}));return g(t),()=>{e=!1,t&&(t.pause(),t.release())}}),[A]),e.useEffect((()=>{v&&v!==y&&x&&P&&(P.pause(),w(!1),j(0),N.value=0)}),[v,y,x,P]),e.useEffect((()=>{let e;return x&&P&&!R&&(e=setInterval((()=>{P.getCurrentTime((e=>{if("number"==typeof e&&!isNaN(e)&&(j(e),E.current>0&&b>0)){const t=e/b*E.current;isNaN(t)||(N.value=s.withSpring(t,{damping:15,stiffness:100}))}}))}),100)),()=>{e&&clearInterval(e)}}),[x,P,R,b]);const D=t.PanResponder.create({onStartShouldSetPanResponder:()=>!0,onMoveShouldSetPanResponder:()=>!0,onPanResponderGrant:e=>{_(!0),M.current=e.nativeEvent.pageX-N.value},onPanResponderMove:e=>{if(E.current>0){const t=e.nativeEvent.pageX-M.current,s=Math.max(0,Math.min(t,E.current));N.value=s;const r=s/E.current*b;isNaN(r)||j(r)}},onPanResponderRelease:()=>{if(_(!1),P&&E.current>0){const e=N.value/E.current*b;isNaN(e)||P.setCurrentTime(e)}},onPanResponderTerminate:()=>{_(!1)}}),V=s.useAnimatedStyle(function(){const e=[new global.Error,-2,-27],t=function(){return{transform:[{translateX:N.value}]}};return t.__closure={knobPosition:N},t.__workletHash=1935336866997,t.__initData=d,t.__stackDetails=e,t}());return e.useEffect((()=>{h&&x&&P&&P.pause((()=>{w(!1),f(null)}))}),[h]),c.jsxs(t.View,{style:n`rounded-lg w-56`,children:[c.jsxs(t.View,{style:n`flex-row items-center gap-2 px-2 pt-2`,children:[c.jsx(t.Pressable,{onPress:()=>{P&&(x?P.pause((()=>{w(!1),f(null)})):(f(y),P.play((e=>{e&&(w(!1),j(0),N.value=s.withSpring(0),f(null))})),w(!0)))},style:[n`bg-black/40 rounded-full p-2`,C?.messageStyle?.audioPlayButtonStyle],children:x?m?c.jsx(m,{}):c.jsx(a.PauseIcon,{style:n.style("h-6 w-6"),color:C?.colors?.audioPauseIconColor||"white"}):p?c.jsx(p,{}):c.jsx(o.PlayIcon,{style:n.style("h-6 w-6"),color:C?.colors?.audioPlayIconColor||"white"})}),c.jsxs(t.View,{ref:q,onLayout:e=>{const{width:t}=e.nativeEvent.layout;E.current=t,q.current?.measure(((e,t,s,r,n)=>{k.current=n}))},style:[n`relative h-1 bg-zinc-400 rounded overflow-visible w-[75%]`,C?.messageStyle?.progressBarStyle],children:[c.jsx(t.View,{style:[n`absolute h-full bg-slate-200`,{width:(b>0?S/b*100:0)+"%"},C?.messageStyle?.activeProgressBarStyle]}),c.jsx(s.View,{...D.panHandlers,style:[V,{position:"absolute",top:-6,width:16,height:16,borderRadius:8,backgroundColor:"white",shadowColor:"#000",shadowOffset:{width:0,height:2},shadowOpacity:.25,shadowRadius:3.84,elevation:5},{...C?.messageStyle?.audioKnobStyle}]})]})]}),c.jsx(t.View,{style:n`px-4 py-1`,children:c.jsx(t.Text,{style:[n`text-xs text-gray-500`,C?.messageStyle?.audioDurationStyle],children:isNaN(S)?"0:00":l.formatDuration(S)})})]})};var y=e.memo(A);module.exports=y;
2
+ //# sourceMappingURL=AudioPlayer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AudioPlayer.js","sources":["../../../../src/components/AudioPlayer/AudioPlayer.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport { PanResponder, Pressable, Text, View } from 'react-native';\nimport Animated, {\n useAnimatedStyle,\n useSharedValue,\n withSpring,\n} from 'react-native-reanimated';\nimport Sound from 'react-native-sound';\nimport tw from 'twrnc';\nimport { PauseIcon } from '../../assets/Icons/PauseIcon';\nimport { PlayIcon } from '../../assets/Icons/PlayIcon';\nimport { useAudio } from '../../context/AudioContext';\nimport { useChatContext } from '../../context/ChatContext';\nimport { formatDuration } from '../../utils/datefunc';\nimport { AudioPlayerProps } from './types';\n\nconst AudioPlayer: React.FC<AudioPlayerProps> = ({\n audioUrl,\n audioId,\n isVideoPlaying,\n}) => {\n const { theme, CustomPlayIcon, CustomPauseIcon } = useChatContext();\n const { currentlyPlayingId, setCurrentlyPlayingId } = useAudio();\n const [sound, setSound] = useState<Sound | null>(null);\n const [isPlaying, setIsPlaying] = useState(false);\n const [currentTime, setCurrentTime] = useState(0);\n const [duration, setDuration] = useState(0);\n const [isDragging, setIsDragging] = useState(false);\n const progressRef = useRef<View>(null);\n const progressWidth = useRef(0);\n const progressX = useRef(0);\n const startX = useRef(0);\n const knobPosition = useSharedValue(0);\n\n // Initialize sound\n useEffect(() => {\n let mounted = true;\n const newSound = new Sound(audioUrl, '', (error) => {\n if (!error && mounted) {\n setDuration(newSound.getDuration());\n }\n });\n setSound(newSound);\n\n return () => {\n mounted = false;\n if (newSound) {\n newSound.pause();\n newSound.release();\n }\n };\n }, [audioUrl]);\n\n // Handle stopping playback when another audio starts\n useEffect(() => {\n if (\n currentlyPlayingId &&\n currentlyPlayingId !== audioId &&\n isPlaying &&\n sound\n ) {\n sound.pause();\n setIsPlaying(false);\n setCurrentTime(0);\n knobPosition.value = 0;\n }\n }, [currentlyPlayingId, audioId, isPlaying, sound]);\n\n // Update progress\n useEffect(() => {\n let interval: ReturnType<typeof setInterval>;\n if (isPlaying && sound && !isDragging) {\n interval = setInterval(() => {\n sound.getCurrentTime((seconds) => {\n if (typeof seconds === 'number' && !isNaN(seconds)) {\n setCurrentTime(seconds);\n if (progressWidth.current > 0 && duration > 0) {\n const progress = (seconds / duration) * progressWidth.current;\n if (!isNaN(progress)) {\n knobPosition.value = withSpring(progress, {\n damping: 15,\n stiffness: 100,\n });\n }\n }\n }\n });\n }, 100);\n }\n return () => {\n if (interval) clearInterval(interval);\n };\n }, [isPlaying, sound, isDragging, duration]);\n\n const panResponder = PanResponder.create({\n onStartShouldSetPanResponder: () => true,\n onMoveShouldSetPanResponder: () => true,\n onPanResponderGrant: (evt) => {\n setIsDragging(true);\n startX.current = evt.nativeEvent.pageX - knobPosition.value;\n },\n onPanResponderMove: (evt) => {\n if (progressWidth.current > 0) {\n const newPosition = evt.nativeEvent.pageX - startX.current;\n const boundedPosition = Math.max(\n 0,\n Math.min(newPosition, progressWidth.current)\n );\n knobPosition.value = boundedPosition;\n\n const percentage = boundedPosition / progressWidth.current;\n const newTime = percentage * duration;\n if (!isNaN(newTime)) {\n setCurrentTime(newTime);\n }\n }\n },\n onPanResponderRelease: () => {\n setIsDragging(false);\n if (sound && progressWidth.current > 0) {\n const percentage = knobPosition.value / progressWidth.current;\n const newTime = percentage * duration;\n if (!isNaN(newTime)) {\n sound.setCurrentTime(newTime);\n }\n }\n },\n onPanResponderTerminate: () => {\n setIsDragging(false);\n },\n });\n\n const animatedStyle = useAnimatedStyle(() => {\n return {\n transform: [{ translateX: knobPosition.value }],\n };\n });\n\n const togglePlay = () => {\n if (!sound) return;\n\n if (isPlaying) {\n sound.pause(() => {\n setIsPlaying(false);\n setCurrentlyPlayingId(null);\n });\n } else {\n setCurrentlyPlayingId(audioId);\n sound.play((success) => {\n if (success) {\n setIsPlaying(false);\n setCurrentTime(0);\n knobPosition.value = withSpring(0);\n setCurrentlyPlayingId(null);\n }\n });\n setIsPlaying(true);\n }\n };\n\n // Stop audio when video starts playing\n useEffect(() => {\n if (isVideoPlaying && isPlaying && sound) {\n sound.pause(() => {\n setIsPlaying(false);\n setCurrentlyPlayingId(null);\n });\n }\n }, [isVideoPlaying]);\n\n return (\n <View style={tw`rounded-lg w-56`}>\n <View style={tw`flex-row items-center gap-2 px-2 pt-2`}>\n <Pressable\n onPress={togglePlay}\n style={[\n tw`bg-black/40 rounded-full p-2`,\n theme?.messageStyle?.audioPlayButtonStyle,\n ]}\n >\n {isPlaying ? (\n CustomPauseIcon ? (\n <CustomPauseIcon />\n ) : (\n <PauseIcon\n style={tw.style('h-6 w-6')}\n color={theme?.colors?.audioPauseIconColor || 'white'}\n />\n )\n ) : CustomPlayIcon ? (\n <CustomPlayIcon />\n ) : (\n <PlayIcon\n style={tw.style('h-6 w-6')}\n color={theme?.colors?.audioPlayIconColor || 'white'}\n />\n )}\n </Pressable>\n\n <View\n ref={progressRef}\n onLayout={(e) => {\n const { width } = e.nativeEvent.layout;\n progressWidth.current = width;\n progressRef.current?.measure((_, __, ___, ____, pageX) => {\n progressX.current = pageX;\n });\n }}\n style={[\n tw`relative h-1 bg-zinc-400 rounded overflow-visible w-[75%]`,\n theme?.messageStyle?.progressBarStyle,\n ]}\n >\n <View\n style={[\n tw`absolute h-full bg-slate-200`,\n {\n width: `${duration > 0 ? (currentTime / duration) * 100 : 0}%`,\n },\n theme?.messageStyle?.activeProgressBarStyle,\n ]}\n />\n <Animated.View\n {...panResponder.panHandlers}\n style={[\n animatedStyle,\n {\n position: 'absolute',\n top: -6,\n width: 16,\n height: 16,\n borderRadius: 8,\n backgroundColor: 'white',\n shadowColor: '#000',\n shadowOffset: { width: 0, height: 2 },\n shadowOpacity: 0.25,\n shadowRadius: 3.84,\n elevation: 5,\n },\n { ...theme?.messageStyle?.audioKnobStyle },\n ]}\n />\n </View>\n </View>\n <View style={tw`px-4 py-1`}>\n <Text\n style={[\n tw`text-xs text-gray-500`,\n theme?.messageStyle?.audioDurationStyle,\n ]}\n >\n {!isNaN(currentTime) ? formatDuration(currentTime) : '0:00'}\n </Text>\n </View>\n </View>\n );\n};\n\nexport default React.memo(AudioPlayer);\n"],"names":["_worklet_1935336866997_init_data","code","location","sourceMap","version","AudioPlayer","audioUrl","audioId","isVideoPlaying","theme","CustomPlayIcon","CustomPauseIcon","useChatContext","currentlyPlayingId","setCurrentlyPlayingId","useAudio","sound","setSound","useState","isPlaying","setIsPlaying","currentTime","setCurrentTime","duration","setDuration","isDragging","setIsDragging","progressRef","useRef","progressWidth","progressX","startX","knobPosition","useSharedValue","useEffect","mounted","newSound","Sound","error","getDuration","pause","release","value","interval","setInterval","getCurrentTime","seconds","isNaN","current","progress","withSpring","damping","stiffness","clearInterval","panResponder","PanResponder","create","onStartShouldSetPanResponder","onMoveShouldSetPanResponder","onPanResponderGrant","evt","nativeEvent","pageX","onPanResponderMove","newPosition","boundedPosition","Math","max","min","newTime","onPanResponderRelease","onPanResponderTerminate","animatedStyle","useAnimatedStyle","_e","global","Error","AudioPlayerTsx1","transform","translateX","__closure","__workletHash","__initData","__stackDetails","_jsxs","View","style","tw","children","jsxs","_jsx","jsx","Pressable","onPress","togglePlay","play","success","messageStyle","audioPlayButtonStyle","PauseIcon","color","colors","audioPauseIconColor","PlayIcon","audioPlayIconColor","ref","onLayout","e","width","layout","measure","_","__","___","____","progressBarStyle","activeProgressBarStyle","Animated","panHandlers","position","top","height","borderRadius","backgroundColor","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","audioKnobStyle","Text","audioDurationStyle","formatDuration","AudioPlayer$1","React","memo"],"mappings":"wYAasD,MAAAA,EAAA,CAAAC,KAAA,sHAAAC,SAAA,yFAAAC,UAAA,8WAAAC,QAAA,UAGhDC,EAA0CA,EAC9CC,WACAC,UACAC,qBAEA,MAAMC,MAAEA,EAAKC,eAAEA,EAAcC,gBAAEA,GAAoBC,oBAC7CC,mBAAEA,EAAkBC,sBAAEA,GAA0BC,cAC/CC,EAAOC,GAAYC,EAAAA,SAAuB,OAC1CC,EAAWC,GAAgBF,EAAAA,UAAS,IACpCG,EAAaC,GAAkBJ,EAAAA,SAAS,IACxCK,EAAUC,GAAeN,EAAAA,SAAS,IAClCO,EAAYC,GAAiBR,EAAAA,UAAS,GACvCS,EAAcC,EAAMA,OAAO,MAC3BC,EAAgBD,EAAMA,OAAC,GACvBE,EAAYF,EAAMA,OAAC,GACnBG,EAASH,EAAMA,OAAC,GAChBI,EAAeC,EAAcA,eAAC,GAGpCC,EAAAA,WAAU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ACFgF,MAAChF,EAAc,CAAA,GAEfgF,EAAAC,IAACY,WAAQ,CACPjB,MAAOC,EAAGD,MAAM,WAChBc,MAAO3F,GAAO4F,QAAQG,oBAAsB,YAKlDpB,EAAAK,KAACJ,OAAI,CACHoB,IAAK9E,EACL+E,SAAWC,IACT,MAAMC,MAAEA,GAAUD,EAAE9C,YAAYgD,OAChChF,EAAcmB,QAAU4D,EAC1BjF,EAAYqB,SAAS8D,SAAQ,CAACC,EAAGC,EAAIC,EAAKC,EAAMpD,KAC9ChC,EAAUkB,QAAUc,CAAK,GACzB,EAEFwB,MAAO,CACLC,CAAE,4DACF9E,GAAOwF,cAAckB,kBACrB3B,SAAA,CAEFE,EAAAC,IAACN,OAAI,CACHC,MAAO,CACLC,CAAE,+BACF,CACEqB,OAAUrF,EAAW,EAAKF,EAAcE,EAAY,IAAM,GAAnD,KAETd,GAAOwF,cAAcmB,0BAGzB1B,EAAAA,IAAC2B,EAAShC,KAAI,IACR/B,EAAagE,YACjBhC,MAAO,CACLd,EACA,CACE+C,SAAU,WACVC,KAAO,EACPZ,MAAO,GACPa,OAAQ,GACRC,aAAc,EACdC,gBAAiB,QACjBC,YAAa,OACbC,aAAc,CAAEjB,MAAO,EAAGa,OAAQ,GAClCK,cAAe,IACfC,aAAc,KACdC,UAAW,GAEb,IAAKvH,GAAOwF,cAAcgC,yBAKlCvC,EAAAC,IAACN,OAAI,CAACC,MAAOC,CAAE,YAAYC,SACzBE,EAAAC,IAACuC,OAAI,CACH5C,MAAO,CACLC,CAAE,wBACF9E,GAAOwF,cAAckC,oBACrB3C,SAEAzC,MAAM1B,GAA6C,OAA9B+G,EAAcA,eAAC/G,SAGrC,EAIX,IAAAgH,EAAeC,EAAMC,KAAKlI"}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react"),t=require("react-native"),s=require("twrnc"),r=require("../../assets/Icons/ArrowBack2RoundedIcon.js"),l=require("../../context/ChatContext.js"),a=require("./MessageContent.js"),i=require("./MessageStatus.js"),o=require("react/jsx-runtime");const n=({message:e,isCurrentUser:n,isFirstInSequence:u,onLongPress:d})=>{const{theme:c,showAvatars:b,showUserNames:m,showBubbleTail:x,setMediaUrl:g,setIsVideoPlaying:h,isVideoPlaying:y}=l.useChatContext();return o.jsxs(t.Pressable,{onLongPress:d,style:[s`px-2 my-1 max-w-[75%] relative`,n?s`self-end mr-3`:s`self-start ml-9`,u?n?s`bg-green-500 rounded-tr-none`:s`bg-white rounded-tl-none`:n?s`bg-green-500`:s`bg-white`,{borderRadius:8,...n?c?.bubbleStyle?.sent:c?.bubbleStyle?.received}],children:[!n&&u&&b&&o.jsxs(o.Fragment,{children:[o.jsx(t.View,{style:s`absolute w-6 h-6 rounded-full top-0 -left-9 flex-row items-center`,children:e.senderAvatar?o.jsx(t.Image,{source:{uri:e.senderAvatar},style:[s`w-full h-full rounded-full`,c?.bubbleStyle?.avatarImageStyle],resizeMode:"cover"}):o.jsx(t.Text,{style:[s`text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5`,c?.bubbleStyle?.avatarTextStyle],children:e.senderName?.charAt(0)})}),m&&e.senderName&&o.jsx(t.Text,{style:[s`text-sm text-black font-semibold mt-1 capitalize`,c?.bubbleStyle?.userNameStyle],children:e.senderName})]}),u&&x&&o.jsx(r.ArrowBack2RoundedIcon,{style:s.style("absolute -top-1 w-6 h-6",n?"-right-3.5":"-left-3.5 mt-[1.25px]",{transform:[{rotate:n?"90deg":"180deg"}]}),color:n?`${c?.colors?.sentMessageTailColor||"rgba(34, 197, 94,1)"}`:`${c?.colors?.receivedMessageTailColor||"white"}`}),o.jsx(a,{message:e,isCurrentUser:n,isFirstInSequence:u,onMediaPress:(e,t)=>{g({imageUrl:"image"===e?t:"",videoUrl:"video"===e?t:""}),"video"===e&&h(!0)},isVideoPlaying:y}),o.jsx(i,{time:e.time,status:n?e.status:void 0,isCurrentUser:n,hasText:!!e.text,hasAudio:!!e.audio})]})};var u=e.memo(n);module.exports=u;
2
+ //# sourceMappingURL=ChatBubble.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatBubble.js","sources":["../../../../src/components/ChatBubble/ChatBubble.tsx"],"sourcesContent":["import React from 'react';\nimport { Image, Pressable, Text, View } from 'react-native';\nimport tw from 'twrnc';\nimport { ArrowBack2RoundedIcon } from '../../assets/Icons/ArrowBack2RoundedIcon';\nimport { useChatContext } from '../../context/ChatContext';\nimport MessageContent from './MessageContent';\nimport MessageStatus from './MessageStatus';\nimport { ChatBubbleProps } from './types';\n\nconst ChatBubble: React.FC<ChatBubbleProps> = ({\n message,\n isCurrentUser,\n isFirstInSequence,\n onLongPress,\n}) => {\n const {\n theme,\n showAvatars,\n showUserNames,\n showBubbleTail,\n setMediaUrl,\n setIsVideoPlaying,\n isVideoPlaying,\n } = useChatContext();\n\n const handleMediaPress = (type: 'image' | 'video', url: string) => {\n setMediaUrl({\n imageUrl: type === 'image' ? url : '',\n videoUrl: type === 'video' ? url : '',\n });\n if (type === 'video') {\n setIsVideoPlaying(true);\n }\n };\n\n return (\n <Pressable\n onLongPress={onLongPress}\n style={[\n tw`px-2 my-1 max-w-[75%] relative`,\n isCurrentUser ? tw`self-end mr-3` : tw`self-start ml-9`,\n isFirstInSequence\n ? isCurrentUser\n ? tw`bg-green-500 rounded-tr-none`\n : tw`bg-white rounded-tl-none`\n : isCurrentUser\n ? tw`bg-green-500`\n : tw`bg-white`,\n {\n borderRadius: 8,\n ...(isCurrentUser\n ? theme?.bubbleStyle?.sent\n : theme?.bubbleStyle?.received),\n },\n ]}\n >\n {/* Avatar & Sender Name for Group Chat */}\n {!isCurrentUser && isFirstInSequence && showAvatars && (\n <>\n <View\n style={tw`absolute w-6 h-6 rounded-full top-0 -left-9 flex-row items-center`}\n >\n {message.senderAvatar ? (\n <Image\n source={{ uri: message.senderAvatar }}\n style={[\n tw`w-full h-full rounded-full`,\n theme?.bubbleStyle?.avatarImageStyle,\n ]}\n resizeMode=\"cover\"\n />\n ) : (\n <Text\n style={[\n tw`text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5`,\n theme?.bubbleStyle?.avatarTextStyle,\n ]}\n >\n {message.senderName?.charAt(0)}\n </Text>\n )}\n </View>\n {showUserNames && message.senderName && (\n <Text\n style={[\n tw`text-sm text-black font-semibold mt-1 capitalize`,\n theme?.bubbleStyle?.userNameStyle,\n ]}\n >\n {message.senderName}\n </Text>\n )}\n </>\n )}\n\n {/* Bubble Tail */}\n {isFirstInSequence && showBubbleTail && (\n <ArrowBack2RoundedIcon\n style={tw.style(\n 'absolute -top-1 w-6 h-6',\n isCurrentUser ? '-right-3.5' : '-left-3.5 mt-[1.25px]',\n {\n transform: [{ rotate: isCurrentUser ? '90deg' : '180deg' }],\n }\n )}\n color={\n isCurrentUser\n ? `${\n theme?.colors?.sentMessageTailColor || 'rgba(34, 197, 94,1)'\n }`\n : `${theme?.colors?.receivedMessageTailColor || 'white'}`\n }\n />\n )}\n\n {/* Message Content */}\n <MessageContent\n message={message}\n isCurrentUser={isCurrentUser}\n isFirstInSequence={isFirstInSequence}\n onMediaPress={handleMediaPress}\n isVideoPlaying={isVideoPlaying}\n />\n\n {/* Message Status */}\n <MessageStatus\n time={message.time}\n status={isCurrentUser ? message.status : undefined}\n isCurrentUser={isCurrentUser}\n hasText={!!message.text}\n hasAudio={!!message.audio}\n />\n </Pressable>\n );\n};\n\nexport default React.memo(ChatBubble);\n"],"names":["ChatBubble","message","isCurrentUser","isFirstInSequence","onLongPress","theme","showAvatars","showUserNames","showBubbleTail","setMediaUrl","setIsVideoPlaying","isVideoPlaying","useChatContext","_jsxs","Pressable","style","tw","borderRadius","bubbleStyle","sent","received","children","jsxs","_Fragment","_jsx","jsx","View","senderAvatar","Image","source","uri","avatarImageStyle","resizeMode","Text","avatarTextStyle","senderName","charAt","userNameStyle","ArrowBack2RoundedIcon","transform","rotate","color","colors","sentMessageTailColor","receivedMessageTailColor","MessageContent","onMediaPress","handleMediaPress","type","url","imageUrl","videoUrl","MessageStatus","time","status","undefined","hasText","text","hasAudio","audio","ChatBubble$1","React","memo"],"mappings":"oRASA,MAAMA,EAAwCA,EAC5CC,UACAC,gBACAC,oBACAC,kBAEA,MAAMC,MACJA,EAAKC,YACLA,EAAWC,cACXA,EAAaC,eACbA,EAAcC,YACdA,EAAWC,kBACXA,EAAiBC,eACjBA,GACEC,mBAYJ,OACEC,EAAAA,KAACC,EAAAA,UAAS,CACRV,YAAaA,EACbW,MAAO,CACLC,CAAE,iCACFd,EAAgBc,CAAE,gBAAkBA,CAAE,kBACtCb,EACID,EACEc,CAAE,+BACFA,CAAE,2BACJd,EACEc,CAAE,eACFA,CAAE,WACR,CACEC,aAAc,KACVf,EACAG,GAAOa,aAAaC,KACpBd,GAAOa,aAAaE,WAE1BC,SAAA,EAGAnB,GAAiBC,GAAqBG,GACtCO,EAAAS,KAAAC,WAAA,CAAAF,SAAA,CACEG,EAAAC,IAACC,OAAI,CACHX,MAAOC,CAAE,oEAAoEK,SAE5EpB,EAAQ0B,aACPH,EAAAA,IAACI,EAAAA,MAAK,CACJC,OAAQ,CAAEC,IAAK7B,EAAQ0B,cACvBZ,MAAO,CACLC,CAAE,6BACFX,GAAOa,aAAaa,kBAEtBC,WAAW,UAGbR,EAAAC,IAACQ,OAAI,CACHlB,MAAO,CACLC,CAAE,wGACFX,GAAOa,aAAagB,iBACpBb,SAEDpB,EAAQkC,YAAYC,OAAO,OAIjC7B,GAAiBN,EAAQkC,YACxBX,EAAAA,IAACS,EAAAA,KAAI,CACHlB,MAAO,CACLC,CAAE,mDACFX,GAAOa,aAAamB,eACpBhB,SAEDpB,EAAQkC,gBAOhBhC,GAAqBK,GACpBgB,EAAAA,IAACc,EAAAA,sBAAqB,CACpBvB,MAAOC,EAAGD,MACR,0BACAb,EAAgB,aAAe,wBAC/B,CACEqC,UAAW,CAAC,CAAEC,OAAQtC,EAAgB,QAAU,aAGpDuC,MACEvC,EACI,GACEG,GAAOqC,QAAQC,sBAAwB,wBAEzC,GAAGtC,GAAOqC,QAAQE,0BAA4B,YAMxDpB,EAAAC,IAACoB,EAAc,CACb5C,QAASA,EACTC,cAAeA,EACfC,kBAAmBA,EACnB2C,aA/FmBC,CAACC,EAAyBC,KACjDxC,EAAY,CACVyC,SAAmB,UAATF,EAAmBC,EAAM,GACnCE,SAAmB,UAATH,EAAmBC,EAAM,KAExB,UAATD,GACFtC,GAAkB,EACpB,EAyFIC,eAAgBA,IAIlBa,EAAAC,IAAC2B,EAAa,CACZC,KAAMpD,EAAQoD,KACdC,OAAQpD,EAAgBD,EAAQqD,YAASC,EACzCrD,cAAeA,EACfsD,UAAWvD,EAAQwD,KACnBC,WAAYzD,EAAQ0D,UAEZ,EAIhB,IAAAC,EAAeC,EAAMC,KAAK9D"}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react"),t=require("react-native"),s=require("react-native-video"),r=require("twrnc"),i=require("../../assets/Icons/LoadingIcon.js"),o=require("../../assets/Icons/PlayIcon.js"),l=require("../../context/ChatContext.js"),a=require("../../utils/datefunc.js"),n=require("../AudioPlayer/AudioPlayer.js"),d=require("react/jsx-runtime");const u=({message:u,onMediaPress:c,isVideoPlaying:x})=>{const{theme:y,showMessageStatus:h,CustomPlayIcon:j,renderCustomVideoBubbleError:m}=l.useChatContext(),b=e.useRef(null),[f,w]=e.useState(0),[g,v]=e.useState(!1),[P,p]=e.useState(!1);return d.jsxs(t.View,{children:[u.image&&d.jsx(t.Pressable,{onPress:()=>c("image",u.image),style:r`w-60 h-80 my-2`,children:d.jsx(t.Image,{source:{uri:u.image},style:r`w-full h-full object-contain rounded-lg`})}),u.video&&d.jsxs(t.Pressable,{onPress:()=>c("video",u.video),style:r`w-60 h-80 my-2 justify-center items-center`,disabled:g,children:[d.jsx(s,{source:{uri:u.video},ref:b,paused:!0,style:{width:"100%",height:"100%",borderRadius:8,position:"relative"},resizeMode:"cover",onLoadStart:()=>{v(!0),p(!1)},onLoad:e=>{w(e.duration),v(!1)},onBuffer:({isBuffering:e})=>v(e),onError:()=>{p(!0),v(!1)}}),g?d.jsx(t.View,{style:r`absolute inset-0 flex items-center justify-center bg-black/40 rounded-full`,children:d.jsx(i.LoadingIcon,{style:r.style("h-12 w-12 fill-white animate-spin")})}):P?m?m():d.jsx(t.View,{style:r`absolute inset-0 flex items-center justify-center bg-red-500/60 p-2`,children:d.jsx(t.Text,{style:r`text-white font-bold`,children:"Failed to load video"})}):d.jsxs(d.Fragment,{children:[d.jsx(t.View,{style:r`absolute bg-black/40 rounded-full`,children:j?d.jsx(j,{}):d.jsx(o.PlayIcon,{style:r.style("h-16 w-16"),color:y?.colors?.audioPlayIconColor||"white"})}),d.jsx(t.View,{style:r`absolute bottom-2 left-2 bg-black/50 px-2 py-1 rounded-md`,children:d.jsx(t.Text,{style:r`text-white text-xs font-semibold`,children:a.formatDuration(f)})})]})]}),u.audio&&d.jsx(t.View,{style:r`my-2`,children:d.jsx(n,{audioUrl:u.audio,audioId:u.id,isVideoPlaying:x})}),u.text&&d.jsx(t.Text,{style:[r`text-gray-800 pt-1`,h?r`pb-0`:r`pb-2`,{wordBreak:"break-word",overflowWrap:"break-word"},y?.messageStyle?.textStyle],children:u.text})]})};var c=e.memo(u);module.exports=c;
2
+ //# sourceMappingURL=MessageContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MessageContent.js","sources":["../../../../src/components/ChatBubble/MessageContent.tsx"],"sourcesContent":["import React from 'react';\nimport { Image, Pressable, Text, View } from 'react-native';\nimport Video, { VideoRef } from 'react-native-video';\nimport tw from 'twrnc';\nimport { LoadingIcon } from '../../assets/Icons/LoadingIcon';\nimport { PlayIcon } from '../../assets/Icons/PlayIcon';\nimport { useChatContext } from '../../context/ChatContext';\nimport { formatDuration } from '../../utils/datefunc';\nimport AudioPlayer from '../AudioPlayer/AudioPlayer';\nimport { MessageContentProps } from './types';\n\nconst MessageContent: React.FC<MessageContentProps> = ({\n message,\n onMediaPress,\n isVideoPlaying,\n}) => {\n const {\n theme,\n showMessageStatus,\n CustomPlayIcon,\n renderCustomVideoBubbleError,\n } = useChatContext();\n const videoRef = React.useRef<VideoRef>(null);\n const [duration, setDuration] = React.useState(0);\n const [videoIsLoading, setVideoIsLoading] = React.useState(false);\n const [videoHasError, setVideoHasError] = React.useState(false);\n\n return (\n <View>\n {message.image && (\n <Pressable\n onPress={() => onMediaPress('image', message.image as string)}\n style={tw`w-60 h-80 my-2`}\n >\n <Image\n source={{ uri: message.image }}\n style={tw`w-full h-full object-contain rounded-lg`}\n />\n </Pressable>\n )}\n\n {message.video && (\n <Pressable\n onPress={() => onMediaPress('video', message.video as string)}\n style={tw`w-60 h-80 my-2 justify-center items-center`}\n disabled={videoIsLoading}\n >\n <Video\n source={{ uri: message.video }}\n ref={videoRef}\n paused={true}\n style={{\n width: '100%',\n height: '100%',\n borderRadius: 8,\n position: 'relative',\n }}\n resizeMode=\"cover\"\n onLoadStart={() => {\n setVideoIsLoading(true);\n setVideoHasError(false);\n }}\n onLoad={(data) => {\n setDuration(data.duration);\n setVideoIsLoading(false);\n }}\n onBuffer={({ isBuffering }) => setVideoIsLoading(isBuffering)}\n onError={() => {\n setVideoHasError(true);\n setVideoIsLoading(false);\n }}\n />\n {videoIsLoading ? (\n <View\n style={tw`absolute inset-0 flex items-center justify-center bg-black/40 rounded-full`}\n >\n <LoadingIcon\n style={tw.style('h-12 w-12 fill-white animate-spin')}\n />\n </View>\n ) : videoHasError ? (\n renderCustomVideoBubbleError ? (\n renderCustomVideoBubbleError()\n ) : (\n <View\n style={tw`absolute inset-0 flex items-center justify-center bg-red-500/60 p-2`}\n >\n <Text style={tw`text-white font-bold`}>\n Failed to load video\n </Text>\n </View>\n )\n ) : (\n <>\n <View style={tw`absolute bg-black/40 rounded-full`}>\n {CustomPlayIcon ? (\n <CustomPlayIcon />\n ) : (\n <PlayIcon\n style={tw.style('h-16 w-16')}\n color={theme?.colors?.audioPlayIconColor || 'white'}\n />\n )}\n </View>\n <View\n style={tw`absolute bottom-2 left-2 bg-black/50 px-2 py-1 rounded-md`}\n >\n <Text style={tw`text-white text-xs font-semibold`}>\n {formatDuration(duration)}\n </Text>\n </View>\n </>\n )}\n </Pressable>\n )}\n\n {message.audio && (\n <View style={tw`my-2`}>\n <AudioPlayer\n audioUrl={message.audio}\n audioId={message.id}\n isVideoPlaying={isVideoPlaying as boolean}\n />\n </View>\n )}\n\n {message.text && (\n <Text\n style={[\n tw`text-gray-800 pt-1`,\n showMessageStatus ? tw`pb-0` : tw`pb-2`,\n { wordBreak: 'break-word', overflowWrap: 'break-word' },\n theme?.messageStyle?.textStyle,\n ]}\n >\n {message.text}\n </Text>\n )}\n </View>\n );\n};\n\nexport default React.memo(MessageContent);\n"],"names":["MessageContent","message","onMediaPress","isVideoPlaying","theme","showMessageStatus","CustomPlayIcon","renderCustomVideoBubbleError","useChatContext","videoRef","React","useRef","duration","setDuration","useState","videoIsLoading","setVideoIsLoading","videoHasError","setVideoHasError","_jsxs","View","children","image","_jsx","Pressable","onPress","style","tw","jsx","Image","source","uri","video","disabled","Video","ref","paused","width","height","borderRadius","position","resizeMode","onLoadStart","onLoad","data","onBuffer","isBuffering","onError","LoadingIcon","Text","jsxs","_Fragment","PlayIcon","color","colors","audioPlayIconColor","formatDuration","audio","AudioPlayer","audioUrl","audioId","id","text","wordBreak","overflowWrap","messageStyle","textStyle","MessageContent$1","memo"],"mappings":"qWAWA,MAAMA,EAAgDA,EACpDC,UACAC,eACAC,qBAEA,MAAMC,MACJA,EAAKC,kBACLA,EAAiBC,eACjBA,EAAcC,6BACdA,GACEC,mBACEC,EAAWC,EAAMC,OAAiB,OACjCC,EAAUC,GAAeH,EAAMI,SAAS,IACxCC,EAAgBC,GAAqBN,EAAMI,UAAS,IACpDG,EAAeC,GAAoBR,EAAMI,UAAS,GAEzD,OACEK,EAAAA,KAACC,EAAAA,KAAI,CAAAC,UACFpB,EAAQqB,OACPC,EAAAA,IAACC,EAAAA,UAAS,CACRC,QAASA,IAAMvB,EAAa,QAASD,EAAQqB,OAC7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AAE,mCAAmCN,SAC/CmC,EAAcA,eAAC5C,aAQ3BX,EAAQwD,OACPlC,EAAAA,IAACH,EAAAA,KAAI,CAACM,MAAOC,CAAE,OAAON,SACpBE,EAAAK,IAAC8B,EAAW,CACVC,SAAU1D,EAAQwD,MAClBG,QAAS3D,EAAQ4D,GACjB1D,eAAgBA,MAKrBF,EAAQ6D,MACPvC,EAAAA,IAAC0B,EAAAA,KAAI,CACHvB,MAAO,CACLC,CAAE,qBACFtB,EAAoBsB,CAAE,OAASA,CAAE,OACjC,CAAEoC,UAAW,aAAcC,aAAc,cACzC5D,GAAO6D,cAAcC,WACrB7C,SAEDpB,EAAQ6D,SAGR,EAIX,IAAAK,EAAezD,EAAM0D,KAAKpE"}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react"),t=require("react-native"),s=require("twrnc"),r=require("../../assets/Icons/CheckAllIcon.js"),l=require("../../assets/Icons/CheckIcon.js"),i=require("../../context/ChatContext.js"),o=require("react/jsx-runtime");const c=({time:e,status:c,isCurrentUser:n,hasText:a,hasAudio:h})=>{const{theme:u,showMessageStatus:x}=i.useChatContext();return o.jsx(o.Fragment,{children:x&&o.jsxs(t.View,{style:[s`flex-row items-center`,a?s`justify-end pb-1 ml-4`:h?s`absolute right-3 bottom-3`:s`absolute right-3 bottom-4 bg-black/50 px-2 py-1 rounded-md`],children:[o.jsx(t.Text,{style:[s`text-xs`,{color:a||h?u?.colors?.timestamp||"rgba(107, 114, 128, 0.7)":"white"}],children:e}),n&&o.jsxs(t.View,{style:s`ml-1 flex-row items-center`,children:["sent"===c&&o.jsx(l.CheckIcon,{style:s.style("fill-[#6B7280] h-4 w-4",{opacity:.7})}),"delivered"===c&&o.jsx(r.CheckAllIcon,{style:s.style("fill-[#6B7280] h-4 w-4",{opacity:.7})}),"read"===c&&o.jsx(r.CheckAllIcon,{style:s.style("fill-[#3B82F6] h-4 w-4",{opacity:.9})})]})]})})};var n=e.memo(c);module.exports=n;
2
+ //# sourceMappingURL=MessageStatus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MessageStatus.js","sources":["../../../../src/components/ChatBubble/MessageStatus.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport tw from 'twrnc';\nimport { CheckAllIcon } from '../../assets/Icons/CheckAllIcon';\nimport { CheckIcon } from '../../assets/Icons/CheckIcon';\nimport { useChatContext } from '../../context/ChatContext';\nimport { MessageStatusProps } from './types';\n\nconst MessageStatus: React.FC<MessageStatusProps> = ({\n time,\n status,\n isCurrentUser,\n hasText,\n hasAudio,\n}) => {\n const { theme, showMessageStatus } = useChatContext();\n return (\n <>\n {showMessageStatus && (\n <View\n style={[\n tw`flex-row items-center`,\n hasText\n ? tw`justify-end pb-1 ml-4`\n : hasAudio\n ? tw`absolute right-3 bottom-3`\n : tw`absolute right-3 bottom-4 bg-black/50 px-2 py-1 rounded-md`,\n ]}\n >\n <Text\n style={[\n tw`text-xs`,\n {\n color:\n hasText || hasAudio\n ? theme?.colors?.timestamp || 'rgba(107, 114, 128, 0.7)'\n : 'white',\n },\n ]}\n >\n {time}\n </Text>\n {isCurrentUser && (\n <View style={tw`ml-1 flex-row items-center`}>\n {status === 'sent' && (\n <CheckIcon\n style={tw.style('fill-[#6B7280] h-4 w-4', { opacity: 0.7 })}\n />\n )}\n {status === 'delivered' && (\n <CheckAllIcon\n style={tw.style('fill-[#6B7280] h-4 w-4', { opacity: 0.7 })}\n />\n )}\n {status === 'read' && (\n <CheckAllIcon\n style={tw.style('fill-[#3B82F6] h-4 w-4', { opacity: 0.9 })}\n />\n )}\n </View>\n )}\n </View>\n )}\n </>\n );\n};\n\nexport default React.memo(MessageStatus);\n"],"names":["MessageStatus","time","status","isCurrentUser","hasText","hasAudio","theme","showMessageStatus","useChatContext","_jsx","_Fragment","children","_jsxs","jsxs","View","style","tw","jsx","Text","color","colors","timestamp","CheckIcon","opacity","CheckAllIcon","MessageStatus$1","React","memo"],"mappings":"uPAQA,MAAMA,EAA8CA,EAClDC,OACAC,SACAC,gBACAC,UACAC,eAEA,MAAMC,MAAEA,EAAKC,kBAAEA,GAAsBC,mBACrC,OACEC,EAAAA,IAAAC,EAAAA,SAAA,CAAAC,SACGJ,GACCK,EAAAC,KAACC,OAAI,CACHC,MAAO,CACLC,CAAE,wBACFZ,EACIY,CAAE,wBACFX,EACEW,CAAE,4BACFA,CAAE,8DACRL,SAAA,CAEFF,EAAAQ,IAACC,OAAI,CACHH,MAAO,CACLC,CAAE,UACF,CACEG,MACEf,GAAWC,EACPC,GAAOc,QAAQC,WAAa,2BAC5B,UAERV,SAEDV,IAEFE,GACCS,EAAAC,KAACC,OAAI,CAACC,MAAOC,CAAE,6BAA6BL,UAC9B,SAAXT,GACCO,EAAAA,IAACa,EAAAA,UAAS,CACRP,MAAOC,EAAGD,MAAM,yBAA0B,CAAEQ,QAAS,OAG7C,cAAXrB,GACCO,EAAAA,IAACe,EAAAA,aAAY,CACXT,MAAOC,EAAGD,MAAM,yBAA0B,CAAEQ,QAAS,OAG7C,SAAXrB,GACCO,EAAAA,IAACe,EAAAA,aAAY,CACXT,MAAOC,EAAGD,MAAM,yBAA0B,CAAEQ,QAAS,cAOhE,EAIP,IAAAE,EAAeC,EAAMC,KAAK3B"}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("../../assets/Icons/CameraIcon.js"),s=require("../../assets/Icons/EmojiFunnySquareIcon.js"),t=require("../../assets/Icons/MicrophoneIcon.js"),o=require("../../assets/Icons/PaperClipIcon.js"),r=require("../../assets/Icons/PaperPlaneIcon.js"),n=require("react"),l=require("react-native"),i=require("../../context/ChatContext.js"),a=require("twrnc"),c=require("react/jsx-runtime");const u="ios"===l.Platform.OS?32:30,h=({onSendMessage:h,onTypingStart:m,onTypingEnd:x,onAttachmentPress:p,onCameraPress:d,onAudioRecordStart:j,onAudioRecordEnd:C,CustomEmojiIcon:y,CustomAttachmentIcon:I,CustomCameraIcon:g,CustomSendIcon:P,CustomMicrophoneIcon:S})=>{const[w,b]=n.useState(""),[f,M]=n.useState({height:u,isMultiline:!1}),{theme:q,currentUserId:E,showEmojiButton:O,showAttachmentsButton:v,showCameraButton:A,showVoiceRecordButton:T,placeholder:B}=i.useChatContext(),V=n.useCallback((e=>{const s=Math.min(Math.max(e.nativeEvent.contentSize.height,u),118);M({height:s,isMultiline:s>u})}),[]),R=n.useCallback((()=>{w.trim()&&(h({text:w.trim(),senderId:E}),b(""),M({height:u,isMultiline:!1}))}),[w,h,E]);return n.useEffect((()=>{w.trim()?m?.():x?.()}),[w,m,x]),c.jsxs(l.View,{style:[a`flex-row gap-2`,q?.inputStyles?.inputSectionContainerStyle],children:[c.jsxs(l.View,{style:[a`flex-1 bg-white px-3.5 gap-1 flex-row justify-between`,f.isMultiline?a`rounded-3xl items-end`:a`rounded-full items-center`,q?.inputStyles?.inputContainerStyle],children:[O&&c.jsx(l.Pressable,{children:y?c.jsx(y,{}):c.jsx(s.EmojiFunnySquareIcon,{style:a.style(""+("ios"===l.Platform.OS?"h-6 w-6":"w-7 h-7"),f.isMultiline?"pb-14":"pb-0"),color:q?.colors?.inputsIconsColor||"rgba(0,0,0,0.7)"})}),c.jsx(l.TextInput,{value:w,onChangeText:b,placeholder:B||"Message",style:[a`bg-transparent flex-1 pl-2 my-3`,"ios"===l.Platform.OS?a`text-[17px]`:a`text-[16px]`,{minHeight:u,maxHeight:118}],placeholderTextColor:q?.colors?.placeholderTextColor||"rgba(0, 0, 0, 0.4)",multiline:!0,textAlignVertical:"center",onContentSizeChange:V}),c.jsxs(l.View,{style:[a`gap-4 flex-row`,f.isMultiline?a`pb-4`:a`pb-0`],children:[v&&c.jsx(l.Pressable,{onPress:p,children:I?c.jsx(I,{}):c.jsx(o.PaperClipIcon,{style:a.style("ios"===l.Platform.OS?"h-6 w-6":"w-7 h-7"),color:q?.colors?.inputsIconsColor||"rgba(0,0,0,0.7)"})}),A&&!w.trim()&&c.jsx(l.Pressable,{onPress:d,children:g?c.jsx(g,{}):c.jsx(e.CameraIcon,{style:a.style("ios"===l.Platform.OS?"h-6 w-6":"w-7 h-7"),color:q?.colors?.inputsIconsColor||"rgba(0,0,0,0.7)"})})]})]}),c.jsx(l.Pressable,{style:[a`p-2 rounded-full bg-green-600 justify-center items-center`,{height:"ios"===l.Platform.OS?50:48,width:"ios"===l.Platform.OS?50:48,...q?.inputStyles?.sendButtonStyle}],onPress:w.trim()?R:j,onLongPress:j,onPressOut:C,children:w.trim()?P?c.jsx(P,{}):c.jsx(r.PaperPlaneIcon,{style:a.style("h-6 w-6"),color:q?.colors?.sendIconsColor||"rgba(255,255,255,0.7)"}):T?S?c.jsx(S,{}):c.jsx(t.MicrophoneIcon,{style:a.style("h-8 w-8"),color:q?.colors?.sendIconsColor||"rgba(255,255,255,0.7)"}):P?c.jsx(P,{}):c.jsx(r.PaperPlaneIcon,{style:a.style("h-6 w-6"),color:q?.colors?.sendIconsColor||"rgba(255,255,255,0.7)"})})]})};var m=n.memo(h);module.exports=m;
2
+ //# sourceMappingURL=ChatInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatInput.js","sources":["../../../../src/components/ChatInput/ChatInput.tsx"],"sourcesContent":["import { CameraIcon } from \"../../assets/Icons/CameraIcon\";\nimport { EmojiFunnySquareIcon } from \"../../assets/Icons/EmojiFunnySquareIcon\";\nimport { MicrophoneIcon } from \"../../assets/Icons/MicrophoneIcon\";\nimport { PaperClipIcon } from \"../../assets/Icons/PaperClipIcon\";\nimport { PaperPlaneIcon } from \"../../assets/Icons/PaperPlaneIcon\";\nimport React, { useCallback, useEffect, useState } from \"react\";\nimport { Platform, Pressable, TextInput, View } from \"react-native\";\nimport { useChatContext } from \"../../context/ChatContext\";\nimport { ChatInputProps, InputHeightState } from \"./types\";\nimport tw from 'twrnc';\n\nconst MIN_INPUT_HEIGHT = Platform.OS === \"ios\" ? 32 : 30;\nconst MAX_INPUT_HEIGHT = 118;\n\nconst ChatInput: React.FC<ChatInputProps> = ({\n onSendMessage,\n onTypingStart,\n onTypingEnd,\n onAttachmentPress,\n onCameraPress,\n onAudioRecordStart,\n onAudioRecordEnd,\n CustomEmojiIcon,\n CustomAttachmentIcon,\n CustomCameraIcon,\n CustomSendIcon,\n CustomMicrophoneIcon,\n}) => {\n const [inputText, setInputText] = useState(\"\");\n const [inputHeight, setInputHeight] = useState<InputHeightState>({\n height: MIN_INPUT_HEIGHT,\n isMultiline: false,\n });\n const {\n theme,\n currentUserId,\n showEmojiButton,\n showAttachmentsButton,\n showCameraButton,\n showVoiceRecordButton,\n placeholder,\n } = useChatContext();\n\n const handleContentSizeChange = useCallback(\n (event: { nativeEvent: { contentSize: { height: number } } }) => {\n const newHeight = Math.min(\n Math.max(event.nativeEvent.contentSize.height, MIN_INPUT_HEIGHT),\n MAX_INPUT_HEIGHT\n );\n setInputHeight({\n height: newHeight,\n isMultiline: newHeight > MIN_INPUT_HEIGHT,\n });\n },\n []\n );\n\n const handleSendMessage = useCallback(() => {\n if (inputText.trim()) {\n onSendMessage({\n text: inputText.trim(),\n senderId: currentUserId,\n });\n setInputText(\"\");\n setInputHeight({ height: MIN_INPUT_HEIGHT, isMultiline: false });\n }\n }, [inputText, onSendMessage, currentUserId]);\n\n useEffect(() => {\n if (inputText.trim()) {\n onTypingStart?.();\n } else {\n onTypingEnd?.();\n }\n }, [inputText, onTypingStart, onTypingEnd]);\n\n return (\n <View\n style={[\n tw`flex-row gap-2`,\n theme?.inputStyles?.inputSectionContainerStyle,\n ]}\n >\n <View\n style={[\n tw`flex-1 bg-white px-3.5 gap-1 flex-row justify-between`,\n inputHeight.isMultiline\n ? tw`rounded-3xl items-end`\n : tw`rounded-full items-center`,\n theme?.inputStyles?.inputContainerStyle,\n ]}\n >\n {showEmojiButton && (\n <Pressable>\n {CustomEmojiIcon ? (\n <CustomEmojiIcon />\n ) : (\n <EmojiFunnySquareIcon\n style={tw.style(\n `${Platform.OS === 'ios' ? 'h-6 w-6' : 'w-7 h-7'}`,\n inputHeight.isMultiline ? 'pb-14' : 'pb-0'\n )}\n color={theme?.colors?.inputsIconsColor || 'rgba(0,0,0,0.7)'}\n />\n )}\n </Pressable>\n )}\n\n <TextInput\n value={inputText}\n onChangeText={setInputText}\n placeholder={placeholder || 'Message'}\n style={[\n tw`bg-transparent flex-1 pl-2 my-3`,\n Platform.OS === 'ios' ? tw`text-[17px]` : tw`text-[16px]`,\n { minHeight: MIN_INPUT_HEIGHT, maxHeight: MAX_INPUT_HEIGHT },\n ]}\n placeholderTextColor={\n theme?.colors?.placeholderTextColor || 'rgba(0, 0, 0, 0.4)'\n }\n multiline\n textAlignVertical=\"center\"\n onContentSizeChange={handleContentSizeChange}\n />\n\n <View\n style={[\n tw`gap-4 flex-row`,\n inputHeight.isMultiline ? tw`pb-4` : tw`pb-0`,\n ]}\n >\n {showAttachmentsButton && (\n <Pressable onPress={onAttachmentPress}>\n {CustomAttachmentIcon ? (\n <CustomAttachmentIcon />\n ) : (\n <PaperClipIcon\n style={tw.style(\n Platform.OS === 'ios' ? 'h-6 w-6' : 'w-7 h-7'\n )}\n color={theme?.colors?.inputsIconsColor || 'rgba(0,0,0,0.7)'}\n />\n )}\n </Pressable>\n )}\n {showCameraButton && !inputText.trim() && (\n <Pressable onPress={onCameraPress}>\n {CustomCameraIcon ? (\n <CustomCameraIcon />\n ) : (\n <CameraIcon\n style={tw.style(\n Platform.OS === 'ios' ? 'h-6 w-6' : 'w-7 h-7'\n )}\n color={theme?.colors?.inputsIconsColor || 'rgba(0,0,0,0.7)'}\n />\n )}\n </Pressable>\n )}\n </View>\n </View>\n\n <Pressable\n style={[\n tw`p-2 rounded-full bg-green-600 justify-center items-center`,\n {\n height: Platform.OS === 'ios' ? 50 : 48,\n width: Platform.OS === 'ios' ? 50 : 48,\n ...theme?.inputStyles?.sendButtonStyle,\n },\n ]}\n onPress={inputText.trim() ? handleSendMessage : onAudioRecordStart}\n onLongPress={onAudioRecordStart}\n onPressOut={onAudioRecordEnd}\n >\n {inputText.trim() ? (\n CustomSendIcon ? (\n <CustomSendIcon />\n ) : (\n <PaperPlaneIcon\n style={tw.style('h-6 w-6')}\n color={theme?.colors?.sendIconsColor || 'rgba(255,255,255,0.7)'}\n />\n )\n ) : showVoiceRecordButton ? (\n CustomMicrophoneIcon ? (\n <CustomMicrophoneIcon />\n ) : (\n <MicrophoneIcon\n style={tw.style('h-8 w-8')}\n color={theme?.colors?.sendIconsColor || 'rgba(255,255,255,0.7)'}\n />\n )\n ) : CustomSendIcon ? (\n <CustomSendIcon />\n ) : (\n <PaperPlaneIcon\n style={tw.style('h-6 w-6')}\n color={theme?.colors?.sendIconsColor || 'rgba(255,255,255,0.7)'}\n />\n )}\n </Pressable>\n </View>\n );\n};\n\nexport default React.memo(ChatInput);\n"],"names":["MIN_INPUT_HEIGHT","Platform","OS","ChatInput","onSendMessage","onTypingStart","onTypingEnd","onAttachmentPress","onCameraPress","onAudioRecordStart","onAudioRecordEnd","CustomEmojiIcon","CustomAttachmentIcon","CustomCameraIcon","CustomSendIcon","CustomMicrophoneIcon","inputText","setInputText","useState","inputHeight","setInputHeight","height","isMultiline","theme","currentUserId","showEmojiButton","showAttachmentsButton","showCameraButton","showVoiceRecordButton","placeholder","useChatContext","handleContentSizeChange","useCallback","event","newHeight","Math","min","max","nativeEvent","contentSize","handleSendMessage","trim","text","senderId","useEffect","_jsxs","View","style","tw","inputStyles","inputSectionContainerStyle","children","jsxs","inputContainerStyle","_jsx","jsx","Pressable","EmojiFunnySquareIcon","color","colors","inputsIconsColor","TextInput","value","onChangeText","minHeight","maxHeight","placeholderTextColor","multiline","textAlignVertical","onContentSizeChange","onPress","PaperClipIcon","CameraIcon","width","sendButtonStyle","onLongPress","onPressOut","PaperPlaneIcon","sendIconsColor","MicrophoneIcon","ChatInput$1","React","memo"],"mappings":"qZAWA,MAAMA,EAAmC,QAAhBC,EAAAA,SAASC,GAAe,GAAK,GAGhDC,EAAsCA,EAC1CC,gBACAC,gBACAC,cACAC,oBACAC,gBACAC,qBACAC,mBACAC,kBACAC,uBACAC,mBACAC,iBACAC,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D,EACFb,EACEuC,EAAAC,IAACxC,EAAsB,IAEvBuC,EAAAC,IAACwB,iBAAc,CACbhC,MAAOC,EAAGD,MAAM,WAChBW,MAAOnC,GAAOoC,QAAQmB,gBAAkB,0BAG1ChE,EACFwC,MAACxC,EAAc,CAAA,GAEfwC,EAAAC,IAACsB,iBAAc,CACb9B,MAAOC,EAAGD,MAAM,WAChBW,MAAOnC,GAAOoC,QAAQmB,gBAAkB,8BAIzC,EAIX,IAAAE,EAAeC,EAAMC,KAAK/E"}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("../../assets/Icons/LoadingIcon.js"),t=require("../../assets/Icons/XIcon.js"),r=require("react"),s=require("react-native"),i=require("react-native-image-zoom-viewer"),o=require("react-native-video"),n=require("twrnc"),l=require("react/jsx-runtime");const a=({imageUrl:a,videoUrl:u,onClose:c})=>{const d=r.useRef(null),[b,h]=r.useState(!1),[x,g]=r.useState(!1);return a||u?l.jsx(s.Modal,{visible:!!a||!!u,transparent:!0,children:l.jsxs(s.View,{style:n`top-0 bottom-0 left-0 right-0 bg-black/80 flex-1 absolute`,children:[l.jsx(s.Pressable,{onPress:c,style:n`absolute right-4 top-4 p-2 rounded-full bg-slate-100/70 z-10`,children:l.jsx(t.XIcon,{style:n`h-8 w-8 stroke-black`})}),a&&l.jsx(i,{imageUrls:[{url:a}],enableSwipeDown:!0,onSwipeDown:c,backgroundColor:"rgba(0,0,0,0.8)",enableImageZoom:!0,onSave:()=>a,renderIndicator:()=>l.jsx(l.Fragment,{})}),u&&l.jsxs(s.View,{style:n`justify-center items-center`,children:[l.jsx(o,{source:{uri:u},ref:d,shutterColor:"transparent",controls:!0,style:{width:"100%",height:"100%",borderRadius:8,position:"relative",marginHorizontal:48},controlsStyles:{hideSettingButton:!1,hideNext:!0,hidePrevious:!0},resizeMode:"contain",onLoadStart:()=>{h(!0),g(!1)},onLoad:()=>h(!1),onBuffer:({isBuffering:e})=>h(e),onError:()=>{g(!0),h(!1)}}),b&&l.jsx(s.View,{style:n`absolute inset-0 flex items-center justify-center bg-black/40 rounded-full`,children:l.jsx(e.LoadingIcon,{style:n.style("h-12 w-12 fill-white animate-spin")})}),x&&l.jsx(s.View,{style:n`absolute inset-0 flex items-center justify-center bg-red-500/60 p-2`,children:l.jsx(s.Text,{style:n`text-white font-bold`,children:"Failed to load video"})})]})]})}):null};var u=r.memo(a);module.exports=u;
2
+ //# sourceMappingURL=MediaViewer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MediaViewer.js","sources":["../../../../src/components/MediaViewer/MediaViewer.tsx"],"sourcesContent":["import { LoadingIcon } from '../../assets/Icons/LoadingIcon';\nimport { XIcon } from '../../assets/Icons/XIcon';\nimport React, { useRef, useState } from 'react';\nimport { Modal, Pressable, Text, View } from 'react-native';\nimport ImageViewer from 'react-native-image-zoom-viewer';\nimport Video, { VideoRef } from 'react-native-video';\nimport tw from 'twrnc';\nimport { MediaViewerProps } from './types';\n\nconst MediaViewer: React.FC<MediaViewerProps> = ({\n imageUrl,\n videoUrl,\n onClose,\n}) => {\n const videoRef = useRef<VideoRef>(null);\n const [videoIsLoading, setVideoIsLoading] = useState(false);\n const [videoHasError, setVideoHasError] = useState(false);\n\n if (!imageUrl && !videoUrl) return null;\n\n return (\n <Modal visible={!!imageUrl || !!videoUrl} transparent={true}>\n <View\n style={tw`top-0 bottom-0 left-0 right-0 bg-black/80 flex-1 absolute`}\n >\n <Pressable\n onPress={onClose}\n style={tw`absolute right-4 top-4 p-2 rounded-full bg-slate-100/70 z-10`}\n >\n <XIcon style={tw`h-8 w-8 stroke-black`} />\n </Pressable>\n\n {imageUrl && (\n <ImageViewer\n imageUrls={[{ url: imageUrl }]}\n enableSwipeDown\n onSwipeDown={onClose}\n backgroundColor=\"rgba(0,0,0,0.8)\"\n enableImageZoom\n onSave={() => imageUrl}\n renderIndicator={() => <></>}\n />\n )}\n\n {videoUrl && (\n <View style={tw`justify-center items-center`}>\n <Video\n source={{ uri: videoUrl }}\n ref={videoRef}\n shutterColor=\"transparent\"\n controls={true}\n style={{\n width: '100%',\n height: '100%',\n borderRadius: 8,\n position: 'relative',\n marginHorizontal: 48,\n }}\n controlsStyles={{\n hideSettingButton: false,\n hideNext: true,\n hidePrevious: true,\n }}\n resizeMode=\"contain\"\n onLoadStart={() => {\n setVideoIsLoading(true);\n setVideoHasError(false);\n }}\n onLoad={() => setVideoIsLoading(false)}\n onBuffer={({ isBuffering }) => setVideoIsLoading(isBuffering)}\n onError={() => {\n setVideoHasError(true);\n setVideoIsLoading(false);\n }}\n />\n {videoIsLoading && (\n <View\n style={tw`absolute inset-0 flex items-center justify-center bg-black/40 rounded-full`}\n >\n <LoadingIcon\n style={tw.style('h-12 w-12 fill-white animate-spin')}\n />\n </View>\n )}\n {videoHasError && (\n <View\n style={tw`absolute inset-0 flex items-center justify-center bg-red-500/60 p-2`}\n >\n <Text style={tw`text-white font-bold`}>\n Failed to load video\n </Text>\n </View>\n )}\n </View>\n )}\n </View>\n </Modal>\n );\n};\n\nexport default React.memo(MediaViewer);\n"],"names":["MediaViewer","imageUrl","videoUrl","onClose","videoRef","useRef","videoIsLoading","setVideoIsLoading","useState","videoHasError","setVideoHasError","_jsx","Modal","visible","transparent","children","_jsxs","jsxs","View","style","tw","jsx","Pressable","onPress","XIcon","ImageViewer","imageUrls","url","enableSwipeDown","onSwipeDown","backgroundColor","enableImageZoom","onSave","renderIndicator","_Fragment","Video","source","uri","ref","shutterColor","controls","width","height","borderRadius","position","marginHorizontal","controlsStyles","hideSettingButton","hideNext","hidePrevious","resizeMode","onLoadStart","onLoad","onBuffer","isBuffering","onError","LoadingIcon","Text","MediaViewer$1","React","memo"],"mappings":"oRASA,MAAMA,EAA0CA,EAC9CC,WACAC,WACAC,cAEA,MAAMC,EAAWC,EAAMA,OAAW,OAC3BC,EAAgBC,GAAqBC,EAAAA,UAAS,IAC9CC,EAAeC,GAAoBF,EAAAA,UAAS,GAEnD,OAAKP,GAAaC,EAGhBS,EAAAA,IAACC,EAAAA,MAA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0,0 +1,2 @@
1
+ "use strict";var e=require("react-native"),t=require("twrnc"),r=require("../../assets/Icons/ArrowBack2RoundedIcon.js"),l=require("../../context/ChatContext.js"),n=require("react/jsx-runtime");exports.TypingIndicator=({typingUsers:s,currentUserId:i})=>{const{theme:a,showAvatars:o,renderCustomTyping:c,showBubbleTail:d}=l.useChatContext(),u=s.filter((e=>e.id!==i));if(!u.length)return null;const x=u.slice(0,2),y=u.length-2;return n.jsxs(e.View,{style:t`my-1 max-w-[75%] self-start flex-row`,children:[o&&n.jsxs(e.View,{style:t`flex-row`,children:[x.map(((r,l)=>n.jsx(e.View,{style:[t`bg-gray-400 w-6 h-6 rounded-full items-center`,{marginLeft:l>0?-10:0,zIndex:x.length+l}],children:r.avatar?n.jsx(e.Image,{source:{uri:r.avatar},style:[t`w-full h-full object-cover rounded-full`,a?.bubbleStyle?.avatarImageStyle]}):n.jsx(e.Text,{style:[t`text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5`,a?.bubbleStyle?.avatarTextStyle],children:r.name?.charAt(0)})},r.id))),y>0&&n.jsx(e.View,{style:[t`bg-gray-400 w-6 h-6 rounded-full items-center justify-center`,{marginLeft:-10,zIndex:3},{...a?.bubbleStyle?.additionalTypingUsersContainerStyle}],children:n.jsxs(e.Text,{style:[t`text-white text-xs font-semibold`,a?.bubbleStyle?.additionalTypingUsersTextStyle],children:["+",y]})})]}),d&&n.jsx(r.ArrowBack2RoundedIcon,{style:t.style("w-6 h-6 fill-white mt-[1.25px]",{transform:[{rotate:"180deg"},{translateX:6}]}),color:`${a?.colors?.receivedMessageTailColor||"white"}`}),n.jsx(e.View,{style:[t`px-2 my-1 bg-white rounded-tl-none rounded-lg`,a?.bubbleStyle?.typingContainerStyle],children:c?c():n.jsx(e.View,{style:t`flex-row items-center py-3 px-2 justify-center`,children:n.jsx(e.Text,{style:t`text-gray-600`,children:"Typing..."})})})]})};
2
+ //# sourceMappingURL=TypingIndicator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypingIndicator.js","sources":["../../../../src/components/TypingComponent/TypingIndicator.tsx"],"sourcesContent":["import { Image, Text, View } from 'react-native';\nimport tw from 'twrnc';\nimport { ArrowBack2RoundedIcon } from '../../assets/Icons/ArrowBack2RoundedIcon';\nimport { useChatContext } from '../../context/ChatContext';\n\nexport interface TypingUser {\n id: string;\n avatar: string;\n name: string;\n}\n\ninterface TypingIndicatorProps {\n typingUsers: TypingUser[];\n currentUserId: string;\n}\n\nexport const TypingIndicator = ({\n typingUsers,\n currentUserId,\n}: TypingIndicatorProps) => {\n const { theme, showAvatars, renderCustomTyping, showBubbleTail } =\n useChatContext();\n\n const otherTypingUsers = typingUsers.filter(\n (user) => user.id !== currentUserId\n );\n\n if (!otherTypingUsers.length) return null;\n\n const displayedUsers = otherTypingUsers.slice(0, 2);\n const additionalUsers = otherTypingUsers.length - 2;\n\n return (\n <View style={tw`my-1 max-w-[75%] self-start flex-row`}>\n {showAvatars && (\n <View style={tw`flex-row`}>\n {displayedUsers.map((user, index) => (\n <View\n key={user.id}\n style={[\n tw`bg-gray-400 w-6 h-6 rounded-full items-center`,\n {\n marginLeft: index > 0 ? -10 : 0,\n zIndex: displayedUsers.length + index,\n },\n ]}\n >\n {user.avatar ? (\n <Image\n source={{ uri: user.avatar }}\n style={[\n tw`w-full h-full object-cover rounded-full`,\n theme?.bubbleStyle?.avatarImageStyle,\n ]}\n />\n ) : (\n <Text\n style={[\n tw`text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5`,\n theme?.bubbleStyle?.avatarTextStyle,\n ]}\n >\n {user.name?.charAt(0)}\n </Text>\n )}\n </View>\n ))}\n {additionalUsers > 0 && (\n <View\n style={[\n tw`bg-gray-400 w-6 h-6 rounded-full items-center justify-center`,\n {\n marginLeft: -10,\n zIndex: 3,\n },\n { ...theme?.bubbleStyle?.additionalTypingUsersContainerStyle },\n ]}\n >\n <Text\n style={[\n tw`text-white text-xs font-semibold`,\n theme?.bubbleStyle?.additionalTypingUsersTextStyle,\n ]}\n >\n +{additionalUsers}\n </Text>\n </View>\n )}\n </View>\n )}\n {showBubbleTail && (\n <ArrowBack2RoundedIcon\n style={tw.style(\n 'w-6 h-6 fill-white mt-[1.25px]', \n {\n transform: [{ rotate: '180deg' }, { translateX: 6 }],\n }\n )}\n color={`${theme?.colors?.receivedMessageTailColor || 'white'}`}\n />\n )}\n\n <View\n style={[\n tw`px-2 my-1 bg-white rounded-tl-none rounded-lg`,\n theme?.bubbleStyle?.typingContainerStyle,\n ]}\n >\n {renderCustomTyping ? (\n renderCustomTyping()\n ) : (\n <View style={tw`flex-row items-center py-3 px-2 justify-center`}>\n <Text style={tw`text-gray-600`}>Typing...</Text>\n </View>\n )}\n </View>\n </View>\n );\n};\n"],"names":["TypingIndicator","typingUsers","currentUserId","theme","showAvatars","renderCustomTyping","showBubbleTail","useChatContext","otherTypingUsers","filter","user","id","length","displayedUsers","slice","additionalUsers","_jsxs","View","style","tw","children","jsxs","map","index","_jsx","jsx","marginLeft","zIndex","avatar","Image","source","uri","bubbleStyle","avatarImageStyle","Text","avatarTextStyle","name","charAt","additionalTypingUsersContainerStyle","additionalTypingUsersTextStyle","ArrowBack2RoundedIcon","transform","rotate","translateX","color","colors","receivedMessageTailColor","typingContainerStyle"],"mappings":"wNAgB+BA,EAC7BC,cACAC,oBAEA,MAAMC,MAAEA,EAAKC,YAAEA,EAAWC,mBAAEA,EAAkBC,eAAEA,GAC9CC,mBAEIC,EAAmBP,EAAYQ,QAClCC,GAASA,EAAKC,KAAOT,IAGxB,IAAKM,EAAiBI,OAAQ,OAAO,KAErC,MAAMC,EAAiBL,EAAiBM,MAAM,EAAG,GAC3CC,EAAkBP,EAAiBI,OAAS,EAElD,OACEI,EAAAA,KAACC,EAAAA,KAAI,CAACC,MAAOC,CAAE,uCAAuCC,SACnDhB,CAAAA,GACCY,EAAAK,KAACJ,OAAI,CAACC,MAAOC,CAAE,WAAWC,SACvBP,CAAAA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