@patternfly/chatbot 2.2.0-prerelease.9 → 2.2.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.
- package/dist/cjs/AttachmentEdit/AttachmentEdit.test.d.ts +1 -0
- package/dist/cjs/AttachmentEdit/AttachmentEdit.test.js +52 -0
- package/dist/cjs/Chatbot/Chatbot.d.ts +2 -1
- package/dist/cjs/Chatbot/Chatbot.js +1 -0
- package/dist/cjs/Chatbot/Chatbot.test.d.ts +1 -0
- package/dist/cjs/Chatbot/Chatbot.test.js +28 -0
- package/dist/cjs/ChatbotAlert/ChatbotAlert.test.d.ts +1 -0
- package/dist/cjs/ChatbotAlert/ChatbotAlert.test.js +27 -0
- package/dist/cjs/ChatbotContent/ChatbotContent.test.d.ts +1 -0
- package/dist/cjs/ChatbotContent/ChatbotContent.test.js +18 -0
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.d.ts +3 -3
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.js +3 -1
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.d.ts +27 -4
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.js +24 -12
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.js +99 -3
- package/dist/cjs/ChatbotConversationHistoryNav/EmptyState.d.ts +11 -0
- package/dist/cjs/ChatbotConversationHistoryNav/EmptyState.js +29 -0
- package/dist/cjs/ChatbotConversationHistoryNav/LoadingState.d.ts +4 -0
- package/dist/cjs/ChatbotConversationHistoryNav/LoadingState.js +45 -0
- package/dist/cjs/ChatbotFooter/ChatbotFooter.test.d.ts +1 -0
- package/dist/cjs/ChatbotFooter/ChatbotFooter.test.js +18 -0
- package/dist/cjs/ChatbotFooter/ChatbotFooternote.test.d.ts +1 -0
- package/dist/cjs/ChatbotFooter/ChatbotFooternote.test.js +87 -0
- package/dist/cjs/ChatbotFooter/ChatbotFootnote.d.ts +1 -1
- package/dist/cjs/ChatbotFooter/ChatbotFootnote.js +1 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeader.test.d.ts +1 -0
- package/dist/cjs/ChatbotHeader/ChatbotHeader.test.js +18 -0
- package/dist/cjs/ChatbotHeader/ChatbotHeaderActions.test.d.ts +1 -0
- package/dist/cjs/ChatbotHeader/ChatbotHeaderActions.test.js +18 -0
- package/dist/cjs/ChatbotHeader/ChatbotHeaderCloseButton.js +3 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderCloseButton.test.d.ts +1 -0
- package/dist/cjs/ChatbotHeader/ChatbotHeaderCloseButton.test.js +20 -0
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMain.test.d.ts +1 -0
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMain.test.js +18 -0
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.js +3 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.test.d.ts +1 -0
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.test.js +20 -0
- package/dist/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.js +3 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.d.ts +1 -0
- package/dist/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.js +43 -0
- package/dist/cjs/ChatbotHeader/ChatbotHeaderSelectorDropdown.js +6 -4
- package/dist/cjs/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.d.ts +1 -0
- package/dist/cjs/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.js +41 -0
- package/dist/cjs/ChatbotHeader/ChatbotHeaderTitle.d.ts +3 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderTitle.js +4 -2
- package/dist/cjs/ChatbotHeader/ChatbotHeaderTitle.test.d.ts +1 -0
- package/dist/cjs/ChatbotHeader/ChatbotHeaderTitle.test.js +55 -0
- package/dist/cjs/ChatbotToggle/ChatbotToggle.js +3 -1
- package/dist/cjs/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.js +19 -11
- package/dist/cjs/Compare/Compare.d.ts +17 -0
- package/dist/cjs/Compare/Compare.js +50 -0
- package/dist/cjs/Compare/Compare.test.d.ts +1 -0
- package/dist/cjs/Compare/Compare.test.js +20 -0
- package/dist/cjs/Compare/index.d.ts +2 -0
- package/dist/cjs/Compare/index.js +23 -0
- package/dist/cjs/Message/ErrorMessage/ErrorMessage.d.ts +4 -0
- package/dist/cjs/Message/ErrorMessage/ErrorMessage.js +26 -0
- package/dist/cjs/Message/ImageMessage/ImageMessage.d.ts +4 -0
- package/dist/cjs/Message/ImageMessage/ImageMessage.js +25 -0
- package/dist/cjs/Message/LinkMessage/LinkMessage.d.ts +4 -0
- package/dist/cjs/Message/LinkMessage/LinkMessage.js +30 -0
- package/dist/cjs/Message/Message.d.ts +35 -8
- package/dist/cjs/Message/Message.js +68 -18
- package/dist/cjs/Message/Message.test.js +239 -3
- package/dist/cjs/Message/QuickResponse/QuickResponse.d.ts +17 -0
- package/dist/cjs/Message/QuickResponse/QuickResponse.js +34 -0
- package/dist/cjs/Message/TableMessage/TableMessage.d.ts +20 -0
- package/dist/cjs/Message/TableMessage/TableMessage.js +67 -0
- package/dist/cjs/Message/TableMessage/TbodyMessage.d.ts +7 -0
- package/dist/cjs/Message/TableMessage/TbodyMessage.js +33 -0
- package/dist/cjs/Message/TableMessage/TdMessage.d.ts +5 -0
- package/dist/cjs/Message/TableMessage/TdMessage.js +26 -0
- package/dist/cjs/Message/TableMessage/ThMessage.d.ts +5 -0
- package/dist/cjs/Message/TableMessage/ThMessage.js +26 -0
- package/dist/cjs/Message/TableMessage/TheadMessage.d.ts +5 -0
- package/dist/cjs/Message/TableMessage/TheadMessage.js +26 -0
- package/dist/cjs/Message/TableMessage/TrMessage.d.ts +7 -0
- package/dist/cjs/Message/TableMessage/TrMessage.js +37 -0
- package/dist/cjs/Message/TextMessage/TextMessage.d.ts +2 -1
- package/dist/cjs/Message/TextMessage/TextMessage.js +2 -2
- package/dist/cjs/Message/UserFeedback/CloseButton.d.ts +10 -0
- package/dist/cjs/Message/UserFeedback/CloseButton.js +14 -0
- package/dist/cjs/Message/UserFeedback/UserFeedback.d.ts +39 -0
- package/dist/cjs/Message/UserFeedback/UserFeedback.js +54 -0
- package/dist/cjs/Message/UserFeedback/UserFeedback.test.d.ts +1 -0
- package/dist/cjs/Message/UserFeedback/UserFeedback.test.js +133 -0
- package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.d.ts +42 -0
- package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.js +117 -0
- package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.test.d.ts +1 -0
- package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.test.js +249 -0
- package/dist/cjs/MessageBar/AttachButton.js +4 -2
- package/dist/cjs/MessageBar/MessageBar.d.ts +11 -4
- package/dist/cjs/MessageBar/MessageBar.js +127 -46
- package/dist/cjs/MessageBar/MessageBar.test.js +12 -4
- package/dist/cjs/MessageBar/MicrophoneButton.d.ts +1 -1
- package/dist/cjs/MessageBar/SendButton.js +3 -1
- package/dist/cjs/MessageBar/StopButton.js +3 -1
- package/dist/cjs/MessageBox/MessageBox.test.d.ts +1 -0
- package/dist/cjs/MessageBox/MessageBox.test.js +22 -0
- package/dist/cjs/PreviewAttachment/PreviewAttachment.test.d.ts +1 -0
- package/dist/cjs/PreviewAttachment/PreviewAttachment.test.js +28 -0
- package/dist/cjs/ResponseActions/ResponseActionButton.d.ts +4 -1
- package/dist/cjs/ResponseActions/ResponseActionButton.js +21 -6
- package/dist/cjs/ResponseActions/ResponseActions.d.ts +8 -2
- package/dist/cjs/ResponseActions/ResponseActions.js +7 -7
- package/dist/cjs/ResponseActions/ResponseActions.test.js +2 -2
- package/dist/cjs/Settings/SettingsForm.test.d.ts +1 -0
- package/dist/cjs/Settings/SettingsForm.test.js +26 -0
- package/dist/cjs/__mocks__/rehype-external-links.d.ts +2 -0
- package/dist/cjs/__mocks__/rehype-external-links.js +4 -0
- package/dist/cjs/__mocks__/rehype-sanitize.d.ts +2 -0
- package/dist/cjs/__mocks__/rehype-sanitize.js +4 -0
- package/dist/cjs/__mocks__/rehype-unwrap-images.d.ts +2 -0
- package/dist/cjs/__mocks__/rehype-unwrap-images.js +4 -0
- package/dist/cjs/index.d.ts +4 -0
- package/dist/cjs/index.js +7 -1
- package/dist/cjs/tracking/console_tracking_provider.d.ts +10 -0
- package/dist/cjs/tracking/console_tracking_provider.js +27 -0
- package/dist/cjs/tracking/index.d.ts +2 -0
- package/dist/cjs/tracking/index.js +23 -0
- package/dist/cjs/tracking/posthog_tracking_provider.d.ts +9 -0
- package/dist/cjs/tracking/posthog_tracking_provider.js +37 -0
- package/dist/cjs/tracking/segment_tracking_provider.d.ts +10 -0
- package/dist/cjs/tracking/segment_tracking_provider.js +50 -0
- package/dist/cjs/tracking/trackingProviderProxy.d.ts +9 -0
- package/dist/cjs/tracking/trackingProviderProxy.js +24 -0
- package/dist/cjs/tracking/tracking_api.d.ts +8 -0
- package/dist/cjs/tracking/tracking_api.js +2 -0
- package/dist/cjs/tracking/tracking_registry.d.ts +4 -0
- package/dist/cjs/tracking/tracking_registry.js +33 -0
- package/dist/cjs/tracking/tracking_spi.d.ts +9 -0
- package/dist/cjs/tracking/tracking_spi.js +2 -0
- package/dist/cjs/tracking/umami_tracking_provider.d.ts +14 -0
- package/dist/cjs/tracking/umami_tracking_provider.js +44 -0
- package/dist/css/main.css +420 -148
- package/dist/css/main.css.map +1 -1
- package/dist/dynamic/Compare/package.json +1 -0
- package/dist/dynamic/tracking/package.json +1 -0
- package/dist/esm/AttachmentEdit/AttachmentEdit.test.d.ts +1 -0
- package/dist/esm/AttachmentEdit/AttachmentEdit.test.js +47 -0
- package/dist/esm/Chatbot/Chatbot.d.ts +2 -1
- package/dist/esm/Chatbot/Chatbot.js +1 -0
- package/dist/esm/Chatbot/Chatbot.test.d.ts +1 -0
- package/dist/esm/Chatbot/Chatbot.test.js +23 -0
- package/dist/esm/ChatbotAlert/ChatbotAlert.test.d.ts +1 -0
- package/dist/esm/ChatbotAlert/ChatbotAlert.test.js +22 -0
- package/dist/esm/ChatbotContent/ChatbotContent.test.d.ts +1 -0
- package/dist/esm/ChatbotContent/ChatbotContent.test.js +13 -0
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.d.ts +3 -3
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.js +3 -1
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.d.ts +27 -4
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.js +24 -12
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.js +99 -3
- package/dist/esm/ChatbotConversationHistoryNav/EmptyState.d.ts +11 -0
- package/dist/esm/ChatbotConversationHistoryNav/EmptyState.js +22 -0
- package/dist/esm/ChatbotConversationHistoryNav/LoadingState.d.ts +4 -0
- package/dist/esm/ChatbotConversationHistoryNav/LoadingState.js +38 -0
- package/dist/esm/ChatbotFooter/ChatbotFooter.test.d.ts +1 -0
- package/dist/esm/ChatbotFooter/ChatbotFooter.test.js +13 -0
- package/dist/esm/ChatbotFooter/ChatbotFooternote.test.d.ts +1 -0
- package/dist/esm/ChatbotFooter/ChatbotFooternote.test.js +82 -0
- package/dist/esm/ChatbotFooter/ChatbotFootnote.d.ts +1 -1
- package/dist/esm/ChatbotFooter/ChatbotFootnote.js +1 -1
- package/dist/esm/ChatbotHeader/ChatbotHeader.test.d.ts +1 -0
- package/dist/esm/ChatbotHeader/ChatbotHeader.test.js +13 -0
- package/dist/esm/ChatbotHeader/ChatbotHeaderActions.test.d.ts +1 -0
- package/dist/esm/ChatbotHeader/ChatbotHeaderActions.test.js +13 -0
- package/dist/esm/ChatbotHeader/ChatbotHeaderCloseButton.js +3 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderCloseButton.test.d.ts +1 -0
- package/dist/esm/ChatbotHeader/ChatbotHeaderCloseButton.test.js +15 -0
- package/dist/esm/ChatbotHeader/ChatbotHeaderMain.test.d.ts +1 -0
- package/dist/esm/ChatbotHeader/ChatbotHeaderMain.test.js +13 -0
- package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.js +3 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.test.d.ts +1 -0
- package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.test.js +15 -0
- package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.js +3 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.d.ts +1 -0
- package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.js +38 -0
- package/dist/esm/ChatbotHeader/ChatbotHeaderSelectorDropdown.js +6 -4
- package/dist/esm/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.d.ts +1 -0
- package/dist/esm/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.js +36 -0
- package/dist/esm/ChatbotHeader/ChatbotHeaderTitle.d.ts +3 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderTitle.js +4 -2
- package/dist/esm/ChatbotHeader/ChatbotHeaderTitle.test.d.ts +1 -0
- package/dist/esm/ChatbotHeader/ChatbotHeaderTitle.test.js +50 -0
- package/dist/esm/ChatbotToggle/ChatbotToggle.js +3 -1
- package/dist/esm/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.js +19 -11
- package/dist/esm/Compare/Compare.d.ts +17 -0
- package/dist/esm/Compare/Compare.js +43 -0
- package/dist/esm/Compare/Compare.test.d.ts +1 -0
- package/dist/esm/Compare/Compare.test.js +15 -0
- package/dist/esm/Compare/index.d.ts +2 -0
- package/dist/esm/Compare/index.js +2 -0
- package/dist/esm/Message/ErrorMessage/ErrorMessage.d.ts +4 -0
- package/dist/esm/Message/ErrorMessage/ErrorMessage.js +21 -0
- package/dist/esm/Message/ImageMessage/ImageMessage.d.ts +4 -0
- package/dist/esm/Message/ImageMessage/ImageMessage.js +20 -0
- package/dist/esm/Message/LinkMessage/LinkMessage.d.ts +4 -0
- package/dist/esm/Message/LinkMessage/LinkMessage.js +25 -0
- package/dist/esm/Message/Message.d.ts +35 -8
- package/dist/esm/Message/Message.js +66 -16
- package/dist/esm/Message/Message.test.js +239 -3
- package/dist/esm/Message/QuickResponse/QuickResponse.d.ts +17 -0
- package/dist/esm/Message/QuickResponse/QuickResponse.js +27 -0
- package/dist/esm/Message/TableMessage/TableMessage.d.ts +20 -0
- package/dist/esm/Message/TableMessage/TableMessage.js +62 -0
- package/dist/esm/Message/TableMessage/TbodyMessage.d.ts +7 -0
- package/dist/esm/Message/TableMessage/TbodyMessage.js +28 -0
- package/dist/esm/Message/TableMessage/TdMessage.d.ts +5 -0
- package/dist/esm/Message/TableMessage/TdMessage.js +21 -0
- package/dist/esm/Message/TableMessage/ThMessage.d.ts +5 -0
- package/dist/esm/Message/TableMessage/ThMessage.js +21 -0
- package/dist/esm/Message/TableMessage/TheadMessage.d.ts +5 -0
- package/dist/esm/Message/TableMessage/TheadMessage.js +21 -0
- package/dist/esm/Message/TableMessage/TrMessage.d.ts +7 -0
- package/dist/esm/Message/TableMessage/TrMessage.js +32 -0
- package/dist/esm/Message/TextMessage/TextMessage.d.ts +2 -1
- package/dist/esm/Message/TextMessage/TextMessage.js +3 -3
- package/dist/esm/Message/UserFeedback/CloseButton.d.ts +10 -0
- package/dist/esm/Message/UserFeedback/CloseButton.js +9 -0
- package/dist/esm/Message/UserFeedback/UserFeedback.d.ts +39 -0
- package/dist/esm/Message/UserFeedback/UserFeedback.js +49 -0
- package/dist/esm/Message/UserFeedback/UserFeedback.test.d.ts +1 -0
- package/dist/esm/Message/UserFeedback/UserFeedback.test.js +128 -0
- package/dist/esm/Message/UserFeedback/UserFeedbackComplete.d.ts +42 -0
- package/dist/esm/Message/UserFeedback/UserFeedbackComplete.js +112 -0
- package/dist/esm/Message/UserFeedback/UserFeedbackComplete.test.d.ts +1 -0
- package/dist/esm/Message/UserFeedback/UserFeedbackComplete.test.js +244 -0
- package/dist/esm/MessageBar/AttachButton.js +4 -2
- package/dist/esm/MessageBar/MessageBar.d.ts +11 -4
- package/dist/esm/MessageBar/MessageBar.js +127 -46
- package/dist/esm/MessageBar/MessageBar.test.js +12 -4
- package/dist/esm/MessageBar/MicrophoneButton.d.ts +1 -1
- package/dist/esm/MessageBar/SendButton.js +3 -1
- package/dist/esm/MessageBar/StopButton.js +3 -1
- package/dist/esm/MessageBox/MessageBox.test.d.ts +1 -0
- package/dist/esm/MessageBox/MessageBox.test.js +17 -0
- package/dist/esm/PreviewAttachment/PreviewAttachment.test.d.ts +1 -0
- package/dist/esm/PreviewAttachment/PreviewAttachment.test.js +23 -0
- package/dist/esm/ResponseActions/ResponseActionButton.d.ts +4 -1
- package/dist/esm/ResponseActions/ResponseActionButton.js +18 -3
- package/dist/esm/ResponseActions/ResponseActions.d.ts +8 -2
- package/dist/esm/ResponseActions/ResponseActions.js +7 -7
- package/dist/esm/ResponseActions/ResponseActions.test.js +2 -2
- package/dist/esm/Settings/SettingsForm.test.d.ts +1 -0
- package/dist/esm/Settings/SettingsForm.test.js +21 -0
- package/dist/esm/__mocks__/rehype-external-links.d.ts +2 -0
- package/dist/esm/__mocks__/rehype-external-links.js +2 -0
- package/dist/esm/__mocks__/rehype-sanitize.d.ts +2 -0
- package/dist/esm/__mocks__/rehype-sanitize.js +2 -0
- package/dist/esm/__mocks__/rehype-unwrap-images.d.ts +2 -0
- package/dist/esm/__mocks__/rehype-unwrap-images.js +2 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/tracking/console_tracking_provider.d.ts +10 -0
- package/dist/esm/tracking/console_tracking_provider.js +23 -0
- package/dist/esm/tracking/index.d.ts +2 -0
- package/dist/esm/tracking/index.js +2 -0
- package/dist/esm/tracking/posthog_tracking_provider.d.ts +9 -0
- package/dist/esm/tracking/posthog_tracking_provider.js +33 -0
- package/dist/esm/tracking/segment_tracking_provider.d.ts +10 -0
- package/dist/esm/tracking/segment_tracking_provider.js +46 -0
- package/dist/esm/tracking/trackingProviderProxy.d.ts +9 -0
- package/dist/esm/tracking/trackingProviderProxy.js +22 -0
- package/dist/esm/tracking/tracking_api.d.ts +8 -0
- package/dist/esm/tracking/tracking_api.js +1 -0
- package/dist/esm/tracking/tracking_registry.d.ts +4 -0
- package/dist/esm/tracking/tracking_registry.js +26 -0
- package/dist/esm/tracking/tracking_spi.d.ts +9 -0
- package/dist/esm/tracking/tracking_spi.js +1 -0
- package/dist/esm/tracking/umami_tracking_provider.d.ts +14 -0
- package/dist/esm/tracking/umami_tracking_provider.js +40 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -3
- package/patternfly-docs/content/extensions/chatbot/about-chatbot.md +8 -2
- package/patternfly-docs/content/extensions/chatbot/design-guidelines.md +192 -15
- package/patternfly-docs/content/extensions/chatbot/examples/Analytics/Analytics.md +219 -0
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/AttachmentError.tsx +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/BotMessage.tsx +214 -12
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/FileDropZone.tsx +2 -1
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithAttachment.tsx +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithCustomResponseActions.tsx +1 -1
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithFeedback.tsx +71 -0
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithFeedbackTimeout.tsx +27 -0
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithQuickResponses.tsx +1 -1
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithQuickStart.tsx +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithResponseActions.tsx +1 -1
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithSources.tsx +1 -1
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/Messages.md +49 -8
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/UserMessage.tsx +244 -14
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/UserMessageWithExtraContent.tsx +54 -0
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotFooter.tsx +1 -1
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotFootnote.tsx +5 -5
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderBasic.tsx +1 -1
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderDrawer.tsx +36 -3
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderDrawerNavigation.tsx +67 -0
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderDrawerResizable.tsx +94 -0
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotMessageBarAttach.tsx +1 -1
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotWelcomeInteraction.tsx +1 -1
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotWelcomePrompt.tsx +7 -7
- package/patternfly-docs/content/extensions/chatbot/examples/UI/UI.md +21 -6
- package/patternfly-docs/content/extensions/chatbot/examples/demos/AttachmentDemos.md +14 -0
- package/patternfly-docs/content/extensions/chatbot/examples/demos/Chatbot.md +39 -1
- package/patternfly-docs/content/extensions/chatbot/examples/demos/Chatbot.tsx +48 -35
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotAttachment.tsx +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotAttachmentMenu.tsx +3 -3
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotInDrawer.tsx +453 -0
- package/patternfly-docs/content/extensions/chatbot/examples/demos/EmbeddedChatbot.tsx +11 -11
- package/patternfly-docs/content/extensions/chatbot/examples/demos/EmbeddedComparisonChatbot.tsx +206 -0
- package/patternfly-docs/content/extensions/chatbot/examples/demos/Feedback.tsx +104 -0
- package/patternfly-docs/content/extensions/chatbot/img/ai-action-inpage.svg +85 -0
- package/patternfly-docs/content/extensions/chatbot/img/ai-action-message.svg +63 -0
- package/patternfly-docs/content/extensions/chatbot/img/analytics-example.svg +127 -0
- package/patternfly-docs/content/extensions/chatbot/img/attached-file.svg +24 -29
- package/patternfly-docs/content/extensions/chatbot/img/attachment-menu.svg +4 -4
- package/patternfly-docs/content/extensions/chatbot/img/attachment-unsent.svg +30 -58
- package/patternfly-docs/content/extensions/chatbot/img/chatbot-analytics.svg +51 -0
- package/patternfly-docs/content/extensions/chatbot/img/chatbot-elements.svg +11 -12
- package/patternfly-docs/content/extensions/chatbot/img/chatbot-quickstarts-tile.svg +58 -0
- package/patternfly-docs/content/extensions/chatbot/img/chatbot-settings.svg +83 -0
- package/patternfly-docs/content/extensions/chatbot/img/comparison.svg +45 -0
- package/patternfly-docs/content/extensions/chatbot/img/conversation-history.svg +6 -29
- package/patternfly-docs/content/extensions/chatbot/img/docked.svg +259 -241
- package/patternfly-docs/content/extensions/chatbot/img/drawer.svg +255 -0
- package/patternfly-docs/content/extensions/chatbot/img/error-state.svg +30 -0
- package/patternfly-docs/content/extensions/chatbot/img/feedback-form.svg +88 -0
- package/patternfly-docs/content/extensions/chatbot/img/footnote.svg +1 -1
- package/patternfly-docs/content/extensions/chatbot/img/fullscreen.svg +25 -16
- package/patternfly-docs/content/extensions/chatbot/img/listening-pulse.svg +22 -0
- package/patternfly-docs/content/extensions/chatbot/img/listening.svg +1 -1
- package/patternfly-docs/content/extensions/chatbot/img/loading-state.svg +28 -0
- package/patternfly-docs/content/extensions/chatbot/img/masthead-toggle-notification.svg +49 -0
- package/patternfly-docs/content/extensions/chatbot/img/masthead-toggle.svg +75 -0
- package/patternfly-docs/content/extensions/chatbot/img/message-bar-elements.svg +3 -3
- package/patternfly-docs/content/extensions/chatbot/img/message-elements.svg +84 -142
- package/patternfly-docs/content/extensions/chatbot/img/message-feedback.svg +52 -0
- package/patternfly-docs/content/extensions/chatbot/img/message-responses.svg +54 -0
- package/patternfly-docs/content/extensions/chatbot/img/new-chat-emptystate.svg +27 -0
- package/patternfly-docs/content/extensions/chatbot/img/no-results-emptystate.svg +27 -0
- package/patternfly-docs/content/extensions/chatbot/img/overlay.svg +54 -39
- package/patternfly-docs/content/extensions/chatbot/img/posthog.svg +30 -0
- package/patternfly-docs/content/extensions/chatbot/img/segment.svg +36 -0
- package/patternfly-docs/content/extensions/chatbot/img/settings-menu.svg +122 -0
- package/patternfly-docs/content/extensions/chatbot/img/source-tile.svg +62 -0
- package/patternfly-docs/content/extensions/chatbot/img/thank-you-card.svg +81 -0
- package/patternfly-docs/content/extensions/chatbot/img/toggle-customizations.svg +12 -0
- package/patternfly-docs/content/extensions/chatbot/img/toggle-tooltips.svg +38 -0
- package/patternfly-docs/content/extensions/chatbot/img/umami.svg +30 -0
- package/patternfly-docs/content/extensions/chatbot/img/welcome-elements.svg +82 -0
- package/patternfly-docs/content/extensions/chatbot/img/welcome-message.svg +94 -0
- package/src/AttachMenu/AttachMenu.scss +1 -1
- package/src/AttachmentEdit/AttachmentEdit.test.tsx +55 -0
- package/src/Chatbot/Chatbot.scss +20 -1
- package/src/Chatbot/Chatbot.test.tsx +31 -0
- package/src/Chatbot/Chatbot.tsx +2 -1
- package/src/ChatbotAlert/ChatbotAlert.test.tsx +31 -0
- package/src/ChatbotContent/ChatbotContent.scss +1 -0
- package/src/ChatbotContent/ChatbotContent.test.tsx +15 -0
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.tsx +10 -4
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.scss +24 -1
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.tsx +242 -3
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.tsx +94 -26
- package/src/ChatbotConversationHistoryNav/EmptyState.tsx +44 -0
- package/src/ChatbotConversationHistoryNav/LoadingState.tsx +38 -0
- package/src/ChatbotFooter/ChatbotFooter.scss +8 -4
- package/src/ChatbotFooter/ChatbotFooter.test.tsx +15 -0
- package/src/ChatbotFooter/ChatbotFooternote.test.tsx +84 -0
- package/src/ChatbotFooter/ChatbotFootnote.tsx +2 -2
- package/src/ChatbotHeader/ChatbotHeader.scss +5 -6
- package/src/ChatbotHeader/ChatbotHeader.test.tsx +15 -0
- package/src/ChatbotHeader/ChatbotHeaderActions.test.tsx +17 -0
- package/src/ChatbotHeader/ChatbotHeaderCloseButton.test.tsx +20 -0
- package/src/ChatbotHeader/ChatbotHeaderCloseButton.tsx +7 -1
- package/src/ChatbotHeader/ChatbotHeaderMain.test.tsx +17 -0
- package/src/ChatbotHeader/ChatbotHeaderMenu.test.tsx +19 -0
- package/src/ChatbotHeader/ChatbotHeaderMenu.tsx +7 -1
- package/src/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.tsx +45 -0
- package/src/ChatbotHeader/ChatbotHeaderOptionsDropdown.tsx +8 -1
- package/src/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.tsx +43 -0
- package/src/ChatbotHeader/ChatbotHeaderSelectorDropdown.tsx +11 -4
- package/src/ChatbotHeader/ChatbotHeaderTitle.test.tsx +75 -0
- package/src/ChatbotHeader/ChatbotHeaderTitle.tsx +7 -2
- package/src/ChatbotModal/ChatbotModal.scss +12 -12
- package/src/ChatbotToggle/ChatbotToggle.tsx +6 -1
- package/src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.scss +2 -0
- package/src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.tsx +26 -18
- package/src/ChatbotWelcomePrompt/__snapshots__/ChatbotWelcomePrompt.test.tsx.snap +2 -2
- package/src/CodeModal/CodeModal.scss +7 -4
- package/src/Compare/Compare.scss +72 -0
- package/src/Compare/Compare.test.tsx +31 -0
- package/src/Compare/Compare.tsx +98 -0
- package/src/Compare/index.ts +2 -0
- package/src/FileDetails/FileDetails.scss +1 -1
- package/src/FileDetailsLabel/FileDetailsLabel.scss +2 -2
- package/src/FileDropZone/__snapshots__/FileDropZone.test.tsx.snap +1 -0
- package/src/Message/CodeBlockMessage/CodeBlockMessage.scss +4 -4
- package/src/Message/ErrorMessage/ErrorMessage.tsx +14 -0
- package/src/Message/ImageMessage/ImageMessage.scss +9 -0
- package/src/Message/ImageMessage/ImageMessage.tsx +14 -0
- package/src/Message/LinkMessage/LinkMessage.tsx +34 -0
- package/src/Message/ListMessage/ListMessage.scss +6 -6
- package/src/Message/Message.scss +4 -26
- package/src/Message/Message.test.tsx +313 -3
- package/src/Message/Message.tsx +130 -31
- package/src/Message/MessageLoading.scss +2 -2
- package/src/Message/QuickResponse/QuickResponse.scss +33 -0
- package/src/Message/QuickResponse/QuickResponse.tsx +54 -0
- package/src/Message/QuickStarts/QuickStartTile.scss +0 -1
- package/src/Message/TableMessage/TableMessage.scss +23 -0
- package/src/Message/TableMessage/TableMessage.tsx +83 -0
- package/src/Message/TableMessage/TbodyMessage.tsx +20 -0
- package/src/Message/TableMessage/TdMessage.tsx +11 -0
- package/src/Message/TableMessage/ThMessage.tsx +11 -0
- package/src/Message/TableMessage/TheadMessage.tsx +11 -0
- package/src/Message/TableMessage/TrMessage.tsx +27 -0
- package/src/Message/TextMessage/TextMessage.scss +21 -12
- package/src/Message/TextMessage/TextMessage.tsx +3 -3
- package/src/Message/UserFeedback/CloseButton.tsx +21 -0
- package/src/Message/UserFeedback/UserFeedback.scss +53 -0
- package/src/Message/UserFeedback/UserFeedback.test.tsx +236 -0
- package/src/Message/UserFeedback/UserFeedback.tsx +128 -0
- package/src/Message/UserFeedback/UserFeedbackComplete.test.tsx +255 -0
- package/src/Message/UserFeedback/UserFeedbackComplete.tsx +211 -0
- package/src/MessageBar/AttachButton.scss +19 -3
- package/src/MessageBar/AttachButton.tsx +3 -1
- package/src/MessageBar/MessageBar.scss +58 -24
- package/src/MessageBar/MessageBar.test.tsx +12 -4
- package/src/MessageBar/MessageBar.tsx +164 -65
- package/src/MessageBar/MicrophoneButton.scss +8 -8
- package/src/MessageBar/MicrophoneButton.tsx +1 -1
- package/src/MessageBar/SendButton.tsx +2 -0
- package/src/MessageBar/StopButton.scss +17 -3
- package/src/MessageBar/StopButton.tsx +2 -0
- package/src/MessageBox/JumpButton.scss +6 -6
- package/src/MessageBox/MessageBox.scss +1 -0
- package/src/MessageBox/MessageBox.test.tsx +26 -0
- package/src/PreviewAttachment/PreviewAttachment.test.tsx +51 -0
- package/src/ResponseActions/ResponseActionButton.tsx +14 -2
- package/src/ResponseActions/ResponseActions.scss +2 -2
- package/src/ResponseActions/ResponseActions.test.tsx +4 -2
- package/src/ResponseActions/ResponseActions.tsx +26 -2
- package/src/Settings/Settings.scss +2 -2
- package/src/Settings/SettingsForm.test.tsx +28 -0
- package/src/SourceDetailsMenuItem/SourceDetailsMenuItem.scss +2 -2
- package/src/SourcesCard/SourcesCard.scss +9 -3
- package/src/TermsOfUse/TermsOfUse.scss +1 -1
- package/src/__mocks__/rehype-external-links.ts +3 -0
- package/src/__mocks__/rehype-sanitize.ts +3 -0
- package/src/__mocks__/rehype-unwrap-images.tsx +3 -0
- package/src/index.ts +6 -0
- package/src/main.scss +5 -6
- package/src/tracking/console_tracking_provider.ts +30 -0
- package/src/tracking/index.ts +3 -0
- package/src/tracking/posthog_tracking_provider.ts +42 -0
- package/src/tracking/segment_tracking_provider.ts +62 -0
- package/src/tracking/trackingProviderProxy.ts +28 -0
- package/src/tracking/tracking_api.ts +11 -0
- package/src/tracking/tracking_registry.ts +33 -0
- package/src/tracking/tracking_spi.ts +14 -0
- package/src/tracking/umami_tracking_provider.ts +54 -0
@@ -14,14 +14,18 @@ propComponents:
|
|
14
14
|
[
|
15
15
|
'AttachMenu',
|
16
16
|
'AttachmentEdit',
|
17
|
-
'
|
18
|
-
'
|
17
|
+
'FileDetailsProps',
|
18
|
+
'FileDetailsLabelProps',
|
19
19
|
'FileDropZone',
|
20
20
|
'PreviewAttachment',
|
21
21
|
'Message',
|
22
|
+
'MessageExtraContent',
|
22
23
|
'PreviewAttachment',
|
23
24
|
'ActionProps',
|
24
|
-
'SourcesCardProps'
|
25
|
+
'SourcesCardProps',
|
26
|
+
'UserFeedbackProps',
|
27
|
+
'UserFeedbackCompleteProps',
|
28
|
+
'QuickResponseProps'
|
25
29
|
]
|
26
30
|
sortValue: 3
|
27
31
|
---
|
@@ -52,12 +56,8 @@ The `content` prop of the `<Message>` component is passed to a `<Markdown>` comp
|
|
52
56
|
|
53
57
|
Messages from the ChatBot will be marked with an "AI" label to clearly communicate the use of AI to users. The ChatBot can display different `content` types, including plain text, code, or a loading animation (via `isLoading`).
|
54
58
|
|
55
|
-
<br />
|
56
|
-
|
57
59
|
By default, a date and timestamp is displayed with each message. We recommend using the `timestamp` prop in real ChatBots, since it will allow you to set persistent dates and times on messages, even if the messages re-render. You can update `timestamp` with a different [date and time format](/ux-writing/numerics) as needed.
|
58
60
|
|
59
|
-
<br />
|
60
|
-
|
61
61
|
You can further customize the avatar by applying an additional class or passing [PatternFly avatar props](/components/avatar) to the `<Message>` component via `avatarProps`.
|
62
62
|
|
63
63
|
```js file="./BotMessage.tsx"
|
@@ -97,9 +97,40 @@ You can apply a `clickedAriaLabel` and `clickedTooltipContent` once a button is
|
|
97
97
|
|
98
98
|
```
|
99
99
|
|
100
|
+
### Message feedback
|
101
|
+
|
102
|
+
When a user selects a positive or negative [message action](#message-actions), you can display a message feedback card that acknowledges their response and provides space for additional written feedback. These cards can be manually dismissed via the close button and the thank-you card can be [configured to time out automatically](/patternfly-ai/chatbot/messages#message-feedback-with-timeouts).
|
103
|
+
|
104
|
+
You can see the full feedback flow [in the message demos](/patternfly-ai/chatbot/messages/demo#message-feedback).
|
105
|
+
|
106
|
+
The message feedback cards will immediately receive focus by default, but you can remove this behavior by passing `focusOnLoad: false` to the `<Message>` (as shown in the following examples). For better usability, you should generally keep the default focus behavior.
|
107
|
+
|
108
|
+
The following examples demonstrate:
|
109
|
+
|
110
|
+
- A basic feedback card. To toggle the text input area, select the **Has text area** checkbox.
|
111
|
+
- A thank-you card. To toggle the close button, select the **Has close button** checkbox.
|
112
|
+
|
113
|
+
```js file="./MessageWithFeedback.tsx"
|
114
|
+
|
115
|
+
```
|
116
|
+
|
117
|
+
### Message feedback with timeouts
|
118
|
+
|
119
|
+
The feedback thank-you message can be configured to time out and automatically close after a period of time. The default time-out period is 8000 ms, but it can be customized via `timeout`.
|
120
|
+
|
121
|
+
To display the thank-you message in this example, click **Show card**.
|
122
|
+
|
123
|
+
The card will not dismiss within the default time if a user is hovering over it or if it has keyboard focus. Instead, it will dismiss after they remove focus, via `timeoutAnimation`, which is 3000 ms by default. You can adjust this duration and set an `onTimeout` callback, as well as optional `onMouseEnter` and `onMouseLeave` callbacks.
|
124
|
+
|
125
|
+
For accessibility purposes, be sure to announce when new content appears onscreen. `isLiveRegion` is set to true by default on `<Message>` so it will make appropriate announcements for you when the thank-you card appears.
|
126
|
+
|
127
|
+
```js file="./MessageWithFeedbackTimeout.tsx"
|
128
|
+
|
129
|
+
```
|
130
|
+
|
100
131
|
### Messages with quick responses
|
101
132
|
|
102
|
-
You can offer convenient, clickable responses to messages in the form of quick actions. Quick actions are [PatternFly labels](/components/label/) in a label group, configured to display up to 5 visible labels.
|
133
|
+
You can offer convenient, clickable responses to messages in the form of quick actions. Quick actions are [PatternFly labels](/components/label/) in a label group, configured to display up to 5 visible labels. Only 1 response can be selected at a time.
|
103
134
|
|
104
135
|
To add quick actions, pass `quickResponses` to `<Message>`. This can be overridden by passing additional `<LabelGroup>` props to `quickResponseContainerProps`, or additional `<Label>` props to `quickResponses`.
|
105
136
|
|
@@ -135,6 +166,16 @@ Messages from users have a different background color to differentiate them from
|
|
135
166
|
|
136
167
|
```
|
137
168
|
|
169
|
+
### Custom message content
|
170
|
+
|
171
|
+
**Caution:** Take care when using this feature. It can cause you to stray from accessibility and design best practice standards. If you frequently need add the same component via custom message content, reach out to the PatternFly team. If there's a consistent need for a certain component, we can look into adding native support for additional features.
|
172
|
+
|
173
|
+
You can add custom content to specific parts of a `<Message>` via the `extraContent` prop, including additional components (like timestamps, badges, or custom elements). This prop allows you to create dynamic and reusable elements for various use cases, without changing the default message layout.
|
174
|
+
|
175
|
+
```js file="./UserMessageWithExtraContent.tsx"
|
176
|
+
|
177
|
+
```
|
178
|
+
|
138
179
|
## File attachments
|
139
180
|
|
140
181
|
### Messages with attachments
|
@@ -2,43 +2,273 @@ import React from 'react';
|
|
2
2
|
|
3
3
|
import Message from '@patternfly/chatbot/dist/dynamic/Message';
|
4
4
|
import userAvatar from './user_avatar.svg';
|
5
|
+
import { AlertActionLink, Form, FormGroup, Radio } from '@patternfly/react-core';
|
5
6
|
|
6
7
|
export const UserMessageExample: React.FunctionComponent = () => {
|
7
|
-
const
|
8
|
+
const [variant, setVariant] = React.useState('code');
|
8
9
|
|
9
|
-
|
10
|
+
/* eslint-disable indent */
|
11
|
+
const renderContent = () => {
|
12
|
+
switch (variant) {
|
13
|
+
case 'code':
|
14
|
+
return code;
|
15
|
+
case 'inlineCode':
|
16
|
+
return inlineCode;
|
17
|
+
case 'heading':
|
18
|
+
return heading;
|
19
|
+
case 'emphasis':
|
20
|
+
return emphasis;
|
21
|
+
case 'blockQuotes':
|
22
|
+
return blockQuotes;
|
23
|
+
case 'orderedList':
|
24
|
+
return orderedList;
|
25
|
+
case 'unorderedList':
|
26
|
+
return unorderedList;
|
27
|
+
case 'moreComplexList':
|
28
|
+
return moreComplexList;
|
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 */
|
10
40
|
|
11
|
-
|
41
|
+
const code = `
|
42
|
+
Here is some YAML code:
|
12
43
|
|
13
|
-
|
44
|
+
~~~yaml
|
45
|
+
apiVersion: helm.openshift.io/v1beta1/
|
46
|
+
kind: HelmChartRepository
|
47
|
+
metadata:
|
48
|
+
name: azure-sample-repo0oooo00ooo
|
49
|
+
spec:
|
50
|
+
connectionConfig:
|
51
|
+
url: https://raw.githubusercontent.com/Azure-Samples/helm-charts/master/docs
|
52
|
+
~~~
|
14
53
|
|
15
|
-
|
16
|
-
2. Item 3
|
17
|
-
3. Item 4
|
54
|
+
Here is some JavaScript code:
|
18
55
|
|
19
|
-
|
56
|
+
~~~js
|
57
|
+
import React from 'react';
|
58
|
+
|
59
|
+
const MessageLoading = () => (
|
60
|
+
<div className="pf-chatbot__message-loading">
|
61
|
+
<span className="pf-chatbot__message-loading-dots">
|
62
|
+
<span className="pf-v6-screen-reader">Loading message</span>
|
63
|
+
</span>
|
64
|
+
</div>
|
65
|
+
);
|
66
|
+
|
67
|
+
export default MessageLoading;
|
68
|
+
|
69
|
+
~~~
|
70
|
+
`;
|
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
|
+
|
102
|
+
const orderedList = `
|
103
|
+
Here is an ordered list:
|
104
|
+
|
105
|
+
1. Item 1
|
106
|
+
2. Item 2
|
107
|
+
3. Item 3`;
|
20
108
|
|
21
|
-
|
22
|
-
|
23
|
-
|
109
|
+
const unorderedList = `
|
110
|
+
Here is an unordered list:
|
111
|
+
|
112
|
+
* Item 1
|
113
|
+
* Item 2
|
114
|
+
* Item 3`;
|
115
|
+
|
116
|
+
const moreComplexList = `You may be wondering whether you can display more complex lists with formatting. In response to your question, I will explain how to spread butter on toast.
|
117
|
+
|
118
|
+
1. **Using a \`toaster\`:**
|
119
|
+
|
120
|
+
- Place \`bread\` in a \`toaster\`
|
121
|
+
- Once \`bread\` is lightly browned, remove from \`toaster\`
|
122
|
+
|
123
|
+
2. **Using a \`knife\`:**
|
124
|
+
|
125
|
+
Acquire 1 tablespoon of room temperature \`butter\`. Use \`knife\` to spread butter on \`toast\`. Bon appétit!
|
126
|
+
`;
|
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 = ``;
|
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
|
+
};
|
24
157
|
|
25
158
|
return (
|
26
159
|
<>
|
27
160
|
<Message
|
28
161
|
name="User"
|
29
162
|
role="user"
|
30
|
-
content="
|
163
|
+
content="This is a user message with an updated timestamp."
|
31
164
|
timestamp="1 hour ago"
|
32
165
|
avatar={userAvatar}
|
33
166
|
/>
|
34
|
-
<Message name="User" role="user" content={markdown} avatar={userAvatar} />
|
35
167
|
<Message
|
36
168
|
name="User"
|
37
169
|
role="user"
|
38
|
-
content="
|
170
|
+
content="This is a user message with `avatarProps` set to add a border."
|
39
171
|
avatar={userAvatar}
|
40
172
|
avatarProps={{ isBordered: true }}
|
41
173
|
/>
|
174
|
+
<Form>
|
175
|
+
<FormGroup role="radiogroup" isInline fieldId="user-message-type" label="Message content type">
|
176
|
+
<Radio
|
177
|
+
isChecked={variant === 'code'}
|
178
|
+
onChange={() => setVariant('code')}
|
179
|
+
name="user-message-type"
|
180
|
+
label="Code"
|
181
|
+
id="user-code"
|
182
|
+
/>
|
183
|
+
<Radio
|
184
|
+
isChecked={variant === 'inlineCode'}
|
185
|
+
onChange={() => setVariant('inlineCode')}
|
186
|
+
name="user-message-type"
|
187
|
+
label="Inline code"
|
188
|
+
id="user-inline-code"
|
189
|
+
/>
|
190
|
+
<Radio
|
191
|
+
isChecked={variant === 'heading'}
|
192
|
+
onChange={() => setVariant('heading')}
|
193
|
+
name="user-message-type"
|
194
|
+
label="Heading"
|
195
|
+
id="user-heading"
|
196
|
+
/>
|
197
|
+
<Radio
|
198
|
+
isChecked={variant === 'blockQuotes'}
|
199
|
+
onChange={() => setVariant('blockQuotes')}
|
200
|
+
name="user-message-type"
|
201
|
+
label="Block quote"
|
202
|
+
id="user-block-quotes"
|
203
|
+
/>
|
204
|
+
<Radio
|
205
|
+
isChecked={variant === 'emphasis'}
|
206
|
+
onChange={() => setVariant('emphasis')}
|
207
|
+
name="user-message-type"
|
208
|
+
label="Emphasis"
|
209
|
+
id="user-emphasis"
|
210
|
+
/>
|
211
|
+
<Radio
|
212
|
+
isChecked={variant === 'link'}
|
213
|
+
onChange={() => setVariant('link')}
|
214
|
+
name="user-message-type"
|
215
|
+
label="Link"
|
216
|
+
id="user-link"
|
217
|
+
/>
|
218
|
+
<Radio
|
219
|
+
isChecked={variant === 'unorderedList'}
|
220
|
+
onChange={() => setVariant('unorderedList')}
|
221
|
+
name="user-message-type"
|
222
|
+
label="Unordered list"
|
223
|
+
id="user-unordered-list"
|
224
|
+
/>
|
225
|
+
<Radio
|
226
|
+
isChecked={variant === 'orderedList'}
|
227
|
+
onChange={() => setVariant('orderedList')}
|
228
|
+
name="user-message-type"
|
229
|
+
label="Ordered list"
|
230
|
+
id="user-ordered-list"
|
231
|
+
/>
|
232
|
+
<Radio
|
233
|
+
isChecked={variant === 'moreComplexList'}
|
234
|
+
onChange={() => setVariant('moreComplexList')}
|
235
|
+
name="user-message-type"
|
236
|
+
label="More complex list"
|
237
|
+
id="user-more-complex-list"
|
238
|
+
/>
|
239
|
+
<Radio
|
240
|
+
isChecked={variant === 'table'}
|
241
|
+
onChange={() => setVariant('table')}
|
242
|
+
name="user-message-type"
|
243
|
+
label="Table"
|
244
|
+
id="user-table"
|
245
|
+
/>
|
246
|
+
<Radio
|
247
|
+
isChecked={variant === 'image'}
|
248
|
+
onChange={() => setVariant('image')}
|
249
|
+
name="user-message-type"
|
250
|
+
label="Image"
|
251
|
+
id="user-image"
|
252
|
+
/>
|
253
|
+
<Radio
|
254
|
+
isChecked={variant === 'error'}
|
255
|
+
onChange={() => setVariant('error')}
|
256
|
+
name="user-message-error"
|
257
|
+
label="Error"
|
258
|
+
id="user-error"
|
259
|
+
/>
|
260
|
+
</FormGroup>
|
261
|
+
</Form>
|
262
|
+
<Message
|
263
|
+
name="User"
|
264
|
+
role="user"
|
265
|
+
content={renderContent()}
|
266
|
+
avatar={userAvatar}
|
267
|
+
tableProps={
|
268
|
+
variant === 'table' ? { 'aria-label': 'App information and user roles for user messages' } : undefined
|
269
|
+
}
|
270
|
+
error={variant === 'error' ? error : undefined}
|
271
|
+
/>
|
42
272
|
</>
|
43
273
|
);
|
44
274
|
};
|
package/patternfly-docs/content/extensions/chatbot/examples/Messages/UserMessageWithExtraContent.tsx
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
|
3
|
+
import Message from '@patternfly/chatbot/dist/dynamic/Message';
|
4
|
+
import userAvatar from './user_avatar.svg';
|
5
|
+
import { Alert, Badge, Button, Card, CardBody, CardFooter, CardTitle } from '@patternfly/react-core';
|
6
|
+
|
7
|
+
const UserActionEndContent = () => {
|
8
|
+
// eslint-disable-next-line no-console
|
9
|
+
const onClick = () => console.log('custom button click');
|
10
|
+
return (
|
11
|
+
<React.Fragment>
|
12
|
+
<Button variant="secondary" ouiaId="Secondary" onClick={onClick}>
|
13
|
+
End content button
|
14
|
+
</Button>
|
15
|
+
<Alert variant="danger" title="Danger alert title" ouiaId="DangerAlert" />
|
16
|
+
</React.Fragment>
|
17
|
+
);
|
18
|
+
};
|
19
|
+
|
20
|
+
const CardInformationAfterMainContent = () => (
|
21
|
+
<Card ouiaId="BasicCard">
|
22
|
+
<CardTitle>This is content card after main content</CardTitle>
|
23
|
+
<CardBody>Body</CardBody>
|
24
|
+
<CardFooter>Footer</CardFooter>
|
25
|
+
</Card>
|
26
|
+
);
|
27
|
+
|
28
|
+
const BeforeMainContent = () => (
|
29
|
+
<div>
|
30
|
+
<Badge key={1} isRead>
|
31
|
+
7
|
32
|
+
</Badge>
|
33
|
+
<Badge key={2} isRead>
|
34
|
+
24
|
35
|
+
</Badge>
|
36
|
+
</div>
|
37
|
+
);
|
38
|
+
|
39
|
+
export const UserMessageWithExtraContent: React.FunctionComponent = () => (
|
40
|
+
<>
|
41
|
+
<Message
|
42
|
+
avatar={userAvatar}
|
43
|
+
name="User"
|
44
|
+
role="user"
|
45
|
+
content="This is a main message."
|
46
|
+
timestamp="1 hour ago"
|
47
|
+
extraContent={{
|
48
|
+
beforeMainContent: <BeforeMainContent />,
|
49
|
+
afterMainContent: <CardInformationAfterMainContent />,
|
50
|
+
endContent: <UserActionEndContent />
|
51
|
+
}}
|
52
|
+
/>
|
53
|
+
</>
|
54
|
+
);
|
@@ -8,7 +8,7 @@ export const ChatbotFooterExample: React.FunctionComponent = () => {
|
|
8
8
|
return (
|
9
9
|
<ChatbotFooter>
|
10
10
|
<MessageBar onSendMessage={handleSend} hasMicrophoneButton hasAttachButton />
|
11
|
-
<ChatbotFootnote label="
|
11
|
+
<ChatbotFootnote label="ChatBot uses AI. Check for mistakes." />
|
12
12
|
</ChatbotFooter>
|
13
13
|
);
|
14
14
|
};
|
@@ -3,22 +3,22 @@ import { ChatbotFootnote } from '@patternfly/chatbot/dist/dynamic/ChatbotFooter'
|
|
3
3
|
|
4
4
|
export const FootnoteDemo: React.FunctionComponent = () => (
|
5
5
|
<ChatbotFootnote
|
6
|
-
label="
|
6
|
+
label="ChatBot uses AI. Check for mistakes."
|
7
7
|
popover={{
|
8
|
-
title: 'Verify
|
9
|
-
description: `While
|
8
|
+
title: 'Verify information',
|
9
|
+
description: `While ChatBot strives for accuracy, AI is experimental and can make mistakes. We cannot guarantee that all information provided by ChatBot is up to date or without error. You should always verify responses using reliable sources, especially for crucial information and decision making.`,
|
10
10
|
bannerImage: {
|
11
11
|
src: 'https://cdn.dribbble.com/userupload/10651749/file/original-8a07b8e39d9e8bf002358c66fce1223e.gif',
|
12
12
|
alt: 'Example image for footnote popover'
|
13
13
|
},
|
14
14
|
cta: {
|
15
|
-
label: '
|
15
|
+
label: 'Dismiss',
|
16
16
|
onClick: () => {
|
17
17
|
alert('Do something!');
|
18
18
|
}
|
19
19
|
},
|
20
20
|
link: {
|
21
|
-
label: '
|
21
|
+
label: 'View AI policy',
|
22
22
|
url: 'https://www.redhat.com/'
|
23
23
|
}
|
24
24
|
}}
|
@@ -3,7 +3,7 @@ import { ChatbotDisplayMode } from '@patternfly/chatbot/dist/dynamic/Chatbot';
|
|
3
3
|
import ChatbotConversationHistoryNav, {
|
4
4
|
Conversation
|
5
5
|
} from '@patternfly/chatbot/dist/dynamic/ChatbotConversationHistoryNav';
|
6
|
-
import { Checkbox } from '@patternfly/react-core';
|
6
|
+
import { Checkbox, EmptyStateStatus, Spinner } from '@patternfly/react-core';
|
7
7
|
|
8
8
|
const initialConversations: { [key: string]: Conversation[] } = {
|
9
9
|
Today: [{ id: '1', text: 'Red Hat products and services' }],
|
@@ -31,12 +31,29 @@ const initialConversations: { [key: string]: Conversation[] } = {
|
|
31
31
|
]
|
32
32
|
};
|
33
33
|
|
34
|
+
const ERROR = {
|
35
|
+
bodyText: (
|
36
|
+
<>
|
37
|
+
To try again, check your connection and reload this page. If the issue persists,{' '}
|
38
|
+
<a href="">contact the support team</a>.
|
39
|
+
</>
|
40
|
+
),
|
41
|
+
buttonText: 'Reload',
|
42
|
+
buttonIcon: <Spinner size="sm" />,
|
43
|
+
hasButton: true,
|
44
|
+
titleText: 'Could not load chat history',
|
45
|
+
status: EmptyStateStatus.danger,
|
46
|
+
onClick: () => alert('Clicked Reload')
|
47
|
+
};
|
48
|
+
|
34
49
|
export const ChatbotHeaderTitleDemo: React.FunctionComponent = () => {
|
35
50
|
const [isOpen, setIsOpen] = React.useState(true);
|
36
|
-
const [isButtonOrderReversed,
|
51
|
+
const [isButtonOrderReversed, setIsButtonOrderReversed] = React.useState(false);
|
37
52
|
const [conversations, setConversations] = React.useState<Conversation[] | { [key: string]: Conversation[] }>(
|
38
53
|
initialConversations
|
39
54
|
);
|
55
|
+
const [isLoading, setIsLoading] = React.useState(false);
|
56
|
+
const [hasError, setHasError] = React.useState(false);
|
40
57
|
const displayMode = ChatbotDisplayMode.embedded;
|
41
58
|
|
42
59
|
const findMatchingItems = (targetValue: string) => {
|
@@ -70,10 +87,24 @@ export const ChatbotHeaderTitleDemo: React.FunctionComponent = () => {
|
|
70
87
|
<Checkbox
|
71
88
|
label="Reverse action buttons"
|
72
89
|
isChecked={isButtonOrderReversed}
|
73
|
-
onChange={() =>
|
90
|
+
onChange={() => setIsButtonOrderReversed(!isButtonOrderReversed)}
|
74
91
|
id="drawer-actions-visible"
|
75
92
|
name="drawer-actions-visible"
|
76
93
|
></Checkbox>
|
94
|
+
<Checkbox
|
95
|
+
label="Show loading state"
|
96
|
+
isChecked={isLoading}
|
97
|
+
onChange={() => setIsLoading(!isLoading)}
|
98
|
+
id="drawer-is-loading"
|
99
|
+
name="drawer-is-loading"
|
100
|
+
></Checkbox>
|
101
|
+
<Checkbox
|
102
|
+
label="Show error state"
|
103
|
+
isChecked={hasError}
|
104
|
+
onChange={() => setHasError(!hasError)}
|
105
|
+
id="drawer-has-error"
|
106
|
+
name="drawer-has-error"
|
107
|
+
></Checkbox>
|
77
108
|
<ChatbotConversationHistoryNav
|
78
109
|
displayMode={displayMode}
|
79
110
|
onDrawerToggle={() => setIsOpen(!isOpen)}
|
@@ -96,6 +127,8 @@ export const ChatbotHeaderTitleDemo: React.FunctionComponent = () => {
|
|
96
127
|
setConversations(newConversations);
|
97
128
|
}}
|
98
129
|
drawerContent={<div>Drawer content</div>}
|
130
|
+
isLoading={isLoading}
|
131
|
+
errorState={hasError ? ERROR : undefined}
|
99
132
|
/>
|
100
133
|
</>
|
101
134
|
);
|
package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderDrawerNavigation.tsx
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ChatbotDisplayMode } from '@patternfly/chatbot/dist/dynamic/Chatbot';
|
3
|
+
import ChatbotConversationHistoryNav, {
|
4
|
+
Conversation
|
5
|
+
} from '@patternfly/chatbot/dist/dynamic/ChatbotConversationHistoryNav';
|
6
|
+
import { Checkbox } from '@patternfly/react-core';
|
7
|
+
|
8
|
+
const initialConversations: Conversation[] = [
|
9
|
+
{ id: '1', text: 'Red Hat products and services', noIcon: true },
|
10
|
+
{
|
11
|
+
id: '2',
|
12
|
+
text: 'Enterprise Linux installation and setup',
|
13
|
+
noIcon: true
|
14
|
+
},
|
15
|
+
{ id: '3', text: 'Troubleshoot system crash', noIcon: true },
|
16
|
+
{ id: '4', text: 'Ansible security and updates', noIcon: true },
|
17
|
+
{ id: '5', text: 'Red Hat certification', noIcon: true },
|
18
|
+
{ id: '6', text: 'Lightspeed user documentation', noIcon: true },
|
19
|
+
{ id: '7', text: 'Crashing pod assistance', noIcon: true },
|
20
|
+
{ id: '8', text: 'OpenShift AI pipelines', noIcon: true },
|
21
|
+
{ id: '9', text: 'Updating subscription plan', noIcon: true },
|
22
|
+
{ id: '10', text: 'Red Hat licensing options', noIcon: true },
|
23
|
+
{ id: '11', text: 'RHEL system performance', noIcon: true },
|
24
|
+
{ id: '12', text: 'Manage user accounts', noIcon: true }
|
25
|
+
];
|
26
|
+
|
27
|
+
export const ChatbotHeaderTitleDemo: React.FunctionComponent = () => {
|
28
|
+
const [isOpen, setIsOpen] = React.useState(true);
|
29
|
+
const [isButtonOrderReversed, setIsButtonOrderReversed] = React.useState(false);
|
30
|
+
const [conversations, setConversations] = React.useState<Conversation[] | { [key: string]: Conversation[] }>(
|
31
|
+
initialConversations
|
32
|
+
);
|
33
|
+
const displayMode = ChatbotDisplayMode.embedded;
|
34
|
+
|
35
|
+
return (
|
36
|
+
<>
|
37
|
+
<Checkbox
|
38
|
+
label="Display drawer"
|
39
|
+
isChecked={isOpen}
|
40
|
+
onChange={() => {
|
41
|
+
setIsOpen(!isOpen);
|
42
|
+
setConversations(initialConversations);
|
43
|
+
}}
|
44
|
+
id="navigation-drawer-visible"
|
45
|
+
name="navigation-drawer-visible"
|
46
|
+
/>
|
47
|
+
<Checkbox
|
48
|
+
label="Reverse action buttons"
|
49
|
+
isChecked={isButtonOrderReversed}
|
50
|
+
onChange={() => setIsButtonOrderReversed(!isButtonOrderReversed)}
|
51
|
+
id="navigation-drawer-actions-visible"
|
52
|
+
name="navigation-drawer-actions-visible"
|
53
|
+
></Checkbox>
|
54
|
+
<ChatbotConversationHistoryNav
|
55
|
+
displayMode={displayMode}
|
56
|
+
onDrawerToggle={() => setIsOpen(!isOpen)}
|
57
|
+
isDrawerOpen={isOpen}
|
58
|
+
setIsDrawerOpen={setIsOpen}
|
59
|
+
// eslint-disable-next-line no-console
|
60
|
+
onSelectActiveItem={(e, selectedItem) => console.log(`Selected history item with id ${selectedItem}`)}
|
61
|
+
conversations={conversations}
|
62
|
+
reverseButtonOrder={isButtonOrderReversed}
|
63
|
+
drawerContent={<div>Drawer content</div>}
|
64
|
+
/>
|
65
|
+
</>
|
66
|
+
);
|
67
|
+
};
|