@botpress/webchat 1.2.0 → 1.3.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.
Files changed (64) hide show
  1. package/dist/client/MessagingClient/client.d.ts +7 -4
  2. package/dist/client/PushpinClient/index.d.ts +4 -2
  3. package/dist/client/PushpinClient/inner-client/index.d.ts +2 -0
  4. package/dist/client/types.d.ts +4 -1
  5. package/dist/components/Avatar.d.ts +2 -3
  6. package/dist/components/Block.d.ts +3 -2
  7. package/dist/components/CloseWindow.d.ts +5 -0
  8. package/dist/components/Composer.d.ts +1 -1
  9. package/dist/components/renderers/Audio.d.ts +1 -1
  10. package/dist/components/renderers/Carousel.d.ts +1 -1
  11. package/dist/components/renderers/File.d.ts +1 -1
  12. package/dist/components/renderers/Image.d.ts +1 -1
  13. package/dist/components/renderers/Location.d.ts +1 -1
  14. package/dist/components/renderers/Video.d.ts +1 -1
  15. package/dist/contexts/WebchatContext.d.ts +3 -3
  16. package/dist/gen/client/api.d.ts +330 -12
  17. package/dist/gen/client/client.d.ts +5 -1
  18. package/dist/gen/client/errors.d.ts +9 -2
  19. package/dist/gen/models/index.d.ts +186 -23
  20. package/dist/gen/models/message.j.d.ts +107 -5
  21. package/dist/gen/models/message.t.d.ts +49 -0
  22. package/dist/gen/models/message.z.d.ts +79 -12
  23. package/dist/gen/models/user.j.d.ts +0 -3
  24. package/dist/gen/models/user.t.d.ts +0 -1
  25. package/dist/gen/models/user.z.d.ts +0 -3
  26. package/dist/gen/signals/index.d.ts +218 -23
  27. package/dist/gen/signals/messageCreatedSignal.j.d.ts +107 -5
  28. package/dist/gen/signals/messageCreatedSignal.t.d.ts +49 -0
  29. package/dist/gen/signals/messageCreatedSignal.z.d.ts +111 -18
  30. package/dist/get-client.d.ts +8 -0
  31. package/dist/hooks/useClient.d.ts +2 -2
  32. package/dist/hooks/useWebchatStore.d.ts +3 -0
  33. package/dist/index.d.ts +3 -4
  34. package/dist/index.js +33089 -40901
  35. package/dist/index.umd.cjs +96 -125
  36. package/dist/providers/WebchatProvider.d.ts +4 -3
  37. package/dist/schemas/configuration.d.ts +117 -0
  38. package/dist/schemas/index.d.ts +2 -0
  39. package/dist/schemas/init.d.ts +3844 -0
  40. package/dist/schemas/theme.d.ts +231 -232
  41. package/dist/types/block-type.d.ts +3 -6
  42. package/dist/types/configuration.d.ts +4 -16
  43. package/dist/types/index.d.ts +2 -0
  44. package/dist/types/init.d.ts +6 -0
  45. package/dist/types/theme.d.ts +7 -0
  46. package/dist/utils/index.d.ts +0 -2
  47. package/package.json +11 -37
  48. package/dist/App.d.ts +0 -11
  49. package/dist/components/dev-tools/DevTools.d.ts +0 -1
  50. package/dist/components/dev-tools/configuration.d.ts +0 -2
  51. package/dist/components/dev-tools/helpers.d.ts +0 -5
  52. package/dist/main.d.ts +0 -0
  53. package/dist/options.d.ts +0 -11
  54. package/dist/themes/base.d.ts +0 -3
  55. package/dist/themes/baseColors.d.ts +0 -736
  56. package/dist/themes/dawn.d.ts +0 -4
  57. package/dist/themes/eggplant.d.ts +0 -4
  58. package/dist/themes/index.d.ts +0 -3
  59. package/dist/themes/prism.d.ts +0 -4
  60. package/dist/themes/themeBuilder.d.ts +0 -27
  61. package/dist/twind.config.d.ts +0 -9
  62. package/dist/twind.d.ts +0 -16
  63. package/dist/utils/mergeThemes.d.ts +0 -2
  64. package/dist/utils/withBaseTheme.d.ts +0 -384
@@ -1,8 +1,7 @@
1
1
  import { ComponentProps, ReactNode } from 'react';
2
2
  import { type WebchatClient } from '../client';
3
3
  import { ContextVaue, Renderers, WebchatContext } from '../contexts';
4
- import { Theme } from '../schemas';
5
- import { Configuration } from '../types';
4
+ import { Theme, Configuration } from '../types';
6
5
  type Props = {
7
6
  theme?: Theme;
8
7
  renderers?: Renderers;
@@ -10,6 +9,8 @@ type Props = {
10
9
  configuration?: Configuration;
11
10
  defaultState?: Partial<ContextVaue['state']>;
12
11
  children?: ReactNode | ((configuration: Configuration) => ReactNode);
12
+ userData?: Record<string, string>;
13
+ closeWindow?: () => void;
13
14
  } & Omit<ComponentProps<typeof WebchatContext.Provider>, 'value' | 'children'>;
14
- export declare const WebchatProvider: ({ theme: initialTheme, renderers, client, children, configuration, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
15
+ export declare const WebchatProvider: ({ theme: initialTheme, renderers, client, children, configuration, userData, closeWindow, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
15
16
  export {};
@@ -0,0 +1,117 @@
1
+ import { z } from 'zod';
2
+ export declare const descriptionItemSchema: z.ZodObject<{
3
+ title: z.ZodString;
4
+ link: z.ZodOptional<z.ZodString>;
5
+ }, "strip", z.ZodTypeAny, {
6
+ title: string;
7
+ link?: string | undefined;
8
+ }, {
9
+ title: string;
10
+ link?: string | undefined;
11
+ }>;
12
+ export declare const configurationSchema: z.ZodObject<{
13
+ composerPlaceholder: z.ZodOptional<z.ZodString>;
14
+ botName: z.ZodOptional<z.ZodString>;
15
+ botAvatar: z.ZodOptional<z.ZodString>;
16
+ botDescription: z.ZodOptional<z.ZodString>;
17
+ website: z.ZodOptional<z.ZodObject<{
18
+ title: z.ZodString;
19
+ link: z.ZodOptional<z.ZodString>;
20
+ }, "strip", z.ZodTypeAny, {
21
+ title: string;
22
+ link?: string | undefined;
23
+ }, {
24
+ title: string;
25
+ link?: string | undefined;
26
+ }>>;
27
+ email: z.ZodOptional<z.ZodObject<{
28
+ title: z.ZodString;
29
+ link: z.ZodOptional<z.ZodString>;
30
+ }, "strip", z.ZodTypeAny, {
31
+ title: string;
32
+ link?: string | undefined;
33
+ }, {
34
+ title: string;
35
+ link?: string | undefined;
36
+ }>>;
37
+ phone: z.ZodOptional<z.ZodObject<{
38
+ title: z.ZodString;
39
+ link: z.ZodOptional<z.ZodString>;
40
+ }, "strip", z.ZodTypeAny, {
41
+ title: string;
42
+ link?: string | undefined;
43
+ }, {
44
+ title: string;
45
+ link?: string | undefined;
46
+ }>>;
47
+ privacyPolicy: z.ZodOptional<z.ZodObject<{
48
+ title: z.ZodString;
49
+ link: z.ZodOptional<z.ZodString>;
50
+ }, "strip", z.ZodTypeAny, {
51
+ title: string;
52
+ link?: string | undefined;
53
+ }, {
54
+ title: string;
55
+ link?: string | undefined;
56
+ }>>;
57
+ termsOfService: z.ZodOptional<z.ZodObject<{
58
+ title: z.ZodString;
59
+ link: z.ZodOptional<z.ZodString>;
60
+ }, "strip", z.ZodTypeAny, {
61
+ title: string;
62
+ link?: string | undefined;
63
+ }, {
64
+ title: string;
65
+ link?: string | undefined;
66
+ }>>;
67
+ }, "strip", z.ZodTypeAny, {
68
+ composerPlaceholder?: string | undefined;
69
+ botName?: string | undefined;
70
+ botAvatar?: string | undefined;
71
+ botDescription?: string | undefined;
72
+ website?: {
73
+ title: string;
74
+ link?: string | undefined;
75
+ } | undefined;
76
+ email?: {
77
+ title: string;
78
+ link?: string | undefined;
79
+ } | undefined;
80
+ phone?: {
81
+ title: string;
82
+ link?: string | undefined;
83
+ } | undefined;
84
+ privacyPolicy?: {
85
+ title: string;
86
+ link?: string | undefined;
87
+ } | undefined;
88
+ termsOfService?: {
89
+ title: string;
90
+ link?: string | undefined;
91
+ } | undefined;
92
+ }, {
93
+ composerPlaceholder?: string | undefined;
94
+ botName?: string | undefined;
95
+ botAvatar?: string | undefined;
96
+ botDescription?: string | undefined;
97
+ website?: {
98
+ title: string;
99
+ link?: string | undefined;
100
+ } | undefined;
101
+ email?: {
102
+ title: string;
103
+ link?: string | undefined;
104
+ } | undefined;
105
+ phone?: {
106
+ title: string;
107
+ link?: string | undefined;
108
+ } | undefined;
109
+ privacyPolicy?: {
110
+ title: string;
111
+ link?: string | undefined;
112
+ } | undefined;
113
+ termsOfService?: {
114
+ title: string;
115
+ link?: string | undefined;
116
+ } | undefined;
117
+ }>;
@@ -1 +1,3 @@
1
+ export * from './configuration';
1
2
  export * from './theme';
3
+ export * from './init';