@patternfly/chatbot 6.4.0-prerelease.18 → 6.4.0-prerelease.19
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/FilePreview/FilePreview.d.ts +26 -0
- package/dist/cjs/FilePreview/FilePreview.js +26 -0
- package/dist/cjs/FilePreview/FilePreview.test.d.ts +1 -0
- package/dist/cjs/FilePreview/FilePreview.test.js +97 -0
- package/dist/cjs/FilePreview/index.d.ts +2 -0
- package/dist/cjs/FilePreview/index.js +23 -0
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.js +4 -1
- package/dist/css/main.css +24 -0
- package/dist/css/main.css.map +1 -1
- package/dist/dynamic/FilePreview/package.json +1 -0
- package/dist/esm/FilePreview/FilePreview.d.ts +26 -0
- package/dist/esm/FilePreview/FilePreview.js +21 -0
- package/dist/esm/FilePreview/FilePreview.test.d.ts +1 -0
- package/dist/esm/FilePreview/FilePreview.test.js +92 -0
- package/dist/esm/FilePreview/index.d.ts +2 -0
- package/dist/esm/FilePreview/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/FilePreview.tsx +33 -0
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/Messages.md +9 -0
- package/patternfly-docs/content/extensions/chatbot/examples/UI/UI.md +1 -0
- package/src/FilePreview/FilePreview.scss +22 -0
- package/src/FilePreview/FilePreview.test.tsx +112 -0
- package/src/FilePreview/FilePreview.tsx +58 -0
- package/src/FilePreview/index.ts +3 -0
- package/src/index.ts +3 -0
- package/src/main.scss +1 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ModalBodyProps, ModalHeaderProps } from '@patternfly/react-core';
|
|
2
|
+
import type { FunctionComponent } from 'react';
|
|
3
|
+
import { ChatbotDisplayMode } from '../Chatbot';
|
|
4
|
+
import { ChatbotModalProps } from '../ChatbotModal';
|
|
5
|
+
export interface FilePreviewProps extends ChatbotModalProps {
|
|
6
|
+
/** Class applied to modal */
|
|
7
|
+
className?: string;
|
|
8
|
+
/** Function that handles modal toggle */
|
|
9
|
+
handleModalToggle: (event: React.MouseEvent | MouseEvent | KeyboardEvent) => void;
|
|
10
|
+
/** Whether modal is open */
|
|
11
|
+
isModalOpen: boolean;
|
|
12
|
+
/** Title of modal */
|
|
13
|
+
title?: string;
|
|
14
|
+
/** Display mode for the Chatbot parent; this influences the styles applied */
|
|
15
|
+
displayMode?: ChatbotDisplayMode;
|
|
16
|
+
/** File name */
|
|
17
|
+
fileName: string;
|
|
18
|
+
/** Sets modal to compact styling. */
|
|
19
|
+
isCompact?: boolean;
|
|
20
|
+
/** Additional props passed to modal header */
|
|
21
|
+
modalHeaderProps?: ModalHeaderProps;
|
|
22
|
+
/** Additional props passed to modal body */
|
|
23
|
+
modalBodyProps?: ModalBodyProps;
|
|
24
|
+
}
|
|
25
|
+
declare const FilePreview: FunctionComponent<FilePreviewProps>;
|
|
26
|
+
export default FilePreview;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
+
const react_core_1 = require("@patternfly/react-core");
|
|
19
|
+
const Chatbot_1 = require("../Chatbot");
|
|
20
|
+
const ChatbotModal_1 = __importDefault(require("../ChatbotModal"));
|
|
21
|
+
const react_icons_1 = require("@patternfly/react-icons");
|
|
22
|
+
const FilePreview = (_a) => {
|
|
23
|
+
var { isModalOpen, displayMode = Chatbot_1.ChatbotDisplayMode.default, children, fileName, isCompact, className, handleModalToggle, title = 'File preview', modalHeaderProps, modalBodyProps } = _a, props = __rest(_a, ["isModalOpen", "displayMode", "children", "fileName", "isCompact", "className", "handleModalToggle", "title", "modalHeaderProps", "modalBodyProps"]);
|
|
24
|
+
return ((0, jsx_runtime_1.jsxs)(ChatbotModal_1.default, Object.assign({ isOpen: isModalOpen, className: `pf-chatbot__file-preview-modal pf-chatbot__file-preview-modal--${displayMode} ${isCompact ? 'pf-m-compact' : ''} ${className ? className : ''}`, displayMode: displayMode, onClose: handleModalToggle, isCompact: isCompact }, props, { children: [(0, jsx_runtime_1.jsx)(react_core_1.ModalHeader, Object.assign({ title: title }, modalHeaderProps)), (0, jsx_runtime_1.jsxs)(react_core_1.ModalBody, Object.assign({ className: "pf-chatbot__file-preview-body" }, modalBodyProps, { children: [(0, jsx_runtime_1.jsx)(react_icons_1.FileIcon, { className: "pf-chatbot__file-preview-icon" }), (0, jsx_runtime_1.jsx)("h2", { className: "pf-chatbot__file-preview-name", children: fileName }), children && (0, jsx_runtime_1.jsx)("div", { className: "pf-chatbot__file-preview-body", children: children })] }))] })));
|
|
25
|
+
};
|
|
26
|
+
exports.default = FilePreview;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("@testing-library/react");
|
|
8
|
+
require("@testing-library/jest-dom");
|
|
9
|
+
const FilePreview_1 = __importDefault(require("./FilePreview"));
|
|
10
|
+
const Chatbot_1 = require("../Chatbot");
|
|
11
|
+
const react_core_1 = require("@patternfly/react-core");
|
|
12
|
+
describe('FilePreview', () => {
|
|
13
|
+
const defaultProps = {
|
|
14
|
+
isModalOpen: true,
|
|
15
|
+
handleModalToggle: jest.fn(),
|
|
16
|
+
fileName: 'test-file.txt',
|
|
17
|
+
children: 'File content preview'
|
|
18
|
+
};
|
|
19
|
+
beforeEach(() => {
|
|
20
|
+
jest.clearAllMocks();
|
|
21
|
+
});
|
|
22
|
+
it('should render with basic props', () => {
|
|
23
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(FilePreview_1.default, Object.assign({}, defaultProps)));
|
|
24
|
+
expect(react_1.screen.getByText('File preview')).toBeInTheDocument();
|
|
25
|
+
expect(react_1.screen.getByText('test-file.txt')).toBeInTheDocument();
|
|
26
|
+
});
|
|
27
|
+
it('should render with custom title', () => {
|
|
28
|
+
const customTitle = 'Custom file preview title';
|
|
29
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(FilePreview_1.default, Object.assign({}, defaultProps, { title: customTitle })));
|
|
30
|
+
expect(react_1.screen.getByRole('heading', { name: customTitle })).toBeTruthy();
|
|
31
|
+
});
|
|
32
|
+
it('should handle modal toggle when closed', () => {
|
|
33
|
+
const mockToggle = jest.fn();
|
|
34
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(FilePreview_1.default, Object.assign({}, defaultProps, { isModalOpen: false, handleModalToggle: mockToggle })));
|
|
35
|
+
expect(react_1.screen.queryByRole('dialog')).not.toBeInTheDocument();
|
|
36
|
+
});
|
|
37
|
+
it('should apply default display mode class', () => {
|
|
38
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(FilePreview_1.default, Object.assign({}, defaultProps)));
|
|
39
|
+
const modal = react_1.screen.getByRole('dialog');
|
|
40
|
+
expect(modal).toHaveClass('pf-chatbot__file-preview-modal--default');
|
|
41
|
+
});
|
|
42
|
+
it('should apply custom display mode class', () => {
|
|
43
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(FilePreview_1.default, Object.assign({}, defaultProps, { displayMode: Chatbot_1.ChatbotDisplayMode.fullscreen })));
|
|
44
|
+
const modal = react_1.screen.getByRole('dialog');
|
|
45
|
+
expect(modal).toHaveClass('pf-chatbot__file-preview-modal--fullscreen');
|
|
46
|
+
});
|
|
47
|
+
it('should apply compact styling when isCompact is true', () => {
|
|
48
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(FilePreview_1.default, Object.assign({}, defaultProps, { isCompact: true })));
|
|
49
|
+
const modal = react_1.screen.getByRole('dialog');
|
|
50
|
+
expect(modal).toHaveClass('pf-m-compact');
|
|
51
|
+
});
|
|
52
|
+
it('should not apply compact styling when isCompact is false', () => {
|
|
53
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(FilePreview_1.default, Object.assign({}, defaultProps, { isCompact: false })));
|
|
54
|
+
const modal = react_1.screen.getByRole('dialog');
|
|
55
|
+
expect(modal).not.toHaveClass('pf-m-compact');
|
|
56
|
+
});
|
|
57
|
+
it('should apply custom className', () => {
|
|
58
|
+
const customClass = 'custom-file-preview';
|
|
59
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(FilePreview_1.default, Object.assign({}, defaultProps, { className: customClass })));
|
|
60
|
+
const modal = react_1.screen.getByRole('dialog');
|
|
61
|
+
expect(modal).toHaveClass(customClass);
|
|
62
|
+
});
|
|
63
|
+
it('should pass through additional props to ChatbotModal', () => {
|
|
64
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(FilePreview_1.default, Object.assign({}, defaultProps, { "data-testid": "file-preview-modal" })));
|
|
65
|
+
const modal = react_1.screen.getByTestId('file-preview-modal');
|
|
66
|
+
expect(modal).toBeInTheDocument();
|
|
67
|
+
});
|
|
68
|
+
it('should pass modalHeaderProps to ModalHeader', () => {
|
|
69
|
+
const modalHeaderProps = {
|
|
70
|
+
'data-testid': 'custom-header'
|
|
71
|
+
};
|
|
72
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(FilePreview_1.default, Object.assign({}, defaultProps, { modalHeaderProps: modalHeaderProps })));
|
|
73
|
+
const header = react_1.screen.getByTestId('custom-header');
|
|
74
|
+
expect(header).toBeInTheDocument();
|
|
75
|
+
});
|
|
76
|
+
it('should pass modalBodyProps to ModalBody', () => {
|
|
77
|
+
const modalBodyProps = {
|
|
78
|
+
'data-testid': 'custom-body'
|
|
79
|
+
};
|
|
80
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(FilePreview_1.default, Object.assign({}, defaultProps, { modalBodyProps: modalBodyProps })));
|
|
81
|
+
const body = react_1.screen.getByTestId('custom-body');
|
|
82
|
+
expect(body).toBeInTheDocument();
|
|
83
|
+
});
|
|
84
|
+
it('should pass ouiaId to ChatbotModal', () => {
|
|
85
|
+
const ouiaId = 'file-preview-ouia-id';
|
|
86
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(FilePreview_1.default, Object.assign({}, defaultProps, { ouiaId: ouiaId })));
|
|
87
|
+
const modal = react_1.screen.getByRole('dialog');
|
|
88
|
+
expect(modal).toHaveAttribute('data-ouia-component-id', ouiaId);
|
|
89
|
+
});
|
|
90
|
+
it('should handle complex children', () => {
|
|
91
|
+
const complexChildren = ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h3", { children: "File details" }), (0, jsx_runtime_1.jsx)("p", { children: "Size: 1.2 MB" }), (0, jsx_runtime_1.jsx)(react_core_1.Button, { children: "Download" })] }));
|
|
92
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(FilePreview_1.default, Object.assign({}, defaultProps, { children: complexChildren })));
|
|
93
|
+
expect(react_1.screen.getByRole('heading', { name: /File details/i })).toBeTruthy();
|
|
94
|
+
expect(react_1.screen.getByText('Size: 1.2 MB')).toBeTruthy();
|
|
95
|
+
expect(react_1.screen.getByRole('button', { name: /Download/i })).toBeTruthy();
|
|
96
|
+
});
|
|
97
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.default = void 0;
|
|
21
|
+
var FilePreview_1 = require("./FilePreview");
|
|
22
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(FilePreview_1).default; } });
|
|
23
|
+
__exportStar(require("./FilePreview"), exports);
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -34,6 +34,8 @@ export { default as FileDetailsLabel } from './FileDetailsLabel';
|
|
|
34
34
|
export * from './FileDetailsLabel';
|
|
35
35
|
export { default as FileDropZone } from './FileDropZone';
|
|
36
36
|
export * from './FileDropZone';
|
|
37
|
+
export { default as FilePreview } from './FilePreview';
|
|
38
|
+
export * from './FilePreview';
|
|
37
39
|
export { default as LoadingMessage } from './LoadingMessage';
|
|
38
40
|
export * from './LoadingMessage';
|
|
39
41
|
export { default as Message } from './Message';
|
package/dist/cjs/index.js
CHANGED
|
@@ -18,7 +18,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
18
18
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.tracking = exports.ToolResponse = exports.TermsOfUse = exports.SourcesCard = exports.SourceDetailsMenuItem = exports.Settings = exports.ResponseActions = exports.PreviewAttachment = exports.MessageDivider = exports.MessageBox = exports.MessageBar = exports.Message = exports.LoadingMessage = exports.FileDropZone = exports.FileDetailsLabel = exports.FileDetails = exports.DeepThinking = exports.Compare = exports.CodeModal = exports.ChatbotWelcomePrompt = exports.ChatbotToggle = exports.ChatbotPopover = exports.ChatbotModal = exports.ChatbotHeader = exports.ChatbotFooter = exports.ChatbotConversationHistoryNav = exports.ChatbotContent = exports.ChatbotAlert = exports.Chatbot = exports.AttachMenu = exports.AttachmentEdit = void 0;
|
|
21
|
+
exports.tracking = exports.ToolResponse = exports.TermsOfUse = exports.SourcesCard = exports.SourceDetailsMenuItem = exports.Settings = exports.ResponseActions = exports.PreviewAttachment = exports.MessageDivider = exports.MessageBox = exports.MessageBar = exports.Message = exports.LoadingMessage = exports.FilePreview = exports.FileDropZone = exports.FileDetailsLabel = exports.FileDetails = exports.DeepThinking = exports.Compare = exports.CodeModal = exports.ChatbotWelcomePrompt = exports.ChatbotToggle = exports.ChatbotPopover = exports.ChatbotModal = exports.ChatbotHeader = exports.ChatbotFooter = exports.ChatbotConversationHistoryNav = exports.ChatbotContent = exports.ChatbotAlert = exports.Chatbot = exports.AttachMenu = exports.AttachmentEdit = void 0;
|
|
22
22
|
var AttachmentEdit_1 = require("./AttachmentEdit");
|
|
23
23
|
Object.defineProperty(exports, "AttachmentEdit", { enumerable: true, get: function () { return __importDefault(AttachmentEdit_1).default; } });
|
|
24
24
|
__exportStar(require("./AttachmentEdit"), exports);
|
|
@@ -73,6 +73,9 @@ __exportStar(require("./FileDetailsLabel"), exports);
|
|
|
73
73
|
var FileDropZone_1 = require("./FileDropZone");
|
|
74
74
|
Object.defineProperty(exports, "FileDropZone", { enumerable: true, get: function () { return __importDefault(FileDropZone_1).default; } });
|
|
75
75
|
__exportStar(require("./FileDropZone"), exports);
|
|
76
|
+
var FilePreview_1 = require("./FilePreview");
|
|
77
|
+
Object.defineProperty(exports, "FilePreview", { enumerable: true, get: function () { return __importDefault(FilePreview_1).default; } });
|
|
78
|
+
__exportStar(require("./FilePreview"), exports);
|
|
76
79
|
var LoadingMessage_1 = require("./LoadingMessage");
|
|
77
80
|
Object.defineProperty(exports, "LoadingMessage", { enumerable: true, get: function () { return __importDefault(LoadingMessage_1).default; } });
|
|
78
81
|
__exportStar(require("./LoadingMessage"), exports);
|
package/dist/css/main.css
CHANGED
|
@@ -1074,6 +1074,30 @@
|
|
|
1074
1074
|
}
|
|
1075
1075
|
}
|
|
1076
1076
|
|
|
1077
|
+
.pf-chatbot__file-preview-body {
|
|
1078
|
+
display: flex;
|
|
1079
|
+
flex-direction: column;
|
|
1080
|
+
gap: var(--pf-t--global--spacer--md);
|
|
1081
|
+
align-items: center;
|
|
1082
|
+
justify-content: center;
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
.pf-chatbot__file-preview-icon {
|
|
1086
|
+
color: var(--pf-t--global--icon--color--subtle);
|
|
1087
|
+
width: var(--pf-t--global--icon--size--2xl);
|
|
1088
|
+
height: var(--pf-t--global--icon--size--2xl);
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
.pf-chatbot__file-preview-name {
|
|
1092
|
+
font-size: var(--pf-t--global--font--size--xl);
|
|
1093
|
+
font-weight: var(--pf-t--global--font--weight--heading--default);
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
.pf-chatbot__file-preview-body {
|
|
1097
|
+
color: var(--pf-t--global--text--color--subtle);
|
|
1098
|
+
font-size: var(--pf-t--global--font--size--body--lg);
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1077
1101
|
.pf-chatbot__message {
|
|
1078
1102
|
display: flex;
|
|
1079
1103
|
align-items: flex-start;
|
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/DeepThinking/DeepThinking.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/ToolResponse/ToolResponse.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;EACA,YACE;;AAEF;EACE;EACA;EACA;;AAEF;EACE;EACA;;AAKF;EA9BF;IA+BI;IACA;;;AAIF;EApCF;IAqCI;;;;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;;;AC3IF;EACE;EACA;EACA;;;ACAF;EACE;EACA;EACA;EACA;EACA;;AAGA;EARF;IASI;;;;AAOJ;EAII;AAAA;AAAA;IACE;IACA;;;ACnBJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;;AAKF;EACE;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;EACA;;AAIF;EACE;EACA;EACA;EACA;;AAEF;EACE;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;;AAGF;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;;;ACxQN;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;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;;;ACtBF;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;;;AAGF;AAAA;EAEE;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;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;;;ACjGJ;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;;;ACnFJ;EACE;EACA;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;;AAEA;EACE;;;ACKJ;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/DeepThinking/DeepThinking.scss","../../src/FileDetails/FileDetails.scss","../../src/FileDetailsLabel/FileDetailsLabel.scss","../../src/FileDropZone/FileDropZone.scss","../../src/FilePreview/FilePreview.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/ToolResponse/ToolResponse.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;EACA,YACE;;AAEF;EACE;EACA;EACA;;AAEF;EACE;EACA;;AAKF;EA9BF;IA+BI;IACA;;;AAIF;EApCF;IAqCI;;;;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;;;AC3IF;EACE;EACA;EACA;;;ACAF;EACE;EACA;EACA;EACA;EACA;;AAGA;EARF;IASI;;;;AAOJ;EAII;AAAA;AAAA;IACE;IACA;;;ACnBJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;;AAKF;EACE;EACA;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;EACA;;AAIF;EACE;EACA;EACA;EACA;;AAEF;EACE;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;;AAGF;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;;;ACxQN;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;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;;;ACtBF;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;;;;ACnDR;EACE;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;EACA;;;AAEF;EACE;EACA;;;ACjBF;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;;;AAGF;AAAA;EAEE;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;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;;;ACjGJ;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;;;ACnFJ;EACE;EACA;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;;AAEA;EACE;;;ACMJ;EACE;EACA","file":"main.css"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"main":"../../cjs/FilePreview/index.js","module":"../../esm/FilePreview/index.js","typings":"../../esm/FilePreview/index.d.ts"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ModalBodyProps, ModalHeaderProps } from '@patternfly/react-core';
|
|
2
|
+
import type { FunctionComponent } from 'react';
|
|
3
|
+
import { ChatbotDisplayMode } from '../Chatbot';
|
|
4
|
+
import { ChatbotModalProps } from '../ChatbotModal';
|
|
5
|
+
export interface FilePreviewProps extends ChatbotModalProps {
|
|
6
|
+
/** Class applied to modal */
|
|
7
|
+
className?: string;
|
|
8
|
+
/** Function that handles modal toggle */
|
|
9
|
+
handleModalToggle: (event: React.MouseEvent | MouseEvent | KeyboardEvent) => void;
|
|
10
|
+
/** Whether modal is open */
|
|
11
|
+
isModalOpen: boolean;
|
|
12
|
+
/** Title of modal */
|
|
13
|
+
title?: string;
|
|
14
|
+
/** Display mode for the Chatbot parent; this influences the styles applied */
|
|
15
|
+
displayMode?: ChatbotDisplayMode;
|
|
16
|
+
/** File name */
|
|
17
|
+
fileName: string;
|
|
18
|
+
/** Sets modal to compact styling. */
|
|
19
|
+
isCompact?: boolean;
|
|
20
|
+
/** Additional props passed to modal header */
|
|
21
|
+
modalHeaderProps?: ModalHeaderProps;
|
|
22
|
+
/** Additional props passed to modal body */
|
|
23
|
+
modalBodyProps?: ModalBodyProps;
|
|
24
|
+
}
|
|
25
|
+
declare const FilePreview: FunctionComponent<FilePreviewProps>;
|
|
26
|
+
export default FilePreview;
|
|
@@ -0,0 +1,21 @@
|
|
|
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 { ModalBody, ModalHeader } from '@patternfly/react-core';
|
|
14
|
+
import { ChatbotDisplayMode } from '../Chatbot';
|
|
15
|
+
import ChatbotModal from '../ChatbotModal';
|
|
16
|
+
import { FileIcon } from '@patternfly/react-icons';
|
|
17
|
+
const FilePreview = (_a) => {
|
|
18
|
+
var { isModalOpen, displayMode = ChatbotDisplayMode.default, children, fileName, isCompact, className, handleModalToggle, title = 'File preview', modalHeaderProps, modalBodyProps } = _a, props = __rest(_a, ["isModalOpen", "displayMode", "children", "fileName", "isCompact", "className", "handleModalToggle", "title", "modalHeaderProps", "modalBodyProps"]);
|
|
19
|
+
return (_jsxs(ChatbotModal, Object.assign({ isOpen: isModalOpen, className: `pf-chatbot__file-preview-modal pf-chatbot__file-preview-modal--${displayMode} ${isCompact ? 'pf-m-compact' : ''} ${className ? className : ''}`, displayMode: displayMode, onClose: handleModalToggle, isCompact: isCompact }, props, { children: [_jsx(ModalHeader, Object.assign({ title: title }, modalHeaderProps)), _jsxs(ModalBody, Object.assign({ className: "pf-chatbot__file-preview-body" }, modalBodyProps, { children: [_jsx(FileIcon, { className: "pf-chatbot__file-preview-icon" }), _jsx("h2", { className: "pf-chatbot__file-preview-name", children: fileName }), children && _jsx("div", { className: "pf-chatbot__file-preview-body", children: children })] }))] })));
|
|
20
|
+
};
|
|
21
|
+
export default FilePreview;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import '@testing-library/jest-dom';
|
|
4
|
+
import FilePreview from './FilePreview';
|
|
5
|
+
import { ChatbotDisplayMode } from '../Chatbot';
|
|
6
|
+
import { Button } from '@patternfly/react-core';
|
|
7
|
+
describe('FilePreview', () => {
|
|
8
|
+
const defaultProps = {
|
|
9
|
+
isModalOpen: true,
|
|
10
|
+
handleModalToggle: jest.fn(),
|
|
11
|
+
fileName: 'test-file.txt',
|
|
12
|
+
children: 'File content preview'
|
|
13
|
+
};
|
|
14
|
+
beforeEach(() => {
|
|
15
|
+
jest.clearAllMocks();
|
|
16
|
+
});
|
|
17
|
+
it('should render with basic props', () => {
|
|
18
|
+
render(_jsx(FilePreview, Object.assign({}, defaultProps)));
|
|
19
|
+
expect(screen.getByText('File preview')).toBeInTheDocument();
|
|
20
|
+
expect(screen.getByText('test-file.txt')).toBeInTheDocument();
|
|
21
|
+
});
|
|
22
|
+
it('should render with custom title', () => {
|
|
23
|
+
const customTitle = 'Custom file preview title';
|
|
24
|
+
render(_jsx(FilePreview, Object.assign({}, defaultProps, { title: customTitle })));
|
|
25
|
+
expect(screen.getByRole('heading', { name: customTitle })).toBeTruthy();
|
|
26
|
+
});
|
|
27
|
+
it('should handle modal toggle when closed', () => {
|
|
28
|
+
const mockToggle = jest.fn();
|
|
29
|
+
render(_jsx(FilePreview, Object.assign({}, defaultProps, { isModalOpen: false, handleModalToggle: mockToggle })));
|
|
30
|
+
expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
|
|
31
|
+
});
|
|
32
|
+
it('should apply default display mode class', () => {
|
|
33
|
+
render(_jsx(FilePreview, Object.assign({}, defaultProps)));
|
|
34
|
+
const modal = screen.getByRole('dialog');
|
|
35
|
+
expect(modal).toHaveClass('pf-chatbot__file-preview-modal--default');
|
|
36
|
+
});
|
|
37
|
+
it('should apply custom display mode class', () => {
|
|
38
|
+
render(_jsx(FilePreview, Object.assign({}, defaultProps, { displayMode: ChatbotDisplayMode.fullscreen })));
|
|
39
|
+
const modal = screen.getByRole('dialog');
|
|
40
|
+
expect(modal).toHaveClass('pf-chatbot__file-preview-modal--fullscreen');
|
|
41
|
+
});
|
|
42
|
+
it('should apply compact styling when isCompact is true', () => {
|
|
43
|
+
render(_jsx(FilePreview, Object.assign({}, defaultProps, { isCompact: true })));
|
|
44
|
+
const modal = screen.getByRole('dialog');
|
|
45
|
+
expect(modal).toHaveClass('pf-m-compact');
|
|
46
|
+
});
|
|
47
|
+
it('should not apply compact styling when isCompact is false', () => {
|
|
48
|
+
render(_jsx(FilePreview, Object.assign({}, defaultProps, { isCompact: false })));
|
|
49
|
+
const modal = screen.getByRole('dialog');
|
|
50
|
+
expect(modal).not.toHaveClass('pf-m-compact');
|
|
51
|
+
});
|
|
52
|
+
it('should apply custom className', () => {
|
|
53
|
+
const customClass = 'custom-file-preview';
|
|
54
|
+
render(_jsx(FilePreview, Object.assign({}, defaultProps, { className: customClass })));
|
|
55
|
+
const modal = screen.getByRole('dialog');
|
|
56
|
+
expect(modal).toHaveClass(customClass);
|
|
57
|
+
});
|
|
58
|
+
it('should pass through additional props to ChatbotModal', () => {
|
|
59
|
+
render(_jsx(FilePreview, Object.assign({}, defaultProps, { "data-testid": "file-preview-modal" })));
|
|
60
|
+
const modal = screen.getByTestId('file-preview-modal');
|
|
61
|
+
expect(modal).toBeInTheDocument();
|
|
62
|
+
});
|
|
63
|
+
it('should pass modalHeaderProps to ModalHeader', () => {
|
|
64
|
+
const modalHeaderProps = {
|
|
65
|
+
'data-testid': 'custom-header'
|
|
66
|
+
};
|
|
67
|
+
render(_jsx(FilePreview, Object.assign({}, defaultProps, { modalHeaderProps: modalHeaderProps })));
|
|
68
|
+
const header = screen.getByTestId('custom-header');
|
|
69
|
+
expect(header).toBeInTheDocument();
|
|
70
|
+
});
|
|
71
|
+
it('should pass modalBodyProps to ModalBody', () => {
|
|
72
|
+
const modalBodyProps = {
|
|
73
|
+
'data-testid': 'custom-body'
|
|
74
|
+
};
|
|
75
|
+
render(_jsx(FilePreview, Object.assign({}, defaultProps, { modalBodyProps: modalBodyProps })));
|
|
76
|
+
const body = screen.getByTestId('custom-body');
|
|
77
|
+
expect(body).toBeInTheDocument();
|
|
78
|
+
});
|
|
79
|
+
it('should pass ouiaId to ChatbotModal', () => {
|
|
80
|
+
const ouiaId = 'file-preview-ouia-id';
|
|
81
|
+
render(_jsx(FilePreview, Object.assign({}, defaultProps, { ouiaId: ouiaId })));
|
|
82
|
+
const modal = screen.getByRole('dialog');
|
|
83
|
+
expect(modal).toHaveAttribute('data-ouia-component-id', ouiaId);
|
|
84
|
+
});
|
|
85
|
+
it('should handle complex children', () => {
|
|
86
|
+
const complexChildren = (_jsxs("div", { children: [_jsx("h3", { children: "File details" }), _jsx("p", { children: "Size: 1.2 MB" }), _jsx(Button, { children: "Download" })] }));
|
|
87
|
+
render(_jsx(FilePreview, Object.assign({}, defaultProps, { children: complexChildren })));
|
|
88
|
+
expect(screen.getByRole('heading', { name: /File details/i })).toBeTruthy();
|
|
89
|
+
expect(screen.getByText('Size: 1.2 MB')).toBeTruthy();
|
|
90
|
+
expect(screen.getByRole('button', { name: /Download/i })).toBeTruthy();
|
|
91
|
+
});
|
|
92
|
+
});
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -34,6 +34,8 @@ export { default as FileDetailsLabel } from './FileDetailsLabel';
|
|
|
34
34
|
export * from './FileDetailsLabel';
|
|
35
35
|
export { default as FileDropZone } from './FileDropZone';
|
|
36
36
|
export * from './FileDropZone';
|
|
37
|
+
export { default as FilePreview } from './FilePreview';
|
|
38
|
+
export * from './FilePreview';
|
|
37
39
|
export { default as LoadingMessage } from './LoadingMessage';
|
|
38
40
|
export * from './LoadingMessage';
|
|
39
41
|
export { default as Message } from './Message';
|
package/dist/esm/index.js
CHANGED
|
@@ -35,6 +35,8 @@ export { default as FileDetailsLabel } from './FileDetailsLabel';
|
|
|
35
35
|
export * from './FileDetailsLabel';
|
|
36
36
|
export { default as FileDropZone } from './FileDropZone';
|
|
37
37
|
export * from './FileDropZone';
|
|
38
|
+
export { default as FilePreview } from './FilePreview';
|
|
39
|
+
export * from './FilePreview';
|
|
38
40
|
export { default as LoadingMessage } from './LoadingMessage';
|
|
39
41
|
export * from './LoadingMessage';
|
|
40
42
|
export { default as Message } from './Message';
|
|
@@ -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/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/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/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/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/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/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.19",
|
|
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,33 @@
|
|
|
1
|
+
import { useState, FunctionComponent, MouseEvent as ReactMouseEvent } from 'react';
|
|
2
|
+
import { Button, Checkbox } from '@patternfly/react-core';
|
|
3
|
+
import FilePreview from '@patternfly/chatbot/dist/dynamic/FilePreview';
|
|
4
|
+
|
|
5
|
+
export const AttachmentEditModalExample: FunctionComponent = () => {
|
|
6
|
+
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
7
|
+
const [isCompact, setIsCompact] = useState(false);
|
|
8
|
+
|
|
9
|
+
const handleModalToggle = (_event: ReactMouseEvent | MouseEvent | KeyboardEvent) => {
|
|
10
|
+
setIsModalOpen(!isModalOpen);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<>
|
|
15
|
+
<Checkbox
|
|
16
|
+
label="Show compact version"
|
|
17
|
+
isChecked={isCompact}
|
|
18
|
+
onChange={() => setIsCompact(!isCompact)}
|
|
19
|
+
id="modal-compact-no-preview"
|
|
20
|
+
name="modal-compact-no-preview"
|
|
21
|
+
></Checkbox>
|
|
22
|
+
<Button onClick={handleModalToggle}>Launch file preview modal</Button>
|
|
23
|
+
<FilePreview
|
|
24
|
+
isModalOpen={isModalOpen}
|
|
25
|
+
handleModalToggle={handleModalToggle}
|
|
26
|
+
fileName="compressed-file.zip"
|
|
27
|
+
isCompact={isCompact}
|
|
28
|
+
>
|
|
29
|
+
Preview unavailable
|
|
30
|
+
</FilePreview>
|
|
31
|
+
</>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
@@ -47,6 +47,7 @@ import { monitorSampleAppQuickStart } from '@patternfly/chatbot/src/Message/Quic
|
|
|
47
47
|
import userAvatar from './user_avatar.svg';
|
|
48
48
|
import squareImg from './PF-social-color-square.svg';
|
|
49
49
|
import { CSSProperties, useState, Fragment, FunctionComponent, MouseEvent as ReactMouseEvent, KeyboardEvent as ReactKeyboardEvent, Ref, isValidElement, cloneElement, Children, ReactNode, useRef, useEffect } from 'react';
|
|
50
|
+
import FilePreview from '@patternfly/chatbot/dist/dynamic/FilePreview';
|
|
50
51
|
|
|
51
52
|
The `content` prop of the `<Message>` component is passed to a `<Markdown>` component (from [react-markdown](https://remarkjs.github.io/react-markdown/)), which is configured to translate plain text strings into PatternFly [`<Content>` components](/components/content) and code blocks into PatternFly [`<CodeBlock>` components.](/components/code-block)
|
|
52
53
|
|
|
@@ -273,6 +274,14 @@ To allow users to edit an attached file, load a new code editor within the ChatB
|
|
|
273
274
|
|
|
274
275
|
```
|
|
275
276
|
|
|
277
|
+
### File preview
|
|
278
|
+
|
|
279
|
+
If the contents of an attachment cannot be previewed, load a file preview modal with a view of the file name and an unavailable message. When users close the modal, return to the main ChatBot window.
|
|
280
|
+
|
|
281
|
+
```js file="./FilePreview.tsx"
|
|
282
|
+
|
|
283
|
+
```
|
|
284
|
+
|
|
276
285
|
### Failed attachment error
|
|
277
286
|
|
|
278
287
|
When an attachment upload fails, a [danger alert](/components/alert) is displayed to provide details about the reason for failure.
|
|
@@ -87,6 +87,7 @@ 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
89
|
import { FunctionComponent, FormEvent, useState, useRef, MouseEvent, isValidElement, cloneElement, Children, ReactNode, Ref, MouseEvent as ReactMouseEvent, CSSProperties, useEffect} from 'react';
|
|
90
|
+
import FilePreview from '@patternfly/chatbot/dist/dynamic/FilePreview';
|
|
90
91
|
|
|
91
92
|
## Structure
|
|
92
93
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.pf-chatbot__file-preview-body {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: var(--pf-t--global--spacer--md);
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.pf-chatbot__file-preview-icon {
|
|
10
|
+
color: var(--pf-t--global--icon--color--subtle);
|
|
11
|
+
width: var(--pf-t--global--icon--size--2xl);
|
|
12
|
+
height: var(--pf-t--global--icon--size--2xl);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.pf-chatbot__file-preview-name {
|
|
16
|
+
font-size: var(--pf-t--global--font--size--xl);
|
|
17
|
+
font-weight: var(--pf-t--global--font--weight--heading--default);
|
|
18
|
+
}
|
|
19
|
+
.pf-chatbot__file-preview-body {
|
|
20
|
+
color: var(--pf-t--global--text--color--subtle);
|
|
21
|
+
font-size: var(--pf-t--global--font--size--body--lg);
|
|
22
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import '@testing-library/jest-dom';
|
|
3
|
+
import FilePreview from './FilePreview';
|
|
4
|
+
import { ChatbotDisplayMode } from '../Chatbot';
|
|
5
|
+
import { Button, ModalBodyProps, ModalHeaderProps } from '@patternfly/react-core';
|
|
6
|
+
|
|
7
|
+
describe('FilePreview', () => {
|
|
8
|
+
const defaultProps = {
|
|
9
|
+
isModalOpen: true,
|
|
10
|
+
handleModalToggle: jest.fn(),
|
|
11
|
+
fileName: 'test-file.txt',
|
|
12
|
+
children: 'File content preview'
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
jest.clearAllMocks();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('should render with basic props', () => {
|
|
20
|
+
render(<FilePreview {...defaultProps} />);
|
|
21
|
+
expect(screen.getByText('File preview')).toBeInTheDocument();
|
|
22
|
+
expect(screen.getByText('test-file.txt')).toBeInTheDocument();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('should render with custom title', () => {
|
|
26
|
+
const customTitle = 'Custom file preview title';
|
|
27
|
+
render(<FilePreview {...defaultProps} title={customTitle} />);
|
|
28
|
+
expect(screen.getByRole('heading', { name: customTitle })).toBeTruthy();
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('should handle modal toggle when closed', () => {
|
|
32
|
+
const mockToggle = jest.fn();
|
|
33
|
+
render(<FilePreview {...defaultProps} isModalOpen={false} handleModalToggle={mockToggle} />);
|
|
34
|
+
expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('should apply default display mode class', () => {
|
|
38
|
+
render(<FilePreview {...defaultProps} />);
|
|
39
|
+
const modal = screen.getByRole('dialog');
|
|
40
|
+
expect(modal).toHaveClass('pf-chatbot__file-preview-modal--default');
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('should apply custom display mode class', () => {
|
|
44
|
+
render(<FilePreview {...defaultProps} displayMode={ChatbotDisplayMode.fullscreen} />);
|
|
45
|
+
const modal = screen.getByRole('dialog');
|
|
46
|
+
expect(modal).toHaveClass('pf-chatbot__file-preview-modal--fullscreen');
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('should apply compact styling when isCompact is true', () => {
|
|
50
|
+
render(<FilePreview {...defaultProps} isCompact />);
|
|
51
|
+
const modal = screen.getByRole('dialog');
|
|
52
|
+
expect(modal).toHaveClass('pf-m-compact');
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('should not apply compact styling when isCompact is false', () => {
|
|
56
|
+
render(<FilePreview {...defaultProps} isCompact={false} />);
|
|
57
|
+
const modal = screen.getByRole('dialog');
|
|
58
|
+
expect(modal).not.toHaveClass('pf-m-compact');
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it('should apply custom className', () => {
|
|
62
|
+
const customClass = 'custom-file-preview';
|
|
63
|
+
render(<FilePreview {...defaultProps} className={customClass} />);
|
|
64
|
+
const modal = screen.getByRole('dialog');
|
|
65
|
+
expect(modal).toHaveClass(customClass);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it('should pass through additional props to ChatbotModal', () => {
|
|
69
|
+
render(<FilePreview {...defaultProps} data-testid="file-preview-modal" />);
|
|
70
|
+
const modal = screen.getByTestId('file-preview-modal');
|
|
71
|
+
expect(modal).toBeInTheDocument();
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it('should pass modalHeaderProps to ModalHeader', () => {
|
|
75
|
+
const modalHeaderProps = {
|
|
76
|
+
'data-testid': 'custom-header'
|
|
77
|
+
} as ModalHeaderProps;
|
|
78
|
+
render(<FilePreview {...defaultProps} modalHeaderProps={modalHeaderProps} />);
|
|
79
|
+
const header = screen.getByTestId('custom-header');
|
|
80
|
+
expect(header).toBeInTheDocument();
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it('should pass modalBodyProps to ModalBody', () => {
|
|
84
|
+
const modalBodyProps = {
|
|
85
|
+
'data-testid': 'custom-body'
|
|
86
|
+
} as ModalBodyProps;
|
|
87
|
+
render(<FilePreview {...defaultProps} modalBodyProps={modalBodyProps} />);
|
|
88
|
+
const body = screen.getByTestId('custom-body');
|
|
89
|
+
expect(body).toBeInTheDocument();
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it('should pass ouiaId to ChatbotModal', () => {
|
|
93
|
+
const ouiaId = 'file-preview-ouia-id';
|
|
94
|
+
render(<FilePreview {...defaultProps} ouiaId={ouiaId} />);
|
|
95
|
+
const modal = screen.getByRole('dialog');
|
|
96
|
+
expect(modal).toHaveAttribute('data-ouia-component-id', ouiaId);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it('should handle complex children', () => {
|
|
100
|
+
const complexChildren = (
|
|
101
|
+
<div>
|
|
102
|
+
<h3>File details</h3>
|
|
103
|
+
<p>Size: 1.2 MB</p>
|
|
104
|
+
<Button>Download</Button>
|
|
105
|
+
</div>
|
|
106
|
+
);
|
|
107
|
+
render(<FilePreview {...defaultProps}>{complexChildren}</FilePreview>);
|
|
108
|
+
expect(screen.getByRole('heading', { name: /File details/i })).toBeTruthy();
|
|
109
|
+
expect(screen.getByText('Size: 1.2 MB')).toBeTruthy();
|
|
110
|
+
expect(screen.getByRole('button', { name: /Download/i })).toBeTruthy();
|
|
111
|
+
});
|
|
112
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ModalBody, ModalBodyProps, ModalHeader, ModalHeaderProps } from '@patternfly/react-core';
|
|
2
|
+
import type { FunctionComponent } from 'react';
|
|
3
|
+
import { ChatbotDisplayMode } from '../Chatbot';
|
|
4
|
+
import ChatbotModal, { ChatbotModalProps } from '../ChatbotModal';
|
|
5
|
+
import { FileIcon } from '@patternfly/react-icons';
|
|
6
|
+
|
|
7
|
+
export interface FilePreviewProps extends ChatbotModalProps {
|
|
8
|
+
/** Class applied to modal */
|
|
9
|
+
className?: string;
|
|
10
|
+
/** Function that handles modal toggle */
|
|
11
|
+
handleModalToggle: (event: React.MouseEvent | MouseEvent | KeyboardEvent) => void;
|
|
12
|
+
/** Whether modal is open */
|
|
13
|
+
isModalOpen: boolean;
|
|
14
|
+
/** Title of modal */
|
|
15
|
+
title?: string;
|
|
16
|
+
/** Display mode for the Chatbot parent; this influences the styles applied */
|
|
17
|
+
displayMode?: ChatbotDisplayMode;
|
|
18
|
+
/** File name */
|
|
19
|
+
fileName: string;
|
|
20
|
+
/** Sets modal to compact styling. */
|
|
21
|
+
isCompact?: boolean;
|
|
22
|
+
/** Additional props passed to modal header */
|
|
23
|
+
modalHeaderProps?: ModalHeaderProps;
|
|
24
|
+
/** Additional props passed to modal body */
|
|
25
|
+
modalBodyProps?: ModalBodyProps;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const FilePreview: FunctionComponent<FilePreviewProps> = ({
|
|
29
|
+
isModalOpen,
|
|
30
|
+
displayMode = ChatbotDisplayMode.default,
|
|
31
|
+
children,
|
|
32
|
+
fileName,
|
|
33
|
+
isCompact,
|
|
34
|
+
className,
|
|
35
|
+
handleModalToggle,
|
|
36
|
+
title = 'File preview',
|
|
37
|
+
modalHeaderProps,
|
|
38
|
+
modalBodyProps,
|
|
39
|
+
...props
|
|
40
|
+
}: FilePreviewProps) => (
|
|
41
|
+
<ChatbotModal
|
|
42
|
+
isOpen={isModalOpen}
|
|
43
|
+
className={`pf-chatbot__file-preview-modal pf-chatbot__file-preview-modal--${displayMode} ${isCompact ? 'pf-m-compact' : ''} ${className ? className : ''}`}
|
|
44
|
+
displayMode={displayMode}
|
|
45
|
+
onClose={handleModalToggle}
|
|
46
|
+
isCompact={isCompact}
|
|
47
|
+
{...props}
|
|
48
|
+
>
|
|
49
|
+
<ModalHeader title={title} {...modalHeaderProps} />
|
|
50
|
+
<ModalBody className="pf-chatbot__file-preview-body" {...modalBodyProps}>
|
|
51
|
+
<FileIcon className="pf-chatbot__file-preview-icon" />
|
|
52
|
+
<h2 className="pf-chatbot__file-preview-name">{fileName}</h2>
|
|
53
|
+
{children && <div className="pf-chatbot__file-preview-body">{children}</div>}
|
|
54
|
+
</ModalBody>
|
|
55
|
+
</ChatbotModal>
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
export default FilePreview;
|
package/src/index.ts
CHANGED
|
@@ -54,6 +54,9 @@ export * from './FileDetailsLabel';
|
|
|
54
54
|
export { default as FileDropZone } from './FileDropZone';
|
|
55
55
|
export * from './FileDropZone';
|
|
56
56
|
|
|
57
|
+
export { default as FilePreview } from './FilePreview';
|
|
58
|
+
export * from './FilePreview';
|
|
59
|
+
|
|
57
60
|
export { default as LoadingMessage } from './LoadingMessage';
|
|
58
61
|
export * from './LoadingMessage';
|
|
59
62
|
|
package/src/main.scss
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
@import './FileDetails/FileDetails';
|
|
16
16
|
@import './FileDetailsLabel/FileDetailsLabel';
|
|
17
17
|
@import './FileDropZone/FileDropZone';
|
|
18
|
+
@import './FilePreview/FilePreview.scss';
|
|
18
19
|
@import './Message/Message';
|
|
19
20
|
@import './Message/CodeBlockMessage/CodeBlockMessage';
|
|
20
21
|
@import './Message/ImageMessage/ImageMessage';
|