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.
- package/README.md +249 -0
- package/lib/commonjs/assets/Icons/ArrowBack2RoundedIcon.js +2 -0
- package/lib/commonjs/assets/Icons/ArrowBack2RoundedIcon.js.map +1 -0
- package/lib/commonjs/assets/Icons/CameraIcon.js +2 -0
- package/lib/commonjs/assets/Icons/CameraIcon.js.map +1 -0
- package/lib/commonjs/assets/Icons/CheckAllIcon.js +2 -0
- package/lib/commonjs/assets/Icons/CheckAllIcon.js.map +1 -0
- package/lib/commonjs/assets/Icons/CheckIcon.js +2 -0
- package/lib/commonjs/assets/Icons/CheckIcon.js.map +1 -0
- package/lib/commonjs/assets/Icons/EmojiFunnySquareIcon.js +2 -0
- package/lib/commonjs/assets/Icons/EmojiFunnySquareIcon.js.map +1 -0
- package/lib/commonjs/assets/Icons/LoadingIcon.js +2 -0
- package/lib/commonjs/assets/Icons/LoadingIcon.js.map +1 -0
- package/lib/commonjs/assets/Icons/MicrophoneIcon.js +2 -0
- package/lib/commonjs/assets/Icons/MicrophoneIcon.js.map +1 -0
- package/lib/commonjs/assets/Icons/PaperClipIcon.js +2 -0
- package/lib/commonjs/assets/Icons/PaperClipIcon.js.map +1 -0
- package/lib/commonjs/assets/Icons/PaperPlaneIcon.js +2 -0
- package/lib/commonjs/assets/Icons/PaperPlaneIcon.js.map +1 -0
- package/lib/commonjs/assets/Icons/PauseIcon.js +2 -0
- package/lib/commonjs/assets/Icons/PauseIcon.js.map +1 -0
- package/lib/commonjs/assets/Icons/PlayIcon.js +2 -0
- package/lib/commonjs/assets/Icons/PlayIcon.js.map +1 -0
- package/lib/commonjs/assets/Icons/XIcon.js +2 -0
- package/lib/commonjs/assets/Icons/XIcon.js.map +1 -0
- package/lib/commonjs/components/AudioPlayer/AudioPlayer.js +2 -0
- package/lib/commonjs/components/AudioPlayer/AudioPlayer.js.map +1 -0
- package/lib/commonjs/components/ChatBubble/ChatBubble.js +2 -0
- package/lib/commonjs/components/ChatBubble/ChatBubble.js.map +1 -0
- package/lib/commonjs/components/ChatBubble/MessageContent.js +2 -0
- package/lib/commonjs/components/ChatBubble/MessageContent.js.map +1 -0
- package/lib/commonjs/components/ChatBubble/MessageStatus.js +2 -0
- package/lib/commonjs/components/ChatBubble/MessageStatus.js.map +1 -0
- package/lib/commonjs/components/ChatInput/ChatInput.js +2 -0
- package/lib/commonjs/components/ChatInput/ChatInput.js.map +1 -0
- package/lib/commonjs/components/MediaViewer/MediaViewer.js +2 -0
- package/lib/commonjs/components/MediaViewer/MediaViewer.js.map +1 -0
- package/lib/commonjs/components/TypingComponent/TypingIndicator.js +2 -0
- package/lib/commonjs/components/TypingComponent/TypingIndicator.js.map +1 -0
- package/lib/commonjs/context/AudioContext.js +2 -0
- package/lib/commonjs/context/AudioContext.js.map +1 -0
- package/lib/commonjs/context/ChatContext.js +2 -0
- package/lib/commonjs/context/ChatContext.js.map +1 -0
- package/lib/commonjs/index.js +2 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/utils/datefunc.js +2 -0
- package/lib/commonjs/utils/datefunc.js.map +1 -0
- package/lib/module/assets/Icons/ArrowBack2RoundedIcon.js +2 -0
- package/lib/module/assets/Icons/ArrowBack2RoundedIcon.js.map +1 -0
- package/lib/module/assets/Icons/CameraIcon.js +2 -0
- package/lib/module/assets/Icons/CameraIcon.js.map +1 -0
- package/lib/module/assets/Icons/CheckAllIcon.js +2 -0
- package/lib/module/assets/Icons/CheckAllIcon.js.map +1 -0
- package/lib/module/assets/Icons/CheckIcon.js +2 -0
- package/lib/module/assets/Icons/CheckIcon.js.map +1 -0
- package/lib/module/assets/Icons/EmojiFunnySquareIcon.js +2 -0
- package/lib/module/assets/Icons/EmojiFunnySquareIcon.js.map +1 -0
- package/lib/module/assets/Icons/LoadingIcon.js +2 -0
- package/lib/module/assets/Icons/LoadingIcon.js.map +1 -0
- package/lib/module/assets/Icons/MicrophoneIcon.js +2 -0
- package/lib/module/assets/Icons/MicrophoneIcon.js.map +1 -0
- package/lib/module/assets/Icons/PaperClipIcon.js +2 -0
- package/lib/module/assets/Icons/PaperClipIcon.js.map +1 -0
- package/lib/module/assets/Icons/PaperPlaneIcon.js +2 -0
- package/lib/module/assets/Icons/PaperPlaneIcon.js.map +1 -0
- package/lib/module/assets/Icons/PauseIcon.js +2 -0
- package/lib/module/assets/Icons/PauseIcon.js.map +1 -0
- package/lib/module/assets/Icons/PlayIcon.js +2 -0
- package/lib/module/assets/Icons/PlayIcon.js.map +1 -0
- package/lib/module/assets/Icons/XIcon.js +2 -0
- package/lib/module/assets/Icons/XIcon.js.map +1 -0
- package/lib/module/components/AudioPlayer/AudioPlayer.js +2 -0
- package/lib/module/components/AudioPlayer/AudioPlayer.js.map +1 -0
- package/lib/module/components/ChatBubble/ChatBubble.js +2 -0
- package/lib/module/components/ChatBubble/ChatBubble.js.map +1 -0
- package/lib/module/components/ChatBubble/MessageContent.js +2 -0
- package/lib/module/components/ChatBubble/MessageContent.js.map +1 -0
- package/lib/module/components/ChatBubble/MessageStatus.js +2 -0
- package/lib/module/components/ChatBubble/MessageStatus.js.map +1 -0
- package/lib/module/components/ChatInput/ChatInput.js +2 -0
- package/lib/module/components/ChatInput/ChatInput.js.map +1 -0
- package/lib/module/components/MediaViewer/MediaViewer.js +2 -0
- package/lib/module/components/MediaViewer/MediaViewer.js.map +1 -0
- package/lib/module/components/TypingComponent/TypingIndicator.js +2 -0
- package/lib/module/components/TypingComponent/TypingIndicator.js.map +1 -0
- package/lib/module/context/AudioContext.js +2 -0
- package/lib/module/context/AudioContext.js.map +1 -0
- package/lib/module/context/ChatContext.js +2 -0
- package/lib/module/context/ChatContext.js.map +1 -0
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/utils/datefunc.js +2 -0
- package/lib/module/utils/datefunc.js.map +1 -0
- package/lib/typescript/assets/Icons/ArrowBack2RoundedIcon.d.ts +5 -0
- package/lib/typescript/assets/Icons/CameraIcon.d.ts +5 -0
- package/lib/typescript/assets/Icons/CheckAllIcon.d.ts +4 -0
- package/lib/typescript/assets/Icons/CheckIcon.d.ts +4 -0
- package/lib/typescript/assets/Icons/EmojiFunnySquareIcon.d.ts +5 -0
- package/lib/typescript/assets/Icons/LoadingIcon.d.ts +4 -0
- package/lib/typescript/assets/Icons/MicrophoneIcon.d.ts +5 -0
- package/lib/typescript/assets/Icons/PaperClipIcon.d.ts +5 -0
- package/lib/typescript/assets/Icons/PaperPlaneIcon.d.ts +5 -0
- package/lib/typescript/assets/Icons/PauseIcon.d.ts +5 -0
- package/lib/typescript/assets/Icons/PlayIcon.d.ts +5 -0
- package/lib/typescript/assets/Icons/XIcon.d.ts +4 -0
- package/lib/typescript/components/AudioPlayer/AudioPlayer.d.ts +4 -0
- package/lib/typescript/components/AudioPlayer/types.d.ts +5 -0
- package/lib/typescript/components/ChatBubble/ChatBubble.d.ts +4 -0
- package/lib/typescript/components/ChatBubble/MessageContent.d.ts +4 -0
- package/lib/typescript/components/ChatBubble/MessageStatus.d.ts +4 -0
- package/lib/typescript/components/ChatBubble/types.d.ts +18 -0
- package/lib/typescript/components/ChatInput/ChatInput.d.ts +4 -0
- package/lib/typescript/components/ChatInput/types.d.ts +20 -0
- package/lib/typescript/components/MediaViewer/MediaViewer.d.ts +4 -0
- package/lib/typescript/components/MediaViewer/types.d.ts +5 -0
- package/lib/typescript/components/TypingComponent/TypingIndicator.d.ts +11 -0
- package/lib/typescript/context/AudioContext.d.ts +10 -0
- package/lib/typescript/context/ChatContext.d.ts +19 -0
- package/lib/typescript/index.d.ts +4 -0
- package/lib/typescript/types/index.d.ts +85 -0
- package/lib/typescript/utils/datefunc.d.ts +1 -0
- package/package.json +93 -0
- package/src/assets/Icons/ArrowBack2RoundedIcon.tsx +25 -0
- package/src/assets/Icons/CameraIcon.tsx +20 -0
- package/src/assets/Icons/CheckAllIcon.tsx +13 -0
- package/src/assets/Icons/CheckIcon.tsx +11 -0
- package/src/assets/Icons/EmojiFunnySquareIcon.tsx +41 -0
- package/src/assets/Icons/LoadingIcon.tsx +15 -0
- package/src/assets/Icons/MicrophoneIcon.tsx +24 -0
- package/src/assets/Icons/PaperClipIcon.tsx +17 -0
- package/src/assets/Icons/PaperPlaneIcon.tsx +24 -0
- package/src/assets/Icons/PauseIcon.tsx +21 -0
- package/src/assets/Icons/PlayIcon.tsx +20 -0
- package/src/assets/Icons/XIcon.tsx +20 -0
- package/src/components/AudioPlayer/AudioPlayer.tsx +259 -0
- package/src/components/AudioPlayer/types.ts +5 -0
- package/src/components/ChatBubble/ChatBubble.tsx +137 -0
- package/src/components/ChatBubble/MessageContent.tsx +143 -0
- package/src/components/ChatBubble/MessageStatus.tsx +68 -0
- package/src/components/ChatBubble/types.ts +21 -0
- package/src/components/ChatInput/ChatInput.tsx +207 -0
- package/src/components/ChatInput/types.ts +22 -0
- package/src/components/MediaViewer/MediaViewer.tsx +101 -0
- package/src/components/MediaViewer/types.ts +5 -0
- package/src/components/TypingComponent/TypingIndicator.tsx +119 -0
- package/src/context/AudioContext.tsx +30 -0
- package/src/context/ChatContext.tsx +40 -0
- package/src/index.tsx +103 -0
- package/src/types/index.ts +94 -0
- package/src/utils/datefunc.ts +5 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { ImageStyle, TextStyle, ViewStyle } from "react-native";
|
|
2
|
+
|
|
3
|
+
export interface Message {
|
|
4
|
+
id: string;
|
|
5
|
+
text?: string;
|
|
6
|
+
image?: string;
|
|
7
|
+
video?: string;
|
|
8
|
+
audio?: string;
|
|
9
|
+
senderId: string;
|
|
10
|
+
time: string;
|
|
11
|
+
status: "read" | "delivered" | "sent";
|
|
12
|
+
senderName?: string;
|
|
13
|
+
senderAvatar?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface ChatScreenProps {
|
|
17
|
+
// Message handling
|
|
18
|
+
messages: Message[];
|
|
19
|
+
currentUserId: string;
|
|
20
|
+
onSendMessage: (message: Omit<Message, "id" | "time" | "status">) => void;
|
|
21
|
+
onMessageLongPress?: (message: Message) => void;
|
|
22
|
+
onAttachmentPress?: () => void;
|
|
23
|
+
onAudioRecordEnd?: () => void;
|
|
24
|
+
onAudioRecordStart?: () => void;
|
|
25
|
+
onCameraPress?: () => void;
|
|
26
|
+
|
|
27
|
+
// Typing indicators and input
|
|
28
|
+
typingUsers?: Array<{ id: string; avatar: string; name: string }>;
|
|
29
|
+
onTypingStart?: () => void;
|
|
30
|
+
onTypingEnd?: () => void;
|
|
31
|
+
placeholder?: string;
|
|
32
|
+
|
|
33
|
+
// UI Customization
|
|
34
|
+
theme?: {
|
|
35
|
+
colors?: {
|
|
36
|
+
sentMessageTailColor?: string;
|
|
37
|
+
receivedMessageTailColor?: string;
|
|
38
|
+
timestamp?: string;
|
|
39
|
+
inputsIconsColor?: string;
|
|
40
|
+
sendIconsColor?: string;
|
|
41
|
+
placeholderTextColor?: string;
|
|
42
|
+
audioPlayIconColor?: string;
|
|
43
|
+
audioPauseIconColor?: string;
|
|
44
|
+
videoPlayIconColor?: string;
|
|
45
|
+
};
|
|
46
|
+
bubbleStyle?: {
|
|
47
|
+
sent?: ViewStyle;
|
|
48
|
+
received?: ViewStyle;
|
|
49
|
+
avatarTextStyle?: TextStyle;
|
|
50
|
+
userNameStyle?: TextStyle;
|
|
51
|
+
avatarImageStyle?: ImageStyle;
|
|
52
|
+
typingContainerStyle?: ViewStyle;
|
|
53
|
+
additionalTypingUsersContainerStyle?: ViewStyle;
|
|
54
|
+
additionalTypingUsersTextStyle?: TextStyle;
|
|
55
|
+
};
|
|
56
|
+
messageStyle?: {
|
|
57
|
+
textStyle?: TextStyle;
|
|
58
|
+
audioPlayButtonStyle?: ViewStyle;
|
|
59
|
+
audioKnobStyle?: ViewStyle;
|
|
60
|
+
progressBarStyle?: ViewStyle;
|
|
61
|
+
activeProgressBarStyle?: ViewStyle;
|
|
62
|
+
audioDurationStyle?: TextStyle;
|
|
63
|
+
};
|
|
64
|
+
inputStyles?: {
|
|
65
|
+
inputSectionContainerStyle?: ViewStyle;
|
|
66
|
+
inputContainerStyle?: ViewStyle;
|
|
67
|
+
sendButtonStyle?: ViewStyle;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
// Feature flags
|
|
72
|
+
showAvatars?: boolean;
|
|
73
|
+
showUserNames?: boolean;
|
|
74
|
+
showEmojiButton?: boolean;
|
|
75
|
+
showAttachmentsButton?: boolean;
|
|
76
|
+
showCameraButton?: boolean;
|
|
77
|
+
showVoiceRecordButton?: boolean;
|
|
78
|
+
showBubbleTail?: boolean;
|
|
79
|
+
showMessageStatus?: boolean;
|
|
80
|
+
|
|
81
|
+
// Custom components
|
|
82
|
+
renderCustomInput?: () => React.ReactNode;
|
|
83
|
+
renderCustomVideoBubbleError?: () => React.ReactNode;
|
|
84
|
+
renderCustomTyping?: () => React.ReactNode;
|
|
85
|
+
|
|
86
|
+
// Custom icon props
|
|
87
|
+
CustomEmojiIcon?: () => React.ReactNode;
|
|
88
|
+
CustomAttachmentIcon?: () => React.ReactNode;
|
|
89
|
+
CustomCameraIcon?: () => React.ReactNode;
|
|
90
|
+
CustomSendIcon?: () => React.ReactNode;
|
|
91
|
+
CustomMicrophoneIcon?: () => React.ReactNode;
|
|
92
|
+
CustomPlayIcon?: () => React.ReactNode;
|
|
93
|
+
CustomPauseIcon?: () => React.ReactNode;
|
|
94
|
+
}
|