@patternfly/chatbot 6.3.0-prerelease.2 → 6.3.0-prerelease.21
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/AttachMenu/AttachMenu.d.ts +2 -2
- package/dist/cjs/AttachMenu/AttachMenu.js +2 -12
- package/dist/cjs/AttachmentEdit/AttachmentEdit.d.ts +14 -2
- package/dist/cjs/AttachmentEdit/AttachmentEdit.js +3 -6
- package/dist/cjs/AttachmentEdit/AttachmentEdit.test.d.ts +1 -1
- package/dist/cjs/AttachmentEdit/AttachmentEdit.test.js +33 -8
- package/dist/cjs/Chatbot/Chatbot.d.ts +3 -2
- package/dist/cjs/Chatbot/Chatbot.js +5 -10
- package/dist/cjs/Chatbot/Chatbot.test.js +13 -9
- package/dist/cjs/ChatbotAlert/ChatbotAlert.d.ts +2 -2
- package/dist/cjs/ChatbotAlert/ChatbotAlert.js +4 -8
- package/dist/cjs/ChatbotAlert/ChatbotAlert.test.js +10 -10
- package/dist/cjs/ChatbotContent/ChatbotContent.d.ts +3 -3
- package/dist/cjs/ChatbotContent/ChatbotContent.js +2 -8
- package/dist/cjs/ChatbotContent/ChatbotContent.test.js +5 -5
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.d.ts +2 -2
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.js +7 -11
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.test.js +31 -33
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.d.ts +4 -2
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.js +17 -34
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.js +58 -62
- package/dist/cjs/ChatbotConversationHistoryNav/EmptyState.d.ts +2 -2
- package/dist/cjs/ChatbotConversationHistoryNav/EmptyState.js +2 -9
- package/dist/cjs/ChatbotConversationHistoryNav/LoadingState.d.ts +2 -2
- package/dist/cjs/ChatbotConversationHistoryNav/LoadingState.js +2 -25
- package/dist/cjs/ChatbotFooter/ChatbotFooter.d.ts +4 -3
- package/dist/cjs/ChatbotFooter/ChatbotFooter.js +3 -16
- package/dist/cjs/ChatbotFooter/ChatbotFooter.test.d.ts +1 -1
- package/dist/cjs/ChatbotFooter/ChatbotFooter.test.js +10 -5
- package/dist/cjs/ChatbotFooter/ChatbotFooternote.test.js +28 -28
- package/dist/cjs/ChatbotFooter/ChatbotFootnote.d.ts +3 -3
- package/dist/cjs/ChatbotFooter/ChatbotFootnote.js +10 -23
- package/dist/cjs/ChatbotHeader/ChatbotHeader.d.ts +3 -3
- package/dist/cjs/ChatbotHeader/ChatbotHeader.js +2 -7
- package/dist/cjs/ChatbotHeader/ChatbotHeader.test.js +5 -5
- package/dist/cjs/ChatbotHeader/ChatbotHeaderActions.d.ts +2 -2
- package/dist/cjs/ChatbotHeader/ChatbotHeaderActions.js +2 -5
- package/dist/cjs/ChatbotHeader/ChatbotHeaderActions.test.js +5 -5
- package/dist/cjs/ChatbotHeader/ChatbotHeaderCloseButton.d.ts +5 -4
- package/dist/cjs/ChatbotHeader/ChatbotHeaderCloseButton.js +19 -10
- package/dist/cjs/ChatbotHeader/ChatbotHeaderCloseButton.test.d.ts +1 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderCloseButton.test.js +10 -8
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMain.d.ts +2 -2
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMain.js +2 -5
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMain.test.js +5 -5
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.d.ts +5 -4
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.js +20 -8
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.test.d.ts +1 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.test.js +10 -8
- package/dist/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.d.ts +7 -3
- package/dist/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.js +8 -9
- package/dist/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.d.ts +1 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.js +22 -19
- package/dist/cjs/ChatbotHeader/ChatbotHeaderSelectorDropdown.d.ts +9 -3
- package/dist/cjs/ChatbotHeader/ChatbotHeaderSelectorDropdown.js +11 -12
- package/dist/cjs/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.d.ts +1 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.js +20 -17
- package/dist/cjs/ChatbotHeader/ChatbotHeaderTitle.d.ts +2 -2
- package/dist/cjs/ChatbotHeader/ChatbotHeaderTitle.js +2 -5
- package/dist/cjs/ChatbotHeader/ChatbotHeaderTitle.test.js +23 -23
- package/dist/cjs/ChatbotModal/ChatbotModal.d.ts +5 -2
- package/dist/cjs/ChatbotModal/ChatbotModal.js +4 -10
- package/dist/cjs/ChatbotModal/ChatbotModal.test.d.ts +1 -0
- package/dist/cjs/ChatbotModal/ChatbotModal.test.js +16 -0
- package/dist/cjs/ChatbotPopover/ChatbotPopover.d.ts +2 -2
- package/dist/cjs/ChatbotPopover/ChatbotPopover.js +2 -8
- package/dist/cjs/ChatbotToggle/ChatbotToggle.d.ts +1 -2
- package/dist/cjs/ChatbotToggle/ChatbotToggle.js +8 -13
- package/dist/cjs/ChatbotToggle/ChatbotToggle.test.js +25 -25
- package/dist/cjs/ChatbotWelcomePrompt/ChatbotWelcomePrompt.d.ts +3 -2
- package/dist/cjs/ChatbotWelcomePrompt/ChatbotWelcomePrompt.js +7 -21
- package/dist/cjs/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.js +18 -14
- package/dist/cjs/CodeModal/CodeModal.d.ts +10 -2
- package/dist/cjs/CodeModal/CodeModal.js +8 -20
- package/dist/cjs/CodeModal/CodeModal.test.d.ts +1 -0
- package/dist/cjs/CodeModal/CodeModal.test.js +34 -0
- package/dist/cjs/Compare/Compare.d.ts +2 -2
- package/dist/cjs/Compare/Compare.js +7 -16
- package/dist/cjs/Compare/Compare.test.js +7 -9
- package/dist/cjs/FileDetails/FileDetails.d.ts +2 -2
- package/dist/cjs/FileDetails/FileDetails.js +2 -15
- package/dist/cjs/FileDetails/FileDetails.test.js +10 -10
- package/dist/cjs/FileDetailsLabel/FileDetailsLabel.d.ts +2 -2
- package/dist/cjs/FileDetailsLabel/FileDetailsLabel.js +2 -5
- package/dist/cjs/FileDetailsLabel/FileDetailsLabel.test.js +21 -21
- package/dist/cjs/FileDropZone/FileDropZone.d.ts +9 -2
- package/dist/cjs/FileDropZone/FileDropZone.js +6 -9
- package/dist/cjs/FileDropZone/FileDropZone.test.js +31 -5
- package/dist/cjs/LoadingMessage/LoadingMessage.d.ts +2 -2
- package/dist/cjs/LoadingMessage/LoadingMessage.js +2 -10
- package/dist/cjs/LoadingMessage/LoadingMessage.test.js +6 -6
- package/dist/cjs/Message/CodeBlockMessage/CodeBlockMessage.d.ts +20 -3
- package/dist/cjs/Message/CodeBlockMessage/CodeBlockMessage.js +22 -16
- package/dist/cjs/Message/CodeBlockMessage/ExpandableSectionForSyntaxHighlighter.d.ts +62 -0
- package/dist/cjs/Message/CodeBlockMessage/ExpandableSectionForSyntaxHighlighter.js +136 -0
- package/dist/cjs/Message/ErrorMessage/ErrorMessage.d.ts +1 -2
- package/dist/cjs/Message/ErrorMessage/ErrorMessage.js +5 -8
- package/dist/cjs/Message/ImageMessage/ImageMessage.d.ts +1 -2
- package/dist/cjs/Message/ImageMessage/ImageMessage.js +2 -8
- package/dist/cjs/Message/LinkMessage/LinkMessage.d.ts +1 -2
- package/dist/cjs/Message/LinkMessage/LinkMessage.js +6 -9
- package/dist/cjs/Message/ListMessage/ListItemMessage.d.ts +1 -2
- package/dist/cjs/Message/ListMessage/ListItemMessage.js +2 -8
- package/dist/cjs/Message/ListMessage/OrderedListMessage.d.ts +1 -2
- package/dist/cjs/Message/ListMessage/OrderedListMessage.js +2 -9
- package/dist/cjs/Message/ListMessage/UnorderedListMessage.d.ts +1 -2
- package/dist/cjs/Message/ListMessage/UnorderedListMessage.js +2 -9
- package/dist/cjs/Message/Message.d.ts +26 -8
- package/dist/cjs/Message/Message.js +50 -72
- package/dist/cjs/Message/Message.test.js +123 -81
- package/dist/cjs/Message/MessageInput.d.ts +2 -2
- package/dist/cjs/Message/MessageInput.js +5 -14
- package/dist/cjs/Message/MessageLoading.d.ts +1 -2
- package/dist/cjs/Message/MessageLoading.js +3 -8
- package/dist/cjs/Message/Plugins/rehypeMoveImagesOutOfParagraphs.d.ts +2 -0
- package/dist/cjs/Message/Plugins/rehypeMoveImagesOutOfParagraphs.js +47 -0
- package/dist/cjs/Message/QuickResponse/QuickResponse.d.ts +4 -2
- package/dist/cjs/Message/QuickResponse/QuickResponse.js +8 -10
- package/dist/cjs/Message/QuickStarts/FallbackImg.d.ts +2 -2
- package/dist/cjs/Message/QuickStarts/FallbackImg.js +5 -27
- package/dist/cjs/Message/QuickStarts/QuickStartTile.d.ts +4 -2
- package/dist/cjs/Message/QuickStarts/QuickStartTile.js +8 -44
- package/dist/cjs/Message/QuickStarts/QuickStartTileDescription.d.ts +2 -2
- package/dist/cjs/Message/QuickStarts/QuickStartTileDescription.js +9 -38
- package/dist/cjs/Message/QuickStarts/QuickStartTileDescription.test.js +16 -16
- package/dist/cjs/Message/QuickStarts/QuickStartTileHeader.d.ts +2 -2
- package/dist/cjs/Message/QuickStarts/QuickStartTileHeader.js +2 -26
- package/dist/cjs/Message/QuickStarts/types.d.ts +4 -3
- package/dist/cjs/Message/TableMessage/TableMessage.d.ts +1 -2
- package/dist/cjs/Message/TableMessage/TableMessage.js +8 -10
- package/dist/cjs/Message/TableMessage/TbodyMessage.d.ts +2 -3
- package/dist/cjs/Message/TableMessage/TbodyMessage.js +7 -9
- package/dist/cjs/Message/TableMessage/TdMessage.d.ts +1 -2
- package/dist/cjs/Message/TableMessage/TdMessage.js +2 -8
- package/dist/cjs/Message/TableMessage/ThMessage.d.ts +1 -2
- package/dist/cjs/Message/TableMessage/ThMessage.js +2 -8
- package/dist/cjs/Message/TableMessage/TheadMessage.d.ts +1 -2
- package/dist/cjs/Message/TableMessage/TheadMessage.js +2 -8
- package/dist/cjs/Message/TableMessage/TrMessage.d.ts +2 -3
- package/dist/cjs/Message/TableMessage/TrMessage.js +8 -10
- package/dist/cjs/Message/TextMessage/TextMessage.d.ts +1 -2
- package/dist/cjs/Message/TextMessage/TextMessage.js +2 -9
- package/dist/cjs/Message/UserFeedback/CloseButton.d.ts +2 -2
- package/dist/cjs/Message/UserFeedback/CloseButton.js +2 -8
- package/dist/cjs/Message/UserFeedback/UserFeedback.d.ts +2 -2
- package/dist/cjs/Message/UserFeedback/UserFeedback.js +13 -24
- package/dist/cjs/Message/UserFeedback/UserFeedback.test.js +55 -51
- package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.d.ts +2 -2
- package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.js +21 -45
- package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.test.js +83 -89
- package/dist/cjs/MessageBar/AttachButton.d.ts +9 -2
- package/dist/cjs/MessageBar/AttachButton.js +9 -17
- package/dist/cjs/MessageBar/AttachButton.test.js +50 -22
- package/dist/cjs/MessageBar/MessageBar.d.ts +16 -3
- package/dist/cjs/MessageBar/MessageBar.js +36 -37
- package/dist/cjs/MessageBar/MessageBar.test.js +122 -108
- package/dist/cjs/MessageBar/MicrophoneButton.d.ts +3 -2
- package/dist/cjs/MessageBar/MicrophoneButton.js +8 -15
- package/dist/cjs/MessageBar/SendButton.d.ts +4 -2
- package/dist/cjs/MessageBar/SendButton.js +4 -12
- package/dist/cjs/MessageBar/SendButton.test.js +18 -14
- package/dist/cjs/MessageBar/StopButton.d.ts +4 -2
- package/dist/cjs/MessageBar/StopButton.js +4 -13
- package/dist/cjs/MessageBar/StopButton.test.js +18 -14
- package/dist/cjs/MessageBox/JumpButton.d.ts +2 -2
- package/dist/cjs/MessageBox/JumpButton.js +2 -10
- package/dist/cjs/MessageBox/JumpButton.test.js +10 -10
- package/dist/cjs/MessageBox/MessageBox.d.ts +21 -5
- package/dist/cjs/MessageBox/MessageBox.js +181 -44
- package/dist/cjs/MessageBox/MessageBox.test.js +219 -6
- package/dist/cjs/PreviewAttachment/PreviewAttachment.d.ts +14 -2
- package/dist/cjs/PreviewAttachment/PreviewAttachment.js +3 -6
- package/dist/cjs/PreviewAttachment/PreviewAttachment.test.d.ts +1 -1
- package/dist/cjs/PreviewAttachment/PreviewAttachment.test.js +34 -12
- package/dist/cjs/ResponseActions/ResponseActionButton.d.ts +5 -5
- package/dist/cjs/ResponseActions/ResponseActionButton.js +5 -8
- package/dist/cjs/ResponseActions/ResponseActionButton.test.js +19 -19
- package/dist/cjs/ResponseActions/ResponseActions.d.ts +7 -3
- package/dist/cjs/ResponseActions/ResponseActions.js +12 -16
- package/dist/cjs/ResponseActions/ResponseActions.test.js +60 -41
- package/dist/cjs/Settings/SettingsForm.d.ts +4 -2
- package/dist/cjs/Settings/SettingsForm.js +3 -9
- package/dist/cjs/Settings/SettingsForm.test.d.ts +1 -1
- package/dist/cjs/Settings/SettingsForm.test.js +18 -9
- package/dist/cjs/SourceDetailsMenuItem/SourceDetailsMenuItem.d.ts +2 -2
- package/dist/cjs/SourceDetailsMenuItem/SourceDetailsMenuItem.js +2 -11
- package/dist/cjs/SourcesCard/SourcesCard.d.ts +2 -2
- package/dist/cjs/SourcesCard/SourcesCard.js +17 -43
- package/dist/cjs/SourcesCard/SourcesCard.test.js +60 -60
- package/dist/cjs/TermsOfUse/TermsOfUse.d.ts +5 -3
- package/dist/cjs/TermsOfUse/TermsOfUse.js +5 -17
- package/dist/cjs/TermsOfUse/TermsOfUse.test.js +31 -33
- package/dist/css/main.css +228 -15
- package/dist/css/main.css.map +1 -1
- package/dist/esm/AttachMenu/AttachMenu.d.ts +2 -2
- package/dist/esm/AttachMenu/AttachMenu.js +2 -9
- package/dist/esm/AttachmentEdit/AttachmentEdit.d.ts +14 -2
- package/dist/esm/AttachmentEdit/AttachmentEdit.js +3 -6
- package/dist/esm/AttachmentEdit/AttachmentEdit.test.d.ts +1 -1
- package/dist/esm/AttachmentEdit/AttachmentEdit.test.js +30 -5
- package/dist/esm/Chatbot/Chatbot.d.ts +3 -2
- package/dist/esm/Chatbot/Chatbot.js +5 -7
- package/dist/esm/Chatbot/Chatbot.test.js +9 -5
- package/dist/esm/ChatbotAlert/ChatbotAlert.d.ts +2 -2
- package/dist/esm/ChatbotAlert/ChatbotAlert.js +4 -5
- package/dist/esm/ChatbotAlert/ChatbotAlert.test.js +4 -4
- package/dist/esm/ChatbotContent/ChatbotContent.d.ts +3 -3
- package/dist/esm/ChatbotContent/ChatbotContent.js +2 -5
- package/dist/esm/ChatbotContent/ChatbotContent.test.js +3 -3
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.d.ts +2 -2
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.js +7 -11
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.test.js +8 -10
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.d.ts +4 -2
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.js +17 -34
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.js +29 -33
- package/dist/esm/ChatbotConversationHistoryNav/EmptyState.d.ts +2 -2
- package/dist/esm/ChatbotConversationHistoryNav/EmptyState.js +2 -6
- package/dist/esm/ChatbotConversationHistoryNav/LoadingState.d.ts +2 -2
- package/dist/esm/ChatbotConversationHistoryNav/LoadingState.js +2 -22
- package/dist/esm/ChatbotFooter/ChatbotFooter.d.ts +4 -3
- package/dist/esm/ChatbotFooter/ChatbotFooter.js +3 -13
- package/dist/esm/ChatbotFooter/ChatbotFooter.test.d.ts +1 -1
- package/dist/esm/ChatbotFooter/ChatbotFooter.test.js +8 -3
- package/dist/esm/ChatbotFooter/ChatbotFooternote.test.js +5 -5
- package/dist/esm/ChatbotFooter/ChatbotFootnote.d.ts +3 -3
- package/dist/esm/ChatbotFooter/ChatbotFootnote.js +10 -23
- package/dist/esm/ChatbotHeader/ChatbotHeader.d.ts +3 -3
- package/dist/esm/ChatbotHeader/ChatbotHeader.js +2 -4
- package/dist/esm/ChatbotHeader/ChatbotHeader.test.js +3 -3
- package/dist/esm/ChatbotHeader/ChatbotHeaderActions.d.ts +2 -2
- package/dist/esm/ChatbotHeader/ChatbotHeaderActions.js +2 -2
- package/dist/esm/ChatbotHeader/ChatbotHeaderActions.test.js +3 -3
- package/dist/esm/ChatbotHeader/ChatbotHeaderCloseButton.d.ts +5 -4
- package/dist/esm/ChatbotHeader/ChatbotHeaderCloseButton.js +20 -8
- package/dist/esm/ChatbotHeader/ChatbotHeaderCloseButton.test.d.ts +1 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderCloseButton.test.js +8 -3
- package/dist/esm/ChatbotHeader/ChatbotHeaderMain.d.ts +2 -2
- package/dist/esm/ChatbotHeader/ChatbotHeaderMain.js +2 -2
- package/dist/esm/ChatbotHeader/ChatbotHeaderMain.test.js +3 -3
- package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.d.ts +5 -4
- package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.js +20 -8
- package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.test.d.ts +1 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.test.js +8 -3
- package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.d.ts +7 -3
- package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.js +8 -9
- package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.d.ts +1 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.js +13 -7
- package/dist/esm/ChatbotHeader/ChatbotHeaderSelectorDropdown.d.ts +9 -3
- package/dist/esm/ChatbotHeader/ChatbotHeaderSelectorDropdown.js +11 -9
- package/dist/esm/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.d.ts +1 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.js +13 -7
- package/dist/esm/ChatbotHeader/ChatbotHeaderTitle.d.ts +2 -2
- package/dist/esm/ChatbotHeader/ChatbotHeaderTitle.js +2 -2
- package/dist/esm/ChatbotHeader/ChatbotHeaderTitle.test.js +12 -12
- package/dist/esm/ChatbotModal/ChatbotModal.d.ts +5 -2
- package/dist/esm/ChatbotModal/ChatbotModal.js +4 -7
- package/dist/esm/ChatbotModal/ChatbotModal.test.d.ts +1 -0
- package/dist/esm/ChatbotModal/ChatbotModal.test.js +11 -0
- package/dist/esm/ChatbotPopover/ChatbotPopover.d.ts +2 -2
- package/dist/esm/ChatbotPopover/ChatbotPopover.js +2 -5
- package/dist/esm/ChatbotToggle/ChatbotToggle.d.ts +1 -2
- package/dist/esm/ChatbotToggle/ChatbotToggle.js +8 -13
- package/dist/esm/ChatbotToggle/ChatbotToggle.test.js +8 -8
- package/dist/esm/ChatbotWelcomePrompt/ChatbotWelcomePrompt.d.ts +3 -2
- package/dist/esm/ChatbotWelcomePrompt/ChatbotWelcomePrompt.js +7 -18
- package/dist/esm/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.js +11 -7
- package/dist/esm/CodeModal/CodeModal.d.ts +10 -2
- package/dist/esm/CodeModal/CodeModal.js +8 -20
- package/dist/esm/CodeModal/CodeModal.test.d.ts +1 -0
- package/dist/esm/CodeModal/CodeModal.test.js +29 -0
- package/dist/esm/Compare/Compare.d.ts +2 -2
- package/dist/esm/Compare/Compare.js +7 -13
- package/dist/esm/Compare/Compare.test.js +4 -6
- package/dist/esm/FileDetails/FileDetails.d.ts +2 -2
- package/dist/esm/FileDetails/FileDetails.js +2 -15
- package/dist/esm/FileDetails/FileDetails.test.js +4 -4
- package/dist/esm/FileDetailsLabel/FileDetailsLabel.d.ts +2 -2
- package/dist/esm/FileDetailsLabel/FileDetailsLabel.js +2 -5
- package/dist/esm/FileDetailsLabel/FileDetailsLabel.test.js +9 -9
- package/dist/esm/FileDropZone/FileDropZone.d.ts +9 -2
- package/dist/esm/FileDropZone/FileDropZone.js +6 -6
- package/dist/esm/FileDropZone/FileDropZone.test.js +29 -3
- package/dist/esm/LoadingMessage/LoadingMessage.d.ts +2 -2
- package/dist/esm/LoadingMessage/LoadingMessage.js +2 -10
- package/dist/esm/LoadingMessage/LoadingMessage.test.js +3 -3
- package/dist/esm/Message/CodeBlockMessage/CodeBlockMessage.d.ts +20 -3
- package/dist/esm/Message/CodeBlockMessage/CodeBlockMessage.js +23 -17
- package/dist/esm/Message/CodeBlockMessage/ExpandableSectionForSyntaxHighlighter.d.ts +62 -0
- package/dist/esm/Message/CodeBlockMessage/ExpandableSectionForSyntaxHighlighter.js +130 -0
- package/dist/esm/Message/ErrorMessage/ErrorMessage.d.ts +1 -2
- package/dist/esm/Message/ErrorMessage/ErrorMessage.js +5 -5
- package/dist/esm/Message/ImageMessage/ImageMessage.d.ts +1 -2
- package/dist/esm/Message/ImageMessage/ImageMessage.js +2 -5
- package/dist/esm/Message/LinkMessage/LinkMessage.d.ts +1 -2
- package/dist/esm/Message/LinkMessage/LinkMessage.js +6 -6
- package/dist/esm/Message/ListMessage/ListItemMessage.d.ts +1 -2
- package/dist/esm/Message/ListMessage/ListItemMessage.js +2 -5
- package/dist/esm/Message/ListMessage/OrderedListMessage.d.ts +1 -2
- package/dist/esm/Message/ListMessage/OrderedListMessage.js +2 -6
- package/dist/esm/Message/ListMessage/UnorderedListMessage.d.ts +1 -2
- package/dist/esm/Message/ListMessage/UnorderedListMessage.js +2 -6
- package/dist/esm/Message/Message.d.ts +26 -8
- package/dist/esm/Message/Message.js +50 -72
- package/dist/esm/Message/Message.test.js +123 -81
- package/dist/esm/Message/MessageInput.d.ts +2 -2
- package/dist/esm/Message/MessageInput.js +5 -11
- package/dist/esm/Message/MessageLoading.d.ts +1 -2
- package/dist/esm/Message/MessageLoading.js +2 -4
- package/dist/esm/Message/Plugins/rehypeMoveImagesOutOfParagraphs.d.ts +2 -0
- package/dist/esm/Message/Plugins/rehypeMoveImagesOutOfParagraphs.js +43 -0
- package/dist/esm/Message/QuickResponse/QuickResponse.d.ts +4 -2
- package/dist/esm/Message/QuickResponse/QuickResponse.js +8 -7
- package/dist/esm/Message/QuickStarts/FallbackImg.d.ts +2 -2
- package/dist/esm/Message/QuickStarts/FallbackImg.js +5 -4
- package/dist/esm/Message/QuickStarts/QuickStartTile.d.ts +4 -2
- package/dist/esm/Message/QuickStarts/QuickStartTile.js +8 -21
- package/dist/esm/Message/QuickStarts/QuickStartTileDescription.d.ts +2 -2
- package/dist/esm/Message/QuickStarts/QuickStartTileDescription.js +9 -15
- package/dist/esm/Message/QuickStarts/QuickStartTileDescription.test.js +5 -5
- package/dist/esm/Message/QuickStarts/QuickStartTileHeader.d.ts +2 -2
- package/dist/esm/Message/QuickStarts/QuickStartTileHeader.js +2 -3
- package/dist/esm/Message/QuickStarts/types.d.ts +4 -3
- package/dist/esm/Message/TableMessage/TableMessage.d.ts +1 -2
- package/dist/esm/Message/TableMessage/TableMessage.js +8 -7
- package/dist/esm/Message/TableMessage/TbodyMessage.d.ts +2 -3
- package/dist/esm/Message/TableMessage/TbodyMessage.js +7 -6
- package/dist/esm/Message/TableMessage/TdMessage.d.ts +1 -2
- package/dist/esm/Message/TableMessage/TdMessage.js +2 -5
- package/dist/esm/Message/TableMessage/ThMessage.d.ts +1 -2
- package/dist/esm/Message/TableMessage/ThMessage.js +2 -5
- package/dist/esm/Message/TableMessage/TheadMessage.d.ts +1 -2
- package/dist/esm/Message/TableMessage/TheadMessage.js +2 -5
- package/dist/esm/Message/TableMessage/TrMessage.d.ts +2 -3
- package/dist/esm/Message/TableMessage/TrMessage.js +8 -7
- package/dist/esm/Message/TextMessage/TextMessage.d.ts +1 -2
- package/dist/esm/Message/TextMessage/TextMessage.js +2 -6
- package/dist/esm/Message/UserFeedback/CloseButton.d.ts +2 -2
- package/dist/esm/Message/UserFeedback/CloseButton.js +2 -5
- package/dist/esm/Message/UserFeedback/UserFeedback.d.ts +2 -2
- package/dist/esm/Message/UserFeedback/UserFeedback.js +13 -24
- package/dist/esm/Message/UserFeedback/UserFeedback.test.js +24 -20
- package/dist/esm/Message/UserFeedback/UserFeedbackComplete.d.ts +2 -2
- package/dist/esm/Message/UserFeedback/UserFeedbackComplete.js +21 -45
- package/dist/esm/Message/UserFeedback/UserFeedbackComplete.test.js +29 -35
- package/dist/esm/MessageBar/AttachButton.d.ts +9 -2
- package/dist/esm/MessageBar/AttachButton.js +9 -14
- package/dist/esm/MessageBar/AttachButton.test.js +44 -16
- package/dist/esm/MessageBar/MessageBar.d.ts +16 -3
- package/dist/esm/MessageBar/MessageBar.js +34 -35
- package/dist/esm/MessageBar/MessageBar.test.js +87 -73
- package/dist/esm/MessageBar/MicrophoneButton.d.ts +3 -2
- package/dist/esm/MessageBar/MicrophoneButton.js +8 -12
- package/dist/esm/MessageBar/SendButton.d.ts +4 -2
- package/dist/esm/MessageBar/SendButton.js +4 -9
- package/dist/esm/MessageBar/SendButton.test.js +13 -9
- package/dist/esm/MessageBar/StopButton.d.ts +4 -2
- package/dist/esm/MessageBar/StopButton.js +4 -10
- package/dist/esm/MessageBar/StopButton.test.js +13 -9
- package/dist/esm/MessageBox/JumpButton.d.ts +2 -2
- package/dist/esm/MessageBox/JumpButton.js +2 -7
- package/dist/esm/MessageBox/JumpButton.test.js +9 -9
- package/dist/esm/MessageBox/MessageBox.d.ts +21 -5
- package/dist/esm/MessageBox/MessageBox.js +181 -44
- package/dist/esm/MessageBox/MessageBox.test.js +220 -7
- package/dist/esm/PreviewAttachment/PreviewAttachment.d.ts +14 -2
- package/dist/esm/PreviewAttachment/PreviewAttachment.js +3 -6
- package/dist/esm/PreviewAttachment/PreviewAttachment.test.d.ts +1 -1
- package/dist/esm/PreviewAttachment/PreviewAttachment.test.js +30 -5
- package/dist/esm/ResponseActions/ResponseActionButton.d.ts +5 -5
- package/dist/esm/ResponseActions/ResponseActionButton.js +5 -5
- package/dist/esm/ResponseActions/ResponseActionButton.test.js +7 -7
- package/dist/esm/ResponseActions/ResponseActions.d.ts +7 -3
- package/dist/esm/ResponseActions/ResponseActions.js +13 -17
- package/dist/esm/ResponseActions/ResponseActions.test.js +35 -16
- package/dist/esm/Settings/SettingsForm.d.ts +4 -2
- package/dist/esm/Settings/SettingsForm.js +3 -6
- package/dist/esm/Settings/SettingsForm.test.d.ts +1 -1
- package/dist/esm/Settings/SettingsForm.test.js +16 -4
- package/dist/esm/SourceDetailsMenuItem/SourceDetailsMenuItem.d.ts +2 -2
- package/dist/esm/SourceDetailsMenuItem/SourceDetailsMenuItem.js +2 -8
- package/dist/esm/SourcesCard/SourcesCard.d.ts +2 -2
- package/dist/esm/SourcesCard/SourcesCard.js +17 -40
- package/dist/esm/SourcesCard/SourcesCard.test.js +19 -19
- package/dist/esm/TermsOfUse/TermsOfUse.d.ts +5 -3
- package/dist/esm/TermsOfUse/TermsOfUse.js +5 -17
- package/dist/esm/TermsOfUse/TermsOfUse.test.js +10 -12
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -6
- package/patternfly-docs/content/extensions/chatbot/design-guidelines.md +10 -0
- package/patternfly-docs/content/extensions/chatbot/examples/Customizing Messages/Customizing Messages.md +51 -0
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/AttachMenu.tsx +9 -9
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/AttachmentEdit.tsx +14 -5
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/AttachmentError.tsx +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/BotMessage.tsx +19 -20
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/FileDetails.tsx +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/FileDetailsLabel.tsx +9 -9
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/FileDropZone.tsx +4 -4
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithAttachment.tsx +7 -7
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithCustomResponseActions.tsx +2 -12
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithFeedback.tsx +37 -4
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithFeedbackTimeout.tsx +3 -3
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithQuickResponses.tsx +26 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithQuickStart.tsx +13 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithResponseActions.tsx +3 -3
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithSources.tsx +24 -3
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/Messages.md +1 -0
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/PreviewAttachment.tsx +14 -5
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/UserMessage.tsx +20 -14
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/UserMessageWithExtraContent.tsx +4 -4
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotContainer.tsx +59 -36
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotFooter.tsx +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotFootnote.tsx +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderBasic.tsx +10 -13
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderDrawer.tsx +18 -9
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderDrawerNavigation.tsx +5 -5
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderDrawerResizable.tsx +5 -5
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderDrawerWithActions.tsx +14 -5
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderDrawerWithSelection.tsx +17 -8
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderTitle.tsx +59 -34
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotMessageBar.tsx +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotMessageBarAttach.tsx +9 -9
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotMessageBarDisabled.tsx +3 -3
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotMessageBarLanguage.tsx +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotMessageBarStop.tsx +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotModal.tsx +74 -37
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotToggleBasic.tsx +3 -3
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotWelcomeInteraction.tsx +8 -8
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotWelcomePrompt.tsx +3 -3
- package/patternfly-docs/content/extensions/chatbot/examples/UI/CompactSettings.tsx +282 -0
- package/patternfly-docs/content/extensions/chatbot/examples/UI/CustomClosedIcon.tsx +3 -3
- package/patternfly-docs/content/extensions/chatbot/examples/UI/Settings.tsx +16 -23
- package/patternfly-docs/content/extensions/chatbot/examples/UI/SkipToContent.tsx +5 -5
- package/patternfly-docs/content/extensions/chatbot/examples/UI/SquareChatbotToggle.tsx +3 -3
- package/patternfly-docs/content/extensions/chatbot/examples/UI/TermsOfUse.tsx +91 -48
- package/patternfly-docs/content/extensions/chatbot/examples/UI/TermsOfUseCompact.tsx +179 -0
- package/patternfly-docs/content/extensions/chatbot/examples/UI/UI.md +17 -0
- package/patternfly-docs/content/extensions/chatbot/examples/demos/AttachmentDemos.md +37 -0
- package/patternfly-docs/content/extensions/chatbot/examples/demos/Chatbot.md +9 -1
- package/patternfly-docs/content/extensions/chatbot/examples/demos/Chatbot.tsx +19 -25
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotAttachment.tsx +23 -14
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotAttachmentMenu.tsx +14 -14
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotCompact.tsx +475 -0
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotInDrawer.tsx +17 -22
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotScrolling.tsx +536 -0
- package/patternfly-docs/content/extensions/chatbot/examples/demos/EmbeddedChatbot.tsx +17 -22
- package/patternfly-docs/content/extensions/chatbot/examples/demos/EmbeddedComparisonChatbot.tsx +13 -13
- package/patternfly-docs/content/extensions/chatbot/examples/demos/Feedback.tsx +7 -7
- package/patternfly-docs/content/extensions/chatbot/img/quick-response-confirmation.svg +67 -0
- package/src/AttachMenu/AttachMenu.tsx +2 -2
- package/src/AttachmentEdit/AttachmentEdit.test.tsx +46 -2
- package/src/AttachmentEdit/AttachmentEdit.tsx +29 -7
- package/src/Chatbot/Chatbot.scss +7 -0
- package/src/Chatbot/Chatbot.test.tsx +9 -1
- package/src/Chatbot/Chatbot.tsx +9 -4
- package/src/ChatbotAlert/ChatbotAlert.test.tsx +0 -1
- package/src/ChatbotAlert/ChatbotAlert.tsx +2 -2
- package/src/ChatbotContent/ChatbotContent.test.tsx +0 -1
- package/src/ChatbotContent/ChatbotContent.tsx +3 -3
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.test.tsx +0 -1
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.tsx +6 -4
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.scss +38 -3
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.tsx +21 -3
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.tsx +17 -8
- package/src/ChatbotConversationHistoryNav/EmptyState.tsx +2 -2
- package/src/ChatbotConversationHistoryNav/LoadingState.tsx +2 -2
- package/src/ChatbotFooter/ChatbotFooter.scss +5 -0
- package/src/ChatbotFooter/ChatbotFooter.test.tsx +10 -1
- package/src/ChatbotFooter/ChatbotFooter.tsx +6 -4
- package/src/ChatbotFooter/ChatbotFooternote.test.tsx +0 -1
- package/src/ChatbotFooter/ChatbotFootnote.tsx +6 -4
- package/src/ChatbotHeader/ChatbotHeader.scss +25 -0
- package/src/ChatbotHeader/ChatbotHeader.test.tsx +0 -1
- package/src/ChatbotHeader/ChatbotHeader.tsx +4 -7
- package/src/ChatbotHeader/ChatbotHeaderActions.test.tsx +0 -1
- package/src/ChatbotHeader/ChatbotHeaderActions.tsx +2 -2
- package/src/ChatbotHeader/ChatbotHeaderCloseButton.test.tsx +6 -1
- package/src/ChatbotHeader/ChatbotHeaderCloseButton.tsx +17 -10
- package/src/ChatbotHeader/ChatbotHeaderMain.test.tsx +0 -1
- package/src/ChatbotHeader/ChatbotHeaderMain.tsx +5 -3
- package/src/ChatbotHeader/ChatbotHeaderMenu.test.tsx +8 -1
- package/src/ChatbotHeader/ChatbotHeaderMenu.tsx +17 -12
- package/src/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.tsx +15 -1
- package/src/ChatbotHeader/ChatbotHeaderOptionsDropdown.tsx +17 -7
- package/src/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.tsx +19 -1
- package/src/ChatbotHeader/ChatbotHeaderSelectorDropdown.tsx +30 -6
- package/src/ChatbotHeader/ChatbotHeaderTitle.test.tsx +0 -1
- package/src/ChatbotHeader/ChatbotHeaderTitle.tsx +2 -2
- package/src/ChatbotModal/ChatbotModal.scss +15 -4
- package/src/ChatbotModal/ChatbotModal.test.tsx +58 -0
- package/src/ChatbotModal/ChatbotModal.tsx +7 -3
- package/src/ChatbotPopover/ChatbotPopover.scss +9 -5
- package/src/ChatbotPopover/ChatbotPopover.tsx +2 -2
- package/src/ChatbotToggle/ChatbotToggle.test.tsx +0 -1
- package/src/ChatbotToggle/ChatbotToggle.tsx +5 -3
- package/src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.scss +9 -1
- package/src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.tsx +13 -1
- package/src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.tsx +15 -4
- package/src/ChatbotWelcomePrompt/__snapshots__/ChatbotWelcomePrompt.test.tsx.snap +1 -1
- package/src/CodeModal/CodeModal.scss +11 -3
- package/src/CodeModal/CodeModal.test.tsx +51 -0
- package/src/CodeModal/CodeModal.tsx +24 -10
- package/src/Compare/Compare.test.tsx +0 -1
- package/src/Compare/Compare.tsx +7 -6
- package/src/FileDetails/FileDetails.test.tsx +0 -1
- package/src/FileDetails/FileDetails.tsx +2 -2
- package/src/FileDetails/__snapshots__/FileDetails.test.tsx.snap +1 -1
- package/src/FileDetailsLabel/FileDetailsLabel.test.tsx +0 -1
- package/src/FileDetailsLabel/FileDetailsLabel.tsx +1 -1
- package/src/FileDetailsLabel/__snapshots__/FileDetailsLabel.test.tsx.snap +1 -1
- package/src/FileDropZone/FileDropZone.test.tsx +29 -1
- package/src/FileDropZone/FileDropZone.tsx +13 -3
- package/src/LoadingMessage/LoadingMessage.test.tsx +0 -1
- package/src/LoadingMessage/LoadingMessage.tsx +2 -2
- package/src/Message/CodeBlockMessage/CodeBlockMessage.scss +7 -0
- package/src/Message/CodeBlockMessage/CodeBlockMessage.tsx +105 -18
- package/src/Message/CodeBlockMessage/ExpandableSectionForSyntaxHighlighter.tsx +220 -0
- package/src/Message/ErrorMessage/ErrorMessage.tsx +0 -1
- package/src/Message/ImageMessage/ImageMessage.tsx +1 -2
- package/src/Message/LinkMessage/LinkMessage.tsx +0 -1
- package/src/Message/ListMessage/ListItemMessage.tsx +0 -1
- package/src/Message/ListMessage/OrderedListMessage.tsx +0 -1
- package/src/Message/ListMessage/UnorderedListMessage.tsx +0 -1
- package/src/Message/Message.scss +27 -0
- package/src/Message/Message.test.tsx +70 -6
- package/src/Message/Message.tsx +41 -17
- package/src/Message/MessageInput.tsx +5 -5
- package/src/Message/MessageLoading.tsx +0 -2
- package/src/Message/Plugins/rehypeMoveImagesOutOfParagraphs.ts +53 -0
- package/src/Message/QuickResponse/QuickResponse.tsx +9 -4
- package/src/Message/QuickStarts/FallbackImg.tsx +4 -3
- package/src/Message/QuickStarts/QuickStartTile.tsx +8 -4
- package/src/Message/QuickStarts/QuickStartTileDescription.test.tsx +0 -1
- package/src/Message/QuickStarts/QuickStartTileDescription.tsx +4 -3
- package/src/Message/QuickStarts/QuickStartTileHeader.tsx +2 -2
- package/src/Message/QuickStarts/types.ts +4 -3
- package/src/Message/TableMessage/TableMessage.tsx +4 -4
- package/src/Message/TableMessage/TbodyMessage.tsx +3 -3
- package/src/Message/TableMessage/TdMessage.tsx +1 -2
- package/src/Message/TableMessage/ThMessage.tsx +1 -2
- package/src/Message/TableMessage/TheadMessage.tsx +3 -2
- package/src/Message/TableMessage/TrMessage.tsx +4 -4
- package/src/Message/TextMessage/TextMessage.scss +25 -0
- package/src/Message/TextMessage/TextMessage.tsx +1 -2
- package/src/Message/UserFeedback/CloseButton.tsx +2 -2
- package/src/Message/UserFeedback/UserFeedback.scss +24 -3
- package/src/Message/UserFeedback/UserFeedback.test.tsx +13 -1
- package/src/Message/UserFeedback/UserFeedback.tsx +12 -8
- package/src/Message/UserFeedback/UserFeedbackComplete.test.tsx +4 -1
- package/src/Message/UserFeedback/UserFeedbackComplete.tsx +26 -16
- package/src/MessageBar/AttachButton.scss +10 -0
- package/src/MessageBar/AttachButton.test.tsx +56 -8
- package/src/MessageBar/AttachButton.tsx +21 -8
- package/src/MessageBar/MessageBar.scss +17 -0
- package/src/MessageBar/MessageBar.test.tsx +81 -30
- package/src/MessageBar/MessageBar.tsx +60 -25
- package/src/MessageBar/MicrophoneButton.scss +10 -0
- package/src/MessageBar/MicrophoneButton.tsx +15 -9
- package/src/MessageBar/SendButton.scss +10 -0
- package/src/MessageBar/SendButton.test.tsx +10 -7
- package/src/MessageBar/SendButton.tsx +9 -5
- package/src/MessageBar/StopButton.scss +10 -0
- package/src/MessageBar/StopButton.test.tsx +10 -7
- package/src/MessageBar/StopButton.tsx +9 -5
- package/src/MessageBox/JumpButton.test.tsx +4 -5
- package/src/MessageBox/JumpButton.tsx +3 -3
- package/src/MessageBox/MessageBox.scss +6 -0
- package/src/MessageBox/MessageBox.test.tsx +295 -5
- package/src/MessageBox/MessageBox.tsx +301 -82
- package/src/PreviewAttachment/PreviewAttachment.test.tsx +44 -2
- package/src/PreviewAttachment/PreviewAttachment.tsx +29 -7
- package/src/ResponseActions/ResponseActionButton.test.tsx +0 -1
- package/src/ResponseActions/ResponseActionButton.tsx +6 -5
- package/src/ResponseActions/ResponseActions.test.tsx +23 -3
- package/src/ResponseActions/ResponseActions.tsx +40 -10
- package/src/Settings/Settings.scss +11 -0
- package/src/Settings/SettingsForm.test.tsx +17 -1
- package/src/Settings/SettingsForm.tsx +8 -3
- package/src/SourceDetailsMenuItem/SourceDetailsMenuItem.tsx +2 -2
- package/src/SourcesCard/SourcesCard.scss +8 -0
- package/src/SourcesCard/SourcesCard.test.tsx +0 -1
- package/src/SourcesCard/SourcesCard.tsx +9 -8
- package/src/TermsOfUse/TermsOfUse.scss +20 -0
- package/src/TermsOfUse/TermsOfUse.test.tsx +0 -1
- package/src/TermsOfUse/TermsOfUse.tsx +15 -9
- package/tsconfig.cjs.json +0 -1
- package/tsconfig.json +3 -3
@@ -1,12 +1,7 @@
|
|
1
|
-
|
2
|
-
// Chatbot Main - Messages - Jump to Top
|
3
|
-
// ============================================================================
|
4
|
-
import React from 'react';
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
5
2
|
// Import PatternFly components
|
6
3
|
import { Button, Tooltip, Icon } from '@patternfly/react-core';
|
7
4
|
import { ArrowUpIcon } from '@patternfly/react-icons/dist/esm/icons/arrow-up-icon';
|
8
5
|
import { ArrowDownIcon } from '@patternfly/react-icons/dist/esm/icons/arrow-down-icon';
|
9
|
-
const JumpButton = ({ position, isHidden, onClick }) => isHidden ? null : (
|
10
|
-
React.createElement(Button, { variant: "plain", className: `pf-chatbot__jump pf-chatbot__jump--${position}`, "aria-label": `Jump ${position} button`, onClick: onClick },
|
11
|
-
React.createElement(Icon, { iconSize: "lg", isInline: true }, position === 'top' ? React.createElement(ArrowUpIcon, null) : React.createElement(ArrowDownIcon, null)))));
|
6
|
+
const JumpButton = ({ position, isHidden, onClick }) => isHidden ? null : (_jsx(Tooltip, { id: `pf-chatbot__tooltip--jump-${position}`, content: `Back to ${position}`, position: "top", children: _jsx(Button, { variant: "plain", className: `pf-chatbot__jump pf-chatbot__jump--${position}`, "aria-label": `Jump ${position}`, onClick: onClick, children: _jsx(Icon, { iconSize: "lg", isInline: true, children: position === 'top' ? _jsx(ArrowUpIcon, {}) : _jsx(ArrowDownIcon, {}) }) }) }));
|
12
7
|
export default JumpButton;
|
@@ -7,28 +7,28 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
8
8
|
});
|
9
9
|
};
|
10
|
-
import
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
11
11
|
import { render, screen } from '@testing-library/react';
|
12
12
|
import '@testing-library/jest-dom';
|
13
13
|
import JumpButton from './JumpButton';
|
14
14
|
import userEvent from '@testing-library/user-event';
|
15
15
|
describe('JumpButton', () => {
|
16
16
|
it('should render top button correctly', () => {
|
17
|
-
render(
|
18
|
-
expect(screen.getByRole('button', { name: /Jump top
|
17
|
+
render(_jsx(JumpButton, { position: "top", onClick: jest.fn() }));
|
18
|
+
expect(screen.getByRole('button', { name: /Jump top/i })).toBeTruthy();
|
19
19
|
});
|
20
20
|
it('should render bottom button correctly', () => {
|
21
|
-
render(
|
22
|
-
expect(screen.getByRole('button', { name: /Jump bottom
|
21
|
+
render(_jsx(JumpButton, { position: "bottom", onClick: jest.fn() }));
|
22
|
+
expect(screen.getByRole('button', { name: /Jump bottom/i })).toBeTruthy();
|
23
23
|
});
|
24
24
|
it('should call onClick appropriately', () => __awaiter(void 0, void 0, void 0, function* () {
|
25
25
|
const spy = jest.fn();
|
26
|
-
render(
|
27
|
-
yield userEvent.click(screen.getByRole('button', { name: /Jump bottom
|
26
|
+
render(_jsx(JumpButton, { position: "bottom", onClick: spy }));
|
27
|
+
yield userEvent.click(screen.getByRole('button', { name: /Jump bottom/i }));
|
28
28
|
expect(spy).toHaveBeenCalledTimes(1);
|
29
29
|
}));
|
30
30
|
it('should be hidden if isHidden prop is used', () => __awaiter(void 0, void 0, void 0, function* () {
|
31
|
-
render(
|
32
|
-
expect(screen.queryByRole('button', { name: /Jump bottom
|
31
|
+
render(_jsx(JumpButton, { position: "bottom", onClick: jest.fn(), isHidden: true }));
|
32
|
+
expect(screen.queryByRole('button', { name: /Jump bottom/i })).toBeFalsy();
|
33
33
|
}));
|
34
34
|
});
|
@@ -1,17 +1,33 @@
|
|
1
|
-
import
|
2
|
-
export interface MessageBoxProps extends
|
1
|
+
import { HTMLProps, ReactNode } from 'react';
|
2
|
+
export interface MessageBoxProps extends HTMLProps<HTMLDivElement> {
|
3
3
|
/** Content that can be announced, such as a new message, for screen readers */
|
4
4
|
announcement?: string;
|
5
5
|
/** Custom aria-label for scrollable portion of message box */
|
6
6
|
ariaLabel?: string;
|
7
7
|
/** Content to be displayed in the message box */
|
8
|
-
children:
|
8
|
+
children: ReactNode;
|
9
9
|
/** Custom classname for the MessageBox component */
|
10
10
|
className?: string;
|
11
|
-
/** Ref applied to message box
|
11
|
+
/** @deprecated innerRef has been deprecated. Use ref instead. Ref applied to message box */
|
12
12
|
innerRef?: React.Ref<HTMLDivElement>;
|
13
13
|
/** Modifier that controls how content in MessageBox is positioned within the container */
|
14
14
|
position?: 'top' | 'bottom';
|
15
|
+
/** Click handler for additional logic for when scroll to top jump button is clicked */
|
16
|
+
onScrollToTopClick?: () => void;
|
17
|
+
/** Click handler for additional logic for when scroll to bottom jump button is clicked */
|
18
|
+
onScrollToBottomClick?: () => void;
|
19
|
+
/** Flag to enable automatic scrolling when new messages are added */
|
20
|
+
enableSmartScroll?: boolean;
|
15
21
|
}
|
16
|
-
export
|
22
|
+
export interface MessageBoxHandle extends HTMLDivElement {
|
23
|
+
/** Scrolls to the top of the message box */
|
24
|
+
scrollToTop: (options?: ScrollOptions) => void;
|
25
|
+
/** Scrolls to the bottom of the message box */
|
26
|
+
scrollToBottom: (options?: {
|
27
|
+
resumeSmartScroll?: boolean;
|
28
|
+
} & ScrollOptions) => void;
|
29
|
+
/** Returns whether the smart scroll feature is currently active */
|
30
|
+
isSmartScrollActive: () => boolean;
|
31
|
+
}
|
32
|
+
export declare const MessageBox: import("react").ForwardRefExoticComponent<Omit<MessageBoxProps, "ref"> & import("react").RefAttributes<MessageBoxHandle | null>>;
|
17
33
|
export default MessageBox;
|
@@ -1,68 +1,205 @@
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
2
|
+
var t = {};
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
4
|
+
t[p] = s[p];
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
8
|
+
t[p[i]] = s[p[i]];
|
9
|
+
}
|
10
|
+
return t;
|
11
|
+
};
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
1
13
|
// ============================================================================
|
2
14
|
// Chatbot Main - Messages
|
3
15
|
// ============================================================================
|
4
|
-
import
|
16
|
+
import { useState, useRef, useCallback, useEffect, forwardRef, useImperativeHandle } from 'react';
|
5
17
|
import JumpButton from './JumpButton';
|
6
|
-
const
|
7
|
-
|
8
|
-
const [
|
9
|
-
const [
|
10
|
-
const
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
+
export const MessageBox = forwardRef((_a, ref) => {
|
19
|
+
var { announcement, ariaLabel = 'Scrollable message log', children, className, position = 'top', onScrollToTopClick, onScrollToBottomClick, enableSmartScroll = false } = _a, props = __rest(_a, ["announcement", "ariaLabel", "children", "className", "position", "onScrollToTopClick", "onScrollToBottomClick", "enableSmartScroll"]);
|
20
|
+
const [atTop, setAtTop] = useState(false);
|
21
|
+
const [atBottom, setAtBottom] = useState(true);
|
22
|
+
const [isOverflowing, setIsOverflowing] = useState(false);
|
23
|
+
const [autoScroll, setAutoScroll] = useState(true);
|
24
|
+
const lastScrollTop = useRef(0);
|
25
|
+
const animationFrame = useRef(null);
|
26
|
+
const debounceTimeout = useRef(null);
|
27
|
+
const pauseAutoScrollRef = useRef(false);
|
28
|
+
const messageBoxRef = useRef(null);
|
29
|
+
const scrollQueued = useRef(false);
|
30
|
+
const resetUserScrollIntentTimeout = useRef();
|
18
31
|
// Configure handlers
|
19
|
-
const handleScroll =
|
32
|
+
const handleScroll = useCallback(() => {
|
20
33
|
const element = messageBoxRef.current;
|
21
|
-
if (element) {
|
22
|
-
|
23
|
-
|
24
|
-
|
34
|
+
if (!element) {
|
35
|
+
return;
|
36
|
+
}
|
37
|
+
const { scrollTop, scrollHeight, clientHeight } = element;
|
38
|
+
const roundedScrollTop = Math.round(scrollTop);
|
39
|
+
const roundedClientHeight = Math.round(clientHeight);
|
40
|
+
const roundedScrollHeight = Math.round(scrollHeight);
|
41
|
+
const distanceFromBottom = roundedScrollHeight - roundedScrollTop - roundedClientHeight;
|
42
|
+
const isScrollingDown = roundedScrollTop > lastScrollTop.current;
|
43
|
+
const DELTA_UP = 10;
|
44
|
+
const DELTA_DOWN = 50;
|
45
|
+
const DEBOUNCE_DELAY = 200;
|
46
|
+
const delta = isScrollingDown ? DELTA_DOWN : DELTA_UP;
|
47
|
+
const isAtBottom = distanceFromBottom <= delta;
|
48
|
+
setAtTop(roundedScrollTop === 0);
|
49
|
+
setAtBottom(roundedScrollTop + roundedClientHeight >= roundedScrollHeight - 1); // rounding means it could be within a pixel of the bottom
|
50
|
+
if (!enableSmartScroll || scrollQueued.current) {
|
51
|
+
return;
|
52
|
+
}
|
53
|
+
if (roundedScrollTop === 0) {
|
54
|
+
pauseAutoScrollRef.current = false;
|
55
|
+
}
|
56
|
+
if (debounceTimeout.current) {
|
57
|
+
clearTimeout(debounceTimeout.current);
|
25
58
|
}
|
59
|
+
if (!isAtBottom && !pauseAutoScrollRef.current) {
|
60
|
+
setAutoScroll(false);
|
61
|
+
}
|
62
|
+
// User is near bottom and scrolling down - debounce re-enabling auto-scroll
|
63
|
+
if (isAtBottom && isScrollingDown && !pauseAutoScrollRef.current) {
|
64
|
+
debounceTimeout.current = setTimeout(() => {
|
65
|
+
setAutoScroll(true);
|
66
|
+
}, DEBOUNCE_DELAY);
|
67
|
+
}
|
68
|
+
lastScrollTop.current = roundedScrollTop;
|
26
69
|
}, [messageBoxRef]);
|
27
|
-
const checkOverflow =
|
70
|
+
const checkOverflow = useCallback(() => {
|
28
71
|
const element = messageBoxRef.current;
|
29
72
|
if (element) {
|
30
73
|
const { scrollHeight, clientHeight } = element;
|
31
74
|
setIsOverflowing(scrollHeight >= clientHeight);
|
32
75
|
}
|
33
76
|
}, [messageBoxRef]);
|
34
|
-
const
|
77
|
+
const resumeAutoScroll = useCallback(() => {
|
78
|
+
if (!enableSmartScroll) {
|
79
|
+
return;
|
80
|
+
}
|
81
|
+
pauseAutoScrollRef.current = false;
|
82
|
+
setAutoScroll(true);
|
83
|
+
}, [enableSmartScroll]);
|
84
|
+
const pauseAutoScroll = useCallback(() => {
|
85
|
+
if (!enableSmartScroll) {
|
86
|
+
return;
|
87
|
+
}
|
88
|
+
pauseAutoScrollRef.current = true;
|
89
|
+
setAutoScroll(false);
|
90
|
+
}, [enableSmartScroll]);
|
91
|
+
/**
|
92
|
+
* Scrolls to the top of the message box.
|
93
|
+
*
|
94
|
+
*/
|
95
|
+
const scrollToTop = useCallback((options) => {
|
96
|
+
const { behavior = 'smooth' } = options || {};
|
35
97
|
const element = messageBoxRef.current;
|
36
|
-
if (element) {
|
37
|
-
|
98
|
+
if (!element || scrollQueued.current) {
|
99
|
+
return;
|
38
100
|
}
|
101
|
+
scrollQueued.current = true;
|
102
|
+
pauseAutoScroll();
|
103
|
+
if (animationFrame.current) {
|
104
|
+
cancelAnimationFrame(animationFrame.current);
|
105
|
+
animationFrame.current = null;
|
106
|
+
}
|
107
|
+
animationFrame.current = requestAnimationFrame(() => {
|
108
|
+
element.scrollTo({ top: 0, behavior });
|
109
|
+
scrollQueued.current = false;
|
110
|
+
});
|
111
|
+
onScrollToTopClick && onScrollToTopClick();
|
39
112
|
}, [messageBoxRef]);
|
40
|
-
|
113
|
+
/**
|
114
|
+
* Scrolls to the bottom of the message box.
|
115
|
+
*
|
116
|
+
* @param options.resumeSmartScroll - If true, resumes smart scroll behavior;
|
117
|
+
* if false or omitted, scrolls without resuming auto-scroll.
|
118
|
+
* @param options.scrollOptions - Additional scroll options. behavior can be 'smooth' or 'auto'.
|
119
|
+
*/
|
120
|
+
const scrollToBottom = useCallback((options) => {
|
121
|
+
const { behavior = 'smooth', resumeSmartScroll = false } = options || {};
|
122
|
+
resumeSmartScroll && resumeAutoScroll();
|
41
123
|
const element = messageBoxRef.current;
|
42
|
-
if (element) {
|
43
|
-
|
124
|
+
if (!element || pauseAutoScrollRef.current || scrollQueued.current) {
|
125
|
+
return;
|
44
126
|
}
|
45
|
-
|
127
|
+
scrollQueued.current = true;
|
128
|
+
if (animationFrame.current) {
|
129
|
+
cancelAnimationFrame(animationFrame.current);
|
130
|
+
}
|
131
|
+
animationFrame.current = requestAnimationFrame(() => {
|
132
|
+
element.scrollTo({ top: element.scrollHeight, behavior });
|
133
|
+
resumeAutoScroll();
|
134
|
+
scrollQueued.current = false;
|
135
|
+
});
|
136
|
+
onScrollToBottomClick && onScrollToBottomClick();
|
137
|
+
}, [messageBoxRef, enableSmartScroll]);
|
46
138
|
// Detect scroll position
|
47
|
-
|
139
|
+
useEffect(() => {
|
48
140
|
const element = messageBoxRef.current;
|
49
|
-
if (element) {
|
50
|
-
|
51
|
-
element.addEventListener('scroll', handleScroll);
|
52
|
-
// Check initial position and overflow
|
53
|
-
handleScroll();
|
54
|
-
checkOverflow();
|
55
|
-
return () => {
|
56
|
-
element.removeEventListener('scroll', handleScroll);
|
57
|
-
};
|
141
|
+
if (!element) {
|
142
|
+
return;
|
58
143
|
}
|
144
|
+
// Listen for scroll events
|
145
|
+
element.addEventListener('scroll', handleScroll);
|
146
|
+
// Check initial position and overflow
|
147
|
+
handleScroll();
|
148
|
+
checkOverflow();
|
149
|
+
return () => {
|
150
|
+
element.removeEventListener('scroll', handleScroll);
|
151
|
+
};
|
59
152
|
}, [checkOverflow, handleScroll, messageBoxRef]);
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
153
|
+
useImperativeHandle(ref, () => {
|
154
|
+
const node = messageBoxRef.current;
|
155
|
+
// Attach custom methods to the element
|
156
|
+
node.scrollToTop = scrollToTop;
|
157
|
+
node.scrollToBottom = scrollToBottom;
|
158
|
+
node.isSmartScrollActive = () => enableSmartScroll && autoScroll;
|
159
|
+
return node;
|
160
|
+
});
|
161
|
+
let lastTouchY = null;
|
162
|
+
const onTouchEnd = (event) => {
|
163
|
+
lastTouchY = null;
|
164
|
+
props.onTouchEnd && props.onTouchEnd(event);
|
165
|
+
};
|
166
|
+
const handleUserScroll = (isScrollingDown) => {
|
167
|
+
const container = messageBoxRef.current;
|
168
|
+
if (!enableSmartScroll || !container) {
|
169
|
+
return;
|
170
|
+
}
|
171
|
+
if (!isScrollingDown) {
|
172
|
+
pauseAutoScrollRef.current = true;
|
173
|
+
clearTimeout(resetUserScrollIntentTimeout.current);
|
174
|
+
return;
|
175
|
+
}
|
176
|
+
const { scrollTop, scrollHeight, clientHeight } = container;
|
177
|
+
const distanceFromBottom = scrollHeight - scrollTop - clientHeight;
|
178
|
+
if (distanceFromBottom < 100) {
|
179
|
+
pauseAutoScrollRef.current = false;
|
180
|
+
setAutoScroll(true);
|
181
|
+
}
|
182
|
+
};
|
183
|
+
const onWheel = (event) => {
|
184
|
+
const isScrollingDown = event.deltaY > 0;
|
185
|
+
handleUserScroll(isScrollingDown);
|
186
|
+
props.onWheel && props.onWheel(event);
|
187
|
+
};
|
188
|
+
const onTouchMove = (event) => {
|
189
|
+
const currentTouchY = event.touches[0].clientY;
|
190
|
+
let isScrollingDown = false;
|
191
|
+
if (lastTouchY !== null) {
|
192
|
+
isScrollingDown = currentTouchY < lastTouchY;
|
193
|
+
}
|
194
|
+
lastTouchY = currentTouchY;
|
195
|
+
handleUserScroll(isScrollingDown);
|
196
|
+
props.onTouchMove && props.onTouchMove(event);
|
197
|
+
};
|
198
|
+
const smartScrollHandlers = {
|
199
|
+
onWheel,
|
200
|
+
onTouchMove,
|
201
|
+
onTouchEnd
|
202
|
+
};
|
203
|
+
return (_jsxs(_Fragment, { children: [_jsx(JumpButton, { position: "top", isHidden: isOverflowing && atTop, onClick: scrollToTop }), _jsxs("div", Object.assign({ role: "region", tabIndex: 0, "aria-label": ariaLabel, className: `pf-chatbot__messagebox ${position === 'bottom' && 'pf-chatbot__messagebox--bottom'} ${className !== null && className !== void 0 ? className : ''}`, ref: messageBoxRef }, props, (enableSmartScroll ? Object.assign({}, smartScrollHandlers) : {}), { children: [children, _jsx("div", { className: "pf-chatbot__messagebox-announcement", "aria-live": "polite", children: announcement })] })), _jsx(JumpButton, { position: "bottom", isHidden: isOverflowing && atBottom, onClick: () => scrollToBottom({ resumeSmartScroll: true }) })] }));
|
204
|
+
});
|
68
205
|
export default MessageBox;
|
@@ -1,17 +1,230 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
8
|
+
});
|
9
|
+
};
|
10
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
11
|
+
import { createRef } from 'react';
|
12
|
+
import { act, fireEvent, render, screen, waitFor } from '@testing-library/react';
|
3
13
|
import { MessageBox } from './MessageBox';
|
14
|
+
import userEvent from '@testing-library/user-event';
|
4
15
|
describe('MessageBox', () => {
|
16
|
+
beforeEach(() => {
|
17
|
+
jest.spyOn(window, 'requestAnimationFrame').mockImplementation((cb) => {
|
18
|
+
cb(0); // Immediately call the callback
|
19
|
+
return 0;
|
20
|
+
});
|
21
|
+
});
|
22
|
+
afterEach(() => {
|
23
|
+
jest.restoreAllMocks();
|
24
|
+
});
|
5
25
|
it('should render Message box', () => {
|
6
|
-
render(
|
7
|
-
React.createElement(React.Fragment, null, "Chatbot Messages")));
|
26
|
+
render(_jsx(MessageBox, { children: _jsx(_Fragment, { children: "Chatbot Messages" }) }));
|
8
27
|
expect(screen.getByText('Chatbot Messages')).toBeTruthy();
|
9
28
|
});
|
10
29
|
it('should assign ref to Message box', () => {
|
11
|
-
|
12
|
-
|
13
|
-
|
30
|
+
var _a, _b, _c, _d;
|
31
|
+
const ref = createRef();
|
32
|
+
render(_jsx(MessageBox, { "data-testid": "message-box", ref: ref, children: _jsx("div", { children: "Test message content" }) }));
|
33
|
+
screen.getByText('Test message content');
|
14
34
|
expect(ref.current).not.toBeNull();
|
35
|
+
// should contain custom methods exposed by the ref
|
36
|
+
expect(typeof ((_a = ref.current) === null || _a === void 0 ? void 0 : _a.isSmartScrollActive)).toBe('function');
|
37
|
+
expect(typeof ((_b = ref.current) === null || _b === void 0 ? void 0 : _b.scrollToTop)).toBe('function');
|
38
|
+
expect(typeof ((_c = ref.current) === null || _c === void 0 ? void 0 : _c.scrollToBottom)).toBe('function');
|
39
|
+
expect((_d = ref.current) === null || _d === void 0 ? void 0 : _d.isSmartScrollActive()).toBe(false);
|
15
40
|
expect(ref.current).toBeInstanceOf(HTMLDivElement);
|
16
41
|
});
|
42
|
+
it('should call onScrollToBottomClick when scroll to bottom button is clicked', () => __awaiter(void 0, void 0, void 0, function* () {
|
43
|
+
const spy = jest.fn();
|
44
|
+
render(_jsx(MessageBox, { onScrollToBottomClick: spy, children: _jsx("div", { children: "Test message content" }) }));
|
45
|
+
// this forces button to show
|
46
|
+
const region = screen.getByRole('region');
|
47
|
+
Object.defineProperty(region, 'scrollHeight', { configurable: true, value: 1000 });
|
48
|
+
Object.defineProperty(region, 'clientHeight', { configurable: true, value: 500 });
|
49
|
+
Object.defineProperty(region, 'scrollTop', { configurable: true, value: 0 });
|
50
|
+
act(() => {
|
51
|
+
region.dispatchEvent(new Event('scroll'));
|
52
|
+
});
|
53
|
+
yield waitFor(() => {
|
54
|
+
userEvent.click(screen.getByRole('button', { name: /Jump bottom/i }));
|
55
|
+
expect(spy).toHaveBeenCalled();
|
56
|
+
});
|
57
|
+
}));
|
58
|
+
it('should call onScrollToTopClick when scroll to top button is clicked', () => __awaiter(void 0, void 0, void 0, function* () {
|
59
|
+
const spy = jest.fn();
|
60
|
+
render(_jsx(MessageBox, { onScrollToTopClick: spy, children: _jsx("div", { children: "Test message content" }) }));
|
61
|
+
// this forces button to show
|
62
|
+
const region = screen.getByRole('region');
|
63
|
+
Object.defineProperty(region, 'scrollHeight', { configurable: true, value: 1000 });
|
64
|
+
Object.defineProperty(region, 'clientHeight', { configurable: true, value: 500 });
|
65
|
+
Object.defineProperty(region, 'scrollTop', {
|
66
|
+
configurable: true,
|
67
|
+
value: 500
|
68
|
+
});
|
69
|
+
act(() => {
|
70
|
+
region.dispatchEvent(new Event('scroll'));
|
71
|
+
});
|
72
|
+
yield waitFor(() => {
|
73
|
+
userEvent.click(screen.getByRole('button', { name: /Jump top/i }));
|
74
|
+
expect(spy).toHaveBeenCalled();
|
75
|
+
});
|
76
|
+
}));
|
77
|
+
it('should call user defined onWheel, onTouchMove and onTouchEnd handlers', () => __awaiter(void 0, void 0, void 0, function* () {
|
78
|
+
const ref = createRef();
|
79
|
+
const onWheel = jest.fn();
|
80
|
+
const onTouchMove = jest.fn();
|
81
|
+
const onTouchEnd = jest.fn();
|
82
|
+
render(_jsx(MessageBox, { ref: ref, enableSmartScroll: true, onWheel: onWheel, onTouchMove: onTouchMove, onTouchEnd: onTouchEnd, children: _jsx("div", { children: "Test message content" }) }));
|
83
|
+
const element = ref.current;
|
84
|
+
act(() => {
|
85
|
+
fireEvent.wheel(element, { deltaY: 10 });
|
86
|
+
fireEvent.touchMove(element, { touches: [{ clientY: 700 }] });
|
87
|
+
fireEvent.touchEnd(element);
|
88
|
+
});
|
89
|
+
expect(onWheel).toHaveBeenCalled();
|
90
|
+
expect(onTouchMove).toHaveBeenCalled();
|
91
|
+
expect(onTouchEnd).toHaveBeenCalled();
|
92
|
+
}));
|
93
|
+
it('should scroll to the bottom when the method is called ', () => __awaiter(void 0, void 0, void 0, function* () {
|
94
|
+
var _a;
|
95
|
+
const ref = createRef();
|
96
|
+
render(_jsx(MessageBox, { ref: ref, enableSmartScroll: true, children: _jsx("div", { children: "Test message content" }) }));
|
97
|
+
const element = ref.current;
|
98
|
+
const scrollSpy = jest.spyOn(element, 'scrollTo');
|
99
|
+
act(() => {
|
100
|
+
var _a, _b, _c;
|
101
|
+
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.scrollToBottom();
|
102
|
+
(_b = ref.current) === null || _b === void 0 ? void 0 : _b.scrollToBottom();
|
103
|
+
(_c = ref.current) === null || _c === void 0 ? void 0 : _c.scrollToBottom();
|
104
|
+
});
|
105
|
+
expect(scrollSpy).toHaveBeenCalledWith({ top: element.scrollHeight, behavior: 'smooth' });
|
106
|
+
expect((_a = ref.current) === null || _a === void 0 ? void 0 : _a.isSmartScrollActive()).toBe(true);
|
107
|
+
}));
|
108
|
+
it('should scroll to the top when the method is called ', () => __awaiter(void 0, void 0, void 0, function* () {
|
109
|
+
var _a;
|
110
|
+
const ref = createRef();
|
111
|
+
render(_jsx(MessageBox, { ref: ref, enableSmartScroll: true, children: _jsx("div", { children: "Test message content" }) }));
|
112
|
+
const element = ref.current;
|
113
|
+
const scrollSpy = jest.spyOn(element, 'scrollTo');
|
114
|
+
act(() => {
|
115
|
+
var _a;
|
116
|
+
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.scrollToTop();
|
117
|
+
});
|
118
|
+
expect(scrollSpy).toHaveBeenCalledWith({ top: 0, behavior: 'smooth' });
|
119
|
+
expect((_a = ref.current) === null || _a === void 0 ? void 0 : _a.isSmartScrollActive()).toBe(false);
|
120
|
+
}));
|
121
|
+
it('should pause automatic scrolling when user scrolls up ', () => __awaiter(void 0, void 0, void 0, function* () {
|
122
|
+
var _a, _b;
|
123
|
+
const ref = createRef();
|
124
|
+
render(_jsx(MessageBox, { ref: ref, enableSmartScroll: true, children: _jsx("div", { children: "Test message content" }) }));
|
125
|
+
expect((_a = ref.current) === null || _a === void 0 ? void 0 : _a.isSmartScrollActive()).toBe(true);
|
126
|
+
const element = ref.current;
|
127
|
+
// Manually set scrollHeight and clientHeight for calculations
|
128
|
+
Object.defineProperty(element, 'scrollHeight', { configurable: true, value: 1000 });
|
129
|
+
Object.defineProperty(element, 'clientHeight', { configurable: true, value: 300 });
|
130
|
+
// Simulate scroll up by changing scrollTop
|
131
|
+
element.scrollTop = 200;
|
132
|
+
const scrollEvent = new Event('scroll', { bubbles: true });
|
133
|
+
act(() => {
|
134
|
+
element.dispatchEvent(scrollEvent);
|
135
|
+
});
|
136
|
+
expect((_b = ref.current) === null || _b === void 0 ? void 0 : _b.isSmartScrollActive()).toBe(false);
|
137
|
+
}));
|
138
|
+
it('should resume automatic scrolling when user scrolls down to the bottom using scroll event', () => __awaiter(void 0, void 0, void 0, function* () {
|
139
|
+
var _a, _b;
|
140
|
+
jest.useFakeTimers();
|
141
|
+
const ref = createRef();
|
142
|
+
render(_jsx(MessageBox, { ref: ref, enableSmartScroll: true, children: _jsx("div", { children: "Test message content" }) }));
|
143
|
+
const element = ref.current;
|
144
|
+
// Manually set scrollHeight and clientHeight for calculations
|
145
|
+
Object.defineProperty(element, 'scrollHeight', { configurable: true, value: 1000 });
|
146
|
+
Object.defineProperty(element, 'clientHeight', { configurable: true, value: 300 });
|
147
|
+
// Simulate scroll up by changing scrollTop
|
148
|
+
element.scrollTop = 100;
|
149
|
+
const scrollEvent = new Event('scroll', { bubbles: true });
|
150
|
+
act(() => {
|
151
|
+
element.dispatchEvent(scrollEvent);
|
152
|
+
});
|
153
|
+
expect((_a = ref.current) === null || _a === void 0 ? void 0 : _a.isSmartScrollActive()).toBe(false);
|
154
|
+
act(() => {
|
155
|
+
// Simulate scroll down by changing scrollTop
|
156
|
+
element.scrollTop = 650; // scrollHeight - scrollTop - clientHeight - DELTA_DOWN (50) = 0
|
157
|
+
const scrollEvent = new Event('scroll', { bubbles: true });
|
158
|
+
element.dispatchEvent(scrollEvent);
|
159
|
+
jest.advanceTimersByTime(250);
|
160
|
+
});
|
161
|
+
expect((_b = ref.current) === null || _b === void 0 ? void 0 : _b.isSmartScrollActive()).toBe(true);
|
162
|
+
jest.useRealTimers();
|
163
|
+
}));
|
164
|
+
it('should resume automatic scrolling when scrollToBottom method is used', () => __awaiter(void 0, void 0, void 0, function* () {
|
165
|
+
var _a, _b;
|
166
|
+
const ref = createRef();
|
167
|
+
render(_jsx(MessageBox, { ref: ref, enableSmartScroll: true, children: _jsx("div", { children: "Test message content" }) }));
|
168
|
+
const element = ref.current;
|
169
|
+
// Manually set scrollHeight and clientHeight for calculations
|
170
|
+
Object.defineProperty(element, 'scrollHeight', { configurable: true, value: 1000 });
|
171
|
+
Object.defineProperty(element, 'clientHeight', { configurable: true, value: 300 });
|
172
|
+
// Simulate scroll up by changing scrollTop
|
173
|
+
element.scrollTop = 100;
|
174
|
+
const scrollEvent = new Event('scroll', { bubbles: true });
|
175
|
+
act(() => {
|
176
|
+
element.dispatchEvent(scrollEvent);
|
177
|
+
});
|
178
|
+
expect((_a = ref.current) === null || _a === void 0 ? void 0 : _a.isSmartScrollActive()).toBe(false);
|
179
|
+
act(() => {
|
180
|
+
var _a;
|
181
|
+
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.scrollToBottom({ resumeSmartScroll: true, behavior: 'auto' }); // resumes auto scroll and scrolls to bottom.
|
182
|
+
});
|
183
|
+
expect((_b = ref.current) === null || _b === void 0 ? void 0 : _b.isSmartScrollActive()).toBe(true);
|
184
|
+
}));
|
185
|
+
it('should resume automatic scrolling when mouse wheel event is used', () => __awaiter(void 0, void 0, void 0, function* () {
|
186
|
+
var _a, _b;
|
187
|
+
const ref = createRef();
|
188
|
+
render(_jsx(MessageBox, { ref: ref, enableSmartScroll: true, children: _jsx("div", { children: "Test message content" }) }));
|
189
|
+
const element = ref.current;
|
190
|
+
// Manually set scrollHeight and clientHeight for calculations
|
191
|
+
Object.defineProperty(element, 'scrollHeight', { configurable: true, value: 1000 });
|
192
|
+
Object.defineProperty(element, 'clientHeight', { configurable: true, value: 300 });
|
193
|
+
Object.defineProperty(element, 'scrollTop', { configurable: true, value: 350 });
|
194
|
+
const scrollEvent = new Event('scroll', { bubbles: true });
|
195
|
+
act(() => {
|
196
|
+
element.dispatchEvent(scrollEvent);
|
197
|
+
});
|
198
|
+
expect((_a = ref.current) === null || _a === void 0 ? void 0 : _a.isSmartScrollActive()).toBe(false);
|
199
|
+
// Simulate mouse wheel event
|
200
|
+
act(() => {
|
201
|
+
Object.defineProperty(element, 'scrollTop', { configurable: true, value: 650 });
|
202
|
+
fireEvent.wheel(element, { deltaY: 10 });
|
203
|
+
});
|
204
|
+
expect((_b = ref.current) === null || _b === void 0 ? void 0 : _b.isSmartScrollActive()).toBe(true);
|
205
|
+
}));
|
206
|
+
it('should resume automatic scrolling when user swipes up in touch screen', () => __awaiter(void 0, void 0, void 0, function* () {
|
207
|
+
var _a, _b;
|
208
|
+
const ref = createRef();
|
209
|
+
render(_jsx(MessageBox, { ref: ref, enableSmartScroll: true, children: _jsx("div", { children: "Test message content" }) }));
|
210
|
+
const element = ref.current;
|
211
|
+
// Manually set scrollHeight and clientHeight for calculations
|
212
|
+
Object.defineProperty(element, 'scrollHeight', { configurable: true, value: 1000 });
|
213
|
+
Object.defineProperty(element, 'clientHeight', { configurable: true, value: 300 });
|
214
|
+
Object.defineProperty(element, 'scrollTop', { configurable: true, value: 350 });
|
215
|
+
const scrollEvent = new Event('scroll', { bubbles: true });
|
216
|
+
act(() => {
|
217
|
+
element.dispatchEvent(scrollEvent);
|
218
|
+
});
|
219
|
+
expect((_a = ref.current) === null || _a === void 0 ? void 0 : _a.isSmartScrollActive()).toBe(false);
|
220
|
+
// Simulate touch event - swipe up
|
221
|
+
act(() => {
|
222
|
+
Object.defineProperty(element, 'scrollTop', { configurable: true, value: 650 });
|
223
|
+
fireEvent.touchStart(element, { touches: [{ clientY: 700 }] });
|
224
|
+
fireEvent.touchMove(element, { touches: [{ clientY: 700 }] });
|
225
|
+
fireEvent.touchMove(element, { touches: [{ clientY: 600 }] });
|
226
|
+
fireEvent.touchEnd(element);
|
227
|
+
});
|
228
|
+
expect((_b = ref.current) === null || _b === void 0 ? void 0 : _b.isSmartScrollActive()).toBe(true);
|
229
|
+
}));
|
17
230
|
});
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import type { FunctionComponent, MouseEvent } from 'react';
|
2
2
|
import { ChatbotDisplayMode } from '../Chatbot';
|
3
3
|
export interface PreviewAttachmentProps {
|
4
4
|
/** Text shown in code editor */
|
@@ -17,6 +17,18 @@ export interface PreviewAttachmentProps {
|
|
17
17
|
title?: string;
|
18
18
|
/** Display mode for the Chatbot parent; this influences the styles applied */
|
19
19
|
displayMode?: ChatbotDisplayMode;
|
20
|
+
/** Sets modal to compact styling. */
|
21
|
+
isCompact?: boolean;
|
22
|
+
/** Primary action button text */
|
23
|
+
primaryActionButtonText?: string;
|
24
|
+
/** Secondary action button text */
|
25
|
+
secondaryActionButtonText?: string;
|
26
|
+
/** Class applied to modal header */
|
27
|
+
modalHeaderClassName?: string;
|
28
|
+
/** Class applied to modal body */
|
29
|
+
modalBodyClassName?: string;
|
30
|
+
/** Class applied to modal footer */
|
31
|
+
modalFooterClassName?: string;
|
20
32
|
}
|
21
|
-
export declare const PreviewAttachment:
|
33
|
+
export declare const PreviewAttachment: FunctionComponent<PreviewAttachmentProps>;
|
22
34
|
export default PreviewAttachment;
|
@@ -1,10 +1,7 @@
|
|
1
|
-
|
2
|
-
// Preview Attachment - Chatbot Code Snippet Viewer
|
3
|
-
// ============================================================================
|
4
|
-
import React from 'react';
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
5
2
|
import CodeModal from '../CodeModal';
|
6
3
|
import { ChatbotDisplayMode } from '../Chatbot';
|
7
|
-
export const PreviewAttachment = ({ fileName, code, handleModalToggle, isModalOpen, onDismiss = undefined, onEdit, title = 'Preview attachment', displayMode = ChatbotDisplayMode.default }) => {
|
4
|
+
export const PreviewAttachment = ({ fileName, code, handleModalToggle, isModalOpen, onDismiss = undefined, onEdit, title = 'Preview attachment', primaryActionButtonText = 'Edit', secondaryActionButtonText = 'Dismiss', displayMode = ChatbotDisplayMode.default, modalHeaderClassName, modalBodyClassName, modalFooterClassName, isCompact }) => {
|
8
5
|
const handleEdit = (_event) => {
|
9
6
|
handleModalToggle(_event);
|
10
7
|
onEdit(_event);
|
@@ -13,6 +10,6 @@ export const PreviewAttachment = ({ fileName, code, handleModalToggle, isModalOp
|
|
13
10
|
handleModalToggle(_event);
|
14
11
|
onDismiss && onDismiss(_event);
|
15
12
|
};
|
16
|
-
return (
|
13
|
+
return (_jsx(CodeModal, { codeEditorControlClassName: "pf-chatbot__code-modal--controls", code: code, fileName: fileName, handleModalToggle: handleModalToggle, isCopyEnabled: true, isLineNumbersVisible: false, isModalOpen: isModalOpen, onPrimaryAction: handleEdit, onSecondaryAction: handleDismiss, primaryActionBtn: primaryActionButtonText, secondaryActionBtn: secondaryActionButtonText, title: title, isReadOnly: true, displayMode: displayMode, isCompact: isCompact, modalHeaderClassName: modalHeaderClassName, modalBodyClassName: modalBodyClassName, modalFooterClassName: modalFooterClassName }));
|
17
14
|
};
|
18
15
|
export default PreviewAttachment;
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
import '@testing-library/jest-dom';
|