@ethora/chat-component 25.7.5 → 25.7.7
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/ExampleComponents/CustomTypingIndicatorExamples.d.ts +43 -0
- package/dist/components/styled/SendInput.d.ts +1 -0
- package/dist/components/styled/StyledInputComponents/CustomTypingIndicator.d.ts +18 -0
- package/dist/context/xmppProvider.d.ts +1 -1
- package/dist/hooks/useCustomTypingIndicator.d.ts +62 -0
- package/dist/hooks/useEventHandlers.d.ts +24 -0
- package/dist/hooks/useSendMessage.d.ts +3 -2
- package/dist/main.js +8376 -8011
- package/dist/main.js.map +1 -1
- package/dist/types/models/config.model.d.ts +33 -0
- package/package.json +1 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export declare const AIProcessingIndicator: React.FC<{
|
|
3
|
+
usersTyping: string[];
|
|
4
|
+
text: string;
|
|
5
|
+
isVisible: boolean;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const MinimalTypingIndicator: React.FC<{
|
|
8
|
+
usersTyping: string[];
|
|
9
|
+
text: string;
|
|
10
|
+
isVisible: boolean;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const ChatBubbleTypingIndicator: React.FC<{
|
|
13
|
+
usersTyping: string[];
|
|
14
|
+
text: string;
|
|
15
|
+
isVisible: boolean;
|
|
16
|
+
}>;
|
|
17
|
+
export declare const ProgressTypingIndicator: React.FC<{
|
|
18
|
+
usersTyping: string[];
|
|
19
|
+
text: string;
|
|
20
|
+
isVisible: boolean;
|
|
21
|
+
}>;
|
|
22
|
+
export declare const CustomTypingIndicatorExamples: {
|
|
23
|
+
AIProcessingIndicator: React.FC<{
|
|
24
|
+
usersTyping: string[];
|
|
25
|
+
text: string;
|
|
26
|
+
isVisible: boolean;
|
|
27
|
+
}>;
|
|
28
|
+
MinimalTypingIndicator: React.FC<{
|
|
29
|
+
usersTyping: string[];
|
|
30
|
+
text: string;
|
|
31
|
+
isVisible: boolean;
|
|
32
|
+
}>;
|
|
33
|
+
ChatBubbleTypingIndicator: React.FC<{
|
|
34
|
+
usersTyping: string[];
|
|
35
|
+
text: string;
|
|
36
|
+
isVisible: boolean;
|
|
37
|
+
}>;
|
|
38
|
+
ProgressTypingIndicator: React.FC<{
|
|
39
|
+
usersTyping: string[];
|
|
40
|
+
text: string;
|
|
41
|
+
isVisible: boolean;
|
|
42
|
+
}>;
|
|
43
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React, FC } from 'react';
|
|
2
|
+
interface CustomTypingIndicatorProps {
|
|
3
|
+
usersTyping: string[];
|
|
4
|
+
text?: string | ((usersTyping: string[]) => string);
|
|
5
|
+
position?: 'bottom' | 'top' | 'overlay' | 'floating';
|
|
6
|
+
styles?: React.CSSProperties;
|
|
7
|
+
customComponent?: React.ComponentType<{
|
|
8
|
+
usersTyping: string[];
|
|
9
|
+
text: string;
|
|
10
|
+
isVisible: boolean;
|
|
11
|
+
}>;
|
|
12
|
+
isVisible: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare const generateDefaultText: (usersTyping: string[]) => string;
|
|
15
|
+
declare const generateProcessingText: (usersTyping: string[]) => string;
|
|
16
|
+
declare const CustomTypingIndicator: FC<CustomTypingIndicatorProps>;
|
|
17
|
+
export default CustomTypingIndicator;
|
|
18
|
+
export { generateDefaultText, generateProcessingText };
|
|
@@ -4,7 +4,7 @@ import { IConfig, IRoom, xmppSettingsInterface } from '../types/types';
|
|
|
4
4
|
interface XmppContextType {
|
|
5
5
|
client: XmppClient;
|
|
6
6
|
setClient: (client: XmppClient | null) => void;
|
|
7
|
-
initializeClient: (
|
|
7
|
+
initializeClient: (username: string, password: string, xmppSettings?: xmppSettingsInterface, roomsList?: {
|
|
8
8
|
[jid: string]: IRoom;
|
|
9
9
|
}) => Promise<XmppClient>;
|
|
10
10
|
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook for managing custom typing indicator functionality
|
|
3
|
+
* Provides utilities for text generation and typing state management
|
|
4
|
+
*/
|
|
5
|
+
export declare const useCustomTypingIndicator: (roomJID: string) => {
|
|
6
|
+
isComposing: any;
|
|
7
|
+
composingList: any;
|
|
8
|
+
isCustomTypingEnabled: any;
|
|
9
|
+
typingConfig: any;
|
|
10
|
+
shouldShowIndicator: boolean;
|
|
11
|
+
getTypingText: (customText?: string | ((usersTyping: string[]) => string)) => string;
|
|
12
|
+
getProcessingText: () => string;
|
|
13
|
+
getPositionStyles: (position: string) => any;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Utility functions for creating common typing indicator configurations
|
|
17
|
+
*/
|
|
18
|
+
export declare const createTypingIndicatorConfigs: {
|
|
19
|
+
default: {
|
|
20
|
+
enabled: boolean;
|
|
21
|
+
position: "bottom";
|
|
22
|
+
};
|
|
23
|
+
processing: {
|
|
24
|
+
enabled: boolean;
|
|
25
|
+
position: "overlay";
|
|
26
|
+
text: (usersTyping: string[]) => string;
|
|
27
|
+
styles: {
|
|
28
|
+
background: string;
|
|
29
|
+
color: string;
|
|
30
|
+
fontSize: string;
|
|
31
|
+
fontWeight: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
floating: {
|
|
35
|
+
enabled: boolean;
|
|
36
|
+
position: "floating";
|
|
37
|
+
styles: {
|
|
38
|
+
background: string;
|
|
39
|
+
color: string;
|
|
40
|
+
fontSize: string;
|
|
41
|
+
fontWeight: string;
|
|
42
|
+
boxShadow: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
top: {
|
|
46
|
+
enabled: boolean;
|
|
47
|
+
position: "top";
|
|
48
|
+
styles: {
|
|
49
|
+
background: string;
|
|
50
|
+
color: string;
|
|
51
|
+
fontSize: string;
|
|
52
|
+
fontWeight: string;
|
|
53
|
+
boxShadow: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
customTexts: {
|
|
57
|
+
aiProcessing: (usersTyping: string[]) => string;
|
|
58
|
+
simple: (usersTyping: string[]) => string;
|
|
59
|
+
minimal: (usersTyping: string[]) => string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
export default useCustomTypingIndicator;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IConfig } from '../types/models/config.model';
|
|
2
|
+
interface EventHandlersHook {
|
|
3
|
+
handleMessageSent: (event: {
|
|
4
|
+
message: string;
|
|
5
|
+
roomJID: string;
|
|
6
|
+
user: any;
|
|
7
|
+
messageType: 'text' | 'media';
|
|
8
|
+
metadata?: any;
|
|
9
|
+
}) => Promise<void>;
|
|
10
|
+
handleMessageFailed: (event: {
|
|
11
|
+
message: string;
|
|
12
|
+
roomJID: string;
|
|
13
|
+
error: Error;
|
|
14
|
+
messageType: 'text' | 'media';
|
|
15
|
+
}) => void;
|
|
16
|
+
handleMessageEdited: (event: {
|
|
17
|
+
messageId: string;
|
|
18
|
+
newMessage: string;
|
|
19
|
+
roomJID: string;
|
|
20
|
+
user: any;
|
|
21
|
+
}) => void;
|
|
22
|
+
}
|
|
23
|
+
export declare const useEventHandlers: (config?: IConfig) => EventHandlersHook;
|
|
24
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const useSendMessage: () => {
|
|
2
|
-
sendMessage: (message: string, activeRoomJID: string, isReply?: boolean, isChecked?: boolean, mainMessage?: string) => void
|
|
2
|
+
sendMessage: (message: string, activeRoomJID: string, isReply?: boolean, isChecked?: boolean, mainMessage?: string) => Promise<void>;
|
|
3
3
|
sendMedia: (data: File, type: string, activeRoomJID: string, isReply?: boolean, isChecked?: boolean, mainMessage?: string) => Promise<void>;
|
|
4
|
-
sendEditMessage: (message: string) => void
|
|
4
|
+
sendEditMessage: (message: string) => Promise<void>;
|
|
5
|
+
isLastMessageFromUserAndProcessing: (roomJID: string) => boolean;
|
|
5
6
|
};
|