@red-hat-developer-hub/backstage-plugin-lightspeed 2.6.7 → 2.7.0
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/CHANGELOG.md +21 -0
- package/dist/alpha.d.ts +7 -0
- package/dist/components/CollapsedHistoryStrip.esm.js +94 -0
- package/dist/components/CollapsedHistoryStrip.esm.js.map +1 -0
- package/dist/components/LightSpeedChat.esm.js +272 -106
- package/dist/components/LightSpeedChat.esm.js.map +1 -1
- package/dist/components/MessageBarModelSelector.esm.js +92 -0
- package/dist/components/MessageBarModelSelector.esm.js.map +1 -0
- package/dist/images/logo.svg +1 -0
- package/dist/translations/de.esm.js +5 -0
- package/dist/translations/de.esm.js.map +1 -1
- package/dist/translations/es.esm.js +7 -0
- package/dist/translations/es.esm.js.map +1 -1
- package/dist/translations/fr.esm.js +5 -0
- package/dist/translations/fr.esm.js.map +1 -1
- package/dist/translations/it.esm.js +7 -0
- package/dist/translations/it.esm.js.map +1 -1
- package/dist/translations/ja.esm.js +5 -0
- package/dist/translations/ja.esm.js.map +1 -1
- package/dist/translations/ref.esm.js +9 -0
- package/dist/translations/ref.esm.js.map +1 -1
- package/package.json +3 -3
|
@@ -5,7 +5,7 @@ import { Button, makeStyles } from '@material-ui/core';
|
|
|
5
5
|
import { ChatbotDisplayMode, ChatbotContent, ChatbotFooter, MessageBar, ChatbotFootnote, Settings, Chatbot, ChatbotHeader, ChatbotHeaderMain, ChatbotHeaderMenu, ChatbotHeaderTitle, FileDropZone, ChatbotAlert } from '@patternfly/chatbot';
|
|
6
6
|
import ChatbotConversationHistoryNav from '@patternfly/chatbot/dist/dynamic/ChatbotConversationHistoryNav';
|
|
7
7
|
import { DropdownItem, Tooltip, MenuToggle, Select, SelectList, SelectOption, AlertGroup, Alert, AlertVariant, AlertActionCloseButton, Title, Tabs, Tab } from '@patternfly/react-core';
|
|
8
|
-
import { SortAmountDownAltIcon, SortAmountDownIcon,
|
|
8
|
+
import { SortAmountDownAltIcon, SortAmountDownIcon, PlusIcon, SearchIcon } from '@patternfly/react-icons';
|
|
9
9
|
import { useQueryClient } from '@tanstack/react-query';
|
|
10
10
|
import { UNTITLED_NOTEBOOK_NAME, TEMP_CONVERSATION_ID, supportedFileTypes } from '../const.esm.js';
|
|
11
11
|
import '@backstage/core-plugin-api';
|
|
@@ -31,15 +31,18 @@ import { useNotebookDocuments } from '../hooks/notebooks/useNotebookDocuments.es
|
|
|
31
31
|
import { useLightspeedDrawerContext } from '../hooks/useLightspeedDrawerContext.esm.js';
|
|
32
32
|
import { useLightspeedUpdatePermission } from '../hooks/useLightspeedUpdatePermission.esm.js';
|
|
33
33
|
import { useWelcomePrompts } from '../hooks/useWelcomePrompts.esm.js';
|
|
34
|
+
import logo from '../images/logo.svg';
|
|
34
35
|
import { getAttachments } from '../utils/attachment-utils.esm.js';
|
|
35
36
|
import { getCategorizeMessages, getFootnoteProps } from '../utils/lightspeed-chatbox-utils.esm.js';
|
|
36
37
|
import Attachment from './Attachment.esm.js';
|
|
37
38
|
import { useFileAttachmentContext } from './AttachmentContext.esm.js';
|
|
39
|
+
import { EditSquareIcon, CollapsedHistoryStrip } from './CollapsedHistoryStrip.esm.js';
|
|
38
40
|
import { DeleteModal } from './DeleteModal.esm.js';
|
|
39
41
|
import FilePreview from './FilePreview.esm.js';
|
|
40
42
|
import { LightspeedChatBox } from './LightspeedChatBox.esm.js';
|
|
41
43
|
import { LightspeedChatBoxHeader } from './LightspeedChatBoxHeader.esm.js';
|
|
42
44
|
import { McpServersSettings } from './McpServersSettings.esm.js';
|
|
45
|
+
import { MessageBarModelSelector } from './MessageBarModelSelector.esm.js';
|
|
43
46
|
import { DeleteNotebookModal } from './notebooks/DeleteNotebookModal.esm.js';
|
|
44
47
|
import { NotebooksTab } from './notebooks/NotebooksTab.esm.js';
|
|
45
48
|
import { NotebookView } from './notebooks/NotebookView.esm.js';
|
|
@@ -47,6 +50,12 @@ import { RenameNotebookModal } from './notebooks/RenameNotebookModal.esm.js';
|
|
|
47
50
|
import PermissionRequiredState from './PermissionRequiredState.esm.js';
|
|
48
51
|
import { RenameConversationModal } from './RenameConversationModal.esm.js';
|
|
49
52
|
|
|
53
|
+
const COLLAPSE_PANEL_ICON_SVG = `url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16 21V3H14V21H16ZM12 17V7L7 12L12 17Z' fill='black'/%3E%3C/svg%3E") no-repeat center`;
|
|
54
|
+
const ConditionalWrapper = ({
|
|
55
|
+
condition,
|
|
56
|
+
wrapper,
|
|
57
|
+
children
|
|
58
|
+
}) => condition ? wrapper(children) : children;
|
|
50
59
|
const useStyles = makeStyles((theme) => ({
|
|
51
60
|
body: {
|
|
52
61
|
// remove default margin and padding from common elements
|
|
@@ -58,7 +67,8 @@ const useStyles = makeStyles((theme) => ({
|
|
|
58
67
|
header: {
|
|
59
68
|
padding: `${theme.spacing(3)}px ${theme.spacing(3)}px 0 ${theme.spacing(
|
|
60
69
|
3
|
|
61
|
-
)}px !important
|
|
70
|
+
)}px !important`,
|
|
71
|
+
backgroundColor: "var(--pf-t--global--background--color--floating--default) !important"
|
|
62
72
|
},
|
|
63
73
|
errorContainer: {
|
|
64
74
|
padding: theme.spacing(3)
|
|
@@ -68,7 +78,9 @@ const useStyles = makeStyles((theme) => ({
|
|
|
68
78
|
rowGap: 0,
|
|
69
79
|
columnGap: 0,
|
|
70
80
|
"--pf-v6-c-multiple-file-upload--Gap": "0",
|
|
71
|
-
"--pf-v5-c-multiple-file-upload--Gap": "0"
|
|
81
|
+
"--pf-v5-c-multiple-file-upload--Gap": "0",
|
|
82
|
+
flex: 1,
|
|
83
|
+
minWidth: 0
|
|
72
84
|
},
|
|
73
85
|
headerMenu: {
|
|
74
86
|
// align hamburger icon with title
|
|
@@ -77,11 +89,23 @@ const useStyles = makeStyles((theme) => ({
|
|
|
77
89
|
alignItems: "center"
|
|
78
90
|
}
|
|
79
91
|
},
|
|
92
|
+
headerLogo: {
|
|
93
|
+
width: 48,
|
|
94
|
+
height: 48,
|
|
95
|
+
marginRight: theme.spacing(1.5),
|
|
96
|
+
flexShrink: 0
|
|
97
|
+
},
|
|
80
98
|
headerTitle: {
|
|
81
|
-
justifyContent: "left !important"
|
|
99
|
+
justifyContent: "left !important",
|
|
100
|
+
"& h1": {
|
|
101
|
+
fontSize: "32px !important",
|
|
102
|
+
fontWeight: "700 !important",
|
|
103
|
+
lineHeight: "36.4px !important",
|
|
104
|
+
fontFamily: '"Red Hat Display", sans-serif !important'
|
|
105
|
+
}
|
|
82
106
|
},
|
|
83
107
|
tabs: {
|
|
84
|
-
padding:
|
|
108
|
+
padding: `0 ${theme.spacing(2)}px`,
|
|
85
109
|
backgroundColor: "var(--pf-t--global--background--color--floating--default)",
|
|
86
110
|
"& .pf-v6-c-tabs__item, & .pf-v5-c-tabs__item": {
|
|
87
111
|
backgroundColor: "transparent"
|
|
@@ -103,6 +127,11 @@ const useStyles = makeStyles((theme) => ({
|
|
|
103
127
|
tabsDivider: {
|
|
104
128
|
borderTop: "1px solid var(--pf-t--global--border--color--default)"
|
|
105
129
|
},
|
|
130
|
+
headerDivider: {
|
|
131
|
+
paddingTop: 8,
|
|
132
|
+
borderBottom: "1px solid var(--pf-t--global--border--color--default)",
|
|
133
|
+
backgroundColor: "var(--pf-t--global--background--color--floating--default)"
|
|
134
|
+
},
|
|
106
135
|
notebooksContainer: {
|
|
107
136
|
padding: theme.spacing(3),
|
|
108
137
|
height: "100%",
|
|
@@ -249,6 +278,23 @@ const useStyles = makeStyles((theme) => ({
|
|
|
249
278
|
backgroundColor: theme.palette.grey[300]
|
|
250
279
|
}
|
|
251
280
|
},
|
|
281
|
+
fullscreenFooter: {
|
|
282
|
+
"&>.pf-chatbot__footer-container": {
|
|
283
|
+
width: "100% !important",
|
|
284
|
+
padding: theme.spacing(1.5),
|
|
285
|
+
maxWidth: "unset !important",
|
|
286
|
+
margin: "0 auto"
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
fullscreenMessageBar: {
|
|
290
|
+
backgroundColor: "var(--pf-t--global--background--color--secondary--default)",
|
|
291
|
+
border: "1px solid var(--pf-t--global--border--color--default)",
|
|
292
|
+
borderRadius: 24,
|
|
293
|
+
padding: theme.spacing(0.5),
|
|
294
|
+
"&::after": {
|
|
295
|
+
display: "none"
|
|
296
|
+
}
|
|
297
|
+
},
|
|
252
298
|
sortDropdown: {
|
|
253
299
|
padding: 0,
|
|
254
300
|
margin: 0
|
|
@@ -354,7 +400,10 @@ const useStyles = makeStyles((theme) => ({
|
|
|
354
400
|
flexDirection: "column",
|
|
355
401
|
minHeight: 0,
|
|
356
402
|
width: "100%",
|
|
357
|
-
minWidth: 0
|
|
403
|
+
minWidth: 0,
|
|
404
|
+
whiteSpace: "normal",
|
|
405
|
+
wordBreak: "break-word",
|
|
406
|
+
overflowWrap: "break-word"
|
|
358
407
|
},
|
|
359
408
|
mcpSettingsPane: {
|
|
360
409
|
width: "100%",
|
|
@@ -363,7 +412,8 @@ const useStyles = makeStyles((theme) => ({
|
|
|
363
412
|
backgroundColor: "var(--pf-v6-c-table--BackgroundColor, var(--pf-t--global--background--color--primary--default))",
|
|
364
413
|
display: "flex",
|
|
365
414
|
flexDirection: "column",
|
|
366
|
-
minHeight: 0
|
|
415
|
+
minHeight: 0,
|
|
416
|
+
overflow: "auto"
|
|
367
417
|
},
|
|
368
418
|
mcpCollapsedDrawerOrderFix: {
|
|
369
419
|
"& .pf-v6-c-drawer.pf-m-panel-left > .pf-v6-c-drawer__main > .pf-v6-c-drawer__content, & .pf-v5-c-drawer.pf-m-panel-left > .pf-v5-c-drawer__main > .pf-v5-c-drawer__content": {
|
|
@@ -374,6 +424,68 @@ const useStyles = makeStyles((theme) => ({
|
|
|
374
424
|
opacity: 0,
|
|
375
425
|
transition: "none !important"
|
|
376
426
|
}
|
|
427
|
+
},
|
|
428
|
+
// TODO: These PatternFly drawer overrides are needed because PF Chatbot doesn't
|
|
429
|
+
// provide clean APIs for custom expand/collapse icons and positioning.
|
|
430
|
+
// Remove once PatternFly supports these features.
|
|
431
|
+
// See: https://github.com/patternfly/chatbot/issues/834
|
|
432
|
+
fullscreenChatLayout: {
|
|
433
|
+
display: "flex",
|
|
434
|
+
flexDirection: "row",
|
|
435
|
+
flex: 1,
|
|
436
|
+
minHeight: 0,
|
|
437
|
+
height: "100%",
|
|
438
|
+
width: "100%",
|
|
439
|
+
"& .pf-v6-c-drawer, & .pf-v5-c-drawer": {
|
|
440
|
+
flex: 1,
|
|
441
|
+
minWidth: 0
|
|
442
|
+
},
|
|
443
|
+
"& .pf-v6-c-drawer__content, & .pf-v5-c-drawer__content": {
|
|
444
|
+
flex: 1,
|
|
445
|
+
minWidth: 0
|
|
446
|
+
},
|
|
447
|
+
"& .pf-v6-c-drawer:not(.pf-m-expanded) > .pf-v6-c-drawer__main > .pf-v6-c-drawer__panel, & .pf-v5-c-drawer:not(.pf-m-expanded) > .pf-v5-c-drawer__main > .pf-v5-c-drawer__panel": {
|
|
448
|
+
display: "none"
|
|
449
|
+
},
|
|
450
|
+
"& .pf-v6-c-drawer__close, & .pf-v5-c-drawer__close": {
|
|
451
|
+
marginTop: -48,
|
|
452
|
+
marginRight: -24
|
|
453
|
+
},
|
|
454
|
+
"& .pf-v6-c-drawer__close .pf-v6-c-button svg, & .pf-v5-c-drawer__close .pf-v5-c-button svg": {
|
|
455
|
+
display: "none"
|
|
456
|
+
},
|
|
457
|
+
"& .pf-v6-c-drawer__close .pf-v6-c-button, & .pf-v5-c-drawer__close .pf-v5-c-button": {
|
|
458
|
+
display: "flex",
|
|
459
|
+
alignItems: "center",
|
|
460
|
+
justifyContent: "center",
|
|
461
|
+
"&::before": {
|
|
462
|
+
content: '""',
|
|
463
|
+
display: "block",
|
|
464
|
+
width: 24,
|
|
465
|
+
height: 24,
|
|
466
|
+
mask: COLLAPSE_PANEL_ICON_SVG,
|
|
467
|
+
WebkitMask: COLLAPSE_PANEL_ICON_SVG,
|
|
468
|
+
backgroundColor: "currentColor"
|
|
469
|
+
}
|
|
470
|
+
},
|
|
471
|
+
"& .pf-chatbot__menu-item": {
|
|
472
|
+
cursor: "pointer"
|
|
473
|
+
},
|
|
474
|
+
"& .pf-chatbot__menu-item .pf-v6-c-menu-toggle, & .pf-chatbot__menu-item .pf-v5-c-menu-toggle": {
|
|
475
|
+
opacity: 0,
|
|
476
|
+
transition: "opacity 0.15s ease-in-out"
|
|
477
|
+
},
|
|
478
|
+
"& .pf-chatbot__menu-item:hover .pf-v6-c-menu-toggle, & .pf-chatbot__menu-item:hover .pf-v5-c-menu-toggle": {
|
|
479
|
+
opacity: 1
|
|
480
|
+
}
|
|
481
|
+
},
|
|
482
|
+
fullscreenMainContent: {
|
|
483
|
+
display: "flex",
|
|
484
|
+
flexDirection: "column",
|
|
485
|
+
flex: 1,
|
|
486
|
+
minHeight: 0,
|
|
487
|
+
minWidth: 0,
|
|
488
|
+
overflow: "hidden"
|
|
377
489
|
}
|
|
378
490
|
}));
|
|
379
491
|
const LightspeedChat = ({
|
|
@@ -1275,43 +1387,67 @@ const LightspeedChat = ({
|
|
|
1275
1387
|
)
|
|
1276
1388
|
}
|
|
1277
1389
|
),
|
|
1278
|
-
/* @__PURE__ */ jsxs(
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1390
|
+
/* @__PURE__ */ jsxs(
|
|
1391
|
+
ChatbotFooter,
|
|
1392
|
+
{
|
|
1393
|
+
className: isFullscreenMode ? `${classes.footer} ${classes.fullscreenFooter}` : classes.footer,
|
|
1394
|
+
children: [
|
|
1395
|
+
/* @__PURE__ */ jsx(FilePreview, {}),
|
|
1396
|
+
/* @__PURE__ */ jsx(
|
|
1397
|
+
MessageBar,
|
|
1398
|
+
{
|
|
1399
|
+
className: isFullscreenMode ? classes.fullscreenMessageBar : void 0,
|
|
1400
|
+
onSendMessage: sendMessage,
|
|
1401
|
+
isSendButtonDisabled,
|
|
1402
|
+
hasAttachButton: true,
|
|
1403
|
+
attachButtonPosition: isFullscreenMode ? "start" : void 0,
|
|
1404
|
+
handleAttach,
|
|
1405
|
+
hasMicrophoneButton: true,
|
|
1406
|
+
value: draftMessage,
|
|
1407
|
+
onChange: handleDraftMessage,
|
|
1408
|
+
hasStopButton: streamingUiMatchesView,
|
|
1409
|
+
handleStopButton: streamingUiMatchesView ? handleStopButton : void 0,
|
|
1410
|
+
buttonProps: {
|
|
1411
|
+
attach: {
|
|
1412
|
+
inputTestId: "attachment-input",
|
|
1413
|
+
tooltipContent: t("tooltip.attach"),
|
|
1414
|
+
"aria-label": t("tooltip.attach"),
|
|
1415
|
+
...isFullscreenMode && { icon: /* @__PURE__ */ jsx(PlusIcon, {}) }
|
|
1416
|
+
},
|
|
1417
|
+
microphone: {
|
|
1418
|
+
tooltipContent: {
|
|
1419
|
+
active: t("tooltip.microphone.active"),
|
|
1420
|
+
inactive: t("tooltip.microphone.inactive")
|
|
1421
|
+
}
|
|
1422
|
+
},
|
|
1423
|
+
send: {
|
|
1424
|
+
tooltipContent: t("tooltip.send")
|
|
1425
|
+
}
|
|
1426
|
+
},
|
|
1427
|
+
additionalActions: isFullscreenMode ? /* @__PURE__ */ jsx(
|
|
1428
|
+
MessageBarModelSelector,
|
|
1429
|
+
{
|
|
1430
|
+
selectedModel,
|
|
1431
|
+
models,
|
|
1432
|
+
onSelect: (item) => {
|
|
1433
|
+
setIsMcpSettingsOpen(false);
|
|
1434
|
+
onNewChat();
|
|
1435
|
+
handleSelectedModel(item);
|
|
1436
|
+
},
|
|
1437
|
+
disabled: isSendButtonDisabled
|
|
1438
|
+
}
|
|
1439
|
+
) : void 0,
|
|
1440
|
+
forceMultilineLayout: isFullscreenMode,
|
|
1441
|
+
allowedFileTypes: supportedFileTypes,
|
|
1442
|
+
onAttachRejected,
|
|
1443
|
+
placeholder: t("chatbox.message.placeholder")
|
|
1302
1444
|
},
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
placeholder: t("chatbox.message.placeholder")
|
|
1310
|
-
},
|
|
1311
|
-
messageBarKey
|
|
1312
|
-
),
|
|
1313
|
-
/* @__PURE__ */ jsx(ChatbotFootnote, { ...getFootnoteProps(t) })
|
|
1314
|
-
] })
|
|
1445
|
+
messageBarKey
|
|
1446
|
+
),
|
|
1447
|
+
/* @__PURE__ */ jsx(ChatbotFootnote, { ...getFootnoteProps(t) })
|
|
1448
|
+
]
|
|
1449
|
+
}
|
|
1450
|
+
)
|
|
1315
1451
|
] });
|
|
1316
1452
|
const mcpSettingsPanel = /* @__PURE__ */ jsx(
|
|
1317
1453
|
McpServersSettings,
|
|
@@ -1349,6 +1485,8 @@ const LightspeedChat = ({
|
|
|
1349
1485
|
drawerPanelStyle = { zIndex: 1300 };
|
|
1350
1486
|
} else if (isMcpSettingsOpen) {
|
|
1351
1487
|
drawerPanelStyle = { width: 320, minWidth: 320, maxWidth: 320 };
|
|
1488
|
+
} else {
|
|
1489
|
+
drawerPanelStyle = { minWidth: 232, maxWidth: 400 };
|
|
1352
1490
|
}
|
|
1353
1491
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1354
1492
|
notebookAlerts.length > 0 && /* @__PURE__ */ jsx(
|
|
@@ -1423,7 +1561,7 @@ const LightspeedChat = ({
|
|
|
1423
1561
|
children: [
|
|
1424
1562
|
/* @__PURE__ */ jsxs(ChatbotHeader, { className: classes.header, children: [
|
|
1425
1563
|
/* @__PURE__ */ jsxs(ChatbotHeaderMain, { children: [
|
|
1426
|
-
showChatPanel && /* @__PURE__ */ jsx(
|
|
1564
|
+
showChatPanel && !isFullscreenMode && /* @__PURE__ */ jsx(
|
|
1427
1565
|
ChatbotHeaderMenu,
|
|
1428
1566
|
{
|
|
1429
1567
|
"aria-expanded": isChatHistoryDrawerOpen,
|
|
@@ -1433,7 +1571,17 @@ const LightspeedChat = ({
|
|
|
1433
1571
|
"aria-label": t("aria.chatHistoryMenu")
|
|
1434
1572
|
}
|
|
1435
1573
|
),
|
|
1436
|
-
isFullscreenMode && /* @__PURE__ */
|
|
1574
|
+
isFullscreenMode && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1575
|
+
/* @__PURE__ */ jsx(
|
|
1576
|
+
"img",
|
|
1577
|
+
{
|
|
1578
|
+
src: logo,
|
|
1579
|
+
alt: t("icon.lightspeed.alt"),
|
|
1580
|
+
className: classes.headerLogo
|
|
1581
|
+
}
|
|
1582
|
+
),
|
|
1583
|
+
/* @__PURE__ */ jsx(ChatbotHeaderTitle, { className: classes.headerTitle, children: /* @__PURE__ */ jsx(Title, { headingLevel: "h1", size: "3xl", children: t("chatbox.header.title") }) })
|
|
1584
|
+
] })
|
|
1437
1585
|
] }),
|
|
1438
1586
|
/* @__PURE__ */ jsx(
|
|
1439
1587
|
LightspeedChatBoxHeader,
|
|
@@ -1447,7 +1595,7 @@ const LightspeedChat = ({
|
|
|
1447
1595
|
models,
|
|
1448
1596
|
isPinningChatsEnabled,
|
|
1449
1597
|
isModelSelectorDisabled: isSendButtonDisabled,
|
|
1450
|
-
hideModelSelector: showNotebooksPanel,
|
|
1598
|
+
hideModelSelector: showNotebooksPanel || isFullscreenMode,
|
|
1451
1599
|
showChatTabOptions: !showNotebooksPanel,
|
|
1452
1600
|
setDisplayMode: setDisplayModeFromHeader,
|
|
1453
1601
|
displayMode,
|
|
@@ -1456,6 +1604,7 @@ const LightspeedChat = ({
|
|
|
1456
1604
|
}
|
|
1457
1605
|
)
|
|
1458
1606
|
] }),
|
|
1607
|
+
isFullscreenMode && /* @__PURE__ */ jsx("div", { className: classes.headerDivider }),
|
|
1459
1608
|
isFullscreenMode && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1460
1609
|
/* @__PURE__ */ jsxs(
|
|
1461
1610
|
Tabs,
|
|
@@ -1473,69 +1622,86 @@ const LightspeedChat = ({
|
|
|
1473
1622
|
/* @__PURE__ */ jsx("div", { className: classes.tabsDivider })
|
|
1474
1623
|
] }),
|
|
1475
1624
|
showChatPanel && /* @__PURE__ */ jsx(
|
|
1476
|
-
|
|
1625
|
+
ConditionalWrapper,
|
|
1477
1626
|
{
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
setIsDrawerOpen: setIsChatHistoryDrawerOpen,
|
|
1493
|
-
activeItemId: viewConversationId,
|
|
1494
|
-
onSelectActiveItem,
|
|
1495
|
-
conversations: filterConversations(filterValue),
|
|
1496
|
-
onNewChat: newChatCreated ? void 0 : onNewChat,
|
|
1497
|
-
newChatButtonText: t("button.newChat"),
|
|
1498
|
-
newChatButtonProps: {
|
|
1499
|
-
icon: /* @__PURE__ */ jsx(PlusIcon, {})
|
|
1500
|
-
},
|
|
1501
|
-
handleTextInputChange: handleFilter,
|
|
1502
|
-
searchInputPlaceholder: t("chatbox.search.placeholder"),
|
|
1503
|
-
searchInputAriaLabel: t("aria.search.placeholder"),
|
|
1504
|
-
searchInputProps: {
|
|
1505
|
-
value: filterValue,
|
|
1506
|
-
onClear: () => {
|
|
1507
|
-
setFilterValue("");
|
|
1508
|
-
}
|
|
1509
|
-
},
|
|
1510
|
-
searchActionEnd: sortDropdown,
|
|
1511
|
-
noResultsState: filterValue && Object.keys(filterConversations(filterValue)).length === 0 ? {
|
|
1512
|
-
bodyText: t("chatbox.emptyState.noResults.body"),
|
|
1513
|
-
titleText: t("chatbox.emptyState.noResults.title"),
|
|
1514
|
-
icon: SearchIcon
|
|
1515
|
-
} : void 0,
|
|
1516
|
-
drawerContent: /* @__PURE__ */ jsxs(
|
|
1517
|
-
FileDropZone,
|
|
1627
|
+
condition: isFullscreenMode,
|
|
1628
|
+
wrapper: (children) => /* @__PURE__ */ jsxs("div", { className: classes.fullscreenChatLayout, children: [
|
|
1629
|
+
!isChatHistoryDrawerOpen && /* @__PURE__ */ jsx(
|
|
1630
|
+
CollapsedHistoryStrip,
|
|
1631
|
+
{
|
|
1632
|
+
onExpand: () => setIsChatHistoryDrawerOpen(true),
|
|
1633
|
+
onNewChat,
|
|
1634
|
+
newChatDisabled: newChatCreated
|
|
1635
|
+
}
|
|
1636
|
+
),
|
|
1637
|
+
children
|
|
1638
|
+
] }),
|
|
1639
|
+
children: /* @__PURE__ */ jsx(
|
|
1640
|
+
ChatbotConversationHistoryNav,
|
|
1518
1641
|
{
|
|
1519
|
-
|
|
1520
|
-
|
|
1642
|
+
drawerPanelContentProps: {
|
|
1643
|
+
isResizable: isFullscreenMode,
|
|
1644
|
+
hasNoBorder: !isFullscreenMode,
|
|
1645
|
+
style: drawerPanelStyle
|
|
1646
|
+
},
|
|
1647
|
+
reverseButtonOrder: true,
|
|
1521
1648
|
displayMode: ChatbotDisplayMode.embedded,
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
) })
|
|
1537
|
-
|
|
1538
|
-
|
|
1649
|
+
onDrawerToggle: onChatHistoryDrawerToggle,
|
|
1650
|
+
title: "",
|
|
1651
|
+
navTitleIcon: null,
|
|
1652
|
+
isDrawerOpen: isChatHistoryDrawerOpen,
|
|
1653
|
+
drawerCloseButtonProps: {
|
|
1654
|
+
"aria-label": t("aria.closeDrawerPanel")
|
|
1655
|
+
},
|
|
1656
|
+
setIsDrawerOpen: setIsChatHistoryDrawerOpen,
|
|
1657
|
+
activeItemId: viewConversationId,
|
|
1658
|
+
onSelectActiveItem,
|
|
1659
|
+
conversations: filterConversations(filterValue),
|
|
1660
|
+
onNewChat: newChatCreated ? void 0 : onNewChat,
|
|
1661
|
+
newChatButtonText: t("button.newChat"),
|
|
1662
|
+
newChatButtonProps: {
|
|
1663
|
+
icon: isFullscreenMode ? /* @__PURE__ */ jsx(EditSquareIcon, {}) : /* @__PURE__ */ jsx(PlusIcon, {})
|
|
1664
|
+
},
|
|
1665
|
+
handleTextInputChange: handleFilter,
|
|
1666
|
+
searchInputPlaceholder: t("chatbox.search.placeholder"),
|
|
1667
|
+
searchInputAriaLabel: t("aria.search.placeholder"),
|
|
1668
|
+
searchInputProps: {
|
|
1669
|
+
value: filterValue,
|
|
1670
|
+
onClear: () => {
|
|
1671
|
+
setFilterValue("");
|
|
1672
|
+
}
|
|
1673
|
+
},
|
|
1674
|
+
searchActionEnd: sortDropdown,
|
|
1675
|
+
noResultsState: filterValue && Object.keys(filterConversations(filterValue)).length === 0 ? {
|
|
1676
|
+
bodyText: t("chatbox.emptyState.noResults.body"),
|
|
1677
|
+
titleText: t("chatbox.emptyState.noResults.title"),
|
|
1678
|
+
icon: SearchIcon
|
|
1679
|
+
} : void 0,
|
|
1680
|
+
drawerContent: /* @__PURE__ */ jsxs(
|
|
1681
|
+
FileDropZone,
|
|
1682
|
+
{
|
|
1683
|
+
className: classes.drawerFileDropZone,
|
|
1684
|
+
onFileDrop: (e, data) => handleAttach(data, e),
|
|
1685
|
+
displayMode: ChatbotDisplayMode.embedded,
|
|
1686
|
+
infoText: t("chatbox.fileUpload.infoText"),
|
|
1687
|
+
allowedFileTypes: supportedFileTypes,
|
|
1688
|
+
onAttachRejected,
|
|
1689
|
+
children: [
|
|
1690
|
+
showAlert && uploadError.message && /* @__PURE__ */ jsx("div", { className: classes.errorContainer, children: /* @__PURE__ */ jsx(
|
|
1691
|
+
ChatbotAlert,
|
|
1692
|
+
{
|
|
1693
|
+
component: "h4",
|
|
1694
|
+
title: t("chatbox.fileUpload.failed"),
|
|
1695
|
+
variant: uploadError.type ?? "danger",
|
|
1696
|
+
isInline: true,
|
|
1697
|
+
onClose: () => setUploadError({ message: null }),
|
|
1698
|
+
children: uploadError.message
|
|
1699
|
+
}
|
|
1700
|
+
) }),
|
|
1701
|
+
mainPanelContent
|
|
1702
|
+
]
|
|
1703
|
+
}
|
|
1704
|
+
)
|
|
1539
1705
|
}
|
|
1540
1706
|
)
|
|
1541
1707
|
}
|