@botpress/webchat 1.3.13 → 2.1.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,16 +1,5 @@
1
- import { ComponentProps, ReactNode } from 'react';
2
- import { type WebchatClient } from '../client';
3
- import { ContextVaue, Renderers, WebchatContext } from '../contexts';
4
- import { Theme, Configuration } from '../types';
5
- type Props = {
6
- theme?: Theme;
7
- renderers?: Renderers;
8
- client?: WebchatClient;
9
- configuration?: Configuration;
10
- defaultState?: Partial<ContextVaue['state']>;
11
- children?: ReactNode | ((configuration: Configuration) => ReactNode);
12
- userData?: Record<string, unknown>;
13
- closeWindow?: () => void;
14
- } & Omit<ComponentProps<typeof WebchatContext.Provider>, 'value' | 'children'>;
15
- export declare const WebchatProvider: ({ theme: initialTheme, renderers, client, children, configuration, userData, closeWindow, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
1
+ /// <reference types="react" />
2
+ import { type WebchatProps } from '../stores';
3
+ type WebchatProviderProps = Partial<React.PropsWithChildren<WebchatProps>>;
4
+ export declare const WebchatProvider: ({ children, ...props }: WebchatProviderProps) => import("react/jsx-runtime").JSX.Element;
16
5
  export {};
@@ -1184,6 +1184,46 @@ export declare const configPropsSchema: z.ZodObject<{
1184
1184
  className?: string | undefined;
1185
1185
  style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1186
1186
  }>>;
1187
+ uploadButton: z.ZodOptional<z.ZodObject<{
1188
+ container: z.ZodOptional<z.ZodObject<{
1189
+ className: z.ZodOptional<z.ZodString>;
1190
+ style: z.ZodOptional<z.ZodEffects<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, import("react").CSSProperties, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
1191
+ }, "strip", z.ZodTypeAny, {
1192
+ className?: string | undefined;
1193
+ style?: import("react").CSSProperties | undefined;
1194
+ }, {
1195
+ className?: string | undefined;
1196
+ style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1197
+ }>>;
1198
+ icon: z.ZodOptional<z.ZodObject<{
1199
+ className: z.ZodOptional<z.ZodString>;
1200
+ style: z.ZodOptional<z.ZodEffects<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, import("react").CSSProperties, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
1201
+ }, "strip", z.ZodTypeAny, {
1202
+ className?: string | undefined;
1203
+ style?: import("react").CSSProperties | undefined;
1204
+ }, {
1205
+ className?: string | undefined;
1206
+ style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1207
+ }>>;
1208
+ }, "strip", z.ZodTypeAny, {
1209
+ container?: {
1210
+ className?: string | undefined;
1211
+ style?: import("react").CSSProperties | undefined;
1212
+ } | undefined;
1213
+ icon?: {
1214
+ className?: string | undefined;
1215
+ style?: import("react").CSSProperties | undefined;
1216
+ } | undefined;
1217
+ }, {
1218
+ container?: {
1219
+ className?: string | undefined;
1220
+ style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1221
+ } | undefined;
1222
+ icon?: {
1223
+ className?: string | undefined;
1224
+ style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1225
+ } | undefined;
1226
+ }>>;
1187
1227
  button: z.ZodOptional<z.ZodObject<{
1188
1228
  container: z.ZodOptional<z.ZodObject<{
1189
1229
  className: z.ZodOptional<z.ZodString>;
@@ -1233,6 +1273,16 @@ export declare const configPropsSchema: z.ZodObject<{
1233
1273
  className?: string | undefined;
1234
1274
  style?: import("react").CSSProperties | undefined;
1235
1275
  } | undefined;
1276
+ uploadButton?: {
1277
+ container?: {
1278
+ className?: string | undefined;
1279
+ style?: import("react").CSSProperties | undefined;
1280
+ } | undefined;
1281
+ icon?: {
1282
+ className?: string | undefined;
1283
+ style?: import("react").CSSProperties | undefined;
1284
+ } | undefined;
1285
+ } | undefined;
1236
1286
  button?: {
1237
1287
  container?: {
1238
1288
  className?: string | undefined;
@@ -1252,6 +1302,16 @@ export declare const configPropsSchema: z.ZodObject<{
1252
1302
  className?: string | undefined;
1253
1303
  style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1254
1304
  } | undefined;
1305
+ uploadButton?: {
1306
+ container?: {
1307
+ className?: string | undefined;
1308
+ style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1309
+ } | undefined;
1310
+ icon?: {
1311
+ className?: string | undefined;
1312
+ style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1313
+ } | undefined;
1314
+ } | undefined;
1255
1315
  button?: {
1256
1316
  container?: {
1257
1317
  className?: string | undefined;
@@ -2997,6 +3057,16 @@ export declare const configPropsSchema: z.ZodObject<{
2997
3057
  className?: string | undefined;
2998
3058
  style?: import("react").CSSProperties | undefined;
2999
3059
  } | undefined;
3060
+ uploadButton?: {
3061
+ container?: {
3062
+ className?: string | undefined;
3063
+ style?: import("react").CSSProperties | undefined;
3064
+ } | undefined;
3065
+ icon?: {
3066
+ className?: string | undefined;
3067
+ style?: import("react").CSSProperties | undefined;
3068
+ } | undefined;
3069
+ } | undefined;
3000
3070
  button?: {
3001
3071
  container?: {
3002
3072
  className?: string | undefined;
@@ -3408,6 +3478,16 @@ export declare const configPropsSchema: z.ZodObject<{
3408
3478
  className?: string | undefined;
3409
3479
  style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
3410
3480
  } | undefined;
3481
+ uploadButton?: {
3482
+ container?: {
3483
+ className?: string | undefined;
3484
+ style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
3485
+ } | undefined;
3486
+ icon?: {
3487
+ className?: string | undefined;
3488
+ style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
3489
+ } | undefined;
3490
+ } | undefined;
3411
3491
  button?: {
3412
3492
  container?: {
3413
3493
  className?: string | undefined;
@@ -3855,6 +3935,16 @@ export declare const configPropsSchema: z.ZodObject<{
3855
3935
  className?: string | undefined;
3856
3936
  style?: import("react").CSSProperties | undefined;
3857
3937
  } | undefined;
3938
+ uploadButton?: {
3939
+ container?: {
3940
+ className?: string | undefined;
3941
+ style?: import("react").CSSProperties | undefined;
3942
+ } | undefined;
3943
+ icon?: {
3944
+ className?: string | undefined;
3945
+ style?: import("react").CSSProperties | undefined;
3946
+ } | undefined;
3947
+ } | undefined;
3858
3948
  button?: {
3859
3949
  container?: {
3860
3950
  className?: string | undefined;
@@ -5279,6 +5369,46 @@ export declare const initPropsSchema: z.ZodObject<{
5279
5369
  className?: string | undefined;
5280
5370
  style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
5281
5371
  }>>;
5372
+ uploadButton: z.ZodOptional<z.ZodObject<{
5373
+ container: z.ZodOptional<z.ZodObject<{
5374
+ className: z.ZodOptional<z.ZodString>;
5375
+ style: z.ZodOptional<z.ZodEffects<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, import("react").CSSProperties, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
5376
+ }, "strip", z.ZodTypeAny, {
5377
+ className?: string | undefined;
5378
+ style?: import("react").CSSProperties | undefined;
5379
+ }, {
5380
+ className?: string | undefined;
5381
+ style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
5382
+ }>>;
5383
+ icon: z.ZodOptional<z.ZodObject<{
5384
+ className: z.ZodOptional<z.ZodString>;
5385
+ style: z.ZodOptional<z.ZodEffects<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, import("react").CSSProperties, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
5386
+ }, "strip", z.ZodTypeAny, {
5387
+ className?: string | undefined;
5388
+ style?: import("react").CSSProperties | undefined;
5389
+ }, {
5390
+ className?: string | undefined;
5391
+ style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
5392
+ }>>;
5393
+ }, "strip", z.ZodTypeAny, {
5394
+ container?: {
5395
+ className?: string | undefined;
5396
+ style?: import("react").CSSProperties | undefined;
5397
+ } | undefined;
5398
+ icon?: {
5399
+ className?: string | undefined;
5400
+ style?: import("react").CSSProperties | undefined;
5401
+ } | undefined;
5402
+ }, {
5403
+ container?: {
5404
+ className?: string | undefined;
5405
+ style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
5406
+ } | undefined;
5407
+ icon?: {
5408
+ className?: string | undefined;
5409
+ style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
5410
+ } | undefined;
5411
+ }>>;
5282
5412
  button: z.ZodOptional<z.ZodObject<{
5283
5413
  container: z.ZodOptional<z.ZodObject<{
5284
5414
  className: z.ZodOptional<z.ZodString>;
@@ -5328,6 +5458,16 @@ export declare const initPropsSchema: z.ZodObject<{
5328
5458
  className?: string | undefined;
5329
5459
  style?: import("react").CSSProperties | undefined;
5330
5460
  } | undefined;
5461
+ uploadButton?: {
5462
+ container?: {
5463
+ className?: string | undefined;
5464
+ style?: import("react").CSSProperties | undefined;
5465
+ } | undefined;
5466
+ icon?: {
5467
+ className?: string | undefined;
5468
+ style?: import("react").CSSProperties | undefined;
5469
+ } | undefined;
5470
+ } | undefined;
5331
5471
  button?: {
5332
5472
  container?: {
5333
5473
  className?: string | undefined;
@@ -5347,6 +5487,16 @@ export declare const initPropsSchema: z.ZodObject<{
5347
5487
  className?: string | undefined;
5348
5488
  style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
5349
5489
  } | undefined;
5490
+ uploadButton?: {
5491
+ container?: {
5492
+ className?: string | undefined;
5493
+ style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
5494
+ } | undefined;
5495
+ icon?: {
5496
+ className?: string | undefined;
5497
+ style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
5498
+ } | undefined;
5499
+ } | undefined;
5350
5500
  button?: {
5351
5501
  container?: {
5352
5502
  className?: string | undefined;
@@ -7092,6 +7242,16 @@ export declare const initPropsSchema: z.ZodObject<{
7092
7242
  className?: string | undefined;
7093
7243
  style?: import("react").CSSProperties | undefined;
7094
7244
  } | undefined;
7245
+ uploadButton?: {
7246
+ container?: {
7247
+ className?: string | undefined;
7248
+ style?: import("react").CSSProperties | undefined;
7249
+ } | undefined;
7250
+ icon?: {
7251
+ className?: string | undefined;
7252
+ style?: import("react").CSSProperties | undefined;
7253
+ } | undefined;
7254
+ } | undefined;
7095
7255
  button?: {
7096
7256
  container?: {
7097
7257
  className?: string | undefined;
@@ -7503,6 +7663,16 @@ export declare const initPropsSchema: z.ZodObject<{
7503
7663
  className?: string | undefined;
7504
7664
  style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
7505
7665
  } | undefined;
7666
+ uploadButton?: {
7667
+ container?: {
7668
+ className?: string | undefined;
7669
+ style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
7670
+ } | undefined;
7671
+ icon?: {
7672
+ className?: string | undefined;
7673
+ style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
7674
+ } | undefined;
7675
+ } | undefined;
7506
7676
  button?: {
7507
7677
  container?: {
7508
7678
  className?: string | undefined;
@@ -7961,6 +8131,16 @@ export declare const initPropsSchema: z.ZodObject<{
7961
8131
  className?: string | undefined;
7962
8132
  style?: import("react").CSSProperties | undefined;
7963
8133
  } | undefined;
8134
+ uploadButton?: {
8135
+ container?: {
8136
+ className?: string | undefined;
8137
+ style?: import("react").CSSProperties | undefined;
8138
+ } | undefined;
8139
+ icon?: {
8140
+ className?: string | undefined;
8141
+ style?: import("react").CSSProperties | undefined;
8142
+ } | undefined;
8143
+ } | undefined;
7964
8144
  button?: {
7965
8145
  container?: {
7966
8146
  className?: string | undefined;
@@ -1814,6 +1814,46 @@ export declare const themeSchema: z.ZodObject<{
1814
1814
  className?: string | undefined;
1815
1815
  style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1816
1816
  }>>;
1817
+ uploadButton: z.ZodOptional<z.ZodObject<{
1818
+ container: z.ZodOptional<z.ZodObject<{
1819
+ className: z.ZodOptional<z.ZodString>;
1820
+ style: z.ZodOptional<z.ZodEffects<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, CSSProperties, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
1821
+ }, "strip", z.ZodTypeAny, {
1822
+ className?: string | undefined;
1823
+ style?: CSSProperties | undefined;
1824
+ }, {
1825
+ className?: string | undefined;
1826
+ style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1827
+ }>>;
1828
+ icon: z.ZodOptional<z.ZodObject<{
1829
+ className: z.ZodOptional<z.ZodString>;
1830
+ style: z.ZodOptional<z.ZodEffects<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, CSSProperties, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
1831
+ }, "strip", z.ZodTypeAny, {
1832
+ className?: string | undefined;
1833
+ style?: CSSProperties | undefined;
1834
+ }, {
1835
+ className?: string | undefined;
1836
+ style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1837
+ }>>;
1838
+ }, "strip", z.ZodTypeAny, {
1839
+ container?: {
1840
+ className?: string | undefined;
1841
+ style?: CSSProperties | undefined;
1842
+ } | undefined;
1843
+ icon?: {
1844
+ className?: string | undefined;
1845
+ style?: CSSProperties | undefined;
1846
+ } | undefined;
1847
+ }, {
1848
+ container?: {
1849
+ className?: string | undefined;
1850
+ style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1851
+ } | undefined;
1852
+ icon?: {
1853
+ className?: string | undefined;
1854
+ style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1855
+ } | undefined;
1856
+ }>>;
1817
1857
  button: z.ZodOptional<z.ZodObject<{
1818
1858
  container: z.ZodOptional<z.ZodObject<{
1819
1859
  className: z.ZodOptional<z.ZodString>;
@@ -1863,6 +1903,16 @@ export declare const themeSchema: z.ZodObject<{
1863
1903
  className?: string | undefined;
1864
1904
  style?: CSSProperties | undefined;
1865
1905
  } | undefined;
1906
+ uploadButton?: {
1907
+ container?: {
1908
+ className?: string | undefined;
1909
+ style?: CSSProperties | undefined;
1910
+ } | undefined;
1911
+ icon?: {
1912
+ className?: string | undefined;
1913
+ style?: CSSProperties | undefined;
1914
+ } | undefined;
1915
+ } | undefined;
1866
1916
  button?: {
1867
1917
  container?: {
1868
1918
  className?: string | undefined;
@@ -1882,6 +1932,16 @@ export declare const themeSchema: z.ZodObject<{
1882
1932
  className?: string | undefined;
1883
1933
  style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1884
1934
  } | undefined;
1935
+ uploadButton?: {
1936
+ container?: {
1937
+ className?: string | undefined;
1938
+ style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1939
+ } | undefined;
1940
+ icon?: {
1941
+ className?: string | undefined;
1942
+ style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1943
+ } | undefined;
1944
+ } | undefined;
1885
1945
  button?: {
1886
1946
  container?: {
1887
1947
  className?: string | undefined;
@@ -3627,6 +3687,16 @@ export declare const themeSchema: z.ZodObject<{
3627
3687
  className?: string | undefined;
3628
3688
  style?: CSSProperties | undefined;
3629
3689
  } | undefined;
3690
+ uploadButton?: {
3691
+ container?: {
3692
+ className?: string | undefined;
3693
+ style?: CSSProperties | undefined;
3694
+ } | undefined;
3695
+ icon?: {
3696
+ className?: string | undefined;
3697
+ style?: CSSProperties | undefined;
3698
+ } | undefined;
3699
+ } | undefined;
3630
3700
  button?: {
3631
3701
  container?: {
3632
3702
  className?: string | undefined;
@@ -4038,6 +4108,16 @@ export declare const themeSchema: z.ZodObject<{
4038
4108
  className?: string | undefined;
4039
4109
  style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
4040
4110
  } | undefined;
4111
+ uploadButton?: {
4112
+ container?: {
4113
+ className?: string | undefined;
4114
+ style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
4115
+ } | undefined;
4116
+ icon?: {
4117
+ className?: string | undefined;
4118
+ style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
4119
+ } | undefined;
4120
+ } | undefined;
4041
4121
  button?: {
4042
4122
  container?: {
4043
4123
  className?: string | undefined;
@@ -0,0 +1,2 @@
1
+ export * from './offlineStore';
2
+ export * from './webchatStore';
@@ -0,0 +1,33 @@
1
+ import { UserCredentials } from '@botpress/messaging-socket';
2
+ type OfflineStore = {
3
+ messageHistory: {
4
+ [key: string]: string[];
5
+ };
6
+ user?: UserCredentials;
7
+ conversationId?: string;
8
+ clientMode: string;
9
+ addMessageToHistory: (props: {
10
+ userId: string;
11
+ message: string;
12
+ }) => void;
13
+ setClientMode: (clientMode: string) => void;
14
+ setUser: (userId?: UserCredentials) => void;
15
+ setConversationId: (conversationId?: string) => void;
16
+ clearAll: () => void;
17
+ };
18
+ export declare const useOfflineStore: import("zustand").UseBoundStore<Omit<Omit<import("zustand").StoreApi<OfflineStore>, "setState"> & {
19
+ setState<A extends string | {
20
+ type: unknown;
21
+ }>(partial: OfflineStore | Partial<OfflineStore> | ((state: OfflineStore) => OfflineStore | Partial<OfflineStore>), replace?: boolean | undefined, action?: A | undefined): void;
22
+ }, "persist"> & {
23
+ persist: {
24
+ setOptions: (options: Partial<import("zustand/middleware").PersistOptions<OfflineStore, OfflineStore>>) => void;
25
+ clearStorage: () => void;
26
+ rehydrate: () => void | Promise<void>;
27
+ hasHydrated: () => boolean;
28
+ onHydrate: (fn: (state: OfflineStore) => void) => () => void;
29
+ onFinishHydration: (fn: (state: OfflineStore) => void) => () => void;
30
+ getOptions: () => Partial<import("zustand/middleware").PersistOptions<OfflineStore, OfflineStore>>;
31
+ };
32
+ }>;
33
+ export {};
@@ -0,0 +1,46 @@
1
+ import { type RefObject } from 'react';
2
+ import type { Configuration, MessageObject, Theme } from '../types';
3
+ import type { Renderers } from '../contexts';
4
+ import type { WebchatClient } from '../client';
5
+ import { type EventEmitter, type Events } from '../utils';
6
+ export type WebchatProps = {
7
+ theme: Theme;
8
+ renderers: Partial<Renderers>;
9
+ client?: WebchatClient;
10
+ configuration: Configuration;
11
+ messages: MessageObject[];
12
+ connected: boolean;
13
+ disableComposer: boolean;
14
+ isReadOnly: boolean;
15
+ isTyping: boolean;
16
+ allowFileUpload: boolean;
17
+ userData: Record<string, unknown>;
18
+ messageContainerRef: RefObject<HTMLDivElement>;
19
+ closeWindow?: () => void;
20
+ };
21
+ export type WebchatState = WebchatProps & {
22
+ setState: (newState: Partial<WebchatState>) => void;
23
+ setTheme: (theme: Partial<Theme>) => void;
24
+ setMessages: (messages: MessageObject[]) => void;
25
+ addMessage: (message: MessageObject) => void;
26
+ sendTextMessage: (message: string) => void;
27
+ sendFile: WebchatClient['sendFile'];
28
+ on: WebchatClient['on'];
29
+ setConfiguration: (config: Configuration) => void;
30
+ setConnected: (connected: boolean) => void;
31
+ setIsTyping: (isTyping: boolean) => void;
32
+ restartConversation: () => void;
33
+ getClientId: () => string | undefined;
34
+ eventEmitter: EventEmitter<Events>;
35
+ };
36
+ export type WebchatStore = ReturnType<typeof createWebchatStore>;
37
+ export declare const WebchatContext: import("react").Context<(Omit<import("zustand").StoreApi<WebchatState>, "setState"> & {
38
+ setState<A extends string | {
39
+ type: unknown;
40
+ }>(partial: WebchatState | Partial<WebchatState> | ((state: WebchatState) => WebchatState | Partial<WebchatState>), replace?: boolean | undefined, action?: A | undefined): void;
41
+ }) | null>;
42
+ export declare const createWebchatStore: (initProps?: Partial<WebchatProps>) => Omit<import("zustand").StoreApi<WebchatState>, "setState"> & {
43
+ setState<A extends string | {
44
+ type: unknown;
45
+ }>(partial: WebchatState | Partial<WebchatState> | ((state: WebchatState) => WebchatState | Partial<WebchatState>), replace?: boolean | undefined, action?: A | undefined): void;
46
+ };
@@ -34,3 +34,6 @@ export type BlockObjects = {
34
34
  type: T;
35
35
  }>;
36
36
  };
37
+ export declare const fileTypes: readonly ["audio", "file", "image", "video"];
38
+ export type FileType = (typeof fileTypes)[number];
39
+ export declare const isFileType: (type: string) => type is "image" | "audio" | "video" | "file";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botpress/webchat",
3
- "version": "1.3.13",
3
+ "version": "2.1.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.umd.cjs",
@@ -13,7 +13,7 @@
13
13
  }
14
14
  },
15
15
  "scripts": {
16
- "type:check": "tsc --noEmit",
16
+ "check:type": "tsc --noEmit",
17
17
  "build": "vite build",
18
18
  "test": "vitest run",
19
19
  "gen:client": "OUT_DIR=./src/gen es-node ./openapi"
@@ -27,6 +27,7 @@
27
27
  "@radix-ui/react-collapsible": "^1.0.3",
28
28
  "@radix-ui/react-dialog": "^1.0.4",
29
29
  "@radix-ui/react-scroll-area": "^1.0.5",
30
+ "@redux-devtools/extension": "^3.3.0",
30
31
  "@types/qs": "^6.9.8",
31
32
  "axios": "1.2.5",
32
33
  "clsx": "^2.0.0",