@botpress/webchat 2.3.7 → 2.4.0-beta.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/{.eslintrc.js → .eslintrc.cjs} +1 -0
- package/.turbo/turbo-build.log +8 -8
- package/dist/client/client.d.ts +33 -41
- package/dist/client/index.d.ts +2 -0
- package/dist/client/legacyClient.d.ts +55 -0
- package/dist/client/types.d.ts +2 -11
- package/dist/components/Block.d.ts +4 -2
- package/dist/components/CloseWindowButton.d.ts +7 -0
- package/dist/components/Composer/Composer.d.ts +13 -1
- package/dist/components/Container/Container.d.ts +9 -1
- package/dist/components/Header/Header.d.ts +5 -1
- package/dist/components/Loader/Loader.d.ts +5 -0
- package/dist/components/Loader/index.d.ts +1 -0
- package/dist/components/Marquee/Marquee.d.ts +7 -1
- package/dist/components/Message/Message.d.ts +10 -6
- package/dist/components/MessageList/MessageList.d.ts +12 -7
- package/dist/components/RestartConversationButton.d.ts +7 -0
- package/dist/components/Webchat.d.ts +28 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/renderers/Audio/Audio.d.ts +4 -2
- package/dist/components/renderers/Button/Button.d.ts +1 -1
- package/dist/components/renderers/Carousel/Carousel.d.ts +4 -2
- package/dist/components/renderers/Dropdown/Dropdown.d.ts +1 -1
- package/dist/components/renderers/File/File.d.ts +4 -2
- package/dist/components/renderers/Image/Image.d.ts +4 -2
- package/dist/components/renderers/Location/Location.d.ts +4 -2
- package/dist/components/renderers/Video/Video.d.ts +4 -2
- package/dist/components/renderers/index.d.ts +1 -1
- package/dist/contexts/index.d.ts +0 -1
- package/dist/gen/signals/index.d.ts +4 -4
- package/dist/gen/signals/messageCreated.z.d.ts +4 -4
- package/dist/hooks/index.d.ts +4 -1
- package/dist/hooks/useConversationId.d.ts +4 -0
- package/dist/hooks/useIsTyping.d.ts +4 -0
- package/dist/hooks/useUserCredentials.d.ts +5 -0
- package/dist/hooks/useWebchatClient.d.ts +47 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +22120 -22963
- package/dist/index.umd.cjs +125 -125
- package/dist/providers/index.d.ts +0 -1
- package/dist/stores/index.d.ts +1 -0
- package/dist/stores/messagesStore.d.ts +20 -0
- package/dist/stores/offlineStore.d.ts +0 -2
- package/dist/stores/webchatStore.d.ts +5 -53
- package/dist/style.css +1 -1
- package/dist/styles/classes.d.ts +3 -0
- package/dist/types/block-type.d.ts +21 -5
- package/dist/utils/message.d.ts +2 -2
- package/package.json +2 -1
- package/dist/components/CloseWindow.d.ts +0 -5
- package/dist/components/RestartConversation.d.ts +0 -5
- package/dist/contexts/WebchatContext.d.ts +0 -73
- package/dist/hooks/useWebchatStore.d.ts +0 -2
- package/dist/providers/WebchatProvider.d.ts +0 -4
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @botpress/webchat@2.
|
|
2
|
+
> @botpress/webchat@2.4.0-beta.1 build /home/runner/work/genisys/genisys/packages/webchat-components
|
|
3
3
|
> vite build
|
|
4
4
|
|
|
5
5
|
[36mvite v5.4.8 [32mbuilding for production...[36m[39m
|
|
@@ -11,15 +11,15 @@ transforming...
|
|
|
11
11
|
2 | @import './theme.css';
|
|
12
12
|
| ^^^^^^
|
|
13
13
|
3 | @import '../components/index.css'[39m
|
|
14
|
-
[32m✓[39m
|
|
14
|
+
[32m✓[39m 3103 modules transformed.
|
|
15
15
|
rendering chunks...
|
|
16
16
|
|
|
17
17
|
[vite:dts] Start generate declaration files...
|
|
18
18
|
computing gzip size...
|
|
19
|
-
[2mdist/[22m[35mstyle.css [39m[1m[2m 31.
|
|
20
|
-
[2mdist/[22m[36mindex.js [39m[1m[33m1,
|
|
21
|
-
[vite:dts] Declaration files built in
|
|
19
|
+
[2mdist/[22m[35mstyle.css [39m[1m[2m 31.78 kB[22m[1m[22m[2m │ gzip: 5.90 kB[22m
|
|
20
|
+
[2mdist/[22m[36mindex.js [39m[1m[33m1,023.36 kB[39m[22m[2m │ gzip: 267.30 kB[22m
|
|
21
|
+
[vite:dts] Declaration files built in 11767ms.
|
|
22
22
|
|
|
23
|
-
[2mdist/[22m[35mstyle.css [39m[1m[2m 31.
|
|
24
|
-
[2mdist/[22m[36mindex.umd.cjs [39m[1m[
|
|
25
|
-
[32m✓ built in
|
|
23
|
+
[2mdist/[22m[35mstyle.css [39m[1m[2m 31.78 kB[22m[1m[22m[2m │ gzip: 5.90 kB[22m
|
|
24
|
+
[2mdist/[22m[36mindex.umd.cjs [39m[1m[33m701.36 kB[39m[22m[2m │ gzip: 222.77 kB[22m
|
|
25
|
+
[32m✓ built in 20.49s[39m
|
package/dist/client/client.d.ts
CHANGED
|
@@ -1,45 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import type { Message as WebchatMessage } from '../adapters/webchat';
|
|
5
|
-
export type PushpinClientProps = {
|
|
1
|
+
import { Message as BotpressMessage } from '@bpinternal/webchat-http-client';
|
|
2
|
+
import type { MessageObject } from '../types';
|
|
3
|
+
type Props = {
|
|
6
4
|
apiUrl: string;
|
|
7
5
|
clientId: string;
|
|
6
|
+
sseTimeout?: number;
|
|
8
7
|
};
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
get userId(): string | undefined;
|
|
19
|
-
getUser(): Promise<{
|
|
20
|
-
data: {
|
|
21
|
-
[k: string]: any;
|
|
22
|
-
} | undefined;
|
|
8
|
+
export type Client = ReturnType<typeof getClient>;
|
|
9
|
+
export declare function getClient({ apiUrl, clientId, sseTimeout }: Props): {
|
|
10
|
+
sendMessage: (props: Parameters<(input: import("@bpinternal/webchat-http-client/dist/gen/client/operations/createMessage").CreateMessageInput) => Promise<import("@bpinternal/webchat-http-client/dist/gen/client/operations/createMessage").CreateMessageResponse>>[number]) => Promise<MessageObject>;
|
|
11
|
+
getMessage: (props: Parameters<(input: import("@bpinternal/webchat-http-client/dist/gen/client/operations/getMessage").GetMessageInput) => Promise<import("@bpinternal/webchat-http-client/dist/gen/client/operations/getMessage").GetMessageResponse>>[number]) => Promise<MessageObject>;
|
|
12
|
+
listConversationMessages: (props: Parameters<(input: import("@bpinternal/webchat-http-client/dist/gen/client/operations/listConversationMessages").ListConversationMessagesInput) => Promise<import("@bpinternal/webchat-http-client/dist/gen/client/operations/listConversationMessages").ListConversationMessagesResponse>>[number]) => Promise<{
|
|
13
|
+
messages: MessageObject[];
|
|
14
|
+
meta: {
|
|
15
|
+
nextToken?: string;
|
|
16
|
+
};
|
|
23
17
|
}>;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
private _mapMessage;
|
|
45
|
-
}
|
|
18
|
+
createMessage: (props: Parameters<(input: import("@bpinternal/webchat-http-client/dist/gen/client/operations/createMessage").CreateMessageInput) => Promise<import("@bpinternal/webchat-http-client/dist/gen/client/operations/createMessage").CreateMessageResponse>>[number]) => Promise<MessageObject>;
|
|
19
|
+
addParticipant: (input: import("@bpinternal/webchat-http-client/dist/gen/client/operations/addParticipant").AddParticipantInput) => Promise<import("@bpinternal/webchat-http-client/dist/gen/client/operations/addParticipant").AddParticipantResponse>;
|
|
20
|
+
createConversation: (input: import("@bpinternal/webchat-http-client/dist/gen/client/operations/createConversation").CreateConversationInput) => Promise<import("@bpinternal/webchat-http-client/dist/gen/client/operations/createConversation").CreateConversationResponse>;
|
|
21
|
+
createEvent: (input: import("@bpinternal/webchat-http-client/dist/gen/client/operations/createEvent").CreateEventInput) => Promise<import("@bpinternal/webchat-http-client/dist/gen/client/operations/createEvent").CreateEventResponse>;
|
|
22
|
+
createFile: (input: import("@bpinternal/webchat-http-client/dist/gen/client/operations/createFile").CreateFileInput) => Promise<import("@bpinternal/webchat-http-client/dist/gen/client/operations/createFile").CreateFileResponse>;
|
|
23
|
+
createUser: (input: import("@bpinternal/webchat-http-client/dist/gen/client/operations/createUser").CreateUserInput) => Promise<import("@bpinternal/webchat-http-client/dist/gen/client/operations/createUser").CreateUserResponse>;
|
|
24
|
+
deleteConversation: (input: import("@bpinternal/webchat-http-client/dist/gen/client/operations/deleteConversation").DeleteConversationInput) => Promise<import("@bpinternal/webchat-http-client/dist/gen/client/operations/deleteConversation").DeleteConversationResponse>;
|
|
25
|
+
deleteMessage: (input: import("@bpinternal/webchat-http-client/dist/gen/client/operations/deleteMessage").DeleteMessageInput) => Promise<import("@bpinternal/webchat-http-client/dist/gen/client/operations/deleteMessage").DeleteMessageResponse>;
|
|
26
|
+
deleteUser: (input: import("@bpinternal/webchat-http-client/dist/gen/client/operations/deleteUser").DeleteUserInput) => Promise<import("@bpinternal/webchat-http-client/dist/gen/client/operations/deleteUser").DeleteUserResponse>;
|
|
27
|
+
getConversation: (input: import("@bpinternal/webchat-http-client/dist/gen/client/operations/getConversation").GetConversationInput) => Promise<import("@bpinternal/webchat-http-client/dist/gen/client/operations/getConversation").GetConversationResponse>;
|
|
28
|
+
getEvent: (input: import("@bpinternal/webchat-http-client/dist/gen/client/operations/getEvent").GetEventInput) => Promise<import("@bpinternal/webchat-http-client/dist/gen/client/operations/getEvent").GetEventResponse>;
|
|
29
|
+
getParticipant: (input: import("@bpinternal/webchat-http-client/dist/gen/client/operations/getParticipant").GetParticipantInput) => Promise<import("@bpinternal/webchat-http-client/dist/gen/client/operations/getParticipant").GetParticipantResponse>;
|
|
30
|
+
getUser: (input: import("@bpinternal/webchat-http-client/dist/gen/client/operations/getUser").GetUserInput) => Promise<import("@bpinternal/webchat-http-client/dist/gen/client/operations/getUser").GetUserResponse>;
|
|
31
|
+
listConversations: (input: import("@bpinternal/webchat-http-client/dist/gen/client/operations/listConversations").ListConversationsInput) => Promise<import("@bpinternal/webchat-http-client/dist/gen/client/operations/listConversations").ListConversationsResponse>;
|
|
32
|
+
removeParticipant: (input: import("@bpinternal/webchat-http-client/dist/gen/client/operations/removeParticipant").RemoveParticipantInput) => Promise<import("@bpinternal/webchat-http-client/dist/gen/client/operations/removeParticipant").RemoveParticipantResponse>;
|
|
33
|
+
updateUser: (input: import("@bpinternal/webchat-http-client/dist/gen/client/operations/updateUser").UpdateUserInput) => Promise<import("@bpinternal/webchat-http-client/dist/gen/client/operations/updateUser").UpdateUserResponse>;
|
|
34
|
+
listenConversation: ({ id, "x-user-key": userKey, }: import("@bpinternal/webchat-http-client/dist/gen/client/operations/listenConversation").ListenConversationInput) => Promise<import("@bpinternal/webchat-http-client").SignalListener>;
|
|
35
|
+
};
|
|
36
|
+
export declare function mapMessage(message: BotpressMessage): MessageObject;
|
|
37
|
+
export {};
|
package/dist/client/index.d.ts
CHANGED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { EventEmitter } from '../utils';
|
|
2
|
+
import { Events, UserCredentials, UserData, UserOptions, type User } from './types';
|
|
3
|
+
import { type FileType } from '../types';
|
|
4
|
+
import type { Message as WebchatMessage } from '../adapters/webchat';
|
|
5
|
+
export type PushpinClientProps = {
|
|
6
|
+
apiUrl: string;
|
|
7
|
+
clientId: string;
|
|
8
|
+
};
|
|
9
|
+
export declare class WebchatClient extends EventEmitter<Events> {
|
|
10
|
+
private _client;
|
|
11
|
+
private _webhookId;
|
|
12
|
+
private _apiUrl;
|
|
13
|
+
private _state;
|
|
14
|
+
constructor(props: PushpinClientProps);
|
|
15
|
+
readonly mode = "pushpin";
|
|
16
|
+
get apiUrl(): string;
|
|
17
|
+
get clientId(): string;
|
|
18
|
+
get userId(): string | undefined;
|
|
19
|
+
getUser(): Promise<{
|
|
20
|
+
data: {
|
|
21
|
+
[k: string]: any;
|
|
22
|
+
} | undefined;
|
|
23
|
+
}>;
|
|
24
|
+
updateUser(user: User): Promise<User>;
|
|
25
|
+
get conversationId(): string | undefined;
|
|
26
|
+
connect(creds?: UserCredentials, data?: UserData, opts?: UserOptions): Promise<UserCredentials | undefined>;
|
|
27
|
+
private _initialConnect;
|
|
28
|
+
private _reConnect;
|
|
29
|
+
disconnect(): Promise<void>;
|
|
30
|
+
sendFile(file: File): Promise<{
|
|
31
|
+
fileUrl: string;
|
|
32
|
+
name: string;
|
|
33
|
+
type: FileType;
|
|
34
|
+
}>;
|
|
35
|
+
sendMessage(payload: WebchatMessage): Promise<void>;
|
|
36
|
+
sendEvent(event: Record<string, any>): Promise<void>;
|
|
37
|
+
switchConversation(id: string): Promise<void>;
|
|
38
|
+
conversationExists(id: string): Promise<boolean>;
|
|
39
|
+
userExists({ userToken }: UserCredentials): Promise<boolean>;
|
|
40
|
+
newConversation(): Promise<void>;
|
|
41
|
+
private _createNewConversation;
|
|
42
|
+
listMessages(): Promise<{
|
|
43
|
+
id: string;
|
|
44
|
+
conversationId: string;
|
|
45
|
+
authorId: string;
|
|
46
|
+
sentOn: Date;
|
|
47
|
+
payload: import("../adapters/target").Message;
|
|
48
|
+
disableInput: boolean | undefined;
|
|
49
|
+
metadata: {
|
|
50
|
+
[k: string]: any;
|
|
51
|
+
} | undefined;
|
|
52
|
+
}[]>;
|
|
53
|
+
private _connectConversation;
|
|
54
|
+
private _mapMessage;
|
|
55
|
+
}
|
package/dist/client/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type MessageObject } from '../types/block-type';
|
|
2
2
|
import { UserProps } from '../types';
|
|
3
3
|
import type { Message as WebchatMessage } from '../adapters/webchat';
|
|
4
4
|
type SafeOmit<T, K extends keyof T> = Omit<T, K>;
|
|
@@ -9,18 +9,9 @@ export type UserCredentials = {
|
|
|
9
9
|
export type User = UserProps;
|
|
10
10
|
export type UserData = User['data'];
|
|
11
11
|
export type UserOptions = SafeOmit<User, 'data'>;
|
|
12
|
-
export type Message = {
|
|
13
|
-
id: string;
|
|
14
|
-
conversationId: string;
|
|
15
|
-
authorId: string | undefined;
|
|
16
|
-
sentOn: Date;
|
|
17
|
-
disableInput?: boolean;
|
|
18
|
-
payload: BlockObject;
|
|
19
|
-
metadata?: Record<string, any>;
|
|
20
|
-
};
|
|
21
12
|
export type WebchatEvents = {
|
|
22
13
|
conversation: string | undefined;
|
|
23
|
-
message:
|
|
14
|
+
message: MessageObject;
|
|
24
15
|
messageSent: WebchatMessage;
|
|
25
16
|
error: Error;
|
|
26
17
|
webchatVisibility: 'show' | 'hide' | 'toggle';
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
|
+
import { Renderers } from '../types';
|
|
2
3
|
import { BlockObjects, BlockType, type CommonBlockProps } from '../types';
|
|
3
4
|
type BlockProps<T extends BlockType> = {
|
|
4
5
|
block: BlockObjects[T];
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
renderers?: Partial<Renderers>;
|
|
7
|
+
} & CommonBlockProps;
|
|
8
|
+
export declare const Block: <T extends BlockType>({ block, renderers, ...props }: BlockProps<T>) => JSX.Element;
|
|
7
9
|
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import { XMarkIcon } from '@heroicons/react/24/outline';
|
|
3
|
+
type Props = ComponentProps<typeof XMarkIcon> & {
|
|
4
|
+
onClick?: () => void;
|
|
5
|
+
};
|
|
6
|
+
export declare const CloseWindowButton: ({ onClick, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import { ComponentProps, type Ref } from 'react';
|
|
2
|
+
import type { Configuration, FileType } from '../../types';
|
|
3
|
+
import type { Message } from '../../adapters/webchat';
|
|
2
4
|
type Props = ComponentProps<'div'> & {
|
|
3
5
|
inputRef?: Ref<HTMLTextAreaElement>;
|
|
4
|
-
|
|
6
|
+
disableComposer?: boolean;
|
|
7
|
+
isReadOnly?: boolean;
|
|
8
|
+
allowFileUpload?: boolean;
|
|
9
|
+
connected?: boolean;
|
|
10
|
+
sendMessage: (payload: Message) => void;
|
|
11
|
+
uploadFile: (file: File) => Promise<{
|
|
12
|
+
fileUrl: string;
|
|
13
|
+
name: string;
|
|
14
|
+
type: FileType;
|
|
15
|
+
}>;
|
|
16
|
+
} & Pick<Configuration, 'composerPlaceholder' | 'showPoweredBy'>;
|
|
5
17
|
export declare const Composer: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Omit<Props, "ref"> & import("react").RefAttributes<HTMLDivElement>>>;
|
|
6
18
|
export {};
|
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
type Props = ComponentProps<'div'> & {
|
|
3
|
+
connected?: boolean;
|
|
4
|
+
};
|
|
5
|
+
export declare const Container: {
|
|
6
|
+
({ children, className, connected, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import type { Configuration } from '../../types';
|
|
1
2
|
type HeaderProps = {
|
|
2
3
|
defaultOpen?: boolean;
|
|
3
4
|
open?: boolean;
|
|
4
5
|
disabled?: boolean;
|
|
5
6
|
onOpenChange?(open: boolean): void;
|
|
7
|
+
restartConversation?: () => void;
|
|
8
|
+
closeWindow?: () => void;
|
|
9
|
+
configuration: Pick<Configuration, 'email' | 'phone' | 'privacyPolicy' | 'website' | 'termsOfService' | 'botAvatar' | 'botDescription' | 'botName'>;
|
|
6
10
|
};
|
|
7
|
-
export declare const Header: ({ defaultOpen,
|
|
11
|
+
export declare const Header: ({ defaultOpen, closeWindow, configuration, restartConversation, ...props }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
12
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Loader';
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
type Props = {
|
|
2
|
+
botAvatar?: string;
|
|
3
|
+
botDescription?: string;
|
|
4
|
+
botName?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function Marquee({ botAvatar, botDescription, botName }: Props): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
type
|
|
4
|
-
|
|
2
|
+
import type { Renderers } from '../../types';
|
|
3
|
+
import type { Message as WebchatMessage } from '../../adapters/webchat';
|
|
4
|
+
export declare const Message: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<{
|
|
5
5
|
children?: ReactNode;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
renderers?: Partial<Renderers>;
|
|
7
|
+
sendMessage: (payload: WebchatMessage) => void;
|
|
8
|
+
isReadOnly?: boolean;
|
|
9
|
+
} & import("../..").MessageObject<import("../../adapters/target").Message> & {
|
|
10
|
+
direction: import("../..").MessageDirection;
|
|
11
|
+
sender: import("../..").Sender;
|
|
12
|
+
} & import("react").RefAttributes<HTMLDivElement>>>;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import { ComponentProps
|
|
2
|
-
import {
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import type { Renderers, RichMessageObject } from '../../types';
|
|
3
|
+
import type { Message as WebchatMessage } from '../../adapters/webchat';
|
|
3
4
|
type MessageListProps = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
messages?: RichMessageObject[];
|
|
6
|
+
isTyping?: boolean;
|
|
7
|
+
headerMessage?: string;
|
|
8
|
+
renderers?: Partial<Renderers>;
|
|
9
|
+
botAvatar?: string;
|
|
10
|
+
botDescription?: string;
|
|
11
|
+
botName?: string;
|
|
12
|
+
sendMessage: (payload: WebchatMessage) => void;
|
|
8
13
|
};
|
|
9
|
-
export declare const MessageList: import("react").MemoExoticComponent<({
|
|
14
|
+
export declare const MessageList: import("react").MemoExoticComponent<({ className, messages, isTyping, headerMessage, renderers, botAvatar, botDescription, botName, sendMessage, ...props }: ComponentProps<"ul"> & MessageListProps) => import("react/jsx-runtime").JSX.Element>;
|
|
10
15
|
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ArrowPathIcon } from '@heroicons/react/20/solid';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
type Props = {
|
|
4
|
+
onClick?: () => void;
|
|
5
|
+
} & ComponentProps<typeof ArrowPathIcon>;
|
|
6
|
+
export declare const RestartConversationButton: ({ onClick, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -1 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Configuration, FileType, MessageObject, Renderers } from '../types';
|
|
2
|
+
import type { Message } from '../adapters/webchat';
|
|
3
|
+
export type Props = {
|
|
4
|
+
renderers?: Partial<Renderers>;
|
|
5
|
+
configuration: Configuration;
|
|
6
|
+
messages: MessageObject[];
|
|
7
|
+
connected?: boolean;
|
|
8
|
+
disableComposer?: boolean;
|
|
9
|
+
isReadOnly?: boolean;
|
|
10
|
+
isLoading?: boolean;
|
|
11
|
+
isTyping?: boolean;
|
|
12
|
+
lastTypingHeartbeat?: Date | null;
|
|
13
|
+
allowFileUpload?: boolean;
|
|
14
|
+
closeWindow?: () => void;
|
|
15
|
+
restartConversation?: () => void;
|
|
16
|
+
user: {
|
|
17
|
+
id: string;
|
|
18
|
+
name?: string;
|
|
19
|
+
pictureUrl?: string;
|
|
20
|
+
} & Record<string, unknown>;
|
|
21
|
+
sendMessage?: (payload: Message) => void;
|
|
22
|
+
uploadFile?: (file: File) => Promise<{
|
|
23
|
+
fileUrl: string;
|
|
24
|
+
name: string;
|
|
25
|
+
type: FileType;
|
|
26
|
+
}>;
|
|
27
|
+
};
|
|
28
|
+
export declare const Webchat: ({ connected, configuration, closeWindow, isTyping, messages, user, sendMessage, uploadFile, isLoading, renderers, isReadOnly, disableComposer, restartConversation, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,6 +8,6 @@ export * from './TypingIndicator';
|
|
|
8
8
|
export * from './Message';
|
|
9
9
|
export * from './MessageList';
|
|
10
10
|
export * from './Modal';
|
|
11
|
-
export * from './
|
|
11
|
+
export * from './RestartConversationButton';
|
|
12
12
|
export * from './Webchat';
|
|
13
13
|
export * from './renderers';
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export declare const Audio: import("react").ForwardRefExoticComponent<import("../../../adapters/target").AudioMessage &
|
|
1
|
+
export declare const Audio: import("react").ForwardRefExoticComponent<import("../../../adapters/target").AudioMessage & Pick<import("../../..").RichMessageObject<import("../../../adapters/target").Message>, "direction" | "timestamp" | "sender"> & {
|
|
2
2
|
messageId: string;
|
|
3
|
+
sendMessage: (payload: import("../../../adapters/webchat").Message) => void;
|
|
3
4
|
metadata?: Record<string, any>;
|
|
4
|
-
|
|
5
|
+
isReadOnly?: boolean;
|
|
6
|
+
} & import("react").RefAttributes<HTMLAudioElement>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ButtonBlock, type CommonBlockProps } from '../../../types';
|
|
2
2
|
type Props = ButtonBlock & CommonBlockProps;
|
|
3
|
-
export declare const Button: ({ text, buttonValue,
|
|
3
|
+
export declare const Button: ({ text, buttonValue, variant, groupId, reusable, sendMessage, isReadOnly, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export declare const Carousel: import("react").ForwardRefExoticComponent<import("../../../adapters/target").CarouselMessage &
|
|
1
|
+
export declare const Carousel: import("react").ForwardRefExoticComponent<import("../../../adapters/target").CarouselMessage & Pick<import("../../..").RichMessageObject<import("../../../adapters/target").Message>, "direction" | "timestamp" | "sender"> & {
|
|
2
2
|
messageId: string;
|
|
3
|
+
sendMessage: (payload: import("../../../adapters/webchat").Message) => void;
|
|
3
4
|
metadata?: Record<string, any>;
|
|
4
|
-
|
|
5
|
+
isReadOnly?: boolean;
|
|
6
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DropdownBlock, type CommonBlockProps } from '../../../types';
|
|
2
2
|
import { ComponentProps } from 'react';
|
|
3
3
|
type Props = DropdownBlock & ComponentProps<'div'> & CommonBlockProps;
|
|
4
|
-
export declare const Dropdown: ({ options, label, reusable }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare const Dropdown: ({ options, label, reusable, sendMessage, isReadOnly }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export declare const File: import("react").ForwardRefExoticComponent<import("../../../adapters/target").FileMessage &
|
|
1
|
+
export declare const File: import("react").ForwardRefExoticComponent<import("../../../adapters/target").FileMessage & Pick<import("../../..").RichMessageObject<import("../../../adapters/target").Message>, "direction" | "timestamp" | "sender"> & {
|
|
2
2
|
messageId: string;
|
|
3
|
+
sendMessage: (payload: import("../../../adapters/webchat").Message) => void;
|
|
3
4
|
metadata?: Record<string, any>;
|
|
4
|
-
|
|
5
|
+
isReadOnly?: boolean;
|
|
6
|
+
} & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export declare const Image: import("react").ForwardRefExoticComponent<import("../../../adapters/target").ImageMessage &
|
|
1
|
+
export declare const Image: import("react").ForwardRefExoticComponent<import("../../../adapters/target").ImageMessage & Pick<import("../../..").RichMessageObject<import("../../../adapters/target").Message>, "direction" | "timestamp" | "sender"> & {
|
|
2
2
|
messageId: string;
|
|
3
|
+
sendMessage: (payload: import("../../../adapters/webchat").Message) => void;
|
|
3
4
|
metadata?: Record<string, any>;
|
|
4
|
-
|
|
5
|
+
isReadOnly?: boolean;
|
|
6
|
+
} & import("react").RefAttributes<HTMLImageElement>>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export declare const Location: import("react").ForwardRefExoticComponent<import("../../../adapters/target").LocationMessage &
|
|
1
|
+
export declare const Location: import("react").ForwardRefExoticComponent<import("../../../adapters/target").LocationMessage & Pick<import("../../..").RichMessageObject<import("../../../adapters/target").Message>, "direction" | "timestamp" | "sender"> & {
|
|
2
2
|
messageId: string;
|
|
3
|
+
sendMessage: (payload: import("../../../adapters/webchat").Message) => void;
|
|
3
4
|
metadata?: Record<string, any>;
|
|
4
|
-
|
|
5
|
+
isReadOnly?: boolean;
|
|
6
|
+
} & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export declare const Video: import("react").ForwardRefExoticComponent<import("../../../adapters/target").VideoMessage &
|
|
1
|
+
export declare const Video: import("react").ForwardRefExoticComponent<import("../../../adapters/target").VideoMessage & Pick<import("../../..").RichMessageObject<import("../../../adapters/target").Message>, "direction" | "timestamp" | "sender"> & {
|
|
2
2
|
messageId: string;
|
|
3
|
+
sendMessage: (payload: import("../../../adapters/webchat").Message) => void;
|
|
3
4
|
metadata?: Record<string, any>;
|
|
4
|
-
|
|
5
|
+
isReadOnly?: boolean;
|
|
6
|
+
} & import("react").RefAttributes<HTMLVideoElement>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Renderers } from '../../
|
|
1
|
+
import type { Renderers } from '../../types';
|
|
2
2
|
export declare const renderers: Renderers;
|
package/dist/contexts/index.d.ts
CHANGED
|
@@ -593,8 +593,8 @@ export declare const zod: {
|
|
|
593
593
|
})[];
|
|
594
594
|
};
|
|
595
595
|
id: string;
|
|
596
|
-
userId: string;
|
|
597
596
|
conversationId: string;
|
|
597
|
+
userId: string;
|
|
598
598
|
createdAt: string;
|
|
599
599
|
}, {
|
|
600
600
|
payload: {
|
|
@@ -703,8 +703,8 @@ export declare const zod: {
|
|
|
703
703
|
})[];
|
|
704
704
|
};
|
|
705
705
|
id: string;
|
|
706
|
-
userId: string;
|
|
707
706
|
conversationId: string;
|
|
707
|
+
userId: string;
|
|
708
708
|
createdAt: string;
|
|
709
709
|
}>;
|
|
710
710
|
}, "strip", import("zod").ZodTypeAny, {
|
|
@@ -816,8 +816,8 @@ export declare const zod: {
|
|
|
816
816
|
})[];
|
|
817
817
|
};
|
|
818
818
|
id: string;
|
|
819
|
-
userId: string;
|
|
820
819
|
conversationId: string;
|
|
820
|
+
userId: string;
|
|
821
821
|
createdAt: string;
|
|
822
822
|
};
|
|
823
823
|
}, {
|
|
@@ -929,8 +929,8 @@ export declare const zod: {
|
|
|
929
929
|
})[];
|
|
930
930
|
};
|
|
931
931
|
id: string;
|
|
932
|
-
userId: string;
|
|
933
932
|
conversationId: string;
|
|
933
|
+
userId: string;
|
|
934
934
|
createdAt: string;
|
|
935
935
|
};
|
|
936
936
|
}>;
|
|
@@ -586,8 +586,8 @@ declare const _default: z.ZodObject<{
|
|
|
586
586
|
})[];
|
|
587
587
|
};
|
|
588
588
|
id: string;
|
|
589
|
-
userId: string;
|
|
590
589
|
conversationId: string;
|
|
590
|
+
userId: string;
|
|
591
591
|
createdAt: string;
|
|
592
592
|
}, {
|
|
593
593
|
payload: {
|
|
@@ -696,8 +696,8 @@ declare const _default: z.ZodObject<{
|
|
|
696
696
|
})[];
|
|
697
697
|
};
|
|
698
698
|
id: string;
|
|
699
|
-
userId: string;
|
|
700
699
|
conversationId: string;
|
|
700
|
+
userId: string;
|
|
701
701
|
createdAt: string;
|
|
702
702
|
}>;
|
|
703
703
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -809,8 +809,8 @@ declare const _default: z.ZodObject<{
|
|
|
809
809
|
})[];
|
|
810
810
|
};
|
|
811
811
|
id: string;
|
|
812
|
-
userId: string;
|
|
813
812
|
conversationId: string;
|
|
813
|
+
userId: string;
|
|
814
814
|
createdAt: string;
|
|
815
815
|
};
|
|
816
816
|
}, {
|
|
@@ -922,8 +922,8 @@ declare const _default: z.ZodObject<{
|
|
|
922
922
|
})[];
|
|
923
923
|
};
|
|
924
924
|
id: string;
|
|
925
|
-
userId: string;
|
|
926
925
|
conversationId: string;
|
|
926
|
+
userId: string;
|
|
927
927
|
createdAt: string;
|
|
928
928
|
};
|
|
929
929
|
}>;
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export * from './useClient';
|
|
2
|
+
export * from './useConversationId';
|
|
2
3
|
export * from './useImageSize';
|
|
4
|
+
export * from './useIsTyping';
|
|
3
5
|
export * from './useRefresh';
|
|
4
|
-
export * from './
|
|
6
|
+
export * from './useUserCredentials';
|
|
7
|
+
export * from './useWebchatClient';
|