@patternfly/chatbot 6.4.0-prerelease.5 → 6.4.0-prerelease.6
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/ChatbotConversationHistoryDropdown.js +1 -1
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.test.js +6 -6
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.d.ts +13 -4
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.js +6 -12
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.js +21 -0
- package/dist/css/main.css +31 -27
- package/dist/css/main.css.map +1 -1
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.js +1 -1
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.test.js +6 -6
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.d.ts +13 -4
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.js +7 -13
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.js +21 -0
- package/package.json +1 -1
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotConversationEditing.tsx +202 -0
- package/patternfly-docs/content/extensions/chatbot/examples/UI/UI.md +14 -1
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.test.tsx +6 -6
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.tsx +0 -1
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.scss +40 -32
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.tsx +70 -0
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.tsx +55 -49
- package/src/ChatbotModal/ChatbotModal.scss +1 -1
|
@@ -13,7 +13,7 @@ const ChatbotConversationHistoryDropdown = ({ menuItems, menuClassName, onSelect
|
|
|
13
13
|
const [isOpen, setIsOpen] = (0, react_1.useState)(false);
|
|
14
14
|
const toggle = (toggleRef) => ((0, jsx_runtime_1.jsx)(react_core_1.Tooltip, { className: "pf-chatbot__tooltip", content: label !== null && label !== void 0 ? label : 'Conversation options', position: "bottom",
|
|
15
15
|
// prevents VO announcements of both aria label and tooltip
|
|
16
|
-
aria: "none", children: (0, jsx_runtime_1.jsx)(react_core_1.MenuToggle, { className: "pf-chatbot__history-actions", variant: "plain", "aria-label": label !== null && label !== void 0 ? label : 'Conversation options', ref: toggleRef, isExpanded: isOpen, onClick: () => setIsOpen(!isOpen),
|
|
16
|
+
aria: "none", children: (0, jsx_runtime_1.jsx)(react_core_1.MenuToggle, { className: "pf-chatbot__history-actions", variant: "plain", "aria-label": label !== null && label !== void 0 ? label : 'Conversation options', ref: toggleRef, isExpanded: isOpen, onClick: () => setIsOpen(!isOpen), children: (0, jsx_runtime_1.jsx)(ellipsis_v_icon_1.default, {}) }) }));
|
|
17
17
|
return ((0, jsx_runtime_1.jsx)(react_core_1.Dropdown, { className: `pf-chatbot__selections ${menuClassName !== null && menuClassName !== void 0 ? menuClassName : ''}`, isOpen: isOpen, onSelect: (props) => {
|
|
18
18
|
onSelect === null || onSelect === void 0 ? void 0 : onSelect(props);
|
|
19
19
|
setIsOpen((prev) => !prev);
|
|
@@ -22,11 +22,11 @@ describe('ChatbotConversationHistoryDropdown', () => {
|
|
|
22
22
|
const menuItems = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_core_1.DropdownItem, { children: "Rename" }), (0, jsx_runtime_1.jsx)(react_core_1.DropdownItem, { children: "Delete" })] }));
|
|
23
23
|
it('should render the dropdown', () => {
|
|
24
24
|
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotConversationHistoryDropdown_1.default, { menuItems: menuItems, menuClassName: "custom-class" }));
|
|
25
|
-
expect(react_1.screen.queryByRole('
|
|
25
|
+
expect(react_1.screen.queryByRole('button', { name: /Conversation options/i })).toBeInTheDocument();
|
|
26
26
|
});
|
|
27
27
|
it('should display the dropdown menuItems', () => {
|
|
28
28
|
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotConversationHistoryDropdown_1.default, { menuItems: menuItems }));
|
|
29
|
-
const toggle = react_1.screen.queryByRole('
|
|
29
|
+
const toggle = react_1.screen.queryByRole('button', { name: /Conversation options/i });
|
|
30
30
|
expect(toggle).toBeInTheDocument();
|
|
31
31
|
react_1.fireEvent.click(toggle);
|
|
32
32
|
(0, react_1.waitFor)(() => {
|
|
@@ -36,14 +36,14 @@ describe('ChatbotConversationHistoryDropdown', () => {
|
|
|
36
36
|
});
|
|
37
37
|
it('should invoke onSelect callback when menuitem is clicked', () => {
|
|
38
38
|
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotConversationHistoryDropdown_1.default, { menuItems: menuItems, onSelect: onSelect }));
|
|
39
|
-
const toggle = react_1.screen.queryByRole('
|
|
39
|
+
const toggle = react_1.screen.queryByRole('button', { name: /Conversation options/i });
|
|
40
40
|
react_1.fireEvent.click(toggle);
|
|
41
41
|
react_1.fireEvent.click(react_1.screen.getByText('Rename'));
|
|
42
42
|
expect(onSelect).toHaveBeenCalled();
|
|
43
43
|
});
|
|
44
44
|
it('should toggle the dropdown when menuitem is clicked', () => {
|
|
45
45
|
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotConversationHistoryDropdown_1.default, { menuItems: menuItems, onSelect: onSelect }));
|
|
46
|
-
const toggle = react_1.screen.queryByRole('
|
|
46
|
+
const toggle = react_1.screen.queryByRole('button', { name: /Conversation options/i });
|
|
47
47
|
react_1.fireEvent.click(toggle);
|
|
48
48
|
react_1.fireEvent.click(react_1.screen.getByText('Delete'));
|
|
49
49
|
expect(onSelect).toHaveBeenCalled();
|
|
@@ -51,7 +51,7 @@ describe('ChatbotConversationHistoryDropdown', () => {
|
|
|
51
51
|
});
|
|
52
52
|
it('should close the dropdown when user clicks outside', () => {
|
|
53
53
|
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotConversationHistoryDropdown_1.default, { menuItems: menuItems, onSelect: onSelect }));
|
|
54
|
-
const toggle = react_1.screen.queryByRole('
|
|
54
|
+
const toggle = react_1.screen.queryByRole('button', { name: /Conversation options/i });
|
|
55
55
|
react_1.fireEvent.click(toggle);
|
|
56
56
|
expect(react_1.screen.queryByText('Delete')).toBeInTheDocument();
|
|
57
57
|
react_1.fireEvent.click(toggle.parentElement);
|
|
@@ -59,7 +59,7 @@ describe('ChatbotConversationHistoryDropdown', () => {
|
|
|
59
59
|
});
|
|
60
60
|
it('should show the tooltip when the user hovers over the toggle button', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
61
61
|
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotConversationHistoryDropdown_1.default, { menuItems: menuItems, label: "Actions dropdown" }));
|
|
62
|
-
const toggle = react_1.screen.queryByRole('
|
|
62
|
+
const toggle = react_1.screen.queryByRole('button', { name: /Actions dropdown/i });
|
|
63
63
|
(0, react_1.fireEvent)(toggle, new MouseEvent('mouseenter', {
|
|
64
64
|
bubbles: false,
|
|
65
65
|
cancelable: false
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FunctionComponent } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ButtonProps, DrawerProps, ListItemProps, DrawerPanelContentProps, DrawerContentProps, DrawerContentBodyProps, DrawerHeadProps, DrawerActionsProps, DrawerCloseButtonProps, DrawerPanelBodyProps, SkeletonProps, MenuProps, // Remove in next breaking change
|
|
3
|
+
TitleProps, ListProps } from '@patternfly/react-core';
|
|
3
4
|
import { ChatbotDisplayMode } from '../Chatbot/Chatbot';
|
|
4
5
|
import { HistoryEmptyStateProps } from './EmptyState';
|
|
5
6
|
export interface Conversation {
|
|
@@ -19,8 +20,10 @@ export interface Conversation {
|
|
|
19
20
|
label?: string;
|
|
20
21
|
/** Callback for when user selects item. */
|
|
21
22
|
onSelect?: (event?: React.MouseEvent, value?: string | number) => void;
|
|
22
|
-
/** Additional props passed to conversation
|
|
23
|
-
additionalProps?:
|
|
23
|
+
/** Additional props passed to conversation button item */
|
|
24
|
+
additionalProps?: ButtonProps;
|
|
25
|
+
/** Additional props passed to conversation list item */
|
|
26
|
+
listItemProps?: Omit<ListItemProps, 'children'>;
|
|
24
27
|
}
|
|
25
28
|
export interface ChatbotConversationHistoryNavProps extends DrawerProps {
|
|
26
29
|
/** Function called to toggle drawer */
|
|
@@ -38,6 +41,12 @@ export interface ChatbotConversationHistoryNavProps extends DrawerProps {
|
|
|
38
41
|
};
|
|
39
42
|
/** Additional button props for new chat button. */
|
|
40
43
|
newChatButtonProps?: ButtonProps;
|
|
44
|
+
/** Additional props applied to all conversation list headers */
|
|
45
|
+
titleProps?: Partial<TitleProps>;
|
|
46
|
+
/** Additional props applied to conversation list. If conversations is an object, you should pass an object of ListProps for each group. */
|
|
47
|
+
listProps?: ListProps | {
|
|
48
|
+
[key: string]: ListProps;
|
|
49
|
+
};
|
|
41
50
|
/** Text shown in blue button */
|
|
42
51
|
newChatButtonText?: string;
|
|
43
52
|
/** Callback function for when blue button is clicked. Omit to hide blue "new chat button" */
|
|
@@ -56,7 +65,7 @@ export interface ChatbotConversationHistoryNavProps extends DrawerProps {
|
|
|
56
65
|
reverseButtonOrder?: boolean;
|
|
57
66
|
/** Custom test id for the drawer actions */
|
|
58
67
|
drawerActionsTestId?: string;
|
|
59
|
-
/** Additional props applied to
|
|
68
|
+
/** @deprecated Additional props applied to list container */
|
|
60
69
|
menuProps?: MenuProps;
|
|
61
70
|
/** Additional props applied to panel */
|
|
62
71
|
drawerPanelContentProps?: DrawerPanelContentProps;
|
|
@@ -25,27 +25,21 @@ const ChatbotConversationHistoryDropdown_1 = __importDefault(require("./ChatbotC
|
|
|
25
25
|
const LoadingState_1 = __importDefault(require("./LoadingState"));
|
|
26
26
|
const EmptyState_1 = __importDefault(require("./EmptyState"));
|
|
27
27
|
const ChatbotConversationHistoryNav = (_a) => {
|
|
28
|
-
var { onDrawerToggle, isDrawerOpen, setIsDrawerOpen, activeItemId, onSelectActiveItem, conversations, newChatButtonText = 'New chat', drawerContent, onNewChat, newChatButtonProps, searchInputPlaceholder = 'Search previous conversations...', searchInputAriaLabel = 'Filter menu items', handleTextInputChange, displayMode, reverseButtonOrder = false, drawerActionsTestId = 'chatbot-nav-drawer-actions',
|
|
28
|
+
var { onDrawerToggle, isDrawerOpen, setIsDrawerOpen, activeItemId, onSelectActiveItem, conversations, titleProps, listProps, newChatButtonText = 'New chat', drawerContent, onNewChat, newChatButtonProps, searchInputPlaceholder = 'Search previous conversations...', searchInputAriaLabel = 'Filter menu items', handleTextInputChange, displayMode, reverseButtonOrder = false, drawerActionsTestId = 'chatbot-nav-drawer-actions', drawerPanelContentProps, drawerContentProps, drawerContentBodyProps, drawerHeadProps, drawerActionsProps, drawerCloseButtonProps, drawerPanelBodyProps, isLoading, loadingState, errorState, emptyState, noResultsState, isCompact, title = 'Chat history' } = _a, props = __rest(_a, ["onDrawerToggle", "isDrawerOpen", "setIsDrawerOpen", "activeItemId", "onSelectActiveItem", "conversations", "titleProps", "listProps", "newChatButtonText", "drawerContent", "onNewChat", "newChatButtonProps", "searchInputPlaceholder", "searchInputAriaLabel", "handleTextInputChange", "displayMode", "reverseButtonOrder", "drawerActionsTestId", "drawerPanelContentProps", "drawerContentProps", "drawerContentBodyProps", "drawerHeadProps", "drawerActionsProps", "drawerCloseButtonProps", "drawerPanelBodyProps", "isLoading", "loadingState", "errorState", "emptyState", "noResultsState", "isCompact", "title"]);
|
|
29
29
|
const drawerRef = (0, react_1.useRef)(null);
|
|
30
30
|
const onExpand = () => {
|
|
31
31
|
drawerRef.current && drawerRef.current.focus();
|
|
32
32
|
};
|
|
33
33
|
const getNavItem = (conversation) => {
|
|
34
34
|
var _a;
|
|
35
|
-
return ((0, jsx_runtime_1.jsx)(react_core_1.
|
|
36
|
-
? {
|
|
37
|
-
actions: ((0, jsx_runtime_1.jsx)(ChatbotConversationHistoryDropdown_1.default, { menuClassName: conversation.menuClassName, onSelect: conversation.onSelect, menuItems: conversation.menuItems, label: conversation.label }))
|
|
38
|
-
}
|
|
39
|
-
: {}), conversation.additionalProps, { children: conversation.text }), conversation.id));
|
|
35
|
+
return ((0, jsx_runtime_1.jsx)(react_core_1.ListItem, Object.assign({ className: `pf-chatbot__conversation-list-item ${activeItemId && activeItemId === conversation.id ? 'pf-chatbot__conversation-list-item--active' : ''}` }, conversation.listItemProps, { children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_core_1.Button, Object.assign({ className: "pf-chatbot__conversation-history-item", variant: "link" }, conversation.additionalProps, (conversation.noIcon ? {} : { icon: (_a = conversation.icon) !== null && _a !== void 0 ? _a : (0, jsx_runtime_1.jsx)(react_icons_1.OutlinedCommentAltIcon, {}) }), { onClick: (event) => onSelectActiveItem === null || onSelectActiveItem === void 0 ? void 0 : onSelectActiveItem(event, conversation.id), children: conversation.text })), conversation.menuItems && ((0, jsx_runtime_1.jsx)(ChatbotConversationHistoryDropdown_1.default, { menuClassName: conversation.menuClassName, onSelect: conversation.onSelect, menuItems: conversation.menuItems, label: conversation.label }))] }) }), conversation.id));
|
|
40
36
|
};
|
|
41
|
-
const
|
|
37
|
+
const buildConversations = () => {
|
|
42
38
|
if (Array.isArray(conversations)) {
|
|
43
|
-
|
|
44
|
-
return ((0, jsx_runtime_1.jsx)(react_core_1.MenuList, { children: conversations.map((conversation) => ((0, jsx_runtime_1.jsx)(react_1.Fragment, { children: getNavItem(conversation) }, conversation.id))) }));
|
|
39
|
+
return ((0, jsx_runtime_1.jsx)(react_core_1.List, Object.assign({ className: "pf-chatbot__conversation-list", isPlain: true }, listProps, { children: conversations.map((conversation) => ((0, jsx_runtime_1.jsx)(react_1.Fragment, { children: getNavItem(conversation) }, conversation.id))) })));
|
|
45
40
|
}
|
|
46
41
|
else {
|
|
47
|
-
|
|
48
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: Object.keys(conversations).map((navGroup) => ((0, jsx_runtime_1.jsx)(react_core_1.MenuGroup, { className: "pf-chatbot__menu-item-header", label: navGroup, children: (0, jsx_runtime_1.jsx)(react_core_1.MenuList, { children: conversations[navGroup].map((conversation) => ((0, jsx_runtime_1.jsx)(react_1.Fragment, { children: getNavItem(conversation) }, conversation.id))) }) }, navGroup))) }));
|
|
42
|
+
return ((0, jsx_runtime_1.jsx)("div", { children: Object.keys(conversations).map((navGroup) => ((0, jsx_runtime_1.jsxs)("section", { children: [(0, jsx_runtime_1.jsx)(react_core_1.Title, Object.assign({ headingLevel: "h4", className: "pf-chatbot__conversation-list-header" }, titleProps, { children: navGroup })), (0, jsx_runtime_1.jsx)(react_core_1.List, Object.assign({ className: "pf-chatbot__conversation-list", isPlain: true }, listProps === null || listProps === void 0 ? void 0 : listProps[navGroup], { children: conversations[navGroup].map((conversation) => ((0, jsx_runtime_1.jsx)(react_1.Fragment, { children: getNavItem(conversation) }, conversation.id))) }))] }, navGroup))) }));
|
|
49
43
|
}
|
|
50
44
|
};
|
|
51
45
|
// Menu Content
|
|
@@ -61,7 +55,7 @@ const ChatbotConversationHistoryNav = (_a) => {
|
|
|
61
55
|
if (noResultsState) {
|
|
62
56
|
return (0, jsx_runtime_1.jsx)(EmptyState_1.default, Object.assign({}, noResultsState));
|
|
63
57
|
}
|
|
64
|
-
return (
|
|
58
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: buildConversations() });
|
|
65
59
|
};
|
|
66
60
|
const renderDrawerContent = () => ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(react_core_1.DrawerPanelBody, Object.assign({}, drawerPanelBodyProps, { children: renderMenuContent() })) }));
|
|
67
61
|
const renderPanelContent = () => {
|
|
@@ -198,4 +198,25 @@ describe('ChatbotConversationHistoryNav', () => {
|
|
|
198
198
|
const iconElement = container.querySelector('.pf-chatbot__title-icon');
|
|
199
199
|
expect(iconElement).toBeInTheDocument();
|
|
200
200
|
});
|
|
201
|
+
it('Passes titleProps to Title', () => {
|
|
202
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotConversationHistoryNav_1.default, { onDrawerToggle: onDrawerToggle, isDrawerOpen: true, displayMode: Chatbot_1.ChatbotDisplayMode.fullscreen, setIsDrawerOpen: jest.fn(), conversations: { Today: initialConversations }, titleProps: { className: 'test' } }));
|
|
203
|
+
expect(react_1.screen.getByRole('heading', { name: /Today/i })).toHaveClass('test');
|
|
204
|
+
});
|
|
205
|
+
it('Overrides Title heading level when titleProps.headingLevel is passed', () => {
|
|
206
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotConversationHistoryNav_1.default, { onDrawerToggle: onDrawerToggle, isDrawerOpen: true, displayMode: Chatbot_1.ChatbotDisplayMode.fullscreen, setIsDrawerOpen: jest.fn(), conversations: { Today: initialConversations }, titleProps: { headingLevel: 'h2' } }));
|
|
207
|
+
expect(react_1.screen.queryByRole('heading', { name: /Today/i, level: 4 })).not.toBeInTheDocument();
|
|
208
|
+
expect(react_1.screen.getByRole('heading', { name: /Today/i, level: 2 })).toBeInTheDocument();
|
|
209
|
+
});
|
|
210
|
+
it('Passes listProps to List when conversations is an array', () => {
|
|
211
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotConversationHistoryNav_1.default, { onDrawerToggle: onDrawerToggle, isDrawerOpen: true, displayMode: Chatbot_1.ChatbotDisplayMode.fullscreen, setIsDrawerOpen: jest.fn(), conversations: initialConversations, listProps: { className: 'test' } }));
|
|
212
|
+
expect(react_1.screen.getByRole('list')).toHaveClass('test');
|
|
213
|
+
});
|
|
214
|
+
it('Passes listProps to List when conversations is an object', () => {
|
|
215
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotConversationHistoryNav_1.default, { onDrawerToggle: onDrawerToggle, isDrawerOpen: true, displayMode: Chatbot_1.ChatbotDisplayMode.fullscreen, setIsDrawerOpen: jest.fn(), conversations: { Today: initialConversations }, listProps: { Today: { className: 'test' } } }));
|
|
216
|
+
expect(react_1.screen.getByRole('list')).toHaveClass('test');
|
|
217
|
+
});
|
|
218
|
+
it('Passes listItemProps to ListItem', () => {
|
|
219
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(ChatbotConversationHistoryNav_1.default, { onDrawerToggle: onDrawerToggle, isDrawerOpen: true, displayMode: Chatbot_1.ChatbotDisplayMode.fullscreen, setIsDrawerOpen: jest.fn(), conversations: [{ id: '1', text: 'ChatBot documentation', listItemProps: { className: 'test' } }] }));
|
|
220
|
+
expect(react_1.screen.getByRole('listitem')).toHaveClass('test');
|
|
221
|
+
});
|
|
201
222
|
});
|
package/dist/css/main.css
CHANGED
|
@@ -206,47 +206,51 @@
|
|
|
206
206
|
padding-inline-end: var(--pf-t--global--spacer--md);
|
|
207
207
|
padding-inline-start: var(--pf-t--global--spacer--sm);
|
|
208
208
|
}
|
|
209
|
-
.pf-chatbot__history .pf-
|
|
210
|
-
--pf-v6-c-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
position: relative;
|
|
214
|
-
}
|
|
215
|
-
.pf-chatbot__history .pf-v6-c-menu__item-main {
|
|
216
|
-
--pf-v6-c-menu__item-main--ColumnGap: var(--pf-t--global--spacer--md);
|
|
209
|
+
.pf-chatbot__history .pf-chatbot__conversation-list {
|
|
210
|
+
--pf-v6-c-list--Gap: var(--pf-t--global--spacer--xs);
|
|
211
|
+
margin-block-start: var(--pf-t--global--spacer--md);
|
|
212
|
+
margin-block-end: var(--pf-t--global--spacer--md);
|
|
217
213
|
}
|
|
218
|
-
.pf-chatbot__history .pf-
|
|
214
|
+
.pf-chatbot__history .pf-chatbot__conversation-list-header {
|
|
219
215
|
color: var(--pf-t--global--text--color--subtle);
|
|
220
216
|
font-weight: var(--pf-t--global--font--weight--body--bold);
|
|
221
217
|
font-size: var(--pf-t--global--icon--size--font--sm);
|
|
222
|
-
|
|
223
|
-
|
|
218
|
+
padding-inline-start: var(--pf-t--global--spacer--sm);
|
|
219
|
+
padding-inline-end: var(--pf-t--global--spacer--sm);
|
|
224
220
|
position: -webkit-sticky;
|
|
225
221
|
position: sticky;
|
|
226
222
|
top: 0;
|
|
227
223
|
background-color: var(--pf-t--global--background--color--floating--default);
|
|
228
224
|
z-index: var(--pf-t--global--z-index--md);
|
|
229
225
|
}
|
|
230
|
-
.pf-chatbot__history .pf-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
226
|
+
.pf-chatbot__history .pf-chatbot__conversation-list-item > span {
|
|
227
|
+
display: flex;
|
|
228
|
+
column-gap: var(--pf-t--global--spacer--sm);
|
|
229
|
+
}
|
|
230
|
+
.pf-chatbot__history .pf-chatbot__conversation-list-item .pf-chatbot__conversation-history-item {
|
|
231
|
+
--pf-v6-c-button--JustifyContent: flex-start;
|
|
232
|
+
--pf-v6-c-button--FontSize: var(--pf-t--global--font--size--body--lg);
|
|
233
|
+
--pf-v6-c-button--m-link--Color: var(--pf-t--global--text--color--regular);
|
|
234
|
+
--pf-v6-c-button--m-link__icon--Color: var(--pf-t--global--icon--color--regular);
|
|
235
|
+
--pf-v6-c-button--m-link--hover--Color: var(--pf-t--global--text--color--regular--hover);
|
|
236
|
+
--pf-v6-c-button--m-link--hover__icon--Color: var(--pf-t--global--icon--color--regular);
|
|
237
|
+
--pf-v6-c-button--m-link--m-clicked--Color: var(--pf-t--global--text--color--regular--clicked);
|
|
238
|
+
--pf-v6-c-button--m-link--m-clicked__icon--Color: var(--pf-t--global--icon--color--regular);
|
|
239
|
+
column-gap: var(--pf-t--global--spacer--md);
|
|
240
|
+
flex-basis: 100%;
|
|
241
|
+
}
|
|
242
|
+
.pf-chatbot__history .pf-chatbot__conversation-list-item .pf-chatbot__conversation-history-item .pf-v6-c-button__text {
|
|
241
243
|
overflow: hidden;
|
|
244
|
+
text-overflow: ellipsis;
|
|
245
|
+
white-space: nowrap;
|
|
242
246
|
}
|
|
243
247
|
.pf-chatbot__history .pf-chatbot__history-actions {
|
|
244
248
|
transform: rotate(90deg);
|
|
245
249
|
}
|
|
246
|
-
.pf-chatbot__history .pf-
|
|
250
|
+
.pf-chatbot__history .pf-chatbot__conversation-list-item--active {
|
|
247
251
|
background-color: var(--pf-t--global--background--color--action--plain--clicked);
|
|
248
252
|
}
|
|
249
|
-
.pf-chatbot__history button.pf-
|
|
253
|
+
.pf-chatbot__history button.pf-chatbot__conversation-list-item--active {
|
|
250
254
|
background-color: initial;
|
|
251
255
|
}
|
|
252
256
|
|
|
@@ -363,8 +367,8 @@
|
|
|
363
367
|
--pf-v6-c-drawer__panel__body--PaddingInlineStart: var(--pf-t--global--spacer--md);
|
|
364
368
|
--pf-v6-c-drawer__panel__body--PaddingInlineEnd: var(--pf-t--global--spacer--md);
|
|
365
369
|
}
|
|
366
|
-
.pf-chatbot__history.pf-m-compact .pf-
|
|
367
|
-
|
|
370
|
+
.pf-chatbot__history.pf-m-compact .pf-chatbot__conversation-history-item {
|
|
371
|
+
--pf-v6-c-button--FontSize: var(--pf-t--global--font--size--body--md);
|
|
368
372
|
}
|
|
369
373
|
.pf-chatbot__history.pf-m-compact .pf-v6-c-drawer__head {
|
|
370
374
|
--pf-v6-c-drawer__head--PaddingInlineStart: var(--pf-t--global--spacer--lg);
|
|
@@ -590,7 +594,7 @@
|
|
|
590
594
|
padding-block-end: var(--pf-t--global--spacer--xl);
|
|
591
595
|
}
|
|
592
596
|
.pf-chatbot__chatbot-modal .pf-v6-c-modal-box__header {
|
|
593
|
-
padding-block-end: var(--pf-t--global--spacer--
|
|
597
|
+
padding-block-end: var(--pf-t--global--spacer--sm);
|
|
594
598
|
}
|
|
595
599
|
|
|
596
600
|
@media screen and (max-width: 600px) {
|
package/dist/css/main.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../../src/AttachMenu/AttachMenu.scss","../../src/Chatbot/Chatbot.scss","../../src/ChatbotAlert/ChatbotAlert.scss","../../src/ChatbotContent/ChatbotContent.scss","../../src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.scss","../../src/ChatbotFooter/ChatbotFootnote.scss","../../src/ChatbotFooter/ChatbotFooter.scss","../../src/ChatbotHeader/ChatbotHeader.scss","../../src/ChatbotModal/ChatbotModal.scss","../../src/ChatbotPopover/ChatbotPopover.scss","../../src/ChatbotToggle/ChatbotToggle.scss","../../src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.scss","../../src/CodeModal/CodeModal.scss","../../src/Compare/Compare.scss","../../src/FileDetails/FileDetails.scss","../../src/FileDetailsLabel/FileDetailsLabel.scss","../../src/FileDropZone/FileDropZone.scss","../../src/Message/Message.scss","../../src/Message/MessageLoading.scss","../../src/Message/CodeBlockMessage/CodeBlockMessage.scss","../../src/Message/TextMessage/TextMessage.scss","../../src/Message/ImageMessage/ImageMessage.scss","../../src/Message/ListMessage/ListMessage.scss","../../src/Message/TableMessage/TableMessage.scss","../../src/Message/QuickStarts/QuickStartTile.scss","../../src/Message/QuickResponse/QuickResponse.scss","../../src/Message/UserFeedback/UserFeedback.scss","../../src/MessageBar/AttachButton.scss","../../src/MessageBar/MicrophoneButton.scss","../../src/MessageBar/SendButton.scss","../../src/MessageBar/StopButton.scss","../../src/MessageBar/MessageBar.scss","../../src/MessageBox/JumpButton.scss","../../src/MessageBox/MessageBox.scss","../../src/MessageDivider/MessageDivider.scss","../../src/ResponseActions/ResponseActions.scss","../../src/Settings/Settings.scss","../../src/SourcesCard/SourcesCard.scss","../../src/SourceDetailsMenuItem/SourceDetailsMenuItem.scss","../../src/TermsOfUse/TermsOfUse.scss","../../src/main.scss"],"names":[],"mappings":";AAAA;EACE;EACA;;;AAGF;AACE;AAsBA;AASA;;AA9BA;EACE;EACA;EACA;EACA;;AAEF;EACE;;AAGF;AACE;;AACA;EACE;EACA;EACA;EACA;EACA;;AAKJ;EACE;;AAGF;EACE;;AAIF;EACE;EACA;;AAGF;EACE;EACA;;AAGF;EACE;EACA;EACA;;AAGF;EACE;;AAGF;EACE;;;ACxDJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGA;EACE;;AAKF;EAvBF;IAwBI;IACA;;;AAIF;EA7BF;IA8BI;;;;AAOJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAIA;EAXF;IAYI;;;;AAOJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAMF;EACE;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;AAGA;EACE;;AAIF;EAdF;IAeI;;;;AAIJ;EACE;;;AAGF;AAAA;AAAA;EAGE;;;AAMF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;;AAOJ;EACE;;;ACpIF;EACE;EACA;EACA;;;ACAF;EACE;EACA;EACA;EACA;EACA;;AAGA;EARF;IASI;;;;AAOJ;EAII;AAAA;AAAA;IACE;IACA;;;ACrBJ;EACE;EACA;;AAQF;EACE;EACA;EACA;EACA;EACA;;AAIF;EACE;EACA;;AAIF;EACE;EACA;EACA;EACA;;AAEF;EACE;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;;AAEF;EACE;;AAGF;EACE;;AAGF;EACE;;;AAMJ;EACE;EACA;EACA;;AAGA;EACE;EACA;EACA;EACA;EACA;EACA;;AAIF;EACE;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;;AAIF;EACE;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;;AAKA;EACE;EACA;EACA;EACA;EACA;;AAKJ;EACE;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;;AAKA;EACE;;;AASJ;EACE;;;AASF;AAAA;EACE;;AACA;AAAA;EACE;;;AASJ;EACE;;AACA;EACE;EACA;;AAEF;EACE;;;AAUF;AAAA;AAAA;AAAA;EACE;;;AAKN;EACE;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;;;AAKE;EACE;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;;AAIJ;EACE;;AAGF;EACE;EACA;;AAGA;EACE;EACA;EACA;EACA;EACA;EACA;;;ACtPN;EACE;;AAEA;EACE;EACA;;;ACHJ;EACE;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;;;AAMF;EAGI;AAAA;IACE;;EACA;AAAA;IACE;;EAGJ;AAAA;IACE;IACA;IACA;;;AASJ;EACE;;;AAQF;EACE;;;AAIJ;EACE;EACA;;;AC3DF;EACE;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAEA;EACE;;AAKJ;EACE;EACA;EACA;;AAEA;EACE;;AAGF;EACE;EACA;;AAIJ;EACE;;AAGF;EACE;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;;;AAQN;EAGI;AAAA;IACE;;EAEF;AAAA;IACE;;;AAUJ;AAAA;EACE;;;AAOJ;AAAA;EAEE;EACA;EACA;EACA;EACA;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;EAGE;;AAGF;AAAA;AAAA;AAAA;EAEE;EACA;EACA;;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAGE;;;AAOJ;EACE;;;AAOJ;AAAA;EAEE;;;AAGF;EACE;;;AAGF;EACE;;;AAOA;EACE;EACA;;AAGF;EACE;EACA;;;AAIJ;AAAA;EAEE;EACA;;;AAGF;EACE;;;AClKF;EACE;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAGF;EACE;EACA;;AAEF;EACE;;;AAOJ;EACE;AAAA;IAEE;IACA;IACA;IACA;IACA;IACA;IACA;;;AAGJ;EACE;AAAA;IAEE;IACA;IACA;IACA;IACA;IACA;IACA;;;AAOJ;EACE;;;AAMF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAQE;EACE;;;AAQN;EACE;;;AAOA;EACE;;AAGF;EACE;EACA;;;ACjGF;EACE;;AAMA;EACE;;AAEF;EACE;;AAEF;EACE;;AAIF;EACE;EACA;;AAEF;EACE;;;ACxBN;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EAEE;;AAGF;EACE;;AAIF;EACE;EACA;;;AAIJ;EACE;EACA;EACA;;;AC3BF;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAGF;EACE;;AAGF;EACE;;AAGF;EACE;EACA;EACA;;AAGF;EACE;EACA;EACA;;;AAIJ;EACE;EACA;;AAEA;EACE;;;AAOJ;EAIM;AAAA;IACE;IACA;;;ACpDN;EACE;EACA;EACA;EACA;EACA;;AAEF;EACE;AACA;EACA;EACA;;AAEF;EACE;;AAEF;EACE;EACA;;AAEF;EACE;;AAEF;EACE;EACA;EACA;AAAA;AAAA;EAGA;EACA;;AAEF;EACE;EACA;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;;AAEF;EACE;;AAEF;EACE;EACA;EACA;;AAEF;EACE;;AAEF;EACE;EACA;;AAEF;EACE;;AAGA;EACE;;;AAUF;EACE;EACA;;;AAKN;EACE;;;AAGF;EACE;;;AAIA;EACE;;;AC5FJ;EACE;EACA;EACA;EACA;;;AAEF;EACE;;AAEA;EACE;EACA;EACA;;;AAGJ;EACE;EACA;EACA;;AAEA;EALF;IAMI;;;AAGF;EACE;;AAEA;EAHF;IAII;;;;AAKN;EACE;;AAEA;EACE;;AAGF;EACE;;AAIA;EADF;IAEI;;;;AAIN;EACE;;AAEA;EAHF;IAII;;;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EARF;IASI;IACA;IACA;;;;ACrEJ;EACE;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;;;AAIF;EACE;EACA;EACA;EACA;EACA;;;ACvBF;EACE;EACA;EACA;EACA;;;AAGF;EACE;EAEA;EACA;EACA;;AACA;EACE;;AAGF;AAAA;EAEE;EACA;;;AAIJ;EACE;EACA;EACA;;AAEA;EACE;;;AAKF;EACE;;AAGF;EACE;;;AAIJ;AAAA;EAEE;EACA;;AAEA;AAAA;EACE;;;AAKF;EACE;;;AAMF;AAAA;EACE;;;AC/DJ;EACE;EACA;;;AAGF;EACE;EACA;EACA;;AAGA;EANF;IAOI;;;;AAIJ;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAIJ;AACA;EACE;EACA;EACA;EACA;;;AAME;EADF;IAEI;IACA;IACA;;EAEA;IACE;;;;AChDR;EACE;EACA;EACA;EACA;;AAIA;EACE;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;;AAKF;EACE;EACA;;AAKF;EACE;EACA;EACA;EACA;;AAKF;EACE;EACA;EACA;;AAGA;EACE;EAQA;EACA;;AAIF;EACE;EACA;;AAIF;EACE;;AAEF;EACE;;AAMJ;EACE;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;;;AAMJ;EACE;EACA;EACA;;;AAGF;EACE;;;ACnGF;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEF;EAEE;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;IACE;;EAEF;IAEE;;;;AC9CN;EACE;EACA;EACA;EACA;;AAGA;EACE;EACA;;AAIF;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAGF;EACE;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;;AAEA;EAEE;;AAMN;EACE;EACA;EACA;EACA;EACA;;AAEA;AAAA;EAEE;EACA;EACA;;AAEF;EACE;EACA;EACA;;AAGF;EACE;EACA;;;AAKN;EACE;EACA;;;AAIA;EACE;EACA;;;AClFJ;EACE;;AAGE;EACE;;;AAMN;EACE;EACA;EACA;;AAEA;EACE;;AAGF;AAAA;AAAA;AAAA;AAAA;EAKE;;AAGF;EACE;EACA;;;AAKF;EACE;EACA;EACA;EACA;;AACA;EACE;;AAGF;AAAA;AAAA;AAAA;AAAA;EAKE;;;AAWF;EACE;;AAGF;AAAA;AAAA;AAAA;AAAA;EAKE;;AAGF;EACE;EACA;;;AHmCJ;EACE;EACA;;AAEA;EACE;;AAIJ;EACE;;AAGF;EACE;EACA;;AAGF;EACE;;;AEjIJ;EACE;EACA;EACA;EACA;;AAGA;EACE;EACA;;AAIF;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAGF;EACE;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;;AAEA;EAEE;;AAMN;EACE;EACA;EACA;EACA;EACA;;AAEA;AAAA;EAEE;EACA;EACA;;AAEF;EACE;EACA;EACA;;AAGF;EACE;EACA;;;AAKN;EACE;EACA;;;AAIA;EACE;EACA;;;AEtFJ;EACE;EACA;EACA;EACA;EAGA;;;ADHF;EACE;;AAGE;EACE;;;AAMN;EACE;EACA;EACA;;AAEA;EACE;;AAGF;AAAA;AAAA;AAAA;AAAA;EAKE;;AAGF;EACE;EACA;;;AAKF;EACE;EACA;EACA;EACA;;AACA;EACE;;AAGF;AAAA;AAAA;AAAA;AAAA;EAKE;;;AAWF;EACE;;AAGF;AAAA;AAAA;AAAA;AAAA;EAKE;;AAGF;EACE;EACA;;;AE1EN;AAAA;EAEE;EACA;EACA;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;EAGE;;;AAKF;AAAA;EAEE;EACA;EACA;;;ACtBJ;EACE;EACA;EACA;EACA;;AAEA;EACE;;AAGF;EACE;;AAGF;EACE;EACA;;AAGF;EACE;;;ALjBJ;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEF;EAEE;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;IACE;;EAEF;IAEE;;;;AMjDN;EACE;EACA;;AAEA;EAJF;IAKI;IACA;;;AAKA;EACE;;;AAOF;EACE;;;ACnBJ;EACE;;AAEA;EAHF;IAII;;;AAGF;EAPF;IAQI;;;AAKF;EACE;EACA;;AAIJ;AAAA;EAEE;EACA;;AAIF;EACE;EACA;EACA;;;AC7BJ;EACE;EACA;EACA;;;AAIF;EACE;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;;;AAIF;EACE;EACA;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;;;AAKA;EACE;;;AAKF;EACE;;AAGF;EACE;;AAIA;EACE;;;ACnEN;EACE;EACA;EACA;EACA;;AAEA;EACE;;AAKA;EACE;;AAIJ;EAEE;;AAEA;EACE;;AAKA;EACE;;;AASR;EACE;EACA;EACA;EACA;;;ACzCF;EACE;EACA;EACA;EACA;;AAEA;EACE;;AAMA;EACE;;AAKJ;EACE;EACA;;AAGA;EACE;;AAKA;EACE;;;AAMR;EACE;IACE;;EAEF;IACE;;;AAOJ;EACE;EACA;EACA;EACA;;;ACrDF;EACE;EACA;EACA;EACA;;AAEA;EACE;;AAGF;EAEE;EACA;;AAEA;EACE;;;AAMJ;EACE;;AACA;EACE;;AAIJ;EACE;EACA;;AAGF;AAAA;EAEE;;;AAIJ;EACE;IACE;IACA;;EAEF;IACE;IACA;;;AAOJ;EACE;EACA;EACA;EACA;;;AC1DF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAGF;EACE;;AAGF;EACE;;AAEA;EACE;;AAKA;EACE;;;AASR;EACE;EACA;EACA;EACA;;;AClCF;EACE;EACA;EAEA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EAGA;;AAEA;EACE;;AAGF;EACE;;AAGF;EACE;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAEF;EACE;EACA;EACA;EACA;EACA;;AAEF;EACE;;;AAIJ;EACE;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;;;AAGF;EACE;IACE;IACA;;;AAKF;EACE;IACE;IACA;;;;AAQN;EACE;EACA;;AAEA;EACE;;AAGF;EACE;EACA;;;AC1HJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,YACE;EAIF;;AAEA;EACE;;AAGF;EAEE;EACA;EACA;;AAGF;EACE;;AAGF;EACE;;AAIF;EA3CF;IA4CI;;;;AC9CJ;EACE;EACA;EACA;EACA;EACA;EACA;;AAIA;EAVF;IAWI;;;AAGF;EAdF;IAeI;;;;AAIJ;EACE;;;AAKF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EAII;AAAA;AAAA;IACE;IACA;;;AAMJ;EACE;;;AC/CJ;EACE;EACA;;AAEA;AAAA;EAEE;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAKF;EACE;EACA;EAEA;;AAGF;EACE;;AAKF;AAAA;EAEE;;;AFrCN;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,YACE;EAIF;;AAEA;EACE;;AAGF;EAEE;EACA;EACA;;AAGF;EACE;;AAGF;EACE;;AAIF;EA3CF;IA4CI;;;;AGhDJ;EACE;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAEF;EACE;EACA;;;AAKN;EACE;EACA;;;AC1BF;EACE;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;EACA;;;AAIA;EACE;EACA;;;AAIJ;EACE;;;AC3CF;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;;;AAIJ;EACE;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;;AAEA;EACE;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAIA;AAAA;EACE;;AAGJ;EACE;EACA;;AAKA;AAAA;EACE;;AAGJ;EACE;;;AAON;EACE;EACA;;;AChFJ;EACE;EACA;EACA;;;AAGF;EACE;EACA;;;AAGF;EACE;;;AAIF;EACE;EACA;;;AAGA;EACE;;;AAIJ;EACE;;;AAGF;EACE;;;AC9BA;EACE;;AAEA;EACE;EACA;EACA;EACA;EACA;;AAEF;EACE;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;;AAGF;EACE;;AAGF;EACE;EACA;EACA;EACA;;AAIF;EACE;IACE;IACA;;;;AAKN;AAAA;EAGE;;AAGE;AAAA;EACE;;AAIJ;AAAA;EACE;;;AAKF;EACE;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAGF;EACE;EACA;;;AC/CJ;EACE;EACA","file":"main.css"}
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../src/AttachMenu/AttachMenu.scss","../../src/Chatbot/Chatbot.scss","../../src/ChatbotAlert/ChatbotAlert.scss","../../src/ChatbotContent/ChatbotContent.scss","../../src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.scss","../../src/ChatbotFooter/ChatbotFootnote.scss","../../src/ChatbotFooter/ChatbotFooter.scss","../../src/ChatbotHeader/ChatbotHeader.scss","../../src/ChatbotModal/ChatbotModal.scss","../../src/ChatbotPopover/ChatbotPopover.scss","../../src/ChatbotToggle/ChatbotToggle.scss","../../src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.scss","../../src/CodeModal/CodeModal.scss","../../src/Compare/Compare.scss","../../src/FileDetails/FileDetails.scss","../../src/FileDetailsLabel/FileDetailsLabel.scss","../../src/FileDropZone/FileDropZone.scss","../../src/Message/Message.scss","../../src/Message/MessageLoading.scss","../../src/Message/CodeBlockMessage/CodeBlockMessage.scss","../../src/Message/TextMessage/TextMessage.scss","../../src/Message/ImageMessage/ImageMessage.scss","../../src/Message/ListMessage/ListMessage.scss","../../src/Message/TableMessage/TableMessage.scss","../../src/Message/QuickStarts/QuickStartTile.scss","../../src/Message/QuickResponse/QuickResponse.scss","../../src/Message/UserFeedback/UserFeedback.scss","../../src/MessageBar/AttachButton.scss","../../src/MessageBar/MicrophoneButton.scss","../../src/MessageBar/SendButton.scss","../../src/MessageBar/StopButton.scss","../../src/MessageBar/MessageBar.scss","../../src/MessageBox/JumpButton.scss","../../src/MessageBox/MessageBox.scss","../../src/MessageDivider/MessageDivider.scss","../../src/ResponseActions/ResponseActions.scss","../../src/Settings/Settings.scss","../../src/SourcesCard/SourcesCard.scss","../../src/SourceDetailsMenuItem/SourceDetailsMenuItem.scss","../../src/TermsOfUse/TermsOfUse.scss","../../src/main.scss"],"names":[],"mappings":";AAAA;EACE;EACA;;;AAGF;AACE;AAsBA;AASA;;AA9BA;EACE;EACA;EACA;EACA;;AAEF;EACE;;AAGF;AACE;;AACA;EACE;EACA;EACA;EACA;EACA;;AAKJ;EACE;;AAGF;EACE;;AAIF;EACE;EACA;;AAGF;EACE;EACA;;AAGF;EACE;EACA;EACA;;AAGF;EACE;;AAGF;EACE;;;ACxDJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGA;EACE;;AAKF;EAvBF;IAwBI;IACA;;;AAIF;EA7BF;IA8BI;;;;AAOJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAIA;EAXF;IAYI;;;;AAOJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAMF;EACE;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;AAGA;EACE;;AAIF;EAdF;IAeI;;;;AAIJ;EACE;;;AAGF;AAAA;AAAA;EAGE;;;AAMF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;;AAOJ;EACE;;;ACpIF;EACE;EACA;EACA;;;ACAF;EACE;EACA;EACA;EACA;EACA;;AAGA;EARF;IASI;;;;AAOJ;EAII;AAAA;AAAA;IACE;IACA;;;ACrBJ;EACE;EACA;;AAKF;EACE;EACA;EACA;EACA;EACA;;AAIF;EACE;EACA;;AAIF;EACE;EAEA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGA;EACE;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;;AAEA;EACE;EACA;EACA;;AAKN;EACE;;AAGF;EACE;;AAGF;EACE;;;AAMJ;EACE;EACA;EACA;;AAGA;EACE;EACA;EACA;EACA;EACA;EACA;;AAIF;EACE;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;;AAIF;EACE;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;;AAKA;EACE;EACA;EACA;EACA;EACA;;AAKJ;EACE;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;;AAKA;EACE;;;AASJ;EACE;;;AASF;AAAA;EACE;;AACA;AAAA;EACE;;;AASJ;EACE;;AACA;EACE;EACA;;AAEF;EACE;;;AAUF;AAAA;AAAA;AAAA;EACE;;;AAKN;EACE;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;;;AAKE;EACE;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;;AAIJ;EACE;;AAGF;EACE;EACA;;AAGA;EACE;EACA;EACA;EACA;EACA;EACA;;;AC9PN;EACE;;AAEA;EACE;EACA;;;ACHJ;EACE;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;;;AAMF;EAGI;AAAA;IACE;;EACA;AAAA;IACE;;EAGJ;AAAA;IACE;IACA;IACA;;;AASJ;EACE;;;AAQF;EACE;;;AAIJ;EACE;EACA;;;AC3DF;EACE;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAEA;EACE;;AAKJ;EACE;EACA;EACA;;AAEA;EACE;;AAGF;EACE;EACA;;AAIJ;EACE;;AAGF;EACE;EACA;EACA;EACA;EACA;;AACA;EACE;EACA;;;AAQN;EAGI;AAAA;IACE;;EAEF;AAAA;IACE;;;AAUJ;AAAA;EACE;;;AAOJ;AAAA;EAEE;EACA;EACA;EACA;EACA;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;EAGE;;AAGF;AAAA;AAAA;AAAA;EAEE;EACA;EACA;;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAGE;;;AAOJ;EACE;;;AAOJ;AAAA;EAEE;;;AAGF;EACE;;;AAGF;EACE;;;AAOA;EACE;EACA;;AAGF;EACE;EACA;;;AAIJ;AAAA;EAEE;EACA;;;AAGF;EACE;;;AClKF;EACE;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAGF;EACE;EACA;;AAEF;EACE;;;AAOJ;EACE;AAAA;IAEE;IACA;IACA;IACA;IACA;IACA;IACA;;;AAGJ;EACE;AAAA;IAEE;IACA;IACA;IACA;IACA;IACA;IACA;;;AAOJ;EACE;;;AAMF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAQE;EACE;;;AAQN;EACE;;;AAOA;EACE;;AAGF;EACE;EACA;;;ACjGF;EACE;;AAMA;EACE;;AAEF;EACE;;AAEF;EACE;;AAIF;EACE;EACA;;AAEF;EACE;;;ACxBN;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EAEE;;AAGF;EACE;;AAIF;EACE;EACA;;;AAIJ;EACE;EACA;EACA;;;AC3BF;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAGF;EACE;;AAGF;EACE;;AAGF;EACE;EACA;EACA;;AAGF;EACE;EACA;EACA;;;AAIJ;EACE;EACA;;AAEA;EACE;;;AAOJ;EAIM;AAAA;IACE;IACA;;;ACpDN;EACE;EACA;EACA;EACA;EACA;;AAEF;EACE;AACA;EACA;EACA;;AAEF;EACE;;AAEF;EACE;EACA;;AAEF;EACE;;AAEF;EACE;EACA;EACA;AAAA;AAAA;EAGA;EACA;;AAEF;EACE;EACA;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;;AAEF;EACE;;AAEF;EACE;EACA;EACA;;AAEF;EACE;;AAEF;EACE;EACA;;AAEF;EACE;;AAGA;EACE;;;AAUF;EACE;EACA;;;AAKN;EACE;;;AAGF;EACE;;;AAIA;EACE;;;AC5FJ;EACE;EACA;EACA;EACA;;;AAEF;EACE;;AAEA;EACE;EACA;EACA;;;AAGJ;EACE;EACA;EACA;;AAEA;EALF;IAMI;;;AAGF;EACE;;AAEA;EAHF;IAII;;;;AAKN;EACE;;AAEA;EACE;;AAGF;EACE;;AAIA;EADF;IAEI;;;;AAIN;EACE;;AAEA;EAHF;IAII;;;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EARF;IASI;IACA;IACA;;;;ACrEJ;EACE;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;;;AAIF;EACE;EACA;EACA;EACA;EACA;;;ACvBF;EACE;EACA;EACA;EACA;;;AAGF;EACE;EAEA;EACA;EACA;;AACA;EACE;;AAGF;AAAA;EAEE;EACA;;;AAIJ;EACE;EACA;EACA;;AAEA;EACE;;;AAKF;EACE;;AAGF;EACE;;;AAIJ;AAAA;EAEE;EACA;;AAEA;AAAA;EACE;;;AAKF;EACE;;;AAMF;AAAA;EACE;;;AC/DJ;EACE;EACA;;;AAGF;EACE;EACA;EACA;;AAGA;EANF;IAOI;;;;AAIJ;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAIJ;AACA;EACE;EACA;EACA;EACA;;;AAME;EADF;IAEI;IACA;IACA;;EAEA;IACE;;;;AChDR;EACE;EACA;EACA;EACA;;AAIA;EACE;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;;AAKF;EACE;EACA;;AAKF;EACE;EACA;EACA;EACA;;AAKF;EACE;EACA;EACA;;AAGA;EACE;EAQA;EACA;;AAIF;EACE;EACA;;AAIF;EACE;;AAEF;EACE;;AAMJ;EACE;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;;;AAMJ;EACE;EACA;EACA;;;AAGF;EACE;;;ACnGF;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEF;EAEE;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;IACE;;EAEF;IAEE;;;;AC9CN;EACE;EACA;EACA;EACA;;AAGA;EACE;EACA;;AAIF;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAGF;EACE;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;;AAEA;EAEE;;AAMN;EACE;EACA;EACA;EACA;EACA;;AAEA;AAAA;EAEE;EACA;EACA;;AAEF;EACE;EACA;EACA;;AAGF;EACE;EACA;;;AAKN;EACE;EACA;;;AAIA;EACE;EACA;;;AClFJ;EACE;;AAGE;EACE;;;AAMN;EACE;EACA;EACA;;AAEA;EACE;;AAGF;AAAA;AAAA;AAAA;AAAA;EAKE;;AAGF;EACE;EACA;;;AAKF;EACE;EACA;EACA;EACA;;AACA;EACE;;AAGF;AAAA;AAAA;AAAA;AAAA;EAKE;;;AAWF;EACE;;AAGF;AAAA;AAAA;AAAA;AAAA;EAKE;;AAGF;EACE;EACA;;;AHmCJ;EACE;EACA;;AAEA;EACE;;AAIJ;EACE;;AAGF;EACE;EACA;;AAGF;EACE;;;AEjIJ;EACE;EACA;EACA;EACA;;AAGA;EACE;EACA;;AAIF;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAGF;EACE;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;;AAEA;EAEE;;AAMN;EACE;EACA;EACA;EACA;EACA;;AAEA;AAAA;EAEE;EACA;EACA;;AAEF;EACE;EACA;EACA;;AAGF;EACE;EACA;;;AAKN;EACE;EACA;;;AAIA;EACE;EACA;;;AEtFJ;EACE;EACA;EACA;EACA;EAGA;;;ADHF;EACE;;AAGE;EACE;;;AAMN;EACE;EACA;EACA;;AAEA;EACE;;AAGF;AAAA;AAAA;AAAA;AAAA;EAKE;;AAGF;EACE;EACA;;;AAKF;EACE;EACA;EACA;EACA;;AACA;EACE;;AAGF;AAAA;AAAA;AAAA;AAAA;EAKE;;;AAWF;EACE;;AAGF;AAAA;AAAA;AAAA;AAAA;EAKE;;AAGF;EACE;EACA;;;AE1EN;AAAA;EAEE;EACA;EACA;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;EAGE;;;AAKF;AAAA;EAEE;EACA;EACA;;;ACtBJ;EACE;EACA;EACA;EACA;;AAEA;EACE;;AAGF;EACE;;AAGF;EACE;EACA;;AAGF;EACE;;;ALjBJ;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEF;EAEE;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;IACE;;EAEF;IAEE;;;;AMjDN;EACE;EACA;;AAEA;EAJF;IAKI;IACA;;;AAKA;EACE;;;AAOF;EACE;;;ACnBJ;EACE;;AAEA;EAHF;IAII;;;AAGF;EAPF;IAQI;;;AAKF;EACE;EACA;;AAIJ;AAAA;EAEE;EACA;;AAIF;EACE;EACA;EACA;;;AC7BJ;EACE;EACA;EACA;;;AAIF;EACE;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;;;AAIF;EACE;EACA;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;;;AAKA;EACE;;;AAKF;EACE;;AAGF;EACE;;AAIA;EACE;;;ACnEN;EACE;EACA;EACA;EACA;;AAEA;EACE;;AAKA;EACE;;AAIJ;EAEE;;AAEA;EACE;;AAKA;EACE;;;AASR;EACE;EACA;EACA;EACA;;;ACzCF;EACE;EACA;EACA;EACA;;AAEA;EACE;;AAMA;EACE;;AAKJ;EACE;EACA;;AAGA;EACE;;AAKA;EACE;;;AAMR;EACE;IACE;;EAEF;IACE;;;AAOJ;EACE;EACA;EACA;EACA;;;ACrDF;EACE;EACA;EACA;EACA;;AAEA;EACE;;AAGF;EAEE;EACA;;AAEA;EACE;;;AAMJ;EACE;;AACA;EACE;;AAIJ;EACE;EACA;;AAGF;AAAA;EAEE;;;AAIJ;EACE;IACE;IACA;;EAEF;IACE;IACA;;;AAOJ;EACE;EACA;EACA;EACA;;;AC1DF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAGF;EACE;;AAGF;EACE;;AAEA;EACE;;AAKA;EACE;;;AASR;EACE;EACA;EACA;EACA;;;AClCF;EACE;EACA;EAEA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EAGA;;AAEA;EACE;;AAGF;EACE;;AAGF;EACE;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAEF;EACE;EACA;EACA;EACA;EACA;;AAEF;EACE;;;AAIJ;EACE;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;;;AAGF;EACE;IACE;IACA;;;AAKF;EACE;IACE;IACA;;;;AAQN;EACE;EACA;;AAEA;EACE;;AAGF;EACE;EACA;;;AC1HJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,YACE;EAIF;;AAEA;EACE;;AAGF;EAEE;EACA;EACA;;AAGF;EACE;;AAGF;EACE;;AAIF;EA3CF;IA4CI;;;;AC9CJ;EACE;EACA;EACA;EACA;EACA;EACA;;AAIA;EAVF;IAWI;;;AAGF;EAdF;IAeI;;;;AAIJ;EACE;;;AAKF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EAII;AAAA;AAAA;IACE;IACA;;;AAMJ;EACE;;;AC/CJ;EACE;EACA;;AAEA;AAAA;EAEE;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAKF;EACE;EACA;EAEA;;AAGF;EACE;;AAKF;AAAA;EAEE;;;AFrCN;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,YACE;EAIF;;AAEA;EACE;;AAGF;EAEE;EACA;EACA;;AAGF;EACE;;AAGF;EACE;;AAIF;EA3CF;IA4CI;;;;AGhDJ;EACE;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAEF;EACE;EACA;;;AAKN;EACE;EACA;;;AC1BF;EACE;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;EACA;;;AAIA;EACE;EACA;;;AAIJ;EACE;;;AC3CF;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;;;AAIJ;EACE;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;;AAEA;EACE;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAIA;AAAA;EACE;;AAGJ;EACE;EACA;;AAKA;AAAA;EACE;;AAGJ;EACE;;;AAON;EACE;EACA;;;AChFJ;EACE;EACA;EACA;;;AAGF;EACE;EACA;;;AAGF;EACE;;;AAIF;EACE;EACA;;;AAGA;EACE;;;AAIJ;EACE;;;AAGF;EACE;;;AC9BA;EACE;;AAEA;EACE;EACA;EACA;EACA;EACA;;AAEF;EACE;;AAIJ;EACE;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;;AAGF;EACE;;AAGF;EACE;EACA;EACA;EACA;;AAIF;EACE;IACE;IACA;;;;AAKN;AAAA;EAGE;;AAGE;AAAA;EACE;;AAIJ;AAAA;EACE;;;AAKF;EACE;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAGF;EACE;EACA;;;AC/CJ;EACE;EACA","file":"main.css"}
|
|
@@ -7,7 +7,7 @@ export const ChatbotConversationHistoryDropdown = ({ menuItems, menuClassName, o
|
|
|
7
7
|
const [isOpen, setIsOpen] = useState(false);
|
|
8
8
|
const toggle = (toggleRef) => (_jsx(Tooltip, { className: "pf-chatbot__tooltip", content: label !== null && label !== void 0 ? label : 'Conversation options', position: "bottom",
|
|
9
9
|
// prevents VO announcements of both aria label and tooltip
|
|
10
|
-
aria: "none", children: _jsx(MenuToggle, { className: "pf-chatbot__history-actions", variant: "plain", "aria-label": label !== null && label !== void 0 ? label : 'Conversation options', ref: toggleRef, isExpanded: isOpen, onClick: () => setIsOpen(!isOpen),
|
|
10
|
+
aria: "none", children: _jsx(MenuToggle, { className: "pf-chatbot__history-actions", variant: "plain", "aria-label": label !== null && label !== void 0 ? label : 'Conversation options', ref: toggleRef, isExpanded: isOpen, onClick: () => setIsOpen(!isOpen), children: _jsx(EllipsisIcon, {}) }) }));
|
|
11
11
|
return (_jsx(Dropdown, { className: `pf-chatbot__selections ${menuClassName !== null && menuClassName !== void 0 ? menuClassName : ''}`, isOpen: isOpen, onSelect: (props) => {
|
|
12
12
|
onSelect === null || onSelect === void 0 ? void 0 : onSelect(props);
|
|
13
13
|
setIsOpen((prev) => !prev);
|
|
@@ -17,11 +17,11 @@ describe('ChatbotConversationHistoryDropdown', () => {
|
|
|
17
17
|
const menuItems = (_jsxs(_Fragment, { children: [_jsx(DropdownItem, { children: "Rename" }), _jsx(DropdownItem, { children: "Delete" })] }));
|
|
18
18
|
it('should render the dropdown', () => {
|
|
19
19
|
render(_jsx(ChatbotConversationHistoryDropdown, { menuItems: menuItems, menuClassName: "custom-class" }));
|
|
20
|
-
expect(screen.queryByRole('
|
|
20
|
+
expect(screen.queryByRole('button', { name: /Conversation options/i })).toBeInTheDocument();
|
|
21
21
|
});
|
|
22
22
|
it('should display the dropdown menuItems', () => {
|
|
23
23
|
render(_jsx(ChatbotConversationHistoryDropdown, { menuItems: menuItems }));
|
|
24
|
-
const toggle = screen.queryByRole('
|
|
24
|
+
const toggle = screen.queryByRole('button', { name: /Conversation options/i });
|
|
25
25
|
expect(toggle).toBeInTheDocument();
|
|
26
26
|
fireEvent.click(toggle);
|
|
27
27
|
waitFor(() => {
|
|
@@ -31,14 +31,14 @@ describe('ChatbotConversationHistoryDropdown', () => {
|
|
|
31
31
|
});
|
|
32
32
|
it('should invoke onSelect callback when menuitem is clicked', () => {
|
|
33
33
|
render(_jsx(ChatbotConversationHistoryDropdown, { menuItems: menuItems, onSelect: onSelect }));
|
|
34
|
-
const toggle = screen.queryByRole('
|
|
34
|
+
const toggle = screen.queryByRole('button', { name: /Conversation options/i });
|
|
35
35
|
fireEvent.click(toggle);
|
|
36
36
|
fireEvent.click(screen.getByText('Rename'));
|
|
37
37
|
expect(onSelect).toHaveBeenCalled();
|
|
38
38
|
});
|
|
39
39
|
it('should toggle the dropdown when menuitem is clicked', () => {
|
|
40
40
|
render(_jsx(ChatbotConversationHistoryDropdown, { menuItems: menuItems, onSelect: onSelect }));
|
|
41
|
-
const toggle = screen.queryByRole('
|
|
41
|
+
const toggle = screen.queryByRole('button', { name: /Conversation options/i });
|
|
42
42
|
fireEvent.click(toggle);
|
|
43
43
|
fireEvent.click(screen.getByText('Delete'));
|
|
44
44
|
expect(onSelect).toHaveBeenCalled();
|
|
@@ -46,7 +46,7 @@ describe('ChatbotConversationHistoryDropdown', () => {
|
|
|
46
46
|
});
|
|
47
47
|
it('should close the dropdown when user clicks outside', () => {
|
|
48
48
|
render(_jsx(ChatbotConversationHistoryDropdown, { menuItems: menuItems, onSelect: onSelect }));
|
|
49
|
-
const toggle = screen.queryByRole('
|
|
49
|
+
const toggle = screen.queryByRole('button', { name: /Conversation options/i });
|
|
50
50
|
fireEvent.click(toggle);
|
|
51
51
|
expect(screen.queryByText('Delete')).toBeInTheDocument();
|
|
52
52
|
fireEvent.click(toggle.parentElement);
|
|
@@ -54,7 +54,7 @@ describe('ChatbotConversationHistoryDropdown', () => {
|
|
|
54
54
|
});
|
|
55
55
|
it('should show the tooltip when the user hovers over the toggle button', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
56
56
|
render(_jsx(ChatbotConversationHistoryDropdown, { menuItems: menuItems, label: "Actions dropdown" }));
|
|
57
|
-
const toggle = screen.queryByRole('
|
|
57
|
+
const toggle = screen.queryByRole('button', { name: /Actions dropdown/i });
|
|
58
58
|
fireEvent(toggle, new MouseEvent('mouseenter', {
|
|
59
59
|
bubbles: false,
|
|
60
60
|
cancelable: false
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FunctionComponent } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ButtonProps, DrawerProps, ListItemProps, DrawerPanelContentProps, DrawerContentProps, DrawerContentBodyProps, DrawerHeadProps, DrawerActionsProps, DrawerCloseButtonProps, DrawerPanelBodyProps, SkeletonProps, MenuProps, // Remove in next breaking change
|
|
3
|
+
TitleProps, ListProps } from '@patternfly/react-core';
|
|
3
4
|
import { ChatbotDisplayMode } from '../Chatbot/Chatbot';
|
|
4
5
|
import { HistoryEmptyStateProps } from './EmptyState';
|
|
5
6
|
export interface Conversation {
|
|
@@ -19,8 +20,10 @@ export interface Conversation {
|
|
|
19
20
|
label?: string;
|
|
20
21
|
/** Callback for when user selects item. */
|
|
21
22
|
onSelect?: (event?: React.MouseEvent, value?: string | number) => void;
|
|
22
|
-
/** Additional props passed to conversation
|
|
23
|
-
additionalProps?:
|
|
23
|
+
/** Additional props passed to conversation button item */
|
|
24
|
+
additionalProps?: ButtonProps;
|
|
25
|
+
/** Additional props passed to conversation list item */
|
|
26
|
+
listItemProps?: Omit<ListItemProps, 'children'>;
|
|
24
27
|
}
|
|
25
28
|
export interface ChatbotConversationHistoryNavProps extends DrawerProps {
|
|
26
29
|
/** Function called to toggle drawer */
|
|
@@ -38,6 +41,12 @@ export interface ChatbotConversationHistoryNavProps extends DrawerProps {
|
|
|
38
41
|
};
|
|
39
42
|
/** Additional button props for new chat button. */
|
|
40
43
|
newChatButtonProps?: ButtonProps;
|
|
44
|
+
/** Additional props applied to all conversation list headers */
|
|
45
|
+
titleProps?: Partial<TitleProps>;
|
|
46
|
+
/** Additional props applied to conversation list. If conversations is an object, you should pass an object of ListProps for each group. */
|
|
47
|
+
listProps?: ListProps | {
|
|
48
|
+
[key: string]: ListProps;
|
|
49
|
+
};
|
|
41
50
|
/** Text shown in blue button */
|
|
42
51
|
newChatButtonText?: string;
|
|
43
52
|
/** Callback function for when blue button is clicked. Omit to hide blue "new chat button" */
|
|
@@ -56,7 +65,7 @@ export interface ChatbotConversationHistoryNavProps extends DrawerProps {
|
|
|
56
65
|
reverseButtonOrder?: boolean;
|
|
57
66
|
/** Custom test id for the drawer actions */
|
|
58
67
|
drawerActionsTestId?: string;
|
|
59
|
-
/** Additional props applied to
|
|
68
|
+
/** @deprecated Additional props applied to list container */
|
|
60
69
|
menuProps?: MenuProps;
|
|
61
70
|
/** Additional props applied to panel */
|
|
62
71
|
drawerPanelContentProps?: DrawerPanelContentProps;
|
|
@@ -12,34 +12,28 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { useRef, Fragment } from 'react';
|
|
14
14
|
// Import PatternFly components
|
|
15
|
-
import { Button, Drawer, DrawerPanelContent, DrawerContent, DrawerPanelBody, DrawerHead, DrawerActions, DrawerCloseButton, DrawerContentBody, SearchInput,
|
|
15
|
+
import { Button, Drawer, DrawerPanelContent, DrawerContent, DrawerPanelBody, DrawerHead, DrawerActions, DrawerCloseButton, DrawerContentBody, SearchInput, List, ListItem, Title, Icon } from '@patternfly/react-core';
|
|
16
16
|
import { OutlinedClockIcon, OutlinedCommentAltIcon, PenToSquareIcon } from '@patternfly/react-icons';
|
|
17
17
|
import { ChatbotDisplayMode } from '../Chatbot/Chatbot';
|
|
18
18
|
import ConversationHistoryDropdown from './ChatbotConversationHistoryDropdown';
|
|
19
19
|
import LoadingState from './LoadingState';
|
|
20
20
|
import HistoryEmptyState from './EmptyState';
|
|
21
21
|
export const ChatbotConversationHistoryNav = (_a) => {
|
|
22
|
-
var { onDrawerToggle, isDrawerOpen, setIsDrawerOpen, activeItemId, onSelectActiveItem, conversations, newChatButtonText = 'New chat', drawerContent, onNewChat, newChatButtonProps, searchInputPlaceholder = 'Search previous conversations...', searchInputAriaLabel = 'Filter menu items', handleTextInputChange, displayMode, reverseButtonOrder = false, drawerActionsTestId = 'chatbot-nav-drawer-actions',
|
|
22
|
+
var { onDrawerToggle, isDrawerOpen, setIsDrawerOpen, activeItemId, onSelectActiveItem, conversations, titleProps, listProps, newChatButtonText = 'New chat', drawerContent, onNewChat, newChatButtonProps, searchInputPlaceholder = 'Search previous conversations...', searchInputAriaLabel = 'Filter menu items', handleTextInputChange, displayMode, reverseButtonOrder = false, drawerActionsTestId = 'chatbot-nav-drawer-actions', drawerPanelContentProps, drawerContentProps, drawerContentBodyProps, drawerHeadProps, drawerActionsProps, drawerCloseButtonProps, drawerPanelBodyProps, isLoading, loadingState, errorState, emptyState, noResultsState, isCompact, title = 'Chat history' } = _a, props = __rest(_a, ["onDrawerToggle", "isDrawerOpen", "setIsDrawerOpen", "activeItemId", "onSelectActiveItem", "conversations", "titleProps", "listProps", "newChatButtonText", "drawerContent", "onNewChat", "newChatButtonProps", "searchInputPlaceholder", "searchInputAriaLabel", "handleTextInputChange", "displayMode", "reverseButtonOrder", "drawerActionsTestId", "drawerPanelContentProps", "drawerContentProps", "drawerContentBodyProps", "drawerHeadProps", "drawerActionsProps", "drawerCloseButtonProps", "drawerPanelBodyProps", "isLoading", "loadingState", "errorState", "emptyState", "noResultsState", "isCompact", "title"]);
|
|
23
23
|
const drawerRef = useRef(null);
|
|
24
24
|
const onExpand = () => {
|
|
25
25
|
drawerRef.current && drawerRef.current.focus();
|
|
26
26
|
};
|
|
27
27
|
const getNavItem = (conversation) => {
|
|
28
28
|
var _a;
|
|
29
|
-
return (_jsx(
|
|
30
|
-
? {
|
|
31
|
-
actions: (_jsx(ConversationHistoryDropdown, { menuClassName: conversation.menuClassName, onSelect: conversation.onSelect, menuItems: conversation.menuItems, label: conversation.label }))
|
|
32
|
-
}
|
|
33
|
-
: {}), conversation.additionalProps, { children: conversation.text }), conversation.id));
|
|
29
|
+
return (_jsx(ListItem, Object.assign({ className: `pf-chatbot__conversation-list-item ${activeItemId && activeItemId === conversation.id ? 'pf-chatbot__conversation-list-item--active' : ''}` }, conversation.listItemProps, { children: _jsxs(_Fragment, { children: [_jsx(Button, Object.assign({ className: "pf-chatbot__conversation-history-item", variant: "link" }, conversation.additionalProps, (conversation.noIcon ? {} : { icon: (_a = conversation.icon) !== null && _a !== void 0 ? _a : _jsx(OutlinedCommentAltIcon, {}) }), { onClick: (event) => onSelectActiveItem === null || onSelectActiveItem === void 0 ? void 0 : onSelectActiveItem(event, conversation.id), children: conversation.text })), conversation.menuItems && (_jsx(ConversationHistoryDropdown, { menuClassName: conversation.menuClassName, onSelect: conversation.onSelect, menuItems: conversation.menuItems, label: conversation.label }))] }) }), conversation.id));
|
|
34
30
|
};
|
|
35
|
-
const
|
|
31
|
+
const buildConversations = () => {
|
|
36
32
|
if (Array.isArray(conversations)) {
|
|
37
|
-
|
|
38
|
-
return (_jsx(MenuList, { children: conversations.map((conversation) => (_jsx(Fragment, { children: getNavItem(conversation) }, conversation.id))) }));
|
|
33
|
+
return (_jsx(List, Object.assign({ className: "pf-chatbot__conversation-list", isPlain: true }, listProps, { children: conversations.map((conversation) => (_jsx(Fragment, { children: getNavItem(conversation) }, conversation.id))) })));
|
|
39
34
|
}
|
|
40
35
|
else {
|
|
41
|
-
|
|
42
|
-
return (_jsx(_Fragment, { children: Object.keys(conversations).map((navGroup) => (_jsx(MenuGroup, { className: "pf-chatbot__menu-item-header", label: navGroup, children: _jsx(MenuList, { children: conversations[navGroup].map((conversation) => (_jsx(Fragment, { children: getNavItem(conversation) }, conversation.id))) }) }, navGroup))) }));
|
|
36
|
+
return (_jsx("div", { children: Object.keys(conversations).map((navGroup) => (_jsxs("section", { children: [_jsx(Title, Object.assign({ headingLevel: "h4", className: "pf-chatbot__conversation-list-header" }, titleProps, { children: navGroup })), _jsx(List, Object.assign({ className: "pf-chatbot__conversation-list", isPlain: true }, listProps === null || listProps === void 0 ? void 0 : listProps[navGroup], { children: conversations[navGroup].map((conversation) => (_jsx(Fragment, { children: getNavItem(conversation) }, conversation.id))) }))] }, navGroup))) }));
|
|
43
37
|
}
|
|
44
38
|
};
|
|
45
39
|
// Menu Content
|
|
@@ -55,7 +49,7 @@ export const ChatbotConversationHistoryNav = (_a) => {
|
|
|
55
49
|
if (noResultsState) {
|
|
56
50
|
return _jsx(HistoryEmptyState, Object.assign({}, noResultsState));
|
|
57
51
|
}
|
|
58
|
-
return
|
|
52
|
+
return _jsx(_Fragment, { children: buildConversations() });
|
|
59
53
|
};
|
|
60
54
|
const renderDrawerContent = () => (_jsx(_Fragment, { children: _jsx(DrawerPanelBody, Object.assign({}, drawerPanelBodyProps, { children: renderMenuContent() })) }));
|
|
61
55
|
const renderPanelContent = () => {
|
|
@@ -193,4 +193,25 @@ describe('ChatbotConversationHistoryNav', () => {
|
|
|
193
193
|
const iconElement = container.querySelector('.pf-chatbot__title-icon');
|
|
194
194
|
expect(iconElement).toBeInTheDocument();
|
|
195
195
|
});
|
|
196
|
+
it('Passes titleProps to Title', () => {
|
|
197
|
+
render(_jsx(ChatbotConversationHistoryNav, { onDrawerToggle: onDrawerToggle, isDrawerOpen: true, displayMode: ChatbotDisplayMode.fullscreen, setIsDrawerOpen: jest.fn(), conversations: { Today: initialConversations }, titleProps: { className: 'test' } }));
|
|
198
|
+
expect(screen.getByRole('heading', { name: /Today/i })).toHaveClass('test');
|
|
199
|
+
});
|
|
200
|
+
it('Overrides Title heading level when titleProps.headingLevel is passed', () => {
|
|
201
|
+
render(_jsx(ChatbotConversationHistoryNav, { onDrawerToggle: onDrawerToggle, isDrawerOpen: true, displayMode: ChatbotDisplayMode.fullscreen, setIsDrawerOpen: jest.fn(), conversations: { Today: initialConversations }, titleProps: { headingLevel: 'h2' } }));
|
|
202
|
+
expect(screen.queryByRole('heading', { name: /Today/i, level: 4 })).not.toBeInTheDocument();
|
|
203
|
+
expect(screen.getByRole('heading', { name: /Today/i, level: 2 })).toBeInTheDocument();
|
|
204
|
+
});
|
|
205
|
+
it('Passes listProps to List when conversations is an array', () => {
|
|
206
|
+
render(_jsx(ChatbotConversationHistoryNav, { onDrawerToggle: onDrawerToggle, isDrawerOpen: true, displayMode: ChatbotDisplayMode.fullscreen, setIsDrawerOpen: jest.fn(), conversations: initialConversations, listProps: { className: 'test' } }));
|
|
207
|
+
expect(screen.getByRole('list')).toHaveClass('test');
|
|
208
|
+
});
|
|
209
|
+
it('Passes listProps to List when conversations is an object', () => {
|
|
210
|
+
render(_jsx(ChatbotConversationHistoryNav, { onDrawerToggle: onDrawerToggle, isDrawerOpen: true, displayMode: ChatbotDisplayMode.fullscreen, setIsDrawerOpen: jest.fn(), conversations: { Today: initialConversations }, listProps: { Today: { className: 'test' } } }));
|
|
211
|
+
expect(screen.getByRole('list')).toHaveClass('test');
|
|
212
|
+
});
|
|
213
|
+
it('Passes listItemProps to ListItem', () => {
|
|
214
|
+
render(_jsx(ChatbotConversationHistoryNav, { onDrawerToggle: onDrawerToggle, isDrawerOpen: true, displayMode: ChatbotDisplayMode.fullscreen, setIsDrawerOpen: jest.fn(), conversations: [{ id: '1', text: 'ChatBot documentation', listItemProps: { className: 'test' } }] }));
|
|
215
|
+
expect(screen.getByRole('listitem')).toHaveClass('test');
|
|
216
|
+
});
|
|
196
217
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/chatbot",
|
|
3
|
-
"version": "6.4.0-prerelease.
|
|
3
|
+
"version": "6.4.0-prerelease.6",
|
|
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",
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
// From Cursor, with aid
|
|
2
|
+
import React, { FunctionComponent, useState, useRef, useEffect } from 'react';
|
|
3
|
+
import { ChatbotDisplayMode } from '@patternfly/chatbot/dist/dynamic/Chatbot';
|
|
4
|
+
import ChatbotConversationHistoryNav, {
|
|
5
|
+
Conversation
|
|
6
|
+
} from '@patternfly/chatbot/dist/dynamic/ChatbotConversationHistoryNav';
|
|
7
|
+
import { ChatbotModal } from '@patternfly/chatbot/dist/dynamic/ChatbotModal';
|
|
8
|
+
import {
|
|
9
|
+
Checkbox,
|
|
10
|
+
DropdownItem,
|
|
11
|
+
DropdownList,
|
|
12
|
+
Button,
|
|
13
|
+
TextInput,
|
|
14
|
+
Form,
|
|
15
|
+
FormGroup,
|
|
16
|
+
ModalHeader,
|
|
17
|
+
ModalBody,
|
|
18
|
+
ModalFooter
|
|
19
|
+
} from '@patternfly/react-core';
|
|
20
|
+
|
|
21
|
+
export const ChatbotHeaderTitleDemo: FunctionComponent = () => {
|
|
22
|
+
const [isDrawerOpen, setIsDrawerOpen] = useState(true);
|
|
23
|
+
const displayMode = ChatbotDisplayMode.embedded;
|
|
24
|
+
|
|
25
|
+
// Modal state
|
|
26
|
+
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
27
|
+
const [editingConversationId, setEditingConversationId] = useState<string | number | null>(null);
|
|
28
|
+
const [editingText, setEditingText] = useState('');
|
|
29
|
+
|
|
30
|
+
// Ref for the text input
|
|
31
|
+
const textInputRef = useRef<HTMLInputElement>(null);
|
|
32
|
+
|
|
33
|
+
// Focus the text input when modal opens
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (isModalOpen && textInputRef.current) {
|
|
36
|
+
textInputRef.current.focus();
|
|
37
|
+
// Move cursor to the end of the text
|
|
38
|
+
const length = textInputRef.current.value.length;
|
|
39
|
+
textInputRef.current.setSelectionRange(length, length);
|
|
40
|
+
}
|
|
41
|
+
}, [isModalOpen]);
|
|
42
|
+
|
|
43
|
+
const findConversationAndGroup = (conversations: { [key: string]: Conversation[] }, itemId: string | number) => {
|
|
44
|
+
for (const [groupKey, conversationList] of Object.entries(conversations)) {
|
|
45
|
+
const conversationIndex = conversationList.findIndex((conv) => conv.id === itemId);
|
|
46
|
+
if (conversationIndex !== -1) {
|
|
47
|
+
return { groupKey, conversationIndex, conversation: conversationList[conversationIndex] };
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return null;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const onRenameClick = (itemId: string | number) => {
|
|
54
|
+
const result = findConversationAndGroup(conversations, itemId);
|
|
55
|
+
if (result) {
|
|
56
|
+
setEditingConversationId(itemId);
|
|
57
|
+
setEditingText(result.conversation.text);
|
|
58
|
+
setIsModalOpen(true);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const handleModalSave = () => {
|
|
63
|
+
if (editingConversationId) {
|
|
64
|
+
setConversations((prevConversations) => {
|
|
65
|
+
const result = findConversationAndGroup(prevConversations, editingConversationId);
|
|
66
|
+
if (!result) {
|
|
67
|
+
return prevConversations;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const { groupKey, conversationIndex } = result;
|
|
71
|
+
const newConversations = { ...prevConversations };
|
|
72
|
+
const newGroup = [...newConversations[groupKey]];
|
|
73
|
+
|
|
74
|
+
newGroup[conversationIndex] = { ...newGroup[conversationIndex], text: editingText };
|
|
75
|
+
newConversations[groupKey] = newGroup;
|
|
76
|
+
|
|
77
|
+
return newConversations;
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
handleModalClose();
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const handleModalCancel = () => {
|
|
84
|
+
handleModalClose();
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const handleModalClose = () => {
|
|
88
|
+
setIsModalOpen(false);
|
|
89
|
+
setEditingConversationId(null);
|
|
90
|
+
setEditingText('');
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const handleTextInputKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {
|
|
94
|
+
if (event.key === 'Enter') {
|
|
95
|
+
event.preventDefault();
|
|
96
|
+
handleModalSave();
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const renderMenuItems = (itemId: string | number) => [
|
|
101
|
+
<DropdownList key={`list-${itemId}`}>
|
|
102
|
+
<DropdownItem value="Download" id="Download">
|
|
103
|
+
Download
|
|
104
|
+
</DropdownItem>
|
|
105
|
+
<DropdownItem value="Rename" id="Rename" onClick={() => onRenameClick(itemId)}>
|
|
106
|
+
Rename
|
|
107
|
+
</DropdownItem>
|
|
108
|
+
<DropdownItem value="Archive" id="Archive">
|
|
109
|
+
Archive
|
|
110
|
+
</DropdownItem>
|
|
111
|
+
<DropdownItem value="Delete" id="Delete">
|
|
112
|
+
Delete
|
|
113
|
+
</DropdownItem>
|
|
114
|
+
</DropdownList>
|
|
115
|
+
];
|
|
116
|
+
|
|
117
|
+
const initialConversations: { [key: string]: Conversation[] } = {
|
|
118
|
+
Today: [{ id: '1', text: 'Red Hat products and services' }],
|
|
119
|
+
'This month': [
|
|
120
|
+
{
|
|
121
|
+
id: '2',
|
|
122
|
+
text: 'Enterprise Linux installation and setup'
|
|
123
|
+
},
|
|
124
|
+
{ id: '3', text: 'Troubleshoot system crash' }
|
|
125
|
+
],
|
|
126
|
+
March: [
|
|
127
|
+
{ id: '4', text: 'Ansible security and updates' },
|
|
128
|
+
{ id: '5', text: 'Red Hat certification' },
|
|
129
|
+
{ id: '6', text: 'Lightspeed user documentation' }
|
|
130
|
+
],
|
|
131
|
+
February: [
|
|
132
|
+
{ id: '7', text: 'Crashing pod assistance' },
|
|
133
|
+
{ id: '8', text: 'OpenShift AI pipelines' },
|
|
134
|
+
{ id: '9', text: 'Updating subscription plan' },
|
|
135
|
+
{ id: '10', text: 'Red Hat licensing options' }
|
|
136
|
+
],
|
|
137
|
+
January: [
|
|
138
|
+
{ id: '11', text: 'RHEL system performance' },
|
|
139
|
+
{ id: '12', text: 'Manage user accounts' }
|
|
140
|
+
]
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
const [conversations, setConversations] = useState(initialConversations);
|
|
144
|
+
|
|
145
|
+
// Create conversations with menu items dynamically
|
|
146
|
+
const conversationsWithMenuItems = () => {
|
|
147
|
+
const newConversations = { ...conversations };
|
|
148
|
+
Object.keys(newConversations).forEach((groupKey) => {
|
|
149
|
+
newConversations[groupKey] = newConversations[groupKey].map((conv) => ({
|
|
150
|
+
...conv,
|
|
151
|
+
menuItems: renderMenuItems(conv.id)
|
|
152
|
+
}));
|
|
153
|
+
});
|
|
154
|
+
return newConversations;
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
return (
|
|
158
|
+
<>
|
|
159
|
+
<Checkbox
|
|
160
|
+
label="Display drawer"
|
|
161
|
+
isChecked={isDrawerOpen}
|
|
162
|
+
onChange={() => setIsDrawerOpen(!isDrawerOpen)}
|
|
163
|
+
id="drawer-actions-visible"
|
|
164
|
+
name="drawer-actions-visible"
|
|
165
|
+
></Checkbox>
|
|
166
|
+
<ChatbotConversationHistoryNav
|
|
167
|
+
displayMode={displayMode}
|
|
168
|
+
onDrawerToggle={() => setIsDrawerOpen(!isDrawerOpen)}
|
|
169
|
+
isDrawerOpen={isDrawerOpen}
|
|
170
|
+
setIsDrawerOpen={setIsDrawerOpen}
|
|
171
|
+
conversations={conversationsWithMenuItems()}
|
|
172
|
+
drawerContent={<div>Drawer content</div>}
|
|
173
|
+
/>
|
|
174
|
+
|
|
175
|
+
<ChatbotModal displayMode={displayMode} isOpen={isModalOpen} onClose={handleModalClose}>
|
|
176
|
+
<ModalHeader title="Rename Conversation" />
|
|
177
|
+
<ModalBody>
|
|
178
|
+
<Form>
|
|
179
|
+
<FormGroup label="Conversation Name" fieldId="conversation-name" isRequired>
|
|
180
|
+
<TextInput
|
|
181
|
+
isRequired
|
|
182
|
+
ref={textInputRef}
|
|
183
|
+
value={editingText}
|
|
184
|
+
onChange={(_, value) => setEditingText(value)}
|
|
185
|
+
onKeyDown={handleTextInputKeyDown}
|
|
186
|
+
id="conversation-name"
|
|
187
|
+
/>
|
|
188
|
+
</FormGroup>
|
|
189
|
+
</Form>
|
|
190
|
+
</ModalBody>
|
|
191
|
+
<ModalFooter>
|
|
192
|
+
<Button key="save" variant="primary" onClick={handleModalSave}>
|
|
193
|
+
Save
|
|
194
|
+
</Button>
|
|
195
|
+
<Button key="cancel" variant="link" onClick={handleModalCancel}>
|
|
196
|
+
Cancel
|
|
197
|
+
</Button>
|
|
198
|
+
</ModalFooter>
|
|
199
|
+
</ChatbotModal>
|
|
200
|
+
</>
|
|
201
|
+
);
|
|
202
|
+
};
|
|
@@ -86,7 +86,7 @@ import userAvatar from '../Messages/user_avatar.svg';
|
|
|
86
86
|
import patternflyAvatar from '../Messages/patternfly_avatar.jpg';
|
|
87
87
|
import termsAndConditionsHeader from './PF-TermsAndConditionsHeader.svg';
|
|
88
88
|
import { CloseIcon, SearchIcon, OutlinedCommentsIcon } from '@patternfly/react-icons';
|
|
89
|
-
import { FunctionComponent, FormEvent, useState, useRef, MouseEvent, isValidElement, cloneElement, Children, ReactNode, Ref, MouseEvent as ReactMouseEvent, CSSProperties} from 'react';
|
|
89
|
+
import { FunctionComponent, FormEvent, useState, useRef, MouseEvent, isValidElement, cloneElement, Children, ReactNode, Ref, MouseEvent as ReactMouseEvent, CSSProperties, useEffect} from 'react';
|
|
90
90
|
|
|
91
91
|
## Structure
|
|
92
92
|
|
|
@@ -374,6 +374,19 @@ To help users track important conversations, add a "pin" option to the conversat
|
|
|
374
374
|
|
|
375
375
|
```
|
|
376
376
|
|
|
377
|
+
### Renaming conversations in history drawer
|
|
378
|
+
|
|
379
|
+
You can allow users to rename a conversation in the history drawer by implementing a modal that opens upon clicking a "Rename" (or similar) action. When doing so, you must ensure the following:
|
|
380
|
+
|
|
381
|
+
- When the modal opens, focus is placed at the end of the text input.
|
|
382
|
+
- When the modal closes, focus goes back to the action toggle that was previously opened.
|
|
383
|
+
- Changes can be canceled via the **<kbd>Escape</kbd>** key or clicking a "Cancel" button.
|
|
384
|
+
- Changes can be saved via the **<kbd>Enter</kbd>** key or by clicking a "Save" button.
|
|
385
|
+
|
|
386
|
+
```js file="./ChatbotConversationEditing.tsx"
|
|
387
|
+
|
|
388
|
+
```
|
|
389
|
+
|
|
377
390
|
### Drawer with active conversation
|
|
378
391
|
|
|
379
392
|
If you're showing a conversation that is already active, you can set the `activeItemId` prop on your `<ChatbotConversationHistoryNav>` to apply an active visual state.
|
|
@@ -14,13 +14,13 @@ describe('ChatbotConversationHistoryDropdown', () => {
|
|
|
14
14
|
|
|
15
15
|
it('should render the dropdown', () => {
|
|
16
16
|
render(<ChatbotConversationHistoryDropdown menuItems={menuItems} menuClassName="custom-class" />);
|
|
17
|
-
expect(screen.queryByRole('
|
|
17
|
+
expect(screen.queryByRole('button', { name: /Conversation options/i })).toBeInTheDocument();
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
it('should display the dropdown menuItems', () => {
|
|
21
21
|
render(<ChatbotConversationHistoryDropdown menuItems={menuItems} />);
|
|
22
22
|
|
|
23
|
-
const toggle = screen.queryByRole('
|
|
23
|
+
const toggle = screen.queryByRole('button', { name: /Conversation options/i })!;
|
|
24
24
|
|
|
25
25
|
expect(toggle).toBeInTheDocument();
|
|
26
26
|
fireEvent.click(toggle);
|
|
@@ -33,7 +33,7 @@ describe('ChatbotConversationHistoryDropdown', () => {
|
|
|
33
33
|
|
|
34
34
|
it('should invoke onSelect callback when menuitem is clicked', () => {
|
|
35
35
|
render(<ChatbotConversationHistoryDropdown menuItems={menuItems} onSelect={onSelect} />);
|
|
36
|
-
const toggle = screen.queryByRole('
|
|
36
|
+
const toggle = screen.queryByRole('button', { name: /Conversation options/i })!;
|
|
37
37
|
fireEvent.click(toggle);
|
|
38
38
|
fireEvent.click(screen.getByText('Rename'));
|
|
39
39
|
|
|
@@ -42,7 +42,7 @@ describe('ChatbotConversationHistoryDropdown', () => {
|
|
|
42
42
|
|
|
43
43
|
it('should toggle the dropdown when menuitem is clicked', () => {
|
|
44
44
|
render(<ChatbotConversationHistoryDropdown menuItems={menuItems} onSelect={onSelect} />);
|
|
45
|
-
const toggle = screen.queryByRole('
|
|
45
|
+
const toggle = screen.queryByRole('button', { name: /Conversation options/i })!;
|
|
46
46
|
fireEvent.click(toggle);
|
|
47
47
|
fireEvent.click(screen.getByText('Delete'));
|
|
48
48
|
|
|
@@ -53,7 +53,7 @@ describe('ChatbotConversationHistoryDropdown', () => {
|
|
|
53
53
|
|
|
54
54
|
it('should close the dropdown when user clicks outside', () => {
|
|
55
55
|
render(<ChatbotConversationHistoryDropdown menuItems={menuItems} onSelect={onSelect} />);
|
|
56
|
-
const toggle = screen.queryByRole('
|
|
56
|
+
const toggle = screen.queryByRole('button', { name: /Conversation options/i })!;
|
|
57
57
|
fireEvent.click(toggle);
|
|
58
58
|
|
|
59
59
|
expect(screen.queryByText('Delete')).toBeInTheDocument();
|
|
@@ -64,7 +64,7 @@ describe('ChatbotConversationHistoryDropdown', () => {
|
|
|
64
64
|
|
|
65
65
|
it('should show the tooltip when the user hovers over the toggle button', async () => {
|
|
66
66
|
render(<ChatbotConversationHistoryDropdown menuItems={menuItems} label="Actions dropdown" />);
|
|
67
|
-
const toggle = screen.queryByRole('
|
|
67
|
+
const toggle = screen.queryByRole('button', { name: /Actions dropdown/i })!;
|
|
68
68
|
|
|
69
69
|
fireEvent(
|
|
70
70
|
toggle,
|
|
@@ -6,10 +6,7 @@
|
|
|
6
6
|
position: absolute;
|
|
7
7
|
border-radius: var(--pf-t--global--border--radius--medium);
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
// ----------------------------------------------------------------------------
|
|
11
|
-
.pf-chatbot__input {
|
|
12
|
-
}
|
|
9
|
+
|
|
13
10
|
// Drawer title
|
|
14
11
|
// ----------------------------------------------------------------------------
|
|
15
12
|
.pf-chatbot__title-container {
|
|
@@ -27,50 +24,61 @@
|
|
|
27
24
|
}
|
|
28
25
|
// Drawer menu
|
|
29
26
|
// ----------------------------------------------------------------------------
|
|
30
|
-
.pf-
|
|
31
|
-
--pf-v6-c-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
.pf-v6-c-menu__item-main {
|
|
37
|
-
--pf-v6-c-menu__item-main--ColumnGap: var(--pf-t--global--spacer--md);
|
|
27
|
+
.pf-chatbot__conversation-list {
|
|
28
|
+
--pf-v6-c-list--Gap: var(--pf-t--global--spacer--xs);
|
|
29
|
+
|
|
30
|
+
margin-block-start: var(--pf-t--global--spacer--md);
|
|
31
|
+
margin-block-end: var(--pf-t--global--spacer--md);
|
|
38
32
|
}
|
|
39
|
-
|
|
33
|
+
|
|
34
|
+
.pf-chatbot__conversation-list-header {
|
|
40
35
|
color: var(--pf-t--global--text--color--subtle);
|
|
41
36
|
font-weight: var(--pf-t--global--font--weight--body--bold);
|
|
42
37
|
font-size: var(--pf-t--global--icon--size--font--sm);
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
padding-inline-start: var(--pf-t--global--spacer--sm);
|
|
39
|
+
padding-inline-end: var(--pf-t--global--spacer--sm);
|
|
45
40
|
position: -webkit-sticky;
|
|
46
41
|
position: sticky;
|
|
47
42
|
top: 0;
|
|
48
43
|
background-color: var(--pf-t--global--background--color--floating--default);
|
|
49
44
|
z-index: var(--pf-t--global--z-index--md);
|
|
50
45
|
}
|
|
51
|
-
.pf-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
46
|
+
.pf-chatbot__conversation-list-item {
|
|
47
|
+
& > span {
|
|
48
|
+
display: flex;
|
|
49
|
+
column-gap: var(--pf-t--global--spacer--sm);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
& .pf-chatbot__conversation-history-item {
|
|
53
|
+
--pf-v6-c-button--JustifyContent: flex-start;
|
|
54
|
+
--pf-v6-c-button--FontSize: var(--pf-t--global--font--size--body--lg);
|
|
55
|
+
--pf-v6-c-button--m-link--Color: var(--pf-t--global--text--color--regular);
|
|
56
|
+
--pf-v6-c-button--m-link__icon--Color: var(--pf-t--global--icon--color--regular);
|
|
57
|
+
--pf-v6-c-button--m-link--hover--Color: var(--pf-t--global--text--color--regular--hover);
|
|
58
|
+
--pf-v6-c-button--m-link--hover__icon--Color: var(--pf-t--global--icon--color--regular);
|
|
59
|
+
--pf-v6-c-button--m-link--m-clicked--Color: var(--pf-t--global--text--color--regular--clicked);
|
|
60
|
+
--pf-v6-c-button--m-link--m-clicked__icon--Color: var(--pf-t--global--icon--color--regular);
|
|
61
|
+
|
|
62
|
+
column-gap: var(--pf-t--global--spacer--md);
|
|
63
|
+
flex-basis: 100%;
|
|
64
|
+
|
|
65
|
+
& .pf-v6-c-button__text {
|
|
66
|
+
overflow: hidden;
|
|
67
|
+
text-overflow: ellipsis;
|
|
68
|
+
white-space: nowrap;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
64
71
|
}
|
|
72
|
+
|
|
65
73
|
.pf-chatbot__history-actions {
|
|
66
74
|
transform: rotate(90deg);
|
|
67
75
|
}
|
|
68
76
|
|
|
69
|
-
.pf-
|
|
77
|
+
.pf-chatbot__conversation-list-item--active {
|
|
70
78
|
background-color: var(--pf-t--global--background--color--action--plain--clicked);
|
|
71
79
|
}
|
|
72
80
|
|
|
73
|
-
button.pf-
|
|
81
|
+
button.pf-chatbot__conversation-list-item--active {
|
|
74
82
|
background-color: initial;
|
|
75
83
|
}
|
|
76
84
|
}
|
|
@@ -233,8 +241,8 @@
|
|
|
233
241
|
}
|
|
234
242
|
}
|
|
235
243
|
|
|
236
|
-
.pf-
|
|
237
|
-
|
|
244
|
+
.pf-chatbot__conversation-history-item {
|
|
245
|
+
--pf-v6-c-button--FontSize: var(--pf-t--global--font--size--body--md);
|
|
238
246
|
}
|
|
239
247
|
|
|
240
248
|
.pf-v6-c-drawer__head {
|
|
@@ -491,4 +491,74 @@ describe('ChatbotConversationHistoryNav', () => {
|
|
|
491
491
|
const iconElement = container.querySelector('.pf-chatbot__title-icon');
|
|
492
492
|
expect(iconElement).toBeInTheDocument();
|
|
493
493
|
});
|
|
494
|
+
|
|
495
|
+
it('Passes titleProps to Title', () => {
|
|
496
|
+
render(
|
|
497
|
+
<ChatbotConversationHistoryNav
|
|
498
|
+
onDrawerToggle={onDrawerToggle}
|
|
499
|
+
isDrawerOpen={true}
|
|
500
|
+
displayMode={ChatbotDisplayMode.fullscreen}
|
|
501
|
+
setIsDrawerOpen={jest.fn()}
|
|
502
|
+
conversations={{ Today: initialConversations }}
|
|
503
|
+
titleProps={{ className: 'test' }}
|
|
504
|
+
/>
|
|
505
|
+
);
|
|
506
|
+
expect(screen.getByRole('heading', { name: /Today/i })).toHaveClass('test');
|
|
507
|
+
});
|
|
508
|
+
|
|
509
|
+
it('Overrides Title heading level when titleProps.headingLevel is passed', () => {
|
|
510
|
+
render(
|
|
511
|
+
<ChatbotConversationHistoryNav
|
|
512
|
+
onDrawerToggle={onDrawerToggle}
|
|
513
|
+
isDrawerOpen={true}
|
|
514
|
+
displayMode={ChatbotDisplayMode.fullscreen}
|
|
515
|
+
setIsDrawerOpen={jest.fn()}
|
|
516
|
+
conversations={{ Today: initialConversations }}
|
|
517
|
+
titleProps={{ headingLevel: 'h2' }}
|
|
518
|
+
/>
|
|
519
|
+
);
|
|
520
|
+
expect(screen.queryByRole('heading', { name: /Today/i, level: 4 })).not.toBeInTheDocument();
|
|
521
|
+
expect(screen.getByRole('heading', { name: /Today/i, level: 2 })).toBeInTheDocument();
|
|
522
|
+
});
|
|
523
|
+
|
|
524
|
+
it('Passes listProps to List when conversations is an array', () => {
|
|
525
|
+
render(
|
|
526
|
+
<ChatbotConversationHistoryNav
|
|
527
|
+
onDrawerToggle={onDrawerToggle}
|
|
528
|
+
isDrawerOpen={true}
|
|
529
|
+
displayMode={ChatbotDisplayMode.fullscreen}
|
|
530
|
+
setIsDrawerOpen={jest.fn()}
|
|
531
|
+
conversations={initialConversations}
|
|
532
|
+
listProps={{ className: 'test' }}
|
|
533
|
+
/>
|
|
534
|
+
);
|
|
535
|
+
expect(screen.getByRole('list')).toHaveClass('test');
|
|
536
|
+
});
|
|
537
|
+
|
|
538
|
+
it('Passes listProps to List when conversations is an object', () => {
|
|
539
|
+
render(
|
|
540
|
+
<ChatbotConversationHistoryNav
|
|
541
|
+
onDrawerToggle={onDrawerToggle}
|
|
542
|
+
isDrawerOpen={true}
|
|
543
|
+
displayMode={ChatbotDisplayMode.fullscreen}
|
|
544
|
+
setIsDrawerOpen={jest.fn()}
|
|
545
|
+
conversations={{ Today: initialConversations }}
|
|
546
|
+
listProps={{ Today: { className: 'test' } }}
|
|
547
|
+
/>
|
|
548
|
+
);
|
|
549
|
+
expect(screen.getByRole('list')).toHaveClass('test');
|
|
550
|
+
});
|
|
551
|
+
|
|
552
|
+
it('Passes listItemProps to ListItem', () => {
|
|
553
|
+
render(
|
|
554
|
+
<ChatbotConversationHistoryNav
|
|
555
|
+
onDrawerToggle={onDrawerToggle}
|
|
556
|
+
isDrawerOpen={true}
|
|
557
|
+
displayMode={ChatbotDisplayMode.fullscreen}
|
|
558
|
+
setIsDrawerOpen={jest.fn()}
|
|
559
|
+
conversations={[{ id: '1', text: 'ChatBot documentation', listItemProps: { className: 'test' } }]}
|
|
560
|
+
/>
|
|
561
|
+
);
|
|
562
|
+
expect(screen.getByRole('listitem')).toHaveClass('test');
|
|
563
|
+
});
|
|
494
564
|
});
|
|
@@ -8,6 +8,7 @@ import { useRef, Fragment } from 'react';
|
|
|
8
8
|
// Import PatternFly components
|
|
9
9
|
import {
|
|
10
10
|
Button,
|
|
11
|
+
ButtonProps,
|
|
11
12
|
Drawer,
|
|
12
13
|
DrawerPanelContent,
|
|
13
14
|
DrawerContent,
|
|
@@ -18,13 +19,10 @@ import {
|
|
|
18
19
|
DrawerCloseButton,
|
|
19
20
|
DrawerContentBody,
|
|
20
21
|
SearchInput,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
MenuContent,
|
|
26
|
-
MenuItemProps,
|
|
27
|
-
MenuProps,
|
|
22
|
+
List,
|
|
23
|
+
ListItem,
|
|
24
|
+
ListItemProps,
|
|
25
|
+
Title,
|
|
28
26
|
DrawerPanelContentProps,
|
|
29
27
|
DrawerContentProps,
|
|
30
28
|
DrawerContentBodyProps,
|
|
@@ -33,9 +31,10 @@ import {
|
|
|
33
31
|
DrawerCloseButtonProps,
|
|
34
32
|
DrawerPanelBodyProps,
|
|
35
33
|
SkeletonProps,
|
|
36
|
-
Title,
|
|
37
34
|
Icon,
|
|
38
|
-
|
|
35
|
+
MenuProps, // Remove in next breaking change
|
|
36
|
+
TitleProps,
|
|
37
|
+
ListProps
|
|
39
38
|
} from '@patternfly/react-core';
|
|
40
39
|
|
|
41
40
|
import { OutlinedClockIcon, OutlinedCommentAltIcon, PenToSquareIcon } from '@patternfly/react-icons';
|
|
@@ -61,8 +60,10 @@ export interface Conversation {
|
|
|
61
60
|
label?: string;
|
|
62
61
|
/** Callback for when user selects item. */
|
|
63
62
|
onSelect?: (event?: React.MouseEvent, value?: string | number) => void;
|
|
64
|
-
/** Additional props passed to conversation
|
|
65
|
-
additionalProps?:
|
|
63
|
+
/** Additional props passed to conversation button item */
|
|
64
|
+
additionalProps?: ButtonProps;
|
|
65
|
+
/** Additional props passed to conversation list item */
|
|
66
|
+
listItemProps?: Omit<ListItemProps, 'children'>;
|
|
66
67
|
}
|
|
67
68
|
export interface ChatbotConversationHistoryNavProps extends DrawerProps {
|
|
68
69
|
/** Function called to toggle drawer */
|
|
@@ -79,6 +80,10 @@ export interface ChatbotConversationHistoryNavProps extends DrawerProps {
|
|
|
79
80
|
conversations: Conversation[] | { [key: string]: Conversation[] };
|
|
80
81
|
/** Additional button props for new chat button. */
|
|
81
82
|
newChatButtonProps?: ButtonProps;
|
|
83
|
+
/** Additional props applied to all conversation list headers */
|
|
84
|
+
titleProps?: Partial<TitleProps>;
|
|
85
|
+
/** Additional props applied to conversation list. If conversations is an object, you should pass an object of ListProps for each group. */
|
|
86
|
+
listProps?: ListProps | { [key: string]: ListProps };
|
|
82
87
|
/** Text shown in blue button */
|
|
83
88
|
newChatButtonText?: string;
|
|
84
89
|
/** Callback function for when blue button is clicked. Omit to hide blue "new chat button" */
|
|
@@ -97,7 +102,7 @@ export interface ChatbotConversationHistoryNavProps extends DrawerProps {
|
|
|
97
102
|
reverseButtonOrder?: boolean;
|
|
98
103
|
/** Custom test id for the drawer actions */
|
|
99
104
|
drawerActionsTestId?: string;
|
|
100
|
-
/** Additional props applied to
|
|
105
|
+
/** @deprecated Additional props applied to list container */
|
|
101
106
|
menuProps?: MenuProps;
|
|
102
107
|
/** Additional props applied to panel */
|
|
103
108
|
drawerPanelContentProps?: DrawerPanelContentProps;
|
|
@@ -136,6 +141,8 @@ export const ChatbotConversationHistoryNav: FunctionComponent<ChatbotConversatio
|
|
|
136
141
|
activeItemId,
|
|
137
142
|
onSelectActiveItem,
|
|
138
143
|
conversations,
|
|
144
|
+
titleProps,
|
|
145
|
+
listProps,
|
|
139
146
|
newChatButtonText = 'New chat',
|
|
140
147
|
drawerContent,
|
|
141
148
|
onNewChat,
|
|
@@ -146,7 +153,6 @@ export const ChatbotConversationHistoryNav: FunctionComponent<ChatbotConversatio
|
|
|
146
153
|
displayMode,
|
|
147
154
|
reverseButtonOrder = false,
|
|
148
155
|
drawerActionsTestId = 'chatbot-nav-drawer-actions',
|
|
149
|
-
menuProps,
|
|
150
156
|
drawerPanelContentProps,
|
|
151
157
|
drawerContentProps,
|
|
152
158
|
drawerContentBodyProps,
|
|
@@ -170,55 +176,59 @@ export const ChatbotConversationHistoryNav: FunctionComponent<ChatbotConversatio
|
|
|
170
176
|
};
|
|
171
177
|
|
|
172
178
|
const getNavItem = (conversation: Conversation) => (
|
|
173
|
-
<
|
|
174
|
-
className={`pf-
|
|
175
|
-
itemId={conversation.id}
|
|
179
|
+
<ListItem
|
|
180
|
+
className={`pf-chatbot__conversation-list-item ${activeItemId && activeItemId === conversation.id ? 'pf-chatbot__conversation-list-item--active' : ''}`}
|
|
176
181
|
key={conversation.id}
|
|
177
|
-
{...
|
|
178
|
-
/* eslint-disable indent */
|
|
179
|
-
{...(conversation.menuItems
|
|
180
|
-
? {
|
|
181
|
-
actions: (
|
|
182
|
-
<ConversationHistoryDropdown
|
|
183
|
-
menuClassName={conversation.menuClassName}
|
|
184
|
-
onSelect={conversation.onSelect}
|
|
185
|
-
menuItems={conversation.menuItems}
|
|
186
|
-
label={conversation.label}
|
|
187
|
-
/>
|
|
188
|
-
)
|
|
189
|
-
}
|
|
190
|
-
: {})}
|
|
191
|
-
{...conversation.additionalProps}
|
|
182
|
+
{...conversation.listItemProps}
|
|
192
183
|
/* eslint-enable indent */
|
|
193
184
|
>
|
|
194
|
-
|
|
195
|
-
|
|
185
|
+
<>
|
|
186
|
+
<Button
|
|
187
|
+
className="pf-chatbot__conversation-history-item"
|
|
188
|
+
variant="link"
|
|
189
|
+
{...conversation.additionalProps}
|
|
190
|
+
{...(conversation.noIcon ? {} : { icon: conversation.icon ?? <OutlinedCommentAltIcon /> })}
|
|
191
|
+
onClick={(event) => onSelectActiveItem?.(event, conversation.id)}
|
|
192
|
+
>
|
|
193
|
+
{conversation.text}
|
|
194
|
+
</Button>
|
|
195
|
+
{conversation.menuItems && (
|
|
196
|
+
<ConversationHistoryDropdown
|
|
197
|
+
menuClassName={conversation.menuClassName}
|
|
198
|
+
onSelect={conversation.onSelect}
|
|
199
|
+
menuItems={conversation.menuItems}
|
|
200
|
+
label={conversation.label}
|
|
201
|
+
/>
|
|
202
|
+
)}
|
|
203
|
+
</>
|
|
204
|
+
</ListItem>
|
|
196
205
|
);
|
|
197
206
|
|
|
198
|
-
const
|
|
207
|
+
const buildConversations = () => {
|
|
199
208
|
if (Array.isArray(conversations)) {
|
|
200
|
-
// Render for array of MenuItemObject
|
|
201
209
|
return (
|
|
202
|
-
<
|
|
210
|
+
<List className="pf-chatbot__conversation-list" isPlain {...listProps}>
|
|
203
211
|
{conversations.map((conversation) => (
|
|
204
212
|
<Fragment key={conversation.id}>{getNavItem(conversation)}</Fragment>
|
|
205
213
|
))}
|
|
206
|
-
</
|
|
214
|
+
</List>
|
|
207
215
|
);
|
|
208
216
|
} else {
|
|
209
|
-
// Render for object with NavItemObject arrays as values
|
|
210
217
|
return (
|
|
211
|
-
|
|
218
|
+
<div>
|
|
212
219
|
{Object.keys(conversations).map((navGroup) => (
|
|
213
|
-
<
|
|
214
|
-
<
|
|
220
|
+
<section key={navGroup}>
|
|
221
|
+
<Title headingLevel="h4" className="pf-chatbot__conversation-list-header" {...titleProps}>
|
|
222
|
+
{navGroup}
|
|
223
|
+
</Title>
|
|
224
|
+
<List className="pf-chatbot__conversation-list" isPlain {...listProps?.[navGroup]}>
|
|
215
225
|
{conversations[navGroup].map((conversation) => (
|
|
216
226
|
<Fragment key={conversation.id}>{getNavItem(conversation)}</Fragment>
|
|
217
227
|
))}
|
|
218
|
-
</
|
|
219
|
-
</
|
|
228
|
+
</List>
|
|
229
|
+
</section>
|
|
220
230
|
))}
|
|
221
|
-
|
|
231
|
+
</div>
|
|
222
232
|
);
|
|
223
233
|
}
|
|
224
234
|
};
|
|
@@ -238,11 +248,7 @@ export const ChatbotConversationHistoryNav: FunctionComponent<ChatbotConversatio
|
|
|
238
248
|
if (noResultsState) {
|
|
239
249
|
return <HistoryEmptyState {...noResultsState} />;
|
|
240
250
|
}
|
|
241
|
-
return (
|
|
242
|
-
<Menu isPlain onSelect={onSelectActiveItem} activeItemId={activeItemId} {...menuProps}>
|
|
243
|
-
<MenuContent>{buildMenu()}</MenuContent>
|
|
244
|
-
</Menu>
|
|
245
|
-
);
|
|
251
|
+
return <>{buildConversations()}</>;
|
|
246
252
|
};
|
|
247
253
|
|
|
248
254
|
const renderDrawerContent = () => (
|