@droppii-org/chat-sdk 0.0.2 → 0.0.4

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 (64) hide show
  1. package/dist/components/AutoScrollAnchor.d.ts +1 -1
  2. package/dist/components/AutoScrollAnchor.d.ts.map +1 -1
  3. package/dist/components/AutoScrollAnchor.js +12 -0
  4. package/dist/components/ChatBubble.d.ts +1 -1
  5. package/dist/components/ChatBubble.d.ts.map +1 -1
  6. package/dist/components/ChatBubble.js +18 -0
  7. package/dist/components/ChatHeader.d.ts +1 -1
  8. package/dist/components/ChatHeader.d.ts.map +1 -1
  9. package/dist/components/ChatHeader.js +32 -0
  10. package/dist/components/ChatInput.d.ts +1 -2
  11. package/dist/components/ChatInput.d.ts.map +1 -1
  12. package/dist/components/ChatInput.js +379 -0
  13. package/dist/components/ChatInputDemo.d.ts +1 -1
  14. package/dist/components/ChatInputDemo.d.ts.map +1 -1
  15. package/dist/components/ChatInputDemo.js +38 -0
  16. package/dist/components/ChatInputWithCustomIcon.d.ts +1 -2
  17. package/dist/components/ChatInputWithCustomIcon.d.ts.map +1 -1
  18. package/dist/components/ChatInputWithCustomIcon.js +85 -0
  19. package/dist/components/ChatLayout.d.ts +1 -1
  20. package/dist/components/ChatLayout.d.ts.map +1 -1
  21. package/dist/components/ChatLayout.js +48 -0
  22. package/dist/components/ConversationItem.d.ts +1 -1
  23. package/dist/components/ConversationItem.d.ts.map +1 -1
  24. package/dist/components/ConversationItem.js +27 -0
  25. package/dist/components/ConversationList.d.ts +1 -1
  26. package/dist/components/ConversationList.d.ts.map +1 -1
  27. package/dist/components/ConversationList.js +11 -0
  28. package/dist/components/DateDivider.d.ts +1 -1
  29. package/dist/components/DateDivider.d.ts.map +1 -1
  30. package/dist/components/DateDivider.js +27 -0
  31. package/dist/components/EmojiPicker.js +191 -0
  32. package/dist/components/ImageLightbox.d.ts +1 -1
  33. package/dist/components/ImageLightbox.d.ts.map +1 -1
  34. package/dist/components/ImageLightbox.js +8 -0
  35. package/dist/components/ImagePreviewModal.d.ts +1 -1
  36. package/dist/components/ImagePreviewModal.d.ts.map +1 -1
  37. package/dist/components/ImagePreviewModal.js +55 -0
  38. package/dist/components/MessageItem.d.ts +1 -1
  39. package/dist/components/MessageItem.d.ts.map +1 -1
  40. package/dist/components/MessageItem.js +38 -0
  41. package/dist/components/MessageItemDemo.d.ts +1 -1
  42. package/dist/components/MessageItemDemo.d.ts.map +1 -1
  43. package/dist/components/MessageItemDemo.js +166 -0
  44. package/dist/components/MessageList.d.ts +1 -1
  45. package/dist/components/MessageList.d.ts.map +1 -1
  46. package/dist/components/MessageList.js +243 -0
  47. package/dist/components/MessageListDemo.d.ts +1 -1
  48. package/dist/components/MessageListDemo.d.ts.map +1 -1
  49. package/dist/components/MessageListDemo.js +165 -0
  50. package/dist/components/StickerPicker.js +68 -0
  51. package/dist/components/SwipeIndicator.d.ts +1 -1
  52. package/dist/components/SwipeIndicator.d.ts.map +1 -1
  53. package/dist/components/SwipeIndicator.js +24 -0
  54. package/dist/components/TextFormattingToolbar.js +29 -0
  55. package/dist/components/TypingIndicator.d.ts +1 -1
  56. package/dist/components/TypingIndicator.d.ts.map +1 -1
  57. package/dist/components/TypingIndicator.js +21 -0
  58. package/dist/components/VoiceWaveIcon.d.ts +1 -1
  59. package/dist/components/VoiceWaveIcon.d.ts.map +1 -1
  60. package/dist/components/VoiceWaveIcon.js +5 -0
  61. package/dist/context/ChatContext.d.ts +1 -1
  62. package/dist/context/ChatContext.d.ts.map +1 -1
  63. package/dist/context/ChatContext.js +347 -0
  64. package/package.json +1 -1
@@ -0,0 +1,165 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useState } from "react";
4
+ import { MessageList } from "./MessageList";
5
+ export function MessageListDemo() {
6
+ const [messages, setMessages] = useState([
7
+ // Yesterday's messages
8
+ {
9
+ id: "demo-old-1",
10
+ conversationId: "demo-conv",
11
+ senderId: "user-2",
12
+ content: "Hey! How was your weekend?",
13
+ type: "text",
14
+ timestamp: new Date(Date.now() - 86400000 - 3600000), // Yesterday
15
+ status: "read",
16
+ },
17
+ {
18
+ id: "demo-old-2",
19
+ conversationId: "demo-conv",
20
+ senderId: "current-user",
21
+ content: "It was great! Went hiking 🏔️",
22
+ type: "text",
23
+ timestamp: new Date(Date.now() - 86400000 - 3000000), // Yesterday
24
+ status: "read",
25
+ },
26
+ // Today's messages
27
+ {
28
+ id: "demo-1",
29
+ conversationId: "demo-conv",
30
+ senderId: "user-2",
31
+ content: "Good morning! How are you today? 😊",
32
+ type: "text",
33
+ timestamp: new Date(Date.now() - 3600000), // 1 hour ago
34
+ status: "read",
35
+ },
36
+ {
37
+ id: "demo-2",
38
+ conversationId: "demo-conv",
39
+ senderId: "current-user",
40
+ content: "Morning! I'm doing great, thanks for asking!",
41
+ type: "text",
42
+ timestamp: new Date(Date.now() - 3000000), // 50 minutes ago
43
+ status: "read",
44
+ },
45
+ {
46
+ id: "demo-3",
47
+ conversationId: "demo-conv",
48
+ senderId: "user-2",
49
+ content: "Check out these photos from my trip!",
50
+ type: "image",
51
+ timestamp: new Date(Date.now() - 2400000), // 40 minutes ago
52
+ status: "read",
53
+ attachments: [
54
+ {
55
+ id: "att-1",
56
+ name: "trip1.jpg",
57
+ url: "/placeholder.svg?height=300&width=400",
58
+ type: "image/jpeg",
59
+ size: 245760,
60
+ },
61
+ {
62
+ id: "att-2",
63
+ name: "trip2.jpg",
64
+ url: "/placeholder.svg?height=300&width=400",
65
+ type: "image/jpeg",
66
+ size: 198432,
67
+ },
68
+ ],
69
+ },
70
+ {
71
+ id: "demo-4",
72
+ conversationId: "demo-conv",
73
+ senderId: "current-user",
74
+ content: "Wow, those are amazing! 😍",
75
+ type: "text",
76
+ timestamp: new Date(Date.now() - 1800000), // 30 minutes ago
77
+ status: "read",
78
+ },
79
+ {
80
+ id: "demo-5",
81
+ conversationId: "demo-conv",
82
+ senderId: "user-2",
83
+ content: "Here's the document you requested",
84
+ type: "file",
85
+ timestamp: new Date(Date.now() - 1200000), // 20 minutes ago
86
+ status: "read",
87
+ attachments: [
88
+ {
89
+ id: "att-3",
90
+ name: "report.pdf",
91
+ url: "/placeholder.svg?height=200&width=200",
92
+ type: "application/pdf",
93
+ size: 1024000,
94
+ },
95
+ ],
96
+ },
97
+ {
98
+ id: "demo-6",
99
+ conversationId: "demo-conv",
100
+ senderId: "current-user",
101
+ content: "Perfect, thanks! I'll review it this afternoon.",
102
+ type: "text",
103
+ timestamp: new Date(Date.now() - 600000), // 10 minutes ago
104
+ status: "read",
105
+ },
106
+ ]);
107
+ const [isLoadingMore, setIsLoadingMore] = useState(false);
108
+ const [hasMore, setHasMore] = useState(true);
109
+ const handleLoadMore = () => {
110
+ setIsLoadingMore(true);
111
+ // Simulate loading more messages
112
+ setTimeout(() => {
113
+ const olderMessages = [
114
+ {
115
+ id: `older-${Date.now()}-1`,
116
+ conversationId: "demo-conv",
117
+ senderId: "user-2",
118
+ content: "Hey, did you see the news today?",
119
+ type: "text",
120
+ timestamp: new Date(Date.now() - 172800000), // 2 days ago
121
+ status: "read",
122
+ },
123
+ {
124
+ id: `older-${Date.now()}-2`,
125
+ conversationId: "demo-conv",
126
+ senderId: "current-user",
127
+ content: "Yes! It's quite interesting.",
128
+ type: "text",
129
+ timestamp: new Date(Date.now() - 172800000 + 300000), // 2 days ago + 5 min
130
+ status: "read",
131
+ },
132
+ ];
133
+ setMessages((prev) => [...olderMessages, ...prev]);
134
+ setIsLoadingMore(false);
135
+ // Simulate no more messages after a few loads
136
+ if (messages.length > 15) {
137
+ setHasMore(false);
138
+ }
139
+ }, 1500);
140
+ };
141
+ const handleSendMessage = (content) => {
142
+ const newMessage = {
143
+ id: `new-${Date.now()}`,
144
+ conversationId: "demo-conv",
145
+ senderId: "current-user",
146
+ content,
147
+ type: "text",
148
+ timestamp: new Date(),
149
+ status: "sending",
150
+ };
151
+ setMessages((prev) => [...prev, newMessage]);
152
+ // Simulate message status update
153
+ setTimeout(() => {
154
+ setMessages((prev) => prev.map((msg) => (msg.id === newMessage.id ? Object.assign(Object.assign({}, msg), { status: "delivered" }) : msg)));
155
+ }, 1000);
156
+ };
157
+ return (_jsxs("div", { className: "max-w-4xl mx-auto bg-white rounded-lg shadow-lg overflow-hidden h-[600px] flex flex-col", children: [_jsxs("div", { className: "bg-gray-50 p-4 border-b flex-shrink-0", children: [_jsx("h2", { className: "text-lg font-semibold text-gray-900", children: "MessageList Demo" }), _jsx("p", { className: "text-sm text-gray-600", children: "Features: Auto-scroll, lazy loading, date grouping, sender grouping" })] }), _jsx("div", { className: "flex-1 overflow-hidden", children: _jsx(MessageList, { messages: messages, isLoadingMore: isLoadingMore, onLoadMore: handleLoadMore, hasMore: hasMore, currentUserId: "current-user", conversationId: "demo-conv" }) }), _jsx("div", { className: "border-t p-4 flex-shrink-0", children: _jsxs("form", { onSubmit: (e) => {
158
+ e.preventDefault();
159
+ const input = e.currentTarget.elements.namedItem("message");
160
+ if (input.value.trim()) {
161
+ handleSendMessage(input.value.trim());
162
+ input.value = "";
163
+ }
164
+ }, className: "flex space-x-2", children: [_jsx("input", { name: "message", type: "text", placeholder: "Nh\u1EADp tin nh\u1EAFn \u0111\u1EC3 test auto-scroll...", className: "flex-1 px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500" }), _jsx("button", { type: "submit", className: "px-4 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600 transition-colors", children: "G\u1EEDi" })] }) })] }));
165
+ }
@@ -0,0 +1,68 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import React from "react";
4
+ import { useState } from "react";
5
+ import { X, Search, Heart, Smile, Star, Zap, Coffee, Music, Gamepad2Icon as GameController2, Sparkles, } from "lucide-react";
6
+ const stickerCategories = {
7
+ popular: {
8
+ label: "Phổ biến",
9
+ icon: Star,
10
+ stickers: ["🔥", "💯", "✨", "⭐", "🎉", "🎊", "💫", "🌟", "⚡"],
11
+ },
12
+ emotions: {
13
+ label: "Cảm xúc",
14
+ icon: Heart,
15
+ stickers: ["❤️", "💕", "💖", "💗", "💓", "💘", "💝", "💟", "♥️", "💔", "❣️", "💋", "👑", "💎", "🌹"],
16
+ },
17
+ reactions: {
18
+ label: "Phản ứng",
19
+ icon: Smile,
20
+ stickers: ["👍", "👎", "👏", "🙌", "👌", "✌️", "🤞", "🤟", "🤘", "👊", "✊", "🤛", "🤜", "👋", "🤚"],
21
+ },
22
+ fun: {
23
+ label: "Vui nhộn",
24
+ icon: Zap,
25
+ stickers: ["🎯", "🎪", "🎨", "🎭", "🎪", "🎡", "🎢", "🎠", "🎳", "🎮", "🕹️", "🎲", "🃏", "🎴", "🀄"],
26
+ },
27
+ food: {
28
+ label: "Đồ ăn",
29
+ icon: Coffee,
30
+ stickers: ["🍕", "🍔", "🍟", "🌭", "🥪", "🌮", "🌯", "🥙", "🧆", "🥚", "🍳", "🥘", "🍲", "🥗", "🍿"],
31
+ },
32
+ activities: {
33
+ label: "Hoạt động",
34
+ icon: GameController2,
35
+ stickers: ["⚽", "🏀", "🏈", "⚾", "🥎", "🎾", "🏐", "🏉", "🥏", "🎱", "🪀", "🏓", "🏸", "🏒", "🏑"],
36
+ },
37
+ nature: {
38
+ label: "Thiên nhiên",
39
+ icon: Sparkles,
40
+ stickers: ["🌸", "🌺", "🌻", "🌷", "🌹", "🥀", "🌾", "🌿", "☘️", "🍀", "🍃", "🌱", "🌲", "🌳", "🌴"],
41
+ },
42
+ music: {
43
+ label: "Âm nhạc",
44
+ icon: Music,
45
+ stickers: ["🎵", "🎶", "🎼", "🎹", "🥁", "🎷", "🎺", "🎸", "🪕", "🎻", "🎤", "🎧", "📻", "🎚️", "🎛️"],
46
+ },
47
+ };
48
+ export const StickerPicker = React.forwardRef(({ onStickerSelect, onClose, isOpen = false, style }, ref) => {
49
+ const [activeCategory, setActiveCategory] = useState("popular");
50
+ const [searchTerm, setSearchTerm] = useState("");
51
+ if (!isOpen)
52
+ return null;
53
+ const handleStickerClick = (sticker) => {
54
+ onStickerSelect === null || onStickerSelect === void 0 ? void 0 : onStickerSelect(sticker);
55
+ };
56
+ const filteredStickers = searchTerm
57
+ ? stickerCategories[activeCategory].stickers.filter((sticker) => sticker.includes(searchTerm))
58
+ : stickerCategories[activeCategory].stickers;
59
+ return (_jsx("div", { ref: ref, className: "absolute bottom-full mb-1 bg-white border border-gray-200 rounded-lg shadow-lg z-50 w-full sm:max-w-xs md:w-80", style: style, children: _jsxs("div", { className: "p-2", children: [_jsxs("div", { className: "flex items-center justify-between mb-2 pb-1 border-b border-gray-100", children: [Object.entries(stickerCategories).map(([key, category]) => {
60
+ const Icon = category.icon;
61
+ const isActive = activeCategory === key;
62
+ return (_jsx("button", { onClick: () => setActiveCategory(key), className: `
63
+ p-1.5 rounded-full transition-all duration-200 hover:bg-gray-100
64
+ ${isActive ? "text-purple-500 bg-purple-50" : "text-gray-500"}
65
+ `, title: category.label, children: _jsx(Icon, { className: "w-4 h-4" }) }, key));
66
+ }), _jsx("button", { onClick: onClose, className: "p-1.5 text-gray-400 hover:text-gray-600 rounded-full hover:bg-gray-100", children: _jsx(X, { className: "w-4 h-4" }) })] }), _jsxs("div", { className: "relative mb-2", children: [_jsx(Search, { className: "absolute left-2 top-1/2 transform -translate-y-1/2 w-3 h-3 text-gray-400" }), _jsx("input", { type: "text", placeholder: "T\u00ECm sticker", value: searchTerm, onChange: (e) => setSearchTerm(e.target.value), className: "w-full pl-7 pr-3 py-1.5 text-xs bg-gray-50 border border-gray-200 rounded-md focus:outline-none focus:ring-1 focus:ring-purple-500 focus:border-transparent" })] }), _jsx("div", { className: "mb-2", children: _jsx("h3", { className: "text-xs font-medium text-gray-900", children: stickerCategories[activeCategory].label }) }), _jsx("div", { className: "grid grid-cols-6 gap-1 max-h-48 overflow-y-auto", children: filteredStickers.map((sticker, index) => (_jsx("button", { onClick: () => handleStickerClick(sticker), className: "p-2 text-xl hover:bg-gray-100 rounded transition-all duration-200 hover:scale-110 active:scale-95 border border-gray-100 hover:border-gray-200", title: sticker, children: sticker }, index))) }), filteredStickers.length === 0 && (_jsxs("div", { className: "text-center py-4 text-gray-500", children: [_jsx("div", { className: "text-lg mb-1", children: "\uD83D\uDD0D" }), _jsx("p", { className: "text-xs", children: "Kh\u00F4ng t\u00ECm th\u1EA5y sticker n\u00E0o" })] }))] }) }));
67
+ });
68
+ StickerPicker.displayName = "StickerPicker";
@@ -4,6 +4,6 @@ interface SwipeIndicatorProps {
4
4
  text: string;
5
5
  className?: string;
6
6
  }
7
- export declare function SwipeIndicator({ show, direction, text, className }: SwipeIndicatorProps): import("react").JSX.Element | null;
7
+ export declare function SwipeIndicator({ show, direction, text, className }: SwipeIndicatorProps): import("react/jsx-runtime").JSX.Element | null;
8
8
  export {};
9
9
  //# sourceMappingURL=SwipeIndicator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SwipeIndicator.d.ts","sourceRoot":"","sources":["../../src/components/SwipeIndicator.tsx"],"names":[],"mappings":"AAIA,UAAU,mBAAmB;IAC3B,IAAI,EAAE,OAAO,CAAA;IACb,SAAS,EAAE,MAAM,GAAG,OAAO,CAAA;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,cAAc,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAc,EAAE,EAAE,mBAAmB,sCAmC5F"}
1
+ {"version":3,"file":"SwipeIndicator.d.ts","sourceRoot":"","sources":["../../src/components/SwipeIndicator.tsx"],"names":[],"mappings":"AAIA,UAAU,mBAAmB;IAC3B,IAAI,EAAE,OAAO,CAAA;IACb,SAAS,EAAE,MAAM,GAAG,OAAO,CAAA;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,cAAc,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAc,EAAE,EAAE,mBAAmB,kDAmC5F"}
@@ -0,0 +1,24 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useState } from "react";
4
+ export function SwipeIndicator({ show, direction, text, className = "" }) {
5
+ const [isVisible, setIsVisible] = useState(false);
6
+ useEffect(() => {
7
+ if (show) {
8
+ setIsVisible(true);
9
+ }
10
+ else {
11
+ const timer = setTimeout(() => setIsVisible(false), 300);
12
+ return () => clearTimeout(timer);
13
+ }
14
+ }, [show]);
15
+ if (!isVisible)
16
+ return null;
17
+ return (_jsxs("div", { className: `
18
+ fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-50
19
+ bg-black bg-opacity-80 text-white px-4 py-3 rounded-lg
20
+ flex items-center space-x-2 transition-all duration-300
21
+ ${show ? "opacity-100 scale-100" : "opacity-0 scale-95"}
22
+ ${className}
23
+ `, children: [_jsx("svg", { className: `w-5 h-5 ${direction === "left" ? "rotate-180" : ""}`, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" }) }), _jsx("span", { className: "text-sm font-medium", children: text })] }));
24
+ }
@@ -0,0 +1,29 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import React from "react";
4
+ import { Bold, Italic, Strikethrough, List, ListOrdered, Link, Quote, Code, X } from "lucide-react";
5
+ const formatButtons = [
6
+ { icon: Bold, label: "Đậm", format: "bold", shortcut: "Ctrl+B", symbol: "**" },
7
+ { icon: Italic, label: "Nghiêng", format: "italic", shortcut: "Ctrl+I", symbol: "*" },
8
+ { icon: Strikethrough, label: "Gạch ngang", format: "strikethrough", shortcut: "Ctrl+Shift+X", symbol: "~~" },
9
+ { icon: ListOrdered, label: "Danh sách số", format: "numbered-list", shortcut: "Ctrl+Shift+7", symbol: "1." },
10
+ { icon: List, label: "Danh sách dấu đầu dòng", format: "bullet-list", shortcut: "Ctrl+Shift+8", symbol: "•" },
11
+ { icon: Link, label: "Liên kết", format: "link", shortcut: "Ctrl+K", symbol: "[]" },
12
+ { icon: Quote, label: "Trích dẫn", format: "quote", shortcut: "Ctrl+Shift+>", symbol: ">" },
13
+ { icon: Code, label: "Mã", format: "code", shortcut: "Ctrl+E", symbol: "`" },
14
+ ];
15
+ export const TextFormattingToolbar = React.forwardRef(({ isOpen, onClose, onFormatSelect, selectedFormats = [], style }, ref) => {
16
+ if (!isOpen)
17
+ return null;
18
+ return (_jsx("div", { ref: ref, className: "absolute bottom-full mb-1 bg-white border border-gray-200 rounded-lg shadow-lg z-50 w-full sm:max-w-xs md:w-80", style: style, children: _jsxs("div", { className: "p-2", children: [_jsxs("div", { className: "flex items-center justify-between mb-2", children: [_jsx("h3", { className: "text-xs font-medium text-gray-900", children: "\u0110\u1ECBnh d\u1EA1ng v\u0103n b\u1EA3n" }), _jsx("button", { onClick: onClose, className: "p-1 text-gray-400 hover:text-gray-600 rounded-full hover:bg-gray-100", children: _jsx(X, { className: "w-3 h-3" }) })] }), _jsx("div", { className: "grid grid-cols-4 gap-1", children: formatButtons.map((button) => {
19
+ const Icon = button.icon;
20
+ const isSelected = selectedFormats.includes(button.format);
21
+ return (_jsxs("button", { onClick: () => onFormatSelect(button.format), className: `
22
+ flex flex-col items-center p-2 rounded transition-all duration-200 hover:bg-gray-50 active:scale-95
23
+ ${isSelected
24
+ ? "bg-blue-50 text-blue-600 border border-blue-200"
25
+ : "text-gray-600 hover:text-gray-800 border border-gray-200"}
26
+ `, title: `${button.label} (${button.shortcut})`, "aria-label": button.label, children: [_jsx(Icon, { className: "w-4 h-4 mb-1" }), _jsx("span", { className: "text-xs font-medium", children: button.symbol })] }, button.format));
27
+ }) }), _jsx("div", { className: "mt-2 pt-2 border-t border-gray-100", children: _jsx("p", { className: "text-xs text-gray-500 text-center", children: "\uD83D\uDCA1 S\u1EED d\u1EE5ng ph\u00EDm t\u1EAFt \u0111\u1EC3 \u0111\u1ECBnh d\u1EA1ng nhanh" }) })] }) }));
28
+ });
29
+ TextFormattingToolbar.displayName = "TextFormattingToolbar";
@@ -1,6 +1,6 @@
1
1
  interface TypingIndicatorProps {
2
2
  conversationId: string;
3
3
  }
4
- export declare function TypingIndicator({ conversationId }: TypingIndicatorProps): import("react").JSX.Element | null;
4
+ export declare function TypingIndicator({ conversationId }: TypingIndicatorProps): import("react/jsx-runtime").JSX.Element | null;
5
5
  export {};
6
6
  //# sourceMappingURL=TypingIndicator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TypingIndicator.d.ts","sourceRoot":"","sources":["../../src/components/TypingIndicator.tsx"],"names":[],"mappings":"AAGA,UAAU,oBAAoB;IAC5B,cAAc,EAAE,MAAM,CAAA;CACvB;AAED,wBAAgB,eAAe,CAAC,EAAE,cAAc,EAAE,EAAE,oBAAoB,sCAgCvE"}
1
+ {"version":3,"file":"TypingIndicator.d.ts","sourceRoot":"","sources":["../../src/components/TypingIndicator.tsx"],"names":[],"mappings":"AAGA,UAAU,oBAAoB;IAC5B,cAAc,EAAE,MAAM,CAAA;CACvB;AAED,wBAAgB,eAAe,CAAC,EAAE,cAAc,EAAE,EAAE,oBAAoB,kDAgCvE"}
@@ -0,0 +1,21 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useTyping } from "../hooks/useTyping";
4
+ export function TypingIndicator({ conversationId }) {
5
+ const { typingUsers, isTyping } = useTyping(conversationId);
6
+ if (!isTyping)
7
+ return null;
8
+ const getTypingText = () => {
9
+ if (typingUsers.length === 1) {
10
+ return `${typingUsers[0].name} is typing...`;
11
+ }
12
+ else if (typingUsers.length === 2) {
13
+ return `${typingUsers[0].name} and ${typingUsers[1].name} are typing...`;
14
+ }
15
+ else if (typingUsers.length > 2) {
16
+ return `${typingUsers[0].name} and ${typingUsers.length - 1} others are typing...`;
17
+ }
18
+ return "Someone is typing...";
19
+ };
20
+ return (_jsxs("div", { className: "flex items-center space-x-2 px-3 sm:px-4 py-2", children: [_jsxs("div", { className: "flex space-x-1", children: [_jsx("div", { className: "w-1.5 h-1.5 sm:w-2 sm:h-2 bg-gray-400 rounded-full animate-bounce" }), _jsx("div", { className: "w-1.5 h-1.5 sm:w-2 sm:h-2 bg-gray-400 rounded-full animate-bounce", style: { animationDelay: "0.1s" } }), _jsx("div", { className: "w-1.5 h-1.5 sm:w-2 sm:h-2 bg-gray-400 rounded-full animate-bounce", style: { animationDelay: "0.2s" } })] }), _jsx("span", { className: "text-xs sm:text-sm text-gray-500", children: getTypingText() })] }));
21
+ }
@@ -2,6 +2,6 @@ interface VoiceWaveIconProps {
2
2
  className?: string;
3
3
  animated?: boolean;
4
4
  }
5
- export declare function VoiceWaveIcon({ className, animated }: VoiceWaveIconProps): import("react").JSX.Element;
5
+ export declare function VoiceWaveIcon({ className, animated }: VoiceWaveIconProps): import("react/jsx-runtime").JSX.Element;
6
6
  export {};
7
7
  //# sourceMappingURL=VoiceWaveIcon.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"VoiceWaveIcon.d.ts","sourceRoot":"","sources":["../../src/components/VoiceWaveIcon.tsx"],"names":[],"mappings":"AAEA,UAAU,kBAAkB;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,wBAAgB,aAAa,CAAC,EAAE,SAAqB,EAAE,QAAgB,EAAE,EAAE,kBAAkB,+BAmB5F"}
1
+ {"version":3,"file":"VoiceWaveIcon.d.ts","sourceRoot":"","sources":["../../src/components/VoiceWaveIcon.tsx"],"names":[],"mappings":"AAEA,UAAU,kBAAkB;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,wBAAgB,aAAa,CAAC,EAAE,SAAqB,EAAE,QAAgB,EAAE,EAAE,kBAAkB,2CAmB5F"}
@@ -0,0 +1,5 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ export function VoiceWaveIcon({ className = "w-5 h-5", animated = false }) {
4
+ return (_jsxs("svg", { className: className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("path", { d: "M2 10v4", className: animated ? "animate-pulse" : "" }), _jsx("path", { d: "M6 6v12", className: animated ? "animate-pulse" : "", style: { animationDelay: "0.1s" } }), _jsx("path", { d: "M10 4v16", className: animated ? "animate-pulse" : "", style: { animationDelay: "0.2s" } }), _jsx("path", { d: "M14 4v16", className: animated ? "animate-pulse" : "", style: { animationDelay: "0.3s" } }), _jsx("path", { d: "M18 6v12", className: animated ? "animate-pulse" : "", style: { animationDelay: "0.4s" } }), _jsx("path", { d: "M22 10v4", className: animated ? "animate-pulse" : "", style: { animationDelay: "0.5s" } })] }));
5
+ }
@@ -67,6 +67,6 @@ interface ChatProviderProps {
67
67
  enableWebSocket?: boolean;
68
68
  }
69
69
  export declare function ChatProvider({ children, userId, token, onTokenRefresh, websocketUrl, // Use "demo" as default to disable WebSocket
70
- enableWebSocket, }: ChatProviderProps): React.JSX.Element;
70
+ enableWebSocket, }: ChatProviderProps): import("react/jsx-runtime").JSX.Element;
71
71
  export {};
72
72
  //# sourceMappingURL=ChatContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChatContext.d.ts","sourceRoot":"","sources":["../../src/context/ChatContext.tsx"],"names":[],"mappings":"AACA,OAAO,EAAoD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AACxF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAErF,UAAU,SAAS;IACjB,MAAM,EAAE,UAAU,GAAG,IAAI,CAA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