@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.
Files changed (69) hide show
  1. package/README.md +34 -39
  2. package/dist/chatbot-widget.es.js +4356 -4374
  3. package/dist/chatbot-widget.umd.js +16 -15
  4. package/dist/locales/en.json.d.ts +2 -1
  5. package/dist/locales/vi.json.d.ts +7 -5
  6. package/dist/src/assets/Icons.d.ts +2 -0
  7. package/dist/src/assets/createIcon.d.ts +2 -2
  8. package/dist/src/components/ChatWidget.d.ts +3 -3
  9. package/dist/src/components/ChatWindow.d.ts +3 -3
  10. package/dist/src/components/FloatingButton.d.ts +3 -3
  11. package/dist/src/components/index.d.ts +4 -0
  12. package/dist/src/components/modals/AddChat.d.ts +3 -3
  13. package/dist/src/components/modals/AddGroup.d.ts +6 -0
  14. package/dist/src/components/modals/AddMember.d.ts +3 -3
  15. package/dist/src/components/modals/FileViewer.d.ts +3 -3
  16. package/dist/src/components/modals/ThemeModal.d.ts +2 -2
  17. package/dist/src/components/modals/UpdateGroup.d.ts +3 -3
  18. package/dist/src/components/modals/UserProfileModal.d.ts +3 -3
  19. package/dist/src/components/modals/index.d.ts +2 -1
  20. package/dist/src/components/shared/ChatAvatar.d.ts +1 -1
  21. package/dist/src/components/shared/MemberAvatarFallBack.d.ts +5 -0
  22. package/dist/src/components/shared/ToastContainer.d.ts +2 -3
  23. package/dist/src/components/shared/index.d.ts +3 -0
  24. package/dist/src/components/sidebar/AppSideBar.d.ts +2 -3
  25. package/dist/src/components/sidebar/ChatInfoPanel.d.ts +11 -0
  26. package/dist/src/components/sidebar/ChatList.d.ts +4 -4
  27. package/dist/src/components/sidebar/ChatSearchBar.d.ts +2 -2
  28. package/dist/src/components/sidebar/SideBarInfoChat.d.ts +4 -4
  29. package/dist/src/components/sidebar/index.d.ts +1 -0
  30. package/dist/src/components/view/ChatHeader.d.ts +3 -3
  31. package/dist/src/components/view/ChatInput.d.ts +1 -2
  32. package/dist/src/components/view/ContactList.d.ts +3 -3
  33. package/dist/src/components/view/GroupList.d.ts +3 -3
  34. package/dist/src/components/view/MessageFiles.d.ts +3 -3
  35. package/dist/src/components/view/MessageItem.d.ts +3 -3
  36. package/dist/src/components/view/MessageList.d.ts +2 -2
  37. package/dist/src/components/view/index.d.ts +3 -2
  38. package/dist/src/constants/common.d.ts +1 -0
  39. package/dist/src/constants/file.d.ts +2 -0
  40. package/dist/src/constants/index.d.ts +2 -0
  41. package/dist/src/contexts/FileViewerContext.d.ts +5 -5
  42. package/dist/src/contexts/ToastContext.d.ts +3 -3
  43. package/dist/src/contexts/index.d.ts +2 -1
  44. package/dist/src/hooks/index.d.ts +3 -0
  45. package/dist/src/hooks/useChat.d.ts +2 -2
  46. package/dist/src/hooks/useDragDropFiles.d.ts +5 -4
  47. package/dist/src/hooks/useFileViewer.d.ts +1 -1
  48. package/dist/src/hooks/useSetting.d.ts +1 -1
  49. package/dist/src/hooks/useToast.d.ts +1 -1
  50. package/dist/src/hooks/useTranslation.d.ts +2 -1
  51. package/dist/src/locales/index.d.ts +3 -0
  52. package/dist/src/services/chat.service.d.ts +3 -4
  53. package/dist/src/services/index.d.ts +2 -0
  54. package/dist/src/services/language.service.d.ts +2 -2
  55. package/dist/src/store/index.d.ts +2 -0
  56. package/dist/src/store/selectors/index.d.ts +1 -0
  57. package/dist/src/store/selectors/setting.d.ts +5 -5
  58. package/dist/src/store/slices/chatSlice.d.ts +3 -4
  59. package/dist/src/store/slices/index.d.ts +2 -0
  60. package/dist/src/store/slices/settingSlice.d.ts +2 -3
  61. package/dist/src/store/store.d.ts +2 -2
  62. package/dist/src/styles/index.d.ts +1 -0
  63. package/dist/src/types/chat.type.d.ts +2 -2
  64. package/dist/src/types/types.d.ts +2 -6
  65. package/dist/src/utils/chat.utils.d.ts +1 -2
  66. package/dist/src/utils/file.utils.d.ts +16 -0
  67. package/dist/src/utils/format.utils.d.ts +2 -0
  68. package/dist/src/utils/index.d.ts +4 -0
  69. package/package.json +2 -2
@@ -29,7 +29,8 @@ declare const _default: {
29
29
  "settings": "UI Settings",
30
30
  "minimize": "Minimize",
31
31
  "maximize": "Maximize",
32
- "close": "Close"
32
+ "close": "Close",
33
+ "language": "Change Language"
33
34
  },
34
35
  "chatInput": {
35
36
  "placeholder": "Enter message...",
@@ -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 cuộc trò chuyện",
83
- "groupNamePlaceholder": "Nhập tên nhóm...",
84
- "memberSearchPlaceholder": "Tìm tên thành viên...",
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": "Chọn thành viên"
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 React.SVGProps<SVGSVGElement> {
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 { default as React } from 'react';
2
- import { ChatWidgetProps } from '../types';
3
- export declare const ChatWidget: React.FC<ChatWidgetProps>;
1
+ import { FC } from 'react';
2
+ import { ChatWidgetProps } from '../../types';
3
+ export declare const ChatWidget: FC<ChatWidgetProps>;
@@ -1,5 +1,5 @@
1
- import { default as React } from 'react';
2
- import { ChatWidgetProps, WidgetMode } from '../types';
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: React.FC<ChatWindowProps>;
31
+ export declare const ChatWindow: FC<ChatWindowProps>;
32
32
  export {};
@@ -1,5 +1,5 @@
1
- import { default as React } from 'react';
2
- import { WidgetMode } from '../types';
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: React.FC<FloatingButtonProps>;
16
+ export declare const FloatingButton: FC<FloatingButtonProps>;
17
17
  export {};
@@ -1,3 +1,7 @@
1
1
  export { ChatWidget } from './ChatWidget';
2
2
  export { FloatingButton } from './FloatingButton';
3
3
  export { ChatWindow } from './ChatWindow';
4
+ export * from './modals';
5
+ export * from './shared';
6
+ export * from './sidebar';
7
+ export * from './view';
@@ -1,5 +1,5 @@
1
- import { default as React } from 'react';
2
- import { ChatUser } from '../../types';
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: React.FC<AddChatProps>;
15
+ export declare const AddChat: FC<AddChatProps>;
16
16
  export {};
@@ -0,0 +1,6 @@
1
+ import { FC } from 'react';
2
+ interface AddGroupProps {
3
+ onClose: () => void;
4
+ }
5
+ export declare const AddGroup: FC<AddGroupProps>;
6
+ export {};
@@ -1,5 +1,5 @@
1
- import { default as React } from 'react';
2
- import { ChatUser, ChatConversation } from '../../types';
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: React.FC<AddMemberProps>;
12
+ export declare const AddMember: FC<AddMemberProps>;
13
13
  export {};
@@ -1,10 +1,10 @@
1
- import { default as React } from 'react';
2
- import { ChatFile } from '../../types';
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: React.FC<FileViewerProps>;
9
+ export declare const FileViewer: FC<FileViewerProps>;
10
10
  export {};
@@ -1,8 +1,8 @@
1
- import { default as React } from 'react';
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: React.FC<ThemeModalProps>;
7
+ export declare const ThemeModal: FC<ThemeModalProps>;
8
8
  export {};
@@ -1,5 +1,5 @@
1
- import { default as React } from 'react';
2
- import { ChatConversation } from '../../types';
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: React.FC<UpdateGroupProps>;
11
+ export declare const UpdateGroup: FC<UpdateGroupProps>;
12
12
  export {};
@@ -1,10 +1,10 @@
1
- import { default as React } from 'react';
2
- import { ChatUser } from '../../types';
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: React.FC<UserProfileModalProps>;
9
+ export declare const UserProfileModal: FC<UserProfileModalProps>;
10
10
  export {};
@@ -2,4 +2,5 @@ export * from './UpdateGroup';
2
2
  export * from './AddMember';
3
3
  export * from './FileViewer';
4
4
  export * from './ThemeModal';
5
- export * from './AddChat';
5
+ export * from './AddGroup';
6
+ export * from './UserProfileModal';
@@ -1,4 +1,4 @@
1
- import { ChatConversation } from '../../types';
1
+ import { ChatConversation } from '../../../types';
2
2
  export declare const ChatAvatar: import('react').MemoExoticComponent<({ chat, currentUserId, }: {
3
3
  chat?: ChatConversation | null;
4
4
  currentUserId?: number;
@@ -0,0 +1,5 @@
1
+ import { ChatUser } from '../../../types';
2
+ import { FC } from 'react';
3
+ export declare const MemberAvatarFallback: FC<{
4
+ member: ChatUser;
5
+ }>;
@@ -1,3 +1,2 @@
1
- import { default as React } from 'react';
2
- declare const ToastContainer: React.FC;
3
- export default ToastContainer;
1
+ import { FC } from 'react';
2
+ export declare const ToastContainer: FC;
@@ -0,0 +1,3 @@
1
+ export * from './ChatAvatar';
2
+ export * from './ToastContainer';
3
+ export * from './MemberAvatarFallBack';
@@ -1,8 +1,7 @@
1
- import { ChatUser } from '../../types';
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 { default as React } from 'react';
2
- import { ChatConversation } from '../../types';
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: React.MouseEvent) => void;
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: React.FC<ChatListProps>;
11
+ export declare const ChatList: FC<ChatListProps>;
12
12
  export {};
@@ -1,4 +1,4 @@
1
- import { default as React } from 'react';
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: React.FC<ChatSearchBarProps>;
9
+ export declare const ChatSearchBar: FC<ChatSearchBarProps>;
10
10
  export {};
@@ -1,5 +1,5 @@
1
- import { default as React } from 'react';
2
- import { ChatConversation, ChatUser } from '../../types';
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: React.FC<SideBarInfoChatProps>;
11
- export default SideBarInfoChat;
10
+ declare const SideBarInfoChat: FC<SideBarInfoChatProps>;
11
+ export { SideBarInfoChat };
@@ -1,3 +1,4 @@
1
1
  export * from './ChatList';
2
2
  export * from './ChatSearchBar';
3
3
  export * from './AppSideBar';
4
+ export * from './ChatInfoPanel';
@@ -1,5 +1,5 @@
1
- import { default as React } from 'react';
2
- import { WidgetMode } from '../../types';
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: React.FC<ChatHeaderProps>;
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: React.ForwardRefExoticComponent<ChatInputProps & React.RefAttributes<ChatInputHandle>>;
7
+ export declare const ChatInput: import('react').ForwardRefExoticComponent<ChatInputProps & import('react').RefAttributes<ChatInputHandle>>;
9
8
  export {};
@@ -1,8 +1,8 @@
1
- import { default as React } from 'react';
2
- import { ChatUser } from '../../types';
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: React.FC<ContactListProps>;
7
+ export declare const ContactList: FC<ContactListProps>;
8
8
  export {};
@@ -1,9 +1,9 @@
1
- import { default as React } from 'react';
2
- import { ChatConversation } from '../../types';
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: React.FC<GroupListProps>;
8
+ export declare const GroupList: FC<GroupListProps>;
9
9
  export {};
@@ -1,7 +1,7 @@
1
- import { default as React } from 'react';
2
- import { ChatFile } from '../../types';
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: React.FC<MessageFilesProps>;
6
+ export declare const MessageFiles: FC<MessageFilesProps>;
7
7
  export {};
@@ -1,7 +1,7 @@
1
- import { default as React } from 'react';
2
- import { ChatMessage } from '../../types';
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: React.FC<MessageItemProps>;
6
+ export declare const MessageItem: FC<MessageItemProps>;
7
7
  export {};
@@ -1,2 +1,2 @@
1
- import { default as React } from 'react';
2
- export declare const MessageList: React.FC<object>;
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[];
@@ -0,0 +1,2 @@
1
+ export declare const MAX_FILE_SIZE: number;
2
+ export declare const MAX_FILES_COUNT = 20;
@@ -0,0 +1,2 @@
1
+ export * from './file';
2
+ export * from './common';
@@ -1,5 +1,5 @@
1
- import { default as React } from 'react';
2
- import { ChatFile } from '../types';
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: React.Context<FileViewerContextType | undefined>;
10
+ declare const FileViewerContext: import('react').Context<FileViewerContextType | undefined>;
11
11
  export { FileViewerContext };
12
- export declare const FileViewerProvider: React.FC<{
13
- children: React.ReactNode;
12
+ export declare const FileViewerProvider: FC<{
13
+ children: ReactNode;
14
14
  }>;
@@ -1,4 +1,4 @@
1
- import { default as React } from 'react';
2
- export declare const ToastProvider: React.FC<{
3
- children: React.ReactNode;
1
+ import { FC, ReactNode } from 'react';
2
+ export declare const ToastProvider: FC<{
3
+ children: ReactNode;
4
4
  }>;
@@ -1,2 +1,3 @@
1
1
  export * from './FileViewerContext';
2
- export * from '../hooks/useFileViewer';
2
+ export * from './ToastContext';
3
+ export * from './toast-context';
@@ -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 '../types';
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: React.DragEvent<HTMLDivElement>) => void;
7
- handleDragOver: (e: React.DragEvent<HTMLDivElement>) => void;
8
- handleDragLeave: (e: React.DragEvent<HTMLDivElement>) => void;
9
- handleDrop: (e: React.DragEvent<HTMLDivElement>) => void;
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 '../contexts/FileViewerContext';
1
+ import { FileViewerContextType } from '../../contexts';
2
2
  export declare const useFileViewer: () => FileViewerContextType;
@@ -1,2 +1,2 @@
1
- import { WidgetFeature } from '../types';
1
+ import { WidgetFeature } from '../../types';
2
2
  export declare const useSetting: (config?: WidgetFeature) => void;
@@ -1 +1 @@
1
- export declare const useToast: () => import('../contexts/toast-context').ToastContextType;
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
  };
@@ -0,0 +1,3 @@
1
+ import { default as en } from './en.json';
2
+ import { default as vi } from './vi.json';
3
+ export { en, vi };
@@ -1,11 +1,10 @@
1
- import { AuthInfo } from '../types';
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>;
@@ -0,0 +1,2 @@
1
+ export * from './chat.service';
2
+ export * from './language.service';
@@ -1,5 +1,5 @@
1
- import { default as en } from '../locales/en.json';
2
- import { LanguageOption } from '../types';
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]>}`}`;
@@ -1 +1,3 @@
1
1
  export * from './store';
2
+ export * from './slices';
3
+ export * from './selectors';
@@ -0,0 +1 @@
1
+ export * from './setting';