@patternfly/chatbot 2.2.0-prerelease.9 → 2.2.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 (459) hide show
  1. package/dist/cjs/AttachmentEdit/AttachmentEdit.test.d.ts +1 -0
  2. package/dist/cjs/AttachmentEdit/AttachmentEdit.test.js +52 -0
  3. package/dist/cjs/Chatbot/Chatbot.d.ts +2 -1
  4. package/dist/cjs/Chatbot/Chatbot.js +1 -0
  5. package/dist/cjs/Chatbot/Chatbot.test.d.ts +1 -0
  6. package/dist/cjs/Chatbot/Chatbot.test.js +28 -0
  7. package/dist/cjs/ChatbotAlert/ChatbotAlert.test.d.ts +1 -0
  8. package/dist/cjs/ChatbotAlert/ChatbotAlert.test.js +27 -0
  9. package/dist/cjs/ChatbotContent/ChatbotContent.test.d.ts +1 -0
  10. package/dist/cjs/ChatbotContent/ChatbotContent.test.js +18 -0
  11. package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.d.ts +3 -3
  12. package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.js +3 -1
  13. package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.d.ts +27 -4
  14. package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.js +24 -12
  15. package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.js +99 -3
  16. package/dist/cjs/ChatbotConversationHistoryNav/EmptyState.d.ts +11 -0
  17. package/dist/cjs/ChatbotConversationHistoryNav/EmptyState.js +29 -0
  18. package/dist/cjs/ChatbotConversationHistoryNav/LoadingState.d.ts +4 -0
  19. package/dist/cjs/ChatbotConversationHistoryNav/LoadingState.js +45 -0
  20. package/dist/cjs/ChatbotFooter/ChatbotFooter.test.d.ts +1 -0
  21. package/dist/cjs/ChatbotFooter/ChatbotFooter.test.js +18 -0
  22. package/dist/cjs/ChatbotFooter/ChatbotFooternote.test.d.ts +1 -0
  23. package/dist/cjs/ChatbotFooter/ChatbotFooternote.test.js +87 -0
  24. package/dist/cjs/ChatbotFooter/ChatbotFootnote.d.ts +1 -1
  25. package/dist/cjs/ChatbotFooter/ChatbotFootnote.js +1 -1
  26. package/dist/cjs/ChatbotHeader/ChatbotHeader.test.d.ts +1 -0
  27. package/dist/cjs/ChatbotHeader/ChatbotHeader.test.js +18 -0
  28. package/dist/cjs/ChatbotHeader/ChatbotHeaderActions.test.d.ts +1 -0
  29. package/dist/cjs/ChatbotHeader/ChatbotHeaderActions.test.js +18 -0
  30. package/dist/cjs/ChatbotHeader/ChatbotHeaderCloseButton.js +3 -1
  31. package/dist/cjs/ChatbotHeader/ChatbotHeaderCloseButton.test.d.ts +1 -0
  32. package/dist/cjs/ChatbotHeader/ChatbotHeaderCloseButton.test.js +20 -0
  33. package/dist/cjs/ChatbotHeader/ChatbotHeaderMain.test.d.ts +1 -0
  34. package/dist/cjs/ChatbotHeader/ChatbotHeaderMain.test.js +18 -0
  35. package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.js +3 -1
  36. package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.test.d.ts +1 -0
  37. package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.test.js +20 -0
  38. package/dist/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.js +3 -1
  39. package/dist/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.d.ts +1 -0
  40. package/dist/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.js +43 -0
  41. package/dist/cjs/ChatbotHeader/ChatbotHeaderSelectorDropdown.js +6 -4
  42. package/dist/cjs/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.d.ts +1 -0
  43. package/dist/cjs/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.js +41 -0
  44. package/dist/cjs/ChatbotHeader/ChatbotHeaderTitle.d.ts +3 -1
  45. package/dist/cjs/ChatbotHeader/ChatbotHeaderTitle.js +4 -2
  46. package/dist/cjs/ChatbotHeader/ChatbotHeaderTitle.test.d.ts +1 -0
  47. package/dist/cjs/ChatbotHeader/ChatbotHeaderTitle.test.js +55 -0
  48. package/dist/cjs/ChatbotToggle/ChatbotToggle.js +3 -1
  49. package/dist/cjs/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.js +19 -11
  50. package/dist/cjs/Compare/Compare.d.ts +17 -0
  51. package/dist/cjs/Compare/Compare.js +50 -0
  52. package/dist/cjs/Compare/Compare.test.d.ts +1 -0
  53. package/dist/cjs/Compare/Compare.test.js +20 -0
  54. package/dist/cjs/Compare/index.d.ts +2 -0
  55. package/dist/cjs/Compare/index.js +23 -0
  56. package/dist/cjs/Message/ErrorMessage/ErrorMessage.d.ts +4 -0
  57. package/dist/cjs/Message/ErrorMessage/ErrorMessage.js +26 -0
  58. package/dist/cjs/Message/ImageMessage/ImageMessage.d.ts +4 -0
  59. package/dist/cjs/Message/ImageMessage/ImageMessage.js +25 -0
  60. package/dist/cjs/Message/LinkMessage/LinkMessage.d.ts +4 -0
  61. package/dist/cjs/Message/LinkMessage/LinkMessage.js +30 -0
  62. package/dist/cjs/Message/Message.d.ts +35 -8
  63. package/dist/cjs/Message/Message.js +68 -18
  64. package/dist/cjs/Message/Message.test.js +239 -3
  65. package/dist/cjs/Message/QuickResponse/QuickResponse.d.ts +17 -0
  66. package/dist/cjs/Message/QuickResponse/QuickResponse.js +34 -0
  67. package/dist/cjs/Message/TableMessage/TableMessage.d.ts +20 -0
  68. package/dist/cjs/Message/TableMessage/TableMessage.js +67 -0
  69. package/dist/cjs/Message/TableMessage/TbodyMessage.d.ts +7 -0
  70. package/dist/cjs/Message/TableMessage/TbodyMessage.js +33 -0
  71. package/dist/cjs/Message/TableMessage/TdMessage.d.ts +5 -0
  72. package/dist/cjs/Message/TableMessage/TdMessage.js +26 -0
  73. package/dist/cjs/Message/TableMessage/ThMessage.d.ts +5 -0
  74. package/dist/cjs/Message/TableMessage/ThMessage.js +26 -0
  75. package/dist/cjs/Message/TableMessage/TheadMessage.d.ts +5 -0
  76. package/dist/cjs/Message/TableMessage/TheadMessage.js +26 -0
  77. package/dist/cjs/Message/TableMessage/TrMessage.d.ts +7 -0
  78. package/dist/cjs/Message/TableMessage/TrMessage.js +37 -0
  79. package/dist/cjs/Message/TextMessage/TextMessage.d.ts +2 -1
  80. package/dist/cjs/Message/TextMessage/TextMessage.js +2 -2
  81. package/dist/cjs/Message/UserFeedback/CloseButton.d.ts +10 -0
  82. package/dist/cjs/Message/UserFeedback/CloseButton.js +14 -0
  83. package/dist/cjs/Message/UserFeedback/UserFeedback.d.ts +39 -0
  84. package/dist/cjs/Message/UserFeedback/UserFeedback.js +54 -0
  85. package/dist/cjs/Message/UserFeedback/UserFeedback.test.d.ts +1 -0
  86. package/dist/cjs/Message/UserFeedback/UserFeedback.test.js +133 -0
  87. package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.d.ts +42 -0
  88. package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.js +117 -0
  89. package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.test.d.ts +1 -0
  90. package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.test.js +249 -0
  91. package/dist/cjs/MessageBar/AttachButton.js +4 -2
  92. package/dist/cjs/MessageBar/MessageBar.d.ts +11 -4
  93. package/dist/cjs/MessageBar/MessageBar.js +127 -46
  94. package/dist/cjs/MessageBar/MessageBar.test.js +12 -4
  95. package/dist/cjs/MessageBar/MicrophoneButton.d.ts +1 -1
  96. package/dist/cjs/MessageBar/SendButton.js +3 -1
  97. package/dist/cjs/MessageBar/StopButton.js +3 -1
  98. package/dist/cjs/MessageBox/MessageBox.test.d.ts +1 -0
  99. package/dist/cjs/MessageBox/MessageBox.test.js +22 -0
  100. package/dist/cjs/PreviewAttachment/PreviewAttachment.test.d.ts +1 -0
  101. package/dist/cjs/PreviewAttachment/PreviewAttachment.test.js +28 -0
  102. package/dist/cjs/ResponseActions/ResponseActionButton.d.ts +4 -1
  103. package/dist/cjs/ResponseActions/ResponseActionButton.js +21 -6
  104. package/dist/cjs/ResponseActions/ResponseActions.d.ts +8 -2
  105. package/dist/cjs/ResponseActions/ResponseActions.js +7 -7
  106. package/dist/cjs/ResponseActions/ResponseActions.test.js +2 -2
  107. package/dist/cjs/Settings/SettingsForm.test.d.ts +1 -0
  108. package/dist/cjs/Settings/SettingsForm.test.js +26 -0
  109. package/dist/cjs/__mocks__/rehype-external-links.d.ts +2 -0
  110. package/dist/cjs/__mocks__/rehype-external-links.js +4 -0
  111. package/dist/cjs/__mocks__/rehype-sanitize.d.ts +2 -0
  112. package/dist/cjs/__mocks__/rehype-sanitize.js +4 -0
  113. package/dist/cjs/__mocks__/rehype-unwrap-images.d.ts +2 -0
  114. package/dist/cjs/__mocks__/rehype-unwrap-images.js +4 -0
  115. package/dist/cjs/index.d.ts +4 -0
  116. package/dist/cjs/index.js +7 -1
  117. package/dist/cjs/tracking/console_tracking_provider.d.ts +10 -0
  118. package/dist/cjs/tracking/console_tracking_provider.js +27 -0
  119. package/dist/cjs/tracking/index.d.ts +2 -0
  120. package/dist/cjs/tracking/index.js +23 -0
  121. package/dist/cjs/tracking/posthog_tracking_provider.d.ts +9 -0
  122. package/dist/cjs/tracking/posthog_tracking_provider.js +37 -0
  123. package/dist/cjs/tracking/segment_tracking_provider.d.ts +10 -0
  124. package/dist/cjs/tracking/segment_tracking_provider.js +50 -0
  125. package/dist/cjs/tracking/trackingProviderProxy.d.ts +9 -0
  126. package/dist/cjs/tracking/trackingProviderProxy.js +24 -0
  127. package/dist/cjs/tracking/tracking_api.d.ts +8 -0
  128. package/dist/cjs/tracking/tracking_api.js +2 -0
  129. package/dist/cjs/tracking/tracking_registry.d.ts +4 -0
  130. package/dist/cjs/tracking/tracking_registry.js +33 -0
  131. package/dist/cjs/tracking/tracking_spi.d.ts +9 -0
  132. package/dist/cjs/tracking/tracking_spi.js +2 -0
  133. package/dist/cjs/tracking/umami_tracking_provider.d.ts +14 -0
  134. package/dist/cjs/tracking/umami_tracking_provider.js +44 -0
  135. package/dist/css/main.css +420 -148
  136. package/dist/css/main.css.map +1 -1
  137. package/dist/dynamic/Compare/package.json +1 -0
  138. package/dist/dynamic/tracking/package.json +1 -0
  139. package/dist/esm/AttachmentEdit/AttachmentEdit.test.d.ts +1 -0
  140. package/dist/esm/AttachmentEdit/AttachmentEdit.test.js +47 -0
  141. package/dist/esm/Chatbot/Chatbot.d.ts +2 -1
  142. package/dist/esm/Chatbot/Chatbot.js +1 -0
  143. package/dist/esm/Chatbot/Chatbot.test.d.ts +1 -0
  144. package/dist/esm/Chatbot/Chatbot.test.js +23 -0
  145. package/dist/esm/ChatbotAlert/ChatbotAlert.test.d.ts +1 -0
  146. package/dist/esm/ChatbotAlert/ChatbotAlert.test.js +22 -0
  147. package/dist/esm/ChatbotContent/ChatbotContent.test.d.ts +1 -0
  148. package/dist/esm/ChatbotContent/ChatbotContent.test.js +13 -0
  149. package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.d.ts +3 -3
  150. package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.js +3 -1
  151. package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.d.ts +27 -4
  152. package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.js +24 -12
  153. package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.js +99 -3
  154. package/dist/esm/ChatbotConversationHistoryNav/EmptyState.d.ts +11 -0
  155. package/dist/esm/ChatbotConversationHistoryNav/EmptyState.js +22 -0
  156. package/dist/esm/ChatbotConversationHistoryNav/LoadingState.d.ts +4 -0
  157. package/dist/esm/ChatbotConversationHistoryNav/LoadingState.js +38 -0
  158. package/dist/esm/ChatbotFooter/ChatbotFooter.test.d.ts +1 -0
  159. package/dist/esm/ChatbotFooter/ChatbotFooter.test.js +13 -0
  160. package/dist/esm/ChatbotFooter/ChatbotFooternote.test.d.ts +1 -0
  161. package/dist/esm/ChatbotFooter/ChatbotFooternote.test.js +82 -0
  162. package/dist/esm/ChatbotFooter/ChatbotFootnote.d.ts +1 -1
  163. package/dist/esm/ChatbotFooter/ChatbotFootnote.js +1 -1
  164. package/dist/esm/ChatbotHeader/ChatbotHeader.test.d.ts +1 -0
  165. package/dist/esm/ChatbotHeader/ChatbotHeader.test.js +13 -0
  166. package/dist/esm/ChatbotHeader/ChatbotHeaderActions.test.d.ts +1 -0
  167. package/dist/esm/ChatbotHeader/ChatbotHeaderActions.test.js +13 -0
  168. package/dist/esm/ChatbotHeader/ChatbotHeaderCloseButton.js +3 -1
  169. package/dist/esm/ChatbotHeader/ChatbotHeaderCloseButton.test.d.ts +1 -0
  170. package/dist/esm/ChatbotHeader/ChatbotHeaderCloseButton.test.js +15 -0
  171. package/dist/esm/ChatbotHeader/ChatbotHeaderMain.test.d.ts +1 -0
  172. package/dist/esm/ChatbotHeader/ChatbotHeaderMain.test.js +13 -0
  173. package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.js +3 -1
  174. package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.test.d.ts +1 -0
  175. package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.test.js +15 -0
  176. package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.js +3 -1
  177. package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.d.ts +1 -0
  178. package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.js +38 -0
  179. package/dist/esm/ChatbotHeader/ChatbotHeaderSelectorDropdown.js +6 -4
  180. package/dist/esm/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.d.ts +1 -0
  181. package/dist/esm/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.js +36 -0
  182. package/dist/esm/ChatbotHeader/ChatbotHeaderTitle.d.ts +3 -1
  183. package/dist/esm/ChatbotHeader/ChatbotHeaderTitle.js +4 -2
  184. package/dist/esm/ChatbotHeader/ChatbotHeaderTitle.test.d.ts +1 -0
  185. package/dist/esm/ChatbotHeader/ChatbotHeaderTitle.test.js +50 -0
  186. package/dist/esm/ChatbotToggle/ChatbotToggle.js +3 -1
  187. package/dist/esm/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.js +19 -11
  188. package/dist/esm/Compare/Compare.d.ts +17 -0
  189. package/dist/esm/Compare/Compare.js +43 -0
  190. package/dist/esm/Compare/Compare.test.d.ts +1 -0
  191. package/dist/esm/Compare/Compare.test.js +15 -0
  192. package/dist/esm/Compare/index.d.ts +2 -0
  193. package/dist/esm/Compare/index.js +2 -0
  194. package/dist/esm/Message/ErrorMessage/ErrorMessage.d.ts +4 -0
  195. package/dist/esm/Message/ErrorMessage/ErrorMessage.js +21 -0
  196. package/dist/esm/Message/ImageMessage/ImageMessage.d.ts +4 -0
  197. package/dist/esm/Message/ImageMessage/ImageMessage.js +20 -0
  198. package/dist/esm/Message/LinkMessage/LinkMessage.d.ts +4 -0
  199. package/dist/esm/Message/LinkMessage/LinkMessage.js +25 -0
  200. package/dist/esm/Message/Message.d.ts +35 -8
  201. package/dist/esm/Message/Message.js +66 -16
  202. package/dist/esm/Message/Message.test.js +239 -3
  203. package/dist/esm/Message/QuickResponse/QuickResponse.d.ts +17 -0
  204. package/dist/esm/Message/QuickResponse/QuickResponse.js +27 -0
  205. package/dist/esm/Message/TableMessage/TableMessage.d.ts +20 -0
  206. package/dist/esm/Message/TableMessage/TableMessage.js +62 -0
  207. package/dist/esm/Message/TableMessage/TbodyMessage.d.ts +7 -0
  208. package/dist/esm/Message/TableMessage/TbodyMessage.js +28 -0
  209. package/dist/esm/Message/TableMessage/TdMessage.d.ts +5 -0
  210. package/dist/esm/Message/TableMessage/TdMessage.js +21 -0
  211. package/dist/esm/Message/TableMessage/ThMessage.d.ts +5 -0
  212. package/dist/esm/Message/TableMessage/ThMessage.js +21 -0
  213. package/dist/esm/Message/TableMessage/TheadMessage.d.ts +5 -0
  214. package/dist/esm/Message/TableMessage/TheadMessage.js +21 -0
  215. package/dist/esm/Message/TableMessage/TrMessage.d.ts +7 -0
  216. package/dist/esm/Message/TableMessage/TrMessage.js +32 -0
  217. package/dist/esm/Message/TextMessage/TextMessage.d.ts +2 -1
  218. package/dist/esm/Message/TextMessage/TextMessage.js +3 -3
  219. package/dist/esm/Message/UserFeedback/CloseButton.d.ts +10 -0
  220. package/dist/esm/Message/UserFeedback/CloseButton.js +9 -0
  221. package/dist/esm/Message/UserFeedback/UserFeedback.d.ts +39 -0
  222. package/dist/esm/Message/UserFeedback/UserFeedback.js +49 -0
  223. package/dist/esm/Message/UserFeedback/UserFeedback.test.d.ts +1 -0
  224. package/dist/esm/Message/UserFeedback/UserFeedback.test.js +128 -0
  225. package/dist/esm/Message/UserFeedback/UserFeedbackComplete.d.ts +42 -0
  226. package/dist/esm/Message/UserFeedback/UserFeedbackComplete.js +112 -0
  227. package/dist/esm/Message/UserFeedback/UserFeedbackComplete.test.d.ts +1 -0
  228. package/dist/esm/Message/UserFeedback/UserFeedbackComplete.test.js +244 -0
  229. package/dist/esm/MessageBar/AttachButton.js +4 -2
  230. package/dist/esm/MessageBar/MessageBar.d.ts +11 -4
  231. package/dist/esm/MessageBar/MessageBar.js +127 -46
  232. package/dist/esm/MessageBar/MessageBar.test.js +12 -4
  233. package/dist/esm/MessageBar/MicrophoneButton.d.ts +1 -1
  234. package/dist/esm/MessageBar/SendButton.js +3 -1
  235. package/dist/esm/MessageBar/StopButton.js +3 -1
  236. package/dist/esm/MessageBox/MessageBox.test.d.ts +1 -0
  237. package/dist/esm/MessageBox/MessageBox.test.js +17 -0
  238. package/dist/esm/PreviewAttachment/PreviewAttachment.test.d.ts +1 -0
  239. package/dist/esm/PreviewAttachment/PreviewAttachment.test.js +23 -0
  240. package/dist/esm/ResponseActions/ResponseActionButton.d.ts +4 -1
  241. package/dist/esm/ResponseActions/ResponseActionButton.js +18 -3
  242. package/dist/esm/ResponseActions/ResponseActions.d.ts +8 -2
  243. package/dist/esm/ResponseActions/ResponseActions.js +7 -7
  244. package/dist/esm/ResponseActions/ResponseActions.test.js +2 -2
  245. package/dist/esm/Settings/SettingsForm.test.d.ts +1 -0
  246. package/dist/esm/Settings/SettingsForm.test.js +21 -0
  247. package/dist/esm/__mocks__/rehype-external-links.d.ts +2 -0
  248. package/dist/esm/__mocks__/rehype-external-links.js +2 -0
  249. package/dist/esm/__mocks__/rehype-sanitize.d.ts +2 -0
  250. package/dist/esm/__mocks__/rehype-sanitize.js +2 -0
  251. package/dist/esm/__mocks__/rehype-unwrap-images.d.ts +2 -0
  252. package/dist/esm/__mocks__/rehype-unwrap-images.js +2 -0
  253. package/dist/esm/index.d.ts +4 -0
  254. package/dist/esm/index.js +4 -0
  255. package/dist/esm/tracking/console_tracking_provider.d.ts +10 -0
  256. package/dist/esm/tracking/console_tracking_provider.js +23 -0
  257. package/dist/esm/tracking/index.d.ts +2 -0
  258. package/dist/esm/tracking/index.js +2 -0
  259. package/dist/esm/tracking/posthog_tracking_provider.d.ts +9 -0
  260. package/dist/esm/tracking/posthog_tracking_provider.js +33 -0
  261. package/dist/esm/tracking/segment_tracking_provider.d.ts +10 -0
  262. package/dist/esm/tracking/segment_tracking_provider.js +46 -0
  263. package/dist/esm/tracking/trackingProviderProxy.d.ts +9 -0
  264. package/dist/esm/tracking/trackingProviderProxy.js +22 -0
  265. package/dist/esm/tracking/tracking_api.d.ts +8 -0
  266. package/dist/esm/tracking/tracking_api.js +1 -0
  267. package/dist/esm/tracking/tracking_registry.d.ts +4 -0
  268. package/dist/esm/tracking/tracking_registry.js +26 -0
  269. package/dist/esm/tracking/tracking_spi.d.ts +9 -0
  270. package/dist/esm/tracking/tracking_spi.js +1 -0
  271. package/dist/esm/tracking/umami_tracking_provider.d.ts +14 -0
  272. package/dist/esm/tracking/umami_tracking_provider.js +40 -0
  273. package/dist/tsconfig.tsbuildinfo +1 -1
  274. package/package.json +8 -3
  275. package/patternfly-docs/content/extensions/chatbot/about-chatbot.md +8 -2
  276. package/patternfly-docs/content/extensions/chatbot/design-guidelines.md +192 -15
  277. package/patternfly-docs/content/extensions/chatbot/examples/Analytics/Analytics.md +219 -0
  278. package/patternfly-docs/content/extensions/chatbot/examples/Messages/AttachmentError.tsx +2 -2
  279. package/patternfly-docs/content/extensions/chatbot/examples/Messages/BotMessage.tsx +214 -12
  280. package/patternfly-docs/content/extensions/chatbot/examples/Messages/FileDropZone.tsx +2 -1
  281. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithAttachment.tsx +2 -2
  282. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithCustomResponseActions.tsx +1 -1
  283. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithFeedback.tsx +71 -0
  284. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithFeedbackTimeout.tsx +27 -0
  285. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithQuickResponses.tsx +1 -1
  286. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithQuickStart.tsx +2 -2
  287. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithResponseActions.tsx +1 -1
  288. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithSources.tsx +1 -1
  289. package/patternfly-docs/content/extensions/chatbot/examples/Messages/Messages.md +49 -8
  290. package/patternfly-docs/content/extensions/chatbot/examples/Messages/UserMessage.tsx +244 -14
  291. package/patternfly-docs/content/extensions/chatbot/examples/Messages/UserMessageWithExtraContent.tsx +54 -0
  292. package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotFooter.tsx +1 -1
  293. package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotFootnote.tsx +5 -5
  294. package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderBasic.tsx +1 -1
  295. package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderDrawer.tsx +36 -3
  296. package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderDrawerNavigation.tsx +67 -0
  297. package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderDrawerResizable.tsx +94 -0
  298. package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotMessageBarAttach.tsx +1 -1
  299. package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotWelcomeInteraction.tsx +1 -1
  300. package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotWelcomePrompt.tsx +7 -7
  301. package/patternfly-docs/content/extensions/chatbot/examples/UI/UI.md +21 -6
  302. package/patternfly-docs/content/extensions/chatbot/examples/demos/AttachmentDemos.md +14 -0
  303. package/patternfly-docs/content/extensions/chatbot/examples/demos/Chatbot.md +39 -1
  304. package/patternfly-docs/content/extensions/chatbot/examples/demos/Chatbot.tsx +48 -35
  305. package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotAttachment.tsx +2 -2
  306. package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotAttachmentMenu.tsx +3 -3
  307. package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotInDrawer.tsx +453 -0
  308. package/patternfly-docs/content/extensions/chatbot/examples/demos/EmbeddedChatbot.tsx +11 -11
  309. package/patternfly-docs/content/extensions/chatbot/examples/demos/EmbeddedComparisonChatbot.tsx +206 -0
  310. package/patternfly-docs/content/extensions/chatbot/examples/demos/Feedback.tsx +104 -0
  311. package/patternfly-docs/content/extensions/chatbot/img/ai-action-inpage.svg +85 -0
  312. package/patternfly-docs/content/extensions/chatbot/img/ai-action-message.svg +63 -0
  313. package/patternfly-docs/content/extensions/chatbot/img/analytics-example.svg +127 -0
  314. package/patternfly-docs/content/extensions/chatbot/img/attached-file.svg +24 -29
  315. package/patternfly-docs/content/extensions/chatbot/img/attachment-menu.svg +4 -4
  316. package/patternfly-docs/content/extensions/chatbot/img/attachment-unsent.svg +30 -58
  317. package/patternfly-docs/content/extensions/chatbot/img/chatbot-analytics.svg +51 -0
  318. package/patternfly-docs/content/extensions/chatbot/img/chatbot-elements.svg +11 -12
  319. package/patternfly-docs/content/extensions/chatbot/img/chatbot-quickstarts-tile.svg +58 -0
  320. package/patternfly-docs/content/extensions/chatbot/img/chatbot-settings.svg +83 -0
  321. package/patternfly-docs/content/extensions/chatbot/img/comparison.svg +45 -0
  322. package/patternfly-docs/content/extensions/chatbot/img/conversation-history.svg +6 -29
  323. package/patternfly-docs/content/extensions/chatbot/img/docked.svg +259 -241
  324. package/patternfly-docs/content/extensions/chatbot/img/drawer.svg +255 -0
  325. package/patternfly-docs/content/extensions/chatbot/img/error-state.svg +30 -0
  326. package/patternfly-docs/content/extensions/chatbot/img/feedback-form.svg +88 -0
  327. package/patternfly-docs/content/extensions/chatbot/img/footnote.svg +1 -1
  328. package/patternfly-docs/content/extensions/chatbot/img/fullscreen.svg +25 -16
  329. package/patternfly-docs/content/extensions/chatbot/img/listening-pulse.svg +22 -0
  330. package/patternfly-docs/content/extensions/chatbot/img/listening.svg +1 -1
  331. package/patternfly-docs/content/extensions/chatbot/img/loading-state.svg +28 -0
  332. package/patternfly-docs/content/extensions/chatbot/img/masthead-toggle-notification.svg +49 -0
  333. package/patternfly-docs/content/extensions/chatbot/img/masthead-toggle.svg +75 -0
  334. package/patternfly-docs/content/extensions/chatbot/img/message-bar-elements.svg +3 -3
  335. package/patternfly-docs/content/extensions/chatbot/img/message-elements.svg +84 -142
  336. package/patternfly-docs/content/extensions/chatbot/img/message-feedback.svg +52 -0
  337. package/patternfly-docs/content/extensions/chatbot/img/message-responses.svg +54 -0
  338. package/patternfly-docs/content/extensions/chatbot/img/new-chat-emptystate.svg +27 -0
  339. package/patternfly-docs/content/extensions/chatbot/img/no-results-emptystate.svg +27 -0
  340. package/patternfly-docs/content/extensions/chatbot/img/overlay.svg +54 -39
  341. package/patternfly-docs/content/extensions/chatbot/img/posthog.svg +30 -0
  342. package/patternfly-docs/content/extensions/chatbot/img/segment.svg +36 -0
  343. package/patternfly-docs/content/extensions/chatbot/img/settings-menu.svg +122 -0
  344. package/patternfly-docs/content/extensions/chatbot/img/source-tile.svg +62 -0
  345. package/patternfly-docs/content/extensions/chatbot/img/thank-you-card.svg +81 -0
  346. package/patternfly-docs/content/extensions/chatbot/img/toggle-customizations.svg +12 -0
  347. package/patternfly-docs/content/extensions/chatbot/img/toggle-tooltips.svg +38 -0
  348. package/patternfly-docs/content/extensions/chatbot/img/umami.svg +30 -0
  349. package/patternfly-docs/content/extensions/chatbot/img/welcome-elements.svg +82 -0
  350. package/patternfly-docs/content/extensions/chatbot/img/welcome-message.svg +94 -0
  351. package/src/AttachMenu/AttachMenu.scss +1 -1
  352. package/src/AttachmentEdit/AttachmentEdit.test.tsx +55 -0
  353. package/src/Chatbot/Chatbot.scss +20 -1
  354. package/src/Chatbot/Chatbot.test.tsx +31 -0
  355. package/src/Chatbot/Chatbot.tsx +2 -1
  356. package/src/ChatbotAlert/ChatbotAlert.test.tsx +31 -0
  357. package/src/ChatbotContent/ChatbotContent.scss +1 -0
  358. package/src/ChatbotContent/ChatbotContent.test.tsx +15 -0
  359. package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.tsx +10 -4
  360. package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.scss +24 -1
  361. package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.tsx +242 -3
  362. package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.tsx +94 -26
  363. package/src/ChatbotConversationHistoryNav/EmptyState.tsx +44 -0
  364. package/src/ChatbotConversationHistoryNav/LoadingState.tsx +38 -0
  365. package/src/ChatbotFooter/ChatbotFooter.scss +8 -4
  366. package/src/ChatbotFooter/ChatbotFooter.test.tsx +15 -0
  367. package/src/ChatbotFooter/ChatbotFooternote.test.tsx +84 -0
  368. package/src/ChatbotFooter/ChatbotFootnote.tsx +2 -2
  369. package/src/ChatbotHeader/ChatbotHeader.scss +5 -6
  370. package/src/ChatbotHeader/ChatbotHeader.test.tsx +15 -0
  371. package/src/ChatbotHeader/ChatbotHeaderActions.test.tsx +17 -0
  372. package/src/ChatbotHeader/ChatbotHeaderCloseButton.test.tsx +20 -0
  373. package/src/ChatbotHeader/ChatbotHeaderCloseButton.tsx +7 -1
  374. package/src/ChatbotHeader/ChatbotHeaderMain.test.tsx +17 -0
  375. package/src/ChatbotHeader/ChatbotHeaderMenu.test.tsx +19 -0
  376. package/src/ChatbotHeader/ChatbotHeaderMenu.tsx +7 -1
  377. package/src/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.tsx +45 -0
  378. package/src/ChatbotHeader/ChatbotHeaderOptionsDropdown.tsx +8 -1
  379. package/src/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.tsx +43 -0
  380. package/src/ChatbotHeader/ChatbotHeaderSelectorDropdown.tsx +11 -4
  381. package/src/ChatbotHeader/ChatbotHeaderTitle.test.tsx +75 -0
  382. package/src/ChatbotHeader/ChatbotHeaderTitle.tsx +7 -2
  383. package/src/ChatbotModal/ChatbotModal.scss +12 -12
  384. package/src/ChatbotToggle/ChatbotToggle.tsx +6 -1
  385. package/src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.scss +2 -0
  386. package/src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.tsx +26 -18
  387. package/src/ChatbotWelcomePrompt/__snapshots__/ChatbotWelcomePrompt.test.tsx.snap +2 -2
  388. package/src/CodeModal/CodeModal.scss +7 -4
  389. package/src/Compare/Compare.scss +72 -0
  390. package/src/Compare/Compare.test.tsx +31 -0
  391. package/src/Compare/Compare.tsx +98 -0
  392. package/src/Compare/index.ts +2 -0
  393. package/src/FileDetails/FileDetails.scss +1 -1
  394. package/src/FileDetailsLabel/FileDetailsLabel.scss +2 -2
  395. package/src/Message/CodeBlockMessage/CodeBlockMessage.scss +4 -4
  396. package/src/Message/ErrorMessage/ErrorMessage.tsx +14 -0
  397. package/src/Message/ImageMessage/ImageMessage.scss +9 -0
  398. package/src/Message/ImageMessage/ImageMessage.tsx +14 -0
  399. package/src/Message/LinkMessage/LinkMessage.tsx +34 -0
  400. package/src/Message/ListMessage/ListMessage.scss +6 -6
  401. package/src/Message/Message.scss +4 -26
  402. package/src/Message/Message.test.tsx +313 -3
  403. package/src/Message/Message.tsx +130 -31
  404. package/src/Message/MessageLoading.scss +2 -2
  405. package/src/Message/QuickResponse/QuickResponse.scss +33 -0
  406. package/src/Message/QuickResponse/QuickResponse.tsx +54 -0
  407. package/src/Message/QuickStarts/QuickStartTile.scss +0 -1
  408. package/src/Message/TableMessage/TableMessage.scss +23 -0
  409. package/src/Message/TableMessage/TableMessage.tsx +83 -0
  410. package/src/Message/TableMessage/TbodyMessage.tsx +20 -0
  411. package/src/Message/TableMessage/TdMessage.tsx +11 -0
  412. package/src/Message/TableMessage/ThMessage.tsx +11 -0
  413. package/src/Message/TableMessage/TheadMessage.tsx +11 -0
  414. package/src/Message/TableMessage/TrMessage.tsx +27 -0
  415. package/src/Message/TextMessage/TextMessage.scss +21 -12
  416. package/src/Message/TextMessage/TextMessage.tsx +3 -3
  417. package/src/Message/UserFeedback/CloseButton.tsx +21 -0
  418. package/src/Message/UserFeedback/UserFeedback.scss +53 -0
  419. package/src/Message/UserFeedback/UserFeedback.test.tsx +236 -0
  420. package/src/Message/UserFeedback/UserFeedback.tsx +128 -0
  421. package/src/Message/UserFeedback/UserFeedbackComplete.test.tsx +255 -0
  422. package/src/Message/UserFeedback/UserFeedbackComplete.tsx +211 -0
  423. package/src/MessageBar/AttachButton.scss +19 -3
  424. package/src/MessageBar/AttachButton.tsx +3 -1
  425. package/src/MessageBar/MessageBar.scss +58 -24
  426. package/src/MessageBar/MessageBar.test.tsx +12 -4
  427. package/src/MessageBar/MessageBar.tsx +164 -65
  428. package/src/MessageBar/MicrophoneButton.scss +8 -8
  429. package/src/MessageBar/MicrophoneButton.tsx +1 -1
  430. package/src/MessageBar/SendButton.tsx +2 -0
  431. package/src/MessageBar/StopButton.scss +17 -3
  432. package/src/MessageBar/StopButton.tsx +2 -0
  433. package/src/MessageBox/JumpButton.scss +6 -6
  434. package/src/MessageBox/MessageBox.scss +1 -0
  435. package/src/MessageBox/MessageBox.test.tsx +26 -0
  436. package/src/PreviewAttachment/PreviewAttachment.test.tsx +51 -0
  437. package/src/ResponseActions/ResponseActionButton.tsx +14 -2
  438. package/src/ResponseActions/ResponseActions.scss +2 -2
  439. package/src/ResponseActions/ResponseActions.test.tsx +4 -2
  440. package/src/ResponseActions/ResponseActions.tsx +26 -2
  441. package/src/Settings/Settings.scss +2 -2
  442. package/src/Settings/SettingsForm.test.tsx +28 -0
  443. package/src/SourceDetailsMenuItem/SourceDetailsMenuItem.scss +2 -2
  444. package/src/SourcesCard/SourcesCard.scss +9 -3
  445. package/src/TermsOfUse/TermsOfUse.scss +1 -1
  446. package/src/__mocks__/rehype-external-links.ts +3 -0
  447. package/src/__mocks__/rehype-sanitize.ts +3 -0
  448. package/src/__mocks__/rehype-unwrap-images.tsx +3 -0
  449. package/src/index.ts +6 -0
  450. package/src/main.scss +5 -6
  451. package/src/tracking/console_tracking_provider.ts +30 -0
  452. package/src/tracking/index.ts +3 -0
  453. package/src/tracking/posthog_tracking_provider.ts +42 -0
  454. package/src/tracking/segment_tracking_provider.ts +62 -0
  455. package/src/tracking/trackingProviderProxy.ts +28 -0
  456. package/src/tracking/tracking_api.ts +11 -0
  457. package/src/tracking/tracking_registry.ts +33 -0
  458. package/src/tracking/tracking_spi.ts +14 -0
  459. package/src/tracking/umami_tracking_provider.ts +54 -0
@@ -0,0 +1,219 @@
1
+ ---
2
+ # Sidenav top-level section
3
+ # should be the same for all markdown files
4
+ section: PatternFly-AI
5
+ subsection: ChatBot
6
+ # Sidenav secondary level section
7
+ # should be the same for all markdown files
8
+ id: Analytics
9
+ source: Analytics
10
+ # Tab (react | react-demos | html | html-demos | design-guidelines | accessibility)
11
+ # If you use typescript, the name of the interface to display props for
12
+ # These are found through the sourceProps function provided in patternfly-docs.source.js
13
+ sortValue: 60
14
+ ---
15
+
16
+ import "../../images.css"
17
+
18
+ To gain more insight into the ways that your users interact with your ChatBot, you can add support for **analytics**. To add analytics tracking, you can refer to this guide and configure tracking for the interactions you care about most.
19
+
20
+ ## Elements
21
+
22
+ This following diagram shows the main components of ChatBot analytics tracking code, as well as the flow of information between components:
23
+
24
+ <div class="ws-docs-content-img">
25
+ ![Main elements of the tracking code.](../../img/chatbot-analytics.svg)
26
+ </div>
27
+
28
+ The user code (1) first calls the static `getTrackingProviders()` method (3) which initializes the tracking providers (4). This returns an instance of the `trackingAPI` (2), which can then subsequently be used to emit analytics events.
29
+
30
+ Note that user code only interacts with:
31
+
32
+ - `trackingAPI` (including `identify`, `trackPageview`, `trackSingleItem`)
33
+ - `TrackingRegistry` (including `getTrackingProviders`)
34
+
35
+ ## Usage
36
+
37
+ ### Setup
38
+
39
+ 1. Before you can use the `trackingAPI`, you must first supply the API keys of the respective providers.
40
+
41
+ ```nolive
42
+ const initProps: InitProps = {
43
+ segmentKey: 'TODO-key', // TODO add your key here
44
+ // segmentCdn: 'https://my.org/cdn', // Set up segment cdn (optional)
45
+ // segmentIntegrations: { // Provide Segment integrations (optional)
46
+ // 'Segment.io': {
47
+ // apiHost: 'my.api.host/api/v1',
48
+ // protocol: 'https'
49
+ // }
50
+ },
51
+
52
+ posthogKey: 'TODO-key',
53
+ umamiKey: 'TODO-key',
54
+ umamiHostUrl: 'http://localhost:3000', // TODO where is your JS provider?
55
+ something: 'test',
56
+ console: 'true' // Console provider
57
+ };
58
+ ```
59
+
60
+ 1. Once this is done, you can create an instance of the `trackingAPI` and start sending events.
61
+
62
+ ```nolive
63
+ const trackingAPI = getTrackingProviders(initProps);
64
+ ```
65
+
66
+ 1. One of your first events should identify the user in some way, such as a UUID that stays consistent for the same user.
67
+
68
+ ```nolive
69
+ const trackingAPI = getTrackingProviders(initProps);
70
+ trackingAPI.identify('user-123'); // TODO get real user id
71
+ // Track the page that is currently visited. Best put into a react effect (see below)
72
+ trackingAPI.trackPageView();
73
+ // Track a single Event
74
+ trackingAPI.trackSingleItem("MyEvent", { response: 'Good response' })
75
+ ```
76
+
77
+ #### Tracking providers
78
+
79
+ Only providers with a matching key in the `InitProps` will be started and used.
80
+
81
+ ```nolive
82
+ const initProps: InitProps = {
83
+ segmentKey: 'TODO-key', // TODO add your key here
84
+ posthogKey: 'TODO-key',
85
+ umamiKey: 'TODO-key',
86
+ umamiHostUrl: 'http://localhost:3000', // TODO where is your JS provider?
87
+ console: true
88
+ ```
89
+
90
+ ##### Modifying providers
91
+
92
+ If you know upfront that you only want to use 1 of the supported providers, you can modify `getTrackingProviders()` and remove all other providers in the providers array.
93
+
94
+ When using the providers you need to add additional dependencies to your package.json file:
95
+
96
+ ```nolive
97
+ "dependencies": {
98
+ "@segment/analytics-next": "^1.76.0",
99
+ "posthog-js": "^1.194.4"
100
+ ```
101
+
102
+ ##### Adding providers
103
+
104
+ To add another analytics provider, you need to implement 2 interfaces, `TrackingSpi` and `trackingApi`.
105
+
106
+ 1. It is easiest to start by copying the `ConsoleTrackingProvider`
107
+ 1. The first thing you should do is to provide a correct value in `getKey()`
108
+ 1. Once you are happy enough with the implementation, add it to the array of providers in `getTrackingProviders()`
109
+
110
+ ### Page flow tracking
111
+
112
+ To understand how users move through their ChatBot journey, you can track their page flow.
113
+
114
+ To add tracking to each page view, use the `trackPageView()` method.
115
+
116
+ ```nolive
117
+ import React from 'react';
118
+ import { useLocation } from 'react-router-dom';
119
+
120
+ export const useTrackPageFlow = (): void => {
121
+ const { pathname } = useLocation();
122
+
123
+ // notify url change events
124
+ React.useEffect(() => {
125
+ trackingAPI.trackPageView();
126
+ }, [pathname]);
127
+ };
128
+ ```
129
+
130
+ ### Event tracking
131
+
132
+ To get more specific insight into how users are interacting with the UI, you can track single events, including button clicks, form submissions, and so on.
133
+
134
+ To add tracking to an interaction of your choice, use the `trackSingleItem` method.
135
+
136
+ ```nolive
137
+ trackingAPI.trackSingleItem(eventName, propertyDict)
138
+ ```
139
+
140
+ This method takes 2 parameters:
141
+
142
+ - `eventName`: The unique name of the event. To differentiate different events that use the same name, you'll need to add an additional property.
143
+ - `propertyDict`: A dict with key-value pairs that represent important properties of the event. If there are none, this value can be empty.
144
+
145
+ #### Form submissions
146
+
147
+ Only add tracking to the form itself, not the button that opens the form. You should track both successful and failed form submissions, as well as cancelled forms
148
+
149
+ ```nolive
150
+ trackingAPI.trackSingleItem(Event_Name, {
151
+ outcome: << submit , cancel >>,
152
+ success? : boolean,
153
+ error? : string,
154
+ <properties>, string/number/boolean } )
155
+ ```
156
+
157
+ Parameters to pass with the `trackSingleItem` method can include:
158
+
159
+ - `outcome`: Communicates if the form was submitted or cancelled.
160
+ - `success`: Used for a "submit" outcome to communicate if the submission was successful for not in the backend.
161
+ - `error`: Used for a "submit" outcome to communicate the error message associated with a failed submission. Try to remove extraneous parts of the message, like part of a container-name.
162
+ - `properties`: Any additional properties from the form, to be tracked for analytics.
163
+ - Use your judgement to determine what will be useful for your analytics.
164
+ - Highly specific data, like names provided by the user or description text input, should not be tracked.
165
+ - Less personal data, like deployment replica count or memory server size, is more likely to help you understand your users.
166
+
167
+ ## Examples
168
+
169
+ To better understand the analytics tracking process, here are 3 examples of what you could see in an analytics tool.
170
+
171
+ For all 3 tools, consider the following example, where the user has started a ChatBot and taken actions 1-5 in order:
172
+
173
+ <div class="ws-docs-content-img" style="width:60%">
174
+ ![Events done in the ChatBot](../../img/analytics-example.svg)
175
+ </div>
176
+
177
+ 1. Selected a model
178
+ 2. Sent a question
179
+ 3. Received a response from the model
180
+ 4. Clicked the "thumbs up" button
181
+ 5. Closed the ChatBot window
182
+
183
+ This pattern of actions will be applied to the following 3 analytics tools.
184
+
185
+ 1. Segment
186
+
187
+ - [Segment](https://segment.com/) shows all user events in its source debugger:
188
+
189
+ <div class="ws-docs-content-img" style="width:70%">
190
+ ![Events displayed in the Segment debugger](../../img/segment.svg)
191
+ </div>
192
+
193
+ - 1-5: User actions with the newest event at the top.
194
+ - 6-7: You can also see the results of `identify` (6) and `trackPageView` (7).
195
+ - If you clicked on an event, you would also see the properties.
196
+
197
+ - **Note**: When using the Segment provider, you may also want to set the `segmentCdn` and `segmentIntegrations` initialization properties.
198
+
199
+ 1. Umami
200
+
201
+ - In [Umami](https://umami.is/), events are visible within **Website** / **Events**.
202
+ - The list is similar to Segment, with different formatting:
203
+
204
+ <div class="ws-docs-content-img">
205
+ ![Events in Umami](../../img/umami.svg)
206
+ </div>
207
+
208
+ - 1-5: User actions with the newest event at the top.
209
+
210
+ 1. PostHog
211
+
212
+ - In [PostHog](https://posthog.com/), events are located in the **Activity** section.
213
+ - PostHog integrates deeper in the provided code, so there are more default events tracked:
214
+
215
+ <div class="ws-docs-content-img">
216
+ ![Events in PostHog](../../img/posthog.svg)
217
+ </div>
218
+
219
+ - 1-5: User actions with the newest event at the top.
@@ -6,8 +6,8 @@ export const AttachmentErrorExample: React.FunctionComponent = () => (
6
6
  variant="danger"
7
7
  // eslint-disable-next-line no-console
8
8
  onClose={() => console.log('Clicked the close button')}
9
- title="File upload failed"
9
+ title="Could not upload file"
10
10
  >
11
- Your file size is too large. Please ensure that your file is less than 25 MB.
11
+ Your file size must be less than 25 MB.
12
12
  </ChatbotAlert>
13
13
  );
@@ -2,9 +2,43 @@ import React from 'react';
2
2
  import Message from '@patternfly/chatbot/dist/dynamic/Message';
3
3
  import patternflyAvatar from './patternfly_avatar.jpg';
4
4
  import squareImg from './PF-social-color-square.svg';
5
+ import { AlertActionLink, Form, FormGroup, Radio } from '@patternfly/react-core';
5
6
 
6
7
  export const BotMessageExample: React.FunctionComponent = () => {
7
- const markdown = `
8
+ const [variant, setVariant] = React.useState('code');
9
+
10
+ /* eslint-disable indent */
11
+ const renderContent = () => {
12
+ switch (variant) {
13
+ case 'code':
14
+ return code;
15
+ case 'heading':
16
+ return heading;
17
+ case 'emphasis':
18
+ return emphasis;
19
+ case 'blockQuotes':
20
+ return blockQuotes;
21
+ case 'orderedList':
22
+ return orderedList;
23
+ case 'unorderedList':
24
+ return unorderedList;
25
+ case 'moreComplexList':
26
+ return moreComplexList;
27
+ case 'inlineCode':
28
+ return inlineCode;
29
+ case 'link':
30
+ return link;
31
+ case 'table':
32
+ return table;
33
+ case 'image':
34
+ return image;
35
+ default:
36
+ return;
37
+ }
38
+ };
39
+ /* eslint-enable indent */
40
+
41
+ const code = `
8
42
  Here is some YAML code:
9
43
 
10
44
  ~~~yaml
@@ -35,6 +69,36 @@ export default MessageLoading;
35
69
  ~~~
36
70
  `;
37
71
 
72
+ const heading = `
73
+ # h1 Heading
74
+
75
+ ## h2 Heading
76
+
77
+ ### h3 Heading
78
+
79
+ #### h4 Heading
80
+
81
+ ##### h5 Heading
82
+
83
+ ###### h6 Heading
84
+ `;
85
+
86
+ const emphasis = `
87
+ **Bold text, formatted with double asterisks**
88
+
89
+ __Bold text, formatted with double underscores__
90
+
91
+ *Italic text, formatted with single asterisks*
92
+
93
+ _Italic text, formatted with single underscores_
94
+
95
+ ~~Strikethrough~~
96
+ `;
97
+
98
+ const blockQuotes = `> Blockquotes can also be nested...
99
+ >> ...by using additional greater-than signs (>) right next to each other...
100
+ > > > ...or with spaces between each sign.`;
101
+
38
102
  const orderedList = `
39
103
  Here is an ordered list:
40
104
 
@@ -53,43 +117,181 @@ export default MessageLoading;
53
117
 
54
118
  1. **Using a \`toaster\`:**
55
119
 
56
- - Place \`bread\` in a \`toaster\`
57
- - Once \`bread\` is lightly browned, remove from \`toaster\`
120
+ - Place \`bread\` in a \`toaster\`.
121
+ - Once \`bread\` is lightly browned, remove from \`toaster\`.
58
122
 
59
123
  2. **Using a \`knife\`:**
60
124
 
61
125
  Acquire 1 tablespoon of room temperature \`butter\`. Use \`knife\` to spread butter on \`toast\`. Bon appétit!
62
126
  `;
63
127
 
128
+ const link = `A paragraph with a URL: https://reactjs.org.`;
129
+
130
+ const inlineCode = `Here is an inline code - \`() => void\``;
131
+
132
+ const table = `To customize your table, you can use [PatternFly TableProps](/components/table#table)
133
+
134
+ | Version | GA date | User role
135
+ |-|-|-|
136
+ | 2.5 | September 30, 2024 | Administrator |
137
+ | 2.5 | June 27, 2023 | Editor |
138
+ | 3.0 | April 1, 2025 | Administrator
139
+ `;
140
+
141
+ const image = `![Multi-colored wavy lines on a black background](https://cdn.dribbble.com/userupload/10651749/file/original-8a07b8e39d9e8bf002358c66fce1223e.gif)`;
142
+
143
+ const error = {
144
+ title: 'Could not load chat',
145
+ children: 'Wait a few minutes and check your network settings. If the issue persists: ',
146
+ actionLinks: (
147
+ <React.Fragment>
148
+ <AlertActionLink component="a" href="#">
149
+ Start a new chat
150
+ </AlertActionLink>
151
+ <AlertActionLink component="a" href="#">
152
+ Contact support
153
+ </AlertActionLink>
154
+ </React.Fragment>
155
+ )
156
+ };
157
+
64
158
  return (
65
159
  <>
66
- <Message name="Bot" role="bot" avatar={patternflyAvatar} content={`Text-based message from a bot named "Bot"`} />
67
160
  <Message
68
161
  name="Bot"
69
162
  role="bot"
70
163
  avatar={patternflyAvatar}
71
- content={`Text-based message from a bot named "Bot," with updated timestamp`}
164
+ content={`This is a text-based message from a bot named "Bot."`}
165
+ />
166
+ <Message
167
+ name="Bot"
168
+ role="bot"
169
+ avatar={patternflyAvatar}
170
+ content={`This is a text-based message from "Bot," with an updated timestamp.`}
72
171
  timestamp="1 hour ago"
73
172
  />
74
- <Message name="Bot" role="bot" avatar={patternflyAvatar} content={markdown} />
75
- <Message name="Bot" role="bot" avatar={patternflyAvatar} content={orderedList} />
76
- <Message name="Bot" role="bot" avatar={patternflyAvatar} content={unorderedList} />
77
- <Message name="Bot" role="bot" avatar={patternflyAvatar} content={moreComplexList} />
78
173
  <Message name="Bot" role="bot" avatar={patternflyAvatar} content="Example content" isLoading />
79
- <Message role="bot" avatar={patternflyAvatar} content="Text-based message from a nameless bot" />
174
+ <Message role="bot" avatar={patternflyAvatar} content="This message is from a nameless bot." />
80
175
  <Message
81
176
  name="Default Openshift Container Platform Assistant That Can Help With Any Query You Might Need Help With"
82
177
  role="bot"
83
178
  avatar={patternflyAvatar}
84
- content="Text-based message, where the bot's name is truncated"
179
+ content="This is a message from a bot with really long name: it's truncated!"
85
180
  />
86
181
  <Message
87
182
  name="Bot"
88
183
  role="bot"
89
184
  avatar={squareImg}
90
- content="Text-based message from a bot with a square avatar. You can further customize the avatar by applying an additional class or passing [PatternFly avatar props](/components/avatar) to the `<Message>` component via `avatarProps`."
185
+ content="This bot has a square avatar. You can further customize the avatar by applying an additional class or passing [PatternFly avatar props](/components/avatar) to the `<Message>` component via `avatarProps`."
91
186
  hasRoundAvatar={false}
92
187
  />
188
+ <Message
189
+ name="Bot"
190
+ role="bot"
191
+ avatar={patternflyAvatar}
192
+ content={`Text-based message from a bot named "Bot," with updated timestamp`}
193
+ timestamp="1 hour ago"
194
+ />
195
+ <Message name="Bot" role="bot" avatar={patternflyAvatar} content="Example content" isLoading />
196
+
197
+ <Form>
198
+ <FormGroup role="radiogroup" isInline fieldId="bot-message-type" label="Message content type">
199
+ <Radio
200
+ isChecked={variant === 'code'}
201
+ onChange={() => setVariant('code')}
202
+ name="bot-message-type"
203
+ label="Code"
204
+ id="code"
205
+ />
206
+ <Radio
207
+ isChecked={variant === 'inlineCode'}
208
+ onChange={() => setVariant('inlineCode')}
209
+ name="bot-message-type"
210
+ label="Inline code"
211
+ id="inline-code"
212
+ />
213
+ <Radio
214
+ isChecked={variant === 'heading'}
215
+ onChange={() => setVariant('heading')}
216
+ name="bot-message-type"
217
+ label="Heading"
218
+ id="heading"
219
+ />
220
+ <Radio
221
+ isChecked={variant === 'blockQuotes'}
222
+ onChange={() => setVariant('blockQuotes')}
223
+ name="bot-message-type"
224
+ label="Block quote"
225
+ id="block-quotes"
226
+ />
227
+ <Radio
228
+ isChecked={variant === 'emphasis'}
229
+ onChange={() => setVariant('emphasis')}
230
+ name="bot-message-type"
231
+ label="Emphasis"
232
+ id="emphasis"
233
+ />
234
+ <Radio
235
+ isChecked={variant === 'link'}
236
+ onChange={() => setVariant('link')}
237
+ name="bot-message-type"
238
+ label="Link"
239
+ id="link"
240
+ />
241
+ <Radio
242
+ isChecked={variant === 'unorderedList'}
243
+ onChange={() => setVariant('unorderedList')}
244
+ name="bot-message-type"
245
+ label="Unordered list"
246
+ id="unordered-list"
247
+ />
248
+ <Radio
249
+ isChecked={variant === 'orderedList'}
250
+ onChange={() => setVariant('orderedList')}
251
+ name="bot-message-type"
252
+ label="Ordered list"
253
+ id="ordered-list"
254
+ />
255
+ <Radio
256
+ isChecked={variant === 'moreComplexList'}
257
+ onChange={() => setVariant('moreComplexList')}
258
+ name="bot-message-type"
259
+ label="More complex list"
260
+ id="more-complex-list"
261
+ />
262
+ <Radio
263
+ isChecked={variant === 'table'}
264
+ onChange={() => setVariant('table')}
265
+ name="bot-message-type"
266
+ label="Table"
267
+ id="table"
268
+ />
269
+ <Radio
270
+ isChecked={variant === 'image'}
271
+ onChange={() => setVariant('image')}
272
+ name="bot-message-type"
273
+ label="Image"
274
+ id="image"
275
+ />
276
+ <Radio
277
+ isChecked={variant === 'error'}
278
+ onChange={() => setVariant('error')}
279
+ name="bot-message-error"
280
+ label="Error"
281
+ id="error"
282
+ />
283
+ </FormGroup>
284
+ </Form>
285
+ <Message
286
+ name="Bot"
287
+ role="bot"
288
+ avatar={patternflyAvatar}
289
+ content={renderContent()}
290
+ tableProps={
291
+ variant === 'table' ? { 'aria-label': 'App information and user roles for bot messages' } : undefined
292
+ }
293
+ error={variant === 'error' ? error : undefined}
294
+ />
93
295
  </>
94
296
  );
95
297
  };
@@ -53,7 +53,8 @@ export const DropzoneExample: React.FunctionComponent = () => {
53
53
  return (
54
54
  <FileDropZone onFileDrop={handleFileDrop} displayMode="fullscreen">
55
55
  <div className="pf-chatbot__file-drop-zone-example">
56
- Content that shows when no dragging is happening (drag an item here to see the drop zone)
56
+ This is example content that would be shown when no dragging is happening. To see the drop zone, start to drag
57
+ an item into this section. The static content will be replaced by an active drop zone message.
57
58
  </div>
58
59
  </FileDropZone>
59
60
  );
@@ -32,14 +32,14 @@ export const AttachmentMenuExample: React.FunctionComponent = () => {
32
32
  name="User"
33
33
  role="user"
34
34
  avatar={userAvatar}
35
- content="Here is an uploaded file"
35
+ content="Here is an uploaded file:"
36
36
  attachments={[{ name: 'auth-operator.yml', id: '1', onClick, onClose }]}
37
37
  />
38
38
  <Message
39
39
  name="User"
40
40
  role="user"
41
41
  avatar={userAvatar}
42
- content="Here are two uploaded files"
42
+ content="Here are 2 uploaded files:"
43
43
  attachments={[
44
44
  { name: 'auth-operator.yml', id: '1' },
45
45
  { name: 'patternfly.svg', id: '2' }
@@ -11,7 +11,7 @@ export const CustomActionExample: React.FunctionComponent = () => (
11
11
  name="Bot"
12
12
  role="bot"
13
13
  avatar={patternflyAvatar}
14
- content="Example with custom actions"
14
+ content="I updated your account with those settings. You're ready to set up your first dashboard!"
15
15
  actions={{
16
16
  regenerate: {
17
17
  ariaLabel: 'Regenerate',
@@ -0,0 +1,71 @@
1
+ import React from 'react';
2
+ import Message from '@patternfly/chatbot/dist/dynamic/Message';
3
+ import patternflyAvatar from './patternfly_avatar.jpg';
4
+ import { Checkbox, FormGroup, Stack } from '@patternfly/react-core';
5
+
6
+ export const MessageWithFeedbackExample: React.FunctionComponent = () => {
7
+ const [hasCloseButton, setHasCloseButton] = React.useState(false);
8
+ const [hasTextArea, setHasTextArea] = React.useState(false);
9
+
10
+ return (
11
+ <>
12
+ <Stack hasGutter>
13
+ <FormGroup role="radiogroup" isInline fieldId="feedback-card" label="Variant">
14
+ <Checkbox
15
+ isChecked={hasTextArea}
16
+ onChange={() => {
17
+ setHasTextArea(!hasTextArea);
18
+ }}
19
+ name="basic-inline-radio"
20
+ label="Has text area"
21
+ id="has-text-area"
22
+ />
23
+ </FormGroup>
24
+ <Message
25
+ name="Bot"
26
+ role="bot"
27
+ avatar={patternflyAvatar}
28
+ content="This is a message with the feedback card:"
29
+ userFeedbackForm={{
30
+ quickResponses: [
31
+ { id: '1', content: 'Helpful information' },
32
+ { id: '2', content: 'Easy to understand' },
33
+ { id: '3', content: 'Resolved my issue' }
34
+ ],
35
+ onSubmit: (quickResponse, additionalFeedback) =>
36
+ alert(`Selected ${quickResponse} and received the additional feedback: ${additionalFeedback}`),
37
+ hasTextArea,
38
+ // eslint-disable-next-line no-console
39
+ onClose: () => console.log('closed feedback form'),
40
+ focusOnLoad: false
41
+ }}
42
+ />
43
+ </Stack>
44
+ <Stack hasGutter>
45
+ <FormGroup role="radiogroup" isInline fieldId="feedback-thank-you" label="Variant">
46
+ <Checkbox
47
+ isChecked={hasCloseButton}
48
+ onChange={() => {
49
+ setHasCloseButton(!hasCloseButton);
50
+ }}
51
+ name="basic-inline-radio"
52
+ label="Has close button"
53
+ id="has-close"
54
+ />
55
+ </FormGroup>
56
+ <Message
57
+ name="Bot"
58
+ role="bot"
59
+ avatar={patternflyAvatar}
60
+ content="This is a thank-you message, which is displayed once the feedback card is submitted:"
61
+ // eslint-disable-next-line no-console
62
+ userFeedbackComplete={{
63
+ // eslint-disable-next-line no-console
64
+ onClose: hasCloseButton ? () => console.log('closed completion message') : undefined,
65
+ focusOnLoad: false
66
+ }}
67
+ />
68
+ </Stack>
69
+ </>
70
+ );
71
+ };
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import Message from '@patternfly/chatbot/dist/dynamic/Message';
3
+ import patternflyAvatar from './patternfly_avatar.jpg';
4
+ import { Button } from '@patternfly/react-core';
5
+
6
+ export const MessageWithFeedbackTimeoutExample: React.FunctionComponent = () => {
7
+ const [hasFeedback, setHasFeedback] = React.useState(false);
8
+
9
+ return (
10
+ <>
11
+ <Button variant="secondary" onClick={() => setHasFeedback(true)}>
12
+ Show card
13
+ </Button>
14
+ <Button variant="secondary" onClick={() => setHasFeedback(false)}>
15
+ Remove card
16
+ </Button>
17
+ <Message
18
+ name="Bot"
19
+ role="bot"
20
+ avatar={patternflyAvatar}
21
+ content="This completion message times out after you click **Show card**:"
22
+ userFeedbackComplete={hasFeedback ? { timeout: true, onTimeout: () => setHasFeedback(false) } : undefined}
23
+ isLiveRegion
24
+ />
25
+ </>
26
+ );
27
+ };
@@ -31,7 +31,7 @@ export const MessageWithQuickResponsesExample: React.FunctionComponent = () => (
31
31
  name="Bot"
32
32
  role="bot"
33
33
  avatar={patternflyAvatar}
34
- content="Welcome back! How can I help?"
34
+ content="Welcome back, User! How can I help you today?"
35
35
  quickResponses={[
36
36
  { id: '1', content: 'Help me with an access issue', onClick: () => alert('Clicked id 1') },
37
37
  { id: '2', content: 'Show my critical vulnerabilities', onClick: () => alert('Clicked id 2') },
@@ -11,7 +11,7 @@ export const MessageWithQuickStartExample: React.FunctionComponent = () => (
11
11
  name="Bot"
12
12
  role="bot"
13
13
  avatar={patternflyAvatar}
14
- content="Text-based bot message with a quick start tile."
14
+ content="Follow this quick guide to install the Pipelines Operator."
15
15
  quickStarts={{
16
16
  quickStart: explorePipelinesQuickStart as QuickStart,
17
17
  onSelectQuickStart: (id) => alert(id)
@@ -21,7 +21,7 @@ export const MessageWithQuickStartExample: React.FunctionComponent = () => (
21
21
  name="Bot"
22
22
  role="bot"
23
23
  avatar={patternflyAvatar}
24
- content="Text-based bot message with a quick start tile that includes prerequisites and a default icon."
24
+ content="This quick start tile includes prerequisites and a default icon."
25
25
  quickStarts={{
26
26
  quickStart: monitorSampleAppQuickStart,
27
27
  onSelectQuickStart: (id) => alert(id)
@@ -8,7 +8,7 @@ export const ResponseActionExample: React.FunctionComponent = () => (
8
8
  name="Bot"
9
9
  role="bot"
10
10
  avatar={patternflyAvatar}
11
- content="Example with all prebuilt actions"
11
+ content="I updated your account with those settings. You're ready to set up your first dashboard!"
12
12
  actions={{
13
13
  // eslint-disable-next-line no-console
14
14
  positive: { onClick: () => console.log('Good response') },