@botpress/webchat 2.4.1 → 2.5.0

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,19 +1,19 @@
1
1
 
2
- > @botpress/webchat@2.4.1 build /home/runner/work/genisys/genisys/packages/webchat-components
2
+ > @botpress/webchat@2.5.0 build /home/runner/work/genisys/genisys/packages/webchat-components
3
3
  > vite build
4
4
 
5
5
  vite v5.4.8 building for production...
6
6
  transforming...
7
- [plugin:vite:resolve] [plugin vite:resolve] Module "crypto" has been externalized for browser compatibility, imported by "/home/runner/work/genisys/genisys/node_modules/.pnpm/@bpinternal+webchat-http-client@0.2.4/node_modules/@bpinternal/webchat-http-client/dist/index.mjs". See https://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
8
- ✓ 3135 modules transformed.
7
+ [plugin:vite:resolve] [plugin vite:resolve] Module "crypto" has been externalized for browser compatibility, imported by "/home/runner/work/genisys/genisys/node_modules/.pnpm/@bpinternal+webchat-http-client@0.2.5/node_modules/@bpinternal/webchat-http-client/dist/index.mjs". See https://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
8
+ ✓ 2973 modules transformed.
9
9
  rendering chunks...
10
10
 
11
11
  [vite:dts] Start generate declaration files...
12
12
  computing gzip size...
13
- dist/style.css  32.82 kB │ gzip: 6.28 kB
14
- dist/index.js 1,037.66 kB │ gzip: 271.03 kB
15
- [vite:dts] Declaration files built in 11800ms.
13
+ dist/style.css  35.95 kB │ gzip: 6.85 kB
14
+ dist/index.js 1,091.73 kB │ gzip: 282.03 kB
15
+ [vite:dts] Declaration files built in 10684ms.
16
16
 
17
- dist/style.css  32.82 kB │ gzip: 6.28 kB
18
- dist/index.umd.cjs 711.41 kB │ gzip: 225.64 kB
19
- ✓ built in 20.82s
17
+ dist/style.css  35.95 kB │ gzip: 6.85 kB
18
+ dist/index.umd.cjs 744.85 kB │ gzip: 233.89 kB
19
+ ✓ built in 18.84s
@@ -2,3 +2,4 @@ import * as types from './typings';
2
2
  import * as models from '@bpinternal/webchat-http-client';
3
3
  export type Message = models.Message['payload'];
4
4
  export type Messages = types.ByType<Message>;
5
+ export type BlocMessageItem = models.Message['payload']['items'];
@@ -1,6 +1,6 @@
1
- import { ComponentProps, type Ref } from 'react';
2
- import type { Configuration, FileType } from '../../types';
1
+ import { ComponentProps, Ref } from 'react';
3
2
  import type { Message } from '../../adapters/webchat';
3
+ import type { Configuration, FileType } from '../../types';
4
4
  type Props = ComponentProps<'div'> & {
5
5
  inputRef?: Ref<HTMLTextAreaElement>;
6
6
  disableComposer?: boolean;
@@ -0,0 +1,11 @@
1
+ import { type FC } from 'react';
2
+ import type { FileType } from '../../../types';
3
+ type FileAttachmentProps = {
4
+ name: string;
5
+ type: FileType;
6
+ instance: File;
7
+ status: string;
8
+ removeFile: (name: string) => void;
9
+ };
10
+ export declare const FileAttachment: FC<FileAttachmentProps>;
11
+ export {};
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ type FileUploaderProps = {
3
+ disabled: boolean;
4
+ onFileSelected: (file: File) => void;
5
+ };
6
+ export declare const FileInputButton: FC<FileUploaderProps>;
7
+ export {};
@@ -0,0 +1,6 @@
1
+ type SpeechRecognitionProps = {
2
+ textInput: string;
3
+ setTextInput: (value: string) => void;
4
+ };
5
+ export declare const SpeechRecognition: ({ textInput: value, setTextInput: setValue }: SpeechRecognitionProps) => import("react/jsx-runtime").JSX.Element | undefined;
6
+ export {};
@@ -0,0 +1,13 @@
1
+ import { Ref } from 'react';
2
+ type TextInputProps = {
3
+ inputRef?: Ref<HTMLTextAreaElement>;
4
+ composerPlaceholder: string | undefined;
5
+ composerDisabled: boolean;
6
+ textInput: string;
7
+ historyIndex: number;
8
+ setTextInput: (value: string) => void;
9
+ setHistoryIndex: (index: number) => void;
10
+ sendComposerMessage: () => void;
11
+ };
12
+ export declare const TextInput: ({ inputRef, composerPlaceholder, composerDisabled, textInput, historyIndex, setTextInput, setHistoryIndex, sendComposerMessage, }: TextInputProps) => import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,4 @@
1
+ export * from './FileInputButton';
2
+ export * from './FileAttachment';
3
+ export * from './TextInput';
4
+ export * from './SpeechRecognition';
@@ -1,9 +1,16 @@
1
1
  import { ComponentProps } from 'react';
2
+ import { FileType } from '../../types';
2
3
  type Props = ComponentProps<'div'> & {
3
4
  connected?: boolean;
5
+ uploadFile?: (file: File) => Promise<{
6
+ fileUrl: string;
7
+ name: string;
8
+ type: FileType;
9
+ }>;
10
+ allowFileUpload?: boolean;
4
11
  };
5
12
  export declare const Container: {
6
- ({ children, className, connected, ...props }: Props): import("react/jsx-runtime").JSX.Element;
13
+ ({ children, className, connected, uploadFile, allowFileUpload, ...props }: Props): import("react/jsx-runtime").JSX.Element;
7
14
  displayName: string;
8
15
  };
9
16
  export {};
@@ -939,19 +939,19 @@ export declare const zod: {
939
939
  data: import("zod").ZodObject<{
940
940
  visibility: import("zod").ZodUnion<[import("zod").ZodLiteral<"show">, import("zod").ZodLiteral<"hide">, import("zod").ZodLiteral<"toggle">]>;
941
941
  }, "strip", import("zod").ZodTypeAny, {
942
- visibility: "show" | "hide" | "toggle";
942
+ visibility: "toggle" | "show" | "hide";
943
943
  }, {
944
- visibility: "show" | "hide" | "toggle";
944
+ visibility: "toggle" | "show" | "hide";
945
945
  }>;
946
946
  }, "strip", import("zod").ZodTypeAny, {
947
947
  type: "webchat_visibility";
948
948
  data: {
949
- visibility: "show" | "hide" | "toggle";
949
+ visibility: "toggle" | "show" | "hide";
950
950
  };
951
951
  }, {
952
952
  type: "webchat_visibility";
953
953
  data: {
954
- visibility: "show" | "hide" | "toggle";
954
+ visibility: "toggle" | "show" | "hide";
955
955
  };
956
956
  }>;
957
957
  webchatConfig: import("zod").ZodObject<{
@@ -4,19 +4,19 @@ declare const _default: z.ZodObject<{
4
4
  data: z.ZodObject<{
5
5
  visibility: z.ZodUnion<[z.ZodLiteral<"show">, z.ZodLiteral<"hide">, z.ZodLiteral<"toggle">]>;
6
6
  }, "strip", z.ZodTypeAny, {
7
- visibility: "show" | "hide" | "toggle";
7
+ visibility: "toggle" | "show" | "hide";
8
8
  }, {
9
- visibility: "show" | "hide" | "toggle";
9
+ visibility: "toggle" | "show" | "hide";
10
10
  }>;
11
11
  }, "strip", z.ZodTypeAny, {
12
12
  type: "webchat_visibility";
13
13
  data: {
14
- visibility: "show" | "hide" | "toggle";
14
+ visibility: "toggle" | "show" | "hide";
15
15
  };
16
16
  }, {
17
17
  type: "webchat_visibility";
18
18
  data: {
19
- visibility: "show" | "hide" | "toggle";
19
+ visibility: "toggle" | "show" | "hide";
20
20
  };
21
21
  }>;
22
22
  export default _default;