@patternfly/chatbot 6.8.0-prerelease.7 → 6.8.0-prerelease.9
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/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.d.ts +46 -5
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.js +125 -16
- package/dist/cjs/CodeModal/CodeModal.js +5 -0
- package/dist/cjs/MarkdownContent/MarkdownContent.d.ts +26 -7
- package/dist/cjs/MarkdownContent/MarkdownContent.js +79 -166
- package/dist/cjs/MarkdownContent/MarkdownRenderer.d.ts +6 -0
- package/dist/cjs/MarkdownContent/MarkdownRenderer.js +187 -0
- package/dist/cjs/Message/Message.d.ts +3 -4
- package/dist/cjs/Message/Message.js +0 -2
- package/dist/cjs/MessageBox/MessageBox.d.ts +2 -0
- package/dist/cjs/MessageBox/MessageBox.js +7 -2
- package/dist/cjs/index.d.ts +0 -8
- package/dist/cjs/index.js +1 -13
- package/dist/css/main.css +77 -10
- package/dist/css/main.css.map +1 -1
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.d.ts +46 -5
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.js +128 -19
- package/dist/esm/CodeModal/CodeModal.js +5 -0
- package/dist/esm/MarkdownContent/MarkdownContent.d.ts +26 -7
- package/dist/esm/MarkdownContent/MarkdownContent.js +52 -165
- package/dist/esm/MarkdownContent/MarkdownRenderer.d.ts +6 -0
- package/dist/esm/MarkdownContent/MarkdownRenderer.js +182 -0
- package/dist/esm/Message/Message.d.ts +3 -4
- package/dist/esm/Message/Message.js +0 -2
- package/dist/esm/MessageBox/MessageBox.d.ts +2 -0
- package/dist/esm/MessageBox/MessageBox.js +7 -2
- package/dist/esm/index.d.ts +0 -8
- package/dist/esm/index.js +0 -8
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/generate-index.js +41 -16
- package/generate-index.test.js +68 -0
- package/monaco-environment.js +45 -0
- package/package.json +20 -2
- package/patternfly-docs/content/extensions/chatbot/chatbot.md +1 -0
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/BotMessage.tsx +1 -1
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithQuickStart.tsx +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/Messages.md +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/UserMessage.tsx +1 -1
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/monitor-sampleapp-quickstart.ts +1 -0
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderDrawerWithExpandableGroups.tsx +104 -0
- package/patternfly-docs/content/extensions/chatbot/examples/UI/UI.md +12 -1
- package/patternfly-docs/content/extensions/chatbot/tree-shaking.md +124 -0
- package/patternfly-docs/monaco-environment.js +45 -0
- package/patternfly-docs/patternfly-docs.css.js +6 -0
- package/src/Chatbot/Chatbot.scss +4 -0
- package/src/ChatbotContent/ChatbotContent.scss +1 -1
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.scss +52 -6
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.tsx +551 -3
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.tsx +350 -49
- package/src/ChatbotFooter/ChatbotFooter.scss +2 -2
- package/src/ChatbotHeader/ChatbotHeader.scss +4 -0
- package/src/ChatbotModal/ChatbotModal.scss +10 -0
- package/src/ChatbotToggle/ChatbotToggle.scss +6 -0
- package/src/CodeModal/CodeModal.tsx +6 -0
- package/src/DeepThinking/DeepThinking.test.tsx +10 -12
- package/src/MarkdownContent/MarkdownContent.test.tsx +52 -5
- package/src/MarkdownContent/MarkdownContent.tsx +77 -220
- package/src/MarkdownContent/MarkdownRenderer.tsx +235 -0
- package/src/Message/Message.scss +5 -0
- package/src/Message/Message.test.tsx +5 -0
- package/src/Message/Message.tsx +3 -5
- package/src/MessageBox/MessageBox.scss +15 -1
- package/src/MessageBox/MessageBox.tsx +23 -2
- package/src/ResponseActions/ResponseActions.test.tsx +42 -48
- package/src/ToolCall/ToolCall.test.tsx +6 -9
- package/src/ToolResponse/ToolResponse.test.tsx +16 -22
- package/src/index.ts +0 -12
- package/src/test-utils/markdownTestUtils.ts +21 -0
- package/tsconfig.json +6 -1
- package/dist/cjs/AttachmentEdit/AttachmentEdit.test.d.ts +0 -1
- package/dist/cjs/AttachmentEdit/AttachmentEdit.test.js +0 -77
- package/dist/cjs/Chatbot/Chatbot.test.d.ts +0 -1
- package/dist/cjs/Chatbot/Chatbot.test.js +0 -32
- package/dist/cjs/ChatbotAlert/ChatbotAlert.test.d.ts +0 -1
- package/dist/cjs/ChatbotAlert/ChatbotAlert.test.js +0 -27
- package/dist/cjs/ChatbotContent/ChatbotContent.test.d.ts +0 -1
- package/dist/cjs/ChatbotContent/ChatbotContent.test.js +0 -22
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.test.d.ts +0 -1
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.test.js +0 -75
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.d.ts +0 -1
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.js +0 -277
- package/dist/cjs/ChatbotFooter/ChatbotFooter.test.d.ts +0 -1
- package/dist/cjs/ChatbotFooter/ChatbotFooter.test.js +0 -27
- package/dist/cjs/ChatbotFooter/ChatbotFooternote.test.d.ts +0 -1
- package/dist/cjs/ChatbotFooter/ChatbotFooternote.test.js +0 -87
- package/dist/cjs/ChatbotHeader/ChatbotHeader.test.d.ts +0 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeader.test.js +0 -18
- package/dist/cjs/ChatbotHeader/ChatbotHeaderActions.test.d.ts +0 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderActions.test.js +0 -18
- package/dist/cjs/ChatbotHeader/ChatbotHeaderCloseButton.test.d.ts +0 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderCloseButton.test.js +0 -22
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMain.test.d.ts +0 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMain.test.js +0 -18
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.test.d.ts +0 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.test.js +0 -22
- package/dist/cjs/ChatbotHeader/ChatbotHeaderNewChatButton.test.d.ts +0 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderNewChatButton.test.js +0 -22
- package/dist/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.d.ts +0 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.js +0 -46
- package/dist/cjs/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.d.ts +0 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.js +0 -44
- package/dist/cjs/ChatbotHeader/ChatbotHeaderTitle.test.d.ts +0 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderTitle.test.js +0 -55
- package/dist/cjs/ChatbotModal/ChatbotModal.test.d.ts +0 -1
- package/dist/cjs/ChatbotModal/ChatbotModal.test.js +0 -16
- package/dist/cjs/ChatbotToggle/ChatbotToggle.test.d.ts +0 -1
- package/dist/cjs/ChatbotToggle/ChatbotToggle.test.js +0 -64
- package/dist/cjs/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.d.ts +0 -1
- package/dist/cjs/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.js +0 -61
- package/dist/cjs/CodeModal/CodeModal.test.d.ts +0 -1
- package/dist/cjs/CodeModal/CodeModal.test.js +0 -34
- package/dist/cjs/Compare/Compare.test.d.ts +0 -1
- package/dist/cjs/Compare/Compare.test.js +0 -18
- package/dist/cjs/DeepThinking/DeepThinking.test.d.ts +0 -1
- package/dist/cjs/DeepThinking/DeepThinking.test.js +0 -146
- package/dist/cjs/FileDetails/FileDetails.test.d.ts +0 -1
- package/dist/cjs/FileDetails/FileDetails.test.js +0 -42
- package/dist/cjs/FileDetailsLabel/FileDetailsLabel.test.d.ts +0 -1
- package/dist/cjs/FileDetailsLabel/FileDetailsLabel.test.js +0 -79
- package/dist/cjs/FileDropZone/FileDropZone.test.d.ts +0 -1
- package/dist/cjs/FileDropZone/FileDropZone.test.js +0 -100
- package/dist/cjs/FilePreview/FilePreview.test.d.ts +0 -1
- package/dist/cjs/FilePreview/FilePreview.test.js +0 -97
- package/dist/cjs/ImagePreview/ImagePreview.test.d.ts +0 -1
- package/dist/cjs/ImagePreview/ImagePreview.test.js +0 -225
- package/dist/cjs/MarkdownContent/MarkdownContent.test.d.ts +0 -1
- package/dist/cjs/MarkdownContent/MarkdownContent.test.js +0 -192
- package/dist/cjs/Message/CodeBlockMessage/CodeBlockMessage.test.d.ts +0 -1
- package/dist/cjs/Message/CodeBlockMessage/CodeBlockMessage.test.js +0 -131
- package/dist/cjs/Message/ErrorMessage/ErrorMessage.test.d.ts +0 -1
- package/dist/cjs/Message/ErrorMessage/ErrorMessage.test.js +0 -30
- package/dist/cjs/Message/Message.test.d.ts +0 -1
- package/dist/cjs/Message/Message.test.js +0 -1128
- package/dist/cjs/Message/MessageAndActions/MessageAndActions.test.d.ts +0 -1
- package/dist/cjs/Message/MessageAndActions/MessageAndActions.test.js +0 -25
- package/dist/cjs/Message/MessageAttachments/MessageAttachmentItem.test.d.ts +0 -1
- package/dist/cjs/Message/MessageAttachments/MessageAttachmentItem.test.js +0 -25
- package/dist/cjs/Message/MessageAttachments/MessageAttachmentsContainer.test.d.ts +0 -1
- package/dist/cjs/Message/MessageAttachments/MessageAttachmentsContainer.test.js +0 -25
- package/dist/cjs/Message/MessageLoading.test.d.ts +0 -1
- package/dist/cjs/Message/MessageLoading.test.js +0 -25
- package/dist/cjs/Message/QuickResponse/QuickResponse.test.d.ts +0 -1
- package/dist/cjs/Message/QuickResponse/QuickResponse.test.js +0 -109
- package/dist/cjs/Message/QuickStarts/QuickStartTileDescription.test.d.ts +0 -1
- package/dist/cjs/Message/QuickStarts/QuickStartTileDescription.test.js +0 -76
- package/dist/cjs/Message/UserFeedback/UserFeedback.test.d.ts +0 -1
- package/dist/cjs/Message/UserFeedback/UserFeedback.test.js +0 -181
- package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.test.d.ts +0 -1
- package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.test.js +0 -243
- package/dist/cjs/MessageBar/AttachButton.test.d.ts +0 -1
- package/dist/cjs/MessageBar/AttachButton.test.js +0 -152
- package/dist/cjs/MessageBar/MessageBar.test.d.ts +0 -1
- package/dist/cjs/MessageBar/MessageBar.test.js +0 -338
- package/dist/cjs/MessageBar/SendButton.test.d.ts +0 -1
- package/dist/cjs/MessageBar/SendButton.test.js +0 -58
- package/dist/cjs/MessageBar/StopButton.test.d.ts +0 -1
- package/dist/cjs/MessageBar/StopButton.test.js +0 -58
- package/dist/cjs/MessageBox/JumpButton.test.d.ts +0 -1
- package/dist/cjs/MessageBox/JumpButton.test.js +0 -39
- package/dist/cjs/MessageBox/MessageBox.test.d.ts +0 -1
- package/dist/cjs/MessageBox/MessageBox.test.js +0 -294
- package/dist/cjs/MessageDivider/MessageDivider.test.d.ts +0 -1
- package/dist/cjs/MessageDivider/MessageDivider.test.js +0 -29
- package/dist/cjs/Onboarding/Onboarding.test.d.ts +0 -1
- package/dist/cjs/Onboarding/Onboarding.test.js +0 -80
- package/dist/cjs/PreviewAttachment/PreviewAttachment.test.d.ts +0 -1
- package/dist/cjs/PreviewAttachment/PreviewAttachment.test.js +0 -50
- package/dist/cjs/ResponseActions/ResponseActionButton.test.d.ts +0 -1
- package/dist/cjs/ResponseActions/ResponseActionButton.test.js +0 -54
- package/dist/cjs/ResponseActions/ResponseActions.test.d.ts +0 -1
- package/dist/cjs/ResponseActions/ResponseActions.test.js +0 -455
- package/dist/cjs/ResponseActions/ResponseActionsGroups.test.d.ts +0 -1
- package/dist/cjs/ResponseActions/ResponseActionsGroups.test.js +0 -25
- package/dist/cjs/Settings/SettingsForm.test.d.ts +0 -1
- package/dist/cjs/Settings/SettingsForm.test.js +0 -35
- package/dist/cjs/SourcesCard/SourcesCard.test.d.ts +0 -1
- package/dist/cjs/SourcesCard/SourcesCard.test.js +0 -39
- package/dist/cjs/SourcesCardBase/SourcesCardBase.test.d.ts +0 -1
- package/dist/cjs/SourcesCardBase/SourcesCardBase.test.js +0 -199
- package/dist/cjs/TermsOfUse/TermsOfUse.test.d.ts +0 -1
- package/dist/cjs/TermsOfUse/TermsOfUse.test.js +0 -77
- package/dist/cjs/ToolCall/ToolCall.test.d.ts +0 -1
- package/dist/cjs/ToolCall/ToolCall.test.js +0 -201
- package/dist/cjs/ToolResponse/ToolResponse.test.d.ts +0 -1
- package/dist/cjs/ToolResponse/ToolResponse.test.js +0 -184
- package/dist/cjs/__mocks__/monaco-editor.d.ts +0 -11
- package/dist/cjs/__mocks__/monaco-editor.js +0 -18
- package/dist/cjs/__mocks__/rehype-external-links.d.ts +0 -2
- package/dist/cjs/__mocks__/rehype-external-links.js +0 -4
- package/dist/cjs/__mocks__/rehype-highlight.d.ts +0 -2
- package/dist/cjs/__mocks__/rehype-highlight.js +0 -4
- package/dist/cjs/__mocks__/rehype-sanitize.d.ts +0 -2
- package/dist/cjs/__mocks__/rehype-sanitize.js +0 -4
- package/dist/cjs/__mocks__/rehype-unwrap-images.d.ts +0 -2
- package/dist/cjs/__mocks__/rehype-unwrap-images.js +0 -4
- package/dist/esm/AttachmentEdit/AttachmentEdit.test.d.ts +0 -1
- package/dist/esm/AttachmentEdit/AttachmentEdit.test.js +0 -72
- package/dist/esm/Chatbot/Chatbot.test.d.ts +0 -1
- package/dist/esm/Chatbot/Chatbot.test.js +0 -27
- package/dist/esm/ChatbotAlert/ChatbotAlert.test.d.ts +0 -1
- package/dist/esm/ChatbotAlert/ChatbotAlert.test.js +0 -22
- package/dist/esm/ChatbotContent/ChatbotContent.test.d.ts +0 -1
- package/dist/esm/ChatbotContent/ChatbotContent.test.js +0 -17
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.test.d.ts +0 -1
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.test.js +0 -70
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.d.ts +0 -1
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.js +0 -272
- package/dist/esm/ChatbotFooter/ChatbotFooter.test.d.ts +0 -1
- package/dist/esm/ChatbotFooter/ChatbotFooter.test.js +0 -22
- package/dist/esm/ChatbotFooter/ChatbotFooternote.test.d.ts +0 -1
- package/dist/esm/ChatbotFooter/ChatbotFooternote.test.js +0 -82
- package/dist/esm/ChatbotHeader/ChatbotHeader.test.d.ts +0 -1
- package/dist/esm/ChatbotHeader/ChatbotHeader.test.js +0 -13
- package/dist/esm/ChatbotHeader/ChatbotHeaderActions.test.d.ts +0 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderActions.test.js +0 -13
- package/dist/esm/ChatbotHeader/ChatbotHeaderCloseButton.test.d.ts +0 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderCloseButton.test.js +0 -20
- package/dist/esm/ChatbotHeader/ChatbotHeaderMain.test.d.ts +0 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderMain.test.js +0 -13
- package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.test.d.ts +0 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.test.js +0 -20
- package/dist/esm/ChatbotHeader/ChatbotHeaderNewChatButton.test.d.ts +0 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderNewChatButton.test.js +0 -20
- package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.d.ts +0 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.js +0 -44
- package/dist/esm/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.d.ts +0 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.js +0 -42
- package/dist/esm/ChatbotHeader/ChatbotHeaderTitle.test.d.ts +0 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderTitle.test.js +0 -50
- package/dist/esm/ChatbotModal/ChatbotModal.test.d.ts +0 -1
- package/dist/esm/ChatbotModal/ChatbotModal.test.js +0 -11
- package/dist/esm/ChatbotToggle/ChatbotToggle.test.d.ts +0 -1
- package/dist/esm/ChatbotToggle/ChatbotToggle.test.js +0 -59
- package/dist/esm/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.d.ts +0 -1
- package/dist/esm/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.js +0 -56
- package/dist/esm/CodeModal/CodeModal.test.d.ts +0 -1
- package/dist/esm/CodeModal/CodeModal.test.js +0 -29
- package/dist/esm/Compare/Compare.test.d.ts +0 -1
- package/dist/esm/Compare/Compare.test.js +0 -13
- package/dist/esm/DeepThinking/DeepThinking.test.d.ts +0 -1
- package/dist/esm/DeepThinking/DeepThinking.test.js +0 -141
- package/dist/esm/FileDetails/FileDetails.test.d.ts +0 -1
- package/dist/esm/FileDetails/FileDetails.test.js +0 -37
- package/dist/esm/FileDetailsLabel/FileDetailsLabel.test.d.ts +0 -1
- package/dist/esm/FileDetailsLabel/FileDetailsLabel.test.js +0 -74
- package/dist/esm/FileDropZone/FileDropZone.test.d.ts +0 -1
- package/dist/esm/FileDropZone/FileDropZone.test.js +0 -95
- package/dist/esm/FilePreview/FilePreview.test.d.ts +0 -1
- package/dist/esm/FilePreview/FilePreview.test.js +0 -92
- package/dist/esm/ImagePreview/ImagePreview.test.d.ts +0 -1
- package/dist/esm/ImagePreview/ImagePreview.test.js +0 -220
- package/dist/esm/MarkdownContent/MarkdownContent.test.d.ts +0 -1
- package/dist/esm/MarkdownContent/MarkdownContent.test.js +0 -187
- package/dist/esm/Message/CodeBlockMessage/CodeBlockMessage.test.d.ts +0 -1
- package/dist/esm/Message/CodeBlockMessage/CodeBlockMessage.test.js +0 -126
- package/dist/esm/Message/ErrorMessage/ErrorMessage.test.d.ts +0 -1
- package/dist/esm/Message/ErrorMessage/ErrorMessage.test.js +0 -25
- package/dist/esm/Message/Message.test.d.ts +0 -1
- package/dist/esm/Message/Message.test.js +0 -1123
- package/dist/esm/Message/MessageAndActions/MessageAndActions.test.d.ts +0 -1
- package/dist/esm/Message/MessageAndActions/MessageAndActions.test.js +0 -20
- package/dist/esm/Message/MessageAttachments/MessageAttachmentItem.test.d.ts +0 -1
- package/dist/esm/Message/MessageAttachments/MessageAttachmentItem.test.js +0 -20
- package/dist/esm/Message/MessageAttachments/MessageAttachmentsContainer.test.d.ts +0 -1
- package/dist/esm/Message/MessageAttachments/MessageAttachmentsContainer.test.js +0 -20
- package/dist/esm/Message/MessageLoading.test.d.ts +0 -1
- package/dist/esm/Message/MessageLoading.test.js +0 -20
- package/dist/esm/Message/QuickResponse/QuickResponse.test.d.ts +0 -1
- package/dist/esm/Message/QuickResponse/QuickResponse.test.js +0 -104
- package/dist/esm/Message/QuickStarts/QuickStartTileDescription.test.d.ts +0 -1
- package/dist/esm/Message/QuickStarts/QuickStartTileDescription.test.js +0 -48
- package/dist/esm/Message/UserFeedback/UserFeedback.test.d.ts +0 -1
- package/dist/esm/Message/UserFeedback/UserFeedback.test.js +0 -176
- package/dist/esm/Message/UserFeedback/UserFeedbackComplete.test.d.ts +0 -1
- package/dist/esm/Message/UserFeedback/UserFeedbackComplete.test.js +0 -238
- package/dist/esm/MessageBar/AttachButton.test.d.ts +0 -1
- package/dist/esm/MessageBar/AttachButton.test.js +0 -147
- package/dist/esm/MessageBar/MessageBar.test.d.ts +0 -1
- package/dist/esm/MessageBar/MessageBar.test.js +0 -333
- package/dist/esm/MessageBar/SendButton.test.d.ts +0 -1
- package/dist/esm/MessageBar/SendButton.test.js +0 -53
- package/dist/esm/MessageBar/StopButton.test.d.ts +0 -1
- package/dist/esm/MessageBar/StopButton.test.js +0 -53
- package/dist/esm/MessageBox/JumpButton.test.d.ts +0 -1
- package/dist/esm/MessageBox/JumpButton.test.js +0 -34
- package/dist/esm/MessageBox/MessageBox.test.d.ts +0 -1
- package/dist/esm/MessageBox/MessageBox.test.js +0 -289
- package/dist/esm/MessageDivider/MessageDivider.test.d.ts +0 -1
- package/dist/esm/MessageDivider/MessageDivider.test.js +0 -24
- package/dist/esm/Onboarding/Onboarding.test.d.ts +0 -1
- package/dist/esm/Onboarding/Onboarding.test.js +0 -75
- package/dist/esm/PreviewAttachment/PreviewAttachment.test.d.ts +0 -1
- package/dist/esm/PreviewAttachment/PreviewAttachment.test.js +0 -48
- package/dist/esm/ResponseActions/ResponseActionButton.test.d.ts +0 -1
- package/dist/esm/ResponseActions/ResponseActionButton.test.js +0 -49
- package/dist/esm/ResponseActions/ResponseActions.test.d.ts +0 -1
- package/dist/esm/ResponseActions/ResponseActions.test.js +0 -450
- package/dist/esm/ResponseActions/ResponseActionsGroups.test.d.ts +0 -1
- package/dist/esm/ResponseActions/ResponseActionsGroups.test.js +0 -20
- package/dist/esm/Settings/SettingsForm.test.d.ts +0 -1
- package/dist/esm/Settings/SettingsForm.test.js +0 -33
- package/dist/esm/SourcesCard/SourcesCard.test.d.ts +0 -1
- package/dist/esm/SourcesCard/SourcesCard.test.js +0 -34
- package/dist/esm/SourcesCardBase/SourcesCardBase.test.d.ts +0 -1
- package/dist/esm/SourcesCardBase/SourcesCardBase.test.js +0 -194
- package/dist/esm/TermsOfUse/TermsOfUse.test.d.ts +0 -1
- package/dist/esm/TermsOfUse/TermsOfUse.test.js +0 -72
- package/dist/esm/ToolCall/ToolCall.test.d.ts +0 -1
- package/dist/esm/ToolCall/ToolCall.test.js +0 -196
- package/dist/esm/ToolResponse/ToolResponse.test.d.ts +0 -1
- package/dist/esm/ToolResponse/ToolResponse.test.js +0 -179
- package/dist/esm/__mocks__/monaco-editor.d.ts +0 -11
- package/dist/esm/__mocks__/monaco-editor.js +0 -18
- package/dist/esm/__mocks__/rehype-external-links.d.ts +0 -2
- package/dist/esm/__mocks__/rehype-external-links.js +0 -2
- package/dist/esm/__mocks__/rehype-highlight.d.ts +0 -2
- package/dist/esm/__mocks__/rehype-highlight.js +0 -2
- package/dist/esm/__mocks__/rehype-sanitize.d.ts +0 -2
- package/dist/esm/__mocks__/rehype-sanitize.js +0 -2
- package/dist/esm/__mocks__/rehype-unwrap-images.d.ts +0 -2
- package/dist/esm/__mocks__/rehype-unwrap-images.js +0 -2
|
@@ -0,0 +1,182 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
13
|
+
import Markdown from 'react-markdown';
|
|
14
|
+
import remarkGfm from 'remark-gfm';
|
|
15
|
+
import { ContentVariants } from '@patternfly/react-core';
|
|
16
|
+
import CodeBlockMessage from '../Message/CodeBlockMessage/CodeBlockMessage';
|
|
17
|
+
import TextMessage from '../Message/TextMessage/TextMessage';
|
|
18
|
+
import ListItemMessage from '../Message/ListMessage/ListItemMessage';
|
|
19
|
+
import UnorderedListMessage from '../Message/ListMessage/UnorderedListMessage';
|
|
20
|
+
import OrderedListMessage from '../Message/ListMessage/OrderedListMessage';
|
|
21
|
+
import TableMessage from '../Message/TableMessage/TableMessage';
|
|
22
|
+
import TrMessage from '../Message/TableMessage/TrMessage';
|
|
23
|
+
import TdMessage from '../Message/TableMessage/TdMessage';
|
|
24
|
+
import TbodyMessage from '../Message/TableMessage/TbodyMessage';
|
|
25
|
+
import TheadMessage from '../Message/TableMessage/TheadMessage';
|
|
26
|
+
import ThMessage from '../Message/TableMessage/ThMessage';
|
|
27
|
+
import ImageMessage from '../Message/ImageMessage/ImageMessage';
|
|
28
|
+
import rehypeUnwrapImages from 'rehype-unwrap-images';
|
|
29
|
+
import rehypeExternalLinks from 'rehype-external-links';
|
|
30
|
+
import rehypeSanitize from 'rehype-sanitize';
|
|
31
|
+
import rehypeHighlight from 'rehype-highlight';
|
|
32
|
+
import 'highlight.js/styles/vs2015.css';
|
|
33
|
+
import LinkMessage from '../Message/LinkMessage/LinkMessage';
|
|
34
|
+
import { rehypeMoveImagesOutOfParagraphs } from '../Message/Plugins/rehypeMoveImagesOutOfParagraphs';
|
|
35
|
+
import SuperscriptMessage from '../Message/SuperscriptMessage/SuperscriptMessage';
|
|
36
|
+
import { css } from '@patternfly/react-styles';
|
|
37
|
+
const MarkdownRenderer = ({ content, codeBlockProps, tableProps, openLinkInNewTab = true, additionalRehypePlugins = [], additionalRemarkPlugins = [], linkProps, reactMarkdownProps, remarkGfmProps, hasNoImages = false, isPrimary, shouldRetainStyles }) => {
|
|
38
|
+
let rehypePlugins = [rehypeUnwrapImages, rehypeMoveImagesOutOfParagraphs, rehypeHighlight];
|
|
39
|
+
if (openLinkInNewTab) {
|
|
40
|
+
rehypePlugins = rehypePlugins.concat([[rehypeExternalLinks, { target: '_blank' }, rehypeSanitize]]);
|
|
41
|
+
}
|
|
42
|
+
if (additionalRehypePlugins) {
|
|
43
|
+
rehypePlugins.push(...additionalRehypePlugins);
|
|
44
|
+
}
|
|
45
|
+
const disallowedElements = hasNoImages ? ['img'] : [];
|
|
46
|
+
if (reactMarkdownProps && reactMarkdownProps.disallowedElements) {
|
|
47
|
+
disallowedElements.push(...reactMarkdownProps.disallowedElements);
|
|
48
|
+
}
|
|
49
|
+
return (_jsx(Markdown, Object.assign({ components: {
|
|
50
|
+
section: (props) => {
|
|
51
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
52
|
+
const { node } = props, rest = __rest(props, ["node"]);
|
|
53
|
+
return (_jsx("section", Object.assign({}, rest, { className: css('pf-chatbot__message-text', shouldRetainStyles && 'pf-m-markdown', rest === null || rest === void 0 ? void 0 : rest.className) })));
|
|
54
|
+
},
|
|
55
|
+
p: (props) => {
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
57
|
+
const { node } = props, rest = __rest(props, ["node"]);
|
|
58
|
+
return (_jsx(TextMessage, Object.assign({ shouldRetainStyles: shouldRetainStyles, component: ContentVariants.p }, rest, { isPrimary: isPrimary })));
|
|
59
|
+
},
|
|
60
|
+
code: (_a) => {
|
|
61
|
+
var { children } = _a, props = __rest(_a, ["children"]);
|
|
62
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
63
|
+
const { node } = props, codeProps = __rest(props, ["node"]);
|
|
64
|
+
return (_jsx(CodeBlockMessage, Object.assign({}, codeProps, codeBlockProps, { isPrimary: isPrimary, shouldRetainStyles: shouldRetainStyles, children: children })));
|
|
65
|
+
},
|
|
66
|
+
h1: (props) => {
|
|
67
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
68
|
+
const { node } = props, rest = __rest(props, ["node"]);
|
|
69
|
+
return _jsx(TextMessage, Object.assign({ shouldRetainStyles: shouldRetainStyles, component: ContentVariants.h1 }, rest));
|
|
70
|
+
},
|
|
71
|
+
h2: (props) => {
|
|
72
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
73
|
+
const { node } = props, rest = __rest(props, ["node"]);
|
|
74
|
+
return _jsx(TextMessage, Object.assign({ shouldRetainStyles: shouldRetainStyles, component: ContentVariants.h2 }, rest));
|
|
75
|
+
},
|
|
76
|
+
h3: (props) => {
|
|
77
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
78
|
+
const { node } = props, rest = __rest(props, ["node"]);
|
|
79
|
+
return _jsx(TextMessage, Object.assign({ shouldRetainStyles: shouldRetainStyles, component: ContentVariants.h3 }, rest));
|
|
80
|
+
},
|
|
81
|
+
h4: (props) => {
|
|
82
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
83
|
+
const { node } = props, rest = __rest(props, ["node"]);
|
|
84
|
+
return _jsx(TextMessage, Object.assign({ shouldRetainStyles: shouldRetainStyles, component: ContentVariants.h4 }, rest));
|
|
85
|
+
},
|
|
86
|
+
h5: (props) => {
|
|
87
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
88
|
+
const { node } = props, rest = __rest(props, ["node"]);
|
|
89
|
+
return _jsx(TextMessage, Object.assign({ shouldRetainStyles: shouldRetainStyles, component: ContentVariants.h5 }, rest));
|
|
90
|
+
},
|
|
91
|
+
h6: (props) => {
|
|
92
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
93
|
+
const { node } = props, rest = __rest(props, ["node"]);
|
|
94
|
+
return _jsx(TextMessage, Object.assign({ shouldRetainStyles: shouldRetainStyles, component: ContentVariants.h6 }, rest));
|
|
95
|
+
},
|
|
96
|
+
blockquote: (props) => {
|
|
97
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
98
|
+
const { node } = props, rest = __rest(props, ["node"]);
|
|
99
|
+
return (_jsx(TextMessage, Object.assign({ shouldRetainStyles: shouldRetainStyles, component: ContentVariants.blockquote }, rest)));
|
|
100
|
+
},
|
|
101
|
+
ul: (props) => {
|
|
102
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
103
|
+
const { node } = props, rest = __rest(props, ["node"]);
|
|
104
|
+
return _jsx(UnorderedListMessage, Object.assign({ shouldRetainStyles: shouldRetainStyles }, rest));
|
|
105
|
+
},
|
|
106
|
+
ol: (props) => {
|
|
107
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
108
|
+
const { node } = props, rest = __rest(props, ["node"]);
|
|
109
|
+
return _jsx(OrderedListMessage, Object.assign({ shouldRetainStyles: shouldRetainStyles }, rest));
|
|
110
|
+
},
|
|
111
|
+
li: (props) => {
|
|
112
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
113
|
+
const { node } = props, rest = __rest(props, ["node"]);
|
|
114
|
+
return _jsx(ListItemMessage, Object.assign({}, rest));
|
|
115
|
+
},
|
|
116
|
+
// table requires node attribute for calculating headers for mobile breakpoint
|
|
117
|
+
table: (props) => (_jsx(TableMessage, Object.assign({ shouldRetainStyles: shouldRetainStyles }, props, tableProps, { isPrimary: isPrimary }))),
|
|
118
|
+
tbody: (props) => {
|
|
119
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
120
|
+
const { node } = props, rest = __rest(props, ["node"]);
|
|
121
|
+
return _jsx(TbodyMessage, Object.assign({}, rest));
|
|
122
|
+
},
|
|
123
|
+
thead: (props) => {
|
|
124
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
125
|
+
const { node } = props, rest = __rest(props, ["node"]);
|
|
126
|
+
return _jsx(TheadMessage, Object.assign({}, rest));
|
|
127
|
+
},
|
|
128
|
+
tr: (props) => {
|
|
129
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
130
|
+
const { node } = props, rest = __rest(props, ["node"]);
|
|
131
|
+
return _jsx(TrMessage, Object.assign({}, rest));
|
|
132
|
+
},
|
|
133
|
+
td: (props) => {
|
|
134
|
+
// Conflicts with Td type
|
|
135
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
136
|
+
const { node, width } = props, rest = __rest(props, ["node", "width"]);
|
|
137
|
+
return _jsx(TdMessage, Object.assign({}, rest));
|
|
138
|
+
},
|
|
139
|
+
th: (props) => {
|
|
140
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
141
|
+
const { node } = props, rest = __rest(props, ["node"]);
|
|
142
|
+
return _jsx(ThMessage, Object.assign({}, rest));
|
|
143
|
+
},
|
|
144
|
+
img: (props) => {
|
|
145
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
146
|
+
const { node } = props, rest = __rest(props, ["node"]);
|
|
147
|
+
return _jsx(ImageMessage, Object.assign({}, rest));
|
|
148
|
+
},
|
|
149
|
+
a: (props) => {
|
|
150
|
+
// node is just the details of the document structure - not needed
|
|
151
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
152
|
+
const { node } = props, rest = __rest(props, ["node"]);
|
|
153
|
+
return (
|
|
154
|
+
// some a types conflict with ButtonProps, but it's ok because we are using an a tag
|
|
155
|
+
// there are too many to handle manually
|
|
156
|
+
_jsx(LinkMessage, Object.assign({ shouldRetainStyles: shouldRetainStyles }, rest, linkProps, { children: props.children })));
|
|
157
|
+
},
|
|
158
|
+
// used for footnotes
|
|
159
|
+
sup: (props) => {
|
|
160
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
161
|
+
const { node } = props, rest = __rest(props, ["node"]);
|
|
162
|
+
return _jsx(SuperscriptMessage, Object.assign({}, rest));
|
|
163
|
+
}
|
|
164
|
+
}, remarkPlugins: [[remarkGfm, Object.assign({}, remarkGfmProps)], ...additionalRemarkPlugins], rehypePlugins: rehypePlugins }, reactMarkdownProps, { remarkRehypeOptions: Object.assign({
|
|
165
|
+
// removes sr-only class from footnote labels applied by default
|
|
166
|
+
footnoteLabelProperties: { className: [''] },
|
|
167
|
+
// omit default ↩ text; backref icon is rendered in LinkMessage
|
|
168
|
+
footnoteBackContent: (_referenceIndex, rereferenceIndex) => {
|
|
169
|
+
if (rereferenceIndex > 1) {
|
|
170
|
+
return [
|
|
171
|
+
{
|
|
172
|
+
type: 'element',
|
|
173
|
+
tagName: 'sup',
|
|
174
|
+
properties: {},
|
|
175
|
+
children: [{ type: 'text', value: String(rereferenceIndex) }]
|
|
176
|
+
}
|
|
177
|
+
];
|
|
178
|
+
}
|
|
179
|
+
return [];
|
|
180
|
+
} }, reactMarkdownProps === null || reactMarkdownProps === void 0 ? void 0 : reactMarkdownProps.remarkRehypeOptions), disallowedElements: disallowedElements, children: content })));
|
|
181
|
+
};
|
|
182
|
+
export default MarkdownRenderer;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import type { FunctionComponent, HTMLProps, MouseEvent as ReactMouseEvent, Ref } from 'react';
|
|
3
|
-
import { Options } from 'react-markdown';
|
|
3
|
+
import type { Options } from 'react-markdown';
|
|
4
4
|
import { AlertProps, AvatarProps, ButtonProps, FormProps, LabelGroupProps } from '@patternfly/react-core';
|
|
5
5
|
import { CodeBlockMessageProps } from './CodeBlockMessage/CodeBlockMessage';
|
|
6
6
|
import { ActionProps } from '../ResponseActions/ResponseActions';
|
|
@@ -9,9 +9,8 @@ import { QuickStart, QuickstartAction } from './QuickStarts/types';
|
|
|
9
9
|
import QuickResponse from './QuickResponse/QuickResponse';
|
|
10
10
|
import { UserFeedbackProps } from './UserFeedback/UserFeedback';
|
|
11
11
|
import { UserFeedbackCompleteProps } from './UserFeedback/UserFeedbackComplete';
|
|
12
|
-
import { TableProps } from '@patternfly/react-table';
|
|
13
|
-
import '
|
|
14
|
-
import { PluggableList } from 'unified';
|
|
12
|
+
import type { TableProps } from '@patternfly/react-table';
|
|
13
|
+
import type { PluggableList } from 'unified';
|
|
15
14
|
import { ToolResponseProps } from '../ToolResponse';
|
|
16
15
|
import { DeepThinkingProps } from '../DeepThinking';
|
|
17
16
|
import { ToolCallProps } from '../ToolCall';
|
|
@@ -23,8 +23,6 @@ import QuickStartTile from './QuickStarts/QuickStartTile';
|
|
|
23
23
|
import QuickResponse from './QuickResponse/QuickResponse';
|
|
24
24
|
import UserFeedback from './UserFeedback/UserFeedback';
|
|
25
25
|
import UserFeedbackComplete from './UserFeedback/UserFeedbackComplete';
|
|
26
|
-
// see the full list of styles here: https://highlightjs.org/examples
|
|
27
|
-
import 'highlight.js/styles/vs2015.css';
|
|
28
26
|
import ErrorMessage from './ErrorMessage/ErrorMessage';
|
|
29
27
|
import MessageInput from './MessageInput';
|
|
30
28
|
import ToolResponse from '../ToolResponse';
|
|
@@ -27,6 +27,8 @@ export interface MessageBoxProps extends HTMLProps<HTMLDivElement> {
|
|
|
27
27
|
jumpButtonTopTooltipProps?: TooltipProps;
|
|
28
28
|
/** Props passed to top jump button tooltip */
|
|
29
29
|
jumpButtonBottomTooltipProps?: TooltipProps;
|
|
30
|
+
/** Whether scrollbar is on the page or message box in embedded mode */
|
|
31
|
+
hasOuterScrollbar?: boolean;
|
|
30
32
|
}
|
|
31
33
|
export interface MessageBoxHandle extends HTMLDivElement {
|
|
32
34
|
/** Scrolls to the top of the message box */
|
|
@@ -15,7 +15,11 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
15
15
|
// ============================================================================
|
|
16
16
|
import { useState, useRef, useCallback, useLayoutEffect, forwardRef, useImperativeHandle } from 'react';
|
|
17
17
|
import JumpButton from './JumpButton';
|
|
18
|
+
import { MarkdownRendererReadyContext, preloadMarkdownRenderer, useIsMarkdownRendererReady } from '../MarkdownContent/MarkdownContent';
|
|
18
19
|
import { getResizeObserver } from '@patternfly/react-core';
|
|
20
|
+
import { css } from '@patternfly/react-styles';
|
|
21
|
+
// Start fetching the markdown chunk as soon as MessageBox enters the bundle.
|
|
22
|
+
preloadMarkdownRenderer();
|
|
19
23
|
const SCROLL_EDGE_DELTA = 100;
|
|
20
24
|
const getScrollMetrics = (element) => {
|
|
21
25
|
const { scrollTop, scrollHeight, clientHeight } = element;
|
|
@@ -40,7 +44,8 @@ const shouldFollowContentGrowth = (metrics, enableSmartScroll, autoScroll, pause
|
|
|
40
44
|
metrics.nearBottom ||
|
|
41
45
|
(enableSmartScroll && autoScroll && !pauseAutoScroll && metrics.roundedScrollTop > 0);
|
|
42
46
|
export const MessageBox = forwardRef((_a, ref) => {
|
|
43
|
-
var { announcement, ariaLabel = 'Scrollable message log', children, className, position = 'top', onScrollToTopClick, onScrollToBottomClick, enableSmartScroll = false, jumpButtonTopProps, jumpButtonBottomProps, jumpButtonBottomTooltipProps, jumpButtonTopTooltipProps } = _a, props = __rest(_a, ["announcement", "ariaLabel", "children", "className", "position", "onScrollToTopClick", "onScrollToBottomClick", "enableSmartScroll", "jumpButtonTopProps", "jumpButtonBottomProps", "jumpButtonBottomTooltipProps", "jumpButtonTopTooltipProps"]);
|
|
47
|
+
var { announcement, ariaLabel = 'Scrollable message log', children, className, position = 'top', onScrollToTopClick, onScrollToBottomClick, enableSmartScroll = false, jumpButtonTopProps, jumpButtonBottomProps, jumpButtonBottomTooltipProps, jumpButtonTopTooltipProps, hasOuterScrollbar = false } = _a, props = __rest(_a, ["announcement", "ariaLabel", "children", "className", "position", "onScrollToTopClick", "onScrollToBottomClick", "enableSmartScroll", "jumpButtonTopProps", "jumpButtonBottomProps", "jumpButtonBottomTooltipProps", "jumpButtonTopTooltipProps", "hasOuterScrollbar"]);
|
|
48
|
+
const isMarkdownReady = useIsMarkdownRendererReady();
|
|
44
49
|
const [atTop, setAtTop] = useState(true);
|
|
45
50
|
const [atBottom, setAtBottom] = useState(false);
|
|
46
51
|
const [isOverflowing, setIsOverflowing] = useState(false);
|
|
@@ -251,6 +256,6 @@ export const MessageBox = forwardRef((_a, ref) => {
|
|
|
251
256
|
onTouchMove,
|
|
252
257
|
onTouchEnd
|
|
253
258
|
};
|
|
254
|
-
return (_jsxs(_Fragment, { children: [_jsx(JumpButton, { position: "top", isHidden: !hasMeasuredScroll || (isOverflowing && atTop), onClick: scrollToTop, jumpButtonProps: jumpButtonTopProps, jumpButtonTooltipProps: jumpButtonTopTooltipProps }), _jsx(JumpButton, { position: "bottom", isHidden: !hasMeasuredScroll || (isOverflowing && atBottom), onClick: () => scrollToBottom({ resumeSmartScroll: true }), jumpButtonProps: jumpButtonBottomProps, jumpButtonTooltipProps: jumpButtonBottomTooltipProps }), _jsxs("div", Object.assign({ role: "region", tabIndex: 0, "aria-label": ariaLabel, className:
|
|
259
|
+
return (_jsxs(_Fragment, { children: [_jsx(JumpButton, { position: "top", isHidden: !hasMeasuredScroll || (isOverflowing && atTop), onClick: scrollToTop, jumpButtonProps: jumpButtonTopProps, jumpButtonTooltipProps: jumpButtonTopTooltipProps }), _jsx(JumpButton, { position: "bottom", isHidden: !hasMeasuredScroll || (isOverflowing && atBottom), onClick: () => scrollToBottom({ resumeSmartScroll: true }), jumpButtonProps: jumpButtonBottomProps, jumpButtonTooltipProps: jumpButtonBottomTooltipProps }), _jsxs("div", Object.assign({ role: "region", tabIndex: 0, "aria-label": ariaLabel, className: css('pf-chatbot__messagebox', position === 'bottom' && 'pf-chatbot__messagebox--bottom', hasOuterScrollbar && 'pf-chatbot__messagebox--outer-scroll', className), ref: messageBoxRef }, props, (enableSmartScroll ? Object.assign({}, smartScrollHandlers) : {}), { children: [_jsx(MarkdownRendererReadyContext.Provider, { value: isMarkdownReady, children: children }), _jsx("div", { className: "pf-chatbot__messagebox-announcement pf-chatbot-m-hidden", "aria-live": "polite", children: announcement })] }))] }));
|
|
255
260
|
});
|
|
256
261
|
export default MessageBox;
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export { default as AttachmentEdit } from './AttachmentEdit';
|
|
2
|
-
export * from './AttachmentEdit';
|
|
3
1
|
export { default as AttachMenu } from './AttachMenu';
|
|
4
2
|
export * from './AttachMenu';
|
|
5
3
|
export { default as Chatbot } from './Chatbot';
|
|
@@ -22,8 +20,6 @@ export { default as ChatbotToggle } from './ChatbotToggle';
|
|
|
22
20
|
export * from './ChatbotToggle';
|
|
23
21
|
export { default as ChatbotWelcomePrompt } from './ChatbotWelcomePrompt';
|
|
24
22
|
export * from './ChatbotWelcomePrompt';
|
|
25
|
-
export { default as CodeModal } from './CodeModal';
|
|
26
|
-
export * from './CodeModal';
|
|
27
23
|
export { default as Compare } from './Compare';
|
|
28
24
|
export * from './Compare';
|
|
29
25
|
export { default as DeepThinking } from './DeepThinking';
|
|
@@ -50,8 +46,6 @@ export { default as MessageDivider } from './MessageDivider';
|
|
|
50
46
|
export * from './MessageDivider';
|
|
51
47
|
export { default as Onboarding } from './Onboarding';
|
|
52
48
|
export * from './Onboarding';
|
|
53
|
-
export { default as PreviewAttachment } from './PreviewAttachment';
|
|
54
|
-
export * from './PreviewAttachment';
|
|
55
49
|
export { default as ResponseActions } from './ResponseActions';
|
|
56
50
|
export * from './ResponseActions';
|
|
57
51
|
export { default as Settings } from './Settings';
|
|
@@ -68,5 +62,3 @@ export { default as ToolCall } from './ToolCall';
|
|
|
68
62
|
export * from './ToolCall';
|
|
69
63
|
export { default as ToolResponse } from './ToolResponse';
|
|
70
64
|
export * from './ToolResponse';
|
|
71
|
-
export { default as tracking } from './tracking';
|
|
72
|
-
export * from './tracking';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
// this file is autogenerated by generate-index.js, modifying it manually will have no effect
|
|
2
|
-
export { default as AttachmentEdit } from './AttachmentEdit';
|
|
3
|
-
export * from './AttachmentEdit';
|
|
4
2
|
export { default as AttachMenu } from './AttachMenu';
|
|
5
3
|
export * from './AttachMenu';
|
|
6
4
|
export { default as Chatbot } from './Chatbot';
|
|
@@ -23,8 +21,6 @@ export { default as ChatbotToggle } from './ChatbotToggle';
|
|
|
23
21
|
export * from './ChatbotToggle';
|
|
24
22
|
export { default as ChatbotWelcomePrompt } from './ChatbotWelcomePrompt';
|
|
25
23
|
export * from './ChatbotWelcomePrompt';
|
|
26
|
-
export { default as CodeModal } from './CodeModal';
|
|
27
|
-
export * from './CodeModal';
|
|
28
24
|
export { default as Compare } from './Compare';
|
|
29
25
|
export * from './Compare';
|
|
30
26
|
export { default as DeepThinking } from './DeepThinking';
|
|
@@ -51,8 +47,6 @@ export { default as MessageDivider } from './MessageDivider';
|
|
|
51
47
|
export * from './MessageDivider';
|
|
52
48
|
export { default as Onboarding } from './Onboarding';
|
|
53
49
|
export * from './Onboarding';
|
|
54
|
-
export { default as PreviewAttachment } from './PreviewAttachment';
|
|
55
|
-
export * from './PreviewAttachment';
|
|
56
50
|
export { default as ResponseActions } from './ResponseActions';
|
|
57
51
|
export * from './ResponseActions';
|
|
58
52
|
export { default as Settings } from './Settings';
|
|
@@ -69,5 +63,3 @@ export { default as ToolCall } from './ToolCall';
|
|
|
69
63
|
export * from './ToolCall';
|
|
70
64
|
export { default as ToolResponse } from './ToolResponse';
|
|
71
65
|
export * from './ToolResponse';
|
|
72
|
-
export { default as tracking } from './tracking';
|
|
73
|
-
export * from './tracking';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../src/index.ts","../src/AttachMenu/AttachMenu.tsx","../src/AttachMenu/index.ts","../src/AttachmentEdit/AttachmentEdit.
|
|
1
|
+
{"root":["../src/index.ts","../src/AttachMenu/AttachMenu.tsx","../src/AttachMenu/index.ts","../src/AttachmentEdit/AttachmentEdit.tsx","../src/AttachmentEdit/index.ts","../src/Chatbot/Chatbot.tsx","../src/Chatbot/index.ts","../src/ChatbotAlert/ChatbotAlert.tsx","../src/ChatbotAlert/index.ts","../src/ChatbotContent/ChatbotContent.tsx","../src/ChatbotContent/index.ts","../src/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.tsx","../src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.tsx","../src/ChatbotConversationHistoryNav/EmptyState.tsx","../src/ChatbotConversationHistoryNav/LoadingState.tsx","../src/ChatbotConversationHistoryNav/index.ts","../src/ChatbotFooter/ChatbotFooter.tsx","../src/ChatbotFooter/ChatbotFootnote.tsx","../src/ChatbotFooter/index.ts","../src/ChatbotHeader/ChatbotHeader.tsx","../src/ChatbotHeader/ChatbotHeaderActions.tsx","../src/ChatbotHeader/ChatbotHeaderCloseButton.tsx","../src/ChatbotHeader/ChatbotHeaderMain.tsx","../src/ChatbotHeader/ChatbotHeaderMenu.tsx","../src/ChatbotHeader/ChatbotHeaderNewChatButton.tsx","../src/ChatbotHeader/ChatbotHeaderOptionsDropdown.tsx","../src/ChatbotHeader/ChatbotHeaderSelectorDropdown.tsx","../src/ChatbotHeader/ChatbotHeaderTitle.tsx","../src/ChatbotHeader/index.ts","../src/ChatbotModal/ChatbotModal.tsx","../src/ChatbotModal/index.ts","../src/ChatbotPopover/ChatbotPopover.tsx","../src/ChatbotPopover/index.ts","../src/ChatbotToggle/ChatbotToggle.tsx","../src/ChatbotToggle/index.ts","../src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.tsx","../src/ChatbotWelcomePrompt/index.ts","../src/CodeModal/CodeModal.tsx","../src/CodeModal/index.ts","../src/Compare/Compare.tsx","../src/Compare/index.ts","../src/DeepThinking/DeepThinking.tsx","../src/DeepThinking/index.ts","../src/FileDetails/FileDetails.tsx","../src/FileDetails/index.ts","../src/FileDetailsLabel/FileDetailsLabel.tsx","../src/FileDetailsLabel/index.ts","../src/FileDropZone/FileDropZone.tsx","../src/FileDropZone/index.ts","../src/FilePreview/FilePreview.tsx","../src/FilePreview/index.ts","../src/ImagePreview/ImagePreview.tsx","../src/ImagePreview/index.ts","../src/MarkdownContent/MarkdownContent.tsx","../src/MarkdownContent/MarkdownRenderer.tsx","../src/MarkdownContent/index.ts","../src/Message/Message.tsx","../src/Message/MessageInput.tsx","../src/Message/MessageLoading.tsx","../src/Message/index.ts","../src/Message/CodeBlockMessage/CodeBlockMessage.tsx","../src/Message/ErrorMessage/ErrorMessage.tsx","../src/Message/ImageMessage/ImageMessage.tsx","../src/Message/LinkMessage/LinkMessage.tsx","../src/Message/ListMessage/ListItemMessage.tsx","../src/Message/ListMessage/OrderedListMessage.tsx","../src/Message/ListMessage/UnorderedListMessage.tsx","../src/Message/MessageAndActions/MessageAndActions.tsx","../src/Message/MessageAndActions/index.ts","../src/Message/MessageAttachments/MessageAttachmentItem.tsx","../src/Message/MessageAttachments/MessageAttachmentsContainer.tsx","../src/Message/MessageAttachments/index.ts","../src/Message/Plugins/index.ts","../src/Message/Plugins/rehypeCodeBlockToggle.ts","../src/Message/Plugins/rehypeMoveImagesOutOfParagraphs.ts","../src/Message/QuickResponse/QuickResponse.tsx","../src/Message/QuickResponse/index.ts","../src/Message/QuickStarts/FallbackImg.tsx","../src/Message/QuickStarts/QuickStartTile.tsx","../src/Message/QuickStarts/QuickStartTileDescription.tsx","../src/Message/QuickStarts/QuickStartTileHeader.tsx","../src/Message/QuickStarts/index.ts","../src/Message/QuickStarts/monitor-sampleapp-quickstart-with-image.ts","../src/Message/QuickStarts/monitor-sampleapp-quickstart.ts","../src/Message/QuickStarts/types.ts","../src/Message/SuperscriptMessage/SuperscriptMessage.tsx","../src/Message/TableMessage/TableCellContent.tsx","../src/Message/TableMessage/TableMessage.tsx","../src/Message/TableMessage/TbodyMessage.tsx","../src/Message/TableMessage/TdMessage.tsx","../src/Message/TableMessage/ThMessage.tsx","../src/Message/TableMessage/TheadMessage.tsx","../src/Message/TableMessage/TrMessage.tsx","../src/Message/TextMessage/TextMessage.tsx","../src/Message/UserFeedback/CloseButton.tsx","../src/Message/UserFeedback/UserFeedback.tsx","../src/Message/UserFeedback/UserFeedbackComplete.tsx","../src/Message/UserFeedback/index.ts","../src/MessageBar/AttachButton.tsx","../src/MessageBar/MessageBar.tsx","../src/MessageBar/MicrophoneButton.tsx","../src/MessageBar/SendButton.tsx","../src/MessageBar/StopButton.tsx","../src/MessageBar/index.ts","../src/MessageBox/JumpButton.tsx","../src/MessageBox/MessageBox.tsx","../src/MessageBox/index.ts","../src/MessageDivider/MessageDivider.tsx","../src/MessageDivider/index.ts","../src/Onboarding/Onboarding.tsx","../src/Onboarding/index.ts","../src/PreviewAttachment/PreviewAttachment.tsx","../src/PreviewAttachment/index.ts","../src/ResponseActions/ResponseActionButton.tsx","../src/ResponseActions/ResponseActions.tsx","../src/ResponseActions/ResponseActionsGroups.tsx","../src/ResponseActions/index.ts","../src/Settings/SettingsForm.tsx","../src/Settings/index.ts","../src/SourceDetailsMenuItem/SourceDetailsMenuItem.tsx","../src/SourceDetailsMenuItem/index.ts","../src/SourcesCard/SourcesCard.tsx","../src/SourcesCard/index.ts","../src/SourcesCardBase/SourcesCardBase.tsx","../src/SourcesCardBase/index.ts","../src/TermsOfUse/TermsOfUse.tsx","../src/TermsOfUse/index.ts","../src/ToolCall/ToolCall.tsx","../src/ToolCall/index.ts","../src/ToolResponse/ToolResponse.tsx","../src/ToolResponse/index.ts","../src/tracking/console_tracking_provider.ts","../src/tracking/index.ts","../src/tracking/posthog_tracking_provider.ts","../src/tracking/segment_tracking_provider.ts","../src/tracking/trackingProviderProxy.ts","../src/tracking/tracking_api.ts","../src/tracking/tracking_registry.ts","../src/tracking/tracking_spi.ts","../src/tracking/umami_tracking_provider.ts"],"version":"5.6.3"}
|
package/generate-index.js
CHANGED
|
@@ -2,36 +2,51 @@ const fse = require('fs-extra');
|
|
|
2
2
|
const glob = require('glob');
|
|
3
3
|
const path = require('path');
|
|
4
4
|
|
|
5
|
+
const BARREL_EXCLUDE = new Set(['AttachmentEdit', 'CodeModal', 'PreviewAttachment', 'tracking']);
|
|
6
|
+
|
|
5
7
|
const root = process.cwd();
|
|
6
8
|
|
|
7
9
|
const ENV_AGNOSTIC_ROOT = `${root}/src`;
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
function getModuleName(file) {
|
|
12
|
+
return file.replace('/index.ts', '').split('/').pop();
|
|
13
|
+
}
|
|
10
14
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
function filterBarrelFiles(files) {
|
|
16
|
+
return files.filter((file) => !BARREL_EXCLUDE.has(getModuleName(file)));
|
|
17
|
+
}
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
async function generateIndex(files, destRoot = ENV_AGNOSTIC_ROOT) {
|
|
20
|
+
fse.ensureDirSync(path.resolve(destRoot));
|
|
21
|
+
|
|
22
|
+
const destFile = `${destRoot}/index.ts`;
|
|
16
23
|
|
|
17
24
|
const stream = fse.createWriteStream(destFile);
|
|
18
|
-
stream.once('open', () => {
|
|
19
|
-
stream.write('// this file is autogenerated by generate-index.js, modifying it manually will have no effect\n');
|
|
20
25
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
stream.write(
|
|
24
|
-
|
|
26
|
+
return new Promise((resolve, reject) => {
|
|
27
|
+
stream.once('open', () => {
|
|
28
|
+
stream.write('// this file is autogenerated by generate-index.js, modifying it manually will have no effect\n');
|
|
29
|
+
|
|
30
|
+
files.forEach((file) => {
|
|
31
|
+
const name = getModuleName(file);
|
|
32
|
+
|
|
33
|
+
if (BARREL_EXCLUDE.has(name)) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
stream.write(`\nexport { default as ${name} } from './${name}';\n`);
|
|
38
|
+
stream.write(`export * from './${name}';\n`);
|
|
39
|
+
});
|
|
40
|
+
stream.end();
|
|
25
41
|
});
|
|
26
|
-
stream.
|
|
42
|
+
stream.once('close', resolve);
|
|
43
|
+
stream.once('error', reject);
|
|
27
44
|
});
|
|
28
|
-
|
|
29
|
-
return Promise.resolve();
|
|
30
45
|
}
|
|
31
46
|
|
|
32
47
|
async function run(files) {
|
|
33
48
|
try {
|
|
34
|
-
await generateIndex(files);
|
|
49
|
+
await generateIndex(filterBarrelFiles(files));
|
|
35
50
|
} catch (error) {
|
|
36
51
|
// eslint-disable-next-line no-console
|
|
37
52
|
console.error(error);
|
|
@@ -39,4 +54,14 @@ async function run(files) {
|
|
|
39
54
|
}
|
|
40
55
|
}
|
|
41
56
|
|
|
42
|
-
|
|
57
|
+
if (require.main === module) {
|
|
58
|
+
const sourceFiles = glob.sync(path.resolve(__dirname, './src/*/index.ts'));
|
|
59
|
+
run(sourceFiles);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
module.exports = {
|
|
63
|
+
BARREL_EXCLUDE,
|
|
64
|
+
getModuleName,
|
|
65
|
+
filterBarrelFiles,
|
|
66
|
+
generateIndex
|
|
67
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/* eslint-env jest */
|
|
2
|
+
const fse = require('fs-extra');
|
|
3
|
+
const os = require('os');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
const { BARREL_EXCLUDE, getModuleName, filterBarrelFiles, generateIndex } = require('./generate-index');
|
|
7
|
+
|
|
8
|
+
describe('generate-index', () => {
|
|
9
|
+
describe('BARREL_EXCLUDE', () => {
|
|
10
|
+
it('excludes internal modules from the barrel', () => {
|
|
11
|
+
expect(BARREL_EXCLUDE).toEqual(new Set(['AttachmentEdit', 'CodeModal', 'PreviewAttachment', 'tracking']));
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
describe('getModuleName', () => {
|
|
16
|
+
it('extracts the module name from an index.ts path', () => {
|
|
17
|
+
expect(getModuleName('/project/src/Chatbot/index.ts')).toBe('Chatbot');
|
|
18
|
+
expect(getModuleName('/project/src/tracking/index.ts')).toBe('tracking');
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
describe('filterBarrelFiles', () => {
|
|
23
|
+
const files = [
|
|
24
|
+
'/project/src/AttachmentEdit/index.ts',
|
|
25
|
+
'/project/src/Chatbot/index.ts',
|
|
26
|
+
'/project/src/CodeModal/index.ts',
|
|
27
|
+
'/project/src/PreviewAttachment/index.ts',
|
|
28
|
+
'/project/src/tracking/index.ts'
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
it('removes excluded modules from the file list', () => {
|
|
32
|
+
expect(filterBarrelFiles(files)).toEqual(['/project/src/Chatbot/index.ts']);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
describe('generateIndex', () => {
|
|
37
|
+
let tempDir;
|
|
38
|
+
|
|
39
|
+
beforeEach(async () => {
|
|
40
|
+
tempDir = await fse.mkdtemp(path.join(os.tmpdir(), 'generate-index-test-'));
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
afterEach(async () => {
|
|
44
|
+
await fse.remove(tempDir);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('writes exports for included modules and skips excluded ones', async () => {
|
|
48
|
+
const files = [
|
|
49
|
+
'/project/src/AttachmentEdit/index.ts',
|
|
50
|
+
'/project/src/Chatbot/index.ts',
|
|
51
|
+
'/project/src/CodeModal/index.ts',
|
|
52
|
+
'/project/src/PreviewAttachment/index.ts',
|
|
53
|
+
'/project/src/tracking/index.ts'
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
await generateIndex(files, tempDir);
|
|
57
|
+
|
|
58
|
+
const indexContents = await fse.readFile(path.join(tempDir, 'index.ts'), 'utf8');
|
|
59
|
+
|
|
60
|
+
expect(indexContents).toContain("export { default as Chatbot } from './Chatbot';");
|
|
61
|
+
expect(indexContents).toContain("export * from './Chatbot';");
|
|
62
|
+
expect(indexContents).not.toContain('AttachmentEdit');
|
|
63
|
+
expect(indexContents).not.toContain('CodeModal');
|
|
64
|
+
expect(indexContents).not.toContain('PreviewAttachment');
|
|
65
|
+
expect(indexContents).not.toContain('tracking');
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/* global globalThis */
|
|
2
|
+
// Monaco worker setup for webpack/rspack apps using CodeModal, PreviewAttachment, or AttachmentEdit.
|
|
3
|
+
// Import once at app startup: import '@patternfly/chatbot/monaco-environment';
|
|
4
|
+
// Paths assume npm layout: node_modules/@patternfly/chatbot -> node_modules/monaco-editor.
|
|
5
|
+
// Each branch must use inline new Worker(new URL(...)) so the bundler emits worker chunks.
|
|
6
|
+
const workerOptions = { type: 'module' };
|
|
7
|
+
|
|
8
|
+
if (typeof globalThis !== 'undefined' && !globalThis.MonacoEnvironment?.getWorker) {
|
|
9
|
+
globalThis.MonacoEnvironment = {
|
|
10
|
+
getWorker(_workerId, label) {
|
|
11
|
+
switch (label) {
|
|
12
|
+
case 'json':
|
|
13
|
+
return new Worker(
|
|
14
|
+
new URL('../../monaco-editor/esm/vs/language/json/json.worker.js', import.meta.url),
|
|
15
|
+
workerOptions
|
|
16
|
+
);
|
|
17
|
+
case 'css':
|
|
18
|
+
case 'scss':
|
|
19
|
+
case 'less':
|
|
20
|
+
return new Worker(
|
|
21
|
+
new URL('../../monaco-editor/esm/vs/language/css/css.worker.js', import.meta.url),
|
|
22
|
+
workerOptions
|
|
23
|
+
);
|
|
24
|
+
case 'html':
|
|
25
|
+
case 'handlebars':
|
|
26
|
+
case 'razor':
|
|
27
|
+
return new Worker(
|
|
28
|
+
new URL('../../monaco-editor/esm/vs/language/html/html.worker.js', import.meta.url),
|
|
29
|
+
workerOptions
|
|
30
|
+
);
|
|
31
|
+
case 'typescript':
|
|
32
|
+
case 'javascript':
|
|
33
|
+
return new Worker(
|
|
34
|
+
new URL('../../monaco-editor/esm/vs/language/typescript/ts.worker.js', import.meta.url),
|
|
35
|
+
workerOptions
|
|
36
|
+
);
|
|
37
|
+
default:
|
|
38
|
+
return new Worker(
|
|
39
|
+
new URL('../../monaco-editor/esm/vs/editor/editor.worker.js', import.meta.url),
|
|
40
|
+
workerOptions
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/chatbot",
|
|
3
|
-
"version": "6.8.0-prerelease.
|
|
3
|
+
"version": "6.8.0-prerelease.9",
|
|
4
4
|
"description": "This library provides React components based on PatternFly 6 that can be used to build chatbots.",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -88,5 +88,23 @@
|
|
|
88
88
|
"victory-stack": "^37.1.1",
|
|
89
89
|
"victory-tooltip": "^37.1.1",
|
|
90
90
|
"victory-voronoi-container": "^37.1.1"
|
|
91
|
-
}
|
|
91
|
+
},
|
|
92
|
+
"exports": {
|
|
93
|
+
".": {
|
|
94
|
+
"types": "./dist/esm/index.d.ts",
|
|
95
|
+
"import": "./dist/esm/index.js",
|
|
96
|
+
"require": "./dist/cjs/index.js"
|
|
97
|
+
},
|
|
98
|
+
"./dist/css/main.css": "./dist/css/main.css",
|
|
99
|
+
"./dist/dynamic/*": {
|
|
100
|
+
"import": "./dist/esm/*/index.js",
|
|
101
|
+
"require": "./dist/cjs/*/index.js"
|
|
102
|
+
},
|
|
103
|
+
"./monaco-environment": "./monaco-environment.js"
|
|
104
|
+
},
|
|
105
|
+
"sideEffects": [
|
|
106
|
+
"**/*.css",
|
|
107
|
+
"**/*.scss",
|
|
108
|
+
"patternfly-docs/**"
|
|
109
|
+
]
|
|
92
110
|
}
|
|
@@ -51,6 +51,7 @@ Explore our documentation, which covers both the components you'll need to build
|
|
|
51
51
|
- [Chat transcripts](/extensions/chatbot/overview/demo#chat-transcripts)
|
|
52
52
|
- [Analytics](/extensions/chatbot/analytics): Tracking for ChatBot interactions
|
|
53
53
|
- [Customizing messages](/extensions/chatbot/customizing-messages): Details for the implementation of custom messages
|
|
54
|
+
- [Tree-shaking](/extensions/chatbot/tree-shaking): Bundle size optimization and import best practices
|
|
54
55
|
|
|
55
56
|
---
|
|
56
57
|
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
SelectList,
|
|
18
18
|
SelectOption
|
|
19
19
|
} from '@patternfly/react-core';
|
|
20
|
-
import { rehypeCodeBlockToggle } from '@patternfly/chatbot/dist/
|
|
20
|
+
import { rehypeCodeBlockToggle } from '@patternfly/chatbot/dist/dynamic/Message';
|
|
21
21
|
|
|
22
22
|
export const BotMessageExample: FunctionComponent = () => {
|
|
23
23
|
const [variant, setVariant] = useState<string>('Code');
|
package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithQuickStart.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FunctionComponent } from 'react';
|
|
2
2
|
import Message from '@patternfly/chatbot/dist/dynamic/Message';
|
|
3
3
|
import { explorePipelinesQuickStart } from './explore-pipeline-quickstart.ts';
|
|
4
|
-
import { monitorSampleAppQuickStart } from '
|
|
5
|
-
import { QuickStart } from '@patternfly/chatbot/dist/
|
|
4
|
+
import { monitorSampleAppQuickStart } from './monitor-sampleapp-quickstart.ts';
|
|
5
|
+
import { QuickStart } from '@patternfly/chatbot/dist/dynamic/Message';
|
|
6
6
|
|
|
7
7
|
export const MessageWithQuickStartExample: FunctionComponent = () => (
|
|
8
8
|
<>
|