@botpress/webchat 2.2.0 → 2.2.2

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,21 +1,26 @@
1
1
 
2
- > @botpress/webchat@2.2.0 build /home/runner/work/echo/echo/packages/webchat-frontend
2
+ > @botpress/webchat@2.2.2 build /home/runner/work/echo/echo/packages/webchat-frontend
3
3
  > vite build
4
4
 
5
5
  vite v4.4.11 building for production...
6
6
  transforming...
7
+ [vite:css] /home/runner/work/echo/echo/packages/webchat-frontend/src/components/renderers/Audio/styles.css is empty
8
+ 1 | @import './resets.css';
9
+ | ^
10
+ 2 | @import './theme.css';
11
+ 3 | @import '../components/index.css'
7
12
  [plugin:vite:resolve] Module "node:http" has been externalized for browser compatibility, imported by "/home/runner/work/echo/echo/node_modules/.pnpm/@botpress+sdk@0.10.13_react@18.2.0/node_modules/@botpress/sdk/dist/index.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
8
13
  [plugin:vite:resolve] Module "util" has been externalized for browser compatibility, imported by "/home/runner/work/echo/echo/node_modules/.pnpm/@botpress+sdk@0.10.13_react@18.2.0/node_modules/@botpress/sdk/dist/index.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
9
14
  [plugin:vite:resolve] Module "crypto" has been externalized for browser compatibility, imported by "/home/runner/work/echo/echo/packages/webchat-frontend/src/gen/client/errors.ts". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
10
- ✓ 2779 modules transformed.
15
+ ✓ 2763 modules transformed.
11
16
  rendering chunks...
12
17
  
13
18
  [vite:dts] Start generate declaration files...
14
19
  computing gzip size...
15
- dist/style.css  25.49 kB │ gzip: 5.21 kB
16
- dist/index.js 1,401.63 kB │ gzip: 352.59 kB
17
- [vite:dts] Declaration files built in 14199ms.
20
+ dist/style.css  26.60 kB │ gzip: 5.29 kB
21
+ dist/index.js 1,406.59 kB │ gzip: 354.04 kB
22
+ [vite:dts] Declaration files built in 15384ms.
18
23
  
19
- dist/style.css  25.49 kB │ gzip: 5.21 kB
20
- dist/index.umd.cjs 979.10 kB │ gzip: 296.21 kB
21
- ✓ built in 23.63s
24
+ dist/style.css  26.60 kB │ gzip: 5.29 kB
25
+ dist/index.umd.cjs 982.92 kB │ gzip: 297.31 kB
26
+ ✓ built in 25.44s
@@ -1,4 +1,2 @@
1
1
  /// <reference types="react" />
2
- export declare const Container: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
3
- themeOverrides: Record<`--${string}`, string>;
4
- }, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
2
+ export declare const Container: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,5 +1 @@
1
- type Props = {
2
- themeOverrides?: Record<`--${string}`, string>;
3
- };
4
- export declare const Webchat: ({ themeOverrides }: Props) => import("react/jsx-runtime").JSX.Element;
5
- export {};
1
+ export declare const Webchat: () => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,5 @@
1
- import { CSSProperties, FC, ReactNode, RefObject } from 'react';
2
- import { Theme, Configuration, BlockObjects, MessageObject, CommonBlockProps, BlockType } from '../types';
3
- import { EventEmitter, Events } from '../utils';
4
- import { WebchatClient } from '../client';
1
+ import { CSSProperties, FC } from 'react';
2
+ import { BlockObjects, CommonBlockProps, BlockType } from '../types';
5
3
  export type StyleOptions = {
6
4
  className?: string;
7
5
  style?: CSSProperties;
@@ -9,34 +7,65 @@ export type StyleOptions = {
9
7
  export type Renderers = {
10
8
  [T in BlockType]: FC<CommonBlockProps & BlockObjects[T]>;
11
9
  };
12
- export type ModalProps = {
13
- title: string | null;
14
- content: ReactNode | null;
10
+ export declare const WebchatConfigContext: import("react").Context<{
11
+ composerPlaceholder?: string | undefined;
12
+ botName?: string | undefined;
13
+ botAvatar?: string | undefined;
14
+ botDescription?: string | undefined;
15
+ website?: {
16
+ title: string;
17
+ link?: string | undefined;
18
+ } | undefined;
19
+ email?: {
20
+ title: string;
21
+ link?: string | undefined;
22
+ } | undefined;
23
+ phone?: {
24
+ title: string;
25
+ link?: string | undefined;
26
+ } | undefined;
27
+ privacyPolicy?: {
28
+ title: string;
29
+ link?: string | undefined;
30
+ } | undefined;
31
+ termsOfService?: {
32
+ title: string;
33
+ link?: string | undefined;
34
+ } | undefined;
35
+ color?: string | undefined;
36
+ variant?: "soft" | "solid" | undefined;
37
+ theme?: "light" | "dark" | undefined;
38
+ fontFamily?: "rubik" | "inter" | "ibm" | "fira" | undefined;
39
+ radius?: number | undefined;
40
+ } | null>;
41
+ export declare function useWebchatConfig(): {
42
+ composerPlaceholder?: string | undefined;
43
+ botName?: string | undefined;
44
+ botAvatar?: string | undefined;
45
+ botDescription?: string | undefined;
46
+ website?: {
47
+ title: string;
48
+ link?: string | undefined;
49
+ } | undefined;
50
+ email?: {
51
+ title: string;
52
+ link?: string | undefined;
53
+ } | undefined;
54
+ phone?: {
55
+ title: string;
56
+ link?: string | undefined;
57
+ } | undefined;
58
+ privacyPolicy?: {
59
+ title: string;
60
+ link?: string | undefined;
61
+ } | undefined;
62
+ termsOfService?: {
63
+ title: string;
64
+ link?: string | undefined;
65
+ } | undefined;
66
+ color?: string | undefined;
67
+ variant?: "soft" | "solid" | undefined;
68
+ theme?: "light" | "dark" | undefined;
69
+ fontFamily?: "rubik" | "inter" | "ibm" | "fira" | undefined;
70
+ radius?: number | undefined;
15
71
  };
16
- export type ContextVaue = {
17
- theme: Theme;
18
- messageContainerRef: RefObject<HTMLDivElement>;
19
- renderers: Renderers;
20
- messages: MessageObject[];
21
- setMessages: React.Dispatch<React.SetStateAction<MessageObject[]>>;
22
- eventEmitter: EventEmitter<Events>;
23
- configuration: Configuration;
24
- setConfiguration: React.Dispatch<React.SetStateAction<Configuration>>;
25
- state: {
26
- connected: boolean;
27
- disableComposer: boolean;
28
- /**
29
- * Disables interactions on buttons, inputs, etc.
30
- */
31
- isReadOnly?: boolean;
32
- };
33
- client?: {
34
- on: WebchatClient['on'];
35
- sendMessage: WebchatClient['sendMessage'];
36
- restartConversation: () => void;
37
- } & Pick<WebchatClient, 'userId' | 'conversationId' | 'clientId' | 'sendFile'>;
38
- closeWindow?: () => void;
39
- setState: (state: Partial<ContextVaue['state']>) => void;
40
- setTheme: (styles: Partial<Theme>) => void;
41
- };
42
- export declare const WebchatContext: import("react").Context<ContextVaue | null>;
package/dist/index.d.ts CHANGED
@@ -11,3 +11,4 @@ export * from './schemas';
11
11
  export { type WebchatClient, type WebchatEvents } from './client';
12
12
  export { getClient } from './get-client';
13
13
  export { useClient, useWebchatStore } from './hooks';
14
+ export { generateThemeStylesheet } from './utils';