@botpress/webchat 1.0.28 → 1.0.30
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/client/ChatClient/index.d.ts +1 -1
- package/dist/client/ChatClient/state-machine.d.ts +1 -0
- package/dist/components/Fab.d.ts +2 -0
- package/dist/components/MessageList.d.ts +10 -2
- package/dist/components/Webchat.d.ts +1 -6
- package/dist/components/dev-tools/configuration.d.ts +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/contexts/WebchatContext.d.ts +1 -17
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useClient.d.ts +8 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +38229 -55093
- package/dist/index.umd.cjs +117 -297
- package/dist/providers/WebchatProvider.d.ts +3 -2
- package/dist/schemas/theme.d.ts +174 -0
- package/dist/types/block-type.d.ts +2 -2
- package/dist/types/configuration.d.ts +16 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/utils/message.d.ts +8 -0
- package/dist/utils/message.test.d.ts +1 -0
- package/dist/utils/withBaseTheme.d.ts +24 -0
- package/package.json +11 -8
|
@@ -19,7 +19,7 @@ export declare class ChatClient extends EventEmitter<Events> implements WebChatC
|
|
|
19
19
|
sendMessage(message: string): Promise<void>;
|
|
20
20
|
switchConversation(id: string): Promise<void>;
|
|
21
21
|
conversationExists(id: string): Promise<boolean>;
|
|
22
|
-
userExists(
|
|
22
|
+
userExists({ userToken }: UserCredentials): Promise<boolean>;
|
|
23
23
|
newConversation(): Promise<void>;
|
|
24
24
|
private _createNewConversation;
|
|
25
25
|
listMessages(): Promise<Message[]>;
|
|
@@ -4,6 +4,7 @@ export type DisconnectedState = {};
|
|
|
4
4
|
export type UserCreatingState = DisconnectedState & {};
|
|
5
5
|
export type UserCreatedState = UserCreatingState & {
|
|
6
6
|
userId: string;
|
|
7
|
+
userKey: string;
|
|
7
8
|
};
|
|
8
9
|
export type ConversationCreatingState = UserCreatedState & {};
|
|
9
10
|
export type ConversationCreatedState = ConversationCreatingState & {
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
import { ComponentProps } from 'react';
|
|
2
|
-
|
|
1
|
+
import { ComponentProps, FC } from 'react';
|
|
2
|
+
import { StyleOptions } from '../contexts';
|
|
3
|
+
type MessageListProps = {
|
|
4
|
+
scrollDownButton?: {
|
|
5
|
+
text?: string;
|
|
6
|
+
icon?: FC<StyleOptions>;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export declare const MessageList: import("react").MemoExoticComponent<({ scrollDownButton, ...props }: ComponentProps<'ul'> & MessageListProps) => JSX.Element>;
|
|
10
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Configuration } from '../../
|
|
1
|
+
import { Configuration } from '../../types';
|
|
2
2
|
export declare const defaultConfiguration: Configuration;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CSSProperties, FC, ReactNode } from 'react';
|
|
2
|
-
import type { BlockObject, BlockStyles, MessageObject } from '../types';
|
|
2
|
+
import type { BlockObject, BlockStyles, Configuration, MessageObject } from '../types';
|
|
3
3
|
import { EventEmitter, Events } from '../utils';
|
|
4
4
|
import { Theme } from '../schemas';
|
|
5
5
|
import { type WebChatClient } from '../client';
|
|
@@ -7,21 +7,6 @@ export type StyleOptions = {
|
|
|
7
7
|
className?: string;
|
|
8
8
|
style?: CSSProperties;
|
|
9
9
|
};
|
|
10
|
-
type DescriptionItem = {
|
|
11
|
-
title: string;
|
|
12
|
-
link?: string;
|
|
13
|
-
};
|
|
14
|
-
export type Configuration = {
|
|
15
|
-
composerPlaceholder?: string;
|
|
16
|
-
botName?: string;
|
|
17
|
-
botAvatar?: string;
|
|
18
|
-
botDescription?: string;
|
|
19
|
-
website?: DescriptionItem;
|
|
20
|
-
email?: DescriptionItem;
|
|
21
|
-
phone?: DescriptionItem;
|
|
22
|
-
privacyPolicy?: DescriptionItem;
|
|
23
|
-
termsOfService?: DescriptionItem;
|
|
24
|
-
};
|
|
25
10
|
export type Renderers<P extends BlockObject = BlockObject> = {
|
|
26
11
|
[T in P['type']]: FC<Extract<P, {
|
|
27
12
|
type: T;
|
|
@@ -58,4 +43,3 @@ export type ContextVaue = {
|
|
|
58
43
|
};
|
|
59
44
|
export declare const WebchatContext: import("react").Context<ContextVaue | null>;
|
|
60
45
|
export declare function useWebchatContext(): ContextVaue;
|
|
61
|
-
export {};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { WebChatClient } from '../client';
|
|
2
|
+
type UseClientOptions = {
|
|
3
|
+
mode: 'messaging' | 'chat';
|
|
4
|
+
clientId: string;
|
|
5
|
+
apiUrl: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const useClient: ({ clientId, apiUrl, mode }: UseClientOptions) => WebChatClient | undefined;
|
|
8
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -5,3 +5,5 @@ export * from './themes';
|
|
|
5
5
|
export { MessagingClient as Client } from './client/MessagingClient/client';
|
|
6
6
|
export { useWebchatContext } from './contexts';
|
|
7
7
|
export { mergeThemes } from './utils';
|
|
8
|
+
export { useClient } from './hooks';
|
|
9
|
+
export type { Theme } from './schemas';
|