@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.
- package/.turbo/turbo-build.log +9 -9
- package/dist/adapters/target.d.ts +6 -1
- package/dist/components/renderers/Custom/Custom.d.ts +14 -0
- package/dist/components/renderers/Custom/index.d.ts +1 -0
- package/dist/hooks/useWebchatClient.d.ts +3 -1
- package/dist/index.js +9160 -8972
- package/dist/index.umd.cjs +86 -86
- package/dist/schemas/configuration.d.ts +3 -0
- package/dist/schemas/init.d.ts +8 -0
- package/dist/stores/customComponentsStore.d.ts +9 -0
- package/dist/stores/userStore.d.ts +5 -4
- package/dist/stories/Messages/Custom.stories.d.ts +12 -0
- package/dist/style.css +1 -1
- package/dist/styles/classes.d.ts +1 -1
- package/package.json +2 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
|
|
2
|
-
> @botpress/webchat@2.4.0-beta.
|
|
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
|
[36mvite v5.4.8 [32mbuilding for production...[36m[39m
|
|
6
6
|
transforming...
|
|
7
|
-
[1m[33m[plugin:vite:resolve][39m[22m [33m[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.
|
|
8
|
-
[32m✓[39m
|
|
7
|
+
[1m[33m[plugin:vite:resolve][39m[22m [33m[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.[39m
|
|
8
|
+
[32m✓[39m 3135 modules transformed.
|
|
9
9
|
rendering chunks...
|
|
10
10
|
|
|
11
11
|
[vite:dts] Start generate declaration files...
|
|
12
12
|
computing gzip size...
|
|
13
|
-
[2mdist/[22m[35mstyle.css [39m[1m[2m 32.
|
|
14
|
-
[2mdist/[22m[36mindex.js [39m[1m[33m1,
|
|
15
|
-
[vite:dts] Declaration files built in
|
|
13
|
+
[2mdist/[22m[35mstyle.css [39m[1m[2m 32.69 kB[22m[1m[22m[2m │ gzip: 6.26 kB[22m
|
|
14
|
+
[2mdist/[22m[36mindex.js [39m[1m[33m1,031.97 kB[39m[22m[2m │ gzip: 269.89 kB[22m
|
|
15
|
+
[vite:dts] Declaration files built in 12547ms.
|
|
16
16
|
|
|
17
|
-
[2mdist/[22m[35mstyle.css [39m[1m[2m 32.
|
|
18
|
-
[2mdist/[22m[36mindex.umd.cjs [39m[1m[
|
|
19
|
-
[32m✓ built in
|
|
17
|
+
[2mdist/[22m[35mstyle.css [39m[1m[2m 32.69 kB[22m[1m[22m[2m │ gzip: 6.26 kB[22m
|
|
18
|
+
[2mdist/[22m[36mindex.umd.cjs [39m[1m[33m707.48 kB[39m[22m[2m │ gzip: 224.86 kB[22m
|
|
19
|
+
[32m✓ built in 21.64s[39m
|
|
@@ -65,7 +65,12 @@ export type VideoMessage = {
|
|
|
65
65
|
type: 'video';
|
|
66
66
|
url: string;
|
|
67
67
|
};
|
|
68
|
-
export type
|
|
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 {};
|