@satek-team-intern/chatbot-widget 0.10.0 → 0.10.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/README.md +34 -39
- package/dist/chatbot-widget.es.js +4356 -4374
- package/dist/chatbot-widget.umd.js +16 -15
- package/dist/locales/en.json.d.ts +2 -1
- package/dist/locales/vi.json.d.ts +7 -5
- package/dist/src/assets/Icons.d.ts +2 -0
- package/dist/src/assets/createIcon.d.ts +2 -2
- package/dist/src/components/ChatWidget.d.ts +3 -3
- package/dist/src/components/ChatWindow.d.ts +3 -3
- package/dist/src/components/FloatingButton.d.ts +3 -3
- package/dist/src/components/index.d.ts +4 -0
- package/dist/src/components/modals/AddChat.d.ts +3 -3
- package/dist/src/components/modals/AddGroup.d.ts +6 -0
- package/dist/src/components/modals/AddMember.d.ts +3 -3
- package/dist/src/components/modals/FileViewer.d.ts +3 -3
- package/dist/src/components/modals/ThemeModal.d.ts +2 -2
- package/dist/src/components/modals/UpdateGroup.d.ts +3 -3
- package/dist/src/components/modals/UserProfileModal.d.ts +3 -3
- package/dist/src/components/modals/index.d.ts +2 -1
- package/dist/src/components/shared/ChatAvatar.d.ts +1 -1
- package/dist/src/components/shared/MemberAvatarFallBack.d.ts +5 -0
- package/dist/src/components/shared/ToastContainer.d.ts +2 -3
- package/dist/src/components/shared/index.d.ts +3 -0
- package/dist/src/components/sidebar/AppSideBar.d.ts +2 -3
- package/dist/src/components/sidebar/ChatInfoPanel.d.ts +11 -0
- package/dist/src/components/sidebar/ChatList.d.ts +4 -4
- package/dist/src/components/sidebar/ChatSearchBar.d.ts +2 -2
- package/dist/src/components/sidebar/SideBarInfoChat.d.ts +4 -4
- package/dist/src/components/sidebar/index.d.ts +1 -0
- package/dist/src/components/view/ChatHeader.d.ts +3 -3
- package/dist/src/components/view/ChatInput.d.ts +1 -2
- package/dist/src/components/view/ContactList.d.ts +3 -3
- package/dist/src/components/view/GroupList.d.ts +3 -3
- package/dist/src/components/view/MessageFiles.d.ts +3 -3
- package/dist/src/components/view/MessageItem.d.ts +3 -3
- package/dist/src/components/view/MessageList.d.ts +2 -2
- package/dist/src/components/view/index.d.ts +3 -2
- package/dist/src/constants/common.d.ts +1 -0
- package/dist/src/constants/file.d.ts +2 -0
- package/dist/src/constants/index.d.ts +2 -0
- package/dist/src/contexts/FileViewerContext.d.ts +5 -5
- package/dist/src/contexts/ToastContext.d.ts +3 -3
- package/dist/src/contexts/index.d.ts +2 -1
- package/dist/src/hooks/index.d.ts +3 -0
- package/dist/src/hooks/useChat.d.ts +2 -2
- package/dist/src/hooks/useDragDropFiles.d.ts +5 -4
- package/dist/src/hooks/useFileViewer.d.ts +1 -1
- package/dist/src/hooks/useSetting.d.ts +1 -1
- package/dist/src/hooks/useToast.d.ts +1 -1
- package/dist/src/hooks/useTranslation.d.ts +2 -1
- package/dist/src/locales/index.d.ts +3 -0
- package/dist/src/services/chat.service.d.ts +3 -4
- package/dist/src/services/index.d.ts +2 -0
- package/dist/src/services/language.service.d.ts +2 -2
- package/dist/src/store/index.d.ts +2 -0
- package/dist/src/store/selectors/index.d.ts +1 -0
- package/dist/src/store/selectors/setting.d.ts +5 -5
- package/dist/src/store/slices/chatSlice.d.ts +3 -4
- package/dist/src/store/slices/index.d.ts +2 -0
- package/dist/src/store/slices/settingSlice.d.ts +2 -3
- package/dist/src/store/store.d.ts +2 -2
- package/dist/src/styles/index.d.ts +1 -0
- package/dist/src/types/chat.type.d.ts +2 -2
- package/dist/src/types/types.d.ts +2 -6
- package/dist/src/utils/chat.utils.d.ts +1 -2
- package/dist/src/utils/file.utils.d.ts +16 -0
- package/dist/src/utils/format.utils.d.ts +2 -0
- package/dist/src/utils/index.d.ts +4 -0
- package/package.json +2 -2
|
@@ -29,7 +29,8 @@ declare const _default: {
|
|
|
29
29
|
"settings": "Thiết lập giao diện",
|
|
30
30
|
"minimize": "Thu nhỏ",
|
|
31
31
|
"maximize": "Mở rộng",
|
|
32
|
-
"close": "Đóng"
|
|
32
|
+
"close": "Đóng",
|
|
33
|
+
"language": "Thay đổi ngôn ngữ"
|
|
33
34
|
},
|
|
34
35
|
"chatInput": {
|
|
35
36
|
"placeholder": "Nhập tin nhắn...",
|
|
@@ -79,13 +80,14 @@ declare const _default: {
|
|
|
79
80
|
"createGroup": "Tạo nhóm mới"
|
|
80
81
|
},
|
|
81
82
|
"addChat": {
|
|
82
|
-
"title": "Tạo
|
|
83
|
-
"groupNamePlaceholder": "Nhập tên nhóm
|
|
84
|
-
"memberSearchPlaceholder": "
|
|
83
|
+
"title": "Tạo nhóm mới",
|
|
84
|
+
"groupNamePlaceholder": "Nhập tên nhóm",
|
|
85
|
+
"memberSearchPlaceholder": "Chọn người nhận hoặc nhập tên",
|
|
85
86
|
"membersSection": "Gợi ý thành viên",
|
|
86
87
|
"createGroup": "Tạo nhóm",
|
|
87
88
|
"selectMoreMembers": "Chọn thêm thành viên",
|
|
88
|
-
"selectMembers": "
|
|
89
|
+
"selectMembers": "Tạo",
|
|
90
|
+
"cancelMembers": "Huỷ"
|
|
89
91
|
},
|
|
90
92
|
"addMember": {
|
|
91
93
|
"title": "Thêm thành viên",
|
|
@@ -41,3 +41,5 @@ export declare const LoveIcon: import('react').ForwardRefExoticComponent<Omit<im
|
|
|
41
41
|
export declare const DeleteMessageIcon: import('react').ForwardRefExoticComponent<Omit<import('./createIcon').IconProps, "ref"> & import('react').RefAttributes<SVGSVGElement>>;
|
|
42
42
|
export declare const RevokeMessageIcon: import('react').ForwardRefExoticComponent<Omit<import('./createIcon').IconProps, "ref"> & import('react').RefAttributes<SVGSVGElement>>;
|
|
43
43
|
export declare const SeenIcon: import('react').ForwardRefExoticComponent<Omit<import('./createIcon').IconProps, "ref"> & import('react').RefAttributes<SVGSVGElement>>;
|
|
44
|
+
export declare const LanguageIcon: import('react').ForwardRefExoticComponent<Omit<import('./createIcon').IconProps, "ref"> & import('react').RefAttributes<SVGSVGElement>>;
|
|
45
|
+
export declare const ImagePlaceholderIcon: import('react').ForwardRefExoticComponent<Omit<import('./createIcon').IconProps, "ref"> & import('react').RefAttributes<SVGSVGElement>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { JSX } from 'react';
|
|
2
|
-
export interface IconProps extends
|
|
1
|
+
import { JSX, SVGProps } from 'react';
|
|
2
|
+
export interface IconProps extends SVGProps<SVGSVGElement> {
|
|
3
3
|
size?: number | string;
|
|
4
4
|
strokeWidth?: number;
|
|
5
5
|
strokeColor?: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ChatWidgetProps } from '
|
|
3
|
-
export declare const ChatWidget:
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ChatWidgetProps } from '../../types';
|
|
3
|
+
export declare const ChatWidget: FC<ChatWidgetProps>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ChatWidgetProps, WidgetMode } from '
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ChatWidgetProps, WidgetMode } from '../../types';
|
|
3
3
|
interface ChatWindowProps extends ChatWidgetProps {
|
|
4
4
|
mode: WidgetMode;
|
|
5
5
|
setMode: (mode: WidgetMode) => void;
|
|
@@ -28,5 +28,5 @@ interface ChatWindowProps extends ChatWidgetProps {
|
|
|
28
28
|
height: number;
|
|
29
29
|
}) => void;
|
|
30
30
|
}
|
|
31
|
-
export declare const ChatWindow:
|
|
31
|
+
export declare const ChatWindow: FC<ChatWindowProps>;
|
|
32
32
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { WidgetMode } from '
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { WidgetMode } from '../../types';
|
|
3
3
|
interface FloatingButtonProps {
|
|
4
4
|
mode: WidgetMode;
|
|
5
5
|
setMode: (mode: WidgetMode) => void;
|
|
@@ -13,5 +13,5 @@ interface FloatingButtonProps {
|
|
|
13
13
|
} | null) => void;
|
|
14
14
|
primaryColor?: string;
|
|
15
15
|
}
|
|
16
|
-
export declare const FloatingButton:
|
|
16
|
+
export declare const FloatingButton: FC<FloatingButtonProps>;
|
|
17
17
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ChatUser } from '
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ChatUser } from '../../../types';
|
|
3
3
|
interface AddChatProps {
|
|
4
4
|
isOpen: boolean;
|
|
5
5
|
onClose: () => void;
|
|
@@ -12,5 +12,5 @@ interface AddChatProps {
|
|
|
12
12
|
onModalSearchQueryChange: (query: string) => void;
|
|
13
13
|
onCreateChat: () => void;
|
|
14
14
|
}
|
|
15
|
-
export declare const AddChat:
|
|
15
|
+
export declare const AddChat: FC<AddChatProps>;
|
|
16
16
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ChatUser, ChatConversation } from '
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ChatUser, ChatConversation } from '../../../types';
|
|
3
3
|
interface AddMemberProps {
|
|
4
4
|
isOpen: boolean;
|
|
5
5
|
onClose: () => void;
|
|
@@ -9,5 +9,5 @@ interface AddMemberProps {
|
|
|
9
9
|
onAddMember: (chatId: number, memberId: number) => Promise<void>;
|
|
10
10
|
primaryColor?: string;
|
|
11
11
|
}
|
|
12
|
-
export declare const AddMember:
|
|
12
|
+
export declare const AddMember: FC<AddMemberProps>;
|
|
13
13
|
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ChatFile } from '
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ChatFile } from '../../../types';
|
|
3
3
|
interface FileViewerProps {
|
|
4
4
|
isOpen: boolean;
|
|
5
5
|
files: ChatFile[];
|
|
6
6
|
initialIndex?: number;
|
|
7
7
|
onClose: () => void;
|
|
8
8
|
}
|
|
9
|
-
export declare const FileViewer:
|
|
9
|
+
export declare const FileViewer: FC<FileViewerProps>;
|
|
10
10
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FC } from 'react';
|
|
2
2
|
interface ThemeModalProps {
|
|
3
3
|
isOpen: boolean;
|
|
4
4
|
onClose: () => void;
|
|
5
5
|
defaultColor?: string;
|
|
6
6
|
}
|
|
7
|
-
export declare const ThemeModal:
|
|
7
|
+
export declare const ThemeModal: FC<ThemeModalProps>;
|
|
8
8
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ChatConversation } from '
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ChatConversation } from '../../../types';
|
|
3
3
|
interface UpdateGroupProps {
|
|
4
4
|
isOpen: boolean;
|
|
5
5
|
onClose: () => void;
|
|
@@ -8,5 +8,5 @@ interface UpdateGroupProps {
|
|
|
8
8
|
onUpdate: (chatId: number, name: string, avatar?: string | File) => Promise<void>;
|
|
9
9
|
primaryColor?: string;
|
|
10
10
|
}
|
|
11
|
-
export declare const UpdateGroup:
|
|
11
|
+
export declare const UpdateGroup: FC<UpdateGroupProps>;
|
|
12
12
|
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ChatUser } from '
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ChatUser } from '../../../types';
|
|
3
3
|
interface UserProfileModalProps {
|
|
4
4
|
user: ChatUser;
|
|
5
5
|
onClose: () => void;
|
|
6
6
|
isOnline?: boolean;
|
|
7
7
|
onMessage: () => void;
|
|
8
8
|
}
|
|
9
|
-
export declare const UserProfileModal:
|
|
9
|
+
export declare const UserProfileModal: FC<UserProfileModalProps>;
|
|
10
10
|
export {};
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const ToastContainer:
|
|
3
|
-
export default ToastContainer;
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export declare const ToastContainer: FC;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { ChatUser } from '
|
|
2
|
-
declare const AppSideBar: ({ setIsThemeModalOpen, currentUser, activeTab, setActiveTab, }: {
|
|
1
|
+
import { ChatUser } from '../../../types';
|
|
2
|
+
export declare const AppSideBar: ({ setIsThemeModalOpen, currentUser, activeTab, setActiveTab, }: {
|
|
3
3
|
setIsThemeModalOpen: (open: boolean) => void;
|
|
4
4
|
currentUser: ChatUser;
|
|
5
5
|
activeTab: "chats" | "contacts";
|
|
6
6
|
setActiveTab: (tab: "chats" | "contacts") => void;
|
|
7
7
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export default AppSideBar;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ChatConversation, ChatUser } from '../../../types';
|
|
3
|
+
interface SideBarInfoChatProps {
|
|
4
|
+
currentUser: ChatUser | null;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
onAddMember: () => void;
|
|
7
|
+
onUpdateGroup?: (chat: ChatConversation) => void;
|
|
8
|
+
onRemoveMember?: (chatId: number, memberId: number) => void;
|
|
9
|
+
}
|
|
10
|
+
declare const ChatInfoPanel: FC<SideBarInfoChatProps>;
|
|
11
|
+
export { ChatInfoPanel };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ChatConversation } from '
|
|
1
|
+
import { FC, MouseEvent } from 'react';
|
|
2
|
+
import { ChatConversation } from '../../../types';
|
|
3
3
|
interface ChatListProps {
|
|
4
4
|
chats: ChatConversation[];
|
|
5
5
|
selectedChat: ChatConversation | null;
|
|
6
6
|
onSelectChat: (chat: ChatConversation) => void;
|
|
7
|
-
onRemoveChat: (chatId: number, e:
|
|
7
|
+
onRemoveChat: (chatId: number, e: MouseEvent<HTMLDivElement>) => void;
|
|
8
8
|
onUpdateGroup?: (chat: ChatConversation) => void;
|
|
9
9
|
onAddMemberClick?: (chat: ChatConversation) => void;
|
|
10
10
|
}
|
|
11
|
-
export declare const ChatList:
|
|
11
|
+
export declare const ChatList: FC<ChatListProps>;
|
|
12
12
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FC } from 'react';
|
|
2
2
|
interface ChatSearchBarProps {
|
|
3
3
|
value: string;
|
|
4
4
|
onChange: (value: string) => void;
|
|
@@ -6,5 +6,5 @@ interface ChatSearchBarProps {
|
|
|
6
6
|
placeholder?: string;
|
|
7
7
|
activeTab?: 'chats' | 'contacts';
|
|
8
8
|
}
|
|
9
|
-
export declare const ChatSearchBar:
|
|
9
|
+
export declare const ChatSearchBar: FC<ChatSearchBarProps>;
|
|
10
10
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ChatConversation, ChatUser } from '
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ChatConversation, ChatUser } from '../../../types';
|
|
3
3
|
interface SideBarInfoChatProps {
|
|
4
4
|
currentUser: ChatUser | null;
|
|
5
5
|
onClose: () => void;
|
|
@@ -7,5 +7,5 @@ interface SideBarInfoChatProps {
|
|
|
7
7
|
onUpdateGroup?: (chat: ChatConversation) => void;
|
|
8
8
|
onRemoveMember?: (chatId: number, memberId: number) => void;
|
|
9
9
|
}
|
|
10
|
-
declare const SideBarInfoChat:
|
|
11
|
-
export
|
|
10
|
+
declare const SideBarInfoChat: FC<SideBarInfoChatProps>;
|
|
11
|
+
export { SideBarInfoChat };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { WidgetMode } from '
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { WidgetMode } from '../../../types';
|
|
3
3
|
interface ChatHeaderProps {
|
|
4
4
|
mode: WidgetMode;
|
|
5
5
|
title?: string;
|
|
@@ -10,5 +10,5 @@ interface ChatHeaderProps {
|
|
|
10
10
|
onAddMemberClick?: () => void;
|
|
11
11
|
onOpenSettings?: () => void;
|
|
12
12
|
}
|
|
13
|
-
export declare const ChatHeader:
|
|
13
|
+
export declare const ChatHeader: FC<ChatHeaderProps>;
|
|
14
14
|
export {};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
1
|
interface ChatInputProps {
|
|
3
2
|
primaryColor?: string;
|
|
4
3
|
}
|
|
5
4
|
export interface ChatInputHandle {
|
|
6
5
|
processPastedFiles: (files: FileList) => void;
|
|
7
6
|
}
|
|
8
|
-
export declare const ChatInput:
|
|
7
|
+
export declare const ChatInput: import('react').ForwardRefExoticComponent<ChatInputProps & import('react').RefAttributes<ChatInputHandle>>;
|
|
9
8
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ChatUser } from '
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ChatUser } from '../../../types';
|
|
3
3
|
interface ContactListProps {
|
|
4
4
|
members: ChatUser[];
|
|
5
5
|
onMessageClick: (memberId: string) => void;
|
|
6
6
|
}
|
|
7
|
-
export declare const ContactList:
|
|
7
|
+
export declare const ContactList: FC<ContactListProps>;
|
|
8
8
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ChatConversation } from '
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ChatConversation } from '../../../types';
|
|
3
3
|
interface GroupListProps {
|
|
4
4
|
groups: ChatConversation[];
|
|
5
5
|
onGroupClick: (group: ChatConversation) => void;
|
|
6
6
|
currentUserId?: number;
|
|
7
7
|
}
|
|
8
|
-
export declare const GroupList:
|
|
8
|
+
export declare const GroupList: FC<GroupListProps>;
|
|
9
9
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ChatFile } from '
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ChatFile } from '../../../types';
|
|
3
3
|
interface MessageFilesProps {
|
|
4
4
|
files?: ChatFile[];
|
|
5
5
|
}
|
|
6
|
-
export declare const MessageFiles:
|
|
6
|
+
export declare const MessageFiles: FC<MessageFilesProps>;
|
|
7
7
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ChatMessage } from '
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ChatMessage } from '../../../types';
|
|
3
3
|
interface MessageItemProps {
|
|
4
4
|
message: ChatMessage;
|
|
5
5
|
}
|
|
6
|
-
export declare const MessageItem:
|
|
6
|
+
export declare const MessageItem: FC<MessageItemProps>;
|
|
7
7
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const MessageList:
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export declare const MessageList: FC<object>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './ChatHeader';
|
|
2
2
|
export * from './ChatInput';
|
|
3
|
-
export * from './MessageList';
|
|
4
|
-
export * from './MessageItem';
|
|
5
3
|
export * from './ContactList';
|
|
6
4
|
export * from './GroupList';
|
|
5
|
+
export * from './MessageFiles';
|
|
6
|
+
export * from './MessageItem';
|
|
7
|
+
export * from './MessageList';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const COMMON_EMOJIS: string[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ChatFile } from '
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { ChatFile } from '../../types';
|
|
3
3
|
export interface FileViewerContextType {
|
|
4
4
|
isOpen: boolean;
|
|
5
5
|
files: ChatFile[];
|
|
@@ -7,8 +7,8 @@ export interface FileViewerContextType {
|
|
|
7
7
|
openViewer: (files: ChatFile[], initialIndex?: number) => void;
|
|
8
8
|
closeViewer: () => void;
|
|
9
9
|
}
|
|
10
|
-
declare const FileViewerContext:
|
|
10
|
+
declare const FileViewerContext: import('react').Context<FileViewerContextType | undefined>;
|
|
11
11
|
export { FileViewerContext };
|
|
12
|
-
export declare const FileViewerProvider:
|
|
13
|
-
children:
|
|
12
|
+
export declare const FileViewerProvider: FC<{
|
|
13
|
+
children: ReactNode;
|
|
14
14
|
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const ToastProvider:
|
|
3
|
-
children:
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
export declare const ToastProvider: FC<{
|
|
3
|
+
children: ReactNode;
|
|
4
4
|
}>;
|
|
@@ -2,3 +2,6 @@ export { useChat } from './useChat';
|
|
|
2
2
|
export { useFileViewer } from './useFileViewer';
|
|
3
3
|
export { useDragDropFiles } from './useDragDropFiles';
|
|
4
4
|
export { useVoiceRecorder } from './useVoiceRecorder';
|
|
5
|
+
export { useTranslation } from './useTranslation';
|
|
6
|
+
export { useToast } from './useToast';
|
|
7
|
+
export { useSetting } from './useSetting';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AuthInfo } from '
|
|
2
|
-
export declare const useChat: (chatKey: string, authInfo: AuthInfo) => void;
|
|
1
|
+
import { AuthInfo } from '../../types';
|
|
2
|
+
export declare const useChat: (chatKey: string, authInfo: AuthInfo, workspace?: string) => void;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import { DragEvent } from 'react';
|
|
1
2
|
interface DragDropFilesProps {
|
|
2
3
|
onFilesAdded: (files: FileList) => void;
|
|
3
4
|
}
|
|
4
5
|
export declare const useDragDropFiles: ({ onFilesAdded }: DragDropFilesProps) => {
|
|
5
6
|
isDragOver: boolean;
|
|
6
|
-
handleDragEnter: (e:
|
|
7
|
-
handleDragOver: (e:
|
|
8
|
-
handleDragLeave: (e:
|
|
9
|
-
handleDrop: (e:
|
|
7
|
+
handleDragEnter: (e: DragEvent<HTMLDivElement>) => void;
|
|
8
|
+
handleDragOver: (e: DragEvent<HTMLDivElement>) => void;
|
|
9
|
+
handleDragLeave: (e: DragEvent<HTMLDivElement>) => void;
|
|
10
|
+
handleDrop: (e: DragEvent<HTMLDivElement>) => void;
|
|
10
11
|
};
|
|
11
12
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { FileViewerContextType } from '
|
|
1
|
+
import { FileViewerContextType } from '../../contexts';
|
|
2
2
|
export declare const useFileViewer: () => FileViewerContextType;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { WidgetFeature } from '
|
|
1
|
+
import { WidgetFeature } from '../../types';
|
|
2
2
|
export declare const useSetting: (config?: WidgetFeature) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useToast: () => import('
|
|
1
|
+
export declare const useToast: () => import('../../contexts').ToastContextType;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare const useTranslation: () => {
|
|
2
|
-
t: (path: "addChat" | "common" | "chatWindow" | "chatHeader" | "chatInput" | "chatMessage" | "chatList" | "chatSearchBar" | "addMember" | "fileViewer" | "themeModal" | "updateGroup" | "addChat.title" | "addChat.groupNamePlaceholder" | "addChat.memberSearchPlaceholder" | "addChat.membersSection" | "addChat.createGroup" | "addChat.selectMoreMembers" | "addChat.selectMembers" | "addChat.title." | "addChat.groupNamePlaceholder." | "addChat.memberSearchPlaceholder." | "addChat.membersSection." | "addChat.createGroup." | "addChat.selectMoreMembers." | "addChat.selectMembers." | "common.buttons" | "common.errors" | "common.buttons.save" | "common.buttons.cancel" | "common.buttons.confirm" | "common.buttons.close" | "common.buttons.save." | "common.buttons.cancel." | "common.buttons.confirm." | "common.buttons.close." | "common.errors.updateGroup" | "common.errors.createChat" | "common.errors.updateGroup." | "common.errors.createChat." | "chatWindow.memberSystem" | "chatWindow.dragFile" | "chatWindow.selectChat" | "chatWindow.startConversation" | "chatWindow.searchPlaceholder" | "chatWindow.filterAll" | "chatWindow.filterGroup" | "chatWindow.filterSingle" | "chatWindow.memberSystem." | "chatWindow.dragFile." | "chatWindow.selectChat." | "chatWindow.startConversation." | "chatWindow.searchPlaceholder." | "chatWindow.filterAll." | "chatWindow.filterGroup." | "chatWindow.filterSingle." | "chatHeader.addMember" | "chatHeader.close" | "chatHeader.close." | "chatHeader.defaultTitle" | "chatHeader.darkMode" | "chatHeader.lightMode" | "chatHeader.settings" | "chatHeader.minimize" | "chatHeader.maximize" | "chatHeader.addMember." | "chatHeader.defaultTitle." | "chatHeader.darkMode." | "chatHeader.lightMode." | "chatHeader.settings." | "chatHeader.minimize." | "chatHeader.maximize." | "chatInput.placeholder" | "chatInput.selectFiles" | "chatInput.recordVoice" | "chatInput.selectFilesOrOptions" | "chatInput.removeFile" | "chatInput.recording" | "chatInput.cancelRecording" | "chatInput.stopRecording" | "chatInput.playRecording" | "chatInput.discardRecording" | "chatInput.addToMessage" | "chatInput.voiceMessage" | "chatInput.replyingTo" | "chatInput.attachmentIndicator" | "chatInput.placeholder." | "chatInput.selectFiles." | "chatInput.recordVoice." | "chatInput.selectFilesOrOptions." | "chatInput.removeFile." | "chatInput.recording." | "chatInput.cancelRecording." | "chatInput.stopRecording." | "chatInput.playRecording." | "chatInput.discardRecording." | "chatInput.addToMessage." | "chatInput.voiceMessage." | "chatInput.replyingTo." | "chatInput.attachmentIndicator." | "chatMessage.status" | "chatMessage.actions" | "chatMessage.states" | "chatMessage.status.seen" | "chatMessage.status.sent" | "chatMessage.status.seen." | "chatMessage.status.sent." | "chatMessage.actions.reply" | "chatMessage.actions.like" | "chatMessage.actions.love" | "chatMessage.actions.revoke" | "chatMessage.actions.delete" | "chatMessage.actions.seeMore" | "chatMessage.actions.seeLess" | "chatMessage.actions.reply." | "chatMessage.actions.like." | "chatMessage.actions.love." | "chatMessage.actions.revoke." | "chatMessage.actions.delete." | "chatMessage.actions.seeMore." | "chatMessage.actions.seeLess." | "chatMessage.states.revoked" | "chatMessage.states.attachment" | "chatMessage.states.revoked." | "chatMessage.states.attachment." | "chatList.delete" | "chatList.addMember" | "chatList.addMember." | "chatList.delete." | "chatList.options" | "chatList.editGroup" | "chatList.deleteGroup" | "chatList.yourMessage" | "chatList.options." | "chatList.editGroup." | "chatList.deleteGroup." | "chatList.yourMessage." | "chatSearchBar.createGroup" | "chatSearchBar.createGroup." | "chatSearchBar.searchPlaceholder" | "chatSearchBar.searchPlaceholder." | "addMember.title" | "addMember.memberSearchPlaceholder" | "addMember.membersSection" | "addMember.title." | "addMember.memberSearchPlaceholder." | "addMember.membersSection." | "addMember.noMembersFound" | "addMember.addButton" | "addMember.noMembersFound." | "addMember.addButton." | "fileViewer.closeButtonTitle" | "fileViewer.previousButtonTitle" | "fileViewer.nextButtonTitle" | "fileViewer.scrollLeftTitle" | "fileViewer.scrollRightTitle" | "fileViewer.openDownloadButton" | "fileViewer.closeAriaLabel" | "fileViewer.previousAriaLabel" | "fileViewer.nextAriaLabel" | "fileViewer.scrollLeftAriaLabel" | "fileViewer.scrollRightAriaLabel" | "fileViewer.closeButtonTitle." | "fileViewer.previousButtonTitle." | "fileViewer.nextButtonTitle." | "fileViewer.scrollLeftTitle." | "fileViewer.scrollRightTitle." | "fileViewer.openDownloadButton." | "fileViewer.closeAriaLabel." | "fileViewer.previousAriaLabel." | "fileViewer.nextAriaLabel." | "fileViewer.scrollLeftAriaLabel." | "fileViewer.scrollRightAriaLabel." | "themeModal.title" | "themeModal.title." | "themeModal.themeSectionTitle" | "themeModal.themeSectionDesc" | "themeModal.customColorTitle" | "themeModal.doneButton" | "themeModal.resetButton" | "themeModal.themeSectionTitle." | "themeModal.themeSectionDesc." | "themeModal.customColorTitle." | "themeModal.doneButton." | "themeModal.resetButton." | "updateGroup.title" | "updateGroup.groupNamePlaceholder" | "updateGroup.membersSection" | "updateGroup.title." | "updateGroup.groupNamePlaceholder." | "updateGroup.membersSection." | "updateGroup.groupNameLabel" | "updateGroup.avatarUrlLabel" | "updateGroup.avatarUrlPlaceholder" | "updateGroup.uploadAvatarButton" | "updateGroup.removeMemberButtonTitle" | "updateGroup.removeConfirmationStart" | "updateGroup.removeConfirmationEnd" | "updateGroup.cancelButton" | "updateGroup.updateButton" | "updateGroup.updatingButton" | "updateGroup.groupNameLabel." | "updateGroup.avatarUrlLabel." | "updateGroup.avatarUrlPlaceholder." | "updateGroup.uploadAvatarButton." | "updateGroup.removeMemberButtonTitle." | "updateGroup.removeConfirmationStart." | "updateGroup.removeConfirmationEnd." | "updateGroup.cancelButton." | "updateGroup.updateButton." | "updateGroup.updatingButton.", params?: Record<string, string>) => string;
|
|
2
|
+
t: (path: "addChat" | "common" | "chatWindow" | "chatHeader" | "chatInput" | "chatMessage" | "chatList" | "chatSearchBar" | "addMember" | "fileViewer" | "themeModal" | "updateGroup" | "addChat.title" | "addChat.groupNamePlaceholder" | "addChat.memberSearchPlaceholder" | "addChat.membersSection" | "addChat.createGroup" | "addChat.selectMoreMembers" | "addChat.selectMembers" | "addChat.title." | "addChat.groupNamePlaceholder." | "addChat.memberSearchPlaceholder." | "addChat.membersSection." | "addChat.createGroup." | "addChat.selectMoreMembers." | "addChat.selectMembers." | "common.buttons" | "common.errors" | "common.buttons.save" | "common.buttons.cancel" | "common.buttons.confirm" | "common.buttons.close" | "common.buttons.save." | "common.buttons.cancel." | "common.buttons.confirm." | "common.buttons.close." | "common.errors.updateGroup" | "common.errors.createChat" | "common.errors.updateGroup." | "common.errors.createChat." | "chatWindow.memberSystem" | "chatWindow.dragFile" | "chatWindow.selectChat" | "chatWindow.startConversation" | "chatWindow.searchPlaceholder" | "chatWindow.filterAll" | "chatWindow.filterGroup" | "chatWindow.filterSingle" | "chatWindow.memberSystem." | "chatWindow.dragFile." | "chatWindow.selectChat." | "chatWindow.startConversation." | "chatWindow.searchPlaceholder." | "chatWindow.filterAll." | "chatWindow.filterGroup." | "chatWindow.filterSingle." | "chatHeader.addMember" | "chatHeader.close" | "chatHeader.close." | "chatHeader.defaultTitle" | "chatHeader.darkMode" | "chatHeader.lightMode" | "chatHeader.settings" | "chatHeader.minimize" | "chatHeader.maximize" | "chatHeader.language" | "chatHeader.addMember." | "chatHeader.defaultTitle." | "chatHeader.darkMode." | "chatHeader.lightMode." | "chatHeader.settings." | "chatHeader.minimize." | "chatHeader.maximize." | "chatHeader.language." | "chatInput.placeholder" | "chatInput.selectFiles" | "chatInput.recordVoice" | "chatInput.selectFilesOrOptions" | "chatInput.removeFile" | "chatInput.recording" | "chatInput.cancelRecording" | "chatInput.stopRecording" | "chatInput.playRecording" | "chatInput.discardRecording" | "chatInput.addToMessage" | "chatInput.voiceMessage" | "chatInput.replyingTo" | "chatInput.attachmentIndicator" | "chatInput.placeholder." | "chatInput.selectFiles." | "chatInput.recordVoice." | "chatInput.selectFilesOrOptions." | "chatInput.removeFile." | "chatInput.recording." | "chatInput.cancelRecording." | "chatInput.stopRecording." | "chatInput.playRecording." | "chatInput.discardRecording." | "chatInput.addToMessage." | "chatInput.voiceMessage." | "chatInput.replyingTo." | "chatInput.attachmentIndicator." | "chatMessage.status" | "chatMessage.actions" | "chatMessage.states" | "chatMessage.status.seen" | "chatMessage.status.sent" | "chatMessage.status.seen." | "chatMessage.status.sent." | "chatMessage.actions.reply" | "chatMessage.actions.like" | "chatMessage.actions.love" | "chatMessage.actions.revoke" | "chatMessage.actions.delete" | "chatMessage.actions.seeMore" | "chatMessage.actions.seeLess" | "chatMessage.actions.reply." | "chatMessage.actions.like." | "chatMessage.actions.love." | "chatMessage.actions.revoke." | "chatMessage.actions.delete." | "chatMessage.actions.seeMore." | "chatMessage.actions.seeLess." | "chatMessage.states.revoked" | "chatMessage.states.attachment" | "chatMessage.states.revoked." | "chatMessage.states.attachment." | "chatList.delete" | "chatList.addMember" | "chatList.addMember." | "chatList.delete." | "chatList.options" | "chatList.editGroup" | "chatList.deleteGroup" | "chatList.yourMessage" | "chatList.options." | "chatList.editGroup." | "chatList.deleteGroup." | "chatList.yourMessage." | "chatSearchBar.createGroup" | "chatSearchBar.createGroup." | "chatSearchBar.searchPlaceholder" | "chatSearchBar.searchPlaceholder." | "addMember.title" | "addMember.memberSearchPlaceholder" | "addMember.membersSection" | "addMember.title." | "addMember.memberSearchPlaceholder." | "addMember.membersSection." | "addMember.noMembersFound" | "addMember.addButton" | "addMember.noMembersFound." | "addMember.addButton." | "fileViewer.closeButtonTitle" | "fileViewer.previousButtonTitle" | "fileViewer.nextButtonTitle" | "fileViewer.scrollLeftTitle" | "fileViewer.scrollRightTitle" | "fileViewer.openDownloadButton" | "fileViewer.closeAriaLabel" | "fileViewer.previousAriaLabel" | "fileViewer.nextAriaLabel" | "fileViewer.scrollLeftAriaLabel" | "fileViewer.scrollRightAriaLabel" | "fileViewer.closeButtonTitle." | "fileViewer.previousButtonTitle." | "fileViewer.nextButtonTitle." | "fileViewer.scrollLeftTitle." | "fileViewer.scrollRightTitle." | "fileViewer.openDownloadButton." | "fileViewer.closeAriaLabel." | "fileViewer.previousAriaLabel." | "fileViewer.nextAriaLabel." | "fileViewer.scrollLeftAriaLabel." | "fileViewer.scrollRightAriaLabel." | "themeModal.title" | "themeModal.title." | "themeModal.themeSectionTitle" | "themeModal.themeSectionDesc" | "themeModal.customColorTitle" | "themeModal.doneButton" | "themeModal.resetButton" | "themeModal.themeSectionTitle." | "themeModal.themeSectionDesc." | "themeModal.customColorTitle." | "themeModal.doneButton." | "themeModal.resetButton." | "updateGroup.title" | "updateGroup.groupNamePlaceholder" | "updateGroup.membersSection" | "updateGroup.title." | "updateGroup.groupNamePlaceholder." | "updateGroup.membersSection." | "updateGroup.groupNameLabel" | "updateGroup.avatarUrlLabel" | "updateGroup.avatarUrlPlaceholder" | "updateGroup.uploadAvatarButton" | "updateGroup.removeMemberButtonTitle" | "updateGroup.removeConfirmationStart" | "updateGroup.removeConfirmationEnd" | "updateGroup.cancelButton" | "updateGroup.updateButton" | "updateGroup.updatingButton" | "updateGroup.groupNameLabel." | "updateGroup.avatarUrlLabel." | "updateGroup.avatarUrlPlaceholder." | "updateGroup.uploadAvatarButton." | "updateGroup.removeMemberButtonTitle." | "updateGroup.removeConfirmationStart." | "updateGroup.removeConfirmationEnd." | "updateGroup.cancelButton." | "updateGroup.updateButton." | "updateGroup.updatingButton.", params?: Record<string, string>) => string;
|
|
3
|
+
toggleChangeLanguage: () => void;
|
|
3
4
|
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { AuthInfo } from '
|
|
2
|
-
import { ChatEventPayloads, ChatResponse, ChatConversation, ChatMessage, ChatConfig, PaginationInfo, MessageAction, ChatUser, ChatSetting } from '../types/chat.type';
|
|
1
|
+
import { AuthInfo, ChatEventPayloads, ChatResponse, ChatConversation, ChatMessage, ChatConfig, PaginationInfo, MessageAction, ChatUser, ChatSetting } from '../../types';
|
|
3
2
|
declare class ChatService {
|
|
4
3
|
private static instance;
|
|
5
4
|
private chatSDK;
|
|
6
5
|
constructor();
|
|
7
6
|
static getInstance(): ChatService;
|
|
8
|
-
init(chatKey: string): Promise<void>;
|
|
7
|
+
init(chatKey: string, workspace: string): Promise<void>;
|
|
9
8
|
private setupSDK;
|
|
10
9
|
get setting(): ChatSetting;
|
|
11
10
|
setAuth(data: AuthInfo): Promise<ChatUser>;
|
|
@@ -22,7 +21,7 @@ declare class ChatService {
|
|
|
22
21
|
}>;
|
|
23
22
|
findChatByReceiver(receiverId: number): Promise<ChatResponse<ChatConversation>>;
|
|
24
23
|
addChat(receiverId: number, content?: string): Promise<ChatResponse<ChatConversation>>;
|
|
25
|
-
addGroup(memberIds: number[], name: string, avatar?: string, userId?: number): Promise<ChatResponse<ChatConversation>>;
|
|
24
|
+
addGroup(memberIds: number[], name: string, avatar?: string | File, userId?: number): Promise<ChatResponse<ChatConversation>>;
|
|
26
25
|
updateGroup(chatId: number, name: string, avatar?: string | File): Promise<ChatResponse<ChatConversation>>;
|
|
27
26
|
removeChat(chatId: number): Promise<ChatResponse>;
|
|
28
27
|
readChat(chatId: number): Promise<ChatResponse>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { LanguageOption } from '
|
|
1
|
+
import { en } from '../../locales';
|
|
2
|
+
import { LanguageOption } from '../../types';
|
|
3
3
|
export type TranslationSchema = typeof en;
|
|
4
4
|
type NestedKeys<T> = T extends object ? {
|
|
5
5
|
[K in keyof T]: `${Exclude<K, symbol>}${'' | `.${NestedKeys<T[K]>}`}`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './setting';
|