@botpress/webchat 2.4.0-beta.5 → 2.4.0-beta.7

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.0-beta.5 build /home/runner/work/genisys/genisys/packages/webchat-components
2
+ > @botpress/webchat@2.4.0-beta.7 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.3/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
- ✓ 3110 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.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.
9
9
  rendering chunks...
10
10
 
11
11
  [vite:dts] Start generate declaration files...
12
12
  computing gzip size...
13
- dist/style.css  32.68 kB │ gzip: 6.26 kB
14
- dist/index.js 1,026.69 kB │ gzip: 268.16 kB
15
- [vite:dts] Declaration files built in 11510ms.
13
+ dist/style.css  32.69 kB │ gzip: 6.26 kB
14
+ dist/index.js 1,031.97 kB │ gzip: 269.89 kB
15
+ [vite:dts] Declaration files built in 12547ms.
16
16
 
17
- dist/style.css  32.68 kB │ gzip: 6.26 kB
18
- dist/index.umd.cjs 703.80 kB │ gzip: 223.45 kB
19
- ✓ built in 20.07s
17
+ dist/style.css  32.69 kB │ gzip: 6.26 kB
18
+ dist/index.umd.cjs 707.48 kB │ gzip: 224.86 kB
19
+ ✓ built in 21.64s
@@ -65,7 +65,12 @@ export type VideoMessage = {
65
65
  type: 'video';
66
66
  url: string;
67
67
  };
68
- export type Message = AudioMessage | BubbleMessage | ButtonMessage | CarouselMessage | ColumnMessage | DropdownMessage | FileMessage | ImageMessage | LocationMessage | RowMessage | TextMessage | VideoMessage;
68
+ export type CustomMessage = {
69
+ type: 'custom';
70
+ url: string;
71
+ name: string;
72
+ };
73
+ export type Message = AudioMessage | BubbleMessage | ButtonMessage | CarouselMessage | ColumnMessage | DropdownMessage | FileMessage | ImageMessage | LocationMessage | RowMessage | TextMessage | VideoMessage | CustomMessage;
69
74
  export type BubbleOf<T extends Message> = Omit<BubbleMessage, 'block'> & {
70
75
  block: T;
71
76
  };
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { type RemoteComponentProps } from '../../../stores/customComponentsStore';
3
+ declare global {
4
+ interface Window {
5
+ RemoteComponents: Record<string, React.FC<any>>;
6
+ }
7
+ }
8
+ type CustomComponentProps = {
9
+ url: string;
10
+ name: string;
11
+ data?: any;
12
+ };
13
+ export declare const CustomComponent: ({ url, name, data, ...props }: CustomComponentProps & RemoteComponentProps) => import("react/jsx-runtime").JSX.Element | null;
14
+ export {};
@@ -0,0 +1 @@
1
+ export * from './Custom';
@@ -3,6 +3,7 @@ import { type FileType, type MessageObject } from '../types';
3
3
  import { EventEmitter } from '../utils';
4
4
  import type { Message as WebchatMessage } from '../adapters/webchat';
5
5
  import { getClient } from '../client';
6
+ import { getUseUserStore } from '../stores';
6
7
  type UserResponse = Awaited<ReturnType<Awaited<ReturnType<typeof getClient>['getUser']>>>['user'];
7
8
  type Props = {
8
9
  userKey?: string;
@@ -11,6 +12,7 @@ type Props = {
11
12
  apiUrl?: string;
12
13
  sseTimeout?: number;
13
14
  storageKey?: string;
15
+ storageLocation?: Parameters<typeof getUseUserStore>[1];
14
16
  };
15
17
  type ScopedClient = {
16
18
  sendMessage: (payload: WebchatMessage) => Promise<void>;
@@ -44,5 +46,5 @@ export type UseWebchatClientReturn = {
44
46
  user: undefined;
45
47
  isTyping: undefined;
46
48
  };
47
- export declare function useWebchatClient({ apiUrl, clientId, storageKey, ...props }: Props): UseWebchatClientReturn;
49
+ export declare function useWebchatClient({ apiUrl, clientId, storageKey, storageLocation, ...props }: Props): UseWebchatClientReturn;
48
50
  export {};