@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.
Files changed (54) hide show
  1. package/{.eslintrc.js → .eslintrc.cjs} +1 -0
  2. package/.turbo/turbo-build.log +8 -8
  3. package/dist/client/client.d.ts +33 -41
  4. package/dist/client/index.d.ts +2 -0
  5. package/dist/client/legacyClient.d.ts +55 -0
  6. package/dist/client/types.d.ts +2 -11
  7. package/dist/components/Block.d.ts +4 -2
  8. package/dist/components/CloseWindowButton.d.ts +7 -0
  9. package/dist/components/Composer/Composer.d.ts +13 -1
  10. package/dist/components/Container/Container.d.ts +9 -1
  11. package/dist/components/Header/Header.d.ts +5 -1
  12. package/dist/components/Loader/Loader.d.ts +5 -0
  13. package/dist/components/Loader/index.d.ts +1 -0
  14. package/dist/components/Marquee/Marquee.d.ts +7 -1
  15. package/dist/components/Message/Message.d.ts +10 -6
  16. package/dist/components/MessageList/MessageList.d.ts +12 -7
  17. package/dist/components/RestartConversationButton.d.ts +7 -0
  18. package/dist/components/Webchat.d.ts +28 -1
  19. package/dist/components/index.d.ts +1 -1
  20. package/dist/components/renderers/Audio/Audio.d.ts +4 -2
  21. package/dist/components/renderers/Button/Button.d.ts +1 -1
  22. package/dist/components/renderers/Carousel/Carousel.d.ts +4 -2
  23. package/dist/components/renderers/Dropdown/Dropdown.d.ts +1 -1
  24. package/dist/components/renderers/File/File.d.ts +4 -2
  25. package/dist/components/renderers/Image/Image.d.ts +4 -2
  26. package/dist/components/renderers/Location/Location.d.ts +4 -2
  27. package/dist/components/renderers/Video/Video.d.ts +4 -2
  28. package/dist/components/renderers/index.d.ts +1 -1
  29. package/dist/contexts/index.d.ts +0 -1
  30. package/dist/gen/signals/index.d.ts +4 -4
  31. package/dist/gen/signals/messageCreated.z.d.ts +4 -4
  32. package/dist/hooks/index.d.ts +4 -1
  33. package/dist/hooks/useConversationId.d.ts +4 -0
  34. package/dist/hooks/useIsTyping.d.ts +4 -0
  35. package/dist/hooks/useUserCredentials.d.ts +5 -0
  36. package/dist/hooks/useWebchatClient.d.ts +47 -0
  37. package/dist/index.d.ts +3 -3
  38. package/dist/index.js +22120 -22963
  39. package/dist/index.umd.cjs +125 -125
  40. package/dist/providers/index.d.ts +0 -1
  41. package/dist/stores/index.d.ts +1 -0
  42. package/dist/stores/messagesStore.d.ts +20 -0
  43. package/dist/stores/offlineStore.d.ts +0 -2
  44. package/dist/stores/webchatStore.d.ts +5 -53
  45. package/dist/style.css +1 -1
  46. package/dist/styles/classes.d.ts +3 -0
  47. package/dist/types/block-type.d.ts +21 -5
  48. package/dist/utils/message.d.ts +2 -2
  49. package/package.json +2 -1
  50. package/dist/components/CloseWindow.d.ts +0 -5
  51. package/dist/components/RestartConversation.d.ts +0 -5
  52. package/dist/contexts/WebchatContext.d.ts +0 -73
  53. package/dist/hooks/useWebchatStore.d.ts +0 -2
  54. package/dist/providers/WebchatProvider.d.ts +0 -4
@@ -8,4 +8,5 @@ module.exports = {
8
8
  project: "./tsconfig.json",
9
9
  tsconfigRootDir: __dirname,
10
10
  },
11
+
11
12
  };
@@ -1,5 +1,5 @@
1
1
 
2
- > @botpress/webchat@2.3.7 build /home/runner/work/genisys/genisys/packages/webchat-components
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
  vite v5.4.8 building for production...
@@ -11,15 +11,15 @@ transforming...
11
11
  2 | @import './theme.css';
12
12
  | ^^^^^^
13
13
  3 | @import '../components/index.css'
14
- ✓ 3196 modules transformed.
14
+ ✓ 3103 modules transformed.
15
15
  rendering chunks...
16
16
 
17
17
  [vite:dts] Start generate declaration files...
18
18
  computing gzip size...
19
- dist/style.css  31.27 kB │ gzip: 5.81 kB
20
- dist/index.js 1,094.13 kB │ gzip: 287.40 kB
21
- [vite:dts] Declaration files built in 10547ms.
19
+ dist/style.css  31.78 kB │ gzip: 5.90 kB
20
+ dist/index.js 1,023.36 kB │ gzip: 267.30 kB
21
+ [vite:dts] Declaration files built in 11767ms.
22
22
 
23
- dist/style.css  31.27 kB │ gzip: 5.81 kB
24
- dist/index.umd.cjs 761.31 kB │ gzip: 241.99 kB
25
- ✓ built in 19.55s
23
+ dist/style.css  31.78 kB │ gzip: 5.90 kB
24
+ dist/index.umd.cjs 701.36 kB │ gzip: 222.77 kB
25
+ ✓ built in 20.49s
@@ -1,45 +1,37 @@
1
- import { EventEmitter } from '../utils';
2
- import { Events, UserCredentials, UserData, UserOptions, type Message, type User } from './types';
3
- import { type FileType } from '../types';
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 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;
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
- 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<Message[]>;
43
- private _connectConversation;
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 {};
@@ -1,2 +1,4 @@
1
1
  export * from './client';
2
+ export * from './legacyClient';
3
+ export * from './state-machine';
2
4
  export * from './types';
@@ -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
+ }
@@ -1,4 +1,4 @@
1
- import { BlockObject } from '../types/block-type';
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: 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
- } & Partial<CommonBlockProps>;
6
- export declare const Block: <T extends BlockType>({ block, ...props }: BlockProps<T>) => JSX.Element;
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
- export declare const Container: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
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, disabled, onOpenChange, ...props }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
11
+ export declare const Header: ({ defaultOpen, closeWindow, configuration, restartConversation, ...props }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
8
12
  export {};
@@ -0,0 +1,5 @@
1
+ type Props = {
2
+ className?: string;
3
+ };
4
+ export declare const Loader: ({ className, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -0,0 +1 @@
1
+ export * from './Loader';
@@ -1 +1,7 @@
1
- export declare function Marquee(): import("react/jsx-runtime").JSX.Element;
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 { MessageObject } from '../../types';
3
- type MessageProps = {
4
- scroll: () => void;
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
- } & MessageObject;
7
- export declare const Message: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Partial<MessageProps> & import("react").RefAttributes<HTMLDivElement>>>;
8
- export {};
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, FC } from 'react';
2
- import { StyleOptions } from '../../contexts';
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
- scrollDownButton?: {
5
- text?: string;
6
- icon?: FC<StyleOptions>;
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<({ scrollDownButton, className, ...props }: ComponentProps<"ul"> & MessageListProps) => import("react/jsx-runtime").JSX.Element>;
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
- export declare const Webchat: () => import("react/jsx-runtime").JSX.Element;
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 './RestartConversation';
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 & Partial<Pick<import("../../..").MessageObject<import("../../../adapters/target").Message>, "direction" | "timestamp" | "sender"> & {
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
- }> & import("react").RefAttributes<HTMLAudioElement>>;
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, type, variant, groupId, reusable, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
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 & Partial<Pick<import("../../..").MessageObject<import("../../../adapters/target").Message>, "direction" | "timestamp" | "sender"> & {
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
- }> & import("react").RefAttributes<HTMLDivElement>>;
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 & Partial<Pick<import("../../..").MessageObject<import("../../../adapters/target").Message>, "direction" | "timestamp" | "sender"> & {
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
- }> & import("react").RefAttributes<HTMLAnchorElement>>;
5
+ isReadOnly?: boolean;
6
+ } & import("react").RefAttributes<HTMLAnchorElement>>;
@@ -1,4 +1,6 @@
1
- export declare const Image: import("react").ForwardRefExoticComponent<import("../../../adapters/target").ImageMessage & Partial<Pick<import("../../..").MessageObject<import("../../../adapters/target").Message>, "direction" | "timestamp" | "sender"> & {
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
- }> & import("react").RefAttributes<HTMLImageElement>>;
5
+ isReadOnly?: boolean;
6
+ } & import("react").RefAttributes<HTMLImageElement>>;
@@ -1,4 +1,6 @@
1
- export declare const Location: import("react").ForwardRefExoticComponent<import("../../../adapters/target").LocationMessage & Partial<Pick<import("../../..").MessageObject<import("../../../adapters/target").Message>, "direction" | "timestamp" | "sender"> & {
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
- }> & import("react").RefAttributes<HTMLAnchorElement>>;
5
+ isReadOnly?: boolean;
6
+ } & import("react").RefAttributes<HTMLAnchorElement>>;
@@ -1,4 +1,6 @@
1
- export declare const Video: import("react").ForwardRefExoticComponent<import("../../../adapters/target").VideoMessage & Partial<Pick<import("../../..").MessageObject<import("../../../adapters/target").Message>, "direction" | "timestamp" | "sender"> & {
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
- }> & import("react").RefAttributes<HTMLVideoElement>>;
5
+ isReadOnly?: boolean;
6
+ } & import("react").RefAttributes<HTMLVideoElement>>;
@@ -1,2 +1,2 @@
1
- import { Renderers } from '../../contexts';
1
+ import type { Renderers } from '../../types';
2
2
  export declare const renderers: Renderers;
@@ -1,3 +1,2 @@
1
1
  export * from './MessageContext';
2
2
  export * from './ModalContext';
3
- export * from './WebchatContext';
@@ -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
  }>;
@@ -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 './useWebchatStore';
6
+ export * from './useUserCredentials';
7
+ export * from './useWebchatClient';
@@ -0,0 +1,4 @@
1
+ export declare function useConversationId(createConversation: () => Promise<string>): {
2
+ conversationId: string | undefined;
3
+ newConversation: () => Promise<void>;
4
+ };
@@ -0,0 +1,4 @@
1
+ export declare function useIsTyping(): {
2
+ isTyping: boolean;
3
+ setIsTyping: (isTyping: boolean, timeout?: number) => () => void;
4
+ };
@@ -0,0 +1,5 @@
1
+ import type { UserCredentials } from '../client';
2
+ export declare function useUserCredentials(createUser: () => Promise<UserCredentials>): {
3
+ userCredentials: UserCredentials | undefined;
4
+ newUserCredentials: () => Promise<void>;
5
+ };