@patternfly/chatbot 2.2.1 → 6.3.0-prerelease.10
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.d.ts +2 -0
- package/dist/cjs/AttachmentEdit/AttachmentEdit.js +2 -2
- package/dist/cjs/Chatbot/Chatbot.d.ts +2 -0
- package/dist/cjs/Chatbot/Chatbot.js +2 -2
- package/dist/cjs/Chatbot/Chatbot.test.js +4 -0
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.d.ts +6 -0
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.js +9 -3
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.js +27 -0
- package/dist/cjs/ChatbotFooter/ChatbotFooter.d.ts +1 -0
- package/dist/cjs/ChatbotFooter/ChatbotFooter.js +2 -2
- package/dist/cjs/ChatbotFooter/ChatbotFooter.test.d.ts +1 -1
- package/dist/cjs/ChatbotFooter/ChatbotFooter.test.js +5 -0
- package/dist/cjs/ChatbotHeader/ChatbotHeader.js +1 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderCloseButton.d.ts +4 -2
- package/dist/cjs/ChatbotHeader/ChatbotHeaderCloseButton.js +20 -6
- package/dist/cjs/ChatbotHeader/ChatbotHeaderCloseButton.test.d.ts +1 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderCloseButton.test.js +5 -0
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMain.js +1 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.d.ts +3 -2
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.js +20 -6
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.test.d.ts +1 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.test.js +5 -0
- package/dist/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.d.ts +1 -0
- package/dist/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.js +3 -3
- package/dist/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.d.ts +1 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.js +5 -0
- package/dist/cjs/ChatbotHeader/ChatbotHeaderSelectorDropdown.d.ts +1 -0
- package/dist/cjs/ChatbotHeader/ChatbotHeaderSelectorDropdown.js +2 -2
- package/dist/cjs/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.d.ts +1 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.js +5 -0
- package/dist/cjs/ChatbotModal/ChatbotModal.d.ts +3 -0
- package/dist/cjs/ChatbotModal/ChatbotModal.js +2 -2
- package/dist/cjs/ChatbotModal/ChatbotModal.test.d.ts +1 -0
- package/dist/cjs/ChatbotModal/ChatbotModal.test.js +28 -0
- package/dist/cjs/ChatbotPopover/ChatbotPopover.js +1 -1
- package/dist/cjs/ChatbotWelcomePrompt/ChatbotWelcomePrompt.d.ts +1 -0
- package/dist/cjs/ChatbotWelcomePrompt/ChatbotWelcomePrompt.js +3 -3
- package/dist/cjs/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.js +4 -0
- package/dist/cjs/CodeModal/CodeModal.d.ts +2 -0
- package/dist/cjs/CodeModal/CodeModal.js +3 -3
- package/dist/cjs/CodeModal/CodeModal.test.d.ts +1 -0
- package/dist/cjs/CodeModal/CodeModal.test.js +15 -0
- package/dist/cjs/FileDetails/FileDetails.js +1 -1
- package/dist/cjs/Message/Message.d.ts +19 -1
- package/dist/cjs/Message/Message.js +58 -39
- package/dist/cjs/Message/Message.test.js +64 -0
- package/dist/cjs/Message/MessageInput.d.ts +18 -0
- package/dist/cjs/Message/MessageInput.js +34 -0
- package/dist/cjs/Message/QuickResponse/QuickResponse.d.ts +2 -0
- package/dist/cjs/Message/QuickResponse/QuickResponse.js +2 -2
- package/dist/cjs/Message/QuickStarts/QuickStartTile.d.ts +2 -0
- package/dist/cjs/Message/QuickStarts/QuickStartTile.js +2 -2
- package/dist/cjs/Message/UserFeedback/UserFeedback.js +4 -4
- package/dist/cjs/Message/UserFeedback/UserFeedback.test.js +4 -0
- package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.js +4 -4
- package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.test.js +4 -0
- package/dist/cjs/MessageBar/AttachButton.d.ts +1 -0
- package/dist/cjs/MessageBar/AttachButton.js +3 -3
- package/dist/cjs/MessageBar/AttachButton.test.js +4 -0
- package/dist/cjs/MessageBar/MessageBar.d.ts +5 -0
- package/dist/cjs/MessageBar/MessageBar.js +14 -13
- package/dist/cjs/MessageBar/MessageBar.test.js +13 -0
- package/dist/cjs/MessageBar/MicrophoneButton.d.ts +1 -0
- package/dist/cjs/MessageBar/MicrophoneButton.js +4 -4
- package/dist/cjs/MessageBar/SendButton.d.ts +1 -0
- package/dist/cjs/MessageBar/SendButton.js +3 -3
- package/dist/cjs/MessageBar/SendButton.test.js +4 -0
- package/dist/cjs/MessageBar/StopButton.d.ts +1 -0
- package/dist/cjs/MessageBar/StopButton.js +3 -3
- package/dist/cjs/MessageBar/StopButton.test.js +4 -0
- package/dist/cjs/MessageBox/MessageBox.d.ts +4 -0
- package/dist/cjs/MessageBox/MessageBox.js +21 -7
- package/dist/cjs/MessageBox/MessageBox.test.js +43 -0
- package/dist/cjs/PreviewAttachment/PreviewAttachment.d.ts +2 -0
- package/dist/cjs/PreviewAttachment/PreviewAttachment.js +2 -2
- package/dist/cjs/Settings/SettingsForm.d.ts +2 -0
- package/dist/cjs/Settings/SettingsForm.js +2 -2
- package/dist/cjs/Settings/SettingsForm.test.d.ts +1 -1
- package/dist/cjs/Settings/SettingsForm.test.js +12 -0
- package/dist/cjs/SourcesCard/SourcesCard.d.ts +7 -1
- package/dist/cjs/SourcesCard/SourcesCard.js +17 -11
- package/dist/cjs/SourcesCard/SourcesCard.test.js +25 -15
- package/dist/cjs/TermsOfUse/TermsOfUse.d.ts +2 -0
- package/dist/cjs/TermsOfUse/TermsOfUse.js +5 -5
- package/dist/cjs/tracking/console_tracking_provider.d.ts +4 -5
- package/dist/cjs/tracking/console_tracking_provider.js +22 -15
- package/dist/cjs/tracking/posthog_tracking_provider.d.ts +2 -2
- package/dist/cjs/tracking/posthog_tracking_provider.js +21 -12
- package/dist/cjs/tracking/segment_tracking_provider.d.ts +2 -2
- package/dist/cjs/tracking/segment_tracking_provider.js +21 -12
- package/dist/cjs/tracking/trackingProviderProxy.d.ts +1 -1
- package/dist/cjs/tracking/trackingProviderProxy.js +2 -2
- package/dist/cjs/tracking/tracking_api.d.ts +1 -1
- package/dist/cjs/tracking/tracking_registry.js +46 -12
- package/dist/cjs/tracking/tracking_spi.d.ts +15 -5
- package/dist/cjs/tracking/tracking_spi.js +9 -0
- package/dist/cjs/tracking/umami_tracking_provider.d.ts +6 -2
- package/dist/cjs/tracking/umami_tracking_provider.js +66 -22
- package/dist/css/main.css +225 -22
- package/dist/css/main.css.map +1 -1
- package/dist/esm/AttachmentEdit/AttachmentEdit.d.ts +2 -0
- package/dist/esm/AttachmentEdit/AttachmentEdit.js +2 -2
- package/dist/esm/Chatbot/Chatbot.d.ts +2 -0
- package/dist/esm/Chatbot/Chatbot.js +2 -2
- package/dist/esm/Chatbot/Chatbot.test.js +4 -0
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.d.ts +6 -0
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.js +9 -3
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.js +27 -0
- package/dist/esm/ChatbotFooter/ChatbotFooter.d.ts +1 -0
- package/dist/esm/ChatbotFooter/ChatbotFooter.js +2 -2
- package/dist/esm/ChatbotFooter/ChatbotFooter.test.d.ts +1 -1
- package/dist/esm/ChatbotFooter/ChatbotFooter.test.js +5 -0
- package/dist/esm/ChatbotHeader/ChatbotHeader.js +1 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderCloseButton.d.ts +4 -2
- package/dist/esm/ChatbotHeader/ChatbotHeaderCloseButton.js +20 -6
- package/dist/esm/ChatbotHeader/ChatbotHeaderCloseButton.test.d.ts +1 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderCloseButton.test.js +5 -0
- package/dist/esm/ChatbotHeader/ChatbotHeaderMain.js +1 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.d.ts +3 -2
- package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.js +20 -6
- package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.test.d.ts +1 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.test.js +5 -0
- package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.d.ts +1 -0
- package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.js +3 -3
- package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.d.ts +1 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.js +5 -0
- package/dist/esm/ChatbotHeader/ChatbotHeaderSelectorDropdown.d.ts +1 -0
- package/dist/esm/ChatbotHeader/ChatbotHeaderSelectorDropdown.js +2 -2
- package/dist/esm/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.d.ts +1 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.js +5 -0
- package/dist/esm/ChatbotModal/ChatbotModal.d.ts +3 -0
- package/dist/esm/ChatbotModal/ChatbotModal.js +2 -2
- package/dist/esm/ChatbotModal/ChatbotModal.test.d.ts +1 -0
- package/dist/esm/ChatbotModal/ChatbotModal.test.js +23 -0
- package/dist/esm/ChatbotPopover/ChatbotPopover.js +1 -1
- package/dist/esm/ChatbotWelcomePrompt/ChatbotWelcomePrompt.d.ts +1 -0
- package/dist/esm/ChatbotWelcomePrompt/ChatbotWelcomePrompt.js +3 -3
- package/dist/esm/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.js +4 -0
- package/dist/esm/CodeModal/CodeModal.d.ts +2 -0
- package/dist/esm/CodeModal/CodeModal.js +3 -3
- package/dist/esm/CodeModal/CodeModal.test.d.ts +1 -0
- package/dist/esm/CodeModal/CodeModal.test.js +10 -0
- package/dist/esm/FileDetails/FileDetails.js +1 -1
- package/dist/esm/Message/Message.d.ts +19 -1
- package/dist/esm/Message/Message.js +58 -39
- package/dist/esm/Message/Message.test.js +64 -0
- package/dist/esm/Message/MessageInput.d.ts +18 -0
- package/dist/esm/Message/MessageInput.js +29 -0
- package/dist/esm/Message/QuickResponse/QuickResponse.d.ts +2 -0
- package/dist/esm/Message/QuickResponse/QuickResponse.js +2 -2
- package/dist/esm/Message/QuickStarts/QuickStartTile.d.ts +2 -0
- package/dist/esm/Message/QuickStarts/QuickStartTile.js +2 -2
- package/dist/esm/Message/UserFeedback/UserFeedback.js +4 -4
- package/dist/esm/Message/UserFeedback/UserFeedback.test.js +4 -0
- package/dist/esm/Message/UserFeedback/UserFeedbackComplete.js +4 -4
- package/dist/esm/Message/UserFeedback/UserFeedbackComplete.test.js +4 -0
- package/dist/esm/MessageBar/AttachButton.d.ts +1 -0
- package/dist/esm/MessageBar/AttachButton.js +3 -3
- package/dist/esm/MessageBar/AttachButton.test.js +4 -0
- package/dist/esm/MessageBar/MessageBar.d.ts +5 -0
- package/dist/esm/MessageBar/MessageBar.js +14 -13
- package/dist/esm/MessageBar/MessageBar.test.js +13 -0
- package/dist/esm/MessageBar/MicrophoneButton.d.ts +1 -0
- package/dist/esm/MessageBar/MicrophoneButton.js +4 -4
- package/dist/esm/MessageBar/SendButton.d.ts +1 -0
- package/dist/esm/MessageBar/SendButton.js +3 -3
- package/dist/esm/MessageBar/SendButton.test.js +4 -0
- package/dist/esm/MessageBar/StopButton.d.ts +1 -0
- package/dist/esm/MessageBar/StopButton.js +3 -3
- package/dist/esm/MessageBar/StopButton.test.js +4 -0
- package/dist/esm/MessageBox/MessageBox.d.ts +4 -0
- package/dist/esm/MessageBox/MessageBox.js +21 -7
- package/dist/esm/MessageBox/MessageBox.test.js +44 -1
- package/dist/esm/PreviewAttachment/PreviewAttachment.d.ts +2 -0
- package/dist/esm/PreviewAttachment/PreviewAttachment.js +2 -2
- package/dist/esm/Settings/SettingsForm.d.ts +2 -0
- package/dist/esm/Settings/SettingsForm.js +2 -2
- package/dist/esm/Settings/SettingsForm.test.d.ts +1 -1
- package/dist/esm/Settings/SettingsForm.test.js +12 -0
- package/dist/esm/SourcesCard/SourcesCard.d.ts +7 -1
- package/dist/esm/SourcesCard/SourcesCard.js +18 -12
- package/dist/esm/SourcesCard/SourcesCard.test.js +25 -15
- package/dist/esm/TermsOfUse/TermsOfUse.d.ts +2 -0
- package/dist/esm/TermsOfUse/TermsOfUse.js +5 -5
- package/dist/esm/tracking/console_tracking_provider.d.ts +4 -5
- package/dist/esm/tracking/console_tracking_provider.js +22 -15
- package/dist/esm/tracking/posthog_tracking_provider.d.ts +2 -2
- package/dist/esm/tracking/posthog_tracking_provider.js +21 -12
- package/dist/esm/tracking/segment_tracking_provider.d.ts +2 -2
- package/dist/esm/tracking/segment_tracking_provider.js +21 -12
- package/dist/esm/tracking/trackingProviderProxy.d.ts +1 -1
- package/dist/esm/tracking/trackingProviderProxy.js +2 -2
- package/dist/esm/tracking/tracking_api.d.ts +1 -1
- package/dist/esm/tracking/tracking_registry.js +46 -12
- package/dist/esm/tracking/tracking_spi.d.ts +15 -5
- package/dist/esm/tracking/tracking_spi.js +8 -1
- package/dist/esm/tracking/umami_tracking_provider.d.ts +6 -2
- package/dist/esm/tracking/umami_tracking_provider.js +66 -22
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/patternfly-docs/content/extensions/chatbot/examples/Analytics/Analytics.md +18 -14
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/AttachmentEdit.tsx +10 -1
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/BotMessage.tsx +74 -104
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/FileDetailsLabel.tsx +48 -37
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithFeedback.tsx +33 -0
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithQuickResponses.tsx +34 -0
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithQuickStart.tsx +11 -0
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithSources.tsx +71 -13
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/Messages.md +3 -1
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/PreviewAttachment.tsx +10 -1
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/UserMessage.tsx +80 -104
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderDrawer.tsx +44 -2
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderDrawerResizable.tsx +13 -2
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderDrawerWithActions.tsx +9 -0
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderDrawerWithSelection.tsx +11 -2
- package/patternfly-docs/content/extensions/chatbot/examples/UI/CompactSettings.tsx +289 -0
- package/patternfly-docs/content/extensions/chatbot/examples/UI/TermsOfUseCompact.tsx +136 -0
- package/patternfly-docs/content/extensions/chatbot/examples/UI/UI.md +15 -1
- package/patternfly-docs/content/extensions/chatbot/examples/demos/Chatbot.md +8 -1
- package/patternfly-docs/content/extensions/chatbot/examples/demos/Chatbot.tsx +6 -3
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotAttachment.tsx +2 -0
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotAttachmentMenu.tsx +2 -0
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotCompact.tsx +481 -0
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotInDrawer.tsx +2 -0
- package/patternfly-docs/content/extensions/chatbot/examples/demos/EmbeddedChatbot.tsx +2 -0
- package/patternfly-docs/content/extensions/chatbot/examples/demos/EmbeddedComparisonChatbot.tsx +62 -57
- package/patternfly-docs/content/extensions/chatbot/examples/demos/Feedback.tsx +2 -0
- package/src/AttachmentEdit/AttachmentEdit.tsx +5 -1
- package/src/Chatbot/Chatbot.scss +7 -0
- package/src/Chatbot/Chatbot.test.tsx +9 -0
- package/src/Chatbot/Chatbot.tsx +4 -1
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.scss +38 -3
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.tsx +71 -0
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.tsx +23 -2
- package/src/ChatbotFooter/ChatbotFooter.scss +5 -0
- package/src/ChatbotFooter/ChatbotFooter.test.tsx +10 -0
- package/src/ChatbotFooter/ChatbotFooter.tsx +3 -1
- package/src/ChatbotHeader/ChatbotHeader.scss +25 -0
- package/src/ChatbotHeader/ChatbotHeader.tsx +1 -1
- package/src/ChatbotHeader/ChatbotHeaderCloseButton.test.tsx +6 -0
- package/src/ChatbotHeader/ChatbotHeaderCloseButton.tsx +12 -6
- package/src/ChatbotHeader/ChatbotHeaderMain.tsx +3 -1
- package/src/ChatbotHeader/ChatbotHeaderMenu.test.tsx +8 -0
- package/src/ChatbotHeader/ChatbotHeaderMenu.tsx +10 -5
- package/src/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.tsx +6 -0
- package/src/ChatbotHeader/ChatbotHeaderOptionsDropdown.tsx +5 -2
- package/src/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.tsx +10 -0
- package/src/ChatbotHeader/ChatbotHeaderSelectorDropdown.tsx +4 -0
- package/src/ChatbotModal/ChatbotModal.scss +15 -4
- package/src/ChatbotModal/ChatbotModal.test.tsx +59 -0
- package/src/ChatbotModal/ChatbotModal.tsx +5 -1
- package/src/ChatbotPopover/ChatbotPopover.scss +9 -5
- package/src/ChatbotPopover/ChatbotPopover.tsx +1 -1
- package/src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.scss +9 -1
- package/src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.tsx +13 -0
- package/src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.tsx +13 -2
- package/src/ChatbotWelcomePrompt/__snapshots__/ChatbotWelcomePrompt.test.tsx.snap +1 -1
- package/src/CodeModal/CodeModal.scss +11 -3
- package/src/CodeModal/CodeModal.test.tsx +24 -0
- package/src/CodeModal/CodeModal.tsx +6 -2
- package/src/FileDetails/FileDetails.tsx +1 -1
- package/src/FileDetails/__snapshots__/FileDetails.test.tsx.snap +1 -1
- package/src/FileDetailsLabel/__snapshots__/FileDetailsLabel.test.tsx.snap +1 -1
- package/src/Message/Message.scss +31 -0
- package/src/Message/Message.test.tsx +83 -0
- package/src/Message/Message.tsx +121 -56
- package/src/Message/MessageInput.tsx +59 -0
- package/src/Message/QuickResponse/QuickResponse.tsx +5 -1
- package/src/Message/QuickStarts/QuickStartTile.tsx +5 -1
- package/src/Message/TextMessage/TextMessage.scss +25 -0
- package/src/Message/UserFeedback/UserFeedback.scss +24 -3
- package/src/Message/UserFeedback/UserFeedback.test.tsx +13 -0
- package/src/Message/UserFeedback/UserFeedback.tsx +4 -2
- package/src/Message/UserFeedback/UserFeedbackComplete.test.tsx +4 -0
- package/src/Message/UserFeedback/UserFeedbackComplete.tsx +10 -2
- package/src/MessageBar/AttachButton.scss +10 -0
- package/src/MessageBar/AttachButton.test.tsx +4 -0
- package/src/MessageBar/AttachButton.tsx +5 -2
- package/src/MessageBar/MessageBar.scss +17 -0
- package/src/MessageBar/MessageBar.test.tsx +13 -0
- package/src/MessageBar/MessageBar.tsx +23 -8
- package/src/MessageBar/MicrophoneButton.scss +10 -0
- package/src/MessageBar/MicrophoneButton.tsx +6 -3
- package/src/MessageBar/SendButton.scss +10 -0
- package/src/MessageBar/SendButton.test.tsx +5 -1
- package/src/MessageBar/SendButton.tsx +5 -2
- package/src/MessageBar/StopButton.scss +10 -0
- package/src/MessageBar/StopButton.test.tsx +5 -1
- package/src/MessageBar/StopButton.tsx +5 -2
- package/src/MessageBox/MessageBox.scss +6 -0
- package/src/MessageBox/MessageBox.test.tsx +45 -1
- package/src/MessageBox/MessageBox.tsx +16 -6
- package/src/PreviewAttachment/PreviewAttachment.tsx +5 -1
- package/src/Settings/Settings.scss +11 -0
- package/src/Settings/SettingsForm.test.tsx +17 -0
- package/src/Settings/SettingsForm.tsx +12 -2
- package/src/SourcesCard/SourcesCard.scss +11 -7
- package/src/SourcesCard/SourcesCard.test.tsx +30 -22
- package/src/SourcesCard/SourcesCard.tsx +56 -13
- package/src/TermsOfUse/TermsOfUse.scss +20 -0
- package/src/TermsOfUse/TermsOfUse.tsx +9 -4
- package/src/tracking/console_tracking_provider.ts +21 -17
- package/src/tracking/posthog_tracking_provider.ts +20 -13
- package/src/tracking/segment_tracking_provider.ts +20 -13
- package/src/tracking/trackingProviderProxy.ts +2 -2
- package/src/tracking/tracking_api.ts +1 -1
- package/src/tracking/tracking_registry.ts +46 -13
- package/src/tracking/tracking_spi.ts +18 -7
- package/src/tracking/umami_tracking_provider.ts +76 -20
- package/src/SourcesCard/__snapshots__/SourcesCard.test.tsx.snap +0 -34
@@ -0,0 +1,289 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
|
3
|
+
import SettingsForm from '@patternfly/chatbot/dist/dynamic/Settings';
|
4
|
+
import {
|
5
|
+
Button,
|
6
|
+
Divider,
|
7
|
+
Dropdown,
|
8
|
+
DropdownGroup,
|
9
|
+
DropdownItem,
|
10
|
+
DropdownList,
|
11
|
+
MenuToggle,
|
12
|
+
MenuToggleElement,
|
13
|
+
Switch,
|
14
|
+
Title
|
15
|
+
} from '@patternfly/react-core';
|
16
|
+
import Chatbot, { ChatbotDisplayMode } from '@patternfly/chatbot/dist/dynamic/Chatbot';
|
17
|
+
import ChatbotHeader, {
|
18
|
+
ChatbotHeaderActions,
|
19
|
+
ChatbotHeaderCloseButton,
|
20
|
+
ChatbotHeaderMain,
|
21
|
+
ChatbotHeaderOptionsDropdown,
|
22
|
+
ChatbotHeaderTitle
|
23
|
+
} from '@patternfly/chatbot/dist/dynamic/ChatbotHeader';
|
24
|
+
import { CogIcon, ExpandIcon, OpenDrawerRightIcon, OutlinedWindowRestoreIcon } from '@patternfly/react-icons';
|
25
|
+
|
26
|
+
export const CompactSettingsDemo: React.FunctionComponent = () => {
|
27
|
+
const [isChecked, setIsChecked] = React.useState<boolean>(true);
|
28
|
+
const [isThemeOpen, setIsThemeOpen] = React.useState(false);
|
29
|
+
const [isLanguageOpen, setIsLanguageOpen] = React.useState(false);
|
30
|
+
const [isVoiceOpen, setIsVoiceOpen] = React.useState(false);
|
31
|
+
const [displayMode, setDisplayMode] = React.useState(ChatbotDisplayMode.default);
|
32
|
+
const [areSettingsOpen, setAreSettingsOpen] = React.useState(true);
|
33
|
+
const chatbotVisible = true;
|
34
|
+
|
35
|
+
const onFocus = (id: string) => {
|
36
|
+
const element = document.getElementById(id);
|
37
|
+
(element as HTMLElement).focus();
|
38
|
+
};
|
39
|
+
|
40
|
+
const onThemeToggleClick = () => {
|
41
|
+
setIsThemeOpen(!isThemeOpen);
|
42
|
+
};
|
43
|
+
|
44
|
+
const onThemeSelect = (
|
45
|
+
_event: React.MouseEvent<Element, MouseEvent> | undefined,
|
46
|
+
value: string | number | undefined
|
47
|
+
) => {
|
48
|
+
// eslint-disable-next-line no-console
|
49
|
+
console.log('selected', value);
|
50
|
+
onFocus('theme');
|
51
|
+
setIsThemeOpen(false);
|
52
|
+
};
|
53
|
+
|
54
|
+
const onLanguageToggleClick = () => {
|
55
|
+
setIsLanguageOpen(!isLanguageOpen);
|
56
|
+
};
|
57
|
+
|
58
|
+
const onLanguageSelect = (
|
59
|
+
_event: React.MouseEvent<Element, MouseEvent> | undefined,
|
60
|
+
value: string | number | undefined
|
61
|
+
) => {
|
62
|
+
// eslint-disable-next-line no-console
|
63
|
+
console.log('selected', value);
|
64
|
+
onFocus('language');
|
65
|
+
setIsLanguageOpen(false);
|
66
|
+
};
|
67
|
+
|
68
|
+
const onVoiceToggleClick = () => {
|
69
|
+
onFocus('voice');
|
70
|
+
setIsVoiceOpen(!isVoiceOpen);
|
71
|
+
};
|
72
|
+
|
73
|
+
const onVoiceSelect = (
|
74
|
+
_event: React.MouseEvent<Element, MouseEvent> | undefined,
|
75
|
+
value: string | number | undefined
|
76
|
+
) => {
|
77
|
+
// eslint-disable-next-line no-console
|
78
|
+
console.log('selected', value);
|
79
|
+
setIsVoiceOpen(false);
|
80
|
+
};
|
81
|
+
|
82
|
+
const handleChange = (_event: React.FormEvent<HTMLInputElement>, checked: boolean) => {
|
83
|
+
setIsChecked(checked);
|
84
|
+
};
|
85
|
+
|
86
|
+
const themeDropdown = (
|
87
|
+
<Dropdown
|
88
|
+
isOpen={isThemeOpen}
|
89
|
+
onSelect={onThemeSelect}
|
90
|
+
onOpenChange={(isOpen: boolean) => setIsThemeOpen(isOpen)}
|
91
|
+
shouldFocusToggleOnSelect
|
92
|
+
shouldFocusFirstItemOnOpen
|
93
|
+
shouldPreventScrollOnItemFocus
|
94
|
+
toggle={(toggleRef: React.Ref<MenuToggleElement>) => (
|
95
|
+
// We want to add the id property here as well so the label is coupled
|
96
|
+
// with t he button on screen readers.
|
97
|
+
<MenuToggle size="sm" id="theme" ref={toggleRef} onClick={onThemeToggleClick} isExpanded={isThemeOpen}>
|
98
|
+
System
|
99
|
+
</MenuToggle>
|
100
|
+
)}
|
101
|
+
ouiaId="ThemeDropdown"
|
102
|
+
>
|
103
|
+
<DropdownList>
|
104
|
+
<DropdownItem value="System" key="system">
|
105
|
+
System
|
106
|
+
</DropdownItem>
|
107
|
+
</DropdownList>
|
108
|
+
</Dropdown>
|
109
|
+
);
|
110
|
+
|
111
|
+
const languageDropdown = (
|
112
|
+
<Dropdown
|
113
|
+
isOpen={isLanguageOpen}
|
114
|
+
onSelect={onLanguageSelect}
|
115
|
+
onOpenChange={(isOpen: boolean) => setIsLanguageOpen(isOpen)}
|
116
|
+
shouldFocusToggleOnSelect
|
117
|
+
shouldFocusFirstItemOnOpen
|
118
|
+
shouldPreventScrollOnItemFocus
|
119
|
+
toggle={(toggleRef: React.Ref<MenuToggleElement>) => (
|
120
|
+
// We want to add the id property here as well so the label is coupled
|
121
|
+
// with the button on screen readers.
|
122
|
+
<MenuToggle size="sm" id="language" ref={toggleRef} onClick={onLanguageToggleClick} isExpanded={isLanguageOpen}>
|
123
|
+
Auto-detect
|
124
|
+
</MenuToggle>
|
125
|
+
)}
|
126
|
+
ouiaId="LanguageDropdown"
|
127
|
+
>
|
128
|
+
<DropdownList>
|
129
|
+
<DropdownItem value="Auto-detect" key="auto-detect">
|
130
|
+
Auto-detect
|
131
|
+
</DropdownItem>
|
132
|
+
</DropdownList>
|
133
|
+
</Dropdown>
|
134
|
+
);
|
135
|
+
const voiceDropdown = (
|
136
|
+
<Dropdown
|
137
|
+
isOpen={isVoiceOpen}
|
138
|
+
onSelect={onVoiceSelect}
|
139
|
+
onOpenChange={(isOpen: boolean) => setIsVoiceOpen(isOpen)}
|
140
|
+
shouldFocusToggleOnSelect
|
141
|
+
shouldFocusFirstItemOnOpen
|
142
|
+
shouldPreventScrollOnItemFocus
|
143
|
+
toggle={(toggleRef: React.Ref<MenuToggleElement>) => (
|
144
|
+
// We want to add the id property here as well so the label is coupled
|
145
|
+
// with the button on screen readers.
|
146
|
+
<MenuToggle size="sm" id="voice" ref={toggleRef} onClick={onVoiceToggleClick} isExpanded={isVoiceOpen}>
|
147
|
+
Bot
|
148
|
+
</MenuToggle>
|
149
|
+
)}
|
150
|
+
ouiaId="VoiceDropdown"
|
151
|
+
>
|
152
|
+
<DropdownList>
|
153
|
+
<DropdownItem value="Bot" key="bot">
|
154
|
+
Bot
|
155
|
+
</DropdownItem>
|
156
|
+
</DropdownList>
|
157
|
+
</Dropdown>
|
158
|
+
);
|
159
|
+
const children = [
|
160
|
+
{ id: 'theme', label: 'Theme', field: themeDropdown },
|
161
|
+
{ id: 'language', label: 'Language', field: languageDropdown },
|
162
|
+
{ id: 'voice', label: 'Voice', field: voiceDropdown },
|
163
|
+
{
|
164
|
+
id: 'analytics',
|
165
|
+
label: 'Share analytics',
|
166
|
+
field: (
|
167
|
+
<Switch
|
168
|
+
// We want to add the id property here as well so the label is coupled
|
169
|
+
// with the button on screen readers.
|
170
|
+
id="analytics"
|
171
|
+
aria-label="Togglable option for whether to share analytics"
|
172
|
+
isChecked={isChecked}
|
173
|
+
onChange={handleChange}
|
174
|
+
/>
|
175
|
+
)
|
176
|
+
},
|
177
|
+
{
|
178
|
+
id: 'archived-chat',
|
179
|
+
label: 'Archive chat',
|
180
|
+
field: (
|
181
|
+
// We want to add the id property here as well so the label is coupled
|
182
|
+
// with the button on screen readers.
|
183
|
+
<Button size="sm" id="archived-chat" variant="secondary">
|
184
|
+
Manage
|
185
|
+
</Button>
|
186
|
+
)
|
187
|
+
},
|
188
|
+
{
|
189
|
+
id: 'archive-all',
|
190
|
+
label: 'Archive all chat',
|
191
|
+
field: (
|
192
|
+
// We want to add the id property here as well so the label is coupled
|
193
|
+
// with the button on screen readers.
|
194
|
+
<Button size="sm" id="archive-all" variant="secondary">
|
195
|
+
Archive all
|
196
|
+
</Button>
|
197
|
+
)
|
198
|
+
},
|
199
|
+
{
|
200
|
+
id: 'delete-all',
|
201
|
+
label: 'Delete all chats',
|
202
|
+
field: (
|
203
|
+
// We want to add the id property here as well so the label is coupled
|
204
|
+
// with the button on screen readers.
|
205
|
+
<Button size="sm" id="delete-all" variant="danger">
|
206
|
+
Delete all
|
207
|
+
</Button>
|
208
|
+
)
|
209
|
+
}
|
210
|
+
];
|
211
|
+
|
212
|
+
const onSelectDropdownItem = (
|
213
|
+
_event: React.MouseEvent<Element, MouseEvent> | undefined,
|
214
|
+
value: string | number | undefined
|
215
|
+
) => {
|
216
|
+
if (value === 'Settings') {
|
217
|
+
setAreSettingsOpen(true);
|
218
|
+
} else {
|
219
|
+
setDisplayMode(value as ChatbotDisplayMode);
|
220
|
+
}
|
221
|
+
};
|
222
|
+
|
223
|
+
const regularChatbot = (
|
224
|
+
<ChatbotHeader>
|
225
|
+
<ChatbotHeaderActions>
|
226
|
+
<ChatbotHeaderOptionsDropdown isCompact onSelect={onSelectDropdownItem}>
|
227
|
+
<DropdownGroup label="Display mode">
|
228
|
+
<DropdownList>
|
229
|
+
<DropdownItem
|
230
|
+
value={ChatbotDisplayMode.default}
|
231
|
+
key="switchDisplayOverlay"
|
232
|
+
icon={<OutlinedWindowRestoreIcon aria-hidden />}
|
233
|
+
isSelected={displayMode === ChatbotDisplayMode.default}
|
234
|
+
>
|
235
|
+
<span>Overlay</span>
|
236
|
+
</DropdownItem>
|
237
|
+
<DropdownItem
|
238
|
+
value={ChatbotDisplayMode.docked}
|
239
|
+
key="switchDisplayDock"
|
240
|
+
icon={<OpenDrawerRightIcon aria-hidden />}
|
241
|
+
isSelected={displayMode === ChatbotDisplayMode.docked}
|
242
|
+
>
|
243
|
+
<span>Dock to window</span>
|
244
|
+
</DropdownItem>
|
245
|
+
<DropdownItem
|
246
|
+
value={ChatbotDisplayMode.fullscreen}
|
247
|
+
key="switchDisplayFullscreen"
|
248
|
+
icon={<ExpandIcon aria-hidden />}
|
249
|
+
isSelected={displayMode === ChatbotDisplayMode.fullscreen}
|
250
|
+
>
|
251
|
+
<span>Fullscreen</span>
|
252
|
+
</DropdownItem>
|
253
|
+
</DropdownList>
|
254
|
+
</DropdownGroup>
|
255
|
+
<Divider />
|
256
|
+
<DropdownList>
|
257
|
+
<DropdownItem value="Settings" key="switchSettings" icon={<CogIcon aria-hidden />}>
|
258
|
+
<span>Settings</span>
|
259
|
+
</DropdownItem>
|
260
|
+
</DropdownList>
|
261
|
+
</ChatbotHeaderOptionsDropdown>
|
262
|
+
</ChatbotHeaderActions>
|
263
|
+
</ChatbotHeader>
|
264
|
+
);
|
265
|
+
|
266
|
+
return (
|
267
|
+
<>
|
268
|
+
<Chatbot isCompact isVisible={chatbotVisible} displayMode={displayMode}>
|
269
|
+
{areSettingsOpen ? (
|
270
|
+
<>
|
271
|
+
<ChatbotHeader className="pf-m-compact">
|
272
|
+
<ChatbotHeaderMain>
|
273
|
+
<ChatbotHeaderTitle>
|
274
|
+
<Title headingLevel="h1" size="2xl">
|
275
|
+
Settings
|
276
|
+
</Title>
|
277
|
+
</ChatbotHeaderTitle>
|
278
|
+
</ChatbotHeaderMain>
|
279
|
+
<ChatbotHeaderCloseButton isCompact onClick={() => setAreSettingsOpen(false)} />
|
280
|
+
</ChatbotHeader>
|
281
|
+
<SettingsForm isCompact fields={children} />
|
282
|
+
</>
|
283
|
+
) : (
|
284
|
+
<>{regularChatbot}</>
|
285
|
+
)}
|
286
|
+
</Chatbot>
|
287
|
+
</>
|
288
|
+
);
|
289
|
+
};
|
@@ -0,0 +1,136 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Button, FormGroup, Radio, SkipToContent } from '@patternfly/react-core';
|
3
|
+
import TermsOfUse from '@patternfly/chatbot/dist/dynamic/TermsOfUse';
|
4
|
+
import Chatbot, { ChatbotDisplayMode } from '@patternfly/chatbot/dist/dynamic/Chatbot';
|
5
|
+
|
6
|
+
export const TermsOfUseCompactExample: React.FunctionComponent = () => {
|
7
|
+
const [isModalOpen, setIsModalOpen] = React.useState(true);
|
8
|
+
const [displayMode, setDisplayMode] = React.useState(ChatbotDisplayMode.default);
|
9
|
+
const chatbotRef = React.useRef<HTMLDivElement>(null);
|
10
|
+
const termsRef = React.useRef<HTMLDivElement>(null);
|
11
|
+
|
12
|
+
const handleSkipToContent = (e) => {
|
13
|
+
e.preventDefault();
|
14
|
+
if (!isModalOpen && chatbotRef.current) {
|
15
|
+
chatbotRef.current.focus();
|
16
|
+
}
|
17
|
+
if (isModalOpen && termsRef.current) {
|
18
|
+
termsRef.current.focus();
|
19
|
+
}
|
20
|
+
};
|
21
|
+
|
22
|
+
const handleModalToggle = (_event: React.MouseEvent | MouseEvent | KeyboardEvent) => {
|
23
|
+
setIsModalOpen(!isModalOpen);
|
24
|
+
};
|
25
|
+
|
26
|
+
const onPrimaryAction = () => {
|
27
|
+
// eslint-disable-next-line no-console
|
28
|
+
console.log('Clicked primary action');
|
29
|
+
};
|
30
|
+
|
31
|
+
const onSecondaryAction = () => {
|
32
|
+
// eslint-disable-next-line no-console
|
33
|
+
console.log('Clicked secondary action');
|
34
|
+
};
|
35
|
+
|
36
|
+
const introduction = (
|
37
|
+
<>
|
38
|
+
<p>
|
39
|
+
Welcome to PatternFly! These terms and conditions outline the rules and regulations for the use of PatternFly's
|
40
|
+
website, located at <a href="https://patternfly.org">www.patternfly.org.</a>
|
41
|
+
</p>
|
42
|
+
<p>
|
43
|
+
By accessing this website, you are agreeing with our terms and conditions. If you do not agree to all of these
|
44
|
+
terms and conditions, do not continue to use PatternFly.
|
45
|
+
</p>
|
46
|
+
</>
|
47
|
+
);
|
48
|
+
|
49
|
+
const terminology = (
|
50
|
+
<>
|
51
|
+
<p>
|
52
|
+
The following terminology applies to these Terms and Conditions, Privacy Statement, Disclaimer Notice, and all
|
53
|
+
Agreements:
|
54
|
+
</p>
|
55
|
+
<ul>
|
56
|
+
<li>
|
57
|
+
"Client", "You", and "Your" refer to you, the person using this website who is compliant with the Company's
|
58
|
+
terms and conditions.
|
59
|
+
</li>
|
60
|
+
<li>
|
61
|
+
"The Company", "Ourselves", "We", "Our", and "Us", refer to our Company. "Party", "Parties", or "Us", refers
|
62
|
+
to both the Client and ourselves.
|
63
|
+
</li>
|
64
|
+
</ul>
|
65
|
+
</>
|
66
|
+
);
|
67
|
+
|
68
|
+
const body = (
|
69
|
+
<>
|
70
|
+
<h2>Introduction</h2>
|
71
|
+
{introduction}
|
72
|
+
<h2>Terminology</h2>
|
73
|
+
{terminology}
|
74
|
+
</>
|
75
|
+
);
|
76
|
+
|
77
|
+
return (
|
78
|
+
<>
|
79
|
+
<SkipToContent style={{ zIndex: '999' }} onClick={handleSkipToContent} href="#">
|
80
|
+
Skip to chatbot
|
81
|
+
</SkipToContent>
|
82
|
+
<div
|
83
|
+
style={{
|
84
|
+
position: 'fixed',
|
85
|
+
padding: 'var(--pf-t--global--spacer--lg)',
|
86
|
+
zIndex: '601',
|
87
|
+
boxShadow: 'var(--pf-t--global--box-shadow--lg)'
|
88
|
+
}}
|
89
|
+
>
|
90
|
+
<FormGroup role="radiogroup" isInline fieldId="basic-form-radio-group" label="Display mode">
|
91
|
+
<Radio
|
92
|
+
isChecked={displayMode === ChatbotDisplayMode.default}
|
93
|
+
onChange={() => setDisplayMode(ChatbotDisplayMode.default)}
|
94
|
+
name="basic-inline-radio"
|
95
|
+
label="Default"
|
96
|
+
id="default"
|
97
|
+
/>
|
98
|
+
<Radio
|
99
|
+
isChecked={displayMode === ChatbotDisplayMode.docked}
|
100
|
+
onChange={() => setDisplayMode(ChatbotDisplayMode.docked)}
|
101
|
+
name="basic-inline-radio"
|
102
|
+
label="Docked"
|
103
|
+
id="docked"
|
104
|
+
/>
|
105
|
+
<Radio
|
106
|
+
isChecked={displayMode === ChatbotDisplayMode.fullscreen}
|
107
|
+
onChange={() => setDisplayMode(ChatbotDisplayMode.fullscreen)}
|
108
|
+
name="basic-inline-radio"
|
109
|
+
label="Fullscreen"
|
110
|
+
id="fullscreen"
|
111
|
+
/>
|
112
|
+
<Radio
|
113
|
+
isChecked={displayMode === ChatbotDisplayMode.embedded}
|
114
|
+
onChange={() => setDisplayMode(ChatbotDisplayMode.embedded)}
|
115
|
+
name="basic-inline-radio"
|
116
|
+
label="Embedded"
|
117
|
+
id="embedded"
|
118
|
+
/>
|
119
|
+
</FormGroup>
|
120
|
+
<Button onClick={handleModalToggle}>Launch modal</Button>
|
121
|
+
</div>
|
122
|
+
<Chatbot ref={chatbotRef} displayMode={displayMode} isVisible></Chatbot>
|
123
|
+
<TermsOfUse
|
124
|
+
ref={termsRef}
|
125
|
+
displayMode={displayMode}
|
126
|
+
isModalOpen={isModalOpen}
|
127
|
+
handleModalToggle={handleModalToggle}
|
128
|
+
onPrimaryAction={onPrimaryAction}
|
129
|
+
onSecondaryAction={onSecondaryAction}
|
130
|
+
isCompact
|
131
|
+
>
|
132
|
+
{body}
|
133
|
+
</TermsOfUse>
|
134
|
+
</>
|
135
|
+
);
|
136
|
+
};
|
@@ -83,7 +83,7 @@ import PFHorizontalLogoReverse from './PF-HorizontalLogo-Reverse.svg';
|
|
83
83
|
import userAvatar from '../Messages/user_avatar.svg';
|
84
84
|
import patternflyAvatar from '../Messages/patternfly_avatar.jpg';
|
85
85
|
import termsAndConditionsHeader from './PF-TermsAndConditionsHeader.svg';
|
86
|
-
import { CloseIcon } from '@patternfly/react-icons';
|
86
|
+
import { CloseIcon, SearchIcon, OutlinedCommentsIcon } from '@patternfly/react-icons';
|
87
87
|
|
88
88
|
## Structure
|
89
89
|
|
@@ -396,6 +396,13 @@ This example also includes an example of how to use [skip to content](/patternfl
|
|
396
396
|
|
397
397
|
```
|
398
398
|
|
399
|
+
### Compact terms of use
|
400
|
+
|
401
|
+
To apply compact styling to the terms of use modal, pass `isCompact` to `<TermsOfUse>`. This will remove the header image and adjust the spacing of text, so that there is less white space in the modal.
|
402
|
+
```js file="./TermsOfUseCompact.tsx" isFullscreen
|
403
|
+
|
404
|
+
```
|
405
|
+
|
399
406
|
### Settings
|
400
407
|
|
401
408
|
To contain user preference controls and other ChatBot setting options, you can create a separate settings page that can accept any number of buttons, dropdown menus, toggles, labels, and so on. This settings page will render all components appropriately within all 4 display modes.
|
@@ -406,6 +413,13 @@ In this demo, you can toggle the settings page by clicking the "Settings" button
|
|
406
413
|
|
407
414
|
```
|
408
415
|
|
416
|
+
### Compact settings
|
417
|
+
|
418
|
+
To make the settings menu compact, with less spacing between the menu contents, pass `isCompact` to the `<SettingsForm>`.
|
419
|
+
```js file="./CompactSettings.tsx" isFullscreen
|
420
|
+
|
421
|
+
```
|
422
|
+
|
409
423
|
## Modals
|
410
424
|
|
411
425
|
### Modal
|
@@ -59,7 +59,6 @@ import userAvatar from '../Messages/user_avatar.svg';
|
|
59
59
|
import patternflyAvatar from '../Messages/patternfly_avatar.jpg';
|
60
60
|
import { getTrackingProviders } from "@patternfly/chatbot/dist/dynamic/tracking";
|
61
61
|
|
62
|
-
|
63
62
|
### Basic ChatBot
|
64
63
|
|
65
64
|
This demo displays a basic ChatBot, which includes:
|
@@ -87,6 +86,14 @@ This demo displays a basic ChatBot, which includes:
|
|
87
86
|
|
88
87
|
```
|
89
88
|
|
89
|
+
### Compact ChatBot
|
90
|
+
|
91
|
+
This demo displays a basic compact ChatBot
|
92
|
+
|
93
|
+
```js file="./ChatbotCompact.tsx" isFullscreen
|
94
|
+
|
95
|
+
```
|
96
|
+
|
90
97
|
### Embedded ChatBot
|
91
98
|
|
92
99
|
This demo displays an embedded ChatBot. Embedded ChatBots are meant to be placed within a page in your product. This demo includes:
|
@@ -34,6 +34,8 @@ import userAvatar from '../Messages/user_avatar.svg';
|
|
34
34
|
import patternflyAvatar from '../Messages/patternfly_avatar.jpg';
|
35
35
|
import { getTrackingProviders } from '@patternfly/chatbot/dist/dynamic/tracking';
|
36
36
|
import { InitProps } from '@patternfly/chatbot/dist/dynamic/tracking';
|
37
|
+
import '@patternfly/react-core/dist/styles/base.css';
|
38
|
+
import '@patternfly/chatbot/dist/css/main.css';
|
37
39
|
|
38
40
|
const footnoteProps = {
|
39
41
|
label: 'ChatBot uses AI. Check for mistakes.',
|
@@ -98,17 +100,18 @@ export default MessageLoading;
|
|
98
100
|
const date = new Date();
|
99
101
|
|
100
102
|
const initProps: InitProps = {
|
103
|
+
verbose: false,
|
101
104
|
segmentKey: 'TODO-key', // TODO add your key here
|
102
105
|
posthogKey: 'TODO-key',
|
103
106
|
umamiKey: 'TODO-key',
|
104
|
-
umamiHostUrl: 'http://localhost:3000', // TODO where is your
|
107
|
+
umamiHostUrl: 'http://localhost:3000', // TODO where is your Umami installation?
|
105
108
|
console: true,
|
106
109
|
something: 'test'
|
107
110
|
};
|
108
111
|
|
109
112
|
const tracking = getTrackingProviders(initProps);
|
110
|
-
tracking.identify('user-123'); // TODO get real user id
|
111
|
-
tracking.trackPageView(window.
|
113
|
+
tracking.identify('user-123', { superUser: true }); // TODO get real user id + properties
|
114
|
+
tracking.trackPageView(window.location.href);
|
112
115
|
|
113
116
|
const actionEventName = 'MessageAction';
|
114
117
|
const initialMessages: MessageProps[] = [
|
@@ -29,6 +29,8 @@ import PFIconLogoColor from '../UI/PF-IconLogo-Color.svg';
|
|
29
29
|
import PFIconLogoReverse from '../UI/PF-IconLogo-Reverse.svg';
|
30
30
|
import userAvatar from '../Messages/user_avatar.svg';
|
31
31
|
import patternflyAvatar from '../Messages/patternfly_avatar.jpg';
|
32
|
+
import '@patternfly/react-core/dist/styles/base.css';
|
33
|
+
import '@patternfly/chatbot/dist/css/main.css';
|
32
34
|
|
33
35
|
interface ModalData {
|
34
36
|
code: string;
|
@@ -16,6 +16,8 @@ import { BellIcon, CalendarAltIcon, ClipboardIcon, CodeIcon, UploadIcon } from '
|
|
16
16
|
import { useDropzone } from 'react-dropzone';
|
17
17
|
import userAvatar from '../Messages/user_avatar.svg';
|
18
18
|
import patternflyAvatar from '../Messages/patternfly_avatar.jpg';
|
19
|
+
import '@patternfly/react-core/dist/styles/base.css';
|
20
|
+
import '@patternfly/chatbot/dist/css/main.css';
|
19
21
|
|
20
22
|
const initialMenuItems = [
|
21
23
|
<DropdownList key="list-1">
|