@botpress/webchat 1.0.30 → 1.0.32

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.
Files changed (46) hide show
  1. package/dist/App.d.ts +1 -0
  2. package/dist/client/ChatClient/index.d.ts +0 -1
  3. package/dist/client/MessagingClient/adapters/Trigger.d.ts +33 -0
  4. package/dist/client/MessagingClient/client.d.ts +4 -9
  5. package/dist/client/types.d.ts +1 -0
  6. package/dist/components/Block.d.ts +1 -1
  7. package/dist/components/renderers/Audio.d.ts +2 -2
  8. package/dist/components/renderers/Carousel.d.ts +2 -2
  9. package/dist/components/renderers/File.d.ts +2 -2
  10. package/dist/components/renderers/Image.d.ts +2 -2
  11. package/dist/components/renderers/Location.d.ts +2 -2
  12. package/dist/components/renderers/Video.d.ts +2 -2
  13. package/dist/contexts/WebchatContext.d.ts +1 -0
  14. package/dist/hooks/useClient.d.ts +2 -2
  15. package/dist/index.js +77029 -27834
  16. package/dist/index.umd.cjs +147 -387
  17. package/dist/schemas/theme.d.ts +8 -8
  18. package/dist/themes/base.d.ts +1 -0
  19. package/dist/themes/baseColors.d.ts +736 -0
  20. package/dist/themes/dawn.d.ts +3 -1
  21. package/dist/themes/eggplant.d.ts +3 -1
  22. package/dist/themes/index.d.ts +0 -3
  23. package/dist/themes/prism.d.ts +3 -1
  24. package/dist/themes/themeBuilder.d.ts +27 -0
  25. package/dist/types/block-type.d.ts +14 -68
  26. package/dist/utils/index.d.ts +0 -1
  27. package/dist/utils/withBaseTheme.d.ts +1 -1
  28. package/package.json +12 -9
  29. package/dist/client/MessagingClient/adapters/Audio.d.ts +0 -19
  30. package/dist/client/MessagingClient/adapters/Card.d.ts +0 -188
  31. package/dist/client/MessagingClient/adapters/Carousel.d.ts +0 -147
  32. package/dist/client/MessagingClient/adapters/Choice.d.ts +0 -45
  33. package/dist/client/MessagingClient/adapters/Dropdown.d.ts +0 -46
  34. package/dist/client/MessagingClient/adapters/File.d.ts +0 -19
  35. package/dist/client/MessagingClient/adapters/Image.d.ts +0 -19
  36. package/dist/client/MessagingClient/adapters/Location.d.ts +0 -27
  37. package/dist/client/MessagingClient/adapters/Message.d.ts +0 -433
  38. package/dist/client/MessagingClient/adapters/Text.d.ts +0 -20
  39. package/dist/client/MessagingClient/adapters/Utils.d.ts +0 -5
  40. package/dist/client/MessagingClient/adapters/Video.d.ts +0 -19
  41. package/dist/client/MessagingClient/adapters/Voice.d.ts +0 -15
  42. package/dist/client/MessagingClient/adapters/index.d.ts +0 -12
  43. package/dist/themes/dusk.d.ts +0 -2
  44. package/dist/themes/galaxy.d.ts +0 -2
  45. package/dist/themes/midnight.d.ts +0 -2
  46. package/dist/utils/colors.d.ts +0 -18
@@ -1,19 +0,0 @@
1
- import { z } from 'zod';
2
- import { FileBlock } from '../../../types';
3
- export declare const FileSchema: z.ZodEffects<z.ZodObject<{
4
- type: z.ZodLiteral<"file">;
5
- file: z.ZodString;
6
- title: z.ZodOptional<z.ZodString>;
7
- }, "strip", z.ZodTypeAny, {
8
- file: string;
9
- type: "file";
10
- title?: string | undefined;
11
- }, {
12
- file: string;
13
- type: "file";
14
- title?: string | undefined;
15
- }>, FileBlock, {
16
- file: string;
17
- type: "file";
18
- title?: string | undefined;
19
- }>;
@@ -1,19 +0,0 @@
1
- import { z } from 'zod';
2
- import { ImageBlock } from '../../../types';
3
- export declare const ImageSchema: z.ZodEffects<z.ZodObject<{
4
- type: z.ZodLiteral<"image">;
5
- image: z.ZodString;
6
- title: z.ZodOptional<z.ZodString>;
7
- }, "strip", z.ZodTypeAny, {
8
- image: string;
9
- type: "image";
10
- title?: string | undefined;
11
- }, {
12
- image: string;
13
- type: "image";
14
- title?: string | undefined;
15
- }>, ImageBlock, {
16
- image: string;
17
- type: "image";
18
- title?: string | undefined;
19
- }>;
@@ -1,27 +0,0 @@
1
- import { z } from 'zod';
2
- import { LocationBlock } from '../../../types';
3
- export declare const LocationSchema: z.ZodEffects<z.ZodObject<{
4
- type: z.ZodLiteral<"location">;
5
- latitude: z.ZodNumber;
6
- longitude: z.ZodNumber;
7
- address: z.ZodOptional<z.ZodString>;
8
- title: z.ZodOptional<z.ZodString>;
9
- }, "strip", z.ZodTypeAny, {
10
- type: "location";
11
- latitude: number;
12
- longitude: number;
13
- address?: string | undefined;
14
- title?: string | undefined;
15
- }, {
16
- type: "location";
17
- latitude: number;
18
- longitude: number;
19
- address?: string | undefined;
20
- title?: string | undefined;
21
- }>, LocationBlock, {
22
- type: "location";
23
- latitude: number;
24
- longitude: number;
25
- address?: string | undefined;
26
- title?: string | undefined;
27
- }>;
@@ -1,433 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const MessageContentSchema: z.ZodUnion<[z.ZodEffects<z.ZodObject<{
3
- type: z.ZodLiteral<"text">;
4
- text: z.ZodString;
5
- markdown: z.ZodOptional<z.ZodBoolean>;
6
- }, "strip", z.ZodTypeAny, {
7
- text: string;
8
- type: "text";
9
- markdown?: boolean | undefined;
10
- }, {
11
- text: string;
12
- type: "text";
13
- markdown?: boolean | undefined;
14
- }>, import("./Utils.ts").WithBubble<import("../../../index.ts").TextBlock>, {
15
- text: string;
16
- type: "text";
17
- markdown?: boolean | undefined;
18
- }>, z.ZodEffects<z.ZodObject<{
19
- type: z.ZodLiteral<"image">;
20
- image: z.ZodString;
21
- title: z.ZodOptional<z.ZodString>;
22
- }, "strip", z.ZodTypeAny, {
23
- image: string;
24
- type: "image";
25
- title?: string | undefined;
26
- }, {
27
- image: string;
28
- type: "image";
29
- title?: string | undefined;
30
- }>, import("../../../index.ts").ImageBlock, {
31
- image: string;
32
- type: "image";
33
- title?: string | undefined;
34
- }>, z.ZodEffects<z.ZodObject<{
35
- type: z.ZodLiteral<"audio">;
36
- audio: z.ZodString;
37
- title: z.ZodOptional<z.ZodString>;
38
- }, "strip", z.ZodTypeAny, {
39
- audio: string;
40
- type: "audio";
41
- title?: string | undefined;
42
- }, {
43
- audio: string;
44
- type: "audio";
45
- title?: string | undefined;
46
- }>, import("../../../index.ts").AudioBlock, {
47
- audio: string;
48
- type: "audio";
49
- title?: string | undefined;
50
- }>, z.ZodEffects<z.ZodObject<{
51
- type: z.ZodLiteral<"video">;
52
- video: z.ZodString;
53
- title: z.ZodOptional<z.ZodString>;
54
- }, "strip", z.ZodTypeAny, {
55
- video: string;
56
- type: "video";
57
- title?: string | undefined;
58
- }, {
59
- video: string;
60
- type: "video";
61
- title?: string | undefined;
62
- }>, import("../../../index.ts").VideoBlock, {
63
- video: string;
64
- type: "video";
65
- title?: string | undefined;
66
- }>, z.ZodEffects<z.ZodObject<{
67
- type: z.ZodLiteral<"carousel">;
68
- items: z.ZodArray<z.ZodEffects<z.ZodObject<Omit<{
69
- type: z.ZodLiteral<"card">;
70
- title: z.ZodOptional<z.ZodString>;
71
- subtitle: z.ZodOptional<z.ZodString>;
72
- image: z.ZodOptional<z.ZodString>;
73
- actions: z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodObject<{
74
- title: z.ZodString;
75
- action: z.ZodLiteral<"Say something">;
76
- text: z.ZodString;
77
- }, "strip", z.ZodTypeAny, {
78
- text: string;
79
- title: string;
80
- action: "Say something";
81
- }, {
82
- text: string;
83
- title: string;
84
- action: "Say something";
85
- }>, import("../../../index.ts").ButtonBlock, {
86
- text: string;
87
- title: string;
88
- action: "Say something";
89
- }>, z.ZodEffects<z.ZodObject<{
90
- title: z.ZodString;
91
- action: z.ZodLiteral<"Open URL">;
92
- url: z.ZodString;
93
- }, "strip", z.ZodTypeAny, {
94
- title: string;
95
- action: "Open URL";
96
- url: string;
97
- }, {
98
- title: string;
99
- action: "Open URL";
100
- url: string;
101
- }>, import("../../../index.ts").ButtonBlock, {
102
- title: string;
103
- action: "Open URL";
104
- url: string;
105
- }>, z.ZodEffects<z.ZodObject<{
106
- title: z.ZodString;
107
- action: z.ZodLiteral<"Postback">;
108
- payload: z.ZodString;
109
- }, "strip", z.ZodTypeAny, {
110
- title: string;
111
- action: "Postback";
112
- payload: string;
113
- }, {
114
- title: string;
115
- action: "Postback";
116
- payload: string;
117
- }>, import("../../../index.ts").ButtonBlock, {
118
- title: string;
119
- action: "Postback";
120
- payload: string;
121
- }>]>, "many">;
122
- }, "type">, "strip", z.ZodTypeAny, {
123
- actions: import("../../../index.ts").ButtonBlock[];
124
- image?: string | undefined;
125
- title?: string | undefined;
126
- subtitle?: string | undefined;
127
- }, {
128
- actions: ({
129
- text: string;
130
- title: string;
131
- action: "Say something";
132
- } | {
133
- title: string;
134
- action: "Open URL";
135
- url: string;
136
- } | {
137
- title: string;
138
- action: "Postback";
139
- payload: string;
140
- })[];
141
- image?: string | undefined;
142
- title?: string | undefined;
143
- subtitle?: string | undefined;
144
- }>, import("./Card").CardBlockType, {
145
- actions: ({
146
- text: string;
147
- title: string;
148
- action: "Say something";
149
- } | {
150
- title: string;
151
- action: "Open URL";
152
- url: string;
153
- } | {
154
- title: string;
155
- action: "Postback";
156
- payload: string;
157
- })[];
158
- image?: string | undefined;
159
- title?: string | undefined;
160
- subtitle?: string | undefined;
161
- }>, "many">;
162
- }, "strip", z.ZodTypeAny, {
163
- type: "carousel";
164
- items: import("./Card").CardBlockType[];
165
- }, {
166
- type: "carousel";
167
- items: {
168
- actions: ({
169
- text: string;
170
- title: string;
171
- action: "Say something";
172
- } | {
173
- title: string;
174
- action: "Open URL";
175
- url: string;
176
- } | {
177
- title: string;
178
- action: "Postback";
179
- payload: string;
180
- })[];
181
- image?: string | undefined;
182
- title?: string | undefined;
183
- subtitle?: string | undefined;
184
- }[];
185
- }>, {
186
- blocks: import("./Card").CardBlockType[];
187
- } & Omit<import("../../../index.ts").CarouselBlock, "blocks">, {
188
- type: "carousel";
189
- items: {
190
- actions: ({
191
- text: string;
192
- title: string;
193
- action: "Say something";
194
- } | {
195
- title: string;
196
- action: "Open URL";
197
- url: string;
198
- } | {
199
- title: string;
200
- action: "Postback";
201
- payload: string;
202
- })[];
203
- image?: string | undefined;
204
- title?: string | undefined;
205
- subtitle?: string | undefined;
206
- }[];
207
- }>, z.ZodEffects<z.ZodObject<{
208
- type: z.ZodLiteral<"card">;
209
- title: z.ZodOptional<z.ZodString>;
210
- subtitle: z.ZodOptional<z.ZodString>;
211
- image: z.ZodOptional<z.ZodString>;
212
- actions: z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodObject<{
213
- title: z.ZodString;
214
- action: z.ZodLiteral<"Say something">;
215
- text: z.ZodString;
216
- }, "strip", z.ZodTypeAny, {
217
- text: string;
218
- title: string;
219
- action: "Say something";
220
- }, {
221
- text: string;
222
- title: string;
223
- action: "Say something";
224
- }>, import("../../../index.ts").ButtonBlock, {
225
- text: string;
226
- title: string;
227
- action: "Say something";
228
- }>, z.ZodEffects<z.ZodObject<{
229
- title: z.ZodString;
230
- action: z.ZodLiteral<"Open URL">;
231
- url: z.ZodString;
232
- }, "strip", z.ZodTypeAny, {
233
- title: string;
234
- action: "Open URL";
235
- url: string;
236
- }, {
237
- title: string;
238
- action: "Open URL";
239
- url: string;
240
- }>, import("../../../index.ts").ButtonBlock, {
241
- title: string;
242
- action: "Open URL";
243
- url: string;
244
- }>, z.ZodEffects<z.ZodObject<{
245
- title: z.ZodString;
246
- action: z.ZodLiteral<"Postback">;
247
- payload: z.ZodString;
248
- }, "strip", z.ZodTypeAny, {
249
- title: string;
250
- action: "Postback";
251
- payload: string;
252
- }, {
253
- title: string;
254
- action: "Postback";
255
- payload: string;
256
- }>, import("../../../index.ts").ButtonBlock, {
257
- title: string;
258
- action: "Postback";
259
- payload: string;
260
- }>]>, "many">;
261
- }, "strip", z.ZodTypeAny, {
262
- type: "card";
263
- actions: import("../../../index.ts").ButtonBlock[];
264
- title?: string | undefined;
265
- subtitle?: string | undefined;
266
- image?: string | undefined;
267
- }, {
268
- type: "card";
269
- actions: ({
270
- text: string;
271
- title: string;
272
- action: "Say something";
273
- } | {
274
- title: string;
275
- action: "Open URL";
276
- url: string;
277
- } | {
278
- title: string;
279
- action: "Postback";
280
- payload: string;
281
- })[];
282
- title?: string | undefined;
283
- subtitle?: string | undefined;
284
- image?: string | undefined;
285
- }>, import("./Utils.ts").WithBubble<import("./Card").CardBlockType>, {
286
- type: "card";
287
- actions: ({
288
- text: string;
289
- title: string;
290
- action: "Say something";
291
- } | {
292
- title: string;
293
- action: "Open URL";
294
- url: string;
295
- } | {
296
- title: string;
297
- action: "Postback";
298
- payload: string;
299
- })[];
300
- title?: string | undefined;
301
- subtitle?: string | undefined;
302
- image?: string | undefined;
303
- }>, z.ZodEffects<z.ZodObject<{
304
- type: z.ZodLiteral<"location">;
305
- latitude: z.ZodNumber;
306
- longitude: z.ZodNumber;
307
- address: z.ZodOptional<z.ZodString>;
308
- title: z.ZodOptional<z.ZodString>;
309
- }, "strip", z.ZodTypeAny, {
310
- type: "location";
311
- latitude: number;
312
- longitude: number;
313
- address?: string | undefined;
314
- title?: string | undefined;
315
- }, {
316
- type: "location";
317
- latitude: number;
318
- longitude: number;
319
- address?: string | undefined;
320
- title?: string | undefined;
321
- }>, import("../../../index.ts").LocationBlock, {
322
- type: "location";
323
- latitude: number;
324
- longitude: number;
325
- address?: string | undefined;
326
- title?: string | undefined;
327
- }>, z.ZodEffects<z.ZodObject<{
328
- type: z.ZodLiteral<"file">;
329
- file: z.ZodString;
330
- title: z.ZodOptional<z.ZodString>;
331
- }, "strip", z.ZodTypeAny, {
332
- file: string;
333
- type: "file";
334
- title?: string | undefined;
335
- }, {
336
- file: string;
337
- type: "file";
338
- title?: string | undefined;
339
- }>, import("../../../index.ts").FileBlock, {
340
- file: string;
341
- type: "file";
342
- title?: string | undefined;
343
- }>, z.ZodEffects<z.ZodObject<{
344
- type: z.ZodLiteral<"voice">;
345
- audio: z.ZodString;
346
- }, "strip", z.ZodTypeAny, {
347
- audio: string;
348
- type: "voice";
349
- }, {
350
- audio: string;
351
- type: "voice";
352
- }>, import("../../../index.ts").AudioBlock, {
353
- audio: string;
354
- type: "voice";
355
- }>, z.ZodEffects<z.ZodObject<{
356
- type: z.ZodLiteral<"single-choice">;
357
- text: z.ZodString;
358
- choices: z.ZodArray<z.ZodObject<{
359
- title: z.ZodString;
360
- value: z.ZodString;
361
- }, "strip", z.ZodTypeAny, {
362
- value: string;
363
- title: string;
364
- }, {
365
- value: string;
366
- title: string;
367
- }>, "many">;
368
- }, "strip", z.ZodTypeAny, {
369
- text: string;
370
- type: "single-choice";
371
- choices: {
372
- value: string;
373
- title: string;
374
- }[];
375
- }, {
376
- text: string;
377
- type: "single-choice";
378
- choices: {
379
- value: string;
380
- title: string;
381
- }[];
382
- }>, import("./Utils.ts").WithBubble<{
383
- blocks: (import("../../../index.ts").TextBlock | ({
384
- blocks: import("../../../index.ts").ButtonBlock[];
385
- } & Omit<import("../../../index.ts").RowBlock, "blocks">))[];
386
- } & Omit<import("../../../index.ts").ColumnBlock, "blocks">>, {
387
- text: string;
388
- type: "single-choice";
389
- choices: {
390
- value: string;
391
- title: string;
392
- }[];
393
- }>, z.ZodEffects<z.ZodObject<{
394
- type: z.ZodLiteral<"dropdown">;
395
- text: z.ZodOptional<z.ZodString>;
396
- message: z.ZodOptional<z.ZodString>;
397
- options: z.ZodArray<z.ZodObject<{
398
- label: z.ZodString;
399
- value: z.ZodString;
400
- }, "strip", z.ZodTypeAny, {
401
- value: string;
402
- label: string;
403
- }, {
404
- value: string;
405
- label: string;
406
- }>, "many">;
407
- }, "strip", z.ZodTypeAny, {
408
- options: {
409
- value: string;
410
- label: string;
411
- }[];
412
- type: "dropdown";
413
- text?: string | undefined;
414
- message?: string | undefined;
415
- }, {
416
- options: {
417
- value: string;
418
- label: string;
419
- }[];
420
- type: "dropdown";
421
- text?: string | undefined;
422
- message?: string | undefined;
423
- }>, import("./Utils.ts").WithBubble<{
424
- blocks: (import("../../../index.ts").DropdownBlock | import("../../../index.ts").TextBlock)[];
425
- } & Omit<import("../../../index.ts").ColumnBlock, "blocks">>, {
426
- options: {
427
- value: string;
428
- label: string;
429
- }[];
430
- type: "dropdown";
431
- text?: string | undefined;
432
- message?: string | undefined;
433
- }>]>;
@@ -1,20 +0,0 @@
1
- import { z } from 'zod';
2
- import { TextBlock } from '../../../types';
3
- import { WithBubble } from './Utils';
4
- export declare const TextSchema: z.ZodEffects<z.ZodObject<{
5
- type: z.ZodLiteral<"text">;
6
- text: z.ZodString;
7
- markdown: z.ZodOptional<z.ZodBoolean>;
8
- }, "strip", z.ZodTypeAny, {
9
- text: string;
10
- type: "text";
11
- markdown?: boolean | undefined;
12
- }, {
13
- text: string;
14
- type: "text";
15
- markdown?: boolean | undefined;
16
- }>, WithBubble<TextBlock>, {
17
- text: string;
18
- type: "text";
19
- markdown?: boolean | undefined;
20
- }>;
@@ -1,5 +0,0 @@
1
- import { BlockObject, BubbleBlock } from '../../../types';
2
- export type WithBubble<T extends BlockObject> = {
3
- block: T;
4
- } & Omit<BubbleBlock, 'block'>;
5
- export declare function withBubble<T extends BlockObject>(block: T): WithBubble<T>;
@@ -1,19 +0,0 @@
1
- import { z } from 'zod';
2
- import { VideoBlock } from '../../../types';
3
- export declare const VideoSchema: z.ZodEffects<z.ZodObject<{
4
- type: z.ZodLiteral<"video">;
5
- video: z.ZodString;
6
- title: z.ZodOptional<z.ZodString>;
7
- }, "strip", z.ZodTypeAny, {
8
- video: string;
9
- type: "video";
10
- title?: string | undefined;
11
- }, {
12
- video: string;
13
- type: "video";
14
- title?: string | undefined;
15
- }>, VideoBlock, {
16
- video: string;
17
- type: "video";
18
- title?: string | undefined;
19
- }>;
@@ -1,15 +0,0 @@
1
- import { z } from 'zod';
2
- import { AudioBlock } from '../../../types';
3
- export declare const VoiceSchema: z.ZodEffects<z.ZodObject<{
4
- type: z.ZodLiteral<"voice">;
5
- audio: z.ZodString;
6
- }, "strip", z.ZodTypeAny, {
7
- audio: string;
8
- type: "voice";
9
- }, {
10
- audio: string;
11
- type: "voice";
12
- }>, AudioBlock, {
13
- audio: string;
14
- type: "voice";
15
- }>;
@@ -1,12 +0,0 @@
1
- export * from './Audio';
2
- export * from './Card';
3
- export * from './Carousel';
4
- export * from './Choice';
5
- export * from './File';
6
- export * from './Image';
7
- export * from './Location';
8
- export * from './Message';
9
- export * from './Text';
10
- export * from './Utils';
11
- export * from './Video';
12
- export * from './Voice';
@@ -1,2 +0,0 @@
1
- import { Theme } from '../schemas';
2
- export declare const dusk: Theme;
@@ -1,2 +0,0 @@
1
- import { Theme } from '../schemas';
2
- export declare const galaxy: Theme;
@@ -1,2 +0,0 @@
1
- import { Theme } from '../schemas';
2
- export declare function buildMidnightTheme(color: string): Theme;
@@ -1,18 +0,0 @@
1
- export declare function buildColorPalette(color: string, theme?: 'light' | 'dark'): {
2
- primary: string;
3
- primaryHover: string;
4
- primaryHoverDark: string;
5
- onPrimary: string;
6
- primaryContainer: string;
7
- primaryContainerHover: string;
8
- onPrimaryContainer: string;
9
- secondary: string;
10
- secondaryHover: string;
11
- onSecondary: string;
12
- secondaryContainer: string;
13
- secondaryContainerHover: string;
14
- onSecondaryContainer: string;
15
- };
16
- type Grays = 'gray' | 'stone' | 'slate' | 'zinc' | 'neutral';
17
- export declare function selectGrayFromColor(color: string, omit?: Grays[]): Grays;
18
- export {};