@botpress/webchat 1.2.0 → 1.3.1

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 (72) hide show
  1. package/dist/adapters/index.d.ts +4 -0
  2. package/dist/adapters/messaging-to-target.d.ts +151 -0
  3. package/dist/adapters/target.d.ts +77 -0
  4. package/dist/adapters/webchat-to-target.d.ts +126 -0
  5. package/dist/client/MessagingClient/client.d.ts +7 -4
  6. package/dist/client/PushpinClient/index.d.ts +4 -2
  7. package/dist/client/PushpinClient/inner-client/index.d.ts +2 -0
  8. package/dist/client/types.d.ts +4 -1
  9. package/dist/components/Avatar.d.ts +2 -3
  10. package/dist/components/Block.d.ts +3 -2
  11. package/dist/components/CloseWindow.d.ts +5 -0
  12. package/dist/components/Composer.d.ts +1 -1
  13. package/dist/components/renderers/Audio.d.ts +1 -1
  14. package/dist/components/renderers/Carousel.d.ts +1 -1
  15. package/dist/components/renderers/File.d.ts +1 -1
  16. package/dist/components/renderers/Image.d.ts +1 -1
  17. package/dist/components/renderers/Location.d.ts +1 -1
  18. package/dist/components/renderers/Video.d.ts +1 -1
  19. package/dist/contexts/WebchatContext.d.ts +3 -3
  20. package/dist/gen/client/api.d.ts +349 -31
  21. package/dist/gen/client/client.d.ts +21 -17
  22. package/dist/gen/client/errors.d.ts +9 -2
  23. package/dist/gen/models/index.d.ts +186 -23
  24. package/dist/gen/models/message.j.d.ts +107 -5
  25. package/dist/gen/models/message.t.d.ts +49 -0
  26. package/dist/gen/models/message.z.d.ts +79 -12
  27. package/dist/gen/models/user.j.d.ts +0 -3
  28. package/dist/gen/models/user.t.d.ts +0 -1
  29. package/dist/gen/models/user.z.d.ts +0 -3
  30. package/dist/gen/signals/index.d.ts +218 -23
  31. package/dist/gen/signals/messageCreatedSignal.j.d.ts +107 -5
  32. package/dist/gen/signals/messageCreatedSignal.t.d.ts +49 -0
  33. package/dist/gen/signals/messageCreatedSignal.z.d.ts +111 -18
  34. package/dist/get-client.d.ts +8 -0
  35. package/dist/hooks/useClient.d.ts +2 -2
  36. package/dist/hooks/useWebchatStore.d.ts +3 -0
  37. package/dist/index.d.ts +3 -4
  38. package/dist/index.js +33301 -40913
  39. package/dist/index.umd.cjs +96 -125
  40. package/dist/providers/WebchatProvider.d.ts +4 -3
  41. package/dist/schemas/configuration.d.ts +117 -0
  42. package/dist/schemas/index.d.ts +2 -0
  43. package/dist/schemas/init.d.ts +7650 -0
  44. package/dist/schemas/theme.d.ts +231 -232
  45. package/dist/types/block-type.d.ts +3 -6
  46. package/dist/types/configuration.d.ts +4 -16
  47. package/dist/types/index.d.ts +2 -0
  48. package/dist/types/init.d.ts +7 -0
  49. package/dist/types/theme.d.ts +7 -0
  50. package/dist/utils/index.d.ts +0 -2
  51. package/openapi.ts +40 -0
  52. package/package.json +15 -38
  53. package/dist/App.d.ts +0 -11
  54. package/dist/components/dev-tools/DevTools.d.ts +0 -1
  55. package/dist/components/dev-tools/configuration.d.ts +0 -2
  56. package/dist/components/dev-tools/helpers.d.ts +0 -5
  57. package/dist/main.d.ts +0 -0
  58. package/dist/options.d.ts +0 -11
  59. package/dist/themes/base.d.ts +0 -3
  60. package/dist/themes/baseColors.d.ts +0 -736
  61. package/dist/themes/dawn.d.ts +0 -4
  62. package/dist/themes/eggplant.d.ts +0 -4
  63. package/dist/themes/index.d.ts +0 -3
  64. package/dist/themes/prism.d.ts +0 -4
  65. package/dist/themes/themeBuilder.d.ts +0 -27
  66. package/dist/twind.config.d.ts +0 -9
  67. package/dist/twind.d.ts +0 -16
  68. package/dist/utils/mergeThemes.d.ts +0 -2
  69. package/dist/utils/withBaseTheme.d.ts +0 -384
  70. package/openapi/index.ts +0 -31
  71. package/openapi/package.json +0 -5
  72. package/openapi/readme.md +0 -1
@@ -1,4 +0,0 @@
1
- import { Theme } from '../schemas';
2
- export declare function buildEggplantTheme(color: string, { darkMode }?: {
3
- darkMode?: boolean;
4
- }): Theme;
@@ -1,3 +0,0 @@
1
- export * from './dawn';
2
- export * from './eggplant';
3
- export * from './prism';
@@ -1,4 +0,0 @@
1
- import { Theme } from '../schemas';
2
- export declare function buildPrismTheme(color: string, { darkMode }?: {
3
- darkMode?: boolean;
4
- }): Theme;
@@ -1,27 +0,0 @@
1
- declare const aliases: readonly ["base", "bgSubtle", "bg", "bgHover", "bgActive", "line", "border", "borderHover", "solid", "solidHover", "text", "textContrast", "onSolid"];
2
- declare const shades: readonly ["25", "50", "100", "150", "200", "300", "400", "500", "600", "700", "800", "900", "0"];
3
- type Aliases = Record<(typeof aliases)[number], string>;
4
- type Shades = Record<(typeof shades)[number], string>;
5
- type Palette = {
6
- aliases: Aliases;
7
- shades: Shades;
8
- };
9
- type Theme = {
10
- light: {
11
- primary: Palette;
12
- secondary: Palette;
13
- tertiary: Palette;
14
- grey: Palette;
15
- };
16
- dark: {
17
- primary: Palette;
18
- secondary: Palette;
19
- tertiary: Palette;
20
- grey: Palette;
21
- };
22
- };
23
- type ThemeOptions = {
24
- scheme?: 'analogous' | 'complementary' | 'triadic';
25
- };
26
- export declare function buildTheme(color: string, { scheme }?: ThemeOptions): Theme;
27
- export {};
@@ -1,9 +0,0 @@
1
- export declare const config: import("@twind/core").TwindConfig<import("@twind/core").BaseTheme & import("@twind/preset-tailwind").TailwindTheme & import("@twind/preset-container-queries").ContainerQueriesTheme & {
2
- fontFamily: {
3
- sans: string[];
4
- rubik: string[];
5
- plex: string[];
6
- mono: string[];
7
- };
8
- extend: never;
9
- }>;
package/dist/twind.d.ts DELETED
@@ -1,16 +0,0 @@
1
- export declare const tw: import("@twind/core").Twind<import("@twind/core").BaseTheme & import("@twind/preset-tailwind").TailwindTheme & import("@twind/preset-container-queries").ContainerQueriesTheme & {
2
- fontFamily: {
3
- sans: string[];
4
- rubik: string[];
5
- plex: string[];
6
- mono: string[];
7
- };
8
- extend: never;
9
- }, CSSStyleSheet>;
10
- export declare const tx: import("@twind/core").TxFunction;
11
- export declare const injectGlobal: import("@twind/core").InjectGlobalFunction;
12
- export declare const keyframes: import("@twind/core").KeyframesFunction & {
13
- [label: string]: import("@twind/core").KeyframesFunction;
14
- } & {
15
- [label: string]: import("@twind/core").KeyframesFunction;
16
- };
@@ -1,2 +0,0 @@
1
- import { Theme } from '../schemas';
2
- export declare function mergeThemes(baseTheme: Theme, other: Theme): Theme;
@@ -1,384 +0,0 @@
1
- /// <reference types="react" />
2
- import { Theme } from '../schemas';
3
- export declare function withBaseTheme(theme: Theme): {
4
- container?: {
5
- className?: string | undefined;
6
- style?: import("react").CSSProperties | undefined;
7
- } | undefined;
8
- modal?: {
9
- overlay?: {
10
- className?: string | undefined;
11
- style?: import("react").CSSProperties | undefined;
12
- } | undefined;
13
- container?: {
14
- className?: string | undefined;
15
- style?: import("react").CSSProperties | undefined;
16
- } | undefined;
17
- dialog?: {
18
- container?: {
19
- className?: string | undefined;
20
- style?: import("react").CSSProperties | undefined;
21
- } | undefined;
22
- title?: {
23
- container?: {
24
- className?: string | undefined;
25
- style?: import("react").CSSProperties | undefined;
26
- } | undefined;
27
- text?: {
28
- className?: string | undefined;
29
- style?: import("react").CSSProperties | undefined;
30
- } | undefined;
31
- closeIcon?: {
32
- className?: string | undefined;
33
- style?: import("react").CSSProperties | undefined;
34
- } | undefined;
35
- } | undefined;
36
- content?: {
37
- className?: string | undefined;
38
- style?: import("react").CSSProperties | undefined;
39
- } | undefined;
40
- newConversation?: {
41
- text?: {
42
- className?: string | undefined;
43
- style?: import("react").CSSProperties | undefined;
44
- } | undefined;
45
- button?: {
46
- className?: string | undefined;
47
- style?: import("react").CSSProperties | undefined;
48
- } | undefined;
49
- } | undefined;
50
- } | undefined;
51
- } | undefined;
52
- notification?: {
53
- container?: {
54
- className?: string | undefined;
55
- style?: import("react").CSSProperties | undefined;
56
- } | undefined;
57
- title?: {
58
- className?: string | undefined;
59
- style?: import("react").CSSProperties | undefined;
60
- } | undefined;
61
- description?: {
62
- className?: string | undefined;
63
- style?: import("react").CSSProperties | undefined;
64
- } | undefined;
65
- icon?: {
66
- className?: string | undefined;
67
- style?: import("react").CSSProperties | undefined;
68
- } | undefined;
69
- closeIcon?: {
70
- className?: string | undefined;
71
- style?: import("react").CSSProperties | undefined;
72
- } | undefined;
73
- } | undefined;
74
- header?: {
75
- content: {
76
- container?: {
77
- className?: string | undefined;
78
- style?: import("react").CSSProperties | undefined;
79
- } | undefined;
80
- title?: {
81
- className?: string | undefined;
82
- style?: import("react").CSSProperties | undefined;
83
- } | undefined;
84
- description?: {
85
- className?: string | undefined;
86
- style?: import("react").CSSProperties | undefined;
87
- } | undefined;
88
- avatar?: {
89
- container?: {
90
- className?: string | undefined;
91
- style?: import("react").CSSProperties | undefined;
92
- } | undefined;
93
- image?: {
94
- className?: string | undefined;
95
- style?: import("react").CSSProperties | undefined;
96
- } | undefined;
97
- fallback?: {
98
- className?: string | undefined;
99
- style?: import("react").CSSProperties | undefined;
100
- } | undefined;
101
- } | undefined;
102
- actions?: {
103
- container?: {
104
- className?: string | undefined;
105
- style?: import("react").CSSProperties | undefined;
106
- } | undefined;
107
- icons?: {
108
- className?: string | undefined;
109
- style?: import("react").CSSProperties | undefined;
110
- } | undefined;
111
- } | undefined;
112
- };
113
- container?: {
114
- className?: string | undefined;
115
- style?: import("react").CSSProperties | undefined;
116
- } | undefined;
117
- expandedContent?: {
118
- container?: {
119
- className?: string | undefined;
120
- style?: import("react").CSSProperties | undefined;
121
- } | undefined;
122
- descriptionItems?: {
123
- container?: {
124
- className?: string | undefined;
125
- style?: import("react").CSSProperties | undefined;
126
- } | undefined;
127
- icon?: {
128
- className?: string | undefined;
129
- style?: import("react").CSSProperties | undefined;
130
- } | undefined;
131
- text?: {
132
- className?: string | undefined;
133
- style?: import("react").CSSProperties | undefined;
134
- } | undefined;
135
- link?: {
136
- className?: string | undefined;
137
- style?: import("react").CSSProperties | undefined;
138
- } | undefined;
139
- } | undefined;
140
- } | undefined;
141
- description?: {
142
- container?: {
143
- className?: string | undefined;
144
- style?: import("react").CSSProperties | undefined;
145
- } | undefined;
146
- title?: {
147
- className?: string | undefined;
148
- style?: import("react").CSSProperties | undefined;
149
- } | undefined;
150
- subtitle?: {
151
- className?: string | undefined;
152
- style?: import("react").CSSProperties | undefined;
153
- } | undefined;
154
- } | undefined;
155
- newConversationIcon?: {
156
- className?: string | undefined;
157
- style?: import("react").CSSProperties | undefined;
158
- } | undefined;
159
- } | undefined;
160
- composer?: {
161
- container?: {
162
- className?: string | undefined;
163
- style?: import("react").CSSProperties | undefined;
164
- } | undefined;
165
- input?: {
166
- className?: string | undefined;
167
- style?: import("react").CSSProperties | undefined;
168
- } | undefined;
169
- button?: {
170
- container?: {
171
- className?: string | undefined;
172
- style?: import("react").CSSProperties | undefined;
173
- } | undefined;
174
- icon?: {
175
- className?: string | undefined;
176
- style?: import("react").CSSProperties | undefined;
177
- } | undefined;
178
- } | undefined;
179
- } | undefined;
180
- fab?: {
181
- icon?: {
182
- className?: string | undefined;
183
- style?: import("react").CSSProperties | undefined;
184
- } | undefined;
185
- container?: {
186
- className?: string | undefined;
187
- style?: import("react").CSSProperties | undefined;
188
- } | undefined;
189
- } | undefined;
190
- messageList?: {
191
- container?: {
192
- className?: string | undefined;
193
- style?: import("react").CSSProperties | undefined;
194
- } | undefined;
195
- marquee?: {
196
- content?: {
197
- className?: string | undefined;
198
- style?: import("react").CSSProperties | undefined;
199
- } | undefined;
200
- title?: {
201
- className?: string | undefined;
202
- style?: import("react").CSSProperties | undefined;
203
- } | undefined;
204
- description?: {
205
- className?: string | undefined;
206
- style?: import("react").CSSProperties | undefined;
207
- } | undefined;
208
- avatar?: {
209
- container?: {
210
- className?: string | undefined;
211
- style?: import("react").CSSProperties | undefined;
212
- } | undefined;
213
- image?: {
214
- className?: string | undefined;
215
- style?: import("react").CSSProperties | undefined;
216
- } | undefined;
217
- fallback?: {
218
- className?: string | undefined;
219
- style?: import("react").CSSProperties | undefined;
220
- } | undefined;
221
- } | undefined;
222
- container?: {
223
- className?: string | undefined;
224
- style?: import("react").CSSProperties | undefined;
225
- } | undefined;
226
- } | undefined;
227
- scrollDownButton?: {
228
- container?: {
229
- className?: string | undefined;
230
- style?: import("react").CSSProperties | undefined;
231
- } | undefined;
232
- button?: {
233
- className?: string | undefined;
234
- style?: import("react").CSSProperties | undefined;
235
- } | undefined;
236
- icon?: {
237
- className?: string | undefined;
238
- style?: import("react").CSSProperties | undefined;
239
- } | undefined;
240
- } | undefined;
241
- } | undefined;
242
- message?: {
243
- container?: {
244
- className?: string | undefined;
245
- style?: import("react").CSSProperties | undefined;
246
- } | undefined;
247
- avatar?: {
248
- container?: {
249
- className?: string | undefined;
250
- style?: import("react").CSSProperties | undefined;
251
- } | undefined;
252
- image?: {
253
- className?: string | undefined;
254
- style?: import("react").CSSProperties | undefined;
255
- } | undefined;
256
- fallback?: {
257
- className?: string | undefined;
258
- style?: import("react").CSSProperties | undefined;
259
- } | undefined;
260
- } | undefined;
261
- blocks?: {
262
- text: Partial<Record<"text" | "link" | "heading1" | "heading2" | "heading3" | "horizontalRule" | "italic" | "bold" | "orderedList" | "unorderedList" | "listItem" | "lineBreak" | "pre", {
263
- className?: string | undefined;
264
- style?: import("react").CSSProperties | undefined;
265
- } | undefined>>;
266
- button?: {
267
- className?: string | undefined;
268
- style?: import("react").CSSProperties | undefined;
269
- } | undefined;
270
- image?: {
271
- image?: {
272
- className?: string | undefined;
273
- style?: import("react").CSSProperties | undefined;
274
- } | undefined;
275
- placeholder?: {
276
- className?: string | undefined;
277
- style?: import("react").CSSProperties | undefined;
278
- } | undefined;
279
- } | undefined;
280
- audio?: {
281
- className?: string | undefined;
282
- style?: import("react").CSSProperties | undefined;
283
- } | undefined;
284
- video?: {
285
- className?: string | undefined;
286
- style?: import("react").CSSProperties | undefined;
287
- } | undefined;
288
- file?: {
289
- container?: {
290
- className?: string | undefined;
291
- style?: import("react").CSSProperties | undefined;
292
- } | undefined;
293
- title?: {
294
- className?: string | undefined;
295
- style?: import("react").CSSProperties | undefined;
296
- } | undefined;
297
- icon?: {
298
- className?: string | undefined;
299
- style?: import("react").CSSProperties | undefined;
300
- } | undefined;
301
- } | undefined;
302
- location?: {
303
- container?: {
304
- className?: string | undefined;
305
- style?: import("react").CSSProperties | undefined;
306
- } | undefined;
307
- title?: {
308
- className?: string | undefined;
309
- style?: import("react").CSSProperties | undefined;
310
- } | undefined;
311
- icon?: {
312
- className?: string | undefined;
313
- style?: import("react").CSSProperties | undefined;
314
- } | undefined;
315
- } | undefined;
316
- column?: {
317
- className?: string | undefined;
318
- style?: import("react").CSSProperties | undefined;
319
- } | undefined;
320
- row?: {
321
- className?: string | undefined;
322
- style?: import("react").CSSProperties | undefined;
323
- } | undefined;
324
- bubble?: {
325
- className?: string | undefined;
326
- style?: import("react").CSSProperties | undefined;
327
- } | undefined;
328
- carousel?: {
329
- container?: {
330
- className?: string | undefined;
331
- style?: import("react").CSSProperties | undefined;
332
- } | undefined;
333
- slidesContainer?: {
334
- className?: string | undefined;
335
- style?: import("react").CSSProperties | undefined;
336
- } | undefined;
337
- backButton?: {
338
- className?: string | undefined;
339
- style?: import("react").CSSProperties | undefined;
340
- } | undefined;
341
- nextButton?: {
342
- className?: string | undefined;
343
- style?: import("react").CSSProperties | undefined;
344
- } | undefined;
345
- } | undefined;
346
- dropdown?: {
347
- button?: {
348
- container?: {
349
- className?: string | undefined;
350
- style?: import("react").CSSProperties | undefined;
351
- } | undefined;
352
- icon?: {
353
- className?: string | undefined;
354
- style?: import("react").CSSProperties | undefined;
355
- } | undefined;
356
- text?: {
357
- className?: string | undefined;
358
- style?: import("react").CSSProperties | undefined;
359
- } | undefined;
360
- } | undefined;
361
- content?: {
362
- container?: {
363
- className?: string | undefined;
364
- style?: import("react").CSSProperties | undefined;
365
- } | undefined;
366
- item?: {
367
- className?: string | undefined;
368
- style?: import("react").CSSProperties | undefined;
369
- } | undefined;
370
- } | undefined;
371
- } | undefined;
372
- } | undefined;
373
- } | undefined;
374
- loadingIndicator?: {
375
- container?: {
376
- className?: string | undefined;
377
- style?: import("react").CSSProperties | undefined;
378
- } | undefined;
379
- loader?: {
380
- className?: string | undefined;
381
- style?: import("react").CSSProperties | undefined;
382
- } | undefined;
383
- } | undefined;
384
- };
package/openapi/index.ts DELETED
@@ -1,31 +0,0 @@
1
- import yargs, { parseEnv, YargsSchema } from '@bpinternal/yargs-extra'
2
- import { api } from 'webchat-api'
3
- import pathlib from 'path'
4
-
5
- const DEFAULT_OPENAPI_GEN_ENDPOINT = 'http://api.openapi-generator.tech'
6
-
7
- const configSchema = {
8
- outDir: {
9
- type: 'string',
10
- demandOption: true,
11
- },
12
- openapiEndpoint: {
13
- type: 'string',
14
- default: DEFAULT_OPENAPI_GEN_ENDPOINT,
15
- },
16
- } satisfies YargsSchema
17
-
18
- const description = 'Generate OpenAPI client'
19
- void yargs
20
- .command('$0', description, configSchema, async (argv) => {
21
- const args = { ...argv, ...parseEnv(configSchema) }
22
-
23
- const clientDir = pathlib.join(args.outDir, 'client')
24
- const signalsDir = pathlib.join(args.outDir, 'signals')
25
- const modelsDir = pathlib.join(args.outDir, 'models')
26
- await api.exportClient(clientDir, args.openapiEndpoint)
27
- await api.signals.exportSchemas(signalsDir)
28
- await api.models.exportSchemas(modelsDir)
29
- })
30
- .help()
31
- .parse()
@@ -1,5 +0,0 @@
1
- {
2
- "name": "openapi.ts",
3
- "description": "script to generate client",
4
- "type": "commonjs"
5
- }
package/openapi/readme.md DELETED
@@ -1 +0,0 @@
1
- this script must have its own dedicated package.json and tsconfig.json to run properly with ts-node