@ethora/chat-component 24.10.11 → 24.10.16
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 +4 -4
- package/dist/assets/icons.d.ts +12 -0
- package/dist/components/InputComponents/AudioRecorder.d.ts +1 -1
- package/dist/components/InputComponents/Search.d.ts +9 -0
- package/dist/components/MainComponents/ChatHeaderAvatar.d.ts +9 -0
- package/dist/components/MainComponents/ChatRoom.d.ts +1 -1
- package/dist/components/MainComponents/MessageList.d.ts +3 -3
- package/dist/components/MainComponents/NoMessagesPlaceholder.d.ts +2 -0
- package/dist/components/MainComponents/RoomList.d.ts +1 -0
- package/dist/components/MainComponents/SystemMessage.d.ts +8 -0
- package/dist/components/MessageBubble/Avatar.d.ts +9 -0
- package/dist/components/styled/SendInput.d.ts +1 -1
- package/dist/main.js +5567 -5248
- package/dist/main.js.map +1 -1
- package/dist/networking/apiClient.d.ts +1 -0
- package/dist/networking/xmppClient.d.ts +0 -1
- package/dist/roomStore/roomsSlice.d.ts +16 -8
- package/dist/types/types.d.ts +5 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,9 +21,9 @@ Note: scroll below for use cases and functionality break down of this Chat Compo
|
|
|
21
21
|
2. specify a name for your project (e.g. "vite-project")
|
|
22
22
|
3. select framework and variant (for example, React -> Typescript but may be different depending on your project requirements, it will work with plain Javascript too)
|
|
23
23
|
|
|
24
|
-
<img src="
|
|
24
|
+
<img src="./img/readme01.png" width="500" />
|
|
25
25
|
|
|
26
|
-
<img src="
|
|
26
|
+
<img src="./img/readme02.png" width="500" />
|
|
27
27
|
|
|
28
28
|
4. cd vite-project _(use your name instead of "vite-project")_
|
|
29
29
|
5. npm i
|
|
@@ -49,14 +49,14 @@ npm run dev
|
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
you should see something like this:
|
|
52
|
-
<br /><img src="
|
|
52
|
+
<br /><img src="./img/readme03.png" width="350" />
|
|
53
53
|
|
|
54
54
|
|
|
55
55
|
8. Open http://localhost:5173/ in your browser
|
|
56
56
|
|
|
57
57
|
Voilà - your chat app should work like so:
|
|
58
58
|
|
|
59
|
-
<img src="
|
|
59
|
+
<img src="./img/readme04.png" width="600" />
|
|
60
60
|
|
|
61
61
|
ℹ️ Note: your Ethora App, User and Chat credentials are hard-coded and login screen is bypassed. This is done so that you can scaffold and test the functionality quickly.
|
|
62
62
|
Leave this as is if you only need to demo or validate the chat functionality as part of your project.
|
package/dist/assets/icons.d.ts
CHANGED
|
@@ -11,3 +11,15 @@ export declare const SendIcon: ({ color, ...props }: {
|
|
|
11
11
|
export declare const GoogleIcon: ({ ...props }: {
|
|
12
12
|
[x: string]: any;
|
|
13
13
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const MoreIcon: ({ color, ...props }: {
|
|
15
|
+
[x: string]: any;
|
|
16
|
+
color?: string;
|
|
17
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const SearchIcon: ({ color, ...props }: {
|
|
19
|
+
[x: string]: any;
|
|
20
|
+
color?: string;
|
|
21
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare const NoMessages: ({ color, ...props }: {
|
|
23
|
+
[x: string]: any;
|
|
24
|
+
color?: string;
|
|
25
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,7 +3,7 @@ import { default as React } from 'react';
|
|
|
3
3
|
interface AudioRecorderProps {
|
|
4
4
|
setIsRecording: (state: boolean) => void;
|
|
5
5
|
isRecording: boolean;
|
|
6
|
-
handleSendClick: (audioBlob?:
|
|
6
|
+
handleSendClick: (audioBlob?: any) => void;
|
|
7
7
|
}
|
|
8
8
|
declare const AudioRecorder: React.FC<AudioRecorderProps>;
|
|
9
9
|
export default AudioRecorder;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
interface SearchInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
4
|
+
icon?: React.ReactNode;
|
|
5
|
+
animated?: boolean;
|
|
6
|
+
direction?: "left" | "right";
|
|
7
|
+
}
|
|
8
|
+
declare const SearchInput: React.FC<SearchInputProps>;
|
|
9
|
+
export { SearchInput };
|
|
@@ -2,15 +2,15 @@ import { default as React } from 'react';
|
|
|
2
2
|
import { IConfig, IMessage, IRoom, User } from '../../types/types';
|
|
3
3
|
|
|
4
4
|
interface MessageListProps<TMessage extends IMessage> {
|
|
5
|
-
messages: TMessage[];
|
|
6
5
|
CustomMessage?: React.ComponentType<{
|
|
7
|
-
message:
|
|
6
|
+
message: IMessage;
|
|
8
7
|
isUser: boolean;
|
|
9
8
|
}>;
|
|
10
9
|
user: User;
|
|
11
10
|
room: IRoom;
|
|
12
11
|
loadMoreMessages: (chatJID: string, max: number, amount?: number) => Promise<void>;
|
|
12
|
+
loading: boolean;
|
|
13
13
|
config?: IConfig;
|
|
14
14
|
}
|
|
15
|
-
declare const MessageList: <TMessage extends IMessage>({
|
|
15
|
+
declare const MessageList: <TMessage extends IMessage>({ CustomMessage, user, loadMoreMessages, room, config, loading, }: MessageListProps<TMessage>) => import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
export default MessageList;
|
|
@@ -2,6 +2,14 @@ import { default as React } from 'react';
|
|
|
2
2
|
|
|
3
3
|
interface SystemMessageProps {
|
|
4
4
|
messageText: string;
|
|
5
|
+
colors?: {
|
|
6
|
+
primary?: string;
|
|
7
|
+
secondary?: string;
|
|
8
|
+
};
|
|
5
9
|
}
|
|
10
|
+
export declare const CustomSystemMessageText: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
11
|
+
primary?: string;
|
|
12
|
+
secondary?: string;
|
|
13
|
+
}>> & string;
|
|
6
14
|
declare const SystemMessage: React.FC<SystemMessageProps>;
|
|
7
15
|
export default SystemMessage;
|
|
@@ -4,7 +4,7 @@ import { IConfig } from '../../types/types';
|
|
|
4
4
|
interface SendInputProps {
|
|
5
5
|
sendMessage: (message: string) => void;
|
|
6
6
|
isLoading: boolean;
|
|
7
|
-
sendMedia: (data: any) => void;
|
|
7
|
+
sendMedia: (data: any, type: string) => void;
|
|
8
8
|
config?: IConfig;
|
|
9
9
|
onFocus?: () => void;
|
|
10
10
|
onBlur?: () => void;
|