@botpress/webchat 2.2.4 → 2.2.6
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 +8 -8
- package/dist/client/PushpinClient/index.d.ts +2 -2
- package/dist/client/types.d.ts +6 -5
- package/dist/contexts/WebchatContext.d.ts +4 -2
- package/dist/index.js +6452 -6383
- package/dist/index.umd.cjs +91 -91
- package/dist/schemas/configuration.d.ts +3 -0
- package/dist/schemas/init.d.ts +30 -0
- package/dist/stores/webchatStore.d.ts +2 -0
- package/dist/style.css +1 -1
- package/dist/styles/classes.d.ts +3 -3
- package/package.json +2 -2
- package/readme.md +56 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @botpress/webchat@2.2.
|
|
2
|
+
> @botpress/webchat@2.2.6 build /home/runner/work/echo/echo/packages/webchat-frontend
|
|
3
3
|
> vite build
|
|
4
4
|
|
|
5
5
|
[36mvite v4.4.11 [32mbuilding for production...[36m[39m
|
|
@@ -12,15 +12,15 @@ transforming...
|
|
|
12
12
|
[1m[33m[plugin:vite:resolve][39m[22m [33mModule "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.[39m
|
|
13
13
|
[1m[33m[plugin:vite:resolve][39m[22m [33mModule "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.[39m
|
|
14
14
|
[1m[33m[plugin:vite:resolve][39m[22m [33mModule "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.[39m
|
|
15
|
-
[32m✓[39m
|
|
15
|
+
[32m✓[39m 3174 modules transformed.
|
|
16
16
|
rendering chunks...
|
|
17
17
|
[32m
|
|
18
18
|
[36m[vite:dts][32m Start generate declaration files...[39m
|
|
19
19
|
computing gzip size...
|
|
20
|
-
[
|
|
21
|
-
[2mdist/[22m[36mindex.js [39m[1m[33m1,407.93 kB[39m[22m[2m │ gzip: 354.54 kB[22m
|
|
22
|
-
[32m[36m[vite:dts][32m Declaration files built in 16195ms.
|
|
20
|
+
[32m[36m[vite:dts][32m Declaration files built in 15280ms.
|
|
23
21
|
[39m
|
|
24
|
-
[2mdist/[22m[35mstyle.css
|
|
25
|
-
[2mdist/[22m[36mindex.
|
|
26
|
-
[
|
|
22
|
+
[2mdist/[22m[35mstyle.css [39m[1m[2m 28.87 kB[22m[1m[22m[2m │ gzip: 5.57 kB[22m
|
|
23
|
+
[2mdist/[22m[36mindex.js [39m[1m[33m1,410.48 kB[39m[22m[2m │ gzip: 355.20 kB[22m
|
|
24
|
+
[2mdist/[22m[35mstyle.css [39m[1m[2m 28.87 kB[22m[1m[22m[2m │ gzip: 5.57 kB[22m
|
|
25
|
+
[2mdist/[22m[36mindex.umd.cjs [39m[1m[33m985.33 kB[39m[22m[2m │ gzip: 298.11 kB[22m
|
|
26
|
+
[32m✓ built in 25.52s[39m
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from '../../utils';
|
|
2
|
-
import { Events, Message, UserCredentials, UserData, WebchatClient, type User } from '../types';
|
|
2
|
+
import { Events, Message, UserCredentials, UserData, UserOptions, WebchatClient, type User } from '../types';
|
|
3
3
|
import { type FileType } from '../../types';
|
|
4
4
|
export type PushpinClientProps = {
|
|
5
5
|
apiUrl: string;
|
|
@@ -22,7 +22,7 @@ export declare class PushpinClient extends EventEmitter<Events> implements Webch
|
|
|
22
22
|
}>;
|
|
23
23
|
updateUser(user: User): Promise<User>;
|
|
24
24
|
get conversationId(): string | undefined;
|
|
25
|
-
connect(creds?: UserCredentials, data?: UserData): Promise<UserCredentials | undefined>;
|
|
25
|
+
connect(creds?: UserCredentials, data?: UserData, opts?: UserOptions): Promise<UserCredentials | undefined>;
|
|
26
26
|
private _initialConnect;
|
|
27
27
|
private _reConnect;
|
|
28
28
|
disconnect(): Promise<void>;
|
package/dist/client/types.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { EventEmitter } from '../utils';
|
|
2
2
|
import { BlockObject, type FileType } from '../types/block-type';
|
|
3
|
+
import { UserProps } from '../types';
|
|
4
|
+
type SafeOmit<T, K extends keyof T> = Omit<T, K>;
|
|
3
5
|
export type UserCredentials = {
|
|
4
6
|
userId: string;
|
|
5
7
|
userToken: string;
|
|
6
8
|
};
|
|
7
|
-
export type
|
|
8
|
-
export type
|
|
9
|
-
|
|
10
|
-
};
|
|
9
|
+
export type User = UserProps;
|
|
10
|
+
export type UserData = User['data'];
|
|
11
|
+
export type UserOptions = SafeOmit<User, 'data'>;
|
|
11
12
|
export type Message = {
|
|
12
13
|
id: string;
|
|
13
14
|
conversationId: string;
|
|
@@ -46,7 +47,7 @@ export type WebchatClient = {
|
|
|
46
47
|
userId: string | undefined;
|
|
47
48
|
conversationId: string | undefined;
|
|
48
49
|
on: EventEmitter<Events>['on'];
|
|
49
|
-
connect(creds?: UserCredentials, data?: UserData): Promise<UserCredentials | undefined>;
|
|
50
|
+
connect(creds?: UserCredentials, data?: UserData, opts?: UserOptions): Promise<UserCredentials | undefined>;
|
|
50
51
|
disconnect(): Promise<void>;
|
|
51
52
|
getUser(): Promise<User>;
|
|
52
53
|
updateUser(user: User): Promise<User>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { CSSProperties, FC } from 'react';
|
|
2
|
-
import { BlockObjects,
|
|
2
|
+
import { BlockObjects, BlockType } from '../types';
|
|
3
3
|
export type StyleOptions = {
|
|
4
4
|
className?: string;
|
|
5
5
|
style?: CSSProperties;
|
|
6
6
|
};
|
|
7
7
|
export type Renderers = {
|
|
8
|
-
[T in BlockType]: FC<
|
|
8
|
+
[T in BlockType]: FC<BlockObjects[T]>;
|
|
9
9
|
};
|
|
10
10
|
export declare const WebchatConfigContext: import("react").Context<{
|
|
11
11
|
composerPlaceholder?: string | undefined;
|
|
@@ -32,6 +32,7 @@ export declare const WebchatConfigContext: import("react").Context<{
|
|
|
32
32
|
title: string;
|
|
33
33
|
link?: string | undefined;
|
|
34
34
|
} | undefined;
|
|
35
|
+
showPoweredBy?: boolean | undefined;
|
|
35
36
|
color?: string | undefined;
|
|
36
37
|
variant?: "soft" | "solid" | undefined;
|
|
37
38
|
themeMode?: "light" | "dark" | undefined;
|
|
@@ -63,6 +64,7 @@ export declare function useWebchatConfig(): {
|
|
|
63
64
|
title: string;
|
|
64
65
|
link?: string | undefined;
|
|
65
66
|
} | undefined;
|
|
67
|
+
showPoweredBy?: boolean | undefined;
|
|
66
68
|
color?: string | undefined;
|
|
67
69
|
variant?: "soft" | "solid" | undefined;
|
|
68
70
|
themeMode?: "light" | "dark" | undefined;
|