@ethora/chat-component 25.10.5 → 25.11.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/dist/components/MainComponents/ChatRoom.d.ts +2 -1
- package/dist/components/MainComponents/ChatWrapper.d.ts +1 -2
- package/dist/components/MainComponents/ConnectionBanner.d.ts +3 -0
- package/dist/components/MainComponents/LoginWrapper.d.ts +3 -3
- package/dist/components/MainComponents/ReduxWrapper.d.ts +3 -3
- package/dist/components/styled/SendInput.d.ts +5 -2
- package/dist/context/CustomComponentsContext.d.ts +8 -0
- package/dist/examples/customComponents/CustomChatInput.d.ts +9 -0
- package/dist/examples/customComponents/CustomDaySeparator.d.ts +4 -0
- package/dist/examples/customComponents/CustomMessageBubble.d.ts +4 -0
- package/dist/examples/customComponents/CustomScrollableArea.d.ts +4 -0
- package/dist/hooks/useChatWrapperInit.d.ts +1 -0
- package/dist/main.js +9574 -9462
- package/dist/main.js.map +1 -1
- package/dist/types/models/customComponents.model.d.ts +41 -0
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { MessageProps } from '../../types/types';
|
|
2
3
|
interface ChatRoomProps {
|
|
3
|
-
CustomMessageComponent?:
|
|
4
|
+
CustomMessageComponent?: React.ComponentType<MessageProps>;
|
|
4
5
|
handleBackClick?: (value: boolean) => void;
|
|
5
6
|
}
|
|
6
7
|
declare const ChatRoom: React.FC<ChatRoomProps>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React, FC } from 'react';
|
|
2
|
-
import { IConfig, IRoom
|
|
2
|
+
import { IConfig, IRoom } from '../../types/types';
|
|
3
3
|
interface ChatWrapperProps {
|
|
4
4
|
token?: string;
|
|
5
5
|
room?: IRoom;
|
|
@@ -8,7 +8,6 @@ interface ChatWrapperProps {
|
|
|
8
8
|
password: string;
|
|
9
9
|
};
|
|
10
10
|
MainComponentStyles?: React.CSSProperties;
|
|
11
|
-
CustomMessageComponent?: React.ComponentType<MessageProps>;
|
|
12
11
|
config?: IConfig;
|
|
13
12
|
roomJID?: string;
|
|
14
13
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { IConfig
|
|
3
|
-
|
|
2
|
+
import { IConfig } from '../../types/types';
|
|
3
|
+
import { CustomComponentsContextValue } from '../../types/models/customComponents.model';
|
|
4
|
+
interface LoginWrapperProps extends Partial<Pick<CustomComponentsContextValue, 'CustomMessageComponent' | 'CustomInputComponent' | 'CustomScrollableArea' | 'CustomDaySeparator'>> {
|
|
4
5
|
user?: {
|
|
5
6
|
email: string;
|
|
6
7
|
password: string;
|
|
7
8
|
};
|
|
8
9
|
MainComponentStyles?: React.CSSProperties;
|
|
9
|
-
CustomMessageComponent?: React.ComponentType<MessageProps>;
|
|
10
10
|
config?: IConfig;
|
|
11
11
|
roomJID?: string;
|
|
12
12
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { ConfigUser, IConfig
|
|
3
|
-
|
|
2
|
+
import { ConfigUser, IConfig } from '../../types/types';
|
|
3
|
+
import { CustomComponentsContextValue } from '../../types/models/customComponents.model';
|
|
4
|
+
interface ChatWrapperProps extends Pick<CustomComponentsContextValue, 'CustomMessageComponent' | 'CustomInputComponent' | 'CustomScrollableArea' | 'CustomDaySeparator'> {
|
|
4
5
|
token?: string;
|
|
5
6
|
roomJID?: string;
|
|
6
7
|
user?: ConfigUser;
|
|
@@ -9,7 +10,6 @@ interface ChatWrapperProps {
|
|
|
9
10
|
password: string;
|
|
10
11
|
};
|
|
11
12
|
MainComponentStyles?: React.CSSProperties;
|
|
12
|
-
CustomMessageComponent?: React.ComponentType<MessageProps>;
|
|
13
13
|
config?: IConfig;
|
|
14
14
|
}
|
|
15
15
|
export declare const ReduxWrapper: React.FC<ChatWrapperProps>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { IConfig } from '../../types/types';
|
|
3
|
-
interface SendInputProps {
|
|
3
|
+
export interface SendInputProps {
|
|
4
4
|
sendMessage: (message: string) => void;
|
|
5
|
+
sendMedia: (data: any, type: string) => void;
|
|
5
6
|
isLoading: boolean;
|
|
6
7
|
editMessage?: string;
|
|
7
|
-
sendMedia: (data: any, type: string) => void;
|
|
8
8
|
config?: IConfig;
|
|
9
9
|
onFocus?: () => void;
|
|
10
10
|
onBlur?: () => void;
|
|
@@ -14,6 +14,9 @@ interface SendInputProps {
|
|
|
14
14
|
inputHeight?: number;
|
|
15
15
|
showPreview?: boolean;
|
|
16
16
|
previewParser?: (text: string) => (string | JSX.Element)[];
|
|
17
|
+
onSendMessage?: (message: string) => void;
|
|
18
|
+
onSendMedia?: (data: any, type: string) => void;
|
|
19
|
+
placeholderText?: string;
|
|
17
20
|
}
|
|
18
21
|
declare const SendInput: React.FC<SendInputProps>;
|
|
19
22
|
export default SendInput;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CustomComponentsContextValue } from '../types/models/customComponents.model';
|
|
3
|
+
interface CustomComponentsProviderProps extends CustomComponentsContextValue {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const CustomComponentsProvider: React.FC<CustomComponentsProviderProps>;
|
|
7
|
+
export declare const useCustomComponents: () => CustomComponentsContextValue;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SendInputProps } from '../../components/styled/SendInput';
|
|
3
|
+
type CustomChatInputProps = SendInputProps & {
|
|
4
|
+
onSendMessage?: (message: string) => void;
|
|
5
|
+
onSendMedia?: (data: any, type: string) => void;
|
|
6
|
+
placeholderText?: string;
|
|
7
|
+
};
|
|
8
|
+
declare const CustomChatInput: React.FC<CustomChatInputProps>;
|
|
9
|
+
export default CustomChatInput;
|
|
@@ -13,6 +13,7 @@ interface useChatWrapperInitResult {
|
|
|
13
13
|
setShowModal: React.Dispatch<React.SetStateAction<boolean>>;
|
|
14
14
|
client: XmppClient | null;
|
|
15
15
|
setClient: React.Dispatch<React.SetStateAction<XmppClient | null>>;
|
|
16
|
+
isConnectionLost: boolean;
|
|
16
17
|
}
|
|
17
18
|
declare const useChatWrapperInit: ({ roomJID, wasAutoSelected, config, }: useChatWrapperInitProps) => useChatWrapperInitResult;
|
|
18
19
|
export default useChatWrapperInit;
|