@botpress/webchat 0.5.1 → 1.0.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 (295) hide show
  1. package/dist/App.d.ts +10 -0
  2. package/dist/Utils/colors.d.ts +18 -0
  3. package/dist/Utils/eventEmitter.d.ts +12 -0
  4. package/dist/Utils/index.d.ts +2 -0
  5. package/dist/client/MessagingClient.d.ts +27 -0
  6. package/dist/client/adapters/Audio.d.ts +19 -0
  7. package/dist/client/adapters/Card.d.ts +188 -0
  8. package/dist/client/adapters/Carousel.d.ts +147 -0
  9. package/dist/client/adapters/Choice.d.ts +45 -0
  10. package/dist/client/adapters/Dropdown.d.ts +46 -0
  11. package/dist/client/adapters/File.d.ts +19 -0
  12. package/dist/client/adapters/Image.d.ts +19 -0
  13. package/dist/client/adapters/Location.d.ts +27 -0
  14. package/dist/client/adapters/Message.d.ts +433 -0
  15. package/dist/client/adapters/Text.d.ts +20 -0
  16. package/dist/client/adapters/Utils.d.ts +5 -0
  17. package/dist/client/adapters/Video.d.ts +19 -0
  18. package/dist/client/adapters/Voice.d.ts +15 -0
  19. package/dist/client/adapters/index.d.ts +12 -0
  20. package/dist/client/index.d.ts +2 -0
  21. package/dist/components/Avatar.d.ts +6 -0
  22. package/dist/components/Block.d.ts +4 -0
  23. package/dist/components/Composer.d.ts +12 -14
  24. package/dist/components/Container.d.ts +2 -12
  25. package/dist/components/Header.d.ts +36 -26
  26. package/dist/components/LoadingIndicator.d.ts +2 -0
  27. package/dist/components/Message.d.ts +7 -0
  28. package/dist/components/MessageList.d.ts +2 -0
  29. package/dist/components/Modal.d.ts +17 -0
  30. package/dist/components/RestartConversation.d.ts +5 -0
  31. package/dist/components/Webchat.d.ts +6 -0
  32. package/dist/components/dev-tools/DevTools.d.ts +1 -0
  33. package/dist/components/dev-tools/configuration.d.ts +2 -0
  34. package/dist/components/dev-tools/helpers.d.ts +5 -0
  35. package/dist/components/index.d.ts +12 -0
  36. package/dist/components/renderers/Audio.d.ts +3 -0
  37. package/dist/components/renderers/Bubble.d.ts +5 -0
  38. package/dist/components/renderers/Button.d.ts +4 -0
  39. package/dist/components/renderers/Carousel.d.ts +3 -0
  40. package/dist/components/renderers/Column.d.ts +5 -0
  41. package/dist/components/renderers/Dropdown.d.ts +5 -0
  42. package/dist/components/renderers/File.d.ts +3 -0
  43. package/dist/components/renderers/Image.d.ts +3 -0
  44. package/dist/components/renderers/Location.d.ts +3 -0
  45. package/dist/components/renderers/Row.d.ts +5 -0
  46. package/dist/components/renderers/Text.d.ts +4 -0
  47. package/dist/components/renderers/Video.d.ts +3 -0
  48. package/dist/components/renderers/index.d.ts +2 -0
  49. package/dist/contexts/ComposerContext.d.ts +8 -0
  50. package/dist/contexts/MessageContext.d.ts +8 -0
  51. package/dist/contexts/ModalContext.d.ts +14 -0
  52. package/dist/contexts/WebchatContext.d.ts +56 -0
  53. package/dist/contexts/index.d.ts +4 -0
  54. package/dist/hooks/index.d.ts +3 -0
  55. package/dist/hooks/useImageSize.d.ts +2 -0
  56. package/dist/hooks/useRefresh.d.ts +10 -0
  57. package/dist/hooks/useWebchatStore.d.ts +30 -0
  58. package/dist/index.d.ts +3 -17
  59. package/dist/index.js +43569 -48
  60. package/dist/index.umd.cjs +702 -0
  61. package/dist/main.d.ts +11 -13
  62. package/dist/providers/ModalProvider.d.ts +8 -0
  63. package/dist/providers/WebchatProvider.d.ts +13 -0
  64. package/dist/providers/index.d.ts +2 -0
  65. package/dist/schemas/index.d.ts +1 -0
  66. package/dist/schemas/theme.d.ts +3371 -0
  67. package/dist/services/clipboard.d.ts +1 -0
  68. package/dist/services/images.d.ts +2 -0
  69. package/dist/services/index.d.ts +3 -0
  70. package/dist/services/toast.d.ts +17 -0
  71. package/dist/themes/dawn.d.ts +2 -0
  72. package/dist/themes/duskTheme.d.ts +2 -0
  73. package/dist/themes/eggplant.d.ts +2 -0
  74. package/dist/themes/galaxy.d.ts +2 -0
  75. package/dist/themes/index.d.ts +6 -0
  76. package/dist/themes/midnight.d.ts +2 -0
  77. package/dist/themes/prism.d.ts +2 -0
  78. package/dist/twind.config.d.ts +9 -0
  79. package/dist/types/block-type.d.ts +93 -0
  80. package/dist/types/image.d.ts +11 -0
  81. package/dist/types/index.d.ts +2 -0
  82. package/dist/vite.svg +1 -0
  83. package/index.html +18 -0
  84. package/package.json +60 -49
  85. package/public/vite.svg +1 -0
  86. package/src/App.tsx +41 -0
  87. package/src/Utils/colors.ts +45 -0
  88. package/src/Utils/eventEmitter.ts +31 -0
  89. package/src/Utils/index.ts +2 -0
  90. package/src/assets/check-circle-bold.svg +5 -0
  91. package/src/assets/chevron-up.svg +3 -0
  92. package/src/assets/file-05.svg +6 -0
  93. package/src/assets/globe-02.svg +6 -0
  94. package/src/assets/help-circle.svg +3 -0
  95. package/src/assets/info-circle.svg +3 -0
  96. package/src/assets/lock-01.svg +4 -0
  97. package/src/assets/mail-01.svg +6 -0
  98. package/src/assets/minus-circle.svg +3 -0
  99. package/src/assets/phone.svg +6 -0
  100. package/src/assets/send-03.svg +4 -0
  101. package/src/assets/share-04.svg +5 -0
  102. package/src/assets/slash-circle-01.svg +3 -0
  103. package/src/assets/x-circle-bold.svg +5 -0
  104. package/src/assets/x-close.svg +3 -0
  105. package/src/assets/x.svg +3 -0
  106. package/src/client/MessagingClient.ts +87 -0
  107. package/src/client/adapters/Audio.ts +10 -0
  108. package/src/client/adapters/Card.ts +104 -0
  109. package/src/client/adapters/Carousel.ts +11 -0
  110. package/src/client/adapters/Choice.ts +48 -0
  111. package/src/client/adapters/Dropdown.ts +39 -0
  112. package/src/client/adapters/File.ts +10 -0
  113. package/src/client/adapters/Image.ts +10 -0
  114. package/src/client/adapters/Location.ts +18 -0
  115. package/src/client/adapters/Message.ts +26 -0
  116. package/src/client/adapters/Text.ts +11 -0
  117. package/src/client/adapters/Utils.ts +11 -0
  118. package/src/client/adapters/Video.ts +10 -0
  119. package/src/client/adapters/Voice.ts +9 -0
  120. package/src/client/adapters/index.ts +12 -0
  121. package/src/client/index.ts +2 -0
  122. package/src/components/Avatar.tsx +22 -0
  123. package/src/components/Block.tsx +17 -0
  124. package/src/components/Composer.tsx +115 -0
  125. package/src/components/Container.tsx +17 -0
  126. package/src/components/Header.tsx +141 -0
  127. package/src/components/LoadingIndicator.tsx +15 -0
  128. package/src/components/Message.tsx +52 -0
  129. package/src/components/MessageList.tsx +75 -0
  130. package/src/components/Modal.tsx +49 -0
  131. package/src/components/RestartConversation.tsx +52 -0
  132. package/src/components/Webchat.tsx +68 -0
  133. package/src/components/dev-tools/DevTools.tsx +496 -0
  134. package/src/components/dev-tools/configuration.tsx +27 -0
  135. package/src/components/dev-tools/helpers.ts +21 -0
  136. package/src/components/index.ts +12 -0
  137. package/src/components/renderers/Audio.tsx +11 -0
  138. package/src/components/renderers/Bubble.tsx +12 -0
  139. package/src/components/renderers/Button.tsx +59 -0
  140. package/src/components/renderers/Carousel.tsx +51 -0
  141. package/src/components/renderers/Column.tsx +22 -0
  142. package/src/components/renderers/Dropdown.tsx +170 -0
  143. package/src/components/renderers/File.tsx +13 -0
  144. package/src/components/renderers/Image.tsx +63 -0
  145. package/src/components/renderers/Location.tsx +16 -0
  146. package/src/components/renderers/Row.tsx +22 -0
  147. package/src/components/renderers/Text.tsx +32 -0
  148. package/src/components/renderers/Video.tsx +11 -0
  149. package/src/components/renderers/index.ts +28 -0
  150. package/src/contexts/ComposerContext.ts +16 -0
  151. package/src/contexts/MessageContext.ts +16 -0
  152. package/src/contexts/ModalContext.ts +19 -0
  153. package/src/contexts/WebchatContext.ts +61 -0
  154. package/src/contexts/index.ts +4 -0
  155. package/src/hooks/index.ts +3 -0
  156. package/src/hooks/useImageSize.ts +30 -0
  157. package/src/hooks/useRefresh.ts +33 -0
  158. package/src/hooks/useWebchatStore.ts +45 -0
  159. package/src/index.css +18 -0
  160. package/src/index.ts +3 -0
  161. package/src/main.tsx +33 -0
  162. package/src/providers/ModalProvider.tsx +35 -0
  163. package/src/providers/WebchatProvider.tsx +107 -0
  164. package/src/providers/index.ts +2 -0
  165. package/src/schemas/index.ts +1 -0
  166. package/src/schemas/theme.ts +188 -0
  167. package/src/services/clipboard.ts +8 -0
  168. package/src/services/images.ts +39 -0
  169. package/src/services/index.ts +3 -0
  170. package/src/services/toast.tsx +71 -0
  171. package/src/themes/dawn.ts +277 -0
  172. package/src/themes/duskTheme.ts +349 -0
  173. package/src/themes/eggplant.ts +353 -0
  174. package/src/themes/galaxy.ts +323 -0
  175. package/src/themes/index.ts +6 -0
  176. package/src/themes/midnight.ts +276 -0
  177. package/src/themes/prism.ts +349 -0
  178. package/src/twind.config.ts +31 -0
  179. package/src/types/block-type.ts +150 -0
  180. package/src/types/image.ts +10 -0
  181. package/src/types/index.ts +2 -0
  182. package/src/vite-env.d.ts +1 -0
  183. package/tailwind.config.js +0 -0
  184. package/tsconfig.json +30 -0
  185. package/tsconfig.node.json +10 -0
  186. package/vite.config.ts +31 -0
  187. package/README.md +0 -41
  188. package/assets/fonts/roboto/roboto.woff2 +0 -0
  189. package/assets/fonts/roboto/roboto500.woff2 +0 -0
  190. package/assets/fonts/roboto.css +0 -128
  191. package/assets/notification.mp3 +0 -0
  192. package/dist/components/Composer.js +0 -118
  193. package/dist/components/Container.js +0 -62
  194. package/dist/components/ConversationList.d.ts +0 -10
  195. package/dist/components/ConversationList.js +0 -41
  196. package/dist/components/Footer.d.ts +0 -3
  197. package/dist/components/Footer.js +0 -21
  198. package/dist/components/Header.js +0 -181
  199. package/dist/components/VoiceRecorder.d.ts +0 -10
  200. package/dist/components/VoiceRecorder.js +0 -137
  201. package/dist/components/common/Avatar/index.d.ts +0 -9
  202. package/dist/components/common/Avatar/index.js +0 -13
  203. package/dist/components/common/BotInfo/index.d.ts +0 -10
  204. package/dist/components/common/BotInfo/index.js +0 -107
  205. package/dist/components/common/BotInfo/style.scss +0 -88
  206. package/dist/components/common/ConfirmDialog/index.d.ts +0 -11
  207. package/dist/components/common/ConfirmDialog/index.js +0 -78
  208. package/dist/components/common/ConfirmDialog/style.module.scss +0 -48
  209. package/dist/components/common/Dialog/index.d.ts +0 -17
  210. package/dist/components/common/Dialog/index.js +0 -57
  211. package/dist/components/common/Dialog/style.module.scss +0 -29
  212. package/dist/components/common/ToolTip/index.d.ts +0 -10
  213. package/dist/components/common/ToolTip/index.js +0 -163
  214. package/dist/components/common/ToolTip/style.module.scss +0 -108
  215. package/dist/components/common/ToolTip/utils.d.ts +0 -15
  216. package/dist/components/common/ToolTip/utils.js +0 -78
  217. package/dist/components/common/variables.scss +0 -38
  218. package/dist/components/messages/InlineFeedback.d.ts +0 -11
  219. package/dist/components/messages/InlineFeedback.js +0 -56
  220. package/dist/components/messages/Message.d.ts +0 -11
  221. package/dist/components/messages/Message.js +0 -106
  222. package/dist/components/messages/MessageGroup.d.ts +0 -23
  223. package/dist/components/messages/MessageGroup.js +0 -63
  224. package/dist/components/messages/MessageList.d.ts +0 -10
  225. package/dist/components/messages/MessageList.js +0 -148
  226. package/dist/core/api.d.ts +0 -23
  227. package/dist/core/api.js +0 -117
  228. package/dist/core/constants.d.ts +0 -14
  229. package/dist/core/constants.js +0 -29
  230. package/dist/core/socket.d.ts +0 -14
  231. package/dist/core/socket.js +0 -57
  232. package/dist/declaration.d.ts +0 -2
  233. package/dist/declaration.js +0 -1
  234. package/dist/fonts/roboto.d.ts +0 -4
  235. package/dist/fonts/roboto.js +0 -9
  236. package/dist/globals.d.ts +0 -7
  237. package/dist/globals.js +0 -2
  238. package/dist/icons/Add.d.ts +0 -6
  239. package/dist/icons/Add.js +0 -10
  240. package/dist/icons/Cancel.d.ts +0 -5
  241. package/dist/icons/Cancel.js +0 -10
  242. package/dist/icons/Chat.d.ts +0 -6
  243. package/dist/icons/Chat.js +0 -9
  244. package/dist/icons/Close.d.ts +0 -3
  245. package/dist/icons/Close.js +0 -10
  246. package/dist/icons/Delete.d.ts +0 -3
  247. package/dist/icons/Delete.js +0 -11
  248. package/dist/icons/Download.d.ts +0 -3
  249. package/dist/icons/Download.js +0 -10
  250. package/dist/icons/Email.d.ts +0 -3
  251. package/dist/icons/Email.js +0 -8
  252. package/dist/icons/Information.d.ts +0 -3
  253. package/dist/icons/Information.js +0 -12
  254. package/dist/icons/List.d.ts +0 -3
  255. package/dist/icons/List.js +0 -15
  256. package/dist/icons/Microphone.d.ts +0 -5
  257. package/dist/icons/Microphone.js +0 -12
  258. package/dist/icons/Phone.d.ts +0 -3
  259. package/dist/icons/Phone.js +0 -8
  260. package/dist/icons/Reload.d.ts +0 -3
  261. package/dist/icons/Reload.js +0 -10
  262. package/dist/icons/ThumbsDown.d.ts +0 -3
  263. package/dist/icons/ThumbsDown.js +0 -11
  264. package/dist/icons/ThumbsUp.d.ts +0 -3
  265. package/dist/icons/ThumbsUp.js +0 -11
  266. package/dist/icons/Website.d.ts +0 -3
  267. package/dist/icons/Website.js +0 -8
  268. package/dist/main.js +0 -336
  269. package/dist/store/composer.d.ts +0 -17
  270. package/dist/store/composer.js +0 -98
  271. package/dist/store/index.d.ts +0 -89
  272. package/dist/store/index.js +0 -604
  273. package/dist/store/view.d.ts +0 -61
  274. package/dist/store/view.js +0 -365
  275. package/dist/translations/ar.json +0 -30
  276. package/dist/translations/de.json +0 -32
  277. package/dist/translations/en.json +0 -40
  278. package/dist/translations/es.json +0 -19
  279. package/dist/translations/fr.json +0 -40
  280. package/dist/translations/index.d.ts +0 -9
  281. package/dist/translations/index.js +0 -95
  282. package/dist/translations/it.json +0 -38
  283. package/dist/translations/pt.json +0 -19
  284. package/dist/translations/ru.json +0 -24
  285. package/dist/translations/uk.json +0 -24
  286. package/dist/typings.d.ts +0 -410
  287. package/dist/typings.js +0 -2
  288. package/dist/utils/analytics.d.ts +0 -5
  289. package/dist/utils/analytics.js +0 -37
  290. package/dist/utils/index.d.ts +0 -3
  291. package/dist/utils/index.js +0 -27
  292. package/dist/utils/storage.d.ts +0 -16
  293. package/dist/utils/storage.js +0 -129
  294. package/dist/utils/webchatEvents.d.ts +0 -2
  295. package/dist/utils/webchatEvents.js +0 -14
@@ -0,0 +1,433 @@
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
+ title: string;
79
+ text: string;
80
+ action: "Say something";
81
+ }, {
82
+ title: string;
83
+ text: string;
84
+ action: "Say something";
85
+ }>, import("../../index.ts").ButtonBlock, {
86
+ title: string;
87
+ text: 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
+ url: string;
96
+ action: "Open URL";
97
+ }, {
98
+ title: string;
99
+ url: string;
100
+ action: "Open URL";
101
+ }>, import("../../index.ts").ButtonBlock, {
102
+ title: string;
103
+ url: string;
104
+ action: "Open URL";
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
+ title?: string | undefined;
125
+ image?: string | undefined;
126
+ subtitle?: string | undefined;
127
+ }, {
128
+ actions: ({
129
+ title: string;
130
+ text: string;
131
+ action: "Say something";
132
+ } | {
133
+ title: string;
134
+ url: string;
135
+ action: "Open URL";
136
+ } | {
137
+ title: string;
138
+ action: "Postback";
139
+ payload: string;
140
+ })[];
141
+ title?: string | undefined;
142
+ image?: string | undefined;
143
+ subtitle?: string | undefined;
144
+ }>, import("./Card").CardBlockType, {
145
+ actions: ({
146
+ title: string;
147
+ text: string;
148
+ action: "Say something";
149
+ } | {
150
+ title: string;
151
+ url: string;
152
+ action: "Open URL";
153
+ } | {
154
+ title: string;
155
+ action: "Postback";
156
+ payload: string;
157
+ })[];
158
+ title?: string | undefined;
159
+ image?: 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
+ title: string;
170
+ text: string;
171
+ action: "Say something";
172
+ } | {
173
+ title: string;
174
+ url: string;
175
+ action: "Open URL";
176
+ } | {
177
+ title: string;
178
+ action: "Postback";
179
+ payload: string;
180
+ })[];
181
+ title?: string | undefined;
182
+ image?: 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
+ title: string;
192
+ text: string;
193
+ action: "Say something";
194
+ } | {
195
+ title: string;
196
+ url: string;
197
+ action: "Open URL";
198
+ } | {
199
+ title: string;
200
+ action: "Postback";
201
+ payload: string;
202
+ })[];
203
+ title?: string | undefined;
204
+ image?: 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
+ title: string;
218
+ text: string;
219
+ action: "Say something";
220
+ }, {
221
+ title: string;
222
+ text: string;
223
+ action: "Say something";
224
+ }>, import("../../index.ts").ButtonBlock, {
225
+ title: string;
226
+ text: 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
+ url: string;
235
+ action: "Open URL";
236
+ }, {
237
+ title: string;
238
+ url: string;
239
+ action: "Open URL";
240
+ }>, import("../../index.ts").ButtonBlock, {
241
+ title: string;
242
+ url: string;
243
+ action: "Open URL";
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
+ title: string;
271
+ text: string;
272
+ action: "Say something";
273
+ } | {
274
+ title: string;
275
+ url: string;
276
+ action: "Open URL";
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
+ title: string;
289
+ text: string;
290
+ action: "Say something";
291
+ } | {
292
+ title: string;
293
+ url: string;
294
+ action: "Open URL";
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
+ type: "file";
333
+ file: string;
334
+ title?: string | undefined;
335
+ }, {
336
+ type: "file";
337
+ file: string;
338
+ title?: string | undefined;
339
+ }>, import("../../index.ts").FileBlock, {
340
+ type: "file";
341
+ file: string;
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
+ title: string;
363
+ value: string;
364
+ }, {
365
+ title: string;
366
+ value: string;
367
+ }>, "many">;
368
+ }, "strip", z.ZodTypeAny, {
369
+ text: string;
370
+ type: "single-choice";
371
+ choices: {
372
+ title: string;
373
+ value: string;
374
+ }[];
375
+ }, {
376
+ text: string;
377
+ type: "single-choice";
378
+ choices: {
379
+ title: string;
380
+ value: 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
+ title: string;
391
+ value: 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
+ label: string;
402
+ value: string;
403
+ }, {
404
+ label: string;
405
+ value: string;
406
+ }>, "many">;
407
+ }, "strip", z.ZodTypeAny, {
408
+ options: {
409
+ label: string;
410
+ value: string;
411
+ }[];
412
+ type: "dropdown";
413
+ text?: string | undefined;
414
+ message?: string | undefined;
415
+ }, {
416
+ options: {
417
+ label: string;
418
+ value: 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
+ label: string;
428
+ value: string;
429
+ }[];
430
+ type: "dropdown";
431
+ text?: string | undefined;
432
+ message?: string | undefined;
433
+ }>]>;
@@ -0,0 +1,20 @@
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
+ }>;
@@ -0,0 +1,5 @@
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>;
@@ -0,0 +1,19 @@
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
+ }>;
@@ -0,0 +1,15 @@
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
+ }>;
@@ -0,0 +1,12 @@
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';
@@ -0,0 +1,2 @@
1
+ export * from './adapters';
2
+ export * from './MessagingClient';
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import * as AvatarPrimitive from '@radix-ui/react-avatar';
3
+ declare const Avatar: import("react").ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarProps & import("react").RefAttributes<HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
4
+ declare const AvatarImage: import("react").ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarImageProps & import("react").RefAttributes<HTMLImageElement>, "ref"> & import("react").RefAttributes<HTMLImageElement>>;
5
+ declare const AvatarFallback: import("react").ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & import("react").RefAttributes<HTMLSpanElement>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
6
+ export { Avatar, AvatarImage, AvatarFallback };
@@ -0,0 +1,4 @@
1
+ import { BlockMap, CommonBlockProps } from '../types';
2
+ export declare const Block: <T extends "button" | "audio" | "video" | "image" | "text" | "row" | "location" | "column" | "file" | "bubble" | "carousel" | "dropdown">({ block, styles, ...props }: {
3
+ block: BlockMap[T];
4
+ } & CommonBlockProps) => JSX.Element;
@@ -1,14 +1,12 @@
1
- import React from 'react';
2
- import { WrappedComponentProps } from 'react-intl';
3
- import { StoreDef } from '../store';
4
- declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<ComposerProps, "intl"> & {
5
- forwardedRef?: React.Ref<any> | undefined;
6
- } & React.RefAttributes<any>> & {
7
- WrappedComponent: React.ComponentType<ComposerProps>;
8
- } & import("mobx-react").IWrappedComponent<unknown>;
9
- export default _default;
10
- declare type ComposerProps = {
11
- composerPlaceholder?: string;
12
- composerLocked?: boolean;
13
- composerHidden?: boolean;
14
- } & WrappedComponentProps & Pick<StoreDef, 'botName' | 'composerPlaceholder' | 'intl' | 'focusedArea' | 'sendMessage' | 'sendVoiceMessage' | 'focusPrevious' | 'focusNext' | 'recallHistory' | 'setFocus' | 'updateMessage' | 'message' | 'enableVoiceComposer' | 'currentConversation' | 'preferredLanguage'>;
1
+ import { ComponentProps, FC } from 'react';
2
+ import { type StyleOptions } from '../contexts';
3
+ import { Theme } from '../schemas';
4
+ declare const Composer: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>>;
5
+ declare const ComposerInput: import("react").MemoExoticComponent<({ ...props }: ComponentProps<'textarea'>) => JSX.Element>;
6
+ type ComposerButtonStyle = NonNullable<Theme['composer']>['button'];
7
+ type ComposerButtonProps = {
8
+ icon?: FC<StyleOptions>;
9
+ styles?: ComposerButtonStyle;
10
+ } & ComponentProps<'button'>;
11
+ declare const ComposerButton: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Omit<ComposerButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>>;
12
+ export { Composer, ComposerInput, ComposerButton };
@@ -1,12 +1,2 @@
1
- import React from 'react';
2
- import { WrappedComponentProps } from 'react-intl';
3
- import { RootStore, StoreDef } from '../store';
4
- declare const _default: React.ForwardRefExoticComponent<import("react-intl").Omit<ContainerProps, "intl"> & {
5
- forwardedRef?: React.Ref<any> | undefined;
6
- } & React.RefAttributes<any>> & {
7
- WrappedComponent: React.ComponentType<ContainerProps>;
8
- } & import("mobx-react").IWrappedComponent<unknown>;
9
- export default _default;
10
- declare type ContainerProps = {
11
- store?: RootStore;
12
- } & WrappedComponentProps & Pick<StoreDef, 'config' | 'botName' | 'isFullscreen' | 'isConversationsDisplayed' | 'isBotInfoDisplayed' | 'sideTransition' | 'isInitialized' | 'dimensions' | 'isPoweredByDisplayed' | 'rtl'>;
1
+ /// <reference types="react" />
2
+ export declare const Container: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,26 +1,36 @@
1
- import React from 'react';
2
- import { StoreDef } from '../store';
3
- declare class Header extends React.Component<HeaderProps> {
4
- private btnEls;
5
- state: {
6
- currentFocusIdx: undefined;
7
- showingOption: boolean;
8
- };
9
- componentDidMount(): void;
10
- onBlur: () => void;
11
- setCurrentFocusIdx: (currentFocusIdx: number | undefined) => void;
12
- changeButtonFocus: (step: number) => void;
13
- renderTitle: () => JSX.Element;
14
- handleDeleteConversation: () => Promise<void>;
15
- renderDeleteConversationButton(): JSX.Element;
16
- renderDownloadButton(): JSX.Element;
17
- renderConvoButton(): JSX.Element;
18
- renderBotInfoButton(): JSX.Element;
19
- renderCloseButton(): JSX.Element;
20
- renderCustomButtons(): JSX.Element[];
21
- setShowingOption: (val: any) => void;
22
- render(): JSX.Element;
23
- }
24
- declare const _default: typeof Header & import("mobx-react").IWrappedComponent<unknown>;
25
- export default _default;
26
- declare type HeaderProps = Pick<StoreDef, 'intl' | 'sendMessage' | 'focusPrevious' | 'focusNext' | 'focusedArea' | 'isConversationsDisplayed' | 'botName' | 'hasUnreadMessages' | 'unreadCount' | 'hasBotInfoDescription' | 'deleteConversation' | 'downloadConversation' | 'toggleConversations' | 'hideChat' | 'toggleBotInfo' | 'botAvatarUrl' | 'showDeleteConversationButton' | 'showDownloadButton' | 'showConversationsButton' | 'showBotInfoButton' | 'showCloseButton' | 'botConversationDescription' | 'customButtons'>;
1
+ import { ComponentProps, FC, ReactNode } from 'react';
2
+ import { StyleOptions } from '../contexts';
3
+ type HeaderProps = {
4
+ defaultOpen?: boolean;
5
+ open?: boolean;
6
+ disabled?: boolean;
7
+ onOpenChange?(open: boolean): void;
8
+ } & ComponentProps<'div'>;
9
+ type ContentProps = {
10
+ asChild?: true | undefined;
11
+ } & ComponentProps<'button'>;
12
+ type ExpandedContentProps = {
13
+ asChild?: true | undefined;
14
+ forceMount?: true | undefined;
15
+ } & ComponentProps<'div'>;
16
+ type DescriptionItemProps = {
17
+ title?: ReactNode;
18
+ icon?: FC<StyleOptions>;
19
+ link?: string;
20
+ };
21
+ declare const HeaderNamespace: import("react").NamedExoticComponent<Omit<HeaderProps, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
22
+ readonly type: import("react").ForwardRefExoticComponent<Omit<HeaderProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
23
+ } & {
24
+ Content: import("react").ForwardRefExoticComponent<Omit<ContentProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
25
+ ExpandedContent: import("react").ForwardRefExoticComponent<Omit<ExpandedContentProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
26
+ Avatar: import("react").ForwardRefExoticComponent<{
27
+ src?: string | undefined;
28
+ } & {
29
+ children?: ReactNode;
30
+ } & import("react").RefAttributes<HTMLSpanElement>>;
31
+ Description: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
32
+ Title: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & import("react").RefAttributes<HTMLHeadingElement>>;
33
+ Actions: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
34
+ DescriptionItem: ({ icon, title, link, ...props }: DescriptionItemProps) => JSX.Element | null;
35
+ };
36
+ export { HeaderNamespace as Header };
@@ -0,0 +1,2 @@
1
+ import { ComponentProps } from 'react';
2
+ export declare const LoadingIndicator: import("react").MemoExoticComponent<({ ...props }: ComponentProps<'div'>) => JSX.Element>;
@@ -0,0 +1,7 @@
1
+ import { ComponentProps } from 'react';
2
+ import type { MessageObject } from '../types';
3
+ type MessageProps = {
4
+ scroll: () => void;
5
+ } & Partial<MessageObject> & ComponentProps<'div'>;
6
+ export declare const Message: import("react").ForwardRefExoticComponent<Omit<MessageProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
7
+ export {};
@@ -0,0 +1,2 @@
1
+ import { ComponentProps } from 'react';
2
+ export declare const MessageList: import("react").MemoExoticComponent<({ ...props }: ComponentProps<'ul'>) => JSX.Element>;
@@ -0,0 +1,17 @@
1
+ import * as Dialog from '@radix-ui/react-dialog';
2
+ import { ReactNode } from 'react';
3
+ export declare function Modal({ open, onOpenChange, children, }: {
4
+ open?: boolean;
5
+ onOpenChange?: (open: boolean) => void;
6
+ children: ReactNode;
7
+ }): JSX.Element;
8
+ export declare namespace Modal {
9
+ var Button: import("react").ForwardRefExoticComponent<Dialog.DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
10
+ var Close: import("react").ForwardRefExoticComponent<Dialog.DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
11
+ var Content: typeof ModalContent;
12
+ }
13
+ declare function ModalContent({ title, children }: {
14
+ title: string;
15
+ children: ReactNode;
16
+ }): JSX.Element;
17
+ export {};