impact-ui 5.0.4-alpha.3 → 5.0.4-chatbot.2
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/_virtual/ArrowBack.js +4 -0
- package/dist/_virtual/AttachFileOutlined.js +4 -0
- package/dist/_virtual/ContentCopyOutlined.js +4 -0
- package/dist/_virtual/Menu.js +4 -0
- package/dist/_virtual/NorthRounded.js +4 -0
- package/dist/_virtual/RefreshOutlined.js +4 -0
- package/dist/_virtual/StopRounded.js +4 -0
- package/dist/_virtual/VolumeUpOutlined.js +4 -0
- package/dist/_virtual/index2.js +2 -2
- package/dist/_virtual/index3.js +2 -2
- package/dist/components/AccordionModern/index.js +1 -1
- package/dist/components/Badge/index.js +1 -1
- package/dist/components/Breadcrumbs/index.js +1 -1
- package/dist/components/Button/index.js +1 -1
- package/dist/components/ButtonGroup/index.js +1 -1
- package/dist/components/Chatbot/Chatbot.types.d.ts +253 -186
- package/dist/components/Chatbot/Chatbot.types.d.ts.map +1 -1
- package/dist/components/Chatbot/chatBotFooter.d.ts +1 -1
- package/dist/components/Chatbot/chatBotFooter.d.ts.map +1 -1
- package/dist/components/Chatbot/chatBotFooter.js +21 -4
- package/dist/components/Chatbot/chatbotComposer.d.ts +4 -0
- package/dist/components/Chatbot/chatbotComposer.d.ts.map +1 -0
- package/dist/components/Chatbot/chatbotComposer.js +328 -0
- package/dist/components/Chatbot/chatbotGreetingHeader.d.ts +4 -0
- package/dist/components/Chatbot/chatbotGreetingHeader.d.ts.map +1 -0
- package/dist/components/Chatbot/chatbotGreetingHeader.js +226 -0
- package/dist/components/Chatbot/greetingWeather.d.ts +23 -0
- package/dist/components/Chatbot/greetingWeather.d.ts.map +1 -0
- package/dist/components/Chatbot/greetingWeather.js +81 -0
- package/dist/components/Chatbot/greetingWeather.test.d.ts +2 -0
- package/dist/components/Chatbot/greetingWeather.test.d.ts.map +1 -0
- package/dist/components/Chatbot/index.d.ts +5 -2
- package/dist/components/Chatbot/index.d.ts.map +1 -1
- package/dist/components/Chatbot/index.js +390 -421
- package/dist/components/Chatbot/irisConversationThread.d.ts +24 -0
- package/dist/components/Chatbot/irisConversationThread.d.ts.map +1 -0
- package/dist/components/Chatbot/irisConversationThread.js +511 -0
- package/dist/components/Chatbot/irisGreetingBackdrop.d.ts +5 -0
- package/dist/components/Chatbot/irisGreetingBackdrop.d.ts.map +1 -0
- package/dist/components/Chatbot/irisGreetingBackdrop.js +62 -0
- package/dist/components/Chatbot/irisMenuListItem.d.ts +11 -0
- package/dist/components/Chatbot/irisMenuListItem.d.ts.map +1 -0
- package/dist/components/Chatbot/irisMenuListItem.js +126 -0
- package/dist/components/Chatbot/irisMenuScreen.d.ts +4 -0
- package/dist/components/Chatbot/irisMenuScreen.d.ts.map +1 -0
- package/dist/components/Chatbot/irisMenuScreen.js +357 -0
- package/dist/components/Chatbot/irisThinking.d.ts +7 -0
- package/dist/components/Chatbot/irisThinking.d.ts.map +1 -0
- package/dist/components/Chatbot/irisThinking.js +219 -0
- package/dist/components/Chatbot/newChatComponent.d.ts +1 -1
- package/dist/components/Chatbot/newChatComponent.d.ts.map +1 -1
- package/dist/components/Chatbot/newChatComponent.js +497 -72
- package/dist/components/Chips/index.js +1 -1
- package/dist/components/CommentsPanel/CommentsPanel.impl.js +1 -1
- package/dist/components/DatePicker/DatePicker.types.d.ts +0 -4
- package/dist/components/DatePicker/DatePicker.types.d.ts.map +1 -1
- package/dist/components/DatePicker/datePickerInput.d.ts +0 -2
- package/dist/components/DatePicker/datePickerInput.d.ts.map +1 -1
- package/dist/components/DatePicker/datePickerInput.js +2 -32
- package/dist/components/DatePicker/index.d.ts.map +1 -1
- package/dist/components/DatePicker/index.js +1 -5
- package/dist/components/DatePicker/showMonthYearSelect.d.ts.map +1 -1
- package/dist/components/DatePicker/showMonthYearSelect.js +0 -2
- package/dist/components/DateRangePicker/index.js +1 -1
- package/dist/components/DateRangePicker/showMonthYearSelect.d.ts.map +1 -1
- package/dist/components/DateRangePicker/showMonthYearSelect.js +0 -2
- package/dist/components/FileUpload/index.js +1 -1
- package/dist/components/FilterPanel/index.js +1 -1
- package/dist/components/FiltersStrip/FilterSlider.js +1 -1
- package/dist/components/FiltersStrip/index.js +1 -1
- package/dist/components/Input/index.js +1 -1
- package/dist/components/KeyboardShortCuts/ShortcutLandingPage.js +1 -1
- package/dist/components/KeyboardShortCuts/ShortcutModal.js +1 -1
- package/dist/components/KeyboardShortCuts/allSetBox.js +1 -1
- package/dist/components/KeyboardShortCuts/index.js +1 -1
- package/dist/components/KeyboardShortCuts/tutorial.js +1 -1
- package/dist/components/Menu/IconMenuItem.js +1 -1
- package/dist/components/Menu/NestedMenuItem.js +1 -1
- package/dist/components/Menu/index.js +1 -1
- package/dist/components/Menu/nestedMenuItemsFromObject.js +1 -1
- package/dist/components/Modal/index.js +1 -1
- package/dist/components/MonthPicker/index.js +1 -1
- package/dist/components/MonthRangePicker/index.js +1 -1
- package/dist/components/NewCreateItemFlow/index.js +1 -1
- package/dist/components/NewDynamicLayout/index.js +1 -1
- package/dist/components/OnboardingTour/index.js +1 -1
- package/dist/components/OnboardingTour/productTourList.js +1 -1
- package/dist/components/OnboardingTour/tooltipCard.js +1 -1
- package/dist/components/Panel/index.js +1 -1
- package/dist/components/Popover/index.js +1 -1
- package/dist/components/Prompt/index.js +1 -1
- package/dist/components/Select/Select.types.d.ts +0 -7
- package/dist/components/Select/Select.types.d.ts.map +1 -1
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Select/index.js +26 -44
- package/dist/components/Stepper/index.js +1 -1
- package/dist/components/TableChat/EmptyContainer.js +1 -1
- package/dist/components/TableChat/TableChatSidePanel.js +1 -1
- package/dist/components/TableChat/components/TableChatLeftSection/AddChatContainer/AddChatContainer.js +1 -1
- package/dist/components/TableChat/components/TableChatLeftSection/ChatFilterChips/ChatFilterChips.js +1 -1
- package/dist/components/TableChat/components/TableChatLeftSection/TableChatChannelHeader.js +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/AvatarGroup/AvatarGroup.js +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatDefaultMessageType/ChatDefaultMessageType.js +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatDeleteMessageType/ChatDeletedMessageType.js +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeader.js +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatInlineEdit/ChatInlineEdit.js +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.js +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatMessages/ChatMessage.js +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatNotificationSettings/ChatNotificationSettings.js +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/TableChatRightSection.js +1 -1
- package/dist/components/TableChat/components/TextEditor/EditorToolbar.js +1 -1
- package/dist/components/TableChat/components/TextEditor/Mention.js +1 -1
- package/dist/components/TableChat/components/TextEditor/MentionList.js +1 -1
- package/dist/components/TableV36/AgGridHeader.d.ts.map +1 -1
- package/dist/components/TableV36/AgGridHeader.js +115 -107
- package/dist/components/TableV36/index.js +1 -1
- package/dist/components/Tag/index.js +1 -1
- package/dist/components/TextArea/index.js +1 -1
- package/dist/components/common/MentionEditor/MentionList/index.js +1 -1
- package/dist/components/common/MentionEditor/index.js +1 -1
- package/dist/components/index.d.ts +3 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +3 -0
- package/dist/hooks/useDraggableResizable.d.ts +11 -1
- package/dist/hooks/useDraggableResizable.d.ts.map +1 -1
- package/dist/hooks/useDraggableResizable.js +73 -59
- package/dist/locales/de-DE.json.d.ts +50 -30
- package/dist/locales/de-DE.json.js +50 -30
- package/dist/locales/en-US.json.d.ts +50 -30
- package/dist/locales/en-US.json.js +50 -30
- package/dist/locales/es-ES.json.d.ts +50 -30
- package/dist/locales/es-ES.json.js +50 -30
- package/dist/mcp-component-registry.json +65 -263
- package/dist/node_modules/@impactsmartsuite/impact-icons/dist/index.js +43 -15
- package/dist/node_modules/@mui/icons-material/ArrowBack.js +17 -0
- package/dist/node_modules/@mui/icons-material/AttachFileOutlined.js +17 -0
- package/dist/node_modules/@mui/icons-material/ContentCopyOutlined.js +17 -0
- package/dist/node_modules/@mui/icons-material/Menu.js +17 -0
- package/dist/node_modules/@mui/icons-material/NorthRounded.js +17 -0
- package/dist/node_modules/@mui/icons-material/RefreshOutlined.js +17 -0
- package/dist/node_modules/@mui/icons-material/StopRounded.js +17 -0
- package/dist/node_modules/@mui/icons-material/VolumeUpOutlined.js +17 -0
- package/dist/node_modules/prop-types/index.js +1 -1
- package/dist/node_modules/react-is/index.js +1 -1
- package/dist/stories/chatBotApiMock.d.ts +91 -0
- package/dist/stories/chatBotApiMock.d.ts.map +1 -0
- package/dist/styles/style.css +1 -1
- package/package.json +2 -2
- package/dist/_virtual/MoreVert.js +0 -4
- package/dist/_virtual/RemoveRounded.js +0 -4
- package/dist/_virtual/SaveOutlined.js +0 -4
- package/dist/components/Chatbot/bookMarkPanel.d.ts +0 -4
- package/dist/components/Chatbot/bookMarkPanel.d.ts.map +0 -1
- package/dist/components/Chatbot/bookMarkPanel.js +0 -64
- package/dist/components/Chatbot/chatBotLandingScreen.d.ts +0 -4
- package/dist/components/Chatbot/chatBotLandingScreen.d.ts.map +0 -1
- package/dist/components/Chatbot/chatBotLandingScreen.js +0 -24
- package/dist/components/Chatbot/chatInput.d.ts +0 -4
- package/dist/components/Chatbot/chatInput.d.ts.map +0 -1
- package/dist/components/Chatbot/chatInput.js +0 -198
- package/dist/components/Chatbot/chatbotModuleMenu.d.ts +0 -4
- package/dist/components/Chatbot/chatbotModuleMenu.d.ts.map +0 -1
- package/dist/components/Chatbot/chatbotModuleMenu.js +0 -248
- package/dist/components/Chatbot/constant.d.ts +0 -6
- package/dist/components/Chatbot/constant.d.ts.map +0 -1
- package/dist/components/Chatbot/constant.js +0 -27
- package/dist/components/Chatbot/conversationScreen.d.ts +0 -4
- package/dist/components/Chatbot/conversationScreen.d.ts.map +0 -1
- package/dist/components/Chatbot/conversationScreen.js +0 -207
- package/dist/components/Chatbot/customScreen.d.ts +0 -4
- package/dist/components/Chatbot/customScreen.d.ts.map +0 -1
- package/dist/components/Chatbot/customScreen.js +0 -66
- package/dist/components/Chatbot/historyPanel.d.ts +0 -4
- package/dist/components/Chatbot/historyPanel.d.ts.map +0 -1
- package/dist/components/Chatbot/historyPanel.js +0 -374
- package/dist/components/Chatbot/utils.d.ts +0 -5
- package/dist/components/Chatbot/utils.d.ts.map +0 -1
- package/dist/components/Chatbot/utils.js +0 -29
- package/dist/node_modules/@mui/icons-material/MoreVert.js +0 -17
- package/dist/node_modules/@mui/icons-material/RemoveRounded.js +0 -17
- package/dist/node_modules/@mui/icons-material/SaveOutlined.js +0 -17
- package/dist/utils/onResize.js +0 -28
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import default_1 from "../../node_modules/@mui/icons-material/AttachFileOutlined.js";
|
|
4
|
+
import { MoreHorizontal as MoreHorizontal_default, PinedIcon as PinedIcon_default, EditBlack as EditBlack_default, DeleteRedIcon as DeleteRedIcon_default } from "../../node_modules/@impactsmartsuite/impact-icons/dist/index.js";
|
|
5
|
+
import { Button } from "../Button/index.js";
|
|
6
|
+
import { Menu } from "../Menu/index.js";
|
|
7
|
+
import { Tooltip } from "../Tooltip/index.js";
|
|
8
|
+
import { useTranslation } from "../../i18n/useTranslation.js";
|
|
9
|
+
const ACTION_ICON_SIZE = 14;
|
|
10
|
+
const MORE_ICON_SIZE = 16;
|
|
11
|
+
function IrisMenuListItem({
|
|
12
|
+
id,
|
|
13
|
+
label,
|
|
14
|
+
isCollapsed = false,
|
|
15
|
+
onSelect,
|
|
16
|
+
onAction
|
|
17
|
+
}) {
|
|
18
|
+
const { t } = useTranslation();
|
|
19
|
+
const [menuAnchorEl, setMenuAnchorEl] = useState(null);
|
|
20
|
+
const isMenuOpen = Boolean(menuAnchorEl);
|
|
21
|
+
const menuId = `iris-menu-item-actions-${id}`;
|
|
22
|
+
const handleMoreClick = (event) => {
|
|
23
|
+
event.preventDefault();
|
|
24
|
+
event.stopPropagation();
|
|
25
|
+
setMenuAnchorEl(isMenuOpen ? null : event.currentTarget);
|
|
26
|
+
};
|
|
27
|
+
const handleCloseMenu = () => {
|
|
28
|
+
setMenuAnchorEl(null);
|
|
29
|
+
};
|
|
30
|
+
return /* @__PURE__ */ jsxs(
|
|
31
|
+
"div",
|
|
32
|
+
{
|
|
33
|
+
className: `iris-menu-list-item${isCollapsed ? " is-compact" : ""}${isMenuOpen ? " is-menu-open" : ""}`,
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ jsx(
|
|
36
|
+
"button",
|
|
37
|
+
{
|
|
38
|
+
className: "iris-menu-list-item-main",
|
|
39
|
+
type: "button",
|
|
40
|
+
onClick: () => {
|
|
41
|
+
if (isMenuOpen) return;
|
|
42
|
+
onSelect == null ? void 0 : onSelect();
|
|
43
|
+
},
|
|
44
|
+
children: /* @__PURE__ */ jsx("span", { className: "iris-menu-list-item-label", children: label })
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
/* @__PURE__ */ jsx(Tooltip, { title: t("chatBot.irisMenu.item.more"), variant: "tertiary", children: /* @__PURE__ */ jsx(
|
|
48
|
+
Button,
|
|
49
|
+
{
|
|
50
|
+
"aria-controls": isMenuOpen ? menuId : void 0,
|
|
51
|
+
"aria-expanded": isMenuOpen,
|
|
52
|
+
"aria-haspopup": "true",
|
|
53
|
+
"aria-label": t("chatBot.irisMenu.item.more"),
|
|
54
|
+
className: "iris-menu-list-item-more",
|
|
55
|
+
icon: /* @__PURE__ */ jsx(MoreHorizontal_default, { height: MORE_ICON_SIZE, width: MORE_ICON_SIZE }),
|
|
56
|
+
size: isCollapsed ? "small" : "large",
|
|
57
|
+
type: "default",
|
|
58
|
+
variant: "text",
|
|
59
|
+
onClick: handleMoreClick
|
|
60
|
+
}
|
|
61
|
+
) }),
|
|
62
|
+
/* @__PURE__ */ jsx(
|
|
63
|
+
Menu,
|
|
64
|
+
{
|
|
65
|
+
MenuProps: {
|
|
66
|
+
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
67
|
+
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
68
|
+
slotProps: {
|
|
69
|
+
root: { sx: { zIndex: 2e3 } },
|
|
70
|
+
paper: {
|
|
71
|
+
className: "iris-menu-item-actions-paper",
|
|
72
|
+
style: { width: 182, minWidth: 180, maxWidth: 240 }
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
anchorEl: menuAnchorEl,
|
|
77
|
+
id: menuId,
|
|
78
|
+
open: isMenuOpen,
|
|
79
|
+
options: [
|
|
80
|
+
{
|
|
81
|
+
label: t("chatBot.irisMenu.item.pin"),
|
|
82
|
+
value: "pin",
|
|
83
|
+
icon: /* @__PURE__ */ jsx(PinedIcon_default, { height: ACTION_ICON_SIZE, width: ACTION_ICON_SIZE }),
|
|
84
|
+
onClick: () => {
|
|
85
|
+
onAction == null ? void 0 : onAction("pin");
|
|
86
|
+
handleCloseMenu();
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
label: t("chatBot.irisMenu.item.rename"),
|
|
91
|
+
value: "rename",
|
|
92
|
+
icon: /* @__PURE__ */ jsx(EditBlack_default, { height: ACTION_ICON_SIZE, width: ACTION_ICON_SIZE }),
|
|
93
|
+
onClick: () => {
|
|
94
|
+
onAction == null ? void 0 : onAction("rename");
|
|
95
|
+
handleCloseMenu();
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
label: t("chatBot.irisMenu.item.archive"),
|
|
100
|
+
value: "archive",
|
|
101
|
+
icon: /* @__PURE__ */ jsx(default_1, { sx: { fontSize: ACTION_ICON_SIZE } }),
|
|
102
|
+
onClick: () => {
|
|
103
|
+
onAction == null ? void 0 : onAction("archive");
|
|
104
|
+
handleCloseMenu();
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
label: t("chatBot.irisMenu.item.delete"),
|
|
109
|
+
value: "delete",
|
|
110
|
+
icon: /* @__PURE__ */ jsx(DeleteRedIcon_default, { height: ACTION_ICON_SIZE, width: ACTION_ICON_SIZE }),
|
|
111
|
+
onClick: () => {
|
|
112
|
+
onAction == null ? void 0 : onAction("delete");
|
|
113
|
+
handleCloseMenu();
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
onClose: handleCloseMenu
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
export {
|
|
125
|
+
IrisMenuListItem
|
|
126
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IrisMenuScreenProps } from './Chatbot.types';
|
|
2
|
+
|
|
3
|
+
export declare function IrisMenuScreen({ view, historyPanelData, artifacts, isRecentChatsLoading, isArtifactsLoading, recentChatsPreviewCount, artifactsPreviewCount, footerText, onFooterLinkClick, onBackClick, onClose, onNewChatClick, onToggleCollapse, onMinimiseChatBot, onEnterFloating, onEnterFullScreen, onExitFullScreen, isCollapsed, isFloating, isFullScreen, isFullWidth, dragHandleProps, onSelectConversation, onSelectArtifact, onViewMore, onFilterSelect, onChatMenuAction, onArtifactMenuAction, }: IrisMenuScreenProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
//# sourceMappingURL=irisMenuScreen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"irisMenuScreen.d.ts","sourceRoot":"","sources":["../../../src/components/Chatbot/irisMenuScreen.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAIV,mBAAmB,EAEpB,MAAM,iBAAiB,CAAC;AAyLzB,wBAAgB,cAAc,CAAC,EAC7B,IAAa,EACb,gBAAqB,EACrB,SAAc,EACd,oBAA4B,EAC5B,kBAA0B,EAC1B,uBAAuC,EACvC,qBAAqC,EACrC,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,OAAO,EACP,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,WAAmB,EACnB,UAAkB,EAClB,YAAoB,EACpB,WAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,oBAAoB,GACrB,EAAE,mBAAmB,2CA6LrB"}
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useMemo } from "react";
|
|
3
|
+
import default_1 from "../../node_modules/@mui/icons-material/KeyboardArrowRight.js";
|
|
4
|
+
import { FilterFunnel as FilterFunnel_default } from "../../node_modules/@impactsmartsuite/impact-icons/dist/index.js";
|
|
5
|
+
import { Button } from "../Button/index.js";
|
|
6
|
+
import { Menu } from "../Menu/index.js";
|
|
7
|
+
import { Skeleton } from "../Skeleton/index.js";
|
|
8
|
+
import { Tooltip } from "../Tooltip/index.js";
|
|
9
|
+
import { ChatBotFooter } from "./chatBotFooter.js";
|
|
10
|
+
import { ChatbotGreetingHeader } from "./chatbotGreetingHeader.js";
|
|
11
|
+
import { IrisMenuListItem } from "./irisMenuListItem.js";
|
|
12
|
+
import { useTranslation } from "../../i18n/useTranslation.js";
|
|
13
|
+
const PREVIEW_COUNT = 4;
|
|
14
|
+
const FULL_LIST_SKELETON_COUNT = 8;
|
|
15
|
+
const FILTER_ICON_SIZE = 16;
|
|
16
|
+
function IrisMenuListSkeleton({
|
|
17
|
+
count,
|
|
18
|
+
isCollapsed = false
|
|
19
|
+
}) {
|
|
20
|
+
return /* @__PURE__ */ jsx(
|
|
21
|
+
"div",
|
|
22
|
+
{
|
|
23
|
+
"aria-busy": "true",
|
|
24
|
+
"aria-live": "polite",
|
|
25
|
+
className: `iris-menu-list-skeleton${isCollapsed ? " is-compact" : ""}`,
|
|
26
|
+
"data-testid": "iris-menu-list-skeleton",
|
|
27
|
+
children: Array.from({ length: count }, (_, index) => /* @__PURE__ */ jsx(
|
|
28
|
+
Skeleton,
|
|
29
|
+
{
|
|
30
|
+
className: "iris-menu-list-skeleton-item",
|
|
31
|
+
height: 16,
|
|
32
|
+
variant: "text",
|
|
33
|
+
width: `${72 - index % 3 * 8}%`
|
|
34
|
+
},
|
|
35
|
+
index
|
|
36
|
+
))
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
const FILTER_OPTIONS = [
|
|
41
|
+
{ value: "type", labelKey: "chatBot.irisMenu.filter.type" },
|
|
42
|
+
{ value: "status", labelKey: "chatBot.irisMenu.filter.status" },
|
|
43
|
+
{ value: "lastActivity", labelKey: "chatBot.irisMenu.filter.lastActivity" }
|
|
44
|
+
];
|
|
45
|
+
function flattenHistory(data = []) {
|
|
46
|
+
if (Array.isArray(data)) {
|
|
47
|
+
return data.flatMap((group) => group.conversation_list || []);
|
|
48
|
+
}
|
|
49
|
+
const pinned = data.pinned || [];
|
|
50
|
+
const fromGroups = (data.groups || []).flatMap((group) => group.conversation_list || []);
|
|
51
|
+
const seen = /* @__PURE__ */ new Set();
|
|
52
|
+
const result = [];
|
|
53
|
+
[...pinned, ...fromGroups].forEach((item) => {
|
|
54
|
+
const key = String(item.conversation_id ?? item.name ?? "");
|
|
55
|
+
if (!key || seen.has(key)) return;
|
|
56
|
+
seen.add(key);
|
|
57
|
+
result.push(item);
|
|
58
|
+
});
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
function SectionFilterButton({
|
|
62
|
+
section,
|
|
63
|
+
isCollapsed = false,
|
|
64
|
+
onFilterSelect
|
|
65
|
+
}) {
|
|
66
|
+
const { t } = useTranslation();
|
|
67
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
68
|
+
const open = Boolean(anchorEl);
|
|
69
|
+
return /* @__PURE__ */ jsxs("div", { className: "iris-menu-filter", children: [
|
|
70
|
+
/* @__PURE__ */ jsx(Tooltip, { title: t("chatBot.irisMenu.filter"), variant: "tertiary", children: /* @__PURE__ */ jsx(
|
|
71
|
+
Button,
|
|
72
|
+
{
|
|
73
|
+
"aria-controls": open ? `iris-menu-filter-${section}` : void 0,
|
|
74
|
+
"aria-expanded": open,
|
|
75
|
+
"aria-haspopup": "true",
|
|
76
|
+
"aria-label": t("chatBot.irisMenu.filter"),
|
|
77
|
+
className: `iris-menu-filter-button${open ? " is-active" : ""}`,
|
|
78
|
+
icon: /* @__PURE__ */ jsx(FilterFunnel_default, { height: FILTER_ICON_SIZE, width: FILTER_ICON_SIZE }),
|
|
79
|
+
size: isCollapsed ? "small" : "large",
|
|
80
|
+
type: "default",
|
|
81
|
+
variant: "text",
|
|
82
|
+
onClick: (event) => {
|
|
83
|
+
setAnchorEl(open ? null : event.currentTarget);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
) }),
|
|
87
|
+
/* @__PURE__ */ jsx(
|
|
88
|
+
Menu,
|
|
89
|
+
{
|
|
90
|
+
MenuProps: {
|
|
91
|
+
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
92
|
+
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
93
|
+
slotProps: {
|
|
94
|
+
root: { sx: { zIndex: 2e3 } },
|
|
95
|
+
paper: {
|
|
96
|
+
className: "iris-menu-filter-paper",
|
|
97
|
+
style: { width: 182, minWidth: 180, maxWidth: 240 }
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
anchorEl,
|
|
102
|
+
id: `iris-menu-filter-${section}`,
|
|
103
|
+
open,
|
|
104
|
+
options: FILTER_OPTIONS.map((option) => ({
|
|
105
|
+
label: t(option.labelKey),
|
|
106
|
+
value: option.value,
|
|
107
|
+
onClick: () => {
|
|
108
|
+
onFilterSelect == null ? void 0 : onFilterSelect(section, option.value);
|
|
109
|
+
setAnchorEl(null);
|
|
110
|
+
}
|
|
111
|
+
})),
|
|
112
|
+
onClose: () => setAnchorEl(null)
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
] });
|
|
116
|
+
}
|
|
117
|
+
function AccordionSection({
|
|
118
|
+
section,
|
|
119
|
+
title,
|
|
120
|
+
expanded,
|
|
121
|
+
onToggle,
|
|
122
|
+
children,
|
|
123
|
+
isCollapsed = false,
|
|
124
|
+
onFilterSelect
|
|
125
|
+
}) {
|
|
126
|
+
const { t } = useTranslation();
|
|
127
|
+
const panelId = `iris-menu-panel-${section}`;
|
|
128
|
+
const headerId = `iris-menu-header-${section}`;
|
|
129
|
+
return /* @__PURE__ */ jsxs("section", { className: `iris-menu-section${expanded ? " is-expanded" : ""}`, children: [
|
|
130
|
+
/* @__PURE__ */ jsxs("div", { className: "iris-menu-section-header", children: [
|
|
131
|
+
/* @__PURE__ */ jsxs("div", { className: "iris-menu-section-header-left", children: [
|
|
132
|
+
/* @__PURE__ */ jsx(
|
|
133
|
+
"div",
|
|
134
|
+
{
|
|
135
|
+
"aria-controls": panelId,
|
|
136
|
+
"aria-expanded": expanded,
|
|
137
|
+
"aria-label": expanded ? `${t("chatBot.irisMenu.collapse")} ${title}` : `${t("chatBot.irisMenu.expand")} ${title}`,
|
|
138
|
+
className: `iris-menu-section-expand-icon${expanded ? " is-expanded" : ""}`,
|
|
139
|
+
id: headerId,
|
|
140
|
+
role: "button",
|
|
141
|
+
tabIndex: 0,
|
|
142
|
+
onClick: onToggle,
|
|
143
|
+
onKeyDown: (event) => {
|
|
144
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
145
|
+
event.preventDefault();
|
|
146
|
+
onToggle();
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
children: /* @__PURE__ */ jsx(default_1, {})
|
|
150
|
+
}
|
|
151
|
+
),
|
|
152
|
+
/* @__PURE__ */ jsx("h2", { className: "iris-menu-section-title", children: title })
|
|
153
|
+
] }),
|
|
154
|
+
/* @__PURE__ */ jsx(
|
|
155
|
+
SectionFilterButton,
|
|
156
|
+
{
|
|
157
|
+
isCollapsed,
|
|
158
|
+
section,
|
|
159
|
+
onFilterSelect
|
|
160
|
+
}
|
|
161
|
+
)
|
|
162
|
+
] }),
|
|
163
|
+
expanded ? /* @__PURE__ */ jsx(
|
|
164
|
+
"div",
|
|
165
|
+
{
|
|
166
|
+
"aria-labelledby": headerId,
|
|
167
|
+
className: "iris-menu-section-body",
|
|
168
|
+
id: panelId,
|
|
169
|
+
role: "region",
|
|
170
|
+
children
|
|
171
|
+
}
|
|
172
|
+
) : null
|
|
173
|
+
] });
|
|
174
|
+
}
|
|
175
|
+
function IrisMenuScreen({
|
|
176
|
+
view = "menu",
|
|
177
|
+
historyPanelData = [],
|
|
178
|
+
artifacts = [],
|
|
179
|
+
isRecentChatsLoading = false,
|
|
180
|
+
isArtifactsLoading = false,
|
|
181
|
+
recentChatsPreviewCount = PREVIEW_COUNT,
|
|
182
|
+
artifactsPreviewCount = PREVIEW_COUNT,
|
|
183
|
+
footerText,
|
|
184
|
+
onFooterLinkClick,
|
|
185
|
+
onBackClick,
|
|
186
|
+
onClose,
|
|
187
|
+
onNewChatClick,
|
|
188
|
+
onToggleCollapse,
|
|
189
|
+
onMinimiseChatBot,
|
|
190
|
+
onEnterFloating,
|
|
191
|
+
onEnterFullScreen,
|
|
192
|
+
onExitFullScreen,
|
|
193
|
+
isCollapsed = false,
|
|
194
|
+
isFloating = false,
|
|
195
|
+
isFullScreen = false,
|
|
196
|
+
isFullWidth = false,
|
|
197
|
+
dragHandleProps,
|
|
198
|
+
onSelectConversation,
|
|
199
|
+
onSelectArtifact,
|
|
200
|
+
onViewMore,
|
|
201
|
+
onFilterSelect,
|
|
202
|
+
onChatMenuAction,
|
|
203
|
+
onArtifactMenuAction
|
|
204
|
+
}) {
|
|
205
|
+
const { t } = useTranslation();
|
|
206
|
+
const [chatsExpanded, setChatsExpanded] = useState(true);
|
|
207
|
+
const [artifactsExpanded, setArtifactsExpanded] = useState(true);
|
|
208
|
+
const recentChats = useMemo(() => flattenHistory(historyPanelData), [historyPanelData]);
|
|
209
|
+
const isListView = view === "recent-chats" || view === "artifacts";
|
|
210
|
+
const headerTitle = view === "recent-chats" ? t("chatBot.irisMenu.recentChats") : view === "artifacts" ? t("chatBot.irisMenu.artifacts") : t("chatBot.irisMenu.title");
|
|
211
|
+
const previewChats = recentChats.slice(0, recentChatsPreviewCount);
|
|
212
|
+
const previewArtifacts = artifacts.slice(0, artifactsPreviewCount);
|
|
213
|
+
const showChatsViewMore = recentChats.length > recentChatsPreviewCount;
|
|
214
|
+
const showArtifactsViewMore = artifacts.length > artifactsPreviewCount;
|
|
215
|
+
return /* @__PURE__ */ jsxs(
|
|
216
|
+
"div",
|
|
217
|
+
{
|
|
218
|
+
className: `iris-menu-screen${isCollapsed ? " is-collapsed" : ""}${isFullScreen ? " is-full-screen" : ""}`,
|
|
219
|
+
children: [
|
|
220
|
+
/* @__PURE__ */ jsx(
|
|
221
|
+
ChatbotGreetingHeader,
|
|
222
|
+
{
|
|
223
|
+
dragHandleProps,
|
|
224
|
+
isCollapsed,
|
|
225
|
+
isFloating,
|
|
226
|
+
isFullScreen,
|
|
227
|
+
isFullWidth,
|
|
228
|
+
title: headerTitle,
|
|
229
|
+
variant: isListView ? "list" : "menu",
|
|
230
|
+
onBackClick,
|
|
231
|
+
onClose,
|
|
232
|
+
onEnterFloating,
|
|
233
|
+
onEnterFullScreen,
|
|
234
|
+
onExitFullScreen,
|
|
235
|
+
onMinimiseChatBot,
|
|
236
|
+
onNewChatClick,
|
|
237
|
+
onToggleCollapse
|
|
238
|
+
}
|
|
239
|
+
),
|
|
240
|
+
/* @__PURE__ */ jsx("main", { className: "iris-menu-main", children: view === "menu" ? /* @__PURE__ */ jsxs("div", { className: "iris-menu-content", children: [
|
|
241
|
+
/* @__PURE__ */ jsx(
|
|
242
|
+
AccordionSection,
|
|
243
|
+
{
|
|
244
|
+
expanded: chatsExpanded,
|
|
245
|
+
isCollapsed,
|
|
246
|
+
section: "recentChats",
|
|
247
|
+
title: t("chatBot.irisMenu.recentChats"),
|
|
248
|
+
onFilterSelect,
|
|
249
|
+
onToggle: () => setChatsExpanded((open) => !open),
|
|
250
|
+
children: isRecentChatsLoading ? /* @__PURE__ */ jsx(IrisMenuListSkeleton, { count: recentChatsPreviewCount, isCollapsed }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
251
|
+
/* @__PURE__ */ jsx("ul", { className: "iris-menu-list", children: previewChats.map((item) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
252
|
+
IrisMenuListItem,
|
|
253
|
+
{
|
|
254
|
+
id: item.conversation_id ?? item.name ?? "chat",
|
|
255
|
+
isCollapsed,
|
|
256
|
+
label: item.name || String(item.conversation_id ?? ""),
|
|
257
|
+
onAction: (action) => onChatMenuAction == null ? void 0 : onChatMenuAction(action, item),
|
|
258
|
+
onSelect: () => onSelectConversation == null ? void 0 : onSelectConversation(item)
|
|
259
|
+
}
|
|
260
|
+
) }, String(item.conversation_id ?? item.name))) }),
|
|
261
|
+
previewChats.length === 0 ? /* @__PURE__ */ jsx("p", { className: "iris-menu-empty", children: t("chatBot.history.noConversations") }) : null,
|
|
262
|
+
showChatsViewMore ? /* @__PURE__ */ jsx(
|
|
263
|
+
Button,
|
|
264
|
+
{
|
|
265
|
+
className: "iris-menu-view-more",
|
|
266
|
+
size: "small",
|
|
267
|
+
variant: "url",
|
|
268
|
+
onClick: () => onViewMore == null ? void 0 : onViewMore("recentChats"),
|
|
269
|
+
children: t("chatBot.irisMenu.viewMore")
|
|
270
|
+
}
|
|
271
|
+
) : null
|
|
272
|
+
] })
|
|
273
|
+
}
|
|
274
|
+
),
|
|
275
|
+
/* @__PURE__ */ jsx(
|
|
276
|
+
AccordionSection,
|
|
277
|
+
{
|
|
278
|
+
expanded: artifactsExpanded,
|
|
279
|
+
isCollapsed,
|
|
280
|
+
section: "artifacts",
|
|
281
|
+
title: t("chatBot.irisMenu.artifacts"),
|
|
282
|
+
onFilterSelect,
|
|
283
|
+
onToggle: () => setArtifactsExpanded((open) => !open),
|
|
284
|
+
children: isArtifactsLoading ? /* @__PURE__ */ jsx(IrisMenuListSkeleton, { count: artifactsPreviewCount, isCollapsed }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
285
|
+
/* @__PURE__ */ jsx("ul", { className: "iris-menu-list", children: previewArtifacts.map((item) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
286
|
+
IrisMenuListItem,
|
|
287
|
+
{
|
|
288
|
+
id: item.id,
|
|
289
|
+
isCollapsed,
|
|
290
|
+
label: item.name,
|
|
291
|
+
onAction: (action) => onArtifactMenuAction == null ? void 0 : onArtifactMenuAction(action, item),
|
|
292
|
+
onSelect: () => onSelectArtifact == null ? void 0 : onSelectArtifact(item)
|
|
293
|
+
}
|
|
294
|
+
) }, String(item.id))) }),
|
|
295
|
+
previewArtifacts.length === 0 ? /* @__PURE__ */ jsx("p", { className: "iris-menu-empty", children: t("chatBot.irisMenu.noArtifacts") }) : null,
|
|
296
|
+
showArtifactsViewMore ? /* @__PURE__ */ jsx(
|
|
297
|
+
Button,
|
|
298
|
+
{
|
|
299
|
+
className: "iris-menu-view-more",
|
|
300
|
+
size: "small",
|
|
301
|
+
variant: "url",
|
|
302
|
+
onClick: () => onViewMore == null ? void 0 : onViewMore("artifacts"),
|
|
303
|
+
children: t("chatBot.irisMenu.viewMore")
|
|
304
|
+
}
|
|
305
|
+
) : null
|
|
306
|
+
] })
|
|
307
|
+
}
|
|
308
|
+
)
|
|
309
|
+
] }) : /* @__PURE__ */ jsxs("div", { className: "iris-menu-content iris-menu-content-list", children: [
|
|
310
|
+
/* @__PURE__ */ jsxs("div", { className: "iris-menu-list-toolbar", children: [
|
|
311
|
+
/* @__PURE__ */ jsx("h2", { className: "iris-menu-list-toolbar-title", children: headerTitle }),
|
|
312
|
+
/* @__PURE__ */ jsx(
|
|
313
|
+
SectionFilterButton,
|
|
314
|
+
{
|
|
315
|
+
section: view === "artifacts" ? "artifacts" : "recentChats",
|
|
316
|
+
onFilterSelect
|
|
317
|
+
}
|
|
318
|
+
)
|
|
319
|
+
] }),
|
|
320
|
+
(view === "artifacts" ? isArtifactsLoading : isRecentChatsLoading) ? /* @__PURE__ */ jsx(IrisMenuListSkeleton, { count: FULL_LIST_SKELETON_COUNT, isCollapsed }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
321
|
+
/* @__PURE__ */ jsx("ul", { className: "iris-menu-list iris-menu-list-full", children: view === "artifacts" ? artifacts.map((item) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
322
|
+
IrisMenuListItem,
|
|
323
|
+
{
|
|
324
|
+
id: item.id,
|
|
325
|
+
isCollapsed,
|
|
326
|
+
label: item.name,
|
|
327
|
+
onAction: (action) => onArtifactMenuAction == null ? void 0 : onArtifactMenuAction(action, item),
|
|
328
|
+
onSelect: () => onSelectArtifact == null ? void 0 : onSelectArtifact(item)
|
|
329
|
+
}
|
|
330
|
+
) }, String(item.id))) : recentChats.map((item) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
331
|
+
IrisMenuListItem,
|
|
332
|
+
{
|
|
333
|
+
id: item.conversation_id ?? item.name ?? "chat",
|
|
334
|
+
isCollapsed,
|
|
335
|
+
label: item.name || String(item.conversation_id ?? ""),
|
|
336
|
+
onAction: (action) => onChatMenuAction == null ? void 0 : onChatMenuAction(action, item),
|
|
337
|
+
onSelect: () => onSelectConversation == null ? void 0 : onSelectConversation(item)
|
|
338
|
+
}
|
|
339
|
+
) }, String(item.conversation_id ?? item.name))) }),
|
|
340
|
+
(view === "artifacts" ? artifacts : recentChats).length === 0 ? /* @__PURE__ */ jsx("p", { className: "iris-menu-empty", children: view === "artifacts" ? t("chatBot.irisMenu.noArtifacts") : t("chatBot.history.noConversations") }) : null
|
|
341
|
+
] })
|
|
342
|
+
] }) }),
|
|
343
|
+
/* @__PURE__ */ jsx(
|
|
344
|
+
ChatBotFooter,
|
|
345
|
+
{
|
|
346
|
+
footerLinkLabel: onFooterLinkClick ? t("chatBot.footerLearnMore") : void 0,
|
|
347
|
+
footerText,
|
|
348
|
+
onFooterLinkClick
|
|
349
|
+
}
|
|
350
|
+
)
|
|
351
|
+
]
|
|
352
|
+
}
|
|
353
|
+
);
|
|
354
|
+
}
|
|
355
|
+
export {
|
|
356
|
+
IrisMenuScreen
|
|
357
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IrisThinkingState } from './Chatbot.types';
|
|
2
|
+
|
|
3
|
+
export interface IrisThinkingProps {
|
|
4
|
+
thinking: IrisThinkingState;
|
|
5
|
+
}
|
|
6
|
+
export declare function IrisThinking({ thinking }: IrisThinkingProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=irisThinking.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"irisThinking.d.ts","sourceRoot":"","sources":["../../../src/components/Chatbot/irisThinking.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAoB,MAAM,iBAAiB,CAAC;AAiK3E,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,iBAAiB,CAAC;CAC7B;AAED,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,2CAoI3D"}
|