@red-hat-developer-hub/backstage-plugin-lightspeed 2.6.8 → 2.7.1
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 +23 -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 +274 -107
- 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/hooks/useAllModels.esm.js +2 -1
- package/dist/hooks/useAllModels.esm.js.map +1 -1
- 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,10 +50,17 @@ 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
|
|
53
|
-
|
|
62
|
+
// lists excluded for proper formatting
|
|
63
|
+
"& h1, & h2, & h3, & h4, & h5, & h6, & p, & li": {
|
|
54
64
|
margin: 0,
|
|
55
65
|
padding: 0
|
|
56
66
|
}
|
|
@@ -58,7 +68,8 @@ const useStyles = makeStyles((theme) => ({
|
|
|
58
68
|
header: {
|
|
59
69
|
padding: `${theme.spacing(3)}px ${theme.spacing(3)}px 0 ${theme.spacing(
|
|
60
70
|
3
|
|
61
|
-
)}px !important
|
|
71
|
+
)}px !important`,
|
|
72
|
+
backgroundColor: "var(--pf-t--global--background--color--floating--default) !important"
|
|
62
73
|
},
|
|
63
74
|
errorContainer: {
|
|
64
75
|
padding: theme.spacing(3)
|
|
@@ -68,7 +79,9 @@ const useStyles = makeStyles((theme) => ({
|
|
|
68
79
|
rowGap: 0,
|
|
69
80
|
columnGap: 0,
|
|
70
81
|
"--pf-v6-c-multiple-file-upload--Gap": "0",
|
|
71
|
-
"--pf-v5-c-multiple-file-upload--Gap": "0"
|
|
82
|
+
"--pf-v5-c-multiple-file-upload--Gap": "0",
|
|
83
|
+
flex: 1,
|
|
84
|
+
minWidth: 0
|
|
72
85
|
},
|
|
73
86
|
headerMenu: {
|
|
74
87
|
// align hamburger icon with title
|
|
@@ -77,11 +90,23 @@ const useStyles = makeStyles((theme) => ({
|
|
|
77
90
|
alignItems: "center"
|
|
78
91
|
}
|
|
79
92
|
},
|
|
93
|
+
headerLogo: {
|
|
94
|
+
width: 48,
|
|
95
|
+
height: 48,
|
|
96
|
+
marginRight: theme.spacing(1.5),
|
|
97
|
+
flexShrink: 0
|
|
98
|
+
},
|
|
80
99
|
headerTitle: {
|
|
81
|
-
justifyContent: "left !important"
|
|
100
|
+
justifyContent: "left !important",
|
|
101
|
+
"& h1": {
|
|
102
|
+
fontSize: "32px !important",
|
|
103
|
+
fontWeight: "700 !important",
|
|
104
|
+
lineHeight: "36.4px !important",
|
|
105
|
+
fontFamily: '"Red Hat Display", sans-serif !important'
|
|
106
|
+
}
|
|
82
107
|
},
|
|
83
108
|
tabs: {
|
|
84
|
-
padding:
|
|
109
|
+
padding: `0 ${theme.spacing(2)}px`,
|
|
85
110
|
backgroundColor: "var(--pf-t--global--background--color--floating--default)",
|
|
86
111
|
"& .pf-v6-c-tabs__item, & .pf-v5-c-tabs__item": {
|
|
87
112
|
backgroundColor: "transparent"
|
|
@@ -103,6 +128,11 @@ const useStyles = makeStyles((theme) => ({
|
|
|
103
128
|
tabsDivider: {
|
|
104
129
|
borderTop: "1px solid var(--pf-t--global--border--color--default)"
|
|
105
130
|
},
|
|
131
|
+
headerDivider: {
|
|
132
|
+
paddingTop: 8,
|
|
133
|
+
borderBottom: "1px solid var(--pf-t--global--border--color--default)",
|
|
134
|
+
backgroundColor: "var(--pf-t--global--background--color--floating--default)"
|
|
135
|
+
},
|
|
106
136
|
notebooksContainer: {
|
|
107
137
|
padding: theme.spacing(3),
|
|
108
138
|
height: "100%",
|
|
@@ -249,6 +279,23 @@ const useStyles = makeStyles((theme) => ({
|
|
|
249
279
|
backgroundColor: theme.palette.grey[300]
|
|
250
280
|
}
|
|
251
281
|
},
|
|
282
|
+
fullscreenFooter: {
|
|
283
|
+
"&>.pf-chatbot__footer-container": {
|
|
284
|
+
width: "100% !important",
|
|
285
|
+
padding: theme.spacing(1.5),
|
|
286
|
+
maxWidth: "unset !important",
|
|
287
|
+
margin: "0 auto"
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
fullscreenMessageBar: {
|
|
291
|
+
backgroundColor: "var(--pf-t--global--background--color--secondary--default)",
|
|
292
|
+
border: "1px solid var(--pf-t--global--border--color--default)",
|
|
293
|
+
borderRadius: 24,
|
|
294
|
+
padding: theme.spacing(0.5),
|
|
295
|
+
"&::after": {
|
|
296
|
+
display: "none"
|
|
297
|
+
}
|
|
298
|
+
},
|
|
252
299
|
sortDropdown: {
|
|
253
300
|
padding: 0,
|
|
254
301
|
margin: 0
|
|
@@ -354,7 +401,10 @@ const useStyles = makeStyles((theme) => ({
|
|
|
354
401
|
flexDirection: "column",
|
|
355
402
|
minHeight: 0,
|
|
356
403
|
width: "100%",
|
|
357
|
-
minWidth: 0
|
|
404
|
+
minWidth: 0,
|
|
405
|
+
whiteSpace: "normal",
|
|
406
|
+
wordBreak: "break-word",
|
|
407
|
+
overflowWrap: "break-word"
|
|
358
408
|
},
|
|
359
409
|
mcpSettingsPane: {
|
|
360
410
|
width: "100%",
|
|
@@ -363,7 +413,8 @@ const useStyles = makeStyles((theme) => ({
|
|
|
363
413
|
backgroundColor: "var(--pf-v6-c-table--BackgroundColor, var(--pf-t--global--background--color--primary--default))",
|
|
364
414
|
display: "flex",
|
|
365
415
|
flexDirection: "column",
|
|
366
|
-
minHeight: 0
|
|
416
|
+
minHeight: 0,
|
|
417
|
+
overflow: "auto"
|
|
367
418
|
},
|
|
368
419
|
mcpCollapsedDrawerOrderFix: {
|
|
369
420
|
"& .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 +425,68 @@ const useStyles = makeStyles((theme) => ({
|
|
|
374
425
|
opacity: 0,
|
|
375
426
|
transition: "none !important"
|
|
376
427
|
}
|
|
428
|
+
},
|
|
429
|
+
// TODO: These PatternFly drawer overrides are needed because PF Chatbot doesn't
|
|
430
|
+
// provide clean APIs for custom expand/collapse icons and positioning.
|
|
431
|
+
// Remove once PatternFly supports these features.
|
|
432
|
+
// See: https://github.com/patternfly/chatbot/issues/834
|
|
433
|
+
fullscreenChatLayout: {
|
|
434
|
+
display: "flex",
|
|
435
|
+
flexDirection: "row",
|
|
436
|
+
flex: 1,
|
|
437
|
+
minHeight: 0,
|
|
438
|
+
height: "100%",
|
|
439
|
+
width: "100%",
|
|
440
|
+
"& .pf-v6-c-drawer, & .pf-v5-c-drawer": {
|
|
441
|
+
flex: 1,
|
|
442
|
+
minWidth: 0
|
|
443
|
+
},
|
|
444
|
+
"& .pf-v6-c-drawer__content, & .pf-v5-c-drawer__content": {
|
|
445
|
+
flex: 1,
|
|
446
|
+
minWidth: 0
|
|
447
|
+
},
|
|
448
|
+
"& .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": {
|
|
449
|
+
display: "none"
|
|
450
|
+
},
|
|
451
|
+
"& .pf-v6-c-drawer__close, & .pf-v5-c-drawer__close": {
|
|
452
|
+
marginTop: -48,
|
|
453
|
+
marginRight: -24
|
|
454
|
+
},
|
|
455
|
+
"& .pf-v6-c-drawer__close .pf-v6-c-button svg, & .pf-v5-c-drawer__close .pf-v5-c-button svg": {
|
|
456
|
+
display: "none"
|
|
457
|
+
},
|
|
458
|
+
"& .pf-v6-c-drawer__close .pf-v6-c-button, & .pf-v5-c-drawer__close .pf-v5-c-button": {
|
|
459
|
+
display: "flex",
|
|
460
|
+
alignItems: "center",
|
|
461
|
+
justifyContent: "center",
|
|
462
|
+
"&::before": {
|
|
463
|
+
content: '""',
|
|
464
|
+
display: "block",
|
|
465
|
+
width: 24,
|
|
466
|
+
height: 24,
|
|
467
|
+
mask: COLLAPSE_PANEL_ICON_SVG,
|
|
468
|
+
WebkitMask: COLLAPSE_PANEL_ICON_SVG,
|
|
469
|
+
backgroundColor: "currentColor"
|
|
470
|
+
}
|
|
471
|
+
},
|
|
472
|
+
"& .pf-chatbot__menu-item": {
|
|
473
|
+
cursor: "pointer"
|
|
474
|
+
},
|
|
475
|
+
"& .pf-chatbot__menu-item .pf-v6-c-menu-toggle, & .pf-chatbot__menu-item .pf-v5-c-menu-toggle": {
|
|
476
|
+
opacity: 0,
|
|
477
|
+
transition: "opacity 0.15s ease-in-out"
|
|
478
|
+
},
|
|
479
|
+
"& .pf-chatbot__menu-item:hover .pf-v6-c-menu-toggle, & .pf-chatbot__menu-item:hover .pf-v5-c-menu-toggle": {
|
|
480
|
+
opacity: 1
|
|
481
|
+
}
|
|
482
|
+
},
|
|
483
|
+
fullscreenMainContent: {
|
|
484
|
+
display: "flex",
|
|
485
|
+
flexDirection: "column",
|
|
486
|
+
flex: 1,
|
|
487
|
+
minHeight: 0,
|
|
488
|
+
minWidth: 0,
|
|
489
|
+
overflow: "hidden"
|
|
377
490
|
}
|
|
378
491
|
}));
|
|
379
492
|
const LightspeedChat = ({
|
|
@@ -1275,43 +1388,67 @@ const LightspeedChat = ({
|
|
|
1275
1388
|
)
|
|
1276
1389
|
}
|
|
1277
1390
|
),
|
|
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
|
-
|
|
1391
|
+
/* @__PURE__ */ jsxs(
|
|
1392
|
+
ChatbotFooter,
|
|
1393
|
+
{
|
|
1394
|
+
className: isFullscreenMode ? `${classes.footer} ${classes.fullscreenFooter}` : classes.footer,
|
|
1395
|
+
children: [
|
|
1396
|
+
/* @__PURE__ */ jsx(FilePreview, {}),
|
|
1397
|
+
/* @__PURE__ */ jsx(
|
|
1398
|
+
MessageBar,
|
|
1399
|
+
{
|
|
1400
|
+
className: isFullscreenMode ? classes.fullscreenMessageBar : void 0,
|
|
1401
|
+
onSendMessage: sendMessage,
|
|
1402
|
+
isSendButtonDisabled,
|
|
1403
|
+
hasAttachButton: true,
|
|
1404
|
+
attachButtonPosition: isFullscreenMode ? "start" : void 0,
|
|
1405
|
+
handleAttach,
|
|
1406
|
+
hasMicrophoneButton: true,
|
|
1407
|
+
value: draftMessage,
|
|
1408
|
+
onChange: handleDraftMessage,
|
|
1409
|
+
hasStopButton: streamingUiMatchesView,
|
|
1410
|
+
handleStopButton: streamingUiMatchesView ? handleStopButton : void 0,
|
|
1411
|
+
buttonProps: {
|
|
1412
|
+
attach: {
|
|
1413
|
+
inputTestId: "attachment-input",
|
|
1414
|
+
tooltipContent: t("tooltip.attach"),
|
|
1415
|
+
"aria-label": t("tooltip.attach"),
|
|
1416
|
+
...isFullscreenMode && { icon: /* @__PURE__ */ jsx(PlusIcon, {}) }
|
|
1417
|
+
},
|
|
1418
|
+
microphone: {
|
|
1419
|
+
tooltipContent: {
|
|
1420
|
+
active: t("tooltip.microphone.active"),
|
|
1421
|
+
inactive: t("tooltip.microphone.inactive")
|
|
1422
|
+
}
|
|
1423
|
+
},
|
|
1424
|
+
send: {
|
|
1425
|
+
tooltipContent: t("tooltip.send")
|
|
1426
|
+
}
|
|
1427
|
+
},
|
|
1428
|
+
additionalActions: isFullscreenMode ? /* @__PURE__ */ jsx(
|
|
1429
|
+
MessageBarModelSelector,
|
|
1430
|
+
{
|
|
1431
|
+
selectedModel,
|
|
1432
|
+
models,
|
|
1433
|
+
onSelect: (item) => {
|
|
1434
|
+
setIsMcpSettingsOpen(false);
|
|
1435
|
+
onNewChat();
|
|
1436
|
+
handleSelectedModel(item);
|
|
1437
|
+
},
|
|
1438
|
+
disabled: isSendButtonDisabled
|
|
1439
|
+
}
|
|
1440
|
+
) : void 0,
|
|
1441
|
+
forceMultilineLayout: isFullscreenMode,
|
|
1442
|
+
allowedFileTypes: supportedFileTypes,
|
|
1443
|
+
onAttachRejected,
|
|
1444
|
+
placeholder: t("chatbox.message.placeholder")
|
|
1302
1445
|
},
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
placeholder: t("chatbox.message.placeholder")
|
|
1310
|
-
},
|
|
1311
|
-
messageBarKey
|
|
1312
|
-
),
|
|
1313
|
-
/* @__PURE__ */ jsx(ChatbotFootnote, { ...getFootnoteProps(t) })
|
|
1314
|
-
] })
|
|
1446
|
+
messageBarKey
|
|
1447
|
+
),
|
|
1448
|
+
/* @__PURE__ */ jsx(ChatbotFootnote, { ...getFootnoteProps(t) })
|
|
1449
|
+
]
|
|
1450
|
+
}
|
|
1451
|
+
)
|
|
1315
1452
|
] });
|
|
1316
1453
|
const mcpSettingsPanel = /* @__PURE__ */ jsx(
|
|
1317
1454
|
McpServersSettings,
|
|
@@ -1349,6 +1486,8 @@ const LightspeedChat = ({
|
|
|
1349
1486
|
drawerPanelStyle = { zIndex: 1300 };
|
|
1350
1487
|
} else if (isMcpSettingsOpen) {
|
|
1351
1488
|
drawerPanelStyle = { width: 320, minWidth: 320, maxWidth: 320 };
|
|
1489
|
+
} else {
|
|
1490
|
+
drawerPanelStyle = { minWidth: 232, maxWidth: 400 };
|
|
1352
1491
|
}
|
|
1353
1492
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1354
1493
|
notebookAlerts.length > 0 && /* @__PURE__ */ jsx(
|
|
@@ -1423,7 +1562,7 @@ const LightspeedChat = ({
|
|
|
1423
1562
|
children: [
|
|
1424
1563
|
/* @__PURE__ */ jsxs(ChatbotHeader, { className: classes.header, children: [
|
|
1425
1564
|
/* @__PURE__ */ jsxs(ChatbotHeaderMain, { children: [
|
|
1426
|
-
showChatPanel && /* @__PURE__ */ jsx(
|
|
1565
|
+
showChatPanel && !isFullscreenMode && /* @__PURE__ */ jsx(
|
|
1427
1566
|
ChatbotHeaderMenu,
|
|
1428
1567
|
{
|
|
1429
1568
|
"aria-expanded": isChatHistoryDrawerOpen,
|
|
@@ -1433,7 +1572,17 @@ const LightspeedChat = ({
|
|
|
1433
1572
|
"aria-label": t("aria.chatHistoryMenu")
|
|
1434
1573
|
}
|
|
1435
1574
|
),
|
|
1436
|
-
isFullscreenMode && /* @__PURE__ */
|
|
1575
|
+
isFullscreenMode && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1576
|
+
/* @__PURE__ */ jsx(
|
|
1577
|
+
"img",
|
|
1578
|
+
{
|
|
1579
|
+
src: logo,
|
|
1580
|
+
alt: t("icon.lightspeed.alt"),
|
|
1581
|
+
className: classes.headerLogo
|
|
1582
|
+
}
|
|
1583
|
+
),
|
|
1584
|
+
/* @__PURE__ */ jsx(ChatbotHeaderTitle, { className: classes.headerTitle, children: /* @__PURE__ */ jsx(Title, { headingLevel: "h1", size: "3xl", children: t("chatbox.header.title") }) })
|
|
1585
|
+
] })
|
|
1437
1586
|
] }),
|
|
1438
1587
|
/* @__PURE__ */ jsx(
|
|
1439
1588
|
LightspeedChatBoxHeader,
|
|
@@ -1447,7 +1596,7 @@ const LightspeedChat = ({
|
|
|
1447
1596
|
models,
|
|
1448
1597
|
isPinningChatsEnabled,
|
|
1449
1598
|
isModelSelectorDisabled: isSendButtonDisabled,
|
|
1450
|
-
hideModelSelector: showNotebooksPanel,
|
|
1599
|
+
hideModelSelector: showNotebooksPanel || isFullscreenMode,
|
|
1451
1600
|
showChatTabOptions: !showNotebooksPanel,
|
|
1452
1601
|
setDisplayMode: setDisplayModeFromHeader,
|
|
1453
1602
|
displayMode,
|
|
@@ -1456,6 +1605,7 @@ const LightspeedChat = ({
|
|
|
1456
1605
|
}
|
|
1457
1606
|
)
|
|
1458
1607
|
] }),
|
|
1608
|
+
isFullscreenMode && /* @__PURE__ */ jsx("div", { className: classes.headerDivider }),
|
|
1459
1609
|
isFullscreenMode && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1460
1610
|
/* @__PURE__ */ jsxs(
|
|
1461
1611
|
Tabs,
|
|
@@ -1473,69 +1623,86 @@ const LightspeedChat = ({
|
|
|
1473
1623
|
/* @__PURE__ */ jsx("div", { className: classes.tabsDivider })
|
|
1474
1624
|
] }),
|
|
1475
1625
|
showChatPanel && /* @__PURE__ */ jsx(
|
|
1476
|
-
|
|
1626
|
+
ConditionalWrapper,
|
|
1477
1627
|
{
|
|
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,
|
|
1628
|
+
condition: isFullscreenMode,
|
|
1629
|
+
wrapper: (children) => /* @__PURE__ */ jsxs("div", { className: classes.fullscreenChatLayout, children: [
|
|
1630
|
+
!isChatHistoryDrawerOpen && /* @__PURE__ */ jsx(
|
|
1631
|
+
CollapsedHistoryStrip,
|
|
1632
|
+
{
|
|
1633
|
+
onExpand: () => setIsChatHistoryDrawerOpen(true),
|
|
1634
|
+
onNewChat,
|
|
1635
|
+
newChatDisabled: newChatCreated
|
|
1636
|
+
}
|
|
1637
|
+
),
|
|
1638
|
+
children
|
|
1639
|
+
] }),
|
|
1640
|
+
children: /* @__PURE__ */ jsx(
|
|
1641
|
+
ChatbotConversationHistoryNav,
|
|
1518
1642
|
{
|
|
1519
|
-
|
|
1520
|
-
|
|
1643
|
+
drawerPanelContentProps: {
|
|
1644
|
+
isResizable: isFullscreenMode,
|
|
1645
|
+
hasNoBorder: !isFullscreenMode,
|
|
1646
|
+
style: drawerPanelStyle
|
|
1647
|
+
},
|
|
1648
|
+
reverseButtonOrder: true,
|
|
1521
1649
|
displayMode: ChatbotDisplayMode.embedded,
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
) })
|
|
1537
|
-
|
|
1538
|
-
|
|
1650
|
+
onDrawerToggle: onChatHistoryDrawerToggle,
|
|
1651
|
+
title: "",
|
|
1652
|
+
navTitleIcon: null,
|
|
1653
|
+
isDrawerOpen: isChatHistoryDrawerOpen,
|
|
1654
|
+
drawerCloseButtonProps: {
|
|
1655
|
+
"aria-label": t("aria.closeDrawerPanel")
|
|
1656
|
+
},
|
|
1657
|
+
setIsDrawerOpen: setIsChatHistoryDrawerOpen,
|
|
1658
|
+
activeItemId: viewConversationId,
|
|
1659
|
+
onSelectActiveItem,
|
|
1660
|
+
conversations: filterConversations(filterValue),
|
|
1661
|
+
onNewChat: newChatCreated ? void 0 : onNewChat,
|
|
1662
|
+
newChatButtonText: t("button.newChat"),
|
|
1663
|
+
newChatButtonProps: {
|
|
1664
|
+
icon: isFullscreenMode ? /* @__PURE__ */ jsx(EditSquareIcon, {}) : /* @__PURE__ */ jsx(PlusIcon, {})
|
|
1665
|
+
},
|
|
1666
|
+
handleTextInputChange: handleFilter,
|
|
1667
|
+
searchInputPlaceholder: t("chatbox.search.placeholder"),
|
|
1668
|
+
searchInputAriaLabel: t("aria.search.placeholder"),
|
|
1669
|
+
searchInputProps: {
|
|
1670
|
+
value: filterValue,
|
|
1671
|
+
onClear: () => {
|
|
1672
|
+
setFilterValue("");
|
|
1673
|
+
}
|
|
1674
|
+
},
|
|
1675
|
+
searchActionEnd: sortDropdown,
|
|
1676
|
+
noResultsState: filterValue && Object.keys(filterConversations(filterValue)).length === 0 ? {
|
|
1677
|
+
bodyText: t("chatbox.emptyState.noResults.body"),
|
|
1678
|
+
titleText: t("chatbox.emptyState.noResults.title"),
|
|
1679
|
+
icon: SearchIcon
|
|
1680
|
+
} : void 0,
|
|
1681
|
+
drawerContent: /* @__PURE__ */ jsxs(
|
|
1682
|
+
FileDropZone,
|
|
1683
|
+
{
|
|
1684
|
+
className: classes.drawerFileDropZone,
|
|
1685
|
+
onFileDrop: (e, data) => handleAttach(data, e),
|
|
1686
|
+
displayMode: ChatbotDisplayMode.embedded,
|
|
1687
|
+
infoText: t("chatbox.fileUpload.infoText"),
|
|
1688
|
+
allowedFileTypes: supportedFileTypes,
|
|
1689
|
+
onAttachRejected,
|
|
1690
|
+
children: [
|
|
1691
|
+
showAlert && uploadError.message && /* @__PURE__ */ jsx("div", { className: classes.errorContainer, children: /* @__PURE__ */ jsx(
|
|
1692
|
+
ChatbotAlert,
|
|
1693
|
+
{
|
|
1694
|
+
component: "h4",
|
|
1695
|
+
title: t("chatbox.fileUpload.failed"),
|
|
1696
|
+
variant: uploadError.type ?? "danger",
|
|
1697
|
+
isInline: true,
|
|
1698
|
+
onClose: () => setUploadError({ message: null }),
|
|
1699
|
+
children: uploadError.message
|
|
1700
|
+
}
|
|
1701
|
+
) }),
|
|
1702
|
+
mainPanelContent
|
|
1703
|
+
]
|
|
1704
|
+
}
|
|
1705
|
+
)
|
|
1539
1706
|
}
|
|
1540
1707
|
)
|
|
1541
1708
|
}
|