@botpress/webchat 1.0.27 → 1.0.29

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,4 +1,4 @@
1
1
  import { BlockMap, CommonBlockProps } from '../types';
2
- export declare const Block: <T extends "button" | "audio" | "video" | "image" | "text" | "row" | "location" | "column" | "file" | "bubble" | "carousel" | "dropdown">({ block, styles, ...props }: {
2
+ export declare const Block: <T extends "button" | "text" | "image" | "audio" | "video" | "file" | "location" | "column" | "row" | "bubble" | "carousel" | "dropdown">({ block, styles, ...props }: {
3
3
  block: BlockMap[T];
4
4
  } & CommonBlockProps) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const Fab: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,2 +1,10 @@
1
- import { ComponentProps } from 'react';
2
- export declare const MessageList: import("react").MemoExoticComponent<({ ...props }: ComponentProps<'ul'>) => JSX.Element>;
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,6 +1 @@
1
- import { Configuration } from '../contexts';
2
- type Props = {
3
- configuration: Configuration;
4
- };
5
- export declare const Webchat: ({ configuration }: Props) => JSX.Element;
6
- export {};
1
+ export declare const Webchat: () => JSX.Element;
@@ -1,2 +1,2 @@
1
- import { Configuration } from '../../contexts';
1
+ import { Configuration } from '../../types';
2
2
  export declare const defaultConfiguration: Configuration;
@@ -2,6 +2,7 @@ export * from './Avatar';
2
2
  export * from './Block';
3
3
  export * from './Composer';
4
4
  export * from './Container';
5
+ export * from './Fab';
5
6
  export * from './Header';
6
7
  export * from './LoadingIndicator';
7
8
  export * from './Message';
@@ -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 {};
@@ -1,3 +1,4 @@
1
1
  export * from './useImageSize';
2
2
  export * from './useWebchatStore';
3
3
  export * from './useRefresh.ts';
4
+ export * from './useClient.ts';
@@ -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';