@patternfly/chatbot 6.3.0-prerelease.9 → 6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/AttachMenu/AttachMenu.d.ts +2 -2
- package/dist/cjs/AttachMenu/AttachMenu.js +2 -12
- package/dist/cjs/AttachmentEdit/AttachmentEdit.d.ts +12 -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 +1 -2
- package/dist/cjs/Chatbot/Chatbot.js +4 -9
- package/dist/cjs/Chatbot/Chatbot.test.js +11 -11
- 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 +2 -2
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.js +16 -33
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.js +56 -64
- 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 +3 -3
- package/dist/cjs/ChatbotFooter/ChatbotFooter.js +2 -15
- package/dist/cjs/ChatbotFooter/ChatbotFooter.test.js +7 -7
- 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 +1 -2
- package/dist/cjs/ChatbotHeader/ChatbotHeaderCloseButton.js +5 -10
- package/dist/cjs/ChatbotHeader/ChatbotHeaderCloseButton.test.js +7 -10
- 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 +2 -2
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.js +5 -7
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.test.js +7 -10
- package/dist/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.d.ts +6 -3
- package/dist/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.js +8 -9
- package/dist/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.js +19 -21
- package/dist/cjs/ChatbotHeader/ChatbotHeaderSelectorDropdown.d.ts +8 -3
- package/dist/cjs/ChatbotHeader/ChatbotHeaderSelectorDropdown.js +11 -12
- package/dist/cjs/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.js +17 -19
- 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 +2 -2
- package/dist/cjs/ChatbotModal/ChatbotModal.js +3 -9
- package/dist/cjs/ChatbotModal/ChatbotModal.test.js +4 -16
- 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 +2 -2
- package/dist/cjs/ChatbotWelcomePrompt/ChatbotWelcomePrompt.js +6 -20
- package/dist/cjs/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.js +16 -16
- package/dist/cjs/CodeModal/CodeModal.d.ts +8 -2
- package/dist/cjs/CodeModal/CodeModal.js +8 -20
- package/dist/cjs/CodeModal/CodeModal.test.js +23 -4
- 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 +23 -2
- package/dist/cjs/FileDropZone/FileDropZone.js +11 -9
- package/dist/cjs/FileDropZone/FileDropZone.test.js +86 -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 +34 -16
- package/dist/cjs/Message/CodeBlockMessage/ExpandableSectionForSyntaxHighlighter.d.ts +62 -0
- package/dist/cjs/Message/CodeBlockMessage/ExpandableSectionForSyntaxHighlighter.js +139 -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 +24 -8
- package/dist/cjs/Message/Message.js +49 -71
- package/dist/cjs/Message/Message.test.js +112 -82
- 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/index.d.ts +1 -0
- package/dist/cjs/Message/Plugins/index.js +5 -0
- package/dist/cjs/Message/Plugins/rehypeCodeBlockToggle.d.ts +2 -0
- package/dist/cjs/Message/Plugins/rehypeCodeBlockToggle.js +24 -0
- 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 +2 -2
- package/dist/cjs/Message/QuickResponse/QuickResponse.js +7 -9
- 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 +2 -2
- package/dist/cjs/Message/QuickStarts/QuickStartTile.js +7 -43
- 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 +12 -23
- package/dist/cjs/Message/UserFeedback/UserFeedback.test.js +53 -53
- package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.d.ts +2 -2
- package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.js +20 -44
- package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.test.js +81 -91
- package/dist/cjs/Message/index.d.ts +1 -0
- package/dist/cjs/Message/index.js +3 -1
- package/dist/cjs/MessageBar/AttachButton.d.ts +25 -2
- package/dist/cjs/MessageBar/AttachButton.js +10 -20
- package/dist/cjs/MessageBar/AttachButton.test.js +102 -24
- package/dist/cjs/MessageBar/MessageBar.d.ts +31 -3
- package/dist/cjs/MessageBar/MessageBar.js +30 -32
- package/dist/cjs/MessageBar/MessageBar.test.js +122 -108
- package/dist/cjs/MessageBar/MicrophoneButton.d.ts +2 -2
- package/dist/cjs/MessageBar/MicrophoneButton.js +7 -14
- package/dist/cjs/MessageBar/SendButton.d.ts +3 -2
- package/dist/cjs/MessageBar/SendButton.js +3 -11
- package/dist/cjs/MessageBar/SendButton.test.js +15 -15
- package/dist/cjs/MessageBar/StopButton.d.ts +3 -2
- package/dist/cjs/MessageBar/StopButton.js +3 -12
- package/dist/cjs/MessageBar/StopButton.test.js +15 -15
- 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 +170 -45
- package/dist/cjs/MessageBox/MessageBox.test.js +219 -6
- package/dist/cjs/PreviewAttachment/PreviewAttachment.d.ts +12 -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 +39 -18
- package/dist/cjs/ResponseActions/ResponseActions.test.js +120 -41
- package/dist/cjs/Settings/SettingsForm.d.ts +2 -2
- package/dist/cjs/Settings/SettingsForm.js +2 -8
- package/dist/cjs/Settings/SettingsForm.test.js +9 -12
- package/dist/cjs/SourceDetailsMenuItem/SourceDetailsMenuItem.d.ts +2 -2
- package/dist/cjs/SourceDetailsMenuItem/SourceDetailsMenuItem.js +2 -11
- package/dist/cjs/SourcesCard/SourcesCard.d.ts +12 -3
- package/dist/cjs/SourcesCard/SourcesCard.js +17 -42
- package/dist/cjs/SourcesCard/SourcesCard.test.js +70 -60
- package/dist/cjs/TermsOfUse/TermsOfUse.d.ts +3 -3
- package/dist/cjs/TermsOfUse/TermsOfUse.js +4 -16
- package/dist/cjs/TermsOfUse/TermsOfUse.test.js +31 -33
- package/dist/css/main.css +15 -7
- 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 +12 -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 +1 -2
- package/dist/esm/Chatbot/Chatbot.js +4 -6
- package/dist/esm/Chatbot/Chatbot.test.js +6 -6
- 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 +2 -2
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.js +16 -33
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.js +26 -34
- 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 +3 -3
- package/dist/esm/ChatbotFooter/ChatbotFooter.js +2 -12
- package/dist/esm/ChatbotFooter/ChatbotFooter.test.js +4 -4
- 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 +1 -2
- package/dist/esm/ChatbotHeader/ChatbotHeaderCloseButton.js +5 -7
- package/dist/esm/ChatbotHeader/ChatbotHeaderCloseButton.test.js +4 -4
- 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 +2 -2
- package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.js +5 -7
- package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.test.js +4 -4
- package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.d.ts +6 -3
- package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.js +8 -9
- package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.js +9 -8
- package/dist/esm/ChatbotHeader/ChatbotHeaderSelectorDropdown.d.ts +8 -3
- package/dist/esm/ChatbotHeader/ChatbotHeaderSelectorDropdown.js +11 -9
- package/dist/esm/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.js +9 -8
- 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 +2 -2
- package/dist/esm/ChatbotModal/ChatbotModal.js +3 -6
- package/dist/esm/ChatbotModal/ChatbotModal.test.js +2 -14
- 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 +2 -2
- package/dist/esm/ChatbotWelcomePrompt/ChatbotWelcomePrompt.js +6 -17
- package/dist/esm/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.js +8 -8
- package/dist/esm/CodeModal/CodeModal.d.ts +8 -2
- package/dist/esm/CodeModal/CodeModal.js +8 -20
- package/dist/esm/CodeModal/CodeModal.test.js +22 -3
- 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 +23 -2
- package/dist/esm/FileDropZone/FileDropZone.js +11 -6
- package/dist/esm/FileDropZone/FileDropZone.test.js +84 -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 +35 -17
- package/dist/esm/Message/CodeBlockMessage/ExpandableSectionForSyntaxHighlighter.d.ts +62 -0
- package/dist/esm/Message/CodeBlockMessage/ExpandableSectionForSyntaxHighlighter.js +133 -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 +24 -8
- package/dist/esm/Message/Message.js +49 -71
- package/dist/esm/Message/Message.test.js +112 -82
- 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/index.d.ts +1 -0
- package/dist/esm/Message/Plugins/index.js +1 -0
- package/dist/esm/Message/Plugins/rehypeCodeBlockToggle.d.ts +2 -0
- package/dist/esm/Message/Plugins/rehypeCodeBlockToggle.js +20 -0
- 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 +2 -2
- package/dist/esm/Message/QuickResponse/QuickResponse.js +7 -6
- 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 +2 -2
- package/dist/esm/Message/QuickStarts/QuickStartTile.js +7 -20
- 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 +12 -23
- package/dist/esm/Message/UserFeedback/UserFeedback.test.js +21 -21
- package/dist/esm/Message/UserFeedback/UserFeedbackComplete.d.ts +2 -2
- package/dist/esm/Message/UserFeedback/UserFeedbackComplete.js +20 -44
- package/dist/esm/Message/UserFeedback/UserFeedbackComplete.test.js +26 -36
- package/dist/esm/Message/index.d.ts +1 -0
- package/dist/esm/Message/index.js +1 -0
- package/dist/esm/MessageBar/AttachButton.d.ts +25 -2
- package/dist/esm/MessageBar/AttachButton.js +10 -17
- package/dist/esm/MessageBar/AttachButton.test.js +95 -17
- package/dist/esm/MessageBar/MessageBar.d.ts +31 -3
- package/dist/esm/MessageBar/MessageBar.js +28 -30
- package/dist/esm/MessageBar/MessageBar.test.js +87 -73
- package/dist/esm/MessageBar/MicrophoneButton.d.ts +2 -2
- package/dist/esm/MessageBar/MicrophoneButton.js +7 -11
- package/dist/esm/MessageBar/SendButton.d.ts +3 -2
- package/dist/esm/MessageBar/SendButton.js +3 -8
- package/dist/esm/MessageBar/SendButton.test.js +9 -9
- package/dist/esm/MessageBar/StopButton.d.ts +3 -2
- package/dist/esm/MessageBar/StopButton.js +3 -9
- package/dist/esm/MessageBar/StopButton.test.js +9 -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 +170 -45
- package/dist/esm/MessageBox/MessageBox.test.js +220 -7
- package/dist/esm/PreviewAttachment/PreviewAttachment.d.ts +12 -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 +40 -19
- package/dist/esm/ResponseActions/ResponseActions.test.js +95 -16
- package/dist/esm/Settings/SettingsForm.d.ts +2 -2
- package/dist/esm/Settings/SettingsForm.js +2 -5
- package/dist/esm/Settings/SettingsForm.test.js +6 -6
- package/dist/esm/SourceDetailsMenuItem/SourceDetailsMenuItem.d.ts +2 -2
- package/dist/esm/SourceDetailsMenuItem/SourceDetailsMenuItem.js +2 -8
- package/dist/esm/SourcesCard/SourcesCard.d.ts +12 -3
- package/dist/esm/SourcesCard/SourcesCard.js +17 -39
- package/dist/esm/SourcesCard/SourcesCard.test.js +29 -19
- package/dist/esm/TermsOfUse/TermsOfUse.d.ts +3 -3
- package/dist/esm/TermsOfUse/TermsOfUse.js +4 -16
- 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 +5 -5
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/AttachmentError.tsx +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/BotMessage.tsx +24 -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/MessageWithClickedResponseActions.tsx +25 -0
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithCustomResponseActions.tsx +3 -12
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithFeedback.tsx +4 -4
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithFeedbackTimeout.tsx +3 -3
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithQuickResponses.tsx +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithQuickStart.tsx +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithResponseActions.tsx +3 -3
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithSources.tsx +3 -3
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/Messages.md +19 -0
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/PreviewAttachment.tsx +5 -5
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/UserMessage.tsx +25 -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 +10 -10
- 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 +6 -6
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderDrawerWithSelection.tsx +7 -7
- 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 +16 -23
- 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 +82 -39
- package/patternfly-docs/content/extensions/chatbot/examples/UI/UI.md +3 -0
- package/patternfly-docs/content/extensions/chatbot/examples/demos/AttachmentDemos.md +37 -0
- package/patternfly-docs/content/extensions/chatbot/examples/demos/Chatbot.md +1 -0
- package/patternfly-docs/content/extensions/chatbot/examples/demos/Chatbot.tsx +19 -25
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotAttachment.tsx +42 -15
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotAttachmentMenu.tsx +15 -14
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotCompact.tsx +19 -25
- 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 +25 -7
- package/src/Chatbot/Chatbot.test.tsx +0 -1
- package/src/Chatbot/Chatbot.tsx +5 -3
- 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.test.tsx +3 -3
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.tsx +8 -6
- package/src/ChatbotConversationHistoryNav/EmptyState.tsx +2 -2
- package/src/ChatbotConversationHistoryNav/LoadingState.tsx +2 -2
- package/src/ChatbotFooter/ChatbotFooter.test.tsx +0 -1
- package/src/ChatbotFooter/ChatbotFooter.tsx +3 -3
- package/src/ChatbotFooter/ChatbotFooternote.test.tsx +0 -1
- package/src/ChatbotFooter/ChatbotFootnote.tsx +6 -4
- package/src/ChatbotHeader/ChatbotHeader.test.tsx +0 -1
- package/src/ChatbotHeader/ChatbotHeader.tsx +3 -6
- package/src/ChatbotHeader/ChatbotHeaderActions.test.tsx +0 -1
- package/src/ChatbotHeader/ChatbotHeaderActions.tsx +2 -2
- package/src/ChatbotHeader/ChatbotHeaderCloseButton.test.tsx +0 -1
- package/src/ChatbotHeader/ChatbotHeaderCloseButton.tsx +5 -4
- package/src/ChatbotHeader/ChatbotHeaderMain.test.tsx +0 -1
- package/src/ChatbotHeader/ChatbotHeaderMain.tsx +2 -2
- package/src/ChatbotHeader/ChatbotHeaderMenu.test.tsx +0 -1
- package/src/ChatbotHeader/ChatbotHeaderMenu.tsx +7 -7
- package/src/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.tsx +9 -1
- package/src/ChatbotHeader/ChatbotHeaderOptionsDropdown.tsx +12 -5
- package/src/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.tsx +9 -1
- package/src/ChatbotHeader/ChatbotHeaderSelectorDropdown.tsx +26 -6
- package/src/ChatbotHeader/ChatbotHeaderTitle.test.tsx +0 -1
- package/src/ChatbotHeader/ChatbotHeaderTitle.tsx +2 -2
- package/src/ChatbotModal/ChatbotModal.test.tsx +0 -1
- package/src/ChatbotModal/ChatbotModal.tsx +2 -2
- package/src/ChatbotPopover/ChatbotPopover.tsx +3 -3
- package/src/ChatbotToggle/ChatbotToggle.test.tsx +0 -1
- package/src/ChatbotToggle/ChatbotToggle.tsx +5 -3
- package/src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.tsx +0 -1
- package/src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.tsx +2 -2
- package/src/CodeModal/CodeModal.test.tsx +29 -2
- package/src/CodeModal/CodeModal.tsx +18 -8
- 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 +1 -1
- package/src/FileDetailsLabel/FileDetailsLabel.test.tsx +0 -1
- package/src/FileDetailsLabel/FileDetailsLabel.tsx +1 -1
- package/src/FileDropZone/FileDropZone.test.tsx +112 -1
- package/src/FileDropZone/FileDropZone.tsx +44 -4
- 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 +126 -18
- package/src/Message/CodeBlockMessage/ExpandableSectionForSyntaxHighlighter.tsx +223 -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.test.tsx +49 -6
- package/src/Message/Message.tsx +31 -14
- package/src/Message/MessageInput.tsx +5 -5
- package/src/Message/MessageLoading.tsx +0 -2
- package/src/Message/Plugins/index.ts +1 -0
- package/src/Message/Plugins/rehypeCodeBlockToggle.ts +24 -0
- package/src/Message/Plugins/rehypeMoveImagesOutOfParagraphs.ts +53 -0
- package/src/Message/QuickResponse/QuickResponse.tsx +4 -3
- package/src/Message/QuickStarts/FallbackImg.tsx +4 -3
- package/src/Message/QuickStarts/QuickStartTile.tsx +3 -3
- 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 +2 -5
- package/src/Message/TextMessage/TextMessage.tsx +1 -2
- package/src/Message/UserFeedback/CloseButton.tsx +2 -2
- package/src/Message/UserFeedback/UserFeedback.test.tsx +0 -1
- package/src/Message/UserFeedback/UserFeedback.tsx +8 -6
- package/src/Message/UserFeedback/UserFeedbackComplete.test.tsx +0 -1
- package/src/Message/UserFeedback/UserFeedbackComplete.tsx +16 -14
- package/src/Message/index.ts +1 -0
- package/src/MessageBar/AttachButton.test.tsx +127 -8
- package/src/MessageBar/AttachButton.tsx +49 -6
- package/src/MessageBar/MessageBar.test.tsx +81 -30
- package/src/MessageBar/MessageBar.tsx +85 -19
- package/src/MessageBar/MicrophoneButton.tsx +10 -7
- package/src/MessageBar/SendButton.test.tsx +5 -6
- package/src/MessageBar/SendButton.tsx +4 -3
- package/src/MessageBar/StopButton.test.tsx +5 -6
- package/src/MessageBar/StopButton.tsx +4 -3
- package/src/MessageBox/JumpButton.test.tsx +4 -5
- package/src/MessageBox/JumpButton.tsx +3 -3
- package/src/MessageBox/MessageBox.test.tsx +295 -5
- package/src/MessageBox/MessageBox.tsx +301 -84
- package/src/PreviewAttachment/PreviewAttachment.test.tsx +44 -2
- package/src/PreviewAttachment/PreviewAttachment.tsx +24 -6
- package/src/ResponseActions/ResponseActionButton.test.tsx +0 -1
- package/src/ResponseActions/ResponseActionButton.tsx +6 -5
- package/src/ResponseActions/ResponseActions.test.tsx +121 -4
- package/src/ResponseActions/ResponseActions.tsx +71 -12
- package/src/Settings/SettingsForm.test.tsx +0 -1
- package/src/Settings/SettingsForm.tsx +2 -7
- package/src/SourceDetailsMenuItem/SourceDetailsMenuItem.tsx +2 -2
- package/src/SourcesCard/SourcesCard.test.tsx +14 -1
- package/src/SourcesCard/SourcesCard.tsx +19 -7
- package/src/TermsOfUse/TermsOfUse.test.tsx +0 -1
- package/src/TermsOfUse/TermsOfUse.tsx +6 -5
- package/tsconfig.cjs.json +0 -1
- package/tsconfig.json +3 -3
|
@@ -1,22 +1,235 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
13
|
};
|
|
5
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
15
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
const react_1 = require("react");
|
|
7
17
|
const react_2 = require("@testing-library/react");
|
|
8
18
|
const MessageBox_1 = require("./MessageBox");
|
|
19
|
+
const user_event_1 = __importDefault(require("@testing-library/user-event"));
|
|
9
20
|
describe('MessageBox', () => {
|
|
21
|
+
beforeEach(() => {
|
|
22
|
+
jest.spyOn(window, 'requestAnimationFrame').mockImplementation((cb) => {
|
|
23
|
+
cb(0); // Immediately call the callback
|
|
24
|
+
return 0;
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
afterEach(() => {
|
|
28
|
+
jest.restoreAllMocks();
|
|
29
|
+
});
|
|
10
30
|
it('should render Message box', () => {
|
|
11
|
-
(0, react_2.render)(
|
|
12
|
-
react_1.default.createElement(react_1.default.Fragment, null, "Chatbot Messages")));
|
|
31
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(MessageBox_1.MessageBox, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Chatbot Messages" }) }));
|
|
13
32
|
expect(react_2.screen.getByText('Chatbot Messages')).toBeTruthy();
|
|
14
33
|
});
|
|
15
34
|
it('should assign ref to Message box', () => {
|
|
16
|
-
|
|
17
|
-
(0,
|
|
18
|
-
|
|
35
|
+
var _a, _b, _c, _d;
|
|
36
|
+
const ref = (0, react_1.createRef)();
|
|
37
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(MessageBox_1.MessageBox, { "data-testid": "message-box", ref: ref, children: (0, jsx_runtime_1.jsx)("div", { children: "Test message content" }) }));
|
|
38
|
+
react_2.screen.getByText('Test message content');
|
|
19
39
|
expect(ref.current).not.toBeNull();
|
|
40
|
+
// should contain custom methods exposed by the ref
|
|
41
|
+
expect(typeof ((_a = ref.current) === null || _a === void 0 ? void 0 : _a.isSmartScrollActive)).toBe('function');
|
|
42
|
+
expect(typeof ((_b = ref.current) === null || _b === void 0 ? void 0 : _b.scrollToTop)).toBe('function');
|
|
43
|
+
expect(typeof ((_c = ref.current) === null || _c === void 0 ? void 0 : _c.scrollToBottom)).toBe('function');
|
|
44
|
+
expect((_d = ref.current) === null || _d === void 0 ? void 0 : _d.isSmartScrollActive()).toBe(false);
|
|
20
45
|
expect(ref.current).toBeInstanceOf(HTMLDivElement);
|
|
21
46
|
});
|
|
47
|
+
it('should call onScrollToBottomClick when scroll to bottom button is clicked', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
48
|
+
const spy = jest.fn();
|
|
49
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(MessageBox_1.MessageBox, { onScrollToBottomClick: spy, children: (0, jsx_runtime_1.jsx)("div", { children: "Test message content" }) }));
|
|
50
|
+
// this forces button to show
|
|
51
|
+
const region = react_2.screen.getByRole('region');
|
|
52
|
+
Object.defineProperty(region, 'scrollHeight', { configurable: true, value: 1000 });
|
|
53
|
+
Object.defineProperty(region, 'clientHeight', { configurable: true, value: 500 });
|
|
54
|
+
Object.defineProperty(region, 'scrollTop', { configurable: true, value: 0 });
|
|
55
|
+
(0, react_2.act)(() => {
|
|
56
|
+
region.dispatchEvent(new Event('scroll'));
|
|
57
|
+
});
|
|
58
|
+
yield (0, react_2.waitFor)(() => {
|
|
59
|
+
user_event_1.default.click(react_2.screen.getByRole('button', { name: /Jump bottom/i }));
|
|
60
|
+
expect(spy).toHaveBeenCalled();
|
|
61
|
+
});
|
|
62
|
+
}));
|
|
63
|
+
it('should call onScrollToTopClick when scroll to top button is clicked', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
64
|
+
const spy = jest.fn();
|
|
65
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(MessageBox_1.MessageBox, { onScrollToTopClick: spy, children: (0, jsx_runtime_1.jsx)("div", { children: "Test message content" }) }));
|
|
66
|
+
// this forces button to show
|
|
67
|
+
const region = react_2.screen.getByRole('region');
|
|
68
|
+
Object.defineProperty(region, 'scrollHeight', { configurable: true, value: 1000 });
|
|
69
|
+
Object.defineProperty(region, 'clientHeight', { configurable: true, value: 500 });
|
|
70
|
+
Object.defineProperty(region, 'scrollTop', {
|
|
71
|
+
configurable: true,
|
|
72
|
+
value: 500
|
|
73
|
+
});
|
|
74
|
+
(0, react_2.act)(() => {
|
|
75
|
+
region.dispatchEvent(new Event('scroll'));
|
|
76
|
+
});
|
|
77
|
+
yield (0, react_2.waitFor)(() => {
|
|
78
|
+
user_event_1.default.click(react_2.screen.getByRole('button', { name: /Jump top/i }));
|
|
79
|
+
expect(spy).toHaveBeenCalled();
|
|
80
|
+
});
|
|
81
|
+
}));
|
|
82
|
+
it('should call user defined onWheel, onTouchMove and onTouchEnd handlers', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
83
|
+
const ref = (0, react_1.createRef)();
|
|
84
|
+
const onWheel = jest.fn();
|
|
85
|
+
const onTouchMove = jest.fn();
|
|
86
|
+
const onTouchEnd = jest.fn();
|
|
87
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(MessageBox_1.MessageBox, { ref: ref, enableSmartScroll: true, onWheel: onWheel, onTouchMove: onTouchMove, onTouchEnd: onTouchEnd, children: (0, jsx_runtime_1.jsx)("div", { children: "Test message content" }) }));
|
|
88
|
+
const element = ref.current;
|
|
89
|
+
(0, react_2.act)(() => {
|
|
90
|
+
react_2.fireEvent.wheel(element, { deltaY: 10 });
|
|
91
|
+
react_2.fireEvent.touchMove(element, { touches: [{ clientY: 700 }] });
|
|
92
|
+
react_2.fireEvent.touchEnd(element);
|
|
93
|
+
});
|
|
94
|
+
expect(onWheel).toHaveBeenCalled();
|
|
95
|
+
expect(onTouchMove).toHaveBeenCalled();
|
|
96
|
+
expect(onTouchEnd).toHaveBeenCalled();
|
|
97
|
+
}));
|
|
98
|
+
it('should scroll to the bottom when the method is called ', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
99
|
+
var _a;
|
|
100
|
+
const ref = (0, react_1.createRef)();
|
|
101
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(MessageBox_1.MessageBox, { ref: ref, enableSmartScroll: true, children: (0, jsx_runtime_1.jsx)("div", { children: "Test message content" }) }));
|
|
102
|
+
const element = ref.current;
|
|
103
|
+
const scrollSpy = jest.spyOn(element, 'scrollTo');
|
|
104
|
+
(0, react_2.act)(() => {
|
|
105
|
+
var _a, _b, _c;
|
|
106
|
+
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.scrollToBottom();
|
|
107
|
+
(_b = ref.current) === null || _b === void 0 ? void 0 : _b.scrollToBottom();
|
|
108
|
+
(_c = ref.current) === null || _c === void 0 ? void 0 : _c.scrollToBottom();
|
|
109
|
+
});
|
|
110
|
+
expect(scrollSpy).toHaveBeenCalledWith({ top: element.scrollHeight, behavior: 'smooth' });
|
|
111
|
+
expect((_a = ref.current) === null || _a === void 0 ? void 0 : _a.isSmartScrollActive()).toBe(true);
|
|
112
|
+
}));
|
|
113
|
+
it('should scroll to the top when the method is called ', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
114
|
+
var _a;
|
|
115
|
+
const ref = (0, react_1.createRef)();
|
|
116
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(MessageBox_1.MessageBox, { ref: ref, enableSmartScroll: true, children: (0, jsx_runtime_1.jsx)("div", { children: "Test message content" }) }));
|
|
117
|
+
const element = ref.current;
|
|
118
|
+
const scrollSpy = jest.spyOn(element, 'scrollTo');
|
|
119
|
+
(0, react_2.act)(() => {
|
|
120
|
+
var _a;
|
|
121
|
+
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.scrollToTop();
|
|
122
|
+
});
|
|
123
|
+
expect(scrollSpy).toHaveBeenCalledWith({ top: 0, behavior: 'smooth' });
|
|
124
|
+
expect((_a = ref.current) === null || _a === void 0 ? void 0 : _a.isSmartScrollActive()).toBe(false);
|
|
125
|
+
}));
|
|
126
|
+
it('should pause automatic scrolling when user scrolls up ', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
127
|
+
var _a, _b;
|
|
128
|
+
const ref = (0, react_1.createRef)();
|
|
129
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(MessageBox_1.MessageBox, { ref: ref, enableSmartScroll: true, children: (0, jsx_runtime_1.jsx)("div", { children: "Test message content" }) }));
|
|
130
|
+
expect((_a = ref.current) === null || _a === void 0 ? void 0 : _a.isSmartScrollActive()).toBe(true);
|
|
131
|
+
const element = ref.current;
|
|
132
|
+
// Manually set scrollHeight and clientHeight for calculations
|
|
133
|
+
Object.defineProperty(element, 'scrollHeight', { configurable: true, value: 1000 });
|
|
134
|
+
Object.defineProperty(element, 'clientHeight', { configurable: true, value: 300 });
|
|
135
|
+
// Simulate scroll up by changing scrollTop
|
|
136
|
+
element.scrollTop = 200;
|
|
137
|
+
const scrollEvent = new Event('scroll', { bubbles: true });
|
|
138
|
+
(0, react_2.act)(() => {
|
|
139
|
+
element.dispatchEvent(scrollEvent);
|
|
140
|
+
});
|
|
141
|
+
expect((_b = ref.current) === null || _b === void 0 ? void 0 : _b.isSmartScrollActive()).toBe(false);
|
|
142
|
+
}));
|
|
143
|
+
it('should resume automatic scrolling when user scrolls down to the bottom using scroll event', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
144
|
+
var _a, _b;
|
|
145
|
+
jest.useFakeTimers();
|
|
146
|
+
const ref = (0, react_1.createRef)();
|
|
147
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(MessageBox_1.MessageBox, { ref: ref, enableSmartScroll: true, children: (0, jsx_runtime_1.jsx)("div", { children: "Test message content" }) }));
|
|
148
|
+
const element = ref.current;
|
|
149
|
+
// Manually set scrollHeight and clientHeight for calculations
|
|
150
|
+
Object.defineProperty(element, 'scrollHeight', { configurable: true, value: 1000 });
|
|
151
|
+
Object.defineProperty(element, 'clientHeight', { configurable: true, value: 300 });
|
|
152
|
+
// Simulate scroll up by changing scrollTop
|
|
153
|
+
element.scrollTop = 100;
|
|
154
|
+
const scrollEvent = new Event('scroll', { bubbles: true });
|
|
155
|
+
(0, react_2.act)(() => {
|
|
156
|
+
element.dispatchEvent(scrollEvent);
|
|
157
|
+
});
|
|
158
|
+
expect((_a = ref.current) === null || _a === void 0 ? void 0 : _a.isSmartScrollActive()).toBe(false);
|
|
159
|
+
(0, react_2.act)(() => {
|
|
160
|
+
// Simulate scroll down by changing scrollTop
|
|
161
|
+
element.scrollTop = 650; // scrollHeight - scrollTop - clientHeight - DELTA_DOWN (50) = 0
|
|
162
|
+
const scrollEvent = new Event('scroll', { bubbles: true });
|
|
163
|
+
element.dispatchEvent(scrollEvent);
|
|
164
|
+
jest.advanceTimersByTime(250);
|
|
165
|
+
});
|
|
166
|
+
expect((_b = ref.current) === null || _b === void 0 ? void 0 : _b.isSmartScrollActive()).toBe(true);
|
|
167
|
+
jest.useRealTimers();
|
|
168
|
+
}));
|
|
169
|
+
it('should resume automatic scrolling when scrollToBottom method is used', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
170
|
+
var _a, _b;
|
|
171
|
+
const ref = (0, react_1.createRef)();
|
|
172
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(MessageBox_1.MessageBox, { ref: ref, enableSmartScroll: true, children: (0, jsx_runtime_1.jsx)("div", { children: "Test message content" }) }));
|
|
173
|
+
const element = ref.current;
|
|
174
|
+
// Manually set scrollHeight and clientHeight for calculations
|
|
175
|
+
Object.defineProperty(element, 'scrollHeight', { configurable: true, value: 1000 });
|
|
176
|
+
Object.defineProperty(element, 'clientHeight', { configurable: true, value: 300 });
|
|
177
|
+
// Simulate scroll up by changing scrollTop
|
|
178
|
+
element.scrollTop = 100;
|
|
179
|
+
const scrollEvent = new Event('scroll', { bubbles: true });
|
|
180
|
+
(0, react_2.act)(() => {
|
|
181
|
+
element.dispatchEvent(scrollEvent);
|
|
182
|
+
});
|
|
183
|
+
expect((_a = ref.current) === null || _a === void 0 ? void 0 : _a.isSmartScrollActive()).toBe(false);
|
|
184
|
+
(0, react_2.act)(() => {
|
|
185
|
+
var _a;
|
|
186
|
+
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.scrollToBottom({ resumeSmartScroll: true, behavior: 'auto' }); // resumes auto scroll and scrolls to bottom.
|
|
187
|
+
});
|
|
188
|
+
expect((_b = ref.current) === null || _b === void 0 ? void 0 : _b.isSmartScrollActive()).toBe(true);
|
|
189
|
+
}));
|
|
190
|
+
it('should resume automatic scrolling when mouse wheel event is used', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
191
|
+
var _a, _b;
|
|
192
|
+
const ref = (0, react_1.createRef)();
|
|
193
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(MessageBox_1.MessageBox, { ref: ref, enableSmartScroll: true, children: (0, jsx_runtime_1.jsx)("div", { children: "Test message content" }) }));
|
|
194
|
+
const element = ref.current;
|
|
195
|
+
// Manually set scrollHeight and clientHeight for calculations
|
|
196
|
+
Object.defineProperty(element, 'scrollHeight', { configurable: true, value: 1000 });
|
|
197
|
+
Object.defineProperty(element, 'clientHeight', { configurable: true, value: 300 });
|
|
198
|
+
Object.defineProperty(element, 'scrollTop', { configurable: true, value: 350 });
|
|
199
|
+
const scrollEvent = new Event('scroll', { bubbles: true });
|
|
200
|
+
(0, react_2.act)(() => {
|
|
201
|
+
element.dispatchEvent(scrollEvent);
|
|
202
|
+
});
|
|
203
|
+
expect((_a = ref.current) === null || _a === void 0 ? void 0 : _a.isSmartScrollActive()).toBe(false);
|
|
204
|
+
// Simulate mouse wheel event
|
|
205
|
+
(0, react_2.act)(() => {
|
|
206
|
+
Object.defineProperty(element, 'scrollTop', { configurable: true, value: 650 });
|
|
207
|
+
react_2.fireEvent.wheel(element, { deltaY: 10 });
|
|
208
|
+
});
|
|
209
|
+
expect((_b = ref.current) === null || _b === void 0 ? void 0 : _b.isSmartScrollActive()).toBe(true);
|
|
210
|
+
}));
|
|
211
|
+
it('should resume automatic scrolling when user swipes up in touch screen', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
212
|
+
var _a, _b;
|
|
213
|
+
const ref = (0, react_1.createRef)();
|
|
214
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(MessageBox_1.MessageBox, { ref: ref, enableSmartScroll: true, children: (0, jsx_runtime_1.jsx)("div", { children: "Test message content" }) }));
|
|
215
|
+
const element = ref.current;
|
|
216
|
+
// Manually set scrollHeight and clientHeight for calculations
|
|
217
|
+
Object.defineProperty(element, 'scrollHeight', { configurable: true, value: 1000 });
|
|
218
|
+
Object.defineProperty(element, 'clientHeight', { configurable: true, value: 300 });
|
|
219
|
+
Object.defineProperty(element, 'scrollTop', { configurable: true, value: 350 });
|
|
220
|
+
const scrollEvent = new Event('scroll', { bubbles: true });
|
|
221
|
+
(0, react_2.act)(() => {
|
|
222
|
+
element.dispatchEvent(scrollEvent);
|
|
223
|
+
});
|
|
224
|
+
expect((_a = ref.current) === null || _a === void 0 ? void 0 : _a.isSmartScrollActive()).toBe(false);
|
|
225
|
+
// Simulate touch event - swipe up
|
|
226
|
+
(0, react_2.act)(() => {
|
|
227
|
+
Object.defineProperty(element, 'scrollTop', { configurable: true, value: 650 });
|
|
228
|
+
react_2.fireEvent.touchStart(element, { touches: [{ clientY: 700 }] });
|
|
229
|
+
react_2.fireEvent.touchMove(element, { touches: [{ clientY: 700 }] });
|
|
230
|
+
react_2.fireEvent.touchMove(element, { touches: [{ clientY: 600 }] });
|
|
231
|
+
react_2.fireEvent.touchEnd(element);
|
|
232
|
+
});
|
|
233
|
+
expect((_b = ref.current) === null || _b === void 0 ? void 0 : _b.isSmartScrollActive()).toBe(true);
|
|
234
|
+
}));
|
|
22
235
|
});
|
|
@@ -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 */
|
|
@@ -19,6 +19,16 @@ export interface PreviewAttachmentProps {
|
|
|
19
19
|
displayMode?: ChatbotDisplayMode;
|
|
20
20
|
/** Sets modal to compact styling. */
|
|
21
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;
|
|
22
32
|
}
|
|
23
|
-
export declare const PreviewAttachment:
|
|
33
|
+
export declare const PreviewAttachment: FunctionComponent<PreviewAttachmentProps>;
|
|
24
34
|
export default PreviewAttachment;
|
|
@@ -4,13 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.PreviewAttachment = void 0;
|
|
7
|
-
|
|
8
|
-
// Preview Attachment - Chatbot Code Snippet Viewer
|
|
9
|
-
// ============================================================================
|
|
10
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
11
8
|
const CodeModal_1 = __importDefault(require("../CodeModal"));
|
|
12
9
|
const Chatbot_1 = require("../Chatbot");
|
|
13
|
-
const PreviewAttachment = ({ fileName, code, handleModalToggle, isModalOpen, onDismiss = undefined, onEdit, title = 'Preview attachment', displayMode = Chatbot_1.ChatbotDisplayMode.default, isCompact }) => {
|
|
10
|
+
const PreviewAttachment = ({ fileName, code, handleModalToggle, isModalOpen, onDismiss = undefined, onEdit, title = 'Preview attachment', primaryActionButtonText = 'Edit', secondaryActionButtonText = 'Dismiss', displayMode = Chatbot_1.ChatbotDisplayMode.default, modalHeaderClassName, modalBodyClassName, modalFooterClassName, isCompact }) => {
|
|
14
11
|
const handleEdit = (_event) => {
|
|
15
12
|
handleModalToggle(_event);
|
|
16
13
|
onEdit(_event);
|
|
@@ -19,7 +16,7 @@ const PreviewAttachment = ({ fileName, code, handleModalToggle, isModalOpen, onD
|
|
|
19
16
|
handleModalToggle(_event);
|
|
20
17
|
onDismiss && onDismiss(_event);
|
|
21
18
|
};
|
|
22
|
-
return (
|
|
19
|
+
return ((0, jsx_runtime_1.jsx)(CodeModal_1.default, { 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 }));
|
|
23
20
|
};
|
|
24
21
|
exports.PreviewAttachment = PreviewAttachment;
|
|
25
22
|
exports.default = exports.PreviewAttachment;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -1,28 +1,50 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
4
10
|
};
|
|
5
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
7
|
-
const
|
|
12
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
13
|
+
const react_1 = require("@testing-library/react");
|
|
14
|
+
require("@testing-library/jest-dom");
|
|
8
15
|
const PreviewAttachment_1 = require("./PreviewAttachment");
|
|
9
16
|
describe('PreviewAttachment', () => {
|
|
10
17
|
it('should render PreviewAttachment', () => {
|
|
11
|
-
(0,
|
|
12
|
-
expect(
|
|
13
|
-
expect(
|
|
14
|
-
expect(
|
|
18
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(PreviewAttachment_1.PreviewAttachment, { code: "Hello world", fileName: "greetings.txt", isModalOpen: true, onEdit: jest.fn(), handleModalToggle: jest.fn() }));
|
|
19
|
+
expect(react_1.screen.getByText('Preview attachment')).toBeTruthy();
|
|
20
|
+
expect(react_1.screen.getByText('greetings')).toBeTruthy();
|
|
21
|
+
expect(react_1.screen.getAllByText('TEXT')).toBeTruthy();
|
|
15
22
|
});
|
|
16
23
|
it('should call onEdit handler when edit button is pressed', () => {
|
|
17
24
|
const onEdit = jest.fn();
|
|
18
|
-
(0,
|
|
19
|
-
|
|
25
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(PreviewAttachment_1.PreviewAttachment, { code: "Hello world", fileName: "greetings.txt", isModalOpen: true, onEdit: onEdit, handleModalToggle: jest.fn() }));
|
|
26
|
+
react_1.fireEvent.click(react_1.screen.getByText('Edit'));
|
|
20
27
|
expect(onEdit).toHaveBeenCalled();
|
|
21
28
|
});
|
|
22
29
|
it('should call onDismiss handler when dismiss button is pressed', () => {
|
|
23
30
|
const onDismiss = jest.fn();
|
|
24
|
-
(0,
|
|
25
|
-
|
|
31
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(PreviewAttachment_1.PreviewAttachment, { code: "Hello world", fileName: "greetings.txt", isModalOpen: true, onEdit: jest.fn(), handleModalToggle: onDismiss }));
|
|
32
|
+
react_1.fireEvent.click(react_1.screen.getByText('Dismiss'));
|
|
26
33
|
expect(onDismiss).toHaveBeenCalled();
|
|
27
34
|
});
|
|
35
|
+
it('should render custom button text for footer actions buttons', () => {
|
|
36
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(PreviewAttachment_1.PreviewAttachment, { code: "Hello world", fileName: "greetings.txt", isModalOpen: true, onEdit: jest.fn(), handleModalToggle: jest.fn(), primaryActionButtonText: "Edit", secondaryActionButtonText: "Close" }));
|
|
37
|
+
react_1.screen.getByText('Edit');
|
|
38
|
+
react_1.screen.getByText('Close');
|
|
39
|
+
});
|
|
40
|
+
it('should render PreviewAttachment with custom classNames', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
41
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(PreviewAttachment_1.PreviewAttachment, { code: "Hello world", fileName: "greetings.txt", isModalOpen: true, onEdit: jest.fn(), handleModalToggle: jest.fn(), primaryActionButtonText: "Edit", secondaryActionButtonText: "Close", modalHeaderClassName: "custom-header-class", modalBodyClassName: "custom-body-class", modalFooterClassName: "custom-footer-class" }));
|
|
42
|
+
const modal = react_1.screen.getByRole('dialog');
|
|
43
|
+
const modalHeader = (0, react_1.within)(modal).getByRole('banner');
|
|
44
|
+
expect(modalHeader).toHaveClass('custom-header-class');
|
|
45
|
+
const modalBody = modal.querySelector('#code-modal-body');
|
|
46
|
+
expect(modalBody).toHaveClass('custom-body-class');
|
|
47
|
+
const modalfooter = (0, react_1.within)(modal).getByRole('contentinfo');
|
|
48
|
+
expect(modalfooter).toHaveClass('custom-footer-class');
|
|
49
|
+
}));
|
|
28
50
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { TooltipProps } from '@patternfly/react-core';
|
|
3
|
-
export interface ResponseActionButtonProps {
|
|
1
|
+
import type { FunctionComponent, MouseEvent } from 'react';
|
|
2
|
+
import { ButtonProps, TooltipProps } from '@patternfly/react-core';
|
|
3
|
+
export interface ResponseActionButtonProps extends ButtonProps {
|
|
4
4
|
/** Aria-label for the button. Defaults to the value of the tooltipContent if none provided */
|
|
5
5
|
ariaLabel?: string;
|
|
6
6
|
/** Aria-label for the button, shown when the button is clicked. Defaults to the value of ariaLabel or tooltipContent if not provided. */
|
|
@@ -24,6 +24,6 @@ export interface ResponseActionButtonProps {
|
|
|
24
24
|
/** Ref applied to button */
|
|
25
25
|
innerRef?: React.Ref<HTMLButtonElement>;
|
|
26
26
|
}
|
|
27
|
-
export declare const ResponseActionButtonBase:
|
|
28
|
-
declare const ResponseActionButton:
|
|
27
|
+
export declare const ResponseActionButtonBase: FunctionComponent<ResponseActionButtonProps>;
|
|
28
|
+
declare const ResponseActionButton: import("react").ForwardRefExoticComponent<ResponseActionButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
29
29
|
export default ResponseActionButton;
|
|
@@ -10,12 +10,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
}
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
14
|
exports.ResponseActionButtonBase = void 0;
|
|
18
|
-
const
|
|
15
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
const react_1 = require("react");
|
|
19
17
|
const react_core_1 = require("@patternfly/react-core");
|
|
20
18
|
const ResponseActionButtonBase = (_a) => {
|
|
21
19
|
var { ariaLabel, clickedAriaLabel = ariaLabel, className, icon, isDisabled, onClick, tooltipContent, clickedTooltipContent = tooltipContent, tooltipProps, isClicked = false, innerRef } = _a, props = __rest(_a, ["ariaLabel", "clickedAriaLabel", "className", "icon", "isDisabled", "onClick", "tooltipContent", "clickedTooltipContent", "tooltipProps", "isClicked", "innerRef"]);
|
|
@@ -25,11 +23,10 @@ const ResponseActionButtonBase = (_a) => {
|
|
|
25
23
|
}
|
|
26
24
|
return isClicked ? clickedTooltipContent : tooltipContent;
|
|
27
25
|
};
|
|
28
|
-
return (
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)(react_core_1.Tooltip, Object.assign({ id: `pf-chatbot__tooltip-response-action-${tooltipContent}`, content: isClicked ? clickedTooltipContent : tooltipContent, "aria-live": "polite", position: "bottom", entryDelay: (tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.entryDelay) || 0, exitDelay: (tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.exitDelay) || 0, distance: (tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.distance) || 8, animationDuration: (tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.animationDuration) || 0,
|
|
29
27
|
// prevents VO announcements of both aria label and tooltip
|
|
30
|
-
aria: "none" }, tooltipProps),
|
|
31
|
-
react_1.default.createElement(react_core_1.Button, Object.assign({ variant: "plain", className: `pf-chatbot__button--response-action ${isClicked ? 'pf-chatbot__button--response-action-clicked' : ''} ${className !== null && className !== void 0 ? className : ''}`, "aria-label": generateAriaLabel(), icon: react_1.default.createElement(react_core_1.Icon, { isInline: true, size: "lg" }, icon), isDisabled: isDisabled, onClick: onClick, size: "sm", ref: innerRef }, props))));
|
|
28
|
+
aria: "none" }, tooltipProps, { children: (0, jsx_runtime_1.jsx)(react_core_1.Button, Object.assign({ variant: "plain", className: `pf-chatbot__button--response-action ${isClicked ? 'pf-chatbot__button--response-action-clicked' : ''} ${className !== null && className !== void 0 ? className : ''}`, "aria-label": generateAriaLabel(), icon: (0, jsx_runtime_1.jsx)(react_core_1.Icon, { isInline: true, size: "lg", children: icon }), isDisabled: isDisabled, onClick: onClick, size: "sm", ref: innerRef }, props)) })));
|
|
32
29
|
};
|
|
33
30
|
exports.ResponseActionButtonBase = ResponseActionButtonBase;
|
|
34
|
-
const ResponseActionButton = react_1.
|
|
31
|
+
const ResponseActionButton = (0, react_1.forwardRef)((props, ref) => ((0, jsx_runtime_1.jsx)(exports.ResponseActionButtonBase, Object.assign({ innerRef: ref }, props))));
|
|
35
32
|
exports.default = ResponseActionButton;
|
|
@@ -12,43 +12,43 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const
|
|
16
|
-
const
|
|
15
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
const react_1 = require("@testing-library/react");
|
|
17
17
|
require("@testing-library/jest-dom");
|
|
18
18
|
const user_event_1 = __importDefault(require("@testing-library/user-event"));
|
|
19
19
|
const react_icons_1 = require("@patternfly/react-icons");
|
|
20
20
|
const ResponseActionButton_1 = __importDefault(require("./ResponseActionButton"));
|
|
21
21
|
describe('ResponseActionButton', () => {
|
|
22
22
|
it('renders aria-label correctly if not clicked', () => {
|
|
23
|
-
(0,
|
|
24
|
-
expect(
|
|
23
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(ResponseActionButton_1.default, { icon: (0, jsx_runtime_1.jsx)(react_icons_1.DownloadIcon, {}), ariaLabel: "Download", clickedAriaLabel: "Downloaded" }));
|
|
24
|
+
expect(react_1.screen.getByRole('button', { name: 'Download' })).toBeTruthy();
|
|
25
25
|
});
|
|
26
26
|
it('renders aria-label correctly if clicked', () => {
|
|
27
|
-
(0,
|
|
28
|
-
expect(
|
|
27
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(ResponseActionButton_1.default, { icon: (0, jsx_runtime_1.jsx)(react_icons_1.DownloadIcon, {}), ariaLabel: "Download", clickedAriaLabel: "Downloaded", isClicked: true }));
|
|
28
|
+
expect(react_1.screen.getByRole('button', { name: 'Downloaded' })).toBeTruthy();
|
|
29
29
|
});
|
|
30
30
|
it('renders tooltip correctly if not clicked', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
|
-
(0,
|
|
32
|
-
expect(
|
|
31
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(ResponseActionButton_1.default, { icon: (0, jsx_runtime_1.jsx)(react_icons_1.DownloadIcon, {}), tooltipContent: "Download", clickedTooltipContent: "Downloaded" }));
|
|
32
|
+
expect(react_1.screen.getByRole('button', { name: 'Download' })).toBeTruthy();
|
|
33
33
|
// clicking here just triggers the tooltip; in this button, the logic is divorced from whether it is actually clicked
|
|
34
|
-
yield user_event_1.default.click(
|
|
35
|
-
expect(
|
|
34
|
+
yield user_event_1.default.click(react_1.screen.getByRole('button', { name: 'Download' }));
|
|
35
|
+
expect(react_1.screen.getByRole('tooltip', { name: 'Download' })).toBeTruthy();
|
|
36
36
|
}));
|
|
37
37
|
it('renders tooltip correctly if clicked', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
38
|
-
(0,
|
|
39
|
-
expect(
|
|
38
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(ResponseActionButton_1.default, { icon: (0, jsx_runtime_1.jsx)(react_icons_1.DownloadIcon, {}), tooltipContent: "Download", clickedTooltipContent: "Downloaded", isClicked: true }));
|
|
39
|
+
expect(react_1.screen.getByRole('button', { name: 'Downloaded' })).toBeTruthy();
|
|
40
40
|
// clicking here just triggers the tooltip; in this button, the logic is divorced from whether it is actually clicked
|
|
41
|
-
yield user_event_1.default.click(
|
|
42
|
-
expect(
|
|
41
|
+
yield user_event_1.default.click(react_1.screen.getByRole('button', { name: 'Downloaded' }));
|
|
42
|
+
expect(react_1.screen.getByRole('tooltip', { name: 'Downloaded' })).toBeTruthy();
|
|
43
43
|
}));
|
|
44
44
|
it('if clicked variant for tooltip is not supplied, it uses the default', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
45
|
-
(0,
|
|
45
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(ResponseActionButton_1.default, { icon: (0, jsx_runtime_1.jsx)(react_icons_1.DownloadIcon, {}), tooltipContent: "Download", isClicked: true }));
|
|
46
46
|
// clicking here just triggers the tooltip; in this button, the logic is divorced from whether it is actually clicked
|
|
47
|
-
yield user_event_1.default.click(
|
|
48
|
-
expect(
|
|
47
|
+
yield user_event_1.default.click(react_1.screen.getByRole('button', { name: 'Download' }));
|
|
48
|
+
expect(react_1.screen.getByRole('button', { name: 'Download' })).toBeTruthy();
|
|
49
49
|
}));
|
|
50
50
|
it('if clicked variant for aria label is not supplied, it uses the default', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
51
|
-
(0,
|
|
52
|
-
expect(
|
|
51
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(ResponseActionButton_1.default, { icon: (0, jsx_runtime_1.jsx)(react_icons_1.DownloadIcon, {}), ariaLabel: "Download", isClicked: true }));
|
|
52
|
+
expect(react_1.screen.getByRole('button', { name: 'Download' })).toBeTruthy();
|
|
53
53
|
}));
|
|
54
54
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { FunctionComponent, MouseEvent } from 'react';
|
|
2
2
|
import { ButtonProps, TooltipProps } from '@patternfly/react-core';
|
|
3
3
|
export interface ActionProps extends Omit<ButtonProps, 'ref'> {
|
|
4
4
|
/** Aria-label for the button */
|
|
@@ -26,15 +26,19 @@ export interface ActionProps extends Omit<ButtonProps, 'ref'> {
|
|
|
26
26
|
/** Id for content controlled by the button, such as the feedback form */
|
|
27
27
|
'aria-controls'?: string;
|
|
28
28
|
}
|
|
29
|
+
type ExtendedActionProps = ActionProps & {
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
};
|
|
29
32
|
export interface ResponseActionProps {
|
|
30
33
|
/** Props for message actions, such as feedback (positive or negative), copy button, share, and listen */
|
|
31
|
-
actions: Record<string,
|
|
34
|
+
actions: Record<string, ExtendedActionProps | undefined> & {
|
|
32
35
|
positive?: ActionProps;
|
|
33
36
|
negative?: ActionProps;
|
|
34
37
|
copy?: ActionProps;
|
|
35
38
|
share?: ActionProps;
|
|
39
|
+
download?: ActionProps;
|
|
36
40
|
listen?: ActionProps;
|
|
37
41
|
};
|
|
38
42
|
}
|
|
39
|
-
export declare const ResponseActions:
|
|
43
|
+
export declare const ResponseActions: FunctionComponent<ResponseActionProps>;
|
|
40
44
|
export default ResponseActions;
|