@better-zap/react 0.0.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/LICENSE +15 -0
- package/README.md +3 -0
- package/dist/index.cjs +614 -0
- package/dist/index.d.cts +146 -0
- package/dist/index.d.mts +146 -0
- package/dist/index.mjs +578 -0
- package/dist/tailwind.css +11 -0
- package/dist/wpp-bg.webp +0 -0
- package/package.json +57 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Conversation, Conversation as Conversation$1, UIMessage, UIMessage as UIMessage$1, UIMessageStatus, UIMessageStatus as UIMessageStatus$1 } from "better-zap";
|
|
4
|
+
import { ClassValue } from "clsx";
|
|
5
|
+
|
|
6
|
+
//#region src/react/whatsapp-dashboard.d.ts
|
|
7
|
+
type MobileView = "list" | "chat";
|
|
8
|
+
interface WhatsappDashboardContextValue {
|
|
9
|
+
isMobile: boolean;
|
|
10
|
+
mobileView: MobileView;
|
|
11
|
+
setMobileView: (view: MobileView) => void;
|
|
12
|
+
}
|
|
13
|
+
declare function useWhatsappDashboard(): WhatsappDashboardContextValue;
|
|
14
|
+
interface WhatsappDashboardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
defaultMobileView?: MobileView;
|
|
17
|
+
}
|
|
18
|
+
declare function WhatsappDashboard({
|
|
19
|
+
children,
|
|
20
|
+
className,
|
|
21
|
+
defaultMobileView,
|
|
22
|
+
...props
|
|
23
|
+
}: WhatsappDashboardProps): react_jsx_runtime0.JSX.Element;
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/react/message-view.d.ts
|
|
26
|
+
interface MessageViewProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
27
|
+
children?: React.ReactNode;
|
|
28
|
+
}
|
|
29
|
+
declare function MessageView({
|
|
30
|
+
children,
|
|
31
|
+
className,
|
|
32
|
+
...props
|
|
33
|
+
}: MessageViewProps): react_jsx_runtime0.JSX.Element | null;
|
|
34
|
+
interface MessageViewHeaderProps {
|
|
35
|
+
conversation: Conversation$1;
|
|
36
|
+
onBack?: () => void;
|
|
37
|
+
onInfoClick?: () => void;
|
|
38
|
+
className?: string;
|
|
39
|
+
}
|
|
40
|
+
declare function MessageViewHeader({
|
|
41
|
+
conversation,
|
|
42
|
+
onBack,
|
|
43
|
+
onInfoClick,
|
|
44
|
+
className
|
|
45
|
+
}: MessageViewHeaderProps): react_jsx_runtime0.JSX.Element;
|
|
46
|
+
interface MessageViewContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
47
|
+
children?: React.ReactNode;
|
|
48
|
+
autoScroll?: boolean;
|
|
49
|
+
/** Called when the user scrolls to the top of the container. */
|
|
50
|
+
onScrollTop?: () => void;
|
|
51
|
+
}
|
|
52
|
+
declare function MessageViewContent({
|
|
53
|
+
children,
|
|
54
|
+
autoScroll,
|
|
55
|
+
onScrollTop,
|
|
56
|
+
className,
|
|
57
|
+
...props
|
|
58
|
+
}: MessageViewContentProps): react_jsx_runtime0.JSX.Element;
|
|
59
|
+
interface MessageListProps {
|
|
60
|
+
messages: UIMessage$1[];
|
|
61
|
+
renderMessageLabel?: (message: UIMessage$1) => string | undefined;
|
|
62
|
+
className?: string;
|
|
63
|
+
}
|
|
64
|
+
declare function MessageList({
|
|
65
|
+
messages,
|
|
66
|
+
renderMessageLabel,
|
|
67
|
+
className
|
|
68
|
+
}: MessageListProps): react_jsx_runtime0.JSX.Element;
|
|
69
|
+
declare function MessageViewEmpty({
|
|
70
|
+
className,
|
|
71
|
+
...props
|
|
72
|
+
}: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime0.JSX.Element;
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region src/react/message-bubble.d.ts
|
|
75
|
+
interface MessageBubbleProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
76
|
+
content: string;
|
|
77
|
+
sender: "user" | "bot";
|
|
78
|
+
timestamp?: string;
|
|
79
|
+
status?: UIMessageStatus$1 | string;
|
|
80
|
+
templateName?: string;
|
|
81
|
+
label?: string;
|
|
82
|
+
}
|
|
83
|
+
declare function MessageBubble({
|
|
84
|
+
content,
|
|
85
|
+
sender,
|
|
86
|
+
timestamp,
|
|
87
|
+
status,
|
|
88
|
+
templateName,
|
|
89
|
+
label,
|
|
90
|
+
className,
|
|
91
|
+
...props
|
|
92
|
+
}: MessageBubbleProps): react_jsx_runtime0.JSX.Element;
|
|
93
|
+
declare function FormattedMessage({
|
|
94
|
+
text
|
|
95
|
+
}: {
|
|
96
|
+
text: string;
|
|
97
|
+
}): react_jsx_runtime0.JSX.Element | null;
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/react/conversation-list.d.ts
|
|
100
|
+
interface ConversationListProps {
|
|
101
|
+
conversations: Conversation$1[];
|
|
102
|
+
isLoading: boolean;
|
|
103
|
+
isError?: boolean;
|
|
104
|
+
selectedConversationId: string | null;
|
|
105
|
+
onSelect: (id: string) => void;
|
|
106
|
+
className?: string;
|
|
107
|
+
}
|
|
108
|
+
declare function ConversationList({
|
|
109
|
+
conversations,
|
|
110
|
+
isLoading,
|
|
111
|
+
isError,
|
|
112
|
+
selectedConversationId,
|
|
113
|
+
onSelect,
|
|
114
|
+
className
|
|
115
|
+
}: ConversationListProps): react_jsx_runtime0.JSX.Element;
|
|
116
|
+
interface ConversationItemProps {
|
|
117
|
+
conversation: Conversation$1;
|
|
118
|
+
isSelected: boolean;
|
|
119
|
+
onClick: () => void;
|
|
120
|
+
}
|
|
121
|
+
declare function ConversationItem({
|
|
122
|
+
conversation,
|
|
123
|
+
isSelected,
|
|
124
|
+
onClick
|
|
125
|
+
}: ConversationItemProps): react_jsx_runtime0.JSX.Element;
|
|
126
|
+
//#endregion
|
|
127
|
+
//#region src/react/utils.d.ts
|
|
128
|
+
declare function cn(...inputs: ClassValue[]): string;
|
|
129
|
+
//#endregion
|
|
130
|
+
//#region src/react/message-input.d.ts
|
|
131
|
+
interface MessageInputProps {
|
|
132
|
+
onSend: (text: string) => void | Promise<void>;
|
|
133
|
+
disabled?: boolean;
|
|
134
|
+
placeholder?: string;
|
|
135
|
+
className?: string;
|
|
136
|
+
contextWindowOpen?: boolean;
|
|
137
|
+
}
|
|
138
|
+
declare function MessageInput({
|
|
139
|
+
onSend,
|
|
140
|
+
disabled,
|
|
141
|
+
placeholder,
|
|
142
|
+
className,
|
|
143
|
+
contextWindowOpen
|
|
144
|
+
}: MessageInputProps): react_jsx_runtime0.JSX.Element;
|
|
145
|
+
//#endregion
|
|
146
|
+
export { type Conversation, ConversationItem, ConversationList, FormattedMessage, MessageBubble, MessageBubbleProps, MessageInput, MessageList, MessageView, MessageViewContent, MessageViewEmpty, MessageViewHeader, type UIMessage, type UIMessageStatus, WhatsappDashboard, cn, useWhatsappDashboard };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ClassValue } from "clsx";
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
import { Conversation, Conversation as Conversation$1, UIMessage, UIMessage as UIMessage$1, UIMessageStatus, UIMessageStatus as UIMessageStatus$1 } from "better-zap";
|
|
5
|
+
|
|
6
|
+
//#region src/react/whatsapp-dashboard.d.ts
|
|
7
|
+
type MobileView = "list" | "chat";
|
|
8
|
+
interface WhatsappDashboardContextValue {
|
|
9
|
+
isMobile: boolean;
|
|
10
|
+
mobileView: MobileView;
|
|
11
|
+
setMobileView: (view: MobileView) => void;
|
|
12
|
+
}
|
|
13
|
+
declare function useWhatsappDashboard(): WhatsappDashboardContextValue;
|
|
14
|
+
interface WhatsappDashboardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
defaultMobileView?: MobileView;
|
|
17
|
+
}
|
|
18
|
+
declare function WhatsappDashboard({
|
|
19
|
+
children,
|
|
20
|
+
className,
|
|
21
|
+
defaultMobileView,
|
|
22
|
+
...props
|
|
23
|
+
}: WhatsappDashboardProps): react_jsx_runtime0.JSX.Element;
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/react/message-view.d.ts
|
|
26
|
+
interface MessageViewProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
27
|
+
children?: React.ReactNode;
|
|
28
|
+
}
|
|
29
|
+
declare function MessageView({
|
|
30
|
+
children,
|
|
31
|
+
className,
|
|
32
|
+
...props
|
|
33
|
+
}: MessageViewProps): react_jsx_runtime0.JSX.Element | null;
|
|
34
|
+
interface MessageViewHeaderProps {
|
|
35
|
+
conversation: Conversation$1;
|
|
36
|
+
onBack?: () => void;
|
|
37
|
+
onInfoClick?: () => void;
|
|
38
|
+
className?: string;
|
|
39
|
+
}
|
|
40
|
+
declare function MessageViewHeader({
|
|
41
|
+
conversation,
|
|
42
|
+
onBack,
|
|
43
|
+
onInfoClick,
|
|
44
|
+
className
|
|
45
|
+
}: MessageViewHeaderProps): react_jsx_runtime0.JSX.Element;
|
|
46
|
+
interface MessageViewContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
47
|
+
children?: React.ReactNode;
|
|
48
|
+
autoScroll?: boolean;
|
|
49
|
+
/** Called when the user scrolls to the top of the container. */
|
|
50
|
+
onScrollTop?: () => void;
|
|
51
|
+
}
|
|
52
|
+
declare function MessageViewContent({
|
|
53
|
+
children,
|
|
54
|
+
autoScroll,
|
|
55
|
+
onScrollTop,
|
|
56
|
+
className,
|
|
57
|
+
...props
|
|
58
|
+
}: MessageViewContentProps): react_jsx_runtime0.JSX.Element;
|
|
59
|
+
interface MessageListProps {
|
|
60
|
+
messages: UIMessage$1[];
|
|
61
|
+
renderMessageLabel?: (message: UIMessage$1) => string | undefined;
|
|
62
|
+
className?: string;
|
|
63
|
+
}
|
|
64
|
+
declare function MessageList({
|
|
65
|
+
messages,
|
|
66
|
+
renderMessageLabel,
|
|
67
|
+
className
|
|
68
|
+
}: MessageListProps): react_jsx_runtime0.JSX.Element;
|
|
69
|
+
declare function MessageViewEmpty({
|
|
70
|
+
className,
|
|
71
|
+
...props
|
|
72
|
+
}: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime0.JSX.Element;
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region src/react/message-bubble.d.ts
|
|
75
|
+
interface MessageBubbleProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
76
|
+
content: string;
|
|
77
|
+
sender: "user" | "bot";
|
|
78
|
+
timestamp?: string;
|
|
79
|
+
status?: UIMessageStatus$1 | string;
|
|
80
|
+
templateName?: string;
|
|
81
|
+
label?: string;
|
|
82
|
+
}
|
|
83
|
+
declare function MessageBubble({
|
|
84
|
+
content,
|
|
85
|
+
sender,
|
|
86
|
+
timestamp,
|
|
87
|
+
status,
|
|
88
|
+
templateName,
|
|
89
|
+
label,
|
|
90
|
+
className,
|
|
91
|
+
...props
|
|
92
|
+
}: MessageBubbleProps): react_jsx_runtime0.JSX.Element;
|
|
93
|
+
declare function FormattedMessage({
|
|
94
|
+
text
|
|
95
|
+
}: {
|
|
96
|
+
text: string;
|
|
97
|
+
}): react_jsx_runtime0.JSX.Element | null;
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/react/conversation-list.d.ts
|
|
100
|
+
interface ConversationListProps {
|
|
101
|
+
conversations: Conversation$1[];
|
|
102
|
+
isLoading: boolean;
|
|
103
|
+
isError?: boolean;
|
|
104
|
+
selectedConversationId: string | null;
|
|
105
|
+
onSelect: (id: string) => void;
|
|
106
|
+
className?: string;
|
|
107
|
+
}
|
|
108
|
+
declare function ConversationList({
|
|
109
|
+
conversations,
|
|
110
|
+
isLoading,
|
|
111
|
+
isError,
|
|
112
|
+
selectedConversationId,
|
|
113
|
+
onSelect,
|
|
114
|
+
className
|
|
115
|
+
}: ConversationListProps): react_jsx_runtime0.JSX.Element;
|
|
116
|
+
interface ConversationItemProps {
|
|
117
|
+
conversation: Conversation$1;
|
|
118
|
+
isSelected: boolean;
|
|
119
|
+
onClick: () => void;
|
|
120
|
+
}
|
|
121
|
+
declare function ConversationItem({
|
|
122
|
+
conversation,
|
|
123
|
+
isSelected,
|
|
124
|
+
onClick
|
|
125
|
+
}: ConversationItemProps): react_jsx_runtime0.JSX.Element;
|
|
126
|
+
//#endregion
|
|
127
|
+
//#region src/react/utils.d.ts
|
|
128
|
+
declare function cn(...inputs: ClassValue[]): string;
|
|
129
|
+
//#endregion
|
|
130
|
+
//#region src/react/message-input.d.ts
|
|
131
|
+
interface MessageInputProps {
|
|
132
|
+
onSend: (text: string) => void | Promise<void>;
|
|
133
|
+
disabled?: boolean;
|
|
134
|
+
placeholder?: string;
|
|
135
|
+
className?: string;
|
|
136
|
+
contextWindowOpen?: boolean;
|
|
137
|
+
}
|
|
138
|
+
declare function MessageInput({
|
|
139
|
+
onSend,
|
|
140
|
+
disabled,
|
|
141
|
+
placeholder,
|
|
142
|
+
className,
|
|
143
|
+
contextWindowOpen
|
|
144
|
+
}: MessageInputProps): react_jsx_runtime0.JSX.Element;
|
|
145
|
+
//#endregion
|
|
146
|
+
export { type Conversation, ConversationItem, ConversationList, FormattedMessage, MessageBubble, MessageBubbleProps, MessageInput, MessageList, MessageView, MessageViewContent, MessageViewEmpty, MessageViewHeader, type UIMessage, type UIMessageStatus, WhatsappDashboard, cn, useWhatsappDashboard };
|