jibtalk-react 1.0.0 → 1.0.2
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/components/ChatFooter.d.ts +6 -0
- package/dist/components/ChatHeader.d.ts +7 -0
- package/dist/components/MessageBubble.d.ts +11 -0
- package/dist/components/MessageInput.d.ts +18 -0
- package/dist/components/MessagesList.d.ts +9 -0
- package/dist/components/WelcomeCard.d.ts +7 -0
- package/dist/index.d.ts +17 -3
- package/dist/jibtalk-react.js +5990 -125
- package/dist/jibtalk-react.umd.cjs +11 -1
- package/package.json +11 -5
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface MessageBubbleProps {
|
|
3
|
+
msg: any;
|
|
4
|
+
parentMsg?: any;
|
|
5
|
+
onReply: (msg: any) => void;
|
|
6
|
+
toPersianDigits: (val: string | number) => string;
|
|
7
|
+
getRelativeTimeString: (dateStr: string) => string;
|
|
8
|
+
lastOfPersen: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const MessageBubble: React.FC<MessageBubbleProps>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface MessageInputProps {
|
|
3
|
+
inputText: string;
|
|
4
|
+
replyToMessage: any;
|
|
5
|
+
setReplyToMessage: (val: any) => void;
|
|
6
|
+
attachedFile: any;
|
|
7
|
+
setAttachedFile: (val: any) => void;
|
|
8
|
+
isUploading: boolean;
|
|
9
|
+
onSend: () => void;
|
|
10
|
+
handleInputChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
11
|
+
handleKeyDown: (e: React.KeyboardEvent<HTMLTextAreaElement>) => void;
|
|
12
|
+
handleFileChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
13
|
+
handleEmojiClick: (emoji: string) => void;
|
|
14
|
+
showEmojiPicker: boolean;
|
|
15
|
+
setShowEmojiPicker: (val: boolean) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const MessageInput: React.FC<MessageInputProps>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface MessagesListProps {
|
|
2
|
+
messages: any[];
|
|
3
|
+
messagesEndRef: React.RefObject<HTMLDivElement | null>;
|
|
4
|
+
setReplyToMessage: (msg: any) => void;
|
|
5
|
+
toPersianDigits: (val: string | number) => string;
|
|
6
|
+
getRelativeTimeString: (dateStr: string) => string;
|
|
7
|
+
}
|
|
8
|
+
export declare const MessagesList: React.FC<MessagesListProps>;
|
|
9
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import "./tailwind.css";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import type { JibTalkUser, JibTalkOptions, ThemeTypes } from "jibtalk-core";
|
|
3
4
|
export declare function useJibTalk(): {
|
|
4
5
|
isOpen: boolean;
|
|
5
6
|
isConnected: boolean;
|
|
6
7
|
unreadCount: number;
|
|
7
8
|
currentConversation: any;
|
|
8
9
|
messages: any[];
|
|
10
|
+
workspaceName: any;
|
|
11
|
+
workspaceSlug: any;
|
|
12
|
+
theme: ThemeTypes;
|
|
9
13
|
open: () => void | undefined;
|
|
10
14
|
close: () => void | undefined;
|
|
11
15
|
toggle: () => void | undefined;
|
|
@@ -13,13 +17,23 @@ export declare function useJibTalk(): {
|
|
|
13
17
|
identify: (user: JibTalkUser) => void | undefined;
|
|
14
18
|
setUser: (user: JibTalkUser) => void | undefined;
|
|
15
19
|
logout: () => void | undefined;
|
|
16
|
-
sendMessage: (content: string) => void | undefined;
|
|
20
|
+
sendMessage: (content: string, parentMessageId?: string, file?: any) => void | undefined;
|
|
21
|
+
startConversation: () => any;
|
|
17
22
|
startTyping: () => void | undefined;
|
|
18
23
|
stopTyping: () => void | undefined;
|
|
19
24
|
on: (event: any, cb: Function) => void | undefined;
|
|
20
25
|
off: (event: any, cb: Function) => void | undefined;
|
|
21
26
|
};
|
|
22
27
|
export interface JibTalkProps extends JibTalkOptions {
|
|
28
|
+
apiKey: string;
|
|
29
|
+
locale?: string;
|
|
30
|
+
theme?: ThemeTypes;
|
|
31
|
+
position?: "bottom-right" | "bottom-left" | "top-right" | "top-left";
|
|
32
|
+
primaryColor?: string;
|
|
23
33
|
user?: JibTalkUser;
|
|
34
|
+
customer?: JibTalkUser;
|
|
35
|
+
conversationId?: string;
|
|
36
|
+
timestamp?: number;
|
|
37
|
+
signature?: string;
|
|
24
38
|
}
|
|
25
39
|
export declare const JibTalk: React.FC<JibTalkProps>;
|