@ethora/chat-component 25.10.6 → 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.
@@ -1,6 +1,7 @@
1
1
  import { default as React } from 'react';
2
+ import { MessageProps } from '../../types/types';
2
3
  interface ChatRoomProps {
3
- CustomMessageComponent?: any;
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, MessageProps } from '../../types/types';
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
  }
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ declare const ConnectionBanner: React.FC;
3
+ export default ConnectionBanner;
@@ -1,12 +1,12 @@
1
1
  import { default as React } from 'react';
2
- import { IConfig, MessageProps } from '../../types/types';
3
- interface LoginWrapperProps {
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, MessageProps } from '../../types/types';
3
- interface ChatWrapperProps {
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;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { DaySeparatorProps } from '../../types/models/customComponents.model';
3
+ declare const CustomDaySeparator: React.FC<DaySeparatorProps>;
4
+ export default CustomDaySeparator;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { MessageProps } from '../../types/types';
3
+ declare const CustomMessageBubble: React.FC<MessageProps>;
4
+ export default CustomMessageBubble;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { CustomScrollableAreaProps } from '../../types/models/customComponents.model';
3
+ declare const CustomScrollableArea: React.FC<CustomScrollableAreaProps>;
4
+ export default CustomScrollableArea;
@@ -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;