@botonic/react 0.31.1-alpha.0 → 0.31.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 (452) hide show
  1. package/lib/cjs/webchat/context/index.js +4 -1
  2. package/lib/cjs/webchat/context/index.js.map +1 -1
  3. package/lib/cjs/webchat/context/types.d.ts +3 -1
  4. package/lib/cjs/webchat/context/use-webchat.d.ts +1 -1
  5. package/lib/cjs/webchat/context/use-webchat.js +2 -2
  6. package/lib/cjs/webchat/context/use-webchat.js.map +1 -1
  7. package/lib/cjs/webchat/hooks/use-scrollbar-controller.js +14 -14
  8. package/lib/cjs/webchat/hooks/use-scrollbar-controller.js.map +1 -1
  9. package/lib/cjs/webchat/hooks/use-webchat-dimensions.js +3 -3
  10. package/lib/cjs/webchat/hooks/use-webchat-dimensions.js.map +1 -1
  11. package/lib/cjs/webchat/hooks/use-webchat-resizer.js +5 -5
  12. package/lib/cjs/webchat/hooks/use-webchat-resizer.js.map +1 -1
  13. package/lib/cjs/webchat/webchat.js +9 -14
  14. package/lib/cjs/webchat/webchat.js.map +1 -1
  15. package/lib/cjs/webchat/webview/header.d.ts +1 -0
  16. package/lib/cjs/webchat/webview/header.js +16 -0
  17. package/lib/cjs/webchat/webview/header.js.map +1 -0
  18. package/lib/cjs/webchat/webview/index.d.ts +1 -0
  19. package/lib/cjs/webchat/webview/index.js +49 -0
  20. package/lib/cjs/webchat/webview/index.js.map +1 -0
  21. package/lib/cjs/webchat/webview/styles.d.ts +7 -0
  22. package/lib/cjs/webchat/webview/styles.js +46 -0
  23. package/lib/cjs/webchat/webview/styles.js.map +1 -0
  24. package/lib/esm/app.d.ts +2 -0
  25. package/lib/esm/app.js +6 -0
  26. package/lib/esm/app.js.map +1 -0
  27. package/lib/esm/botonic-tester.d.ts +30 -0
  28. package/lib/esm/botonic-tester.js +78 -0
  29. package/lib/esm/botonic-tester.js.map +1 -0
  30. package/lib/esm/components/audio.d.ts +9 -0
  31. package/lib/esm/components/audio.js +21 -0
  32. package/lib/esm/components/audio.js.map +1 -0
  33. package/lib/esm/components/button.d.ts +17 -0
  34. package/lib/esm/components/button.js +159 -0
  35. package/lib/esm/components/button.js.map +1 -0
  36. package/lib/esm/components/buttons-disabler.d.ts +24 -0
  37. package/lib/esm/components/buttons-disabler.js +84 -0
  38. package/lib/esm/components/buttons-disabler.js.map +1 -0
  39. package/lib/esm/components/carousel.d.ts +10 -0
  40. package/lib/esm/components/carousel.js +105 -0
  41. package/lib/esm/components/carousel.js.map +1 -0
  42. package/lib/esm/components/components.d.ts +12 -0
  43. package/lib/esm/components/components.js +17 -0
  44. package/lib/esm/components/components.js.map +1 -0
  45. package/lib/esm/components/custom-message.d.ts +16 -0
  46. package/lib/esm/components/custom-message.js +50 -0
  47. package/lib/esm/components/custom-message.js.map +1 -0
  48. package/lib/esm/components/document.d.ts +9 -0
  49. package/lib/esm/components/document.js +42 -0
  50. package/lib/esm/components/document.js.map +1 -0
  51. package/lib/esm/components/element.d.ts +4 -0
  52. package/lib/esm/components/element.js +51 -0
  53. package/lib/esm/components/element.js.map +1 -0
  54. package/lib/esm/components/handoff.d.ts +1 -0
  55. package/lib/esm/components/handoff.js +49 -0
  56. package/lib/esm/components/handoff.js.map +1 -0
  57. package/lib/esm/components/image.d.ts +9 -0
  58. package/lib/esm/components/image.js +35 -0
  59. package/lib/esm/components/image.js.map +1 -0
  60. package/lib/esm/components/index-types.d.ts +89 -0
  61. package/lib/esm/components/index-types.js +2 -0
  62. package/lib/esm/components/index-types.js.map +1 -0
  63. package/lib/esm/components/index.d.ts +30 -0
  64. package/lib/esm/components/index.js +31 -0
  65. package/lib/esm/components/index.js.map +1 -0
  66. package/lib/esm/components/location.d.ts +11 -0
  67. package/lib/esm/components/location.js +27 -0
  68. package/lib/esm/components/location.js.map +1 -0
  69. package/lib/esm/components/markdown.d.ts +7 -0
  70. package/lib/esm/components/markdown.js +152 -0
  71. package/lib/esm/components/markdown.js.map +1 -0
  72. package/lib/esm/components/message/index.d.ts +1 -0
  73. package/lib/esm/components/message/index.js +147 -0
  74. package/lib/esm/components/message/index.js.map +1 -0
  75. package/lib/esm/components/message/message-feedback.d.ts +7 -0
  76. package/lib/esm/components/message/message-feedback.js +59 -0
  77. package/lib/esm/components/message/message-feedback.js.map +1 -0
  78. package/lib/esm/components/message/message-footer.d.ts +11 -0
  79. package/lib/esm/components/message/message-footer.js +17 -0
  80. package/lib/esm/components/message/message-footer.js.map +1 -0
  81. package/lib/esm/components/message/message-image.d.ts +7 -0
  82. package/lib/esm/components/message/message-image.js +19 -0
  83. package/lib/esm/components/message/message-image.js.map +1 -0
  84. package/lib/esm/components/message/styles.d.ts +33 -0
  85. package/lib/esm/components/message/styles.js +118 -0
  86. package/lib/esm/components/message/styles.js.map +1 -0
  87. package/lib/esm/components/message/timestamps.d.ts +13 -0
  88. package/lib/esm/components/message/timestamps.js +40 -0
  89. package/lib/esm/components/message/timestamps.js.map +1 -0
  90. package/lib/esm/components/message-template.d.ts +1 -0
  91. package/lib/esm/components/message-template.js +9 -0
  92. package/lib/esm/components/message-template.js.map +1 -0
  93. package/lib/esm/components/multichannel/facebook/facebook.d.ts +17 -0
  94. package/lib/esm/components/multichannel/facebook/facebook.js +43 -0
  95. package/lib/esm/components/multichannel/facebook/facebook.js.map +1 -0
  96. package/lib/esm/components/multichannel/index-types.d.ts +46 -0
  97. package/lib/esm/components/multichannel/index-types.js +2 -0
  98. package/lib/esm/components/multichannel/index-types.js.map +1 -0
  99. package/lib/esm/components/multichannel/index.d.ts +11 -0
  100. package/lib/esm/components/multichannel/index.js +12 -0
  101. package/lib/esm/components/multichannel/index.js.map +1 -0
  102. package/lib/esm/components/multichannel/multichannel-button.d.ts +1 -0
  103. package/lib/esm/components/multichannel/multichannel-button.js +67 -0
  104. package/lib/esm/components/multichannel/multichannel-button.js.map +1 -0
  105. package/lib/esm/components/multichannel/multichannel-carousel.d.ts +1 -0
  106. package/lib/esm/components/multichannel/multichannel-carousel.js +74 -0
  107. package/lib/esm/components/multichannel/multichannel-carousel.js.map +1 -0
  108. package/lib/esm/components/multichannel/multichannel-context.d.ts +11 -0
  109. package/lib/esm/components/multichannel/multichannel-context.js +12 -0
  110. package/lib/esm/components/multichannel/multichannel-context.js.map +1 -0
  111. package/lib/esm/components/multichannel/multichannel-reply.d.ts +1 -0
  112. package/lib/esm/components/multichannel/multichannel-reply.js +20 -0
  113. package/lib/esm/components/multichannel/multichannel-reply.js.map +1 -0
  114. package/lib/esm/components/multichannel/multichannel-text.d.ts +1 -0
  115. package/lib/esm/components/multichannel/multichannel-text.js +160 -0
  116. package/lib/esm/components/multichannel/multichannel-text.js.map +1 -0
  117. package/lib/esm/components/multichannel/multichannel-utils.d.ts +21 -0
  118. package/lib/esm/components/multichannel/multichannel-utils.js +81 -0
  119. package/lib/esm/components/multichannel/multichannel-utils.js.map +1 -0
  120. package/lib/esm/components/multichannel/multichannel.d.ts +1 -0
  121. package/lib/esm/components/multichannel/multichannel.js +57 -0
  122. package/lib/esm/components/multichannel/multichannel.js.map +1 -0
  123. package/lib/esm/components/multichannel/whatsapp/constants.d.ts +11 -0
  124. package/lib/esm/components/multichannel/whatsapp/constants.js +10 -0
  125. package/lib/esm/components/multichannel/whatsapp/constants.js.map +1 -0
  126. package/lib/esm/components/multichannel/whatsapp/markdown-meta.d.ts +1 -0
  127. package/lib/esm/components/multichannel/whatsapp/markdown-meta.js +38 -0
  128. package/lib/esm/components/multichannel/whatsapp/markdown-meta.js.map +1 -0
  129. package/lib/esm/components/pic.d.ts +6 -0
  130. package/lib/esm/components/pic.js +25 -0
  131. package/lib/esm/components/pic.js.map +1 -0
  132. package/lib/esm/components/raw.d.ts +9 -0
  133. package/lib/esm/components/raw.js +39 -0
  134. package/lib/esm/components/raw.js.map +1 -0
  135. package/lib/esm/components/reply.d.ts +10 -0
  136. package/lib/esm/components/reply.js +53 -0
  137. package/lib/esm/components/reply.js.map +1 -0
  138. package/lib/esm/components/share-button.d.ts +1 -0
  139. package/lib/esm/components/share-button.js +9 -0
  140. package/lib/esm/components/share-button.js.map +1 -0
  141. package/lib/esm/components/subtitle.d.ts +6 -0
  142. package/lib/esm/components/subtitle.js +19 -0
  143. package/lib/esm/components/subtitle.js.map +1 -0
  144. package/lib/esm/components/text.d.ts +7 -0
  145. package/lib/esm/components/text.js +40 -0
  146. package/lib/esm/components/text.js.map +1 -0
  147. package/lib/esm/components/title.d.ts +6 -0
  148. package/lib/esm/components/title.js +17 -0
  149. package/lib/esm/components/title.js.map +1 -0
  150. package/lib/esm/components/video.d.ts +9 -0
  151. package/lib/esm/components/video.js +25 -0
  152. package/lib/esm/components/video.js.map +1 -0
  153. package/lib/esm/components/webchat-settings.d.ts +16 -0
  154. package/lib/esm/components/webchat-settings.js +69 -0
  155. package/lib/esm/components/webchat-settings.js.map +1 -0
  156. package/lib/esm/components/whatsapp-button-list.d.ts +20 -0
  157. package/lib/esm/components/whatsapp-button-list.js +47 -0
  158. package/lib/esm/components/whatsapp-button-list.js.map +1 -0
  159. package/lib/esm/components/whatsapp-catalog.d.ts +6 -0
  160. package/lib/esm/components/whatsapp-catalog.js +21 -0
  161. package/lib/esm/components/whatsapp-catalog.js.map +1 -0
  162. package/lib/esm/components/whatsapp-cta-url-button.d.ts +15 -0
  163. package/lib/esm/components/whatsapp-cta-url-button.js +33 -0
  164. package/lib/esm/components/whatsapp-cta-url-button.js.map +1 -0
  165. package/lib/esm/components/whatsapp-media-carousel.d.ts +46 -0
  166. package/lib/esm/components/whatsapp-media-carousel.js +36 -0
  167. package/lib/esm/components/whatsapp-media-carousel.js.map +1 -0
  168. package/lib/esm/components/whatsapp-product-carousel.d.ts +32 -0
  169. package/lib/esm/components/whatsapp-product-carousel.js +30 -0
  170. package/lib/esm/components/whatsapp-product-carousel.js.map +1 -0
  171. package/lib/esm/components/whatsapp-product-list.d.ts +15 -0
  172. package/lib/esm/components/whatsapp-product-list.js +22 -0
  173. package/lib/esm/components/whatsapp-product-list.js.map +1 -0
  174. package/lib/esm/components/whatsapp-product.d.ts +7 -0
  175. package/lib/esm/components/whatsapp-product.js +21 -0
  176. package/lib/esm/components/whatsapp-product.js.map +1 -0
  177. package/lib/esm/components/whatsapp-template.d.ts +1 -0
  178. package/lib/esm/components/whatsapp-template.js +20 -0
  179. package/lib/esm/components/whatsapp-template.js.map +1 -0
  180. package/lib/esm/constants.d.ts +165 -0
  181. package/lib/esm/constants.js +187 -0
  182. package/lib/esm/constants.js.map +1 -0
  183. package/lib/esm/contexts.d.ts +18 -0
  184. package/lib/esm/contexts.js +18 -0
  185. package/lib/esm/contexts.js.map +1 -0
  186. package/lib/esm/dev-app.d.ts +38 -0
  187. package/lib/esm/dev-app.js +81 -0
  188. package/lib/esm/dev-app.js.map +1 -0
  189. package/lib/esm/index-types.d.ts +178 -0
  190. package/lib/esm/index-types.js +12 -0
  191. package/lib/esm/index-types.js.map +1 -0
  192. package/lib/esm/index.d.ts +11 -0
  193. package/lib/esm/index.js +12 -0
  194. package/lib/esm/index.js.map +1 -0
  195. package/lib/esm/message-utils.d.ts +19 -0
  196. package/lib/esm/message-utils.js +41 -0
  197. package/lib/esm/message-utils.js.map +1 -0
  198. package/lib/esm/msg-to-botonic.d.ts +18 -0
  199. package/lib/esm/msg-to-botonic.js +132 -0
  200. package/lib/esm/msg-to-botonic.js.map +1 -0
  201. package/lib/esm/node-app.d.ts +7 -0
  202. package/lib/esm/node-app.js +19 -0
  203. package/lib/esm/node-app.js.map +1 -0
  204. package/lib/esm/react-bot.d.ts +8 -0
  205. package/lib/esm/react-bot.js +32 -0
  206. package/lib/esm/react-bot.js.map +1 -0
  207. package/lib/esm/shared/styles.d.ts +2 -0
  208. package/lib/esm/shared/styles.js +28 -0
  209. package/lib/esm/shared/styles.js.map +1 -0
  210. package/lib/esm/util/dom.d.ts +4 -0
  211. package/lib/esm/util/dom.js +24 -0
  212. package/lib/esm/util/dom.js.map +1 -0
  213. package/lib/esm/util/environment.d.ts +6 -0
  214. package/lib/esm/util/environment.js +61 -0
  215. package/lib/esm/util/environment.js.map +1 -0
  216. package/lib/esm/util/error-boundary.d.ts +7 -0
  217. package/lib/esm/util/error-boundary.js +28 -0
  218. package/lib/esm/util/error-boundary.js.map +1 -0
  219. package/lib/esm/util/functional.d.ts +3 -0
  220. package/lib/esm/util/functional.js +26 -0
  221. package/lib/esm/util/functional.js.map +1 -0
  222. package/lib/esm/util/index.d.ts +9 -0
  223. package/lib/esm/util/index.js +10 -0
  224. package/lib/esm/util/index.js.map +1 -0
  225. package/lib/esm/util/logs.d.ts +2 -0
  226. package/lib/esm/util/logs.js +15 -0
  227. package/lib/esm/util/logs.js.map +1 -0
  228. package/lib/esm/util/objects.d.ts +3 -0
  229. package/lib/esm/util/objects.js +38 -0
  230. package/lib/esm/util/objects.js.map +1 -0
  231. package/lib/esm/util/react.d.ts +12 -0
  232. package/lib/esm/util/react.js +34 -0
  233. package/lib/esm/util/react.js.map +1 -0
  234. package/lib/esm/util/regexs.d.ts +2 -0
  235. package/lib/esm/util/regexs.js +18 -0
  236. package/lib/esm/util/regexs.js.map +1 -0
  237. package/lib/esm/util/strings.d.ts +1 -0
  238. package/lib/esm/util/strings.js +7 -0
  239. package/lib/esm/util/strings.js.map +1 -0
  240. package/lib/esm/util/webchat.d.ts +22 -0
  241. package/lib/esm/util/webchat.js +55 -0
  242. package/lib/esm/util/webchat.js.map +1 -0
  243. package/lib/esm/util/webviews.d.ts +1 -0
  244. package/lib/esm/util/webviews.js +6 -0
  245. package/lib/esm/util/webviews.js.map +1 -0
  246. package/lib/esm/webchat/chat-area/index.d.ts +1 -0
  247. package/lib/esm/webchat/chat-area/index.js +18 -0
  248. package/lib/esm/webchat/chat-area/index.js.map +1 -0
  249. package/lib/esm/webchat/chat-area/styles.d.ts +3 -0
  250. package/lib/esm/webchat/chat-area/styles.js +9 -0
  251. package/lib/esm/webchat/chat-area/styles.js.map +1 -0
  252. package/lib/esm/webchat/components/common.d.ts +1 -0
  253. package/lib/esm/webchat/components/common.js +9 -0
  254. package/lib/esm/webchat/components/common.js.map +1 -0
  255. package/lib/esm/webchat/components/conditional-animation.d.ts +1 -0
  256. package/lib/esm/webchat/components/conditional-animation.js +12 -0
  257. package/lib/esm/webchat/components/conditional-animation.js.map +1 -0
  258. package/lib/esm/webchat/components/opened-persistent-menu.d.ts +6 -0
  259. package/lib/esm/webchat/components/opened-persistent-menu.js +30 -0
  260. package/lib/esm/webchat/components/opened-persistent-menu.js.map +1 -0
  261. package/lib/esm/webchat/constants.d.ts +8 -0
  262. package/lib/esm/webchat/constants.js +10 -0
  263. package/lib/esm/webchat/constants.js.map +1 -0
  264. package/lib/esm/webchat/context/actions.d.ts +29 -0
  265. package/lib/esm/webchat/context/actions.js +32 -0
  266. package/lib/esm/webchat/context/actions.js.map +1 -0
  267. package/lib/esm/webchat/context/index.d.ts +5 -0
  268. package/lib/esm/webchat/context/index.js +81 -0
  269. package/lib/esm/webchat/context/index.js.map +1 -0
  270. package/lib/esm/webchat/context/messages-reducer.d.ts +6 -0
  271. package/lib/esm/webchat/context/messages-reducer.js +85 -0
  272. package/lib/esm/webchat/context/messages-reducer.js.map +1 -0
  273. package/lib/esm/webchat/context/types.d.ts +76 -0
  274. package/lib/esm/webchat/context/types.js +2 -0
  275. package/lib/esm/webchat/context/types.js.map +1 -0
  276. package/lib/esm/webchat/context/use-webchat.d.ts +47 -0
  277. package/lib/esm/webchat/context/use-webchat.js +195 -0
  278. package/lib/esm/webchat/context/use-webchat.js.map +1 -0
  279. package/lib/esm/webchat/context/webchat-reducer.d.ts +6 -0
  280. package/lib/esm/webchat/context/webchat-reducer.js +48 -0
  281. package/lib/esm/webchat/context/webchat-reducer.js.map +1 -0
  282. package/lib/esm/webchat/cover-component/index.d.ts +6 -0
  283. package/lib/esm/webchat/cover-component/index.js +17 -0
  284. package/lib/esm/webchat/cover-component/index.js.map +1 -0
  285. package/lib/esm/webchat/devices/index.d.ts +11 -0
  286. package/lib/esm/webchat/devices/index.js +18 -0
  287. package/lib/esm/webchat/devices/index.js.map +1 -0
  288. package/lib/esm/webchat/header/default-header.d.ts +1 -0
  289. package/lib/esm/webchat/header/default-header.js +21 -0
  290. package/lib/esm/webchat/header/default-header.js.map +1 -0
  291. package/lib/esm/webchat/header/index.d.ts +2 -0
  292. package/lib/esm/webchat/header/index.js +20 -0
  293. package/lib/esm/webchat/header/index.js.map +1 -0
  294. package/lib/esm/webchat/header/styles.d.ts +7 -0
  295. package/lib/esm/webchat/header/styles.js +55 -0
  296. package/lib/esm/webchat/header/styles.js.map +1 -0
  297. package/lib/esm/webchat/hooks/index.d.ts +10 -0
  298. package/lib/esm/webchat/hooks/index.js +11 -0
  299. package/lib/esm/webchat/hooks/index.js.map +1 -0
  300. package/lib/esm/webchat/hooks/use-component-visible.d.ts +8 -0
  301. package/lib/esm/webchat/hooks/use-component-visible.js +20 -0
  302. package/lib/esm/webchat/hooks/use-component-visible.js.map +1 -0
  303. package/lib/esm/webchat/hooks/use-component-will-mount.d.ts +1 -0
  304. package/lib/esm/webchat/hooks/use-component-will-mount.js +5 -0
  305. package/lib/esm/webchat/hooks/use-component-will-mount.js.map +1 -0
  306. package/lib/esm/webchat/hooks/use-device-adapter.d.ts +3 -0
  307. package/lib/esm/webchat/hooks/use-device-adapter.js +42 -0
  308. package/lib/esm/webchat/hooks/use-device-adapter.js.map +1 -0
  309. package/lib/esm/webchat/hooks/use-previous.d.ts +1 -0
  310. package/lib/esm/webchat/hooks/use-previous.js +9 -0
  311. package/lib/esm/webchat/hooks/use-previous.js.map +1 -0
  312. package/lib/esm/webchat/hooks/use-scroll-to-bottom.d.ts +9 -0
  313. package/lib/esm/webchat/hooks/use-scroll-to-bottom.js +19 -0
  314. package/lib/esm/webchat/hooks/use-scroll-to-bottom.js.map +1 -0
  315. package/lib/esm/webchat/hooks/use-scrollbar-controller.d.ts +6 -0
  316. package/lib/esm/webchat/hooks/use-scrollbar-controller.js +136 -0
  317. package/lib/esm/webchat/hooks/use-scrollbar-controller.js.map +1 -0
  318. package/lib/esm/webchat/hooks/use-typing.d.ts +10 -0
  319. package/lib/esm/webchat/hooks/use-typing.js +28 -0
  320. package/lib/esm/webchat/hooks/use-typing.js.map +1 -0
  321. package/lib/esm/webchat/hooks/use-virtual-keyboard-detection.d.ts +3 -0
  322. package/lib/esm/webchat/hooks/use-virtual-keyboard-detection.js +24 -0
  323. package/lib/esm/webchat/hooks/use-virtual-keyboard-detection.js.map +1 -0
  324. package/lib/esm/webchat/hooks/use-webchat-dimensions.d.ts +4 -0
  325. package/lib/esm/webchat/hooks/use-webchat-dimensions.js +36 -0
  326. package/lib/esm/webchat/hooks/use-webchat-dimensions.js.map +1 -0
  327. package/lib/esm/webchat/hooks/use-webchat-resizer.d.ts +4 -0
  328. package/lib/esm/webchat/hooks/use-webchat-resizer.js +30 -0
  329. package/lib/esm/webchat/hooks/use-webchat-resizer.js.map +1 -0
  330. package/lib/esm/webchat/index-types.d.ts +18 -0
  331. package/lib/esm/webchat/index-types.js +2 -0
  332. package/lib/esm/webchat/index-types.js.map +1 -0
  333. package/lib/esm/webchat/index.d.ts +5 -0
  334. package/lib/esm/webchat/index.js +11 -0
  335. package/lib/esm/webchat/index.js.map +1 -0
  336. package/lib/esm/webchat/input-panel/attachment.d.ts +7 -0
  337. package/lib/esm/webchat/input-panel/attachment.js +26 -0
  338. package/lib/esm/webchat/input-panel/attachment.js.map +1 -0
  339. package/lib/esm/webchat/input-panel/emoji-picker.d.ts +6 -0
  340. package/lib/esm/webchat/input-panel/emoji-picker.js +23 -0
  341. package/lib/esm/webchat/input-panel/emoji-picker.js.map +1 -0
  342. package/lib/esm/webchat/input-panel/index.d.ts +12 -0
  343. package/lib/esm/webchat/input-panel/index.js +55 -0
  344. package/lib/esm/webchat/input-panel/index.js.map +1 -0
  345. package/lib/esm/webchat/input-panel/opened-emoji-picker.d.ts +6 -0
  346. package/lib/esm/webchat/input-panel/opened-emoji-picker.js +10 -0
  347. package/lib/esm/webchat/input-panel/opened-emoji-picker.js.map +1 -0
  348. package/lib/esm/webchat/input-panel/persistent-menu.d.ts +6 -0
  349. package/lib/esm/webchat/input-panel/persistent-menu.js +14 -0
  350. package/lib/esm/webchat/input-panel/persistent-menu.js.map +1 -0
  351. package/lib/esm/webchat/input-panel/send-button.d.ts +5 -0
  352. package/lib/esm/webchat/input-panel/send-button.js +14 -0
  353. package/lib/esm/webchat/input-panel/send-button.js.map +1 -0
  354. package/lib/esm/webchat/input-panel/styles.d.ts +3 -0
  355. package/lib/esm/webchat/input-panel/styles.js +27 -0
  356. package/lib/esm/webchat/input-panel/styles.js.map +1 -0
  357. package/lib/esm/webchat/input-panel/textarea.d.ts +11 -0
  358. package/lib/esm/webchat/input-panel/textarea.js +58 -0
  359. package/lib/esm/webchat/input-panel/textarea.js.map +1 -0
  360. package/lib/esm/webchat/message-list/index.d.ts +1 -0
  361. package/lib/esm/webchat/message-list/index.js +107 -0
  362. package/lib/esm/webchat/message-list/index.js.map +1 -0
  363. package/lib/esm/webchat/message-list/intro-message.d.ts +1 -0
  364. package/lib/esm/webchat/message-list/intro-message.js +18 -0
  365. package/lib/esm/webchat/message-list/intro-message.js.map +1 -0
  366. package/lib/esm/webchat/message-list/scroll-button.d.ts +6 -0
  367. package/lib/esm/webchat/message-list/scroll-button.js +12 -0
  368. package/lib/esm/webchat/message-list/scroll-button.js.map +1 -0
  369. package/lib/esm/webchat/message-list/styles.d.ts +5 -0
  370. package/lib/esm/webchat/message-list/styles.js +56 -0
  371. package/lib/esm/webchat/message-list/styles.js.map +1 -0
  372. package/lib/esm/webchat/message-list/unread-messages-banner.d.ts +6 -0
  373. package/lib/esm/webchat/message-list/unread-messages-banner.js +13 -0
  374. package/lib/esm/webchat/message-list/unread-messages-banner.js.map +1 -0
  375. package/lib/esm/webchat/message-list/use-debounce.d.ts +1 -0
  376. package/lib/esm/webchat/message-list/use-debounce.js +14 -0
  377. package/lib/esm/webchat/message-list/use-debounce.js.map +1 -0
  378. package/lib/esm/webchat/message-list/use-notifications.d.ts +7 -0
  379. package/lib/esm/webchat/message-list/use-notifications.js +20 -0
  380. package/lib/esm/webchat/message-list/use-notifications.js.map +1 -0
  381. package/lib/esm/webchat/replies/index.d.ts +1 -0
  382. package/lib/esm/webchat/replies/index.js +28 -0
  383. package/lib/esm/webchat/replies/index.js.map +1 -0
  384. package/lib/esm/webchat/replies/styles.d.ts +8 -0
  385. package/lib/esm/webchat/replies/styles.js +21 -0
  386. package/lib/esm/webchat/replies/styles.js.map +1 -0
  387. package/lib/esm/webchat/session-view.d.ts +1 -0
  388. package/lib/esm/webchat/session-view.js +96 -0
  389. package/lib/esm/webchat/session-view.js.map +1 -0
  390. package/lib/esm/webchat/styles.d.ts +9 -0
  391. package/lib/esm/webchat/styles.js +50 -0
  392. package/lib/esm/webchat/styles.js.map +1 -0
  393. package/lib/esm/webchat/theme/types.d.ts +167 -0
  394. package/lib/esm/webchat/theme/types.js +2 -0
  395. package/lib/esm/webchat/theme/types.js.map +1 -0
  396. package/lib/esm/webchat/tracking.d.ts +7 -0
  397. package/lib/esm/webchat/tracking.js +10 -0
  398. package/lib/esm/webchat/tracking.js.map +1 -0
  399. package/lib/esm/webchat/trigger-button/index.d.ts +2 -0
  400. package/lib/esm/webchat/trigger-button/index.js +28 -0
  401. package/lib/esm/webchat/trigger-button/index.js.map +1 -0
  402. package/lib/esm/webchat/trigger-button/styles.d.ts +3 -0
  403. package/lib/esm/webchat/trigger-button/styles.js +36 -0
  404. package/lib/esm/webchat/trigger-button/styles.js.map +1 -0
  405. package/lib/esm/webchat/typing-indicator/index.d.ts +3 -0
  406. package/lib/esm/webchat/typing-indicator/index.js +8 -0
  407. package/lib/esm/webchat/typing-indicator/index.js.map +1 -0
  408. package/lib/esm/webchat/typing-indicator/styles.d.ts +7 -0
  409. package/lib/esm/webchat/typing-indicator/styles.js +46 -0
  410. package/lib/esm/webchat/typing-indicator/styles.js.map +1 -0
  411. package/lib/esm/webchat/use-storage-state-hook.d.ts +1 -0
  412. package/lib/esm/webchat/use-storage-state-hook.js +38 -0
  413. package/lib/esm/webchat/use-storage-state-hook.js.map +1 -0
  414. package/lib/esm/webchat/utils.d.ts +2 -0
  415. package/lib/esm/webchat/utils.js +8 -0
  416. package/lib/esm/webchat/utils.js.map +1 -0
  417. package/lib/esm/webchat/webchat-dev.d.ts +7 -0
  418. package/lib/esm/webchat/webchat-dev.js +56 -0
  419. package/lib/esm/webchat/webchat-dev.js.map +1 -0
  420. package/lib/esm/webchat/webchat.d.ts +4 -0
  421. package/lib/esm/webchat/webchat.js +517 -0
  422. package/lib/esm/webchat/webchat.js.map +1 -0
  423. package/lib/esm/webchat/webview/header.d.ts +1 -0
  424. package/lib/esm/webchat/webview/header.js +12 -0
  425. package/lib/esm/webchat/webview/header.js.map +1 -0
  426. package/lib/esm/webchat/webview/index.d.ts +1 -0
  427. package/lib/esm/webchat/webview/index.js +45 -0
  428. package/lib/esm/webchat/webview/index.js.map +1 -0
  429. package/lib/esm/webchat/webview/styles.d.ts +7 -0
  430. package/lib/esm/webchat/webview/styles.js +42 -0
  431. package/lib/esm/webchat/webview/styles.js.map +1 -0
  432. package/lib/esm/webchat-app.d.ts +78 -0
  433. package/lib/esm/webchat-app.js +363 -0
  434. package/lib/esm/webchat-app.js.map +1 -0
  435. package/lib/esm/webview-app.d.ts +7 -0
  436. package/lib/esm/webview-app.js +105 -0
  437. package/lib/esm/webview-app.js.map +1 -0
  438. package/package.json +2 -2
  439. package/src/webchat/context/index.tsx +4 -1
  440. package/src/webchat/context/types.ts +3 -1
  441. package/src/webchat/context/use-webchat.ts +3 -3
  442. package/src/webchat/hooks/use-scrollbar-controller.ts +20 -15
  443. package/src/webchat/hooks/use-webchat-dimensions.ts +3 -3
  444. package/src/webchat/hooks/use-webchat-resizer.ts +5 -5
  445. package/src/webchat/webchat.tsx +10 -29
  446. package/src/webchat/webview/header.tsx +22 -0
  447. package/src/webchat/webview/index.tsx +80 -0
  448. package/src/webchat/webview/styles.ts +48 -0
  449. package/lib/cjs/webchat/webview.d.ts +0 -2
  450. package/lib/cjs/webchat/webview.js +0 -76
  451. package/lib/cjs/webchat/webview.js.map +0 -1
  452. package/src/webchat/webview.jsx +0 -106
@@ -0,0 +1 @@
1
+ export declare const IntroMessage: () => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useContext } from 'react';
3
+ import { WEBCHAT } from '../../constants';
4
+ import { Fade } from '../../shared/styles';
5
+ import { resolveImage } from '../../util/environment';
6
+ import { ConditionalWrapper } from '../../util/react';
7
+ import { WebchatContext } from '../../webchat/context';
8
+ import { DefaultIntroImage } from './styles';
9
+ export const IntroMessage = () => {
10
+ const { getThemeProperty } = useContext(WebchatContext);
11
+ const animationsEnabled = getThemeProperty(WEBCHAT.CUSTOM_PROPERTIES.enableAnimations, true);
12
+ const CustomIntro = getThemeProperty(WEBCHAT.CUSTOM_PROPERTIES.customIntro);
13
+ const introImage = getThemeProperty(WEBCHAT.CUSTOM_PROPERTIES.introImage);
14
+ const introStyle = getThemeProperty(WEBCHAT.CUSTOM_PROPERTIES.introStyle);
15
+ const DefaultIntro = introImage && (_jsx(DefaultIntroImage, { style: Object.assign({}, introStyle), src: resolveImage(introImage) }));
16
+ return CustomIntro || DefaultIntro ? (_jsx(ConditionalWrapper, Object.assign({ condition: animationsEnabled, wrapper: children => _jsx(Fade, { children: children }) }, { children: CustomIntro ? _jsx(CustomIntro, {}) : DefaultIntro }))) : null;
17
+ };
18
+ //# sourceMappingURL=intro-message.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intro-message.js","sourceRoot":"","sources":["../../../../src/webchat/message-list/intro-message.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAE5C,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,MAAM,EAAE,gBAAgB,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAA;IAEvD,MAAM,iBAAiB,GAAG,gBAAgB,CACxC,OAAO,CAAC,iBAAiB,CAAC,gBAAgB,EAC1C,IAAI,CACL,CAAA;IACD,MAAM,WAAW,GAAG,gBAAgB,CAAC,OAAO,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAA;IAC3E,MAAM,UAAU,GAAG,gBAAgB,CAAC,OAAO,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAA;IACzE,MAAM,UAAU,GAAG,gBAAgB,CAAC,OAAO,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAA;IAEzE,MAAM,YAAY,GAAG,UAAU,IAAI,CACjC,KAAC,iBAAiB,IAChB,KAAK,oBACA,UAAU,GAEf,GAAG,EAAE,YAAY,CAAC,UAAU,CAAC,GAC7B,CACH,CAAA;IAED,OAAO,WAAW,IAAI,YAAY,CAAC,CAAC,CAAC,CACnC,KAAC,kBAAkB,kBACjB,SAAS,EAAE,iBAAiB,EAC5B,OAAO,EAAE,QAAQ,CAAC,EAAE,CAAC,KAAC,IAAI,cAAE,QAAQ,GAAQ,gBAE3C,WAAW,CAAC,CAAC,CAAC,KAAC,WAAW,KAAG,CAAC,CAAC,CAAC,YAAY,IAC1B,CACtB,CAAC,CAAC,CAAC,IAAI,CAAA;AACV,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ interface ScrollButtonProps {
3
+ handleClick: () => void;
4
+ }
5
+ export declare const ScrollButton: ({ handleClick, }: ScrollButtonProps) => JSX.Element;
6
+ export {};
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import ArrowScrollDown from '../../assets/arrow-scroll-down.svg';
3
+ import { resolveImage } from '../../util/environment';
4
+ import { ContainerScrollButton } from './styles';
5
+ import { useDebounce } from './use-debounce';
6
+ import { useNotifications } from './use-notifications';
7
+ export const ScrollButton = ({ handleClick, }) => {
8
+ const { CustomScrollButton, scrollButtonEnabled } = useNotifications();
9
+ const show = useDebounce();
10
+ return (_jsx(_Fragment, { children: scrollButtonEnabled && show ? (_jsx(_Fragment, { children: CustomScrollButton ? (_jsx(CustomScrollButton, { handleScrollToBottom: handleClick })) : (_jsx(ContainerScrollButton, Object.assign({ onClick: handleClick }, { children: _jsx("img", { src: resolveImage(ArrowScrollDown) }) }))) })) : null }));
11
+ };
12
+ //# sourceMappingURL=scroll-button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scroll-button.js","sourceRoot":"","sources":["../../../../src/webchat/message-list/scroll-button.tsx"],"names":[],"mappings":";AAEA,OAAO,eAAe,MAAM,oCAAoC,CAAA;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAMtD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAC3B,WAAW,GACO,EAAe,EAAE;IACnC,MAAM,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,GAAG,gBAAgB,EAAE,CAAA;IAEtE,MAAM,IAAI,GAAG,WAAW,EAAE,CAAA;IAE1B,OAAO,CACL,4BACG,mBAAmB,IAAI,IAAI,CAAC,CAAC,CAAC,CAC7B,4BACG,kBAAkB,CAAC,CAAC,CAAC,CACpB,KAAC,kBAAkB,IAAC,oBAAoB,EAAE,WAAW,GAAI,CAC1D,CAAC,CAAC,CAAC,CACF,KAAC,qBAAqB,kBAAC,OAAO,EAAE,WAAW,gBACzC,cAAK,GAAG,EAAE,YAAY,CAAC,eAAe,CAAC,GAAI,IACrB,CACzB,GACA,CACJ,CAAC,CAAC,CAAC,IAAI,GACP,CACJ,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,5 @@
1
+ export declare const ContainerMessage: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ export declare const DefaultIntroImage: import("styled-components").StyledComponent<"img", any, {}, never>;
3
+ export declare const ContainerScrollButton: import("styled-components").StyledComponent<"div", any, {}, never>;
4
+ export declare const ContainerUnreadMessagesBanner: import("styled-components").StyledComponent<"div", any, {}, never>;
5
+ export declare const ScrollableMessageList: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,56 @@
1
+ import styled from 'styled-components';
2
+ export const ContainerMessage = styled.div `
3
+ display: flex;
4
+ overflow-x: hidden;
5
+ flex-direction: column;
6
+ flex: none;
7
+ white-space: pre;
8
+ word-wrap: break-word;
9
+ `;
10
+ export const DefaultIntroImage = styled.img `
11
+ max-height: 50%;
12
+ width: 100%;
13
+ `;
14
+ export const ContainerScrollButton = styled.div `
15
+ position: sticky;
16
+ left: 85%;
17
+ bottom: 15px;
18
+
19
+ background-color: #6d6a78;
20
+ cursor: pointer;
21
+ display: flex;
22
+ align-items: center;
23
+ justify-content: center;
24
+
25
+ width: 37px;
26
+ height: 37px;
27
+ border-radius: 50%;
28
+ `;
29
+ export const ContainerUnreadMessagesBanner = styled.div `
30
+ display: flex;
31
+ justify-content: center;
32
+ align-items: center;
33
+ gap: 5px;
34
+
35
+ border-top: 1px solid #e8e8ea;
36
+ padding: 8px;
37
+ color: #6d6a78;
38
+ font-size: 14px;
39
+ font-weight: 400;
40
+ width: 100%;
41
+
42
+ img {
43
+ width: 10px;
44
+ }
45
+ `;
46
+ export const ScrollableMessageList = styled.div `
47
+ display: flex;
48
+ flex: 1;
49
+ flex-direction: column;
50
+ overflow-y: auto;
51
+ overflow-x: hidden;
52
+ overscroll-behavior: contain; // https://css-tricks.com/almanac/properties/o/overscroll-behavior/
53
+ scroll-behavior: smooth;
54
+ -webkit-overflow-scrolling: touch;
55
+ `;
56
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/webchat/message-list/styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;CAOzC,CAAA;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAG1C,CAAA;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;CAc9C,CAAA;AAED,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;CAgBtD,CAAA;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;CAS9C,CAAA"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface UnreadMessagesBannerProps {
3
+ unreadMessagesBannerRef: React.RefObject<HTMLDivElement>;
4
+ }
5
+ export declare const UnreadMessagesBanner: ({ unreadMessagesBannerRef, }: UnreadMessagesBannerProps) => JSX.Element;
6
+ export {};
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useContext } from 'react';
3
+ import ArrowDown from '../../assets/arrow-down.svg';
4
+ import { resolveImage } from '../../util/environment';
5
+ import { WebchatContext } from '../../webchat/context';
6
+ import { ContainerUnreadMessagesBanner } from './styles';
7
+ import { useNotifications } from './use-notifications';
8
+ export const UnreadMessagesBanner = ({ unreadMessagesBannerRef, }) => {
9
+ const { webchatState } = useContext(WebchatContext);
10
+ const { notificationsEnabled, CustomUnreadMessagesBanner, bannerText } = useNotifications();
11
+ return (_jsx(_Fragment, { children: notificationsEnabled ? (_jsx("div", Object.assign({ ref: unreadMessagesBannerRef }, { children: CustomUnreadMessagesBanner ? (_jsx(CustomUnreadMessagesBanner, {})) : (_jsxs(ContainerUnreadMessagesBanner, { children: [_jsx("img", { src: resolveImage(ArrowDown) }), webchatState.numUnreadMessages, " ", bannerText] })) }))) : null }));
12
+ };
13
+ //# sourceMappingURL=unread-messages-banner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unread-messages-banner.js","sourceRoot":"","sources":["../../../../src/webchat/message-list/unread-messages-banner.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,SAAS,MAAM,6BAA6B,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAA;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAMtD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,EACnC,uBAAuB,GACG,EAAe,EAAE;IAC3C,MAAM,EAAE,YAAY,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAA;IAEnD,MAAM,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,UAAU,EAAE,GACpE,gBAAgB,EAAE,CAAA;IAEpB,OAAO,CACL,4BACG,oBAAoB,CAAC,CAAC,CAAC,CACtB,4BAAK,GAAG,EAAE,uBAAuB,gBAC9B,0BAA0B,CAAC,CAAC,CAAC,CAC5B,KAAC,0BAA0B,KAAG,CAC/B,CAAC,CAAC,CAAC,CACF,MAAC,6BAA6B,eAC5B,cAAK,GAAG,EAAE,YAAY,CAAC,SAAS,CAAC,GAAI,EACpC,YAAY,CAAC,iBAAiB,OAAG,UAAU,IACd,CACjC,IACG,CACP,CAAC,CAAC,CAAC,IAAI,GACP,CACJ,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ export declare function useDebounce(delay?: number): boolean;
@@ -0,0 +1,14 @@
1
+ import { useEffect, useState } from 'react';
2
+ export function useDebounce(delay) {
3
+ const [show, setShow] = useState(false);
4
+ useEffect(() => {
5
+ const timeoutId = setTimeout(() => {
6
+ setShow(true);
7
+ }, delay || 500);
8
+ return () => {
9
+ clearTimeout(timeoutId);
10
+ };
11
+ }, []);
12
+ return show;
13
+ }
14
+ //# sourceMappingURL=use-debounce.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-debounce.js","sourceRoot":"","sources":["../../../../src/webchat/message-list/use-debounce.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAE3C,MAAM,UAAU,WAAW,CAAC,KAAc;IACxC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IACvC,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE;YAChC,OAAO,CAAC,IAAI,CAAC,CAAA;QACf,CAAC,EAAE,KAAK,IAAI,GAAG,CAAC,CAAA;QAEhB,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,SAAS,CAAC,CAAA;QACzB,CAAC,CAAA;IACH,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,OAAO,IAAI,CAAA;AACb,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare function useNotifications(): {
2
+ notificationsEnabled: any;
3
+ bannerText: any;
4
+ CustomUnreadMessagesBanner: any;
5
+ CustomScrollButton: any;
6
+ scrollButtonEnabled: any;
7
+ };
@@ -0,0 +1,20 @@
1
+ import { useContext } from 'react';
2
+ import { WEBCHAT } from '../../constants';
3
+ import { WebchatContext } from '../../webchat/context';
4
+ export function useNotifications() {
5
+ const { getThemeProperty } = useContext(WebchatContext);
6
+ const CustomUnreadMessagesBanner = getThemeProperty(WEBCHAT.CUSTOM_PROPERTIES.notificationsBannerCustom, undefined);
7
+ const notificationsBannerEnabled = getThemeProperty(WEBCHAT.CUSTOM_PROPERTIES.notificationsBannerEnabled, undefined);
8
+ const notificationsEnabled = getThemeProperty(WEBCHAT.CUSTOM_PROPERTIES.notificationsEnabled, CustomUnreadMessagesBanner || notificationsBannerEnabled);
9
+ const bannerText = getThemeProperty(WEBCHAT.CUSTOM_PROPERTIES.notificationsBannerText, 'unread messages');
10
+ const CustomScrollButton = getThemeProperty(WEBCHAT.CUSTOM_PROPERTIES.scrollButtonCustom, undefined);
11
+ const scrollButtonEnabled = getThemeProperty(WEBCHAT.CUSTOM_PROPERTIES.scrollButtonEnabled, CustomScrollButton);
12
+ return {
13
+ notificationsEnabled,
14
+ bannerText,
15
+ CustomUnreadMessagesBanner,
16
+ CustomScrollButton,
17
+ scrollButtonEnabled,
18
+ };
19
+ }
20
+ //# sourceMappingURL=use-notifications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-notifications.js","sourceRoot":"","sources":["../../../../src/webchat/message-list/use-notifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAElC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAEtD,MAAM,UAAU,gBAAgB;IAC9B,MAAM,EAAE,gBAAgB,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAA;IAEvD,MAAM,0BAA0B,GAAG,gBAAgB,CACjD,OAAO,CAAC,iBAAiB,CAAC,yBAAyB,EACnD,SAAS,CACV,CAAA;IAED,MAAM,0BAA0B,GAAG,gBAAgB,CACjD,OAAO,CAAC,iBAAiB,CAAC,0BAA0B,EACpD,SAAS,CACV,CAAA;IAED,MAAM,oBAAoB,GAAG,gBAAgB,CAC3C,OAAO,CAAC,iBAAiB,CAAC,oBAAoB,EAC9C,0BAA0B,IAAI,0BAA0B,CACzD,CAAA;IAED,MAAM,UAAU,GAAG,gBAAgB,CACjC,OAAO,CAAC,iBAAiB,CAAC,uBAAuB,EACjD,iBAAiB,CAClB,CAAA;IAED,MAAM,kBAAkB,GAAG,gBAAgB,CACzC,OAAO,CAAC,iBAAiB,CAAC,kBAAkB,EAC5C,SAAS,CACV,CAAA;IAED,MAAM,mBAAmB,GAAG,gBAAgB,CAC1C,OAAO,CAAC,iBAAiB,CAAC,mBAAmB,EAC7C,kBAAkB,CACnB,CAAA;IAED,OAAO;QACL,oBAAoB;QACpB,UAAU;QACV,0BAA0B;QAC1B,kBAAkB;QAClB,mBAAmB;KACpB,CAAA;AACH,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const WebchatReplies: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,28 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useContext } from 'react';
3
+ import { WEBCHAT } from '../../constants';
4
+ import { WebchatContext } from '../../webchat/context';
5
+ import { BotonicContainerId } from '../constants';
6
+ import { RepliesContainer, ReplyContainer, ScrollableReplies } from './styles';
7
+ const options = {
8
+ left: 'flex-start',
9
+ center: 'center',
10
+ right: 'flex-end',
11
+ };
12
+ export const WebchatReplies = () => {
13
+ var _a;
14
+ const { webchatState, getThemeProperty, repliesRef } = useContext(WebchatContext);
15
+ let justifyContent = 'center';
16
+ const flexWrap = getThemeProperty(WEBCHAT.CUSTOM_PROPERTIES.wrapReplies, 'wrap');
17
+ if (flexWrap === 'nowrap') {
18
+ justifyContent = 'flex-start';
19
+ }
20
+ else if (getThemeProperty(WEBCHAT.CUSTOM_PROPERTIES.alignReplies)) {
21
+ justifyContent =
22
+ options[getThemeProperty(WEBCHAT.CUSTOM_PROPERTIES.alignReplies)];
23
+ }
24
+ return (_jsx(ScrollableReplies, { children: _jsx(RepliesContainer, Object.assign({ id: BotonicContainerId.RepliesContainer, ref: repliesRef, className: 'replies-container', justify: justifyContent, wrap: flexWrap }, { children: (_a = webchatState.replies) === null || _a === void 0 ? void 0 : _a.map((reply, i) => (
25
+ // @ts-ignore TODO: In this point reply is the the component to render
26
+ _jsx(ReplyContainer, { children: reply }, `reply-${i}`))) })) }));
27
+ };
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/webchat/replies/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAE9E,MAAM,OAAO,GAAG;IACd,IAAI,EAAE,YAAY;IAClB,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,UAAU;CAClB,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE;;IACjC,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,GAClD,UAAU,CAAC,cAAc,CAAC,CAAA;IAE5B,IAAI,cAAc,GAAG,QAAQ,CAAA;IAC7B,MAAM,QAAQ,GAAG,gBAAgB,CAC/B,OAAO,CAAC,iBAAiB,CAAC,WAAW,EACrC,MAAM,CACP,CAAA;IAED,IAAI,QAAQ,KAAK,QAAQ,EAAE;QACzB,cAAc,GAAG,YAAY,CAAA;KAC9B;SAAM,IAAI,gBAAgB,CAAC,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,EAAE;QACnE,cAAc;YACZ,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC,CAAA;KACpE;IAED,OAAO,CACL,KAAC,iBAAiB,cAChB,KAAC,gBAAgB,kBACf,EAAE,EAAE,kBAAkB,CAAC,gBAAgB,EACvC,GAAG,EAAE,UAAU,EACf,SAAS,EAAC,mBAAmB,EAC7B,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,QAAQ,gBAEb,MAAA,YAAY,CAAC,OAAO,0CAAE,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;YACvC,sEAAsE;YACtE,KAAC,cAAc,cAAqB,KAAK,IAApB,SAAS,CAAC,EAAE,CAA0B,CAC5D,CAAC,IACe,GACD,CACrB,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,8 @@
1
+ export declare const ScrollableReplies: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ interface RepliesContainerProps {
3
+ justify: string;
4
+ wrap: string;
5
+ }
6
+ export declare const RepliesContainer: import("styled-components").StyledComponent<"div", any, RepliesContainerProps, never>;
7
+ export declare const ReplyContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
8
+ export {};
@@ -0,0 +1,21 @@
1
+ import styled from 'styled-components';
2
+ export const ScrollableReplies = styled.div `
3
+ overscroll-behavior: contain;
4
+ -webkit-overflow-scrolling: touch;
5
+ `;
6
+ export const RepliesContainer = styled.div `
7
+ display: flex;
8
+ text-align: center;
9
+ justify-content: ${props => props.justify};
10
+ flex-wrap: ${props => props.wrap};
11
+ padding-bottom: 10px;
12
+ margin-left: 5px;
13
+ margin-right: 5px;
14
+ overflow-x: auto;
15
+ `;
16
+ export const ReplyContainer = styled.div `
17
+ flex: none;
18
+ display: inline-block;
19
+ margin: 3px;
20
+ `;
21
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/webchat/replies/styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAG1C,CAAA;AAOD,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAuB;;;qBAG5C,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO;eAC5B,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI;;;;;CAKjC,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAIvC,CAAA"}
@@ -0,0 +1 @@
1
+ export function SessionView(props: any): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,96 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import { JSONTree } from 'react-json-tree';
4
+ import styled from 'styled-components';
5
+ import { COLORS } from '../constants';
6
+ import { useWebchat } from './context/use-webchat';
7
+ const AttributeContainer = styled.div `
8
+ display: flex;
9
+ flex: none;
10
+ padding: 12px;
11
+ padding-bottom: 0px;
12
+ font-size: 12px;
13
+ font-weight: 600;
14
+ color: ${COLORS.SOLID_WHITE};
15
+ align-items: center;
16
+ `;
17
+ const Label = styled.div `
18
+ flex: none;
19
+ `;
20
+ const Value = styled.div `
21
+ flex: 1 1 auto;
22
+ max-height: 20px;
23
+ font-size: 16px;
24
+ font-weight: 400;
25
+ margin-left: 6px;
26
+ color: ${COLORS.CURIOUS_BLUE};
27
+ overflow-x: hidden;
28
+ `;
29
+ const SessionViewAttribute = props => (_jsxs(AttributeContainer, { children: [_jsx(Label, { children: props.label }), _jsx(Value, { children: props.value })] }));
30
+ const SessionViewContent = styled.div `
31
+ position: relative;
32
+ width: ${props => (props.show ? '100%' : '0%')};
33
+ height: 100%;
34
+ display: flex;
35
+ background-color: ${COLORS.DAINTREE_BLUE};
36
+ font-family: Arial, Helvetica, sans-serif;
37
+ flex-direction: column;
38
+ z-index: 100000;
39
+ transition: all 0.2s ease-in-out;
40
+ `;
41
+ const ToggleTab = styled.div `
42
+ position: absolute;
43
+ top: 10px;
44
+ right: -32px;
45
+ width: 32px;
46
+ height: 32px;
47
+ cursor: pointer;
48
+ display: flex;
49
+ align-items: center;
50
+ justify-content: center;
51
+ color: ${COLORS.SOLID_WHITE_ALPHA_0_8};
52
+ font-size: 14px;
53
+ font-weight: 600;
54
+ background-color: ${COLORS.DAINTREE_BLUE};
55
+ flex-direction: column;
56
+ z-index: 100000;
57
+ border-top-right-radius: 6px;
58
+ border-bottom-right-radius: 6px;
59
+ `;
60
+ const ContentContainer = styled.div `
61
+ overflow-y: auto;
62
+ overflow-x: auto;
63
+ display: flex;
64
+ flex: 1 1 auto;
65
+ flex-direction: column;
66
+ `;
67
+ const Title = styled.div `
68
+ padding: 12px;
69
+ text-align: center;
70
+ color: ${COLORS.SOLID_WHITE};
71
+ border-bottom: 1px solid ${COLORS.SOLID_WHITE_ALPHA_0_2};
72
+ `;
73
+ const SessionContainer = styled.div `
74
+ flex: 1 1 auto;
75
+ height: 100%;
76
+ overflow-y: auto;
77
+ `;
78
+ const KeepSessionContainer = styled.div `
79
+ flex: none;
80
+ padding: 12px;
81
+ color: ${COLORS.SOLID_WHITE_ALPHA_0_8};
82
+ font-size: 12px;
83
+ `;
84
+ export const SessionView = props => {
85
+ // eslint-disable-next-line react-hooks/rules-of-hooks
86
+ const { webchatState, updateDevSettings } = props.webchatHooks || useWebchat();
87
+ const { latestInput: input, session, lastRoutePath } = webchatState;
88
+ const toggleSessionView = () => updateDevSettings(Object.assign(Object.assign({}, webchatState.devSettings), { showSessionView: !webchatState.devSettings.showSessionView }));
89
+ const toggleKeepSessionOnReload = () => updateDevSettings(Object.assign(Object.assign({}, webchatState.devSettings), { keepSessionOnReload: !webchatState.devSettings.keepSessionOnReload }));
90
+ return (_jsxs(SessionViewContent, Object.assign({ show: webchatState.devSettings.showSessionView }, { children: [_jsx(ToggleTab, Object.assign({ onClick: toggleSessionView }, { children: webchatState.devSettings.showSessionView ? '⇤' : '⇥' })), _jsxs(ContentContainer, { children: [_jsx(Title, { children: "Botonic Dev Console" }), _jsx(SessionViewAttribute, { label: 'INPUT:', value: input && Object.keys(input).length
91
+ ? `[${input.type}] ${input.data || ''}`
92
+ : '' }), _jsx(SessionViewAttribute, { label: 'PAYLOAD:', value: input.payload }), _jsx(SessionViewAttribute, { label: 'INTENT:', value: input.intent
93
+ ? `${input.intent} (${(input.confidence * 100).toFixed(1)}%)`
94
+ : '' }), _jsx(SessionViewAttribute, { label: 'PATH:', value: lastRoutePath ? `/${lastRoutePath}` : '/' }), _jsx(SessionViewAttribute, { label: 'SESSION:' }), _jsx(SessionContainer, { children: _jsx(JSONTree, { data: session, hideRoot: true }) }), _jsx(KeepSessionContainer, { children: _jsxs("label", { children: [_jsx("input", { type: 'checkbox', name: 'toggleKeepSessionOnReload', checked: Boolean(webchatState.devSettings.keepSessionOnReload), onChange: toggleKeepSessionOnReload }), "Keep session on reload"] }) })] })] })));
95
+ };
96
+ //# sourceMappingURL=session-view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-view.js","sourceRoot":"","sources":["../../../src/webchat/session-view.jsx"],"names":[],"mappings":"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"}
@@ -0,0 +1,9 @@
1
+ interface StyledWebchatProps {
2
+ width: number;
3
+ height: number;
4
+ }
5
+ export declare const StyledWebchat: import("styled-components").StyledComponent<"div", any, StyledWebchatProps, never>;
6
+ export declare const ErrorMessageContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
7
+ export declare const ErrorMessage: import("styled-components").StyledComponent<"div", any, {}, never>;
8
+ export declare const DarkBackgroundMenu: import("styled-components").StyledComponent<"div", any, {}, never>;
9
+ export {};
@@ -0,0 +1,50 @@
1
+ import styled from 'styled-components';
2
+ import { COLORS, WEBCHAT } from '../constants';
3
+ export const StyledWebchat = styled.div `
4
+ position: fixed;
5
+ right: 20px;
6
+ bottom: 20px;
7
+ width: ${props => props.width}px;
8
+ height: ${props => props.height}px;
9
+ margin: auto;
10
+ background-color: ${COLORS.SOLID_WHITE};
11
+ border-radius: 10px;
12
+ box-shadow: ${COLORS.SOLID_BLACK_ALPHA_0_2} 0px 0px 12px;
13
+ display: flex;
14
+ flex-direction: column;
15
+ justify-content: space-between;
16
+ overflow: hidden;
17
+ `;
18
+ export const ErrorMessageContainer = styled.div `
19
+ position: relative;
20
+ display: flex;
21
+ z-index: 1;
22
+ justify-content: center;
23
+ width: 100%;
24
+ `;
25
+ export const ErrorMessage = styled.div `
26
+ position: absolute;
27
+ top: 10px;
28
+ font-size: 14px;
29
+ line-height: 20px;
30
+ padding: 4px 11px;
31
+ display: flex;
32
+ background-color: ${COLORS.ERROR_RED};
33
+ color: ${COLORS.CONCRETE_WHITE};
34
+ border-radius: 5px;
35
+ align-items: center;
36
+ justify-content: center;
37
+ font-family: ${WEBCHAT.DEFAULTS.FONT_FAMILY};
38
+ `;
39
+ export const DarkBackgroundMenu = styled.div `
40
+ background: ${COLORS.SOLID_BLACK};
41
+ opacity: 0.3;
42
+ z-index: 1;
43
+ right: 0;
44
+ bottom: 0;
45
+ border-radius: 10px;
46
+ position: absolute;
47
+ width: 100%;
48
+ height: 100%;
49
+ `;
50
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/webchat/styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAO9C,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAoB;;;;WAIhD,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK;YACnB,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM;;sBAEX,MAAM,CAAC,WAAW;;gBAExB,MAAM,CAAC,qBAAqB;;;;;CAK3C,CAAA;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;CAM9C,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;sBAOhB,MAAM,CAAC,SAAS;WAC3B,MAAM,CAAC,cAAc;;;;iBAIf,OAAO,CAAC,QAAQ,CAAC,WAAW;CAC5C,CAAA;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAA;gBAC5B,MAAM,CAAC,WAAW;;;;;;;;;CASjC,CAAA"}
@@ -0,0 +1,167 @@
1
+ /// <reference types="react" />
2
+ import { BlockInputOption, ButtonProps, CustomMessageType } from '../../components/index-types';
3
+ interface ImagePreviewerProps {
4
+ src: string;
5
+ isPreviewerOpened: boolean;
6
+ closePreviewer: () => void;
7
+ }
8
+ export interface CoverComponentProps {
9
+ closeComponent: () => void;
10
+ }
11
+ export interface CoverComponentOptions {
12
+ component: React.ComponentType<CoverComponentProps>;
13
+ props?: any;
14
+ }
15
+ export type PersistentMenuCloseOption = {
16
+ closeLabel: string;
17
+ };
18
+ export type PersistentMenuOption = {
19
+ label: string;
20
+ } & ButtonProps;
21
+ export type PersistentMenuOptionsTheme = (PersistentMenuCloseOption | PersistentMenuOption)[];
22
+ export interface PersistentMenuOptionsProps {
23
+ onClick: () => void;
24
+ options: any;
25
+ }
26
+ export interface BlobProps {
27
+ blobTick?: boolean;
28
+ blobTickStyle?: any;
29
+ blobWidth?: string;
30
+ imageStyle?: any;
31
+ }
32
+ export interface ThemeProps {
33
+ style?: any;
34
+ coverComponent?: CoverComponentOptions;
35
+ mobileBreakpoint?: number;
36
+ mobileStyle?: any;
37
+ webview?: {
38
+ style?: any;
39
+ header?: {
40
+ style?: any;
41
+ };
42
+ };
43
+ animations?: {
44
+ enable?: boolean;
45
+ };
46
+ intro?: {
47
+ style?: any;
48
+ image?: string;
49
+ custom?: React.ComponentType;
50
+ };
51
+ brand?: {
52
+ color?: string;
53
+ image?: string;
54
+ };
55
+ header?: {
56
+ title?: string;
57
+ subtitle?: string;
58
+ image?: string;
59
+ style?: any;
60
+ custom?: React.ComponentType;
61
+ };
62
+ customMessageTypes?: CustomMessageType[];
63
+ message?: {
64
+ bot?: BlobProps & {
65
+ image?: string;
66
+ style?: any;
67
+ };
68
+ agent?: {
69
+ image?: string;
70
+ };
71
+ user?: BlobProps & {
72
+ style?: any;
73
+ };
74
+ customTypes?: CustomMessageType[];
75
+ style?: any;
76
+ timestamps?: {
77
+ withImage?: boolean;
78
+ format: () => string;
79
+ style?: any;
80
+ enable?: boolean;
81
+ };
82
+ };
83
+ button?: {
84
+ autodisable?: boolean;
85
+ disabledstyle?: any;
86
+ hoverBackground?: string;
87
+ hoverTextColor?: string;
88
+ messageType?: 'text' | 'payload';
89
+ urlIcon?: {
90
+ image?: string;
91
+ enable?: boolean;
92
+ };
93
+ style?: any;
94
+ custom?: React.ComponentType;
95
+ };
96
+ replies?: {
97
+ align?: 'left' | 'center' | 'right';
98
+ wrap?: 'wrap' | 'nowrap';
99
+ };
100
+ carousel?: {
101
+ arrow?: {
102
+ left: {
103
+ custom?: React.ComponentType;
104
+ };
105
+ right: {
106
+ custom?: React.ComponentType;
107
+ };
108
+ };
109
+ enableArrows?: boolean;
110
+ };
111
+ reply?: {
112
+ style?: any;
113
+ custom?: React.ComponentType;
114
+ };
115
+ triggerButton?: {
116
+ image?: string;
117
+ style?: any;
118
+ custom?: React.ComponentType;
119
+ };
120
+ notifications?: {
121
+ enable?: boolean;
122
+ banner?: {
123
+ custom?: React.ComponentType;
124
+ enable?: boolean;
125
+ text?: string;
126
+ };
127
+ triggerButton?: {
128
+ enable?: boolean;
129
+ };
130
+ };
131
+ scrollButton?: {
132
+ enable?: boolean;
133
+ custom?: React.ComponentType;
134
+ };
135
+ markdownStyle?: string;
136
+ userInput?: {
137
+ attachments?: {
138
+ enable?: boolean;
139
+ custom?: React.ComponentType;
140
+ };
141
+ blockInputs?: BlockInputOption[];
142
+ box?: {
143
+ placeholder: string;
144
+ style?: any;
145
+ };
146
+ emojiPicker?: {
147
+ enable?: boolean;
148
+ custom?: React.ComponentType;
149
+ };
150
+ menu?: {
151
+ darkBackground?: boolean;
152
+ custom?: React.ComponentType<PersistentMenuOptionsProps>;
153
+ };
154
+ menuButton?: {
155
+ custom?: React.ComponentType;
156
+ };
157
+ persistentMenu?: PersistentMenuOptionsTheme;
158
+ sendButton?: {
159
+ enable?: boolean;
160
+ custom?: React.ComponentType;
161
+ };
162
+ enable?: boolean;
163
+ style?: any;
164
+ };
165
+ imagePreviewer?: React.ComponentType<ImagePreviewerProps>;
166
+ }
167
+ export {};
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/webchat/theme/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ export declare enum EventAction {
2
+ FeedbackKnowledgebase = "feedback_knowledgebase"
3
+ }
4
+ export declare enum FeedbackOption {
5
+ ThumbsUp = "thumbsUp",
6
+ ThumbsDown = "thumbsDown"
7
+ }
@@ -0,0 +1,10 @@
1
+ export var EventAction;
2
+ (function (EventAction) {
3
+ EventAction["FeedbackKnowledgebase"] = "feedback_knowledgebase";
4
+ })(EventAction || (EventAction = {}));
5
+ export var FeedbackOption;
6
+ (function (FeedbackOption) {
7
+ FeedbackOption["ThumbsUp"] = "thumbsUp";
8
+ FeedbackOption["ThumbsDown"] = "thumbsDown";
9
+ })(FeedbackOption || (FeedbackOption = {}));
10
+ //# sourceMappingURL=tracking.js.map