@patternfly/chatbot 6.7.0-prerelease.3 → 6.7.0-prerelease.5

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.
Files changed (63) hide show
  1. package/dist/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.js +2 -2
  2. package/dist/cjs/Message/Message.d.ts +4 -2
  3. package/dist/cjs/Message/Message.js +19 -2
  4. package/dist/cjs/Message/Message.test.js +13 -1
  5. package/dist/cjs/MessageDivider/MessageDivider.js +1 -1
  6. package/dist/css/main.css +61 -78
  7. package/dist/css/main.css.map +1 -1
  8. package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.js +2 -2
  9. package/dist/esm/Message/Message.d.ts +4 -2
  10. package/dist/esm/Message/Message.js +19 -2
  11. package/dist/esm/Message/Message.test.js +13 -1
  12. package/dist/esm/MessageDivider/MessageDivider.js +1 -1
  13. package/package.json +8 -8
  14. package/patternfly-docs/content/extensions/chatbot/examples/Messages/BotMessage.tsx +3 -13
  15. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithClickedResponseActions.tsx +0 -2
  16. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithCustomResponseActions.tsx +0 -2
  17. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithCustomStructure.tsx +1 -2
  18. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithDeepThinking.tsx +0 -4
  19. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithDividers.tsx +1 -8
  20. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithFeedback.tsx +0 -5
  21. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithFeedbackTimeout.tsx +0 -2
  22. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithIconSwapping.tsx +0 -2
  23. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithMarkdownDeepThinking.tsx +0 -2
  24. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithMarkdownToolCall.tsx +0 -2
  25. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithMarkdownToolResponse.tsx +0 -2
  26. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithMultipleActionGroups.tsx +0 -3
  27. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithPersistedActions.tsx +0 -2
  28. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithQuickResponses.tsx +0 -8
  29. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithQuickStart.tsx +0 -4
  30. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithResponseActions.tsx +0 -3
  31. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithSources.tsx +0 -10
  32. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithToolCall.tsx +0 -4
  33. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithToolResponse.tsx +0 -3
  34. package/patternfly-docs/content/extensions/chatbot/examples/Messages/UserMessage.tsx +6 -0
  35. package/patternfly-docs/content/extensions/chatbot/examples/Messages/UserMessageWithExtraContent.tsx +0 -4
  36. package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotWelcomeInteraction.tsx +0 -3
  37. package/patternfly-docs/content/extensions/chatbot/examples/demos/Chatbot.tsx +0 -4
  38. package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotAttachment.tsx +0 -2
  39. package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotAttachmentMenu.tsx +1 -3
  40. package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotCompact.tsx +0 -4
  41. package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotDisplayMode.tsx +0 -4
  42. package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotInDrawer.tsx +0 -4
  43. package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotScrolling.tsx +0 -4
  44. package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotTranscripts.tsx +0 -7
  45. package/patternfly-docs/content/extensions/chatbot/examples/demos/EmbeddedChatbot.tsx +0 -4
  46. package/patternfly-docs/content/extensions/chatbot/examples/demos/EmbeddedComparisonChatbot.tsx +0 -3
  47. package/patternfly-docs/content/extensions/chatbot/examples/demos/Feedback.tsx +0 -2
  48. package/patternfly-docs/content/extensions/chatbot/examples/demos/WhiteEmbeddedChatbot.tsx +0 -4
  49. package/src/Chatbot/Chatbot.scss +42 -26
  50. package/src/ChatbotContent/ChatbotContent.scss +10 -5
  51. package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.scss +14 -0
  52. package/src/ChatbotFooter/ChatbotFooter.scss +12 -10
  53. package/src/ChatbotHeader/ChatbotHeader.scss +7 -53
  54. package/src/ChatbotHeader/ChatbotHeaderOptionsDropdown.tsx +2 -2
  55. package/src/ChatbotModal/ChatbotModal.scss +0 -9
  56. package/src/ChatbotWelcomePrompt/__snapshots__/ChatbotWelcomePrompt.test.tsx.snap +1 -1
  57. package/src/FileDetailsLabel/FileDetailsLabel.scss +5 -0
  58. package/src/Message/Message.scss +5 -0
  59. package/src/Message/Message.test.tsx +13 -1
  60. package/src/Message/Message.tsx +37 -11
  61. package/src/MessageBar/MessageBar.scss +4 -24
  62. package/src/MessageDivider/MessageDivider.scss +7 -9
  63. package/src/MessageDivider/MessageDivider.tsx +1 -1
@@ -32,8 +32,9 @@ import DeepThinking from '../DeepThinking';
32
32
  import ToolCall from '../ToolCall';
33
33
  import MarkdownContent from '../MarkdownContent';
34
34
  import { css } from '@patternfly/react-styles';
35
+ import RhUiAiChatbotIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-ai-chatbot-icon';
35
36
  export const MessageBase = (_a) => {
36
- var { children, role, alignment = 'start', isMetadataVisible = true, content, extraContent, name, avatar, timestamp, isLoading, actions, persistActionSelection, showActionsOnInteraction = false, sources, botWord = 'AI', loadingWord = 'Loading message', codeBlockProps, quickResponses, quickResponseContainerProps = { numLabels: 5 }, attachments, hasRoundAvatar = true, avatarProps, quickStarts, userFeedbackForm, userFeedbackComplete, isLiveRegion = true, innerRef, tableProps, openLinkInNewTab = true, additionalRehypePlugins = [], additionalRemarkPlugins = [], linkProps, error, isEditable, editPlaceholder = 'Edit prompt message...', updateWord = 'Update', cancelWord = 'Cancel', onEditUpdate, onEditCancel, inputRef, editFormProps, isCompact, isMarkdownDisabled, reactMarkdownProps, toolResponse, deepThinking, remarkGfmProps, toolCall, hasNoImagesInUserMessages = true, isPrimary, useFilledIconsOnClick } = _a, props = __rest(_a, ["children", "role", "alignment", "isMetadataVisible", "content", "extraContent", "name", "avatar", "timestamp", "isLoading", "actions", "persistActionSelection", "showActionsOnInteraction", "sources", "botWord", "loadingWord", "codeBlockProps", "quickResponses", "quickResponseContainerProps", "attachments", "hasRoundAvatar", "avatarProps", "quickStarts", "userFeedbackForm", "userFeedbackComplete", "isLiveRegion", "innerRef", "tableProps", "openLinkInNewTab", "additionalRehypePlugins", "additionalRemarkPlugins", "linkProps", "error", "isEditable", "editPlaceholder", "updateWord", "cancelWord", "onEditUpdate", "onEditCancel", "inputRef", "editFormProps", "isCompact", "isMarkdownDisabled", "reactMarkdownProps", "toolResponse", "deepThinking", "remarkGfmProps", "toolCall", "hasNoImagesInUserMessages", "isPrimary", "useFilledIconsOnClick"]);
37
+ var { children, role, alignment = 'start', isMetadataVisible = true, content, extraContent, name, avatar, isAvatarHidden = false, timestamp, isLoading, actions, persistActionSelection, showActionsOnInteraction = false, sources, botWord = 'AI', loadingWord = 'Loading message', codeBlockProps, quickResponses, quickResponseContainerProps = { numLabels: 5 }, attachments, hasRoundAvatar = true, avatarProps, quickStarts, userFeedbackForm, userFeedbackComplete, isLiveRegion = true, innerRef, tableProps, openLinkInNewTab = true, additionalRehypePlugins = [], additionalRemarkPlugins = [], linkProps, error, isEditable, editPlaceholder = 'Edit prompt message...', updateWord = 'Update', cancelWord = 'Cancel', onEditUpdate, onEditCancel, inputRef, editFormProps, isCompact, isMarkdownDisabled, reactMarkdownProps, toolResponse, deepThinking, remarkGfmProps, toolCall, hasNoImagesInUserMessages = true, isPrimary, useFilledIconsOnClick } = _a, props = __rest(_a, ["children", "role", "alignment", "isMetadataVisible", "content", "extraContent", "name", "avatar", "isAvatarHidden", "timestamp", "isLoading", "actions", "persistActionSelection", "showActionsOnInteraction", "sources", "botWord", "loadingWord", "codeBlockProps", "quickResponses", "quickResponseContainerProps", "attachments", "hasRoundAvatar", "avatarProps", "quickStarts", "userFeedbackForm", "userFeedbackComplete", "isLiveRegion", "innerRef", "tableProps", "openLinkInNewTab", "additionalRehypePlugins", "additionalRemarkPlugins", "linkProps", "error", "isEditable", "editPlaceholder", "updateWord", "cancelWord", "onEditUpdate", "onEditCancel", "inputRef", "editFormProps", "isCompact", "isMarkdownDisabled", "reactMarkdownProps", "toolResponse", "deepThinking", "remarkGfmProps", "toolCall", "hasNoImagesInUserMessages", "isPrimary", "useFilledIconsOnClick"]);
37
38
  const [messageText, setMessageText] = useState(content);
38
39
  useEffect(() => {
39
40
  setMessageText(content);
@@ -61,7 +62,23 @@ export const MessageBase = (_a) => {
61
62
  }
62
63
  return (_jsxs(_Fragment, { children: [beforeMainContent && _jsx(_Fragment, { children: beforeMainContent }), error ? _jsx(ErrorMessage, Object.assign({}, error)) : handleMarkdown()] }));
63
64
  };
64
- return (_jsxs("section", Object.assign({ "aria-label": `Message from ${role} - ${dateString}`, className: css(`pf-chatbot__message pf-chatbot__message--${role}`, alignment === 'end' && 'pf-m-end'), "aria-live": isLiveRegion ? 'polite' : undefined, "aria-atomic": isLiveRegion ? false : undefined, ref: innerRef }, props, { children: [avatar && (_jsx(Avatar, Object.assign({ className: `pf-chatbot__message-avatar ${hasRoundAvatar ? 'pf-chatbot__message-avatar--round' : ''} ${avatarClassName ? avatarClassName : ''}`, src: avatar, alt: "" }, avatarProps))), _jsxs("div", { className: "pf-chatbot__message-contents", children: [isMetadataVisible && (_jsxs("div", { className: "pf-chatbot__message-meta", children: [name && (_jsx("span", { className: "pf-chatbot__message-name", children: _jsx(Truncate, { content: name }) })), role === 'bot' && (_jsx(Label, { variant: "outline", isCompact: true, children: botWord })), _jsx(Timestamp, { date: date, children: timestamp })] })), _jsx("div", { className: "pf-chatbot__message-response", children: children ? (_jsx(_Fragment, { children: children })) : (_jsxs(_Fragment, { children: [_jsxs("div", { className: "pf-chatbot__message-and-actions", children: [renderMessage(), afterMainContent && _jsx(_Fragment, { children: afterMainContent }), toolResponse && _jsx(ToolResponse, Object.assign({}, toolResponse)), deepThinking && _jsx(DeepThinking, Object.assign({}, deepThinking)), toolCall && _jsx(ToolCall, Object.assign({}, toolCall)), !isLoading && sources && _jsx(SourcesCard, Object.assign({}, sources, { isCompact: isCompact })), quickStarts && quickStarts.quickStart && (_jsx(QuickStartTile, { quickStart: quickStarts.quickStart, onSelectQuickStart: quickStarts.onSelectQuickStart, minuteWord: quickStarts.minuteWord, minuteWordPlural: quickStarts.minuteWordPlural, prerequisiteWord: quickStarts.prerequisiteWord, prerequisiteWordPlural: quickStarts.prerequisiteWordPlural, quickStartButtonAriaLabel: quickStarts.quickStartButtonAriaLabel, isCompact: isCompact })), !isLoading && !isEditable && actions && (_jsx(_Fragment, { children: Array.isArray(actions) ? (_jsx("div", { className: css('pf-chatbot__response-actions-groups', showActionsOnInteraction && 'pf-m-visible-interaction'), children: actions.map((actionGroup, index) => (_jsx(ResponseActions, { actions: actionGroup.actions || actionGroup, persistActionSelection: persistActionSelection || actionGroup.persistActionSelection, useFilledIconsOnClick: useFilledIconsOnClick }, index))) })) : (_jsx(ResponseActions, { actions: actions, persistActionSelection: persistActionSelection, useFilledIconsOnClick: useFilledIconsOnClick, showActionsOnInteraction: showActionsOnInteraction })) })), userFeedbackForm && (_jsx(UserFeedback, Object.assign({}, userFeedbackForm, { timestamp: dateString, isCompact: isCompact }))), userFeedbackComplete && (_jsx(UserFeedbackComplete, Object.assign({}, userFeedbackComplete, { timestamp: dateString, isCompact: isCompact }))), !isLoading && quickResponses && (_jsx(QuickResponse, { quickResponses: quickResponses, quickResponseContainerProps: quickResponseContainerProps, isCompact: isCompact }))] }), attachments && (_jsx("div", { className: "pf-chatbot__message-attachments-container", children: attachments.map((attachment) => {
65
+ const avatarClasses = css(`pf-chatbot__message-avatar ${hasRoundAvatar ? 'pf-chatbot__message-avatar--round' : ''} ${avatarClassName ? avatarClassName : ''}`);
66
+ /* We are using an empty alt tag intentionally in order to reduce noise on screen readers */
67
+ const botAvatar = (_jsx(Avatar, Object.assign({ className: avatarClasses, alt: "", isBordered: true }, avatarProps, { src: undefined, initials: undefined, children: _jsx(RhUiAiChatbotIcon, {}) })));
68
+ let _avatar;
69
+ if (!isAvatarHidden) {
70
+ if (role === 'bot') {
71
+ _avatar = botAvatar;
72
+ }
73
+ else if (avatar) {
74
+ _avatar =
75
+ typeof avatar === 'string' ? (_jsx(Avatar, Object.assign({ className: avatarClasses, src: avatar, alt: "" }, avatarProps))) : (_jsx(Avatar, Object.assign({ className: avatarClasses, alt: "" }, avatarProps, { children: avatar })));
76
+ }
77
+ else if (avatarProps === null || avatarProps === void 0 ? void 0 : avatarProps.initials) {
78
+ _avatar = _jsx(Avatar, Object.assign({ className: avatarClasses, alt: "" }, avatarProps));
79
+ }
80
+ }
81
+ return (_jsxs("section", Object.assign({ "aria-label": `Message from ${role} - ${dateString}`, className: css(`pf-chatbot__message pf-chatbot__message--${role}`, alignment === 'end' && 'pf-m-end'), "aria-live": isLiveRegion ? 'polite' : undefined, "aria-atomic": isLiveRegion ? false : undefined, ref: innerRef }, props, { children: [_avatar && _avatar, _jsxs("div", { className: "pf-chatbot__message-contents", children: [isMetadataVisible && (_jsxs("div", { className: "pf-chatbot__message-meta", children: [name && (_jsx("span", { className: "pf-chatbot__message-name", children: _jsx(Truncate, { content: name }) })), role === 'bot' && (_jsx(Label, { variant: "outline", isCompact: true, children: botWord })), _jsx(Timestamp, { date: date, children: timestamp })] })), _jsx("div", { className: "pf-chatbot__message-response", children: children ? (_jsx(_Fragment, { children: children })) : (_jsxs(_Fragment, { children: [_jsxs("div", { className: "pf-chatbot__message-and-actions", children: [renderMessage(), afterMainContent && _jsx(_Fragment, { children: afterMainContent }), toolResponse && _jsx(ToolResponse, Object.assign({}, toolResponse)), deepThinking && _jsx(DeepThinking, Object.assign({}, deepThinking)), toolCall && _jsx(ToolCall, Object.assign({}, toolCall)), !isLoading && sources && _jsx(SourcesCard, Object.assign({}, sources, { isCompact: isCompact })), quickStarts && quickStarts.quickStart && (_jsx(QuickStartTile, { quickStart: quickStarts.quickStart, onSelectQuickStart: quickStarts.onSelectQuickStart, minuteWord: quickStarts.minuteWord, minuteWordPlural: quickStarts.minuteWordPlural, prerequisiteWord: quickStarts.prerequisiteWord, prerequisiteWordPlural: quickStarts.prerequisiteWordPlural, quickStartButtonAriaLabel: quickStarts.quickStartButtonAriaLabel, isCompact: isCompact })), !isLoading && !isEditable && actions && (_jsx(_Fragment, { children: Array.isArray(actions) ? (_jsx("div", { className: css('pf-chatbot__response-actions-groups', showActionsOnInteraction && 'pf-m-visible-interaction'), children: actions.map((actionGroup, index) => (_jsx(ResponseActions, { actions: actionGroup.actions || actionGroup, persistActionSelection: persistActionSelection || actionGroup.persistActionSelection, useFilledIconsOnClick: useFilledIconsOnClick }, index))) })) : (_jsx(ResponseActions, { actions: actions, persistActionSelection: persistActionSelection, useFilledIconsOnClick: useFilledIconsOnClick, showActionsOnInteraction: showActionsOnInteraction })) })), userFeedbackForm && (_jsx(UserFeedback, Object.assign({}, userFeedbackForm, { timestamp: dateString, isCompact: isCompact }))), userFeedbackComplete && (_jsx(UserFeedbackComplete, Object.assign({}, userFeedbackComplete, { timestamp: dateString, isCompact: isCompact }))), !isLoading && quickResponses && (_jsx(QuickResponse, { quickResponses: quickResponses, quickResponseContainerProps: quickResponseContainerProps, isCompact: isCompact }))] }), attachments && (_jsx("div", { className: "pf-chatbot__message-attachments-container", children: attachments.map((attachment) => {
65
82
  var _a;
66
83
  return (_jsx("div", { className: "pf-chatbot__message-attachment", children: _jsx(FileDetailsLabel, { fileName: attachment.name, fileId: attachment.id, onClose: attachment.onClose, onClick: attachment.onClick, isLoading: attachment.isLoading, closeButtonAriaLabel: attachment.closeButtonAriaLabel, languageTestId: attachment.languageTestId, spinnerTestId: attachment.spinnerTestId, variant: isPrimary ? 'outline' : undefined }) }, (_a = attachment.id) !== null && _a !== void 0 ? _a : attachment.name));
67
84
  }) })), !isLoading && endContent && _jsx(_Fragment, { children: endContent })] })) })] })] })));
@@ -217,11 +217,23 @@ describe('Message', () => {
217
217
  })).toBeInTheDocument();
218
218
  });
219
219
  it('should render avatar correctly', () => {
220
- render(_jsx(Message, { avatar: "./testImg", role: "bot", name: "Bot", content: "Hi" }));
220
+ render(_jsx(Message, { avatar: "./testImg", role: "user", name: "A", content: "Hi" }));
221
221
  expect(screen.getByRole('img')).toHaveAttribute('src', './testImg');
222
222
  });
223
223
  it('should not render avatar if no avatar prop is passed', () => {
224
+ render(_jsx(Message, { role: "user", name: "A", content: "Hi" }));
225
+ expect(screen.queryByRole('img')).not.toBeInTheDocument();
226
+ });
227
+ it('should render bot avatar if no avatar prop is passed', () => {
224
228
  render(_jsx(Message, { role: "bot", name: "Bot", content: "Hi" }));
229
+ expect(screen.queryAllByRole('img', { hidden: true })[0]).toBeVisible();
230
+ });
231
+ it('should not render avatar if isAvatarHidden is passed', () => {
232
+ render(_jsx(Message, { role: "user", name: "A", content: "Hi", isAvatarHidden: true }));
233
+ expect(screen.queryByRole('img')).not.toBeInTheDocument();
234
+ });
235
+ it('should not render bot avatar if isAvatarHidden is passed', () => {
236
+ render(_jsx(Message, { role: "bot", name: "Bot", content: "Hi", isAvatarHidden: true }));
225
237
  expect(screen.queryByRole('img')).not.toBeInTheDocument();
226
238
  });
227
239
  it('should render botWord correctly', () => {
@@ -14,7 +14,7 @@ import { Divider, Label } from '@patternfly/react-core';
14
14
  const MessageDivider = (_a) => {
15
15
  var { variant = 'inset', content = new Date().toLocaleDateString() } = _a, props = __rest(_a, ["variant", "content"]);
16
16
  if (variant === 'inset') {
17
- return (_jsxs("div", Object.assign({ className: "pf-chatbot__message-divider pf-m-divider pf-m-wrap" }, props, { children: [_jsx(Divider, {}), _jsx(Label, { variant: "outline", children: content })] })));
17
+ return (_jsxs("div", Object.assign({ className: "pf-chatbot__message-divider pf-m-divider pf-m-wrap" }, props, { children: [_jsx(Divider, {}), _jsx(Label, { children: content })] })));
18
18
  }
19
19
  return (_jsx("div", Object.assign({ className: "pf-chatbot__message-divider pf-m-wrap" }, props, { children: _jsx(Label, { children: content }) })));
20
20
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/chatbot",
3
- "version": "6.7.0-prerelease.3",
3
+ "version": "6.7.0-prerelease.5",
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",
@@ -33,11 +33,11 @@
33
33
  "tag": "prerelease"
34
34
  },
35
35
  "dependencies": {
36
- "@patternfly/react-code-editor": "^6.1.0",
37
- "@patternfly/react-core": "^6.1.0",
38
- "@patternfly/react-icons": "^6.5.1",
39
- "@patternfly/react-styles": "^6.1.0",
40
- "@patternfly/react-table": "^6.1.0",
36
+ "@patternfly/react-code-editor": "^6.6.0",
37
+ "@patternfly/react-core": "^6.6.0",
38
+ "@patternfly/react-icons": "^6.6.0",
39
+ "@patternfly/react-styles": "^6.6.0",
40
+ "@patternfly/react-table": "^6.6.0",
41
41
  "@segment/analytics-next": "^1.76.0",
42
42
  "clsx": "^2.1.0",
43
43
  "path-browserify": "^1.0.1",
@@ -66,8 +66,8 @@
66
66
  },
67
67
  "devDependencies": {
68
68
  "@octokit/rest": "^18.0.0",
69
- "@patternfly/documentation-framework": "6.28.9",
70
- "@patternfly/patternfly": "^6.1.0",
69
+ "@patternfly/documentation-framework": "^6.47.0",
70
+ "@patternfly/patternfly": "^6.6.0",
71
71
  "@patternfly/patternfly-a11y": "^5.0.0",
72
72
  "@types/dom-speech-recognition": "^0.0.4",
73
73
  "@types/react": "^18.2.61",
@@ -8,7 +8,6 @@ import {
8
8
  Ref
9
9
  } from 'react';
10
10
  import Message from '@patternfly/chatbot/dist/dynamic/Message';
11
- import patternflyAvatar from './patternfly_avatar.jpg';
12
11
  import squareImg from './PF-social-color-square.svg';
13
12
  import {
14
13
  AlertActionLink,
@@ -290,25 +289,18 @@ _Italic text, formatted with single underscores_
290
289
 
291
290
  return (
292
291
  <>
292
+ <Message name="Bot" role="bot" content={`This is a text-based message from a bot named "Bot."`} />
293
293
  <Message
294
294
  name="Bot"
295
295
  role="bot"
296
- avatar={patternflyAvatar}
297
- content={`This is a text-based message from a bot named "Bot."`}
298
- />
299
- <Message
300
- name="Bot"
301
- role="bot"
302
- avatar={patternflyAvatar}
303
296
  content={`This is a text-based message from "Bot," with an updated timestamp.`}
304
297
  timestamp="1 hour ago"
305
298
  />
306
- <Message name="Bot" role="bot" avatar={patternflyAvatar} content="Example content" isLoading />
307
- <Message role="bot" avatar={patternflyAvatar} content="This message is from a nameless bot." />
299
+ <Message name="Bot" role="bot" content="Example content" isLoading />
300
+ <Message role="bot" content="This message is from a nameless bot." />
308
301
  <Message
309
302
  name="Default Openshift Container Platform Assistant That Can Help With Any Query You Might Need Help With"
310
303
  role="bot"
311
- avatar={patternflyAvatar}
312
304
  content="This is a message from a bot with really long name: it's truncated!"
313
305
  />
314
306
  <Message
@@ -322,7 +314,6 @@ _Italic text, formatted with single underscores_
322
314
  <Message
323
315
  name="Bot"
324
316
  role="bot"
325
- avatar={patternflyAvatar}
326
317
  isMetadataVisible={false}
327
318
  content="This is a message from a bot with metadata not visible."
328
319
  />
@@ -355,7 +346,6 @@ _Italic text, formatted with single underscores_
355
346
  <Message
356
347
  name="Bot"
357
348
  role="bot"
358
- avatar={patternflyAvatar}
359
349
  content={renderContent()}
360
350
  tableProps={
361
351
  variant === 'Table' ? { 'aria-label': 'App information and user roles for bot messages' } : undefined
@@ -1,13 +1,11 @@
1
1
  import { FunctionComponent } from 'react';
2
2
 
3
3
  import Message from '@patternfly/chatbot/dist/dynamic/Message';
4
- import patternflyAvatar from './patternfly_avatar.jpg';
5
4
 
6
5
  export const ResponseActionClickedExample: FunctionComponent = () => (
7
6
  <Message
8
7
  name="Bot"
9
8
  role="bot"
10
- avatar={patternflyAvatar}
11
9
  content="I updated your account with those settings. You're ready to set up your first dashboard!"
12
10
  actions={{
13
11
  // eslint-disable-next-line no-console
@@ -1,7 +1,6 @@
1
1
  import { FunctionComponent } from 'react';
2
2
 
3
3
  import Message from '@patternfly/chatbot/dist/dynamic/Message';
4
- import patternflyAvatar from './patternfly_avatar.jpg';
5
4
  import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon';
6
5
  import RedoIcon from '@patternfly/react-icons/dist/esm/icons/redo-icon';
7
6
 
@@ -9,7 +8,6 @@ export const CustomActionExample: FunctionComponent = () => (
9
8
  <Message
10
9
  name="Bot"
11
10
  role="bot"
12
- avatar={patternflyAvatar}
13
11
  content="I updated your account with those settings. You're ready to set up your first dashboard!"
14
12
  actions={{
15
13
  regenerate: {
@@ -11,7 +11,6 @@ import ToolCall from '@patternfly/chatbot/dist/dynamic/ToolCall';
11
11
  import ToolResponse from '@patternfly/chatbot/dist/dynamic/ToolResponse';
12
12
  import FileDetailsLabel from '@patternfly/chatbot/dist/dynamic/FileDetailsLabel';
13
13
  import ResponseActions, { ResponseActionsGroups } from '@patternfly/chatbot/dist/dynamic/ResponseActions';
14
- import patternflyAvatar from './patternfly_avatar.jpg';
15
14
  import userAvatar from './user_avatar.svg';
16
15
 
17
16
  const handlePositiveResponse = () => {
@@ -36,7 +35,7 @@ const handleListen = () => {
36
35
 
37
36
  export const MessageWithCustomStructure: FunctionComponent = () => (
38
37
  <>
39
- <Message name="Bot" role="bot" avatar={patternflyAvatar}>
38
+ <Message name="Bot" role="bot">
40
39
  <MessageAndActions>
41
40
  <MarkdownContent
42
41
  content={`This is a basic message with a more custom, fine-tuned structure. You can pass markdown to the MarkdownContent component, such as **bold content with double asterisks** or _italic content with single underscores_.`}
@@ -1,13 +1,11 @@
1
1
  import { FunctionComponent } from 'react';
2
2
  import Message from '@patternfly/chatbot/dist/dynamic/Message';
3
- import patternflyAvatar from './patternfly_avatar.jpg';
4
3
 
5
4
  export const MessageWithDeepThinkingExample: FunctionComponent = () => (
6
5
  <>
7
6
  <Message
8
7
  name="Bot"
9
8
  role="bot"
10
- avatar={patternflyAvatar}
11
9
  content="This example has a body description that's within the recommended limit of 2 lines."
12
10
  deepThinking={{
13
11
  toggleContent: 'Show thinking',
@@ -18,7 +16,6 @@ export const MessageWithDeepThinkingExample: FunctionComponent = () => (
18
16
  <Message
19
17
  name="Bot"
20
18
  role="bot"
21
- avatar={patternflyAvatar}
22
19
  content="This example has deep thinking that is collapsed by default:"
23
20
  deepThinking={{
24
21
  isDefaultExpanded: false,
@@ -30,7 +27,6 @@ export const MessageWithDeepThinkingExample: FunctionComponent = () => (
30
27
  <Message
31
28
  name="Bot"
32
29
  role="bot"
33
- avatar={patternflyAvatar}
34
30
  content="This example has deep thinking that is loading:"
35
31
  deepThinking={{
36
32
  isDefaultExpanded: false,
@@ -1,21 +1,14 @@
1
1
  import { FunctionComponent } from 'react';
2
2
  import Message from '@patternfly/chatbot/dist/dynamic/Message';
3
- import patternflyAvatar from './patternfly_avatar.jpg';
4
3
  import MessageDivider from '@patternfly/chatbot/dist/dynamic/MessageDivider';
5
4
 
6
5
  export const MessageWithDividersExample: FunctionComponent = () => (
7
6
  <>
8
- <Message
9
- name="Bot"
10
- role="bot"
11
- avatar={patternflyAvatar}
12
- content={`This is a text-based message from a bot named "Bot."`}
13
- />
7
+ <Message name="Bot" role="bot" content={`This is a text-based message from a bot named "Bot."`} />
14
8
  <MessageDivider variant="inset" content="1 hour ago" />
15
9
  <Message
16
10
  name="Bot"
17
11
  role="bot"
18
- avatar={patternflyAvatar}
19
12
  content={`This is a text-based message from "Bot," with an updated timestamp.`}
20
13
  timestamp="1 hour ago"
21
14
  />
@@ -1,6 +1,5 @@
1
1
  import { useState, FunctionComponent } from 'react';
2
2
  import Message from '@patternfly/chatbot/dist/dynamic/Message';
3
- import patternflyAvatar from './patternfly_avatar.jpg';
4
3
  import { Checkbox, FormGroup, Flex, FlexItem } from '@patternfly/react-core';
5
4
 
6
5
  export const MessageWithFeedbackExample: FunctionComponent = () => {
@@ -50,7 +49,6 @@ export const MessageWithFeedbackExample: FunctionComponent = () => {
50
49
  <Message
51
50
  name="Bot"
52
51
  role="bot"
53
- avatar={patternflyAvatar}
54
52
  content="This is a message with the feedback card:"
55
53
  userFeedbackForm={{
56
54
  quickResponses: [
@@ -73,7 +71,6 @@ export const MessageWithFeedbackExample: FunctionComponent = () => {
73
71
  <Message
74
72
  name="Bot"
75
73
  role="bot"
76
- avatar={patternflyAvatar}
77
74
  content="This is a compact message with the feedback card:"
78
75
  userFeedbackForm={{
79
76
  quickResponses: [
@@ -112,7 +109,6 @@ export const MessageWithFeedbackExample: FunctionComponent = () => {
112
109
  <Message
113
110
  name="Bot"
114
111
  role="bot"
115
- avatar={patternflyAvatar}
116
112
  content="This is a thank-you message, which is displayed once the feedback card is submitted:"
117
113
  // eslint-disable-next-line no-console
118
114
  userFeedbackComplete={{
@@ -126,7 +122,6 @@ export const MessageWithFeedbackExample: FunctionComponent = () => {
126
122
  <Message
127
123
  name="Bot"
128
124
  role="bot"
129
- avatar={patternflyAvatar}
130
125
  content="This is a compact thank-you message, which is displayed once the feedback card is submitted:"
131
126
  // eslint-disable-next-line no-console
132
127
  userFeedbackComplete={{
@@ -1,6 +1,5 @@
1
1
  import { FunctionComponent, useState } from 'react';
2
2
  import Message from '@patternfly/chatbot/dist/dynamic/Message';
3
- import patternflyAvatar from './patternfly_avatar.jpg';
4
3
  import { Button } from '@patternfly/react-core';
5
4
 
6
5
  export const MessageWithFeedbackTimeoutExample: FunctionComponent = () => {
@@ -17,7 +16,6 @@ export const MessageWithFeedbackTimeoutExample: FunctionComponent = () => {
17
16
  <Message
18
17
  name="Bot"
19
18
  role="bot"
20
- avatar={patternflyAvatar}
21
19
  content="This completion message times out after you click **Show card**:"
22
20
  userFeedbackComplete={hasFeedback ? { timeout: true, onTimeout: () => setHasFeedback(false) } : undefined}
23
21
  isLiveRegion
@@ -1,13 +1,11 @@
1
1
  import { FunctionComponent } from 'react';
2
2
 
3
3
  import Message from '@patternfly/chatbot/dist/dynamic/Message';
4
- import patternflyAvatar from './patternfly_avatar.jpg';
5
4
 
6
5
  export const IconSwappingExample: FunctionComponent = () => (
7
6
  <Message
8
7
  name="Bot"
9
8
  role="bot"
10
- avatar={patternflyAvatar}
11
9
  content="Click the response actions to see the outlined icons swapped with the filled variants!"
12
10
  actions={{
13
11
  // eslint-disable-next-line no-console
@@ -1,12 +1,10 @@
1
1
  import { FunctionComponent } from 'react';
2
2
  import Message from '@patternfly/chatbot/dist/dynamic/Message';
3
- import patternflyAvatar from './patternfly_avatar.jpg';
4
3
 
5
4
  export const MessageWithMarkdownDeepThinkingExample: FunctionComponent = () => (
6
5
  <Message
7
6
  name="Bot"
8
7
  role="bot"
9
- avatar={patternflyAvatar}
10
8
  content="This example shows how to use Markdown formatting in deep thinking content. Note the use of shouldRetainStyles to maintain proper formatting:"
11
9
  deepThinking={{
12
10
  shouldRetainStyles: true,
@@ -1,12 +1,10 @@
1
1
  import { FunctionComponent } from 'react';
2
2
  import Message from '@patternfly/chatbot/dist/dynamic/Message';
3
- import patternflyAvatar from './patternfly_avatar.jpg';
4
3
 
5
4
  export const MessageWithMarkdownToolCallExample: FunctionComponent = () => (
6
5
  <Message
7
6
  name="Bot"
8
7
  role="bot"
9
- avatar={patternflyAvatar}
10
8
  content="This example shows how to use Markdown formatting in tool call content. Note the use of shouldRetainStyles to maintain proper formatting:"
11
9
  toolCall={{
12
10
  shouldRetainStyles: true,
@@ -1,6 +1,5 @@
1
1
  import { useState, FunctionComponent, MouseEvent as ReactMouseEvent } from 'react';
2
2
  import Message from '@patternfly/chatbot/dist/dynamic/Message';
3
- import patternflyAvatar from './patternfly_avatar.jpg';
4
3
  import { CopyIcon, WrenchIcon } from '@patternfly/react-icons';
5
4
  import {
6
5
  Button,
@@ -35,7 +34,6 @@ export const MessageWithToolResponseExample: FunctionComponent = () => {
35
34
  <Message
36
35
  name="Bot"
37
36
  role="bot"
38
- avatar={patternflyAvatar}
39
37
  content="This example shows how to use Markdown formatting in tool response content. Note the use of shouldRetainStyles to maintain proper formatting:"
40
38
  toolResponse={{
41
39
  shouldRetainStyles: true,
@@ -1,14 +1,12 @@
1
1
  import { FunctionComponent } from 'react';
2
2
 
3
3
  import Message from '@patternfly/chatbot/dist/dynamic/Message';
4
- import patternflyAvatar from './patternfly_avatar.jpg';
5
4
 
6
5
  export const MessageWithMultipleActionGroups: FunctionComponent = () => (
7
6
  <>
8
7
  <Message
9
8
  name="Bot"
10
9
  role="bot"
11
- avatar={patternflyAvatar}
12
10
  content="This message contains multiple action groups, each with their own selection persistence: \n1. Feedback actions (thumbs up/down) with persistent selections \n2. Utility actions (copy, download) with non-persistent selections \n3. Listen action with persistent selection"
13
11
  actions={[
14
12
  {
@@ -41,7 +39,6 @@ export const MessageWithMultipleActionGroups: FunctionComponent = () => (
41
39
  <Message
42
40
  name="Bot"
43
41
  role="bot"
44
- avatar={patternflyAvatar}
45
42
  content="This message contains multiple action groups, both of which persist selections."
46
43
  actions={[
47
44
  {
@@ -1,13 +1,11 @@
1
1
  import { FunctionComponent } from 'react';
2
2
 
3
3
  import Message from '@patternfly/chatbot/dist/dynamic/Message';
4
- import patternflyAvatar from './patternfly_avatar.jpg';
5
4
 
6
5
  export const MessageWithPersistedActions: FunctionComponent = () => (
7
6
  <Message
8
7
  name="Bot"
9
8
  role="bot"
10
- avatar={patternflyAvatar}
11
9
  content="I updated your account with those settings. You're ready to set up your first dashboard! Click a button and then click outside the message - notice the selection persists."
12
10
  actions={{
13
11
  // eslint-disable-next-line no-console
@@ -1,6 +1,5 @@
1
1
  import { FunctionComponent } from 'react';
2
2
  import Message from '@patternfly/chatbot/dist/dynamic/Message';
3
- import patternflyAvatar from './patternfly_avatar.jpg';
4
3
  import { CopyIcon, WrenchIcon } from '@patternfly/react-icons';
5
4
 
6
5
  export const MessageWithQuickResponsesExample: FunctionComponent = () => (
@@ -8,7 +7,6 @@ export const MessageWithQuickResponsesExample: FunctionComponent = () => (
8
7
  <Message
9
8
  name="Bot"
10
9
  role="bot"
11
- avatar={patternflyAvatar}
12
10
  content="Did you clear your cache?"
13
11
  quickResponses={[
14
12
  { id: '1', content: 'Yes', onClick: () => alert('Clicked yes') },
@@ -18,7 +16,6 @@ export const MessageWithQuickResponsesExample: FunctionComponent = () => (
18
16
  <Message
19
17
  name="Bot"
20
18
  role="bot"
21
- avatar={patternflyAvatar}
22
19
  content="What browser are you noticing the issue in?"
23
20
  quickResponses={[
24
21
  { id: '1', content: 'Microsoft Edge', onClick: () => alert('Clicked Edge') },
@@ -31,7 +28,6 @@ export const MessageWithQuickResponsesExample: FunctionComponent = () => (
31
28
  <Message
32
29
  name="Bot"
33
30
  role="bot"
34
- avatar={patternflyAvatar}
35
31
  content="Welcome back, User! How can I help you today?"
36
32
  quickResponses={[
37
33
  { id: '1', content: 'Help me with an access issue', onClick: () => alert('Clicked id 1') },
@@ -44,7 +40,6 @@ export const MessageWithQuickResponsesExample: FunctionComponent = () => (
44
40
  <Message
45
41
  name="Bot"
46
42
  role="bot"
47
- avatar={patternflyAvatar}
48
43
  content="Did you clear your cache?"
49
44
  quickResponses={[
50
45
  { id: '1', content: 'Yes', isDisabled: true },
@@ -54,7 +49,6 @@ export const MessageWithQuickResponsesExample: FunctionComponent = () => (
54
49
  <Message
55
50
  name="Bot"
56
51
  role="bot"
57
- avatar={patternflyAvatar}
58
52
  content="Welcome back, User! How can I help you today?"
59
53
  quickResponses={[
60
54
  { id: '1', content: 'Help me with an access issue', onClick: () => alert('Clicked id 1') },
@@ -67,7 +61,6 @@ export const MessageWithQuickResponsesExample: FunctionComponent = () => (
67
61
  <Message
68
62
  name="Bot"
69
63
  role="bot"
70
- avatar={patternflyAvatar}
71
64
  content="Example with compact responses"
72
65
  quickResponses={[
73
66
  { id: '1', content: 'Yes', onClick: () => alert('Clicked id 1') },
@@ -78,7 +71,6 @@ export const MessageWithQuickResponsesExample: FunctionComponent = () => (
78
71
  <Message
79
72
  name="Bot"
80
73
  role="bot"
81
- avatar={patternflyAvatar}
82
74
  content="Example with icons"
83
75
  quickResponses={[
84
76
  { id: '1', content: 'Update your settings', onClick: () => alert('Clicked yes'), icon: <WrenchIcon /> },
@@ -1,6 +1,5 @@
1
1
  import { FunctionComponent } from 'react';
2
2
  import Message from '@patternfly/chatbot/dist/dynamic/Message';
3
- import patternflyAvatar from './patternfly_avatar.jpg';
4
3
  import { explorePipelinesQuickStart } from './explore-pipeline-quickstart.ts';
5
4
  import { monitorSampleAppQuickStart } from '@patternfly/chatbot/src/Message/QuickStarts/monitor-sampleapp-quickstart.ts';
6
5
  import { QuickStart } from '@patternfly/chatbot/dist/esm/Message/QuickStarts/types';
@@ -10,7 +9,6 @@ export const MessageWithQuickStartExample: FunctionComponent = () => (
10
9
  <Message
11
10
  name="Bot"
12
11
  role="bot"
13
- avatar={patternflyAvatar}
14
12
  content="Follow this quick guide to install the Pipelines Operator."
15
13
  quickStarts={{
16
14
  quickStart: explorePipelinesQuickStart as QuickStart,
@@ -20,7 +18,6 @@ export const MessageWithQuickStartExample: FunctionComponent = () => (
20
18
  <Message
21
19
  name="Bot"
22
20
  role="bot"
23
- avatar={patternflyAvatar}
24
21
  content="This quick start tile includes prerequisites and a default icon."
25
22
  quickStarts={{
26
23
  quickStart: monitorSampleAppQuickStart,
@@ -30,7 +27,6 @@ export const MessageWithQuickStartExample: FunctionComponent = () => (
30
27
  <Message
31
28
  name="Bot"
32
29
  role="bot"
33
- avatar={patternflyAvatar}
34
30
  content="This quick start tile is compact"
35
31
  quickStarts={{
36
32
  quickStart: monitorSampleAppQuickStart,
@@ -1,14 +1,12 @@
1
1
  import { FunctionComponent } from 'react';
2
2
 
3
3
  import Message from '@patternfly/chatbot/dist/dynamic/Message';
4
- import patternflyAvatar from './patternfly_avatar.jpg';
5
4
 
6
5
  export const ResponseActionExample: FunctionComponent = () => (
7
6
  <>
8
7
  <Message
9
8
  name="Bot"
10
9
  role="bot"
11
- avatar={patternflyAvatar}
12
10
  content="I updated your account with those settings. You're ready to set up your first dashboard!"
13
11
  actions={{
14
12
  // eslint-disable-next-line no-console
@@ -27,7 +25,6 @@ export const ResponseActionExample: FunctionComponent = () => (
27
25
  name="Bot"
28
26
  role="bot"
29
27
  showActionsOnInteraction
30
- avatar={patternflyAvatar}
31
28
  content="This message has response actions visually hidden until you hover over the message via mouse, or an action would receive focus via keyboard."
32
29
  actions={{
33
30
  // eslint-disable-next-line no-console
@@ -1,6 +1,5 @@
1
1
  import { FunctionComponent, MouseEvent as ReactMouseEvent, KeyboardEvent as ReactKeyboardEvent } from 'react';
2
2
  import Message from '@patternfly/chatbot/dist/dynamic/Message';
3
- import patternflyAvatar from './patternfly_avatar.jpg';
4
3
  import { Button, Flex, FlexItem, Label, Popover } from '@patternfly/react-core';
5
4
  import { OutlinedQuestionCircleIcon } from '@patternfly/react-icons';
6
5
 
@@ -31,7 +30,6 @@ export const MessageWithSourcesExample: FunctionComponent = () => {
31
30
  <Message
32
31
  name="Bot"
33
32
  role="bot"
34
- avatar={patternflyAvatar}
35
33
  content="This example has a custom subtitle and footer with no pagination"
36
34
  sources={{
37
35
  sources: [
@@ -83,7 +81,6 @@ export const MessageWithSourcesExample: FunctionComponent = () => {
83
81
  <Message
84
82
  name="Bot"
85
83
  role="bot"
86
- avatar={patternflyAvatar}
87
84
  content="This example has a body description that's within the recommended limit of 2 lines:"
88
85
  sources={{
89
86
  sources: [
@@ -112,7 +109,6 @@ export const MessageWithSourcesExample: FunctionComponent = () => {
112
109
  <Message
113
110
  name="Bot"
114
111
  role="bot"
115
- avatar={patternflyAvatar}
116
112
  content="This example has a body description that's longer than the recommended limit of 2 lines, with a link to load the rest of the description:"
117
113
  sources={{
118
114
  sources: [
@@ -141,7 +137,6 @@ export const MessageWithSourcesExample: FunctionComponent = () => {
141
137
  <Message
142
138
  name="Bot"
143
139
  role="bot"
144
- avatar={patternflyAvatar}
145
140
  content="This example has a truncated title:"
146
141
  sources={{
147
142
  sources: [
@@ -164,7 +159,6 @@ export const MessageWithSourcesExample: FunctionComponent = () => {
164
159
  <Message
165
160
  name="Bot"
166
161
  role="bot"
167
- avatar={patternflyAvatar}
168
162
  content="This example only includes 1 source:"
169
163
  sources={{
170
164
  sources: [
@@ -181,7 +175,6 @@ export const MessageWithSourcesExample: FunctionComponent = () => {
181
175
  <Message
182
176
  name="Bot"
183
177
  role="bot"
184
- avatar={patternflyAvatar}
185
178
  content="This example has a title and no body description:"
186
179
  sources={{
187
180
  sources: [
@@ -203,7 +196,6 @@ export const MessageWithSourcesExample: FunctionComponent = () => {
203
196
  <Message
204
197
  name="Bot"
205
198
  role="bot"
206
- avatar={patternflyAvatar}
207
199
  content="This example displays the source as a link, without a title (not recommended)"
208
200
  sources={{
209
201
  sources: [
@@ -223,7 +215,6 @@ export const MessageWithSourcesExample: FunctionComponent = () => {
223
215
  <Message
224
216
  name="Bot"
225
217
  role="bot"
226
- avatar={patternflyAvatar}
227
218
  content="This example displays a compact sources card"
228
219
  sources={{
229
220
  sources: [
@@ -245,7 +236,6 @@ export const MessageWithSourcesExample: FunctionComponent = () => {
245
236
  <Message
246
237
  name="Bot"
247
238
  role="bot"
248
- avatar={patternflyAvatar}
249
239
  content="This example demonstrates the non-paginated layout option. When enabled, all source cards are displayed in a flex layout that wraps automatically based on available space:"
250
240
  sources={{
251
241
  sources: [