@patternfly/chatbot 6.7.1 → 6.8.0-prerelease.2
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.js +1 -1
- package/dist/cjs/Message/Message.test.js +31 -14
- package/dist/cjs/Message/TableMessage/TableCellContent.d.ts +8 -0
- package/dist/cjs/Message/TableMessage/TableCellContent.js +9 -0
- package/dist/cjs/Message/TableMessage/TdMessage.js +5 -1
- package/dist/cjs/Message/TableMessage/ThMessage.js +5 -1
- package/dist/cjs/ResponseActions/ResponseActions.js +21 -5
- package/dist/cjs/ResponseActions/ResponseActions.test.js +33 -29
- package/dist/cjs/SourcesCardBase/SourcesCardBase.js +1 -1
- package/dist/cjs/SourcesCardBase/SourcesCardBase.test.js +4 -4
- package/dist/css/main.css +7 -14
- package/dist/css/main.css.map +1 -1
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.js +1 -1
- package/dist/esm/Message/Message.test.js +31 -14
- package/dist/esm/Message/TableMessage/TableCellContent.d.ts +8 -0
- package/dist/esm/Message/TableMessage/TableCellContent.js +7 -0
- package/dist/esm/Message/TableMessage/TdMessage.js +2 -1
- package/dist/esm/Message/TableMessage/ThMessage.js +2 -1
- package/dist/esm/ResponseActions/ResponseActions.js +22 -6
- package/dist/esm/ResponseActions/ResponseActions.test.js +33 -29
- package/dist/esm/SourcesCardBase/SourcesCardBase.js +1 -1
- package/dist/esm/SourcesCardBase/SourcesCardBase.test.js +4 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotMessageBarAttach.tsx +11 -7
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotMessageBarCustomActions.tsx +46 -35
- package/patternfly-docs/content/extensions/chatbot/examples/UI/UI.md +7 -1
- package/patternfly-docs/content/extensions/chatbot/examples/demos/EmbeddedComparisonChatbot.tsx +4 -2
- package/src/AttachMenu/AttachMenu.scss +0 -9
- package/src/Chatbot/Chatbot.scss +0 -7
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.scss +1 -1
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.tsx +7 -1
- package/src/ChatbotHeader/ChatbotHeader.scss +1 -0
- package/src/ChatbotToggle/ChatbotToggle.scss +1 -1
- package/src/Message/Message.test.tsx +42 -14
- package/src/Message/TableMessage/TableCellContent.tsx +9 -0
- package/src/Message/TableMessage/TdMessage.tsx +6 -1
- package/src/Message/TableMessage/ThMessage.tsx +6 -1
- package/src/ResponseActions/ResponseActions.test.tsx +33 -29
- package/src/ResponseActions/ResponseActions.tsx +37 -18
- package/src/SourcesCard/SourcesCard.scss +5 -0
- package/src/SourcesCardBase/SourcesCardBase.test.tsx +4 -4
- package/src/SourcesCardBase/SourcesCardBase.tsx +12 -3
|
@@ -19,15 +19,18 @@ import rehypeExternalLinks from '../__mocks__/rehype-external-links';
|
|
|
19
19
|
import { AlertActionLink, Button, CodeBlockAction } from '@patternfly/react-core';
|
|
20
20
|
// Mock the icon components
|
|
21
21
|
jest.mock('@patternfly/react-icons', () => ({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
RhUiLikeIcon: () => _jsx("div", { children: "RhUiLikeIcon" }),
|
|
23
|
+
RhUiLikeFillIcon: () => _jsx("div", { children: "RhUiLikeFillIcon" }),
|
|
24
|
+
RhUiDislikeIcon: () => _jsx("div", { children: "RhUiDislikeIcon" }),
|
|
25
|
+
RhUiDislikeFillIcon: () => _jsx("div", { children: "RhUiDislikeFillIcon" }),
|
|
26
|
+
RhUiCopyIcon: () => _jsx("div", { children: "RhUiCopyIcon" }),
|
|
27
|
+
RhUiCopyFillIcon: () => _jsx("div", { children: "RhUiCopyFillIcon" }),
|
|
28
|
+
RhUiEditIcon: () => _jsx("div", { children: "RhUiEditIcon" }),
|
|
29
|
+
RhUiEditFillIcon: () => _jsx("div", { children: "RhUiEditFillIcon" }),
|
|
30
|
+
RhUiVolumeUpIcon: () => _jsx("div", { children: "RhUiVolumeUpIcon" }),
|
|
31
|
+
RhUiVolumeUpFillIcon: () => _jsx("div", { children: "RhUiVolumeUpFillIcon" }),
|
|
32
|
+
RhUiExportIcon: () => _jsx("div", { children: "RhUiExportIcon" }),
|
|
33
|
+
RhUiExportFillIcon: () => _jsx("div", { children: "RhUiExportFillIcon" }),
|
|
31
34
|
CheckIcon: () => _jsx("div", { children: "CheckIcon" }),
|
|
32
35
|
CloseIcon: () => _jsx("div", { children: "CloseIcon" }),
|
|
33
36
|
ExternalLinkSquareAltIcon: () => _jsx("div", { children: "ExternalLinkSquareAltIcon" }),
|
|
@@ -116,6 +119,12 @@ const TABLE = `
|
|
|
116
119
|
| Cell 3 | Cell 4 |
|
|
117
120
|
|
|
118
121
|
`;
|
|
122
|
+
const TABLE_WITH_INLINE_CODE = `
|
|
123
|
+
| Status | Finding |
|
|
124
|
+
|---|---|
|
|
125
|
+
| \`1/1 Running\`, 0 restarts | Healthy — no crashes |
|
|
126
|
+
| \`1/1 Ready\` | Desired replicas met |
|
|
127
|
+
`;
|
|
119
128
|
const ONE_COLUMN_TABLE = `
|
|
120
129
|
|
|
121
130
|
| Column 1 |
|
|
@@ -785,6 +794,14 @@ describe('Message', () => {
|
|
|
785
794
|
render(_jsx(Message, { avatar: "./img", role: "user", name: "User", content: TABLE, tableProps: { 'aria-label': 'Test' } }));
|
|
786
795
|
expect(screen.getByRole('grid', { name: /Test/i })).toBeTruthy();
|
|
787
796
|
});
|
|
797
|
+
it('should wrap table cell content so inline code does not break grid layout', () => {
|
|
798
|
+
render(_jsx(Message, { avatar: "./img", role: "user", name: "User", content: TABLE_WITH_INLINE_CODE, tableProps: { 'aria-label': 'Inline code table' } }));
|
|
799
|
+
const statusCell = screen.getByRole('cell', { name: /1\/1 Running/i });
|
|
800
|
+
expect(statusCell.querySelector(':scope > .pf-chatbot__message-table-cell-content')).toBeTruthy();
|
|
801
|
+
expect(statusCell.querySelector(':scope > code')).toBeFalsy();
|
|
802
|
+
expect(statusCell.querySelector('.pf-chatbot__message-inline-code')).toBeTruthy();
|
|
803
|
+
expect(screen.getByRole('columnheader', { name: /Status/i }).querySelector('.pf-chatbot__message-table-cell-content')).toBeTruthy();
|
|
804
|
+
});
|
|
788
805
|
it('should render footnote correctly', () => {
|
|
789
806
|
render(_jsx(Message, { avatar: "./img", role: "user", name: "User", content: FOOTNOTE }));
|
|
790
807
|
expect(screen.getByText(/This is some text with a footnote/i)).toBeTruthy();
|
|
@@ -1034,10 +1051,10 @@ describe('Message', () => {
|
|
|
1034
1051
|
render(_jsx(Message, { avatar: "./img", role: "bot", name: "Bot", content: "Hi", actions: {
|
|
1035
1052
|
positive: { onClick: jest.fn() }
|
|
1036
1053
|
} }));
|
|
1037
|
-
expect(screen.getByText('
|
|
1054
|
+
expect(screen.getByText('RhUiLikeIcon')).toBeInTheDocument();
|
|
1038
1055
|
yield user.click(screen.getByRole('button', { name: /Good response/i }));
|
|
1039
|
-
expect(screen.getByText('
|
|
1040
|
-
expect(screen.queryByText('
|
|
1056
|
+
expect(screen.getByText('RhUiLikeIcon')).toBeInTheDocument();
|
|
1057
|
+
expect(screen.queryByText('RhUiLikeFillIcon')).not.toBeInTheDocument();
|
|
1041
1058
|
}));
|
|
1042
1059
|
it('should swap icons when useFilledIconsOnClick is true', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
1043
1060
|
const user = userEvent.setup();
|
|
@@ -1045,8 +1062,8 @@ describe('Message', () => {
|
|
|
1045
1062
|
positive: { onClick: jest.fn() }
|
|
1046
1063
|
}, useFilledIconsOnClick: true }));
|
|
1047
1064
|
yield user.click(screen.getByRole('button', { name: /Good response/i }));
|
|
1048
|
-
expect(screen.getByText('
|
|
1049
|
-
expect(screen.queryByText('
|
|
1065
|
+
expect(screen.getByText('RhUiLikeFillIcon')).toBeInTheDocument();
|
|
1066
|
+
expect(screen.queryByText('RhUiLikeIcon')).not.toBeInTheDocument();
|
|
1050
1067
|
}));
|
|
1051
1068
|
it('should apply pf-m-visible-interaction class to response actions when showActionsOnInteraction is true', () => {
|
|
1052
1069
|
render(_jsx(Message, { avatar: "./img", role: "bot", name: "Bot", content: "Hi", showActionsOnInteraction: true, actions: {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wraps table cell content in a single element so phrasing content (e.g. inline
|
|
3
|
+
* code mixed with text) is not a direct child of td/th.
|
|
4
|
+
*/
|
|
5
|
+
declare const TableCellContent: ({ children }: {
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default TableCellContent;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Wraps table cell content in a single element so phrasing content (e.g. inline
|
|
4
|
+
* code mixed with text) is not a direct child of td/th.
|
|
5
|
+
*/
|
|
6
|
+
const TableCellContent = ({ children }) => (_jsx("span", { className: "pf-chatbot__message-table-cell-content", children: children }));
|
|
7
|
+
export default TableCellContent;
|
|
@@ -11,8 +11,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { Td } from '@patternfly/react-table';
|
|
14
|
+
import TableCellContent from './TableCellContent';
|
|
14
15
|
const TdMessage = (_a) => {
|
|
15
16
|
var { children } = _a, props = __rest(_a, ["children"]);
|
|
16
|
-
return _jsx(Td, Object.assign({}, props, { children: children }));
|
|
17
|
+
return (_jsx(Td, Object.assign({}, props, { children: _jsx(TableCellContent, { children: children }) })));
|
|
17
18
|
};
|
|
18
19
|
export default TdMessage;
|
|
@@ -11,8 +11,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { Th } from '@patternfly/react-table';
|
|
14
|
+
import TableCellContent from './TableCellContent';
|
|
14
15
|
const ThMessage = (_a) => {
|
|
15
16
|
var { children } = _a, props = __rest(_a, ["children"]);
|
|
16
|
-
return _jsx(Th, Object.assign({}, props, { children: children }));
|
|
17
|
+
return (_jsx(Th, Object.assign({}, props, { children: _jsx(TableCellContent, { children: children }) })));
|
|
17
18
|
};
|
|
18
19
|
export default ThMessage;
|
|
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { createElement as _createElement } from "react";
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
import { useEffect, useRef, useState } from 'react';
|
|
15
|
-
import {
|
|
15
|
+
import { RhUiLikeIcon, RhUiLikeFillIcon, RhUiDislikeIcon, RhUiDislikeFillIcon, RhUiCopyIcon, RhUiCopyFillIcon, RhUiEditIcon, RhUiEditFillIcon, RhUiVolumeUpIcon, RhUiVolumeUpFillIcon, RhUiExportIcon, RhUiExportFillIcon } from '@patternfly/react-icons';
|
|
16
16
|
import ResponseActionButton from './ResponseActionButton';
|
|
17
17
|
import { css } from '@patternfly/react-styles';
|
|
18
18
|
export const ResponseActions = (_a) => {
|
|
@@ -85,12 +85,28 @@ export const ResponseActions = (_a) => {
|
|
|
85
85
|
};
|
|
86
86
|
const iconMap = {
|
|
87
87
|
positive: {
|
|
88
|
-
filled: _jsx(
|
|
89
|
-
outlined: _jsx(
|
|
88
|
+
filled: _jsx(RhUiLikeFillIcon, {}),
|
|
89
|
+
outlined: _jsx(RhUiLikeIcon, {})
|
|
90
90
|
},
|
|
91
91
|
negative: {
|
|
92
|
-
filled: _jsx(
|
|
93
|
-
outlined: _jsx(
|
|
92
|
+
filled: _jsx(RhUiDislikeFillIcon, {}),
|
|
93
|
+
outlined: _jsx(RhUiDislikeIcon, {})
|
|
94
|
+
},
|
|
95
|
+
listen: {
|
|
96
|
+
filled: _jsx(RhUiVolumeUpFillIcon, {}),
|
|
97
|
+
outlined: _jsx(RhUiVolumeUpIcon, {})
|
|
98
|
+
},
|
|
99
|
+
copy: {
|
|
100
|
+
filled: _jsx(RhUiCopyFillIcon, {}),
|
|
101
|
+
outlined: _jsx(RhUiCopyIcon, {})
|
|
102
|
+
},
|
|
103
|
+
edit: {
|
|
104
|
+
filled: _jsx(RhUiEditFillIcon, {}),
|
|
105
|
+
outlined: _jsx(RhUiEditIcon, {})
|
|
106
|
+
},
|
|
107
|
+
download: {
|
|
108
|
+
filled: _jsx(RhUiExportFillIcon, {}),
|
|
109
|
+
outlined: _jsx(RhUiExportIcon, {})
|
|
94
110
|
}
|
|
95
111
|
};
|
|
96
112
|
const getIcon = (actionName) => {
|
|
@@ -105,7 +121,7 @@ export const ResponseActions = (_a) => {
|
|
|
105
121
|
// to disappear but the tooltip will remain visible.
|
|
106
122
|
const getTooltipContainer = () => responseActions.current || document.body;
|
|
107
123
|
const getTooltipProps = (tooltipProps) => (Object.assign(Object.assign({}, (showActionsOnInteraction && { appendTo: getTooltipContainer })), tooltipProps));
|
|
108
|
-
return (_jsxs("div", Object.assign({ ref: responseActions, className: css('pf-chatbot__response-actions', showActionsOnInteraction && 'pf-m-visible-interaction', className) }, props, { children: [positive && (_jsx(ResponseActionButton, Object.assign({}, positive, { ariaLabel: (_b = positive.ariaLabel) !== null && _b !== void 0 ? _b : 'Good response', clickedAriaLabel: (_c = positive.ariaLabel) !== null && _c !== void 0 ? _c : 'Good response recorded', onClick: (e) => handleClick(e, 'positive', positive.onClick), className: positive.className, isDisabled: positive.isDisabled, tooltipContent: (_d = positive.tooltipContent) !== null && _d !== void 0 ? _d : 'Good response', clickedTooltipContent: (_e = positive.clickedTooltipContent) !== null && _e !== void 0 ? _e : 'Good response recorded', tooltipProps: getTooltipProps(positive.tooltipProps), icon: getIcon('positive'), isClicked: activeButton === 'positive', ref: positive.ref, "aria-expanded": positive['aria-expanded'], "aria-controls": positive['aria-controls'] }))), negative && (_jsx(ResponseActionButton, Object.assign({}, negative, { ariaLabel: (_f = negative.ariaLabel) !== null && _f !== void 0 ? _f : 'Bad response', clickedAriaLabel: (_g = negative.ariaLabel) !== null && _g !== void 0 ? _g : 'Bad response recorded', onClick: (e) => handleClick(e, 'negative', negative.onClick), className: negative.className, isDisabled: negative.isDisabled, tooltipContent: (_h = negative.tooltipContent) !== null && _h !== void 0 ? _h : 'Bad response', clickedTooltipContent: (_j = negative.clickedTooltipContent) !== null && _j !== void 0 ? _j : 'Bad response recorded', tooltipProps: getTooltipProps(negative.tooltipProps), icon: getIcon('negative'), isClicked: activeButton === 'negative', ref: negative.ref, "aria-expanded": negative['aria-expanded'], "aria-controls": negative['aria-controls'] }))), copy && (_jsx(ResponseActionButton, Object.assign({}, copy, { ariaLabel: (_k = copy.ariaLabel) !== null && _k !== void 0 ? _k : 'Copy', clickedAriaLabel: (_l = copy.ariaLabel) !== null && _l !== void 0 ? _l : 'Copied', onClick: (e) => handleClick(e, 'copy', copy.onClick), className: copy.className, isDisabled: copy.isDisabled, tooltipContent: (_m = copy.tooltipContent) !== null && _m !== void 0 ? _m : 'Copy', clickedTooltipContent: (_o = copy.clickedTooltipContent) !== null && _o !== void 0 ? _o : 'Copied', tooltipProps: getTooltipProps(copy.tooltipProps), icon:
|
|
124
|
+
return (_jsxs("div", Object.assign({ ref: responseActions, className: css('pf-chatbot__response-actions', showActionsOnInteraction && 'pf-m-visible-interaction', className) }, props, { children: [positive && (_jsx(ResponseActionButton, Object.assign({}, positive, { ariaLabel: (_b = positive.ariaLabel) !== null && _b !== void 0 ? _b : 'Good response', clickedAriaLabel: (_c = positive.ariaLabel) !== null && _c !== void 0 ? _c : 'Good response recorded', onClick: (e) => handleClick(e, 'positive', positive.onClick), className: positive.className, isDisabled: positive.isDisabled, tooltipContent: (_d = positive.tooltipContent) !== null && _d !== void 0 ? _d : 'Good response', clickedTooltipContent: (_e = positive.clickedTooltipContent) !== null && _e !== void 0 ? _e : 'Good response recorded', tooltipProps: getTooltipProps(positive.tooltipProps), icon: getIcon('positive'), isClicked: activeButton === 'positive', ref: positive.ref, "aria-expanded": positive['aria-expanded'], "aria-controls": positive['aria-controls'] }))), negative && (_jsx(ResponseActionButton, Object.assign({}, negative, { ariaLabel: (_f = negative.ariaLabel) !== null && _f !== void 0 ? _f : 'Bad response', clickedAriaLabel: (_g = negative.ariaLabel) !== null && _g !== void 0 ? _g : 'Bad response recorded', onClick: (e) => handleClick(e, 'negative', negative.onClick), className: negative.className, isDisabled: negative.isDisabled, tooltipContent: (_h = negative.tooltipContent) !== null && _h !== void 0 ? _h : 'Bad response', clickedTooltipContent: (_j = negative.clickedTooltipContent) !== null && _j !== void 0 ? _j : 'Bad response recorded', tooltipProps: getTooltipProps(negative.tooltipProps), icon: getIcon('negative'), isClicked: activeButton === 'negative', ref: negative.ref, "aria-expanded": negative['aria-expanded'], "aria-controls": negative['aria-controls'] }))), copy && (_jsx(ResponseActionButton, Object.assign({}, copy, { ariaLabel: (_k = copy.ariaLabel) !== null && _k !== void 0 ? _k : 'Copy', clickedAriaLabel: (_l = copy.ariaLabel) !== null && _l !== void 0 ? _l : 'Copied', onClick: (e) => handleClick(e, 'copy', copy.onClick), className: copy.className, isDisabled: copy.isDisabled, tooltipContent: (_m = copy.tooltipContent) !== null && _m !== void 0 ? _m : 'Copy', clickedTooltipContent: (_o = copy.clickedTooltipContent) !== null && _o !== void 0 ? _o : 'Copied', tooltipProps: getTooltipProps(copy.tooltipProps), icon: getIcon('copy'), isClicked: activeButton === 'copy', ref: copy.ref, "aria-expanded": copy['aria-expanded'], "aria-controls": copy['aria-controls'] }))), edit && (_jsx(ResponseActionButton, Object.assign({}, edit, { ariaLabel: (_p = edit.ariaLabel) !== null && _p !== void 0 ? _p : 'Edit', clickedAriaLabel: (_q = edit.ariaLabel) !== null && _q !== void 0 ? _q : 'Editing', onClick: (e) => handleClick(e, 'edit', edit.onClick), className: edit.className, isDisabled: edit.isDisabled, tooltipContent: (_r = edit.tooltipContent) !== null && _r !== void 0 ? _r : 'Edit ', clickedTooltipContent: (_s = edit.clickedTooltipContent) !== null && _s !== void 0 ? _s : 'Editing', tooltipProps: getTooltipProps(edit.tooltipProps), icon: getIcon('edit'), isClicked: activeButton === 'edit', ref: edit.ref, "aria-expanded": edit['aria-expanded'], "aria-controls": edit['aria-controls'] }))), share && (_jsx(ResponseActionButton, Object.assign({}, share, { ariaLabel: (_t = share.ariaLabel) !== null && _t !== void 0 ? _t : 'Share', clickedAriaLabel: (_u = share.ariaLabel) !== null && _u !== void 0 ? _u : 'Shared', onClick: (e) => handleClick(e, 'share', share.onClick), className: share.className, isDisabled: share.isDisabled, tooltipContent: (_v = share.tooltipContent) !== null && _v !== void 0 ? _v : 'Share', clickedTooltipContent: (_w = share.clickedTooltipContent) !== null && _w !== void 0 ? _w : 'Shared', tooltipProps: getTooltipProps(share.tooltipProps), icon: getIcon('download'), isClicked: activeButton === 'share', ref: share.ref, "aria-expanded": share['aria-expanded'], "aria-controls": share['aria-controls'] }))), download && (_jsx(ResponseActionButton, Object.assign({}, download, { ariaLabel: (_x = download.ariaLabel) !== null && _x !== void 0 ? _x : 'Download', clickedAriaLabel: (_y = download.ariaLabel) !== null && _y !== void 0 ? _y : 'Downloaded', onClick: (e) => handleClick(e, 'download', download.onClick), className: download.className, isDisabled: download.isDisabled, tooltipContent: (_z = download.tooltipContent) !== null && _z !== void 0 ? _z : 'Download', clickedTooltipContent: (_0 = download.clickedTooltipContent) !== null && _0 !== void 0 ? _0 : 'Downloaded', tooltipProps: getTooltipProps(download.tooltipProps), icon: getIcon('download'), isClicked: activeButton === 'download', ref: download.ref, "aria-expanded": download['aria-expanded'], "aria-controls": download['aria-controls'] }))), listen && (_jsx(ResponseActionButton, Object.assign({}, listen, { ariaLabel: (_1 = listen.ariaLabel) !== null && _1 !== void 0 ? _1 : 'Listen', clickedAriaLabel: (_2 = listen.ariaLabel) !== null && _2 !== void 0 ? _2 : 'Listening', onClick: (e) => handleClick(e, 'listen', listen.onClick), className: listen.className, isDisabled: listen.isDisabled, tooltipContent: (_3 = listen.tooltipContent) !== null && _3 !== void 0 ? _3 : 'Listen', clickedTooltipContent: (_4 = listen.clickedTooltipContent) !== null && _4 !== void 0 ? _4 : 'Listening', tooltipProps: getTooltipProps(listen.tooltipProps), icon: getIcon('listen'), isClicked: activeButton === 'listen', ref: listen.ref, "aria-expanded": listen['aria-expanded'], "aria-controls": listen['aria-controls'] }))), Object.keys(additionalActions).map((action) => {
|
|
109
125
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
110
126
|
return (_createElement(ResponseActionButton, Object.assign({}, additionalActions[action], { key: action, ariaLabel: (_a = additionalActions[action]) === null || _a === void 0 ? void 0 : _a.ariaLabel, clickedAriaLabel: (_b = additionalActions[action]) === null || _b === void 0 ? void 0 : _b.clickedAriaLabel, onClick: (e) => { var _a; return handleClick(e, action, (_a = additionalActions[action]) === null || _a === void 0 ? void 0 : _a.onClick); }, className: (_c = additionalActions[action]) === null || _c === void 0 ? void 0 : _c.className, isDisabled: (_d = additionalActions[action]) === null || _d === void 0 ? void 0 : _d.isDisabled, tooltipContent: (_e = additionalActions[action]) === null || _e === void 0 ? void 0 : _e.tooltipContent, tooltipProps: getTooltipProps((_f = additionalActions[action]) === null || _f === void 0 ? void 0 : _f.tooltipProps), clickedTooltipContent: (_g = additionalActions[action]) === null || _g === void 0 ? void 0 : _g.clickedTooltipContent, icon: (_h = additionalActions[action]) === null || _h === void 0 ? void 0 : _h.icon, isClicked: activeButton === action, ref: (_j = additionalActions[action]) === null || _j === void 0 ? void 0 : _j.ref, "aria-expanded": (_k = additionalActions[action]) === null || _k === void 0 ? void 0 : _k['aria-expanded'], "aria-controls": (_l = additionalActions[action]) === null || _l === void 0 ? void 0 : _l['aria-controls'] })));
|
|
111
127
|
})] })));
|
|
@@ -16,17 +16,21 @@ import { DownloadIcon, InfoCircleIcon, RedoIcon } from '@patternfly/react-icons'
|
|
|
16
16
|
import Message from '../Message';
|
|
17
17
|
// Mock the icon components
|
|
18
18
|
jest.mock('@patternfly/react-icons', () => ({
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
RhUiLikeIcon: () => _jsx("div", { children: "RhUiLikeIcon" }),
|
|
20
|
+
RhUiLikeFillIcon: () => _jsx("div", { children: "RhUiLikeFillIcon" }),
|
|
21
|
+
RhUiDislikeIcon: () => _jsx("div", { children: "RhUiDislikeIcon" }),
|
|
22
|
+
RhUiDislikeFillIcon: () => _jsx("div", { children: "RhUiDislikeFillIcon" }),
|
|
23
|
+
RhUiCopyIcon: () => _jsx("div", { children: "RhUiCopyIcon" }),
|
|
24
|
+
RhUiCopyFillIcon: () => _jsx("div", { children: "RhUiCopyFillIcon" }),
|
|
25
|
+
RhUiEditIcon: () => _jsx("div", { children: "RhUiEditIcon" }),
|
|
26
|
+
RhUiEditFillIcon: () => _jsx("div", { children: "RhUiEditFillIcon" }),
|
|
27
|
+
RhUiVolumeUpIcon: () => _jsx("div", { children: "RhUiVolumeUpIcon" }),
|
|
28
|
+
RhUiVolumeUpFillIcon: () => _jsx("div", { children: "RhUiVolumeUpFillIcon" }),
|
|
29
|
+
RhUiExportIcon: () => _jsx("div", { children: "RhUiExportIcon" }),
|
|
30
|
+
RhUiExportFillIcon: () => _jsx("div", { children: "RhUiExportFillIcon" }),
|
|
24
31
|
DownloadIcon: () => _jsx("div", { children: "DownloadIcon" }),
|
|
25
32
|
InfoCircleIcon: () => _jsx("div", { children: "InfoCircleIcon" }),
|
|
26
|
-
RedoIcon: () => _jsx("div", { children: "RedoIcon" })
|
|
27
|
-
ExternalLinkAltIcon: () => _jsx("div", { children: "ExternalLinkAltIcon" }),
|
|
28
|
-
VolumeUpIcon: () => _jsx("div", { children: "VolumeUpIcon" }),
|
|
29
|
-
PencilAltIcon: () => _jsx("div", { children: "PencilAltIcon" })
|
|
33
|
+
RedoIcon: () => _jsx("div", { children: "RedoIcon" })
|
|
30
34
|
}));
|
|
31
35
|
const ALL_ACTIONS = [
|
|
32
36
|
{ type: 'positive', label: 'Good response', clickedLabel: 'Good response recorded' },
|
|
@@ -358,10 +362,10 @@ describe('ResponseActions', () => {
|
|
|
358
362
|
positive: { onClick: jest.fn() },
|
|
359
363
|
negative: { onClick: jest.fn() }
|
|
360
364
|
} }));
|
|
361
|
-
expect(screen.getByText('
|
|
362
|
-
expect(screen.getByText('
|
|
363
|
-
expect(screen.queryByText('
|
|
364
|
-
expect(screen.queryByText('
|
|
365
|
+
expect(screen.getByText('RhUiLikeIcon')).toBeInTheDocument();
|
|
366
|
+
expect(screen.getByText('RhUiDislikeIcon')).toBeInTheDocument();
|
|
367
|
+
expect(screen.queryByText('RhUiLikeFillIcon')).not.toBeInTheDocument();
|
|
368
|
+
expect(screen.queryByText('RhUiDislikeFillIcon')).not.toBeInTheDocument();
|
|
365
369
|
});
|
|
366
370
|
describe('positive actions', () => {
|
|
367
371
|
it('should not swap positive icon when clicked and useFilledIconsOnClick is false', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -370,8 +374,8 @@ describe('ResponseActions', () => {
|
|
|
370
374
|
positive: { onClick: jest.fn() }
|
|
371
375
|
}, useFilledIconsOnClick: false }));
|
|
372
376
|
yield user.click(screen.getByRole('button', { name: 'Good response' }));
|
|
373
|
-
expect(screen.getByText('
|
|
374
|
-
expect(screen.queryByText('
|
|
377
|
+
expect(screen.getByText('RhUiLikeIcon')).toBeInTheDocument();
|
|
378
|
+
expect(screen.queryByText('RhUiLikeFillIcon')).not.toBeInTheDocument();
|
|
375
379
|
}));
|
|
376
380
|
it('should swap positive icon from outline to filled when clicked with useFilledIconsOnClick', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
377
381
|
const user = userEvent.setup();
|
|
@@ -379,8 +383,8 @@ describe('ResponseActions', () => {
|
|
|
379
383
|
positive: { onClick: jest.fn() }
|
|
380
384
|
}, useFilledIconsOnClick: true }));
|
|
381
385
|
yield user.click(screen.getByRole('button', { name: 'Good response' }));
|
|
382
|
-
expect(screen.getByText('
|
|
383
|
-
expect(screen.queryByText('
|
|
386
|
+
expect(screen.getByText('RhUiLikeFillIcon')).toBeInTheDocument();
|
|
387
|
+
expect(screen.queryByText('RhUiLikeIcon')).not.toBeInTheDocument();
|
|
384
388
|
}));
|
|
385
389
|
it('should revert positive icon to outline icon when clicking outside', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
386
390
|
const user = userEvent.setup();
|
|
@@ -388,9 +392,9 @@ describe('ResponseActions', () => {
|
|
|
388
392
|
positive: { onClick: jest.fn() }
|
|
389
393
|
}, useFilledIconsOnClick: true }), _jsx("div", { "data-testid": "outside", children: "Outside" })] }));
|
|
390
394
|
yield user.click(screen.getByRole('button', { name: 'Good response' }));
|
|
391
|
-
expect(screen.getByText('
|
|
395
|
+
expect(screen.getByText('RhUiLikeFillIcon')).toBeInTheDocument();
|
|
392
396
|
yield user.click(screen.getByTestId('outside'));
|
|
393
|
-
expect(screen.getByText('
|
|
397
|
+
expect(screen.getByText('RhUiLikeIcon')).toBeInTheDocument();
|
|
394
398
|
}));
|
|
395
399
|
it('should not revert positive icon to outline icon when clicking outside if persistActionSelection is true', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
396
400
|
const user = userEvent.setup();
|
|
@@ -398,9 +402,9 @@ describe('ResponseActions', () => {
|
|
|
398
402
|
positive: { onClick: jest.fn() }
|
|
399
403
|
}, persistActionSelection: true, useFilledIconsOnClick: true }), _jsx("div", { "data-testid": "outside", children: "Outside" })] }));
|
|
400
404
|
yield user.click(screen.getByRole('button', { name: 'Good response' }));
|
|
401
|
-
expect(screen.getByText('
|
|
405
|
+
expect(screen.getByText('RhUiLikeFillIcon')).toBeInTheDocument();
|
|
402
406
|
yield user.click(screen.getByTestId('outside'));
|
|
403
|
-
expect(screen.getByText('
|
|
407
|
+
expect(screen.getByText('RhUiLikeFillIcon')).toBeInTheDocument();
|
|
404
408
|
}));
|
|
405
409
|
describe('negative actions', () => {
|
|
406
410
|
it('should not swap negative icon when clicked and useFilledIconsOnClick is false', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -409,8 +413,8 @@ describe('ResponseActions', () => {
|
|
|
409
413
|
negative: { onClick: jest.fn() }
|
|
410
414
|
}, useFilledIconsOnClick: false }));
|
|
411
415
|
yield user.click(screen.getByRole('button', { name: 'Bad response' }));
|
|
412
|
-
expect(screen.getByText('
|
|
413
|
-
expect(screen.queryByText('
|
|
416
|
+
expect(screen.getByText('RhUiDislikeIcon')).toBeInTheDocument();
|
|
417
|
+
expect(screen.queryByText('RhUiDislikeFillIcon')).not.toBeInTheDocument();
|
|
414
418
|
}));
|
|
415
419
|
it('should swap negative icon from outline to filled when clicked with useFilledIconsOnClick', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
416
420
|
const user = userEvent.setup();
|
|
@@ -418,8 +422,8 @@ describe('ResponseActions', () => {
|
|
|
418
422
|
negative: { onClick: jest.fn() }
|
|
419
423
|
}, useFilledIconsOnClick: true }));
|
|
420
424
|
yield user.click(screen.getByRole('button', { name: 'Bad response' }));
|
|
421
|
-
expect(screen.getByText('
|
|
422
|
-
expect(screen.queryByText('
|
|
425
|
+
expect(screen.getByText('RhUiDislikeFillIcon')).toBeInTheDocument();
|
|
426
|
+
expect(screen.queryByText('RhUiDislikeIcon')).not.toBeInTheDocument();
|
|
423
427
|
}));
|
|
424
428
|
it('should revert negative icon to outline when clicking outside', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
425
429
|
const user = userEvent.setup();
|
|
@@ -427,9 +431,9 @@ describe('ResponseActions', () => {
|
|
|
427
431
|
negative: { onClick: jest.fn() }
|
|
428
432
|
}, useFilledIconsOnClick: true }), _jsx("div", { "data-testid": "outside", children: "Outside" })] }));
|
|
429
433
|
yield user.click(screen.getByRole('button', { name: 'Bad response' }));
|
|
430
|
-
expect(screen.getByText('
|
|
434
|
+
expect(screen.getByText('RhUiDislikeFillIcon')).toBeInTheDocument();
|
|
431
435
|
yield user.click(screen.getByTestId('outside'));
|
|
432
|
-
expect(screen.getByText('
|
|
436
|
+
expect(screen.getByText('RhUiDislikeIcon')).toBeInTheDocument();
|
|
433
437
|
}));
|
|
434
438
|
it('should not revert negative icon to outline icon when clicking outside if persistActionSelection is true', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
435
439
|
const user = userEvent.setup();
|
|
@@ -437,9 +441,9 @@ describe('ResponseActions', () => {
|
|
|
437
441
|
negative: { onClick: jest.fn() }
|
|
438
442
|
}, persistActionSelection: true, useFilledIconsOnClick: true }), _jsx("div", { "data-testid": "outside", children: "Outside" })] }));
|
|
439
443
|
yield user.click(screen.getByRole('button', { name: 'Bad response' }));
|
|
440
|
-
expect(screen.getByText('
|
|
444
|
+
expect(screen.getByText('RhUiDislikeFillIcon')).toBeInTheDocument();
|
|
441
445
|
yield user.click(screen.getByTestId('outside'));
|
|
442
|
-
expect(screen.getByText('
|
|
446
|
+
expect(screen.getByText('RhUiDislikeFillIcon')).toBeInTheDocument();
|
|
443
447
|
}));
|
|
444
448
|
});
|
|
445
449
|
});
|
|
@@ -34,7 +34,7 @@ const SourcesCardBase = (_a) => {
|
|
|
34
34
|
};
|
|
35
35
|
const renderUncontrolledSourceCard = (source, index) => {
|
|
36
36
|
var _a;
|
|
37
|
-
return (_jsx("li", { className: "pf-chatbot__sources-list-item", children: _jsxs(Card, Object.assign({ isCompact: isCompact, className: "pf-chatbot__sources-card"
|
|
37
|
+
return (_jsx("li", { className: "pf-chatbot__sources-list-item", style: { '--pf-chatbot-sources-card-max-width': cardMaxWidth }, children: _jsxs(Card, Object.assign({ isFullHeight: true, isCompact: isCompact, className: "pf-chatbot__sources-card" }, props, { children: [_jsx(CardTitle, Object.assign({ className: "pf-chatbot__sources-card-title" }, cardTitleProps, { children: _jsxs("div", { className: "pf-chatbot__sources-card-title-container", children: [_jsx(Button, Object.assign({ component: "a", variant: ButtonVariant.link, href: source.link, icon: source.isExternal ? _jsx(ExternalLinkSquareAltIcon, {}) : undefined, iconPosition: "end", isInline: true, rel: source.isExternal ? 'noreferrer' : undefined, target: source.isExternal ? '_blank' : undefined, onClick: (_a = source.onClick) !== null && _a !== void 0 ? _a : undefined }, source.titleProps, { children: renderTitle(source.title, index, source.truncateProps) })), source.subtitle && _jsx("span", { className: "pf-chatbot__sources-card-subtitle", children: source.subtitle })] }) })), source.body && (_jsx(CardBody, Object.assign({ className: `pf-chatbot__sources-card-body ${source.footer ? 'pf-chatbot__compact-sources-card-body' : undefined}` }, cardBodyProps, { children: source.hasShowMore ? (
|
|
38
38
|
// prevents extra VO announcements of button text - parent Message has aria-live
|
|
39
39
|
_jsx("div", { "aria-live": "off", children: _jsx(ExpandableSection, { variant: ExpandableSectionVariant.truncate, toggleTextCollapsed: showMoreWords, toggleTextExpanded: showLessWords, truncateMaxLines: 2, children: source.body }) })) : (_jsx("div", { className: "pf-chatbot__sources-card-body-text", children: source.body })) }))), source.footer && (_jsx(CardFooter, Object.assign({ className: "pf-chatbot__sources-card-footer" }, cardFooterProps, { children: source.footer })))] })) }, index));
|
|
40
40
|
};
|
|
@@ -180,15 +180,15 @@ describe('SourcesCardBase', () => {
|
|
|
180
180
|
{ title: 'How to make an apple pie', link: '' },
|
|
181
181
|
{ title: 'How to make cookies', link: '' }
|
|
182
182
|
] }));
|
|
183
|
-
const
|
|
184
|
-
expect(
|
|
183
|
+
const firstListItem = screen.getByText('How to make an apple pie').closest('.pf-chatbot__sources-list-item');
|
|
184
|
+
expect(firstListItem).toHaveStyle({ '--pf-chatbot-sources-card-max-width': '400px' });
|
|
185
185
|
});
|
|
186
186
|
it('should apply custom cardMaxWidth when using wrap layout', () => {
|
|
187
187
|
render(_jsx(SourcesCardBase, { layout: "wrap", sources: [
|
|
188
188
|
{ title: 'How to make an apple pie', link: '' },
|
|
189
189
|
{ title: 'How to make cookies', link: '' }
|
|
190
190
|
], cardMaxWidth: "500px" }));
|
|
191
|
-
const
|
|
192
|
-
expect(
|
|
191
|
+
const firstListItem = screen.getByText('How to make an apple pie').closest('.pf-chatbot__sources-list-item');
|
|
192
|
+
expect(firstListItem).toHaveStyle({ '--pf-chatbot-sources-card-max-width': '500px' });
|
|
193
193
|
});
|
|
194
194
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../src/index.ts","../src/AttachMenu/AttachMenu.tsx","../src/AttachMenu/index.ts","../src/AttachmentEdit/AttachmentEdit.test.tsx","../src/AttachmentEdit/AttachmentEdit.tsx","../src/AttachmentEdit/index.ts","../src/Chatbot/Chatbot.test.tsx","../src/Chatbot/Chatbot.tsx","../src/Chatbot/index.ts","../src/ChatbotAlert/ChatbotAlert.test.tsx","../src/ChatbotAlert/ChatbotAlert.tsx","../src/ChatbotAlert/index.ts","../src/ChatbotContent/ChatbotContent.test.tsx","../src/ChatbotContent/ChatbotContent.tsx","../src/ChatbotContent/index.ts","../src/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.test.tsx","../src/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.tsx","../src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.tsx","../src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.tsx","../src/ChatbotConversationHistoryNav/EmptyState.tsx","../src/ChatbotConversationHistoryNav/LoadingState.tsx","../src/ChatbotConversationHistoryNav/index.ts","../src/ChatbotFooter/ChatbotFooter.test.tsx","../src/ChatbotFooter/ChatbotFooter.tsx","../src/ChatbotFooter/ChatbotFooternote.test.tsx","../src/ChatbotFooter/ChatbotFootnote.tsx","../src/ChatbotFooter/index.ts","../src/ChatbotHeader/ChatbotHeader.test.tsx","../src/ChatbotHeader/ChatbotHeader.tsx","../src/ChatbotHeader/ChatbotHeaderActions.test.tsx","../src/ChatbotHeader/ChatbotHeaderActions.tsx","../src/ChatbotHeader/ChatbotHeaderCloseButton.test.tsx","../src/ChatbotHeader/ChatbotHeaderCloseButton.tsx","../src/ChatbotHeader/ChatbotHeaderMain.test.tsx","../src/ChatbotHeader/ChatbotHeaderMain.tsx","../src/ChatbotHeader/ChatbotHeaderMenu.test.tsx","../src/ChatbotHeader/ChatbotHeaderMenu.tsx","../src/ChatbotHeader/ChatbotHeaderNewChatButton.test.tsx","../src/ChatbotHeader/ChatbotHeaderNewChatButton.tsx","../src/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.tsx","../src/ChatbotHeader/ChatbotHeaderOptionsDropdown.tsx","../src/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.tsx","../src/ChatbotHeader/ChatbotHeaderSelectorDropdown.tsx","../src/ChatbotHeader/ChatbotHeaderTitle.test.tsx","../src/ChatbotHeader/ChatbotHeaderTitle.tsx","../src/ChatbotHeader/index.ts","../src/ChatbotModal/ChatbotModal.test.tsx","../src/ChatbotModal/ChatbotModal.tsx","../src/ChatbotModal/index.ts","../src/ChatbotPopover/ChatbotPopover.tsx","../src/ChatbotPopover/index.ts","../src/ChatbotToggle/ChatbotToggle.test.tsx","../src/ChatbotToggle/ChatbotToggle.tsx","../src/ChatbotToggle/index.ts","../src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.tsx","../src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.tsx","../src/ChatbotWelcomePrompt/index.ts","../src/CodeModal/CodeModal.test.tsx","../src/CodeModal/CodeModal.tsx","../src/CodeModal/index.ts","../src/Compare/Compare.test.tsx","../src/Compare/Compare.tsx","../src/Compare/index.ts","../src/DeepThinking/DeepThinking.test.tsx","../src/DeepThinking/DeepThinking.tsx","../src/DeepThinking/index.ts","../src/FileDetails/FileDetails.test.tsx","../src/FileDetails/FileDetails.tsx","../src/FileDetails/index.ts","../src/FileDetailsLabel/FileDetailsLabel.test.tsx","../src/FileDetailsLabel/FileDetailsLabel.tsx","../src/FileDetailsLabel/index.ts","../src/FileDropZone/FileDropZone.test.tsx","../src/FileDropZone/FileDropZone.tsx","../src/FileDropZone/index.ts","../src/FilePreview/FilePreview.test.tsx","../src/FilePreview/FilePreview.tsx","../src/FilePreview/index.ts","../src/ImagePreview/ImagePreview.test.tsx","../src/ImagePreview/ImagePreview.tsx","../src/ImagePreview/index.ts","../src/LoadingMessage/LoadingMessage.test.tsx","../src/LoadingMessage/LoadingMessage.tsx","../src/LoadingMessage/index.ts","../src/MarkdownContent/MarkdownContent.test.tsx","../src/MarkdownContent/MarkdownContent.tsx","../src/MarkdownContent/index.ts","../src/Message/Message.test.tsx","../src/Message/Message.tsx","../src/Message/MessageInput.tsx","../src/Message/MessageLoading.test.tsx","../src/Message/MessageLoading.tsx","../src/Message/index.ts","../src/Message/CodeBlockMessage/CodeBlockMessage.test.tsx","../src/Message/CodeBlockMessage/CodeBlockMessage.tsx","../src/Message/ErrorMessage/ErrorMessage.test.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.test.tsx","../src/Message/MessageAndActions/MessageAndActions.tsx","../src/Message/MessageAndActions/index.ts","../src/Message/MessageAttachments/MessageAttachmentItem.test.tsx","../src/Message/MessageAttachments/MessageAttachmentItem.tsx","../src/Message/MessageAttachments/MessageAttachmentsContainer.test.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.test.tsx","../src/Message/QuickResponse/QuickResponse.tsx","../src/Message/QuickResponse/index.ts","../src/Message/QuickStarts/FallbackImg.tsx","../src/Message/QuickStarts/QuickStartTile.tsx","../src/Message/QuickStarts/QuickStartTileDescription.test.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/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.test.tsx","../src/Message/UserFeedback/UserFeedback.tsx","../src/Message/UserFeedback/UserFeedbackComplete.test.tsx","../src/Message/UserFeedback/UserFeedbackComplete.tsx","../src/Message/UserFeedback/index.ts","../src/MessageBar/AttachButton.test.tsx","../src/MessageBar/AttachButton.tsx","../src/MessageBar/MessageBar.test.tsx","../src/MessageBar/MessageBar.tsx","../src/MessageBar/MicrophoneButton.tsx","../src/MessageBar/SendButton.test.tsx","../src/MessageBar/SendButton.tsx","../src/MessageBar/StopButton.test.tsx","../src/MessageBar/StopButton.tsx","../src/MessageBar/index.ts","../src/MessageBox/JumpButton.test.tsx","../src/MessageBox/JumpButton.tsx","../src/MessageBox/MessageBox.test.tsx","../src/MessageBox/MessageBox.tsx","../src/MessageBox/index.ts","../src/MessageDivider/MessageDivider.test.tsx","../src/MessageDivider/MessageDivider.tsx","../src/MessageDivider/index.ts","../src/Onboarding/Onboarding.test.tsx","../src/Onboarding/Onboarding.tsx","../src/Onboarding/index.ts","../src/PreviewAttachment/PreviewAttachment.test.tsx","../src/PreviewAttachment/PreviewAttachment.tsx","../src/PreviewAttachment/index.ts","../src/ResponseActions/ResponseActionButton.test.tsx","../src/ResponseActions/ResponseActionButton.tsx","../src/ResponseActions/ResponseActions.test.tsx","../src/ResponseActions/ResponseActions.tsx","../src/ResponseActions/ResponseActionsGroups.test.tsx","../src/ResponseActions/ResponseActionsGroups.tsx","../src/ResponseActions/index.ts","../src/Settings/SettingsForm.test.tsx","../src/Settings/SettingsForm.tsx","../src/Settings/index.ts","../src/SourceDetailsMenuItem/SourceDetailsMenuItem.tsx","../src/SourceDetailsMenuItem/index.ts","../src/SourcesCard/SourcesCard.test.tsx","../src/SourcesCard/SourcesCard.tsx","../src/SourcesCard/index.ts","../src/SourcesCardBase/SourcesCardBase.test.tsx","../src/SourcesCardBase/SourcesCardBase.tsx","../src/SourcesCardBase/index.ts","../src/TermsOfUse/TermsOfUse.test.tsx","../src/TermsOfUse/TermsOfUse.tsx","../src/TermsOfUse/index.ts","../src/ToolCall/ToolCall.test.tsx","../src/ToolCall/ToolCall.tsx","../src/ToolCall/index.ts","../src/ToolResponse/ToolResponse.test.tsx","../src/ToolResponse/ToolResponse.tsx","../src/ToolResponse/index.ts","../src/__mocks__/monaco-editor.ts","../src/__mocks__/rehype-external-links.ts","../src/__mocks__/rehype-highlight.ts","../src/__mocks__/rehype-sanitize.ts","../src/__mocks__/rehype-unwrap-images.tsx","../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"}
|
|
1
|
+
{"root":["../src/index.ts","../src/AttachMenu/AttachMenu.tsx","../src/AttachMenu/index.ts","../src/AttachmentEdit/AttachmentEdit.test.tsx","../src/AttachmentEdit/AttachmentEdit.tsx","../src/AttachmentEdit/index.ts","../src/Chatbot/Chatbot.test.tsx","../src/Chatbot/Chatbot.tsx","../src/Chatbot/index.ts","../src/ChatbotAlert/ChatbotAlert.test.tsx","../src/ChatbotAlert/ChatbotAlert.tsx","../src/ChatbotAlert/index.ts","../src/ChatbotContent/ChatbotContent.test.tsx","../src/ChatbotContent/ChatbotContent.tsx","../src/ChatbotContent/index.ts","../src/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.test.tsx","../src/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.tsx","../src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.tsx","../src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.tsx","../src/ChatbotConversationHistoryNav/EmptyState.tsx","../src/ChatbotConversationHistoryNav/LoadingState.tsx","../src/ChatbotConversationHistoryNav/index.ts","../src/ChatbotFooter/ChatbotFooter.test.tsx","../src/ChatbotFooter/ChatbotFooter.tsx","../src/ChatbotFooter/ChatbotFooternote.test.tsx","../src/ChatbotFooter/ChatbotFootnote.tsx","../src/ChatbotFooter/index.ts","../src/ChatbotHeader/ChatbotHeader.test.tsx","../src/ChatbotHeader/ChatbotHeader.tsx","../src/ChatbotHeader/ChatbotHeaderActions.test.tsx","../src/ChatbotHeader/ChatbotHeaderActions.tsx","../src/ChatbotHeader/ChatbotHeaderCloseButton.test.tsx","../src/ChatbotHeader/ChatbotHeaderCloseButton.tsx","../src/ChatbotHeader/ChatbotHeaderMain.test.tsx","../src/ChatbotHeader/ChatbotHeaderMain.tsx","../src/ChatbotHeader/ChatbotHeaderMenu.test.tsx","../src/ChatbotHeader/ChatbotHeaderMenu.tsx","../src/ChatbotHeader/ChatbotHeaderNewChatButton.test.tsx","../src/ChatbotHeader/ChatbotHeaderNewChatButton.tsx","../src/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.tsx","../src/ChatbotHeader/ChatbotHeaderOptionsDropdown.tsx","../src/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.tsx","../src/ChatbotHeader/ChatbotHeaderSelectorDropdown.tsx","../src/ChatbotHeader/ChatbotHeaderTitle.test.tsx","../src/ChatbotHeader/ChatbotHeaderTitle.tsx","../src/ChatbotHeader/index.ts","../src/ChatbotModal/ChatbotModal.test.tsx","../src/ChatbotModal/ChatbotModal.tsx","../src/ChatbotModal/index.ts","../src/ChatbotPopover/ChatbotPopover.tsx","../src/ChatbotPopover/index.ts","../src/ChatbotToggle/ChatbotToggle.test.tsx","../src/ChatbotToggle/ChatbotToggle.tsx","../src/ChatbotToggle/index.ts","../src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.tsx","../src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.tsx","../src/ChatbotWelcomePrompt/index.ts","../src/CodeModal/CodeModal.test.tsx","../src/CodeModal/CodeModal.tsx","../src/CodeModal/index.ts","../src/Compare/Compare.test.tsx","../src/Compare/Compare.tsx","../src/Compare/index.ts","../src/DeepThinking/DeepThinking.test.tsx","../src/DeepThinking/DeepThinking.tsx","../src/DeepThinking/index.ts","../src/FileDetails/FileDetails.test.tsx","../src/FileDetails/FileDetails.tsx","../src/FileDetails/index.ts","../src/FileDetailsLabel/FileDetailsLabel.test.tsx","../src/FileDetailsLabel/FileDetailsLabel.tsx","../src/FileDetailsLabel/index.ts","../src/FileDropZone/FileDropZone.test.tsx","../src/FileDropZone/FileDropZone.tsx","../src/FileDropZone/index.ts","../src/FilePreview/FilePreview.test.tsx","../src/FilePreview/FilePreview.tsx","../src/FilePreview/index.ts","../src/ImagePreview/ImagePreview.test.tsx","../src/ImagePreview/ImagePreview.tsx","../src/ImagePreview/index.ts","../src/LoadingMessage/LoadingMessage.test.tsx","../src/LoadingMessage/LoadingMessage.tsx","../src/LoadingMessage/index.ts","../src/MarkdownContent/MarkdownContent.test.tsx","../src/MarkdownContent/MarkdownContent.tsx","../src/MarkdownContent/index.ts","../src/Message/Message.test.tsx","../src/Message/Message.tsx","../src/Message/MessageInput.tsx","../src/Message/MessageLoading.test.tsx","../src/Message/MessageLoading.tsx","../src/Message/index.ts","../src/Message/CodeBlockMessage/CodeBlockMessage.test.tsx","../src/Message/CodeBlockMessage/CodeBlockMessage.tsx","../src/Message/ErrorMessage/ErrorMessage.test.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.test.tsx","../src/Message/MessageAndActions/MessageAndActions.tsx","../src/Message/MessageAndActions/index.ts","../src/Message/MessageAttachments/MessageAttachmentItem.test.tsx","../src/Message/MessageAttachments/MessageAttachmentItem.tsx","../src/Message/MessageAttachments/MessageAttachmentsContainer.test.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.test.tsx","../src/Message/QuickResponse/QuickResponse.tsx","../src/Message/QuickResponse/index.ts","../src/Message/QuickStarts/FallbackImg.tsx","../src/Message/QuickStarts/QuickStartTile.tsx","../src/Message/QuickStarts/QuickStartTileDescription.test.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.test.tsx","../src/Message/UserFeedback/UserFeedback.tsx","../src/Message/UserFeedback/UserFeedbackComplete.test.tsx","../src/Message/UserFeedback/UserFeedbackComplete.tsx","../src/Message/UserFeedback/index.ts","../src/MessageBar/AttachButton.test.tsx","../src/MessageBar/AttachButton.tsx","../src/MessageBar/MessageBar.test.tsx","../src/MessageBar/MessageBar.tsx","../src/MessageBar/MicrophoneButton.tsx","../src/MessageBar/SendButton.test.tsx","../src/MessageBar/SendButton.tsx","../src/MessageBar/StopButton.test.tsx","../src/MessageBar/StopButton.tsx","../src/MessageBar/index.ts","../src/MessageBox/JumpButton.test.tsx","../src/MessageBox/JumpButton.tsx","../src/MessageBox/MessageBox.test.tsx","../src/MessageBox/MessageBox.tsx","../src/MessageBox/index.ts","../src/MessageDivider/MessageDivider.test.tsx","../src/MessageDivider/MessageDivider.tsx","../src/MessageDivider/index.ts","../src/Onboarding/Onboarding.test.tsx","../src/Onboarding/Onboarding.tsx","../src/Onboarding/index.ts","../src/PreviewAttachment/PreviewAttachment.test.tsx","../src/PreviewAttachment/PreviewAttachment.tsx","../src/PreviewAttachment/index.ts","../src/ResponseActions/ResponseActionButton.test.tsx","../src/ResponseActions/ResponseActionButton.tsx","../src/ResponseActions/ResponseActions.test.tsx","../src/ResponseActions/ResponseActions.tsx","../src/ResponseActions/ResponseActionsGroups.test.tsx","../src/ResponseActions/ResponseActionsGroups.tsx","../src/ResponseActions/index.ts","../src/Settings/SettingsForm.test.tsx","../src/Settings/SettingsForm.tsx","../src/Settings/index.ts","../src/SourceDetailsMenuItem/SourceDetailsMenuItem.tsx","../src/SourceDetailsMenuItem/index.ts","../src/SourcesCard/SourcesCard.test.tsx","../src/SourcesCard/SourcesCard.tsx","../src/SourcesCard/index.ts","../src/SourcesCardBase/SourcesCardBase.test.tsx","../src/SourcesCardBase/SourcesCardBase.tsx","../src/SourcesCardBase/index.ts","../src/TermsOfUse/TermsOfUse.test.tsx","../src/TermsOfUse/TermsOfUse.tsx","../src/TermsOfUse/index.ts","../src/ToolCall/ToolCall.test.tsx","../src/ToolCall/ToolCall.tsx","../src/ToolCall/index.ts","../src/ToolResponse/ToolResponse.test.tsx","../src/ToolResponse/ToolResponse.tsx","../src/ToolResponse/index.ts","../src/__mocks__/monaco-editor.ts","../src/__mocks__/rehype-external-links.ts","../src/__mocks__/rehype-highlight.ts","../src/__mocks__/rehype-sanitize.ts","../src/__mocks__/rehype-unwrap-images.tsx","../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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/chatbot",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.8.0-prerelease.2",
|
|
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",
|
|
@@ -2,7 +2,11 @@ import { useState, isValidElement, cloneElement, Children, FunctionComponent, Re
|
|
|
2
2
|
import { MessageBar } from '@patternfly/chatbot/dist/dynamic/MessageBar';
|
|
3
3
|
import SourceDetailsMenuItem from '@patternfly/chatbot/dist/dynamic/SourceDetailsMenuItem';
|
|
4
4
|
import { Divider, DropdownGroup, DropdownItem, DropdownList } from '@patternfly/react-core';
|
|
5
|
-
import
|
|
5
|
+
import RhUiAttentionBellIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-attention-bell-icon';
|
|
6
|
+
import RhUiCalendarIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-calendar-icon';
|
|
7
|
+
import RhUiClipboardIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-clipboard-icon';
|
|
8
|
+
import RhUiCodeIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-code-icon';
|
|
9
|
+
import RhUiUploadIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-upload-icon';
|
|
6
10
|
import { useDropzone } from 'react-dropzone';
|
|
7
11
|
|
|
8
12
|
export const ChatbotMessageBarDefaultAttachExample: FunctionComponent = () => {
|
|
@@ -95,19 +99,19 @@ export const ChatbotMessageBarDefaultAttachExample: FunctionComponent = () => {
|
|
|
95
99
|
</DropdownList>,
|
|
96
100
|
<DropdownGroup key="message-bar-attach-dropdown-group">
|
|
97
101
|
<DropdownList>
|
|
98
|
-
<DropdownItem value="Alerts" id="1" icon={<
|
|
102
|
+
<DropdownItem value="Alerts" id="1" icon={<RhUiAttentionBellIcon />}>
|
|
99
103
|
Alerts
|
|
100
104
|
</DropdownItem>
|
|
101
|
-
<DropdownItem value="Events" id="2" icon={<
|
|
105
|
+
<DropdownItem value="Events" id="2" icon={<RhUiCalendarIcon />}>
|
|
102
106
|
Events
|
|
103
107
|
</DropdownItem>
|
|
104
|
-
<DropdownItem value="Logs" id="3" icon={<
|
|
108
|
+
<DropdownItem value="Logs" id="3" icon={<RhUiClipboardIcon />}>
|
|
105
109
|
Logs
|
|
106
110
|
</DropdownItem>
|
|
107
|
-
<DropdownItem value="YAML - Status" id="4" icon={<
|
|
111
|
+
<DropdownItem value="YAML - Status" id="4" icon={<RhUiCodeIcon />}>
|
|
108
112
|
YAML - Status
|
|
109
113
|
</DropdownItem>
|
|
110
|
-
<DropdownItem value="YAML - All contents" id="5" icon={<
|
|
114
|
+
<DropdownItem value="YAML - All contents" id="5" icon={<RhUiCodeIcon />}>
|
|
111
115
|
YAML - All contents
|
|
112
116
|
</DropdownItem>
|
|
113
117
|
</DropdownList>
|
|
@@ -117,7 +121,7 @@ export const ChatbotMessageBarDefaultAttachExample: FunctionComponent = () => {
|
|
|
117
121
|
const uploadMenuItems = [
|
|
118
122
|
<Divider key="divider" />,
|
|
119
123
|
<DropdownList key="list-2">
|
|
120
|
-
<DropdownItem key="upload" value="upload" id="upload" icon={<
|
|
124
|
+
<DropdownItem key="upload" value="upload" id="upload" icon={<RhUiUploadIcon />} onClick={open}>
|
|
121
125
|
Upload from computer
|
|
122
126
|
</DropdownItem>
|
|
123
127
|
</DropdownList>
|