@greatapps/greatchat-ui 0.1.0 → 0.1.1

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/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { ClassValue } from 'clsx';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
3
 
3
4
  interface ApiResponse<T> {
4
5
  status: 0 | 1;
@@ -135,4 +136,45 @@ declare function createGchatClient(config: GchatClientConfig): {
135
136
 
136
137
  declare function cn(...inputs: ClassValue[]): string;
137
138
 
138
- export { type ApiResponse, type Channel, type Contact, type GchatClientConfig, type Inbox, type InboxMessage, type InboxStats, type MessageContentType, type WhatsappStatus, cn, createGchatClient };
139
+ /**
140
+ * Groups messages by date. Assumes messages are pre-sorted by datetime_add (ascending).
141
+ */
142
+ declare function groupMessagesByDate(messages: InboxMessage[]): {
143
+ date: string;
144
+ messages: InboxMessage[];
145
+ }[];
146
+
147
+ declare function formatDateGroup(dateStr: string): string;
148
+ declare function formatMessageTime(dateStr: string): string;
149
+
150
+ interface ChatViewProps {
151
+ messages: InboxMessage[];
152
+ isLoading: boolean;
153
+ inboxStatus?: string;
154
+ onStatusChange?: (status: string) => void;
155
+ onSend: (content: string) => void;
156
+ onRetry?: (message: InboxMessage) => void;
157
+ onRevoke?: (message: InboxMessage) => void;
158
+ onEdit?: (message: InboxMessage, newContent: string) => void;
159
+ sendDisabled?: boolean;
160
+ renderHeader?: React.ReactNode;
161
+ renderStatusDropdown?: React.ReactNode;
162
+ }
163
+ declare function ChatView({ messages, isLoading, inboxStatus, onStatusChange, onSend, onRetry, onRevoke, onEdit, sendDisabled, renderHeader, renderStatusDropdown, }: ChatViewProps): react_jsx_runtime.JSX.Element;
164
+
165
+ interface ChatInputProps {
166
+ onSend: (content: string) => void;
167
+ disabled?: boolean;
168
+ }
169
+ declare function ChatInput({ onSend, disabled }: ChatInputProps): react_jsx_runtime.JSX.Element;
170
+
171
+ interface MessageBubbleProps {
172
+ message: InboxMessage;
173
+ onRetry?: (message: InboxMessage) => void;
174
+ onRevoke?: (message: InboxMessage) => void;
175
+ onEdit?: (message: InboxMessage, newContent: string) => void;
176
+ renderActions?: (message: InboxMessage) => React.ReactNode;
177
+ }
178
+ declare function MessageBubble({ message, onRetry, onRevoke, onEdit, renderActions, }: MessageBubbleProps): react_jsx_runtime.JSX.Element;
179
+
180
+ export { type ApiResponse, type Channel, ChatInput, type ChatInputProps, ChatView, type ChatViewProps, type Contact, type GchatClientConfig, type Inbox, type InboxMessage, type InboxStats, MessageBubble, type MessageBubbleProps, type MessageContentType, type WhatsappStatus, cn, createGchatClient, formatDateGroup, formatMessageTime, groupMessagesByDate };