@patternfly/chatbot 6.4.0-prerelease.23 → 6.4.0-prerelease.25
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/Message/Message.d.ts +2 -0
- package/dist/cjs/Message/Message.js +6 -2
- package/dist/cjs/Message/Message.test.js +17 -2
- package/dist/cjs/SourcesCard/SourcesCard.js +6 -30
- package/dist/cjs/SourcesCard/SourcesCard.test.js +2 -211
- package/dist/cjs/SourcesCardBase/SourcesCardBase.d.ts +57 -0
- package/dist/cjs/SourcesCardBase/SourcesCardBase.js +49 -0
- package/dist/cjs/SourcesCardBase/SourcesCardBase.test.d.ts +1 -0
- package/dist/cjs/SourcesCardBase/SourcesCardBase.test.js +171 -0
- package/dist/cjs/SourcesCardBase/index.d.ts +2 -0
- package/dist/cjs/SourcesCardBase/index.js +23 -0
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.js +4 -1
- package/dist/css/main.css +4 -2
- package/dist/css/main.css.map +1 -1
- package/dist/dynamic/SourcesCardBase/package.json +1 -0
- package/dist/esm/Message/Message.d.ts +2 -0
- package/dist/esm/Message/Message.js +6 -2
- package/dist/esm/Message/Message.test.js +17 -2
- package/dist/esm/SourcesCard/SourcesCard.js +4 -31
- package/dist/esm/SourcesCard/SourcesCard.test.js +3 -212
- package/dist/esm/SourcesCardBase/SourcesCardBase.d.ts +57 -0
- package/dist/esm/SourcesCardBase/SourcesCardBase.js +47 -0
- package/dist/esm/SourcesCardBase/SourcesCardBase.test.d.ts +1 -0
- package/dist/esm/SourcesCardBase/SourcesCardBase.test.js +166 -0
- package/dist/esm/SourcesCardBase/index.d.ts +2 -0
- package/dist/esm/SourcesCardBase/index.js +2 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +2 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/UserMessage.tsx +1 -0
- package/src/Message/Message.test.tsx +25 -2
- package/src/Message/Message.tsx +9 -0
- package/src/SourcesCard/SourcesCard.scss +4 -1
- package/src/SourcesCard/SourcesCard.test.tsx +2 -327
- package/src/SourcesCard/SourcesCard.tsx +8 -171
- package/src/SourcesCardBase/SourcesCardBase.test.tsx +236 -0
- package/src/SourcesCardBase/SourcesCardBase.tsx +242 -0
- package/src/SourcesCardBase/index.ts +3 -0
- package/src/index.ts +3 -0
|
@@ -1,43 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
2
|
import { render, screen } from '@testing-library/react';
|
|
12
|
-
import userEvent from '@testing-library/user-event';
|
|
13
3
|
import '@testing-library/jest-dom';
|
|
14
4
|
import SourcesCard from './SourcesCard';
|
|
15
5
|
describe('SourcesCard', () => {
|
|
16
|
-
it('should render
|
|
17
|
-
render(_jsx(SourcesCard, { sources: [{ link: '' }] }));
|
|
18
|
-
expect(screen.getByText('1 source')).toBeTruthy();
|
|
19
|
-
expect(screen.getByText('Source 1')).toBeTruthy();
|
|
20
|
-
// no buttons or navigation when there is only 1 source
|
|
21
|
-
expect(screen.queryByRole('button')).toBeFalsy();
|
|
22
|
-
expect(screen.queryByText('1/1')).toBeFalsy();
|
|
23
|
-
});
|
|
24
|
-
it('should render card correctly if one source with a title is passed in', () => {
|
|
6
|
+
it('should render sources correctly if one source is passed in', () => {
|
|
25
7
|
render(_jsx(SourcesCard, { sources: [{ title: 'How to make an apple pie', link: '' }] }));
|
|
26
8
|
expect(screen.getByText('1 source')).toBeTruthy();
|
|
27
9
|
expect(screen.getByText('How to make an apple pie')).toBeTruthy();
|
|
28
10
|
});
|
|
29
|
-
it('should render
|
|
30
|
-
render(_jsx(SourcesCard, { sources: [{ link: '', body: 'To make an apple pie, you must first...' }] }));
|
|
31
|
-
expect(screen.getByText('1 source')).toBeTruthy();
|
|
32
|
-
expect(screen.getByText('To make an apple pie, you must first...')).toBeTruthy();
|
|
33
|
-
});
|
|
34
|
-
it('should render card correctly if one source with a title and body is passed in', () => {
|
|
35
|
-
render(_jsx(SourcesCard, { sources: [{ title: 'How to make an apple pie', link: '', body: 'To make an apple pie, you must first...' }] }));
|
|
36
|
-
expect(screen.getByText('1 source')).toBeTruthy();
|
|
37
|
-
expect(screen.getByText('How to make an apple pie')).toBeTruthy();
|
|
38
|
-
expect(screen.getByText('To make an apple pie, you must first...')).toBeTruthy();
|
|
39
|
-
});
|
|
40
|
-
it('should render multiple cards correctly', () => {
|
|
11
|
+
it('should render sources correctly when there is more than one', () => {
|
|
41
12
|
render(_jsx(SourcesCard, { sources: [
|
|
42
13
|
{ title: 'How to make an apple pie', link: '' },
|
|
43
14
|
{ title: 'How to make cookies', link: '' }
|
|
@@ -48,184 +19,4 @@ describe('SourcesCard', () => {
|
|
|
48
19
|
screen.getByRole('button', { name: /Go to previous page/i });
|
|
49
20
|
screen.getByRole('button', { name: /Go to next page/i });
|
|
50
21
|
});
|
|
51
|
-
it('should navigate between cards correctly', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
52
|
-
render(_jsx(SourcesCard, { sources: [
|
|
53
|
-
{ title: 'How to make an apple pie', link: '' },
|
|
54
|
-
{ title: 'How to make cookies', link: '' }
|
|
55
|
-
] }));
|
|
56
|
-
expect(screen.getByText('How to make an apple pie')).toBeTruthy();
|
|
57
|
-
expect(screen.getByText('1/2')).toBeTruthy();
|
|
58
|
-
expect(screen.getByRole('button', { name: /Go to previous page/i })).toBeDisabled();
|
|
59
|
-
yield userEvent.click(screen.getByRole('button', { name: /Go to next page/i }));
|
|
60
|
-
expect(screen.queryByText('How to make an apple pie')).toBeFalsy();
|
|
61
|
-
expect(screen.getByText('How to make cookies')).toBeTruthy();
|
|
62
|
-
expect(screen.getByText('2/2')).toBeTruthy();
|
|
63
|
-
expect(screen.getByRole('button', { name: /Go to previous page/i })).toBeEnabled();
|
|
64
|
-
expect(screen.getByRole('button', { name: /Go to next page/i })).toBeDisabled();
|
|
65
|
-
}));
|
|
66
|
-
it('should apply className appropriately', () => {
|
|
67
|
-
render(_jsx(SourcesCard, { sources: [
|
|
68
|
-
{ title: 'How to make an apple pie', link: '' },
|
|
69
|
-
{ title: 'How to make cookies', link: '' }
|
|
70
|
-
], className: "test" }));
|
|
71
|
-
const element = screen.getByRole('navigation');
|
|
72
|
-
expect(element).toHaveClass('test');
|
|
73
|
-
});
|
|
74
|
-
it('should disable pagination appropriately', () => {
|
|
75
|
-
render(_jsx(SourcesCard, { sources: [
|
|
76
|
-
{ title: 'How to make an apple pie', link: '' },
|
|
77
|
-
{ title: 'How to make cookies', link: '' }
|
|
78
|
-
], isDisabled: true }));
|
|
79
|
-
expect(screen.getByRole('button', { name: /Go to previous page/i })).toBeDisabled();
|
|
80
|
-
expect(screen.getByRole('button', { name: /Go to next page/i })).toBeDisabled();
|
|
81
|
-
});
|
|
82
|
-
it('should render navigation aria label appropriately', () => {
|
|
83
|
-
render(_jsx(SourcesCard, { sources: [
|
|
84
|
-
{ title: 'How to make an apple pie', link: '' },
|
|
85
|
-
{ title: 'How to make cookies', link: '' }
|
|
86
|
-
] }));
|
|
87
|
-
expect(screen.getByRole('navigation', { name: /Pagination/i })).toBeTruthy();
|
|
88
|
-
});
|
|
89
|
-
it('should change paginationAriaLabel appropriately', () => {
|
|
90
|
-
render(_jsx(SourcesCard, { sources: [
|
|
91
|
-
{ title: 'How to make an apple pie', link: '' },
|
|
92
|
-
{ title: 'How to make cookies', link: '' }
|
|
93
|
-
], paginationAriaLabel: "Navegaci\u00F3n" }));
|
|
94
|
-
expect(screen.getByRole('navigation', { name: /Navegación/i })).toBeTruthy();
|
|
95
|
-
});
|
|
96
|
-
it('should change sourceWord appropriately', () => {
|
|
97
|
-
render(_jsx(SourcesCard, { sources: [{ title: 'How to make an apple pie', link: '' }], sourceWord: 'fuente' }));
|
|
98
|
-
expect(screen.getByText('1 fuente')).toBeTruthy();
|
|
99
|
-
});
|
|
100
|
-
it('should sourceWordPlural appropriately', () => {
|
|
101
|
-
render(_jsx(SourcesCard, { sources: [
|
|
102
|
-
{ title: 'How to make an apple pie', link: '' },
|
|
103
|
-
{ title: 'How to make cookies', link: '' }
|
|
104
|
-
], sourceWordPlural: 'fuentes' }));
|
|
105
|
-
expect(screen.getByText('2 fuentes')).toBeTruthy();
|
|
106
|
-
});
|
|
107
|
-
it('should change toNextPageAriaLabel appropriately', () => {
|
|
108
|
-
render(_jsx(SourcesCard, { sources: [
|
|
109
|
-
{ title: 'How to make an apple pie', link: '' },
|
|
110
|
-
{ title: 'How to make cookies', link: '' }
|
|
111
|
-
], toNextPageAriaLabel: "Pase a la siguiente p\u00E1gina" }));
|
|
112
|
-
expect(screen.getByRole('button', { name: /Pase a la siguiente página/i })).toBeTruthy();
|
|
113
|
-
});
|
|
114
|
-
it('should change toPreviousPageAriaLabel appropriately', () => {
|
|
115
|
-
render(_jsx(SourcesCard, { sources: [
|
|
116
|
-
{ title: 'How to make an apple pie', link: '' },
|
|
117
|
-
{ title: 'How to make cookies', link: '' }
|
|
118
|
-
], toPreviousPageAriaLabel: "Presione para regresar a la p\u00E1gina anterior" }));
|
|
119
|
-
expect(screen.getByRole('button', { name: /Presione para regresar a la página anterior/i })).toBeTruthy();
|
|
120
|
-
});
|
|
121
|
-
it('should call onNextClick appropriately', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
122
|
-
const spy = jest.fn();
|
|
123
|
-
render(_jsx(SourcesCard, { sources: [
|
|
124
|
-
{ title: 'How to make an apple pie', link: '' },
|
|
125
|
-
{ title: 'How to make cookies', link: '' }
|
|
126
|
-
], onNextClick: spy }));
|
|
127
|
-
yield userEvent.click(screen.getByRole('button', { name: /Go to next page/i }));
|
|
128
|
-
expect(spy).toHaveBeenCalled();
|
|
129
|
-
}));
|
|
130
|
-
it('should call onPreviousClick appropriately', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
131
|
-
const spy = jest.fn();
|
|
132
|
-
render(_jsx(SourcesCard, { sources: [
|
|
133
|
-
{ title: 'How to make an apple pie', link: '' },
|
|
134
|
-
{ title: 'How to make cookies', link: '' }
|
|
135
|
-
], onPreviousClick: spy }));
|
|
136
|
-
yield userEvent.click(screen.getByRole('button', { name: /Go to next page/i }));
|
|
137
|
-
yield userEvent.click(screen.getByRole('button', { name: /Go to previous page/i }));
|
|
138
|
-
expect(spy).toHaveBeenCalled();
|
|
139
|
-
}));
|
|
140
|
-
it('should call onSetPage appropriately', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
141
|
-
const spy = jest.fn();
|
|
142
|
-
render(_jsx(SourcesCard, { sources: [
|
|
143
|
-
{ title: 'How to make an apple pie', link: '' },
|
|
144
|
-
{ title: 'How to make cookies', link: '' }
|
|
145
|
-
], onSetPage: spy }));
|
|
146
|
-
yield userEvent.click(screen.getByRole('button', { name: /Go to next page/i }));
|
|
147
|
-
expect(spy).toHaveBeenCalledTimes(1);
|
|
148
|
-
yield userEvent.click(screen.getByRole('button', { name: /Go to previous page/i }));
|
|
149
|
-
expect(spy).toHaveBeenCalledTimes(2);
|
|
150
|
-
}));
|
|
151
|
-
it('should handle showMore appropriately', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
152
|
-
render(_jsx(SourcesCard, { sources: [
|
|
153
|
-
{
|
|
154
|
-
title: 'Getting started with Red Hat OpenShift',
|
|
155
|
-
link: '#',
|
|
156
|
-
body: 'Red Hat OpenShift on IBM Cloud is a managed offering to create your own cluster of compute hosts where you can deploy and manage containerized apps on IBM Cloud ...',
|
|
157
|
-
hasShowMore: true
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
title: 'Azure Red Hat OpenShift documentation',
|
|
161
|
-
link: '#',
|
|
162
|
-
body: 'Microsoft Azure Red Hat OpenShift allows you to deploy a production ready Red Hat OpenShift cluster in Azure ...'
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
title: 'OKD Documentation: Home',
|
|
166
|
-
link: '#',
|
|
167
|
-
body: 'OKD is a distribution of Kubernetes optimized for continuous application development and multi-tenant deployment. OKD also serves as the upstream code base upon ...'
|
|
168
|
-
}
|
|
169
|
-
] }));
|
|
170
|
-
expect(screen.getByRole('region')).toHaveAttribute('class', 'pf-v6-c-expandable-section__content');
|
|
171
|
-
}));
|
|
172
|
-
it('should call onClick appropriately', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
173
|
-
const spy = jest.fn();
|
|
174
|
-
render(_jsx(SourcesCard, { sources: [{ title: 'How to make an apple pie', link: '', onClick: spy }] }));
|
|
175
|
-
yield userEvent.click(screen.getByRole('link', { name: /How to make an apple pie/i }));
|
|
176
|
-
expect(spy).toHaveBeenCalled();
|
|
177
|
-
}));
|
|
178
|
-
it('should apply titleProps appropriately', () => {
|
|
179
|
-
render(_jsx(SourcesCard, { sources: [{ title: 'How to make an apple pie', link: '', titleProps: { className: 'test' } }] }));
|
|
180
|
-
expect(screen.getByRole('link', { name: /How to make an apple pie/i })).toHaveClass('test');
|
|
181
|
-
});
|
|
182
|
-
it('should apply cardTitleProps appropriately', () => {
|
|
183
|
-
render(_jsx(SourcesCard, { cardTitleProps: { 'data-testid': 'card-title', className: 'test' }, sources: [{ title: 'How to make an apple pie', link: '' }] }));
|
|
184
|
-
expect(screen.getByTestId('card-title')).toHaveClass('test');
|
|
185
|
-
});
|
|
186
|
-
it('should apply cardBodyProps appropriately', () => {
|
|
187
|
-
render(_jsx(SourcesCard, { cardBodyProps: { 'data-testid': 'card-body', body: 'To make an apple pie, you must first...', className: 'test' }, sources: [{ title: 'How to make an apple pie', link: '', body: 'To make an apple pie, you must first...' }] }));
|
|
188
|
-
expect(screen.getByTestId('card-body')).toHaveClass('test');
|
|
189
|
-
});
|
|
190
|
-
it('should apply cardFooterProps appropriately', () => {
|
|
191
|
-
render(_jsx(SourcesCard, { cardFooterProps: { 'data-testid': 'card-footer', className: 'test' }, sources: [
|
|
192
|
-
{ title: 'How to make an apple pie', link: '' },
|
|
193
|
-
{ title: 'How to make cookies', link: '' }
|
|
194
|
-
] }));
|
|
195
|
-
expect(screen.getByTestId('card-footer')).toHaveClass('test');
|
|
196
|
-
});
|
|
197
|
-
it('should apply truncateProps appropriately', () => {
|
|
198
|
-
render(_jsx(SourcesCard, { sources: [
|
|
199
|
-
{
|
|
200
|
-
title: 'How to make an apple pie',
|
|
201
|
-
link: '',
|
|
202
|
-
truncateProps: { 'data-testid': 'card-truncate', className: 'test' }
|
|
203
|
-
}
|
|
204
|
-
] }));
|
|
205
|
-
expect(screen.getByTestId('card-truncate')).toHaveClass('test');
|
|
206
|
-
});
|
|
207
|
-
it('should apply custom footer appropriately when there is one source', () => {
|
|
208
|
-
render(_jsx(SourcesCard, { sources: [{ title: 'How to make an apple pie', link: '', footer: _jsx(_Fragment, { children: "I am a custom footer" }) }] }));
|
|
209
|
-
expect(screen.getByText('I am a custom footer'));
|
|
210
|
-
expect(screen.queryByText('1/1')).toBeFalsy();
|
|
211
|
-
});
|
|
212
|
-
it('should apply custom footer appropriately when are multiple sources', () => {
|
|
213
|
-
render(_jsx(SourcesCard, { sources: [
|
|
214
|
-
{ title: 'How to make an apple pie', link: '', footer: _jsx(_Fragment, { children: "I am a custom footer" }) },
|
|
215
|
-
{ title: 'How to bake bread', link: '' }
|
|
216
|
-
] }));
|
|
217
|
-
expect(screen.getByText('I am a custom footer'));
|
|
218
|
-
// does not show navigation bar
|
|
219
|
-
expect(screen.queryByText('1/2')).toBeFalsy();
|
|
220
|
-
});
|
|
221
|
-
it('should apply footer props to custom footer appropriately', () => {
|
|
222
|
-
render(_jsx(SourcesCard, { cardFooterProps: { 'data-testid': 'card-footer', className: 'test' }, sources: [{ title: 'How to make an apple pie', link: '', footer: _jsx(_Fragment, { children: "I am a custom footer" }) }] }));
|
|
223
|
-
expect(screen.getByText('I am a custom footer'));
|
|
224
|
-
expect(screen.getByTestId('card-footer')).toHaveClass('test');
|
|
225
|
-
});
|
|
226
|
-
it('should apply subtitle appropriately', () => {
|
|
227
|
-
render(_jsx(SourcesCard, { sources: [{ title: 'How to make an apple pie', link: '', subtitle: 'You must first create the universe' }] }));
|
|
228
|
-
expect(screen.getByText('How to make an apple pie'));
|
|
229
|
-
expect(screen.getByText('You must first create the universe'));
|
|
230
|
-
});
|
|
231
22
|
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { FunctionComponent } from 'react';
|
|
2
|
+
import { ButtonProps, CardBodyProps, CardFooterProps, CardProps, CardTitleProps, TruncateProps } from '@patternfly/react-core';
|
|
3
|
+
export interface SourcesCardBaseProps extends CardProps {
|
|
4
|
+
/** Additional classes for the pagination navigation container. */
|
|
5
|
+
className?: string;
|
|
6
|
+
/** Flag indicating if the pagination is disabled. */
|
|
7
|
+
isDisabled?: boolean;
|
|
8
|
+
/** @deprecated ofWord has been deprecated. Label for the English word "of." */
|
|
9
|
+
ofWord?: string;
|
|
10
|
+
/** Accessible label for the pagination component. */
|
|
11
|
+
paginationAriaLabel?: string;
|
|
12
|
+
/** Content rendered inside the paginated card */
|
|
13
|
+
sources: {
|
|
14
|
+
/** Title of sources card */
|
|
15
|
+
title?: string;
|
|
16
|
+
/** Subtitle of sources card */
|
|
17
|
+
subtitle?: string;
|
|
18
|
+
/** Link to source */
|
|
19
|
+
link: string;
|
|
20
|
+
/** Body of sources card */
|
|
21
|
+
body?: React.ReactNode | string;
|
|
22
|
+
/** Whether link is external */
|
|
23
|
+
isExternal?: boolean;
|
|
24
|
+
/** Whether sources card is expandable */
|
|
25
|
+
hasShowMore?: boolean;
|
|
26
|
+
/** onClick event applied to the title of the Sources card */
|
|
27
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
28
|
+
/** Any additional props applied to the title of the Sources card */
|
|
29
|
+
titleProps?: ButtonProps;
|
|
30
|
+
/** Custom footer applied to the Sources card */
|
|
31
|
+
footer?: React.ReactNode;
|
|
32
|
+
/** Additional props passed to Truncate component */
|
|
33
|
+
truncateProps?: TruncateProps;
|
|
34
|
+
}[];
|
|
35
|
+
/** Accessible label for the button which moves to the next page. */
|
|
36
|
+
toNextPageAriaLabel?: string;
|
|
37
|
+
/** Accessible label for the button which moves to the previous page. */
|
|
38
|
+
toPreviousPageAriaLabel?: string;
|
|
39
|
+
/** Function called when user clicks to navigate to next page. */
|
|
40
|
+
onNextClick?: (event: React.SyntheticEvent<HTMLButtonElement>, page: number) => void;
|
|
41
|
+
/** Function called when user clicks to navigate to previous page. */
|
|
42
|
+
onPreviousClick?: (event: React.SyntheticEvent<HTMLButtonElement>, page: number) => void;
|
|
43
|
+
/** Function called when page is changed. */
|
|
44
|
+
onSetPage?: (event: React.MouseEvent | React.KeyboardEvent | MouseEvent, newPage: number) => void;
|
|
45
|
+
/** Label for English words "show more" */
|
|
46
|
+
showMoreWords?: string;
|
|
47
|
+
/** Label for English words "show less" */
|
|
48
|
+
showLessWords?: string;
|
|
49
|
+
/** Additional props passed to card title */
|
|
50
|
+
cardTitleProps?: CardTitleProps;
|
|
51
|
+
/** Additional props passed to card body */
|
|
52
|
+
cardBodyProps?: CardBodyProps;
|
|
53
|
+
/** Additional props passed to card footer */
|
|
54
|
+
cardFooterProps?: CardFooterProps;
|
|
55
|
+
}
|
|
56
|
+
declare const SourcesCardBase: FunctionComponent<SourcesCardBaseProps>;
|
|
57
|
+
export default SourcesCardBase;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useState } from 'react';
|
|
14
|
+
// Import PatternFly components
|
|
15
|
+
import { Button, ButtonVariant, Card, CardBody, CardFooter, CardTitle, ExpandableSection, ExpandableSectionVariant, Icon, Truncate } from '@patternfly/react-core';
|
|
16
|
+
import { ExternalLinkSquareAltIcon } from '@patternfly/react-icons';
|
|
17
|
+
const SourcesCardBase = (_a) => {
|
|
18
|
+
var _b;
|
|
19
|
+
var { className, isDisabled, paginationAriaLabel = 'Pagination', sources, toNextPageAriaLabel = 'Go to next page', toPreviousPageAriaLabel = 'Go to previous page', onNextClick, onPreviousClick, onSetPage, showMoreWords = 'show more', showLessWords = 'show less', isCompact, cardTitleProps, cardBodyProps, cardFooterProps } = _a, props = __rest(_a, ["className", "isDisabled", "paginationAriaLabel", "sources", "toNextPageAriaLabel", "toPreviousPageAriaLabel", "onNextClick", "onPreviousClick", "onSetPage", "showMoreWords", "showLessWords", "isCompact", "cardTitleProps", "cardBodyProps", "cardFooterProps"]);
|
|
20
|
+
const [page, setPage] = useState(1);
|
|
21
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
22
|
+
const onToggle = (_event, isExpanded) => {
|
|
23
|
+
setIsExpanded(isExpanded);
|
|
24
|
+
};
|
|
25
|
+
const handleNewPage = (_evt, newPage) => {
|
|
26
|
+
setPage(newPage);
|
|
27
|
+
onSetPage && onSetPage(_evt, newPage);
|
|
28
|
+
};
|
|
29
|
+
const renderTitle = (title, truncateProps) => {
|
|
30
|
+
if (title) {
|
|
31
|
+
return _jsx(Truncate, Object.assign({ content: title }, truncateProps));
|
|
32
|
+
}
|
|
33
|
+
return `Source ${page}`;
|
|
34
|
+
};
|
|
35
|
+
return (_jsx("div", { className: "pf-chatbot__sources-card-base", children: _jsxs(Card, Object.assign({ 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: sources[page - 1].link, icon: sources[page - 1].isExternal ? _jsx(ExternalLinkSquareAltIcon, {}) : undefined, iconPosition: "end", isInline: true, rel: sources[page - 1].isExternal ? 'noreferrer' : undefined, target: sources[page - 1].isExternal ? '_blank' : undefined, onClick: (_b = sources[page - 1].onClick) !== null && _b !== void 0 ? _b : undefined }, sources[page - 1].titleProps, { children: renderTitle(sources[page - 1].title, sources[page - 1].truncateProps) })), sources[page - 1].subtitle && (_jsx("span", { className: "pf-chatbot__sources-card-subtitle", children: sources[page - 1].subtitle }))] }) })), sources[page - 1].body && (_jsx(CardBody, Object.assign({ className: `pf-chatbot__sources-card-body ${sources[page - 1].footer ? 'pf-chatbot__compact-sources-card-body' : undefined}` }, cardBodyProps, { children: sources[page - 1].hasShowMore ? (
|
|
36
|
+
// prevents extra VO announcements of button text - parent Message has aria-live
|
|
37
|
+
_jsx("div", { "aria-live": "off", children: _jsx(ExpandableSection, { variant: ExpandableSectionVariant.truncate, toggleText: isExpanded ? showLessWords : showMoreWords, onToggle: onToggle, isExpanded: isExpanded, truncateMaxLines: 2, children: sources[page - 1].body }) })) : (_jsx("div", { className: "pf-chatbot__sources-card-body-text", children: sources[page - 1].body })) }))), sources[page - 1].footer ? (_jsx(CardFooter, Object.assign({ className: "pf-chatbot__sources-card-footer" }, cardFooterProps, { children: sources[page - 1].footer }))) : (sources.length > 1 && (_jsx(CardFooter, Object.assign({ className: "pf-chatbot__sources-card-footer-container" }, cardFooterProps, { children: _jsx("div", { className: "pf-chatbot__sources-card-footer", children: _jsxs("nav", { className: `pf-chatbot__sources-card-footer-buttons ${className}`, "aria-label": paginationAriaLabel, children: [_jsx(Button, { variant: ButtonVariant.plain, isDisabled: isDisabled || page === 1, "data-action": "previous", onClick: (event) => {
|
|
38
|
+
const newPage = page >= 1 ? page - 1 : 1;
|
|
39
|
+
onPreviousClick && onPreviousClick(event, newPage);
|
|
40
|
+
handleNewPage(event, newPage);
|
|
41
|
+
}, "aria-label": toPreviousPageAriaLabel, children: _jsx(Icon, { iconSize: "lg", children: _jsx("svg", { className: "pf-v6-svg", viewBox: "0 0 280 500", fill: "currentColor", "aria-hidden": "true", role: "img", width: "1em", height: "1em", children: _jsx("path", { d: "M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z" }) }) }) }), _jsxs("span", { "aria-hidden": "true", children: [page, "/", sources.length] }), _jsx(Button, { variant: ButtonVariant.plain, isDisabled: isDisabled || page === sources.length, "aria-label": toNextPageAriaLabel, "data-action": "next", onClick: (event) => {
|
|
42
|
+
const newPage = page + 1 <= sources.length ? page + 1 : sources.length;
|
|
43
|
+
onNextClick && onNextClick(event, newPage);
|
|
44
|
+
handleNewPage(event, newPage);
|
|
45
|
+
}, children: _jsx(Icon, { isInline: true, iconSize: "lg", children: _jsx("svg", { className: "pf-v6-svg", viewBox: "0 0 180 500", fill: "currentColor", "aria-hidden": "true", role: "img", width: "1em", height: "1em", children: _jsx("path", { d: "M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z" }) }) }) })] }) }) }))))] })) }));
|
|
46
|
+
};
|
|
47
|
+
export default SourcesCardBase;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
import { render, screen } from '@testing-library/react';
|
|
12
|
+
import userEvent from '@testing-library/user-event';
|
|
13
|
+
import '@testing-library/jest-dom';
|
|
14
|
+
import SourcesCardBase from './SourcesCardBase';
|
|
15
|
+
describe('SourcesCardBase', () => {
|
|
16
|
+
it('should render card correctly if one source with only a link is passed in', () => {
|
|
17
|
+
render(_jsx(SourcesCardBase, { sources: [{ link: '' }] }));
|
|
18
|
+
expect(screen.getByText('Source 1')).toBeTruthy();
|
|
19
|
+
// no buttons or navigation when there is only 1 source
|
|
20
|
+
expect(screen.queryByRole('button')).toBeFalsy();
|
|
21
|
+
expect(screen.queryByText('1/1')).toBeFalsy();
|
|
22
|
+
});
|
|
23
|
+
it('should render card correctly if one source with a title is passed in', () => {
|
|
24
|
+
render(_jsx(SourcesCardBase, { sources: [{ title: 'How to make an apple pie', link: '' }] }));
|
|
25
|
+
expect(screen.getByText('How to make an apple pie')).toBeTruthy();
|
|
26
|
+
});
|
|
27
|
+
it('should render card correctly if one source with a body is passed in', () => {
|
|
28
|
+
render(_jsx(SourcesCardBase, { sources: [{ link: '', body: 'To make an apple pie, you must first...' }] }));
|
|
29
|
+
expect(screen.getByText('To make an apple pie, you must first...')).toBeTruthy();
|
|
30
|
+
});
|
|
31
|
+
it('should render card correctly if one source with a title and body is passed in', () => {
|
|
32
|
+
render(_jsx(SourcesCardBase, { sources: [{ title: 'How to make an apple pie', link: '', body: 'To make an apple pie, you must first...' }] }));
|
|
33
|
+
expect(screen.getByText('How to make an apple pie')).toBeTruthy();
|
|
34
|
+
expect(screen.getByText('To make an apple pie, you must first...')).toBeTruthy();
|
|
35
|
+
});
|
|
36
|
+
it('should render multiple cards correctly', () => {
|
|
37
|
+
render(_jsx(SourcesCardBase, { sources: [
|
|
38
|
+
{ title: 'How to make an apple pie', link: '' },
|
|
39
|
+
{ title: 'How to make cookies', link: '' }
|
|
40
|
+
] }));
|
|
41
|
+
expect(screen.getByText('How to make an apple pie')).toBeTruthy();
|
|
42
|
+
expect(screen.getByText('1/2')).toBeTruthy();
|
|
43
|
+
screen.getByRole('button', { name: /Go to previous page/i });
|
|
44
|
+
screen.getByRole('button', { name: /Go to next page/i });
|
|
45
|
+
});
|
|
46
|
+
it('should navigate between cards correctly', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
47
|
+
render(_jsx(SourcesCardBase, { sources: [
|
|
48
|
+
{ title: 'How to make an apple pie', link: '' },
|
|
49
|
+
{ title: 'How to make cookies', link: '' }
|
|
50
|
+
] }));
|
|
51
|
+
expect(screen.getByText('How to make an apple pie')).toBeTruthy();
|
|
52
|
+
expect(screen.getByText('1/2')).toBeTruthy();
|
|
53
|
+
expect(screen.getByRole('button', { name: /Go to previous page/i })).toBeDisabled();
|
|
54
|
+
yield userEvent.click(screen.getByRole('button', { name: /Go to next page/i }));
|
|
55
|
+
expect(screen.queryByText('How to make an apple pie')).toBeFalsy();
|
|
56
|
+
expect(screen.getByText('How to make cookies')).toBeTruthy();
|
|
57
|
+
expect(screen.getByText('2/2')).toBeTruthy();
|
|
58
|
+
expect(screen.getByRole('button', { name: /Go to previous page/i })).toBeEnabled();
|
|
59
|
+
expect(screen.getByRole('button', { name: /Go to next page/i })).toBeDisabled();
|
|
60
|
+
}));
|
|
61
|
+
it('should apply className appropriately', () => {
|
|
62
|
+
render(_jsx(SourcesCardBase, { sources: [
|
|
63
|
+
{ title: 'How to make an apple pie', link: '' },
|
|
64
|
+
{ title: 'How to make cookies', link: '' }
|
|
65
|
+
], className: "test" }));
|
|
66
|
+
const element = screen.getByRole('navigation');
|
|
67
|
+
expect(element).toHaveClass('test');
|
|
68
|
+
});
|
|
69
|
+
it('should disable pagination appropriately', () => {
|
|
70
|
+
render(_jsx(SourcesCardBase, { sources: [
|
|
71
|
+
{ title: 'How to make an apple pie', link: '' },
|
|
72
|
+
{ title: 'How to make cookies', link: '' }
|
|
73
|
+
], isDisabled: true }));
|
|
74
|
+
expect(screen.getByRole('button', { name: /Go to previous page/i })).toBeDisabled();
|
|
75
|
+
expect(screen.getByRole('button', { name: /Go to next page/i })).toBeDisabled();
|
|
76
|
+
});
|
|
77
|
+
it('should render navigation aria label appropriately', () => {
|
|
78
|
+
render(_jsx(SourcesCardBase, { sources: [
|
|
79
|
+
{ title: 'How to make an apple pie', link: '' },
|
|
80
|
+
{ title: 'How to make cookies', link: '' }
|
|
81
|
+
] }));
|
|
82
|
+
expect(screen.getByRole('navigation', { name: /Pagination/i })).toBeTruthy();
|
|
83
|
+
});
|
|
84
|
+
it('should change paginationAriaLabel appropriately', () => {
|
|
85
|
+
render(_jsx(SourcesCardBase, { sources: [
|
|
86
|
+
{ title: 'How to make an apple pie', link: '' },
|
|
87
|
+
{ title: 'How to make cookies', link: '' }
|
|
88
|
+
], paginationAriaLabel: "Navegaci\u00F3n" }));
|
|
89
|
+
expect(screen.getByRole('navigation', { name: /Navegación/i })).toBeTruthy();
|
|
90
|
+
});
|
|
91
|
+
it('should change toNextPageAriaLabel appropriately', () => {
|
|
92
|
+
render(_jsx(SourcesCardBase, { sources: [
|
|
93
|
+
{ title: 'How to make an apple pie', link: '' },
|
|
94
|
+
{ title: 'How to make cookies', link: '' }
|
|
95
|
+
], toNextPageAriaLabel: "Pase a la siguiente p\u00E1gina" }));
|
|
96
|
+
expect(screen.getByRole('button', { name: /Pase a la siguiente página/i })).toBeTruthy();
|
|
97
|
+
});
|
|
98
|
+
it('should change toPreviousPageAriaLabel appropriately', () => {
|
|
99
|
+
render(_jsx(SourcesCardBase, { sources: [
|
|
100
|
+
{ title: 'How to make an apple pie', link: '' },
|
|
101
|
+
{ title: 'How to make cookies', link: '' }
|
|
102
|
+
], toPreviousPageAriaLabel: "Presione para regresar a la p\u00E1gina anterior" }));
|
|
103
|
+
expect(screen.getByRole('button', { name: /Presione para regresar a la página anterior/i })).toBeTruthy();
|
|
104
|
+
});
|
|
105
|
+
it('should call onNextClick appropriately', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
106
|
+
const spy = jest.fn();
|
|
107
|
+
render(_jsx(SourcesCardBase, { sources: [
|
|
108
|
+
{ title: 'How to make an apple pie', link: '' },
|
|
109
|
+
{ title: 'How to make cookies', link: '' }
|
|
110
|
+
], onNextClick: spy }));
|
|
111
|
+
yield userEvent.click(screen.getByRole('button', { name: /Go to next page/i }));
|
|
112
|
+
expect(spy).toHaveBeenCalled();
|
|
113
|
+
}));
|
|
114
|
+
it('should call onPreviousClick appropriately', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
115
|
+
const spy = jest.fn();
|
|
116
|
+
render(_jsx(SourcesCardBase, { sources: [
|
|
117
|
+
{ title: 'How to make an apple pie', link: '' },
|
|
118
|
+
{ title: 'How to make cookies', link: '' }
|
|
119
|
+
], onPreviousClick: spy }));
|
|
120
|
+
yield userEvent.click(screen.getByRole('button', { name: /Go to next page/i }));
|
|
121
|
+
yield userEvent.click(screen.getByRole('button', { name: /Go to previous page/i }));
|
|
122
|
+
expect(spy).toHaveBeenCalled();
|
|
123
|
+
}));
|
|
124
|
+
it('should call onSetPage appropriately', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
125
|
+
const spy = jest.fn();
|
|
126
|
+
render(_jsx(SourcesCardBase, { sources: [
|
|
127
|
+
{ title: 'How to make an apple pie', link: '' },
|
|
128
|
+
{ title: 'How to make cookies', link: '' }
|
|
129
|
+
], onSetPage: spy }));
|
|
130
|
+
yield userEvent.click(screen.getByRole('button', { name: /Go to next page/i }));
|
|
131
|
+
expect(spy).toHaveBeenCalledTimes(1);
|
|
132
|
+
yield userEvent.click(screen.getByRole('button', { name: /Go to previous page/i }));
|
|
133
|
+
expect(spy).toHaveBeenCalledTimes(2);
|
|
134
|
+
}));
|
|
135
|
+
it('should handle showMore appropriately', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
136
|
+
render(_jsx(SourcesCardBase, { sources: [
|
|
137
|
+
{
|
|
138
|
+
title: 'Getting started with Red Hat OpenShift',
|
|
139
|
+
link: '#',
|
|
140
|
+
body: 'Red Hat OpenShift on IBM Cloud is a managed offering to create your own cluster of compute hosts where you can deploy and manage containerized apps on IBM Cloud ...',
|
|
141
|
+
hasShowMore: true
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
title: 'Azure Red Hat OpenShift documentation',
|
|
145
|
+
link: '#',
|
|
146
|
+
body: 'Microsoft Azure Red Hat OpenShift allows you to deploy a production ready Red Hat OpenShift cluster in Azure ...'
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
title: 'OKD Documentation: Home',
|
|
150
|
+
link: '#',
|
|
151
|
+
body: 'OKD is a distribution of Kubernetes optimized for continuous application development and multi-tenant deployment. OKD also serves as the upstream code base upon ...'
|
|
152
|
+
}
|
|
153
|
+
] }));
|
|
154
|
+
expect(screen.getByRole('region')).toHaveAttribute('class', 'pf-v6-c-expandable-section__content');
|
|
155
|
+
}));
|
|
156
|
+
it('should call onClick appropriately', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
157
|
+
const spy = jest.fn();
|
|
158
|
+
render(_jsx(SourcesCardBase, { sources: [{ title: 'How to make an apple pie', link: '', onClick: spy }] }));
|
|
159
|
+
yield userEvent.click(screen.getByRole('link', { name: /How to make an apple pie/i }));
|
|
160
|
+
expect(spy).toHaveBeenCalled();
|
|
161
|
+
}));
|
|
162
|
+
it('should apply titleProps appropriately', () => {
|
|
163
|
+
render(_jsx(SourcesCardBase, { sources: [{ title: 'How to make an apple pie', link: '', titleProps: { className: 'test' } }] }));
|
|
164
|
+
expect(screen.getByRole('link', { name: /How to make an apple pie/i })).toHaveClass('test');
|
|
165
|
+
});
|
|
166
|
+
});
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -58,6 +58,8 @@ export { default as SourceDetailsMenuItem } from './SourceDetailsMenuItem';
|
|
|
58
58
|
export * from './SourceDetailsMenuItem';
|
|
59
59
|
export { default as SourcesCard } from './SourcesCard';
|
|
60
60
|
export * from './SourcesCard';
|
|
61
|
+
export { default as SourcesCardBase } from './SourcesCardBase';
|
|
62
|
+
export * from './SourcesCardBase';
|
|
61
63
|
export { default as TermsOfUse } from './TermsOfUse';
|
|
62
64
|
export * from './TermsOfUse';
|
|
63
65
|
export { default as ToolCall } from './ToolCall';
|
package/dist/esm/index.js
CHANGED
|
@@ -59,6 +59,8 @@ export { default as SourceDetailsMenuItem } from './SourceDetailsMenuItem';
|
|
|
59
59
|
export * from './SourceDetailsMenuItem';
|
|
60
60
|
export { default as SourcesCard } from './SourcesCard';
|
|
61
61
|
export * from './SourcesCard';
|
|
62
|
+
export { default as SourcesCardBase } from './SourcesCardBase';
|
|
63
|
+
export * from './SourcesCardBase';
|
|
62
64
|
export { default as TermsOfUse } from './TermsOfUse';
|
|
63
65
|
export * from './TermsOfUse';
|
|
64
66
|
export { default as ToolCall } from './ToolCall';
|
|
@@ -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/Message/Message.test.tsx","../src/Message/Message.tsx","../src/Message/MessageInput.tsx","../src/Message/MessageLoading.tsx","../src/Message/index.ts","../src/Message/CodeBlockMessage/CodeBlockMessage.tsx","../src/Message/ErrorMessage/ErrorMessage.tsx","../src/Message/ImageMessage/ImageMessage.tsx","../src/Message/LinkMessage/LinkMessage.tsx","../src/Message/ListMessage/ListItemMessage.tsx","../src/Message/ListMessage/OrderedListMessage.tsx","../src/Message/ListMessage/UnorderedListMessage.tsx","../src/Message/Plugins/index.ts","../src/Message/Plugins/rehypeCodeBlockToggle.ts","../src/Message/Plugins/rehypeMoveImagesOutOfParagraphs.ts","../src/Message/QuickResponse/QuickResponse.tsx","../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/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/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/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/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/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__/rehype-external-links.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/Message/Message.test.tsx","../src/Message/Message.tsx","../src/Message/MessageInput.tsx","../src/Message/MessageLoading.tsx","../src/Message/index.ts","../src/Message/CodeBlockMessage/CodeBlockMessage.tsx","../src/Message/ErrorMessage/ErrorMessage.tsx","../src/Message/ImageMessage/ImageMessage.tsx","../src/Message/LinkMessage/LinkMessage.tsx","../src/Message/ListMessage/ListItemMessage.tsx","../src/Message/ListMessage/OrderedListMessage.tsx","../src/Message/ListMessage/UnorderedListMessage.tsx","../src/Message/Plugins/index.ts","../src/Message/Plugins/rehypeCodeBlockToggle.ts","../src/Message/Plugins/rehypeMoveImagesOutOfParagraphs.ts","../src/Message/QuickResponse/QuickResponse.tsx","../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/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/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/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/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__/rehype-external-links.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.4.0-prerelease.
|
|
3
|
+
"version": "6.4.0-prerelease.25",
|
|
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",
|