impact-ui 5.0.4-chatbot.1 → 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/index2.js +2 -2
- package/dist/_virtual/index3.js +2 -2
- package/dist/_virtual/index4.js +4 -2
- package/dist/_virtual/index5.js +3 -3
- package/dist/_virtual/index6.js +2 -4
- 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 +79 -185
- package/dist/components/Chatbot/Chatbot.types.d.ts.map +1 -1
- package/dist/components/Chatbot/chatbotComposer.d.ts +1 -1
- package/dist/components/Chatbot/chatbotComposer.d.ts.map +1 -1
- package/dist/components/Chatbot/chatbotComposer.js +107 -5
- package/dist/components/Chatbot/chatbotGreetingHeader.d.ts +1 -1
- package/dist/components/Chatbot/chatbotGreetingHeader.d.ts.map +1 -1
- package/dist/components/Chatbot/chatbotGreetingHeader.js +21 -8
- 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 +355 -436
- package/dist/components/Chatbot/irisConversationThread.d.ts.map +1 -1
- package/dist/components/Chatbot/irisConversationThread.js +56 -15
- package/dist/components/Chatbot/irisMenuScreen.d.ts +1 -1
- package/dist/components/Chatbot/irisMenuScreen.d.ts.map +1 -1
- package/dist/components/Chatbot/irisMenuScreen.js +157 -111
- 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 +137 -29
- package/dist/components/Chips/index.js +1 -1
- package/dist/components/CommentsPanel/CommentsPanel.impl.js +1 -1
- package/dist/components/DatePicker/index.js +1 -1
- package/dist/components/DateRangePicker/index.js +1 -1
- 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/index.js +1 -1
- 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/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 +1 -32
- package/dist/locales/de-DE.json.js +1 -32
- package/dist/locales/en-US.json.d.ts +1 -32
- package/dist/locales/en-US.json.js +1 -32
- package/dist/locales/es-ES.json.d.ts +1 -32
- package/dist/locales/es-ES.json.js +1 -32
- package/dist/mcp-component-registry.json +49 -321
- package/dist/node_modules/@impactsmartsuite/impact-icons/dist/index.js +13 -5
- package/dist/node_modules/@mui/system/colorManipulator.js +2 -2
- package/dist/node_modules/prop-types/index.js +1 -1
- package/dist/node_modules/prop-types/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/react-is/index.js +1 -1
- package/dist/stories/chatBotApiMock.d.ts +2 -387
- package/dist/stories/chatBotApiMock.d.ts.map +1 -1
- package/dist/styles/style.css +1 -1
- package/package.json +1 -1
- package/dist/_virtual/MoreVert.js +0 -4
- package/dist/_virtual/RemoveRounded.js +0 -4
- package/dist/_virtual/SaveOutlined.js +0 -4
- package/dist/_virtual/ThumbDownOutlined.js +0 -4
- package/dist/_virtual/ThumbUpOutlined.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 -209
- 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/node_modules/@mui/icons-material/ThumbDownOutlined.js +0 -17
- package/dist/node_modules/@mui/icons-material/ThumbUpOutlined.js +0 -17
- package/dist/utils/onResize.js +0 -28
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useRef, useState, useEffect } from "react";
|
|
3
|
-
import default_1 from "../../node_modules/@mui/icons-material/Clear.js";
|
|
4
|
-
import default_1$1 from "../../node_modules/@mui/icons-material/SaveOutlined.js";
|
|
5
|
-
import TextareaAutosize from "react-textarea-autosize";
|
|
6
|
-
import { getAssetUrl } from "../../utils/assetBase.js";
|
|
7
|
-
import { onResize } from "../../utils/onResize.js";
|
|
8
|
-
import { Button } from "../Button/index.js";
|
|
9
|
-
import { Tooltip } from "../Tooltip/index.js";
|
|
10
|
-
import { useTranslation } from "../../i18n/useTranslation.js";
|
|
11
|
-
import Box from "../../node_modules/@mui/material/Box/Box.js";
|
|
12
|
-
import IconButton from "../../node_modules/@mui/material/IconButton/IconButton.js";
|
|
13
|
-
const chatbotBannerIcon = getAssetUrl("icons/chatbotBannerIcon.svg");
|
|
14
|
-
const MicIcon = getAssetUrl("icons/chatBotMicIcon.svg");
|
|
15
|
-
const RefreshIcon = getAssetUrl("icons/chatBotRefreshIcon.svg");
|
|
16
|
-
const SendIcon = getAssetUrl("icons/chatBotSendIcon.svg");
|
|
17
|
-
const ChatbotStopIcon = getAssetUrl("icons/chatbotStopIcon.svg");
|
|
18
|
-
const COMPACT_INPUT_WIDTH = 480;
|
|
19
|
-
function ChatInput({
|
|
20
|
-
inputValue,
|
|
21
|
-
setInputValue,
|
|
22
|
-
setIsNewChat,
|
|
23
|
-
onSendIconClick,
|
|
24
|
-
setUserChats,
|
|
25
|
-
userChats,
|
|
26
|
-
handleRefresh,
|
|
27
|
-
handleSaveChat,
|
|
28
|
-
handleMicClick,
|
|
29
|
-
activeList,
|
|
30
|
-
uniqueId,
|
|
31
|
-
suggestionBanner,
|
|
32
|
-
isStopIcon,
|
|
33
|
-
onStopIconClick,
|
|
34
|
-
minRows = 1,
|
|
35
|
-
newChatScreen = false,
|
|
36
|
-
customScreen = false,
|
|
37
|
-
onCloseSuggestionBanner,
|
|
38
|
-
showSuggestionBanner,
|
|
39
|
-
customInputComponent
|
|
40
|
-
}) {
|
|
41
|
-
const { t } = useTranslation();
|
|
42
|
-
const containerRef = useRef(null);
|
|
43
|
-
const inputRef = useRef(null);
|
|
44
|
-
const [isCompact, setIsCompact] = useState(false);
|
|
45
|
-
const [isFixed, setIsFixed] = useState(false);
|
|
46
|
-
const [isScrollable, setIsScrollable] = useState(false);
|
|
47
|
-
const [height, setHeight] = useState("auto");
|
|
48
|
-
const MAX_HEIGHT = 142;
|
|
49
|
-
const handleHeightChange = (textareaHeight) => {
|
|
50
|
-
if (!textareaHeight) return;
|
|
51
|
-
if (!inputValue.trim()) {
|
|
52
|
-
setIsFixed(false);
|
|
53
|
-
setIsScrollable(false);
|
|
54
|
-
setHeight("auto");
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
if (textareaHeight > 40) setIsFixed(true);
|
|
58
|
-
setIsScrollable(textareaHeight >= MAX_HEIGHT);
|
|
59
|
-
const newHeight = textareaHeight > (newChatScreen ? 88 : 40) ? textareaHeight + 40 : "auto";
|
|
60
|
-
if (newHeight !== "auto") setHeight(newHeight <= MAX_HEIGHT ? newHeight : MAX_HEIGHT);
|
|
61
|
-
};
|
|
62
|
-
useEffect(() => {
|
|
63
|
-
if (inputValue === "") {
|
|
64
|
-
setHeight("auto");
|
|
65
|
-
setIsFixed(false);
|
|
66
|
-
}
|
|
67
|
-
}, [inputValue]);
|
|
68
|
-
useEffect(() => {
|
|
69
|
-
const container = containerRef.current;
|
|
70
|
-
if (!container) return;
|
|
71
|
-
return onResize(container, ({ width }) => {
|
|
72
|
-
setIsCompact(width < COMPACT_INPUT_WIDTH);
|
|
73
|
-
});
|
|
74
|
-
}, []);
|
|
75
|
-
const handleSendMessage = () => {
|
|
76
|
-
var _a;
|
|
77
|
-
setIsNewChat == null ? void 0 : setIsNewChat(false);
|
|
78
|
-
setInputValue("");
|
|
79
|
-
(_a = inputRef.current) == null ? void 0 : _a.blur();
|
|
80
|
-
const newUserChat = {
|
|
81
|
-
id: userChats.length + 1,
|
|
82
|
-
text: inputValue,
|
|
83
|
-
role: "user",
|
|
84
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
85
|
-
};
|
|
86
|
-
setUserChats((prev) => [...prev, newUserChat]);
|
|
87
|
-
onSendIconClick == null ? void 0 : onSendIconClick(newUserChat, activeList, uniqueId);
|
|
88
|
-
};
|
|
89
|
-
const handleStopIconClick = () => {
|
|
90
|
-
onStopIconClick == null ? void 0 : onStopIconClick(activeList);
|
|
91
|
-
};
|
|
92
|
-
return /* @__PURE__ */ jsxs(
|
|
93
|
-
Box,
|
|
94
|
-
{
|
|
95
|
-
ref: containerRef,
|
|
96
|
-
className: `chat-input-box ${newChatScreen ? "new-chat-screen" : ""} ${customScreen ? "custom-screen" : ""}`,
|
|
97
|
-
children: [
|
|
98
|
-
showSuggestionBanner && /* @__PURE__ */ jsxs("div", { className: "suggestion-banner", children: [
|
|
99
|
-
/* @__PURE__ */ jsxs("div", { className: "suggestion-banner-content", children: [
|
|
100
|
-
/* @__PURE__ */ jsx("img", { alt: "suggestion", src: chatbotBannerIcon }),
|
|
101
|
-
/* @__PURE__ */ jsx("span", { className: "suggestion-banner-text", children: suggestionBanner.freeTextContent })
|
|
102
|
-
] }),
|
|
103
|
-
/* @__PURE__ */ jsx(
|
|
104
|
-
IconButton,
|
|
105
|
-
{
|
|
106
|
-
disableRipple: true,
|
|
107
|
-
size: "small",
|
|
108
|
-
sx: { color: "#60697D" },
|
|
109
|
-
onClick: onCloseSuggestionBanner,
|
|
110
|
-
children: /* @__PURE__ */ jsx(default_1, { fontSize: "small", sx: { fontSize: "16px" } })
|
|
111
|
-
}
|
|
112
|
-
)
|
|
113
|
-
] }),
|
|
114
|
-
customInputComponent ? customInputComponent : /* @__PURE__ */ jsx("div", { className: "chat-input-container", children: /* @__PURE__ */ jsxs(
|
|
115
|
-
"div",
|
|
116
|
-
{
|
|
117
|
-
className: `chat-input-wrapper ${isFixed ? "stacked" : ""} ${(!isFixed || inputValue === "") && !newChatScreen ? "empty" : ""} ${!newChatScreen && !isFixed ? "single-line-textarea" : ""}`,
|
|
118
|
-
style: { height },
|
|
119
|
-
children: [
|
|
120
|
-
/* @__PURE__ */ jsx(
|
|
121
|
-
TextareaAutosize,
|
|
122
|
-
{
|
|
123
|
-
ref: inputRef,
|
|
124
|
-
className: `chat-textarea ${isScrollable ? "scrollable" : ""}`,
|
|
125
|
-
minRows,
|
|
126
|
-
placeholder: t("chatBot.inputPlaceholder"),
|
|
127
|
-
value: inputValue,
|
|
128
|
-
onChange: (e) => {
|
|
129
|
-
setInputValue(e.target.value);
|
|
130
|
-
},
|
|
131
|
-
onHeightChange: handleHeightChange,
|
|
132
|
-
onKeyDown: (e) => {
|
|
133
|
-
if (e.key === "Enter" && !e.shiftKey) {
|
|
134
|
-
e.preventDefault();
|
|
135
|
-
if (inputValue.trim().length > 0) handleSendMessage();
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
),
|
|
140
|
-
/* @__PURE__ */ jsxs("div", { className: `chat-actions ${isFixed ? "fixed" : ""}`, children: [
|
|
141
|
-
handleRefresh && /* @__PURE__ */ jsx(
|
|
142
|
-
Button,
|
|
143
|
-
{
|
|
144
|
-
icon: /* @__PURE__ */ jsx("img", { alt: "refresh", src: RefreshIcon }),
|
|
145
|
-
iconPlacement: "left",
|
|
146
|
-
size: isCompact ? "medium" : "large",
|
|
147
|
-
type: "default",
|
|
148
|
-
variant: "url",
|
|
149
|
-
onClick: handleRefresh
|
|
150
|
-
}
|
|
151
|
-
),
|
|
152
|
-
handleMicClick && /* @__PURE__ */ jsx(
|
|
153
|
-
Button,
|
|
154
|
-
{
|
|
155
|
-
icon: /* @__PURE__ */ jsx("img", { alt: "mic", src: MicIcon }),
|
|
156
|
-
iconPlacement: "left",
|
|
157
|
-
size: isCompact ? "medium" : "large",
|
|
158
|
-
type: "default",
|
|
159
|
-
variant: "tertiary",
|
|
160
|
-
onClick: handleMicClick
|
|
161
|
-
}
|
|
162
|
-
),
|
|
163
|
-
handleSaveChat && /* @__PURE__ */ jsx(Tooltip, { title: t("chatBot.saveChat"), variant: "tertiary", children: /* @__PURE__ */ jsx(
|
|
164
|
-
Button,
|
|
165
|
-
{
|
|
166
|
-
icon: /* @__PURE__ */ jsx(default_1$1, {}),
|
|
167
|
-
iconPlacement: "left",
|
|
168
|
-
id: "chat-input-save-button",
|
|
169
|
-
size: isCompact ? "medium" : "large",
|
|
170
|
-
type: "default",
|
|
171
|
-
variant: "tertiary",
|
|
172
|
-
onClick: handleSaveChat
|
|
173
|
-
}
|
|
174
|
-
) }),
|
|
175
|
-
/* @__PURE__ */ jsx(
|
|
176
|
-
Button,
|
|
177
|
-
{
|
|
178
|
-
className: isStopIcon ? "stop-icon-button" : "",
|
|
179
|
-
icon: !isStopIcon ? /* @__PURE__ */ jsx("img", { alt: "send", src: SendIcon }) : /* @__PURE__ */ jsx("img", { alt: "stop", src: ChatbotStopIcon }),
|
|
180
|
-
iconPlacement: "left",
|
|
181
|
-
id: "chat-input-send-button",
|
|
182
|
-
size: isCompact ? "medium" : "large",
|
|
183
|
-
type: "default",
|
|
184
|
-
variant: "primary",
|
|
185
|
-
onClick: !isStopIcon ? handleSendMessage : handleStopIconClick
|
|
186
|
-
}
|
|
187
|
-
)
|
|
188
|
-
] })
|
|
189
|
-
]
|
|
190
|
-
}
|
|
191
|
-
) })
|
|
192
|
-
]
|
|
193
|
-
}
|
|
194
|
-
);
|
|
195
|
-
}
|
|
196
|
-
export {
|
|
197
|
-
ChatInput as default
|
|
198
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ChatbotModuleMenuProps } from './Chatbot.types';
|
|
2
|
-
|
|
3
|
-
export declare function ChatbotModuleMenu({ hideMenuArrow, onModuleClick, moduleList, activeList, hideChildren, isModuleListLoading, hideSmartBotIcon, hideCenterOptions, threadList: threadListProp, activeThread: activeThreadProp, handleSavedChat, onClose, isFullWidth, handleCloseThread: handleCloseThreadProp, handleThreadClick, onMinimiseChatBot, dragHandleProps, isCollapsed, onToggleCollapse, }: ChatbotModuleMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
//# sourceMappingURL=chatbotModuleMenu.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chatbotModuleMenu.d.ts","sourceRoot":"","sources":["../../../src/components/Chatbot/chatbotModuleMenu.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAS9D,wBAAgB,iBAAiB,CAAC,EAChC,aAAa,EACb,aAAa,EACb,UAAU,EACV,UAAU,EACV,YAAoB,EACpB,mBAAmB,EACnB,gBAAwB,EACxB,iBAAyB,EACzB,UAAU,EAAE,cAAmB,EAC/B,YAAY,EAAE,gBAAgB,EAC9B,eAAe,EACf,OAAO,EACP,WAAW,EACX,iBAAiB,EAAE,qBAAqB,EACxC,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,WAAmB,EACnB,gBAAgB,GACjB,EAAE,sBAAsB,2CAgOxB"}
|
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useEffect } from "react";
|
|
3
|
-
import default_1$4 from "../../node_modules/@mui/icons-material/Clear.js";
|
|
4
|
-
import default_1$1 from "../../node_modules/@mui/icons-material/KeyboardArrowDown.js";
|
|
5
|
-
import default_1 from "../../node_modules/@mui/icons-material/KeyboardArrowUp.js";
|
|
6
|
-
import default_1$2 from "../../node_modules/@mui/icons-material/RemoveRounded.js";
|
|
7
|
-
import default_1$3 from "../../node_modules/@mui/icons-material/SaveOutlined.js";
|
|
8
|
-
import { getAssetUrl } from "../../utils/assetBase.js";
|
|
9
|
-
import { Button } from "../Button/index.js";
|
|
10
|
-
import { Loader } from "../Loader/index.js";
|
|
11
|
-
import { useTranslation } from "../../i18n/useTranslation.js";
|
|
12
|
-
const ActiveIcon = getAssetUrl("icons/activeModuleIcon.svg");
|
|
13
|
-
const HomeIcon = getAssetUrl("icons/chat-home-icon.svg");
|
|
14
|
-
const CloseThreadIcon = getAssetUrl("icons/close.svg");
|
|
15
|
-
const SmartBotIcon = getAssetUrl("icons/smartBotAlan.svg");
|
|
16
|
-
const CollapseIcon = getAssetUrl("icons/Collapse.svg");
|
|
17
|
-
const ExpandIcon = getAssetUrl("icons/expand-icon.svg");
|
|
18
|
-
function ChatbotModuleMenu({
|
|
19
|
-
hideMenuArrow,
|
|
20
|
-
onModuleClick,
|
|
21
|
-
moduleList,
|
|
22
|
-
activeList,
|
|
23
|
-
hideChildren = false,
|
|
24
|
-
isModuleListLoading,
|
|
25
|
-
hideSmartBotIcon = false,
|
|
26
|
-
hideCenterOptions = false,
|
|
27
|
-
threadList: threadListProp = [],
|
|
28
|
-
activeThread: activeThreadProp,
|
|
29
|
-
handleSavedChat,
|
|
30
|
-
onClose,
|
|
31
|
-
isFullWidth,
|
|
32
|
-
handleCloseThread: handleCloseThreadProp,
|
|
33
|
-
handleThreadClick,
|
|
34
|
-
onMinimiseChatBot,
|
|
35
|
-
dragHandleProps,
|
|
36
|
-
isCollapsed = false,
|
|
37
|
-
onToggleCollapse
|
|
38
|
-
}) {
|
|
39
|
-
var _a;
|
|
40
|
-
const { t } = useTranslation();
|
|
41
|
-
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
|
|
42
|
-
const [activeModule, setActiveModule] = useState(
|
|
43
|
-
((_a = moduleList.find((module) => module.isActive)) == null ? void 0 : _a.name) || ""
|
|
44
|
-
);
|
|
45
|
-
const [threadList, setThreadList] = useState(threadListProp);
|
|
46
|
-
const [activeThread, setActiveThread] = useState(activeThreadProp || threadListProp[0]);
|
|
47
|
-
const handleCloseThread = (e, idx) => {
|
|
48
|
-
e.stopPropagation();
|
|
49
|
-
e.preventDefault();
|
|
50
|
-
if (handleCloseThreadProp) {
|
|
51
|
-
handleCloseThreadProp(e, idx);
|
|
52
|
-
} else {
|
|
53
|
-
const newThreadList = [...threadList];
|
|
54
|
-
newThreadList.splice(idx, 1);
|
|
55
|
-
setThreadList(newThreadList);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
useEffect(() => {
|
|
59
|
-
const handleClickOutside = (e) => {
|
|
60
|
-
const target = e.target;
|
|
61
|
-
if (!target.closest(".chatbot-component-header-dropdown-container")) {
|
|
62
|
-
setIsDropdownOpen(false);
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
document.addEventListener("mousedown", handleClickOutside);
|
|
66
|
-
return () => {
|
|
67
|
-
document.removeEventListener("mousedown", handleClickOutside);
|
|
68
|
-
};
|
|
69
|
-
}, []);
|
|
70
|
-
return /* @__PURE__ */ jsxs(
|
|
71
|
-
"div",
|
|
72
|
-
{
|
|
73
|
-
className: `conversation-screen-container-header ${dragHandleProps ? "draggable" : ""} ${isCollapsed ? "collapsed" : ""}`,
|
|
74
|
-
onPointerDown: dragHandleProps == null ? void 0 : dragHandleProps.onPointerDown,
|
|
75
|
-
children: [
|
|
76
|
-
/* @__PURE__ */ jsxs("div", { className: "left_logo_arrow_container", children: [
|
|
77
|
-
!hideSmartBotIcon && /* @__PURE__ */ jsx("div", { className: "conversation_chatbot_logo_container", children: /* @__PURE__ */ jsx("img", { alt: "smartbot", draggable: false, src: SmartBotIcon }) }),
|
|
78
|
-
!hideMenuArrow && /* @__PURE__ */ jsxs("div", { className: "menu_arrow", children: [
|
|
79
|
-
/* @__PURE__ */ jsx(
|
|
80
|
-
Button,
|
|
81
|
-
{
|
|
82
|
-
icon: isDropdownOpen ? /* @__PURE__ */ jsx(default_1, {}) : /* @__PURE__ */ jsx(default_1$1, {}),
|
|
83
|
-
iconPlacement: "right",
|
|
84
|
-
size: hideChildren ? "small" : "medium",
|
|
85
|
-
type: "default",
|
|
86
|
-
variant: "text",
|
|
87
|
-
onClick: () => {
|
|
88
|
-
setIsDropdownOpen(!isDropdownOpen);
|
|
89
|
-
},
|
|
90
|
-
children: !hideChildren && t("chatBot.moduleMenu.module")
|
|
91
|
-
}
|
|
92
|
-
),
|
|
93
|
-
isDropdownOpen && /* @__PURE__ */ jsx(
|
|
94
|
-
"div",
|
|
95
|
-
{
|
|
96
|
-
className: `chatbot-component-header-dropdown-container ${isDropdownOpen ? "open" : ""}`,
|
|
97
|
-
children: isModuleListLoading ? /* @__PURE__ */ jsx(Loader, {}) : /* @__PURE__ */ jsx("div", { className: `item ${isCollapsed ? "isCollapsed" : ""}`, children: moduleList.map((module, idx) => /* @__PURE__ */ jsxs(
|
|
98
|
-
"div",
|
|
99
|
-
{
|
|
100
|
-
className: `item-container ${isCollapsed ? "isCollapsed" : ""}`,
|
|
101
|
-
onClick: () => {
|
|
102
|
-
setActiveModule(module.name ?? "");
|
|
103
|
-
onModuleClick == null ? void 0 : onModuleClick(module.id, module.name, activeList);
|
|
104
|
-
setIsDropdownOpen(false);
|
|
105
|
-
},
|
|
106
|
-
children: [
|
|
107
|
-
/* @__PURE__ */ jsxs("div", { className: "item-content", children: [
|
|
108
|
-
typeof module.icon === "string" ? /* @__PURE__ */ jsx("img", { alt: module.key ?? module.name, src: module.icon }) : module.icon,
|
|
109
|
-
/* @__PURE__ */ jsxs("div", { className: "item-content-text", children: [
|
|
110
|
-
/* @__PURE__ */ jsx(
|
|
111
|
-
"span",
|
|
112
|
-
{
|
|
113
|
-
className: `item-content-text-name ${isCollapsed ? "collapsed" : ""}`,
|
|
114
|
-
children: module.name
|
|
115
|
-
}
|
|
116
|
-
),
|
|
117
|
-
/* @__PURE__ */ jsx(
|
|
118
|
-
"span",
|
|
119
|
-
{
|
|
120
|
-
className: `item-content-text-description ${isCollapsed ? "collapsed" : ""}`,
|
|
121
|
-
children: module.description
|
|
122
|
-
}
|
|
123
|
-
)
|
|
124
|
-
] })
|
|
125
|
-
] }),
|
|
126
|
-
activeModule === module.name && /* @__PURE__ */ jsx("img", { alt: "active", src: ActiveIcon })
|
|
127
|
-
]
|
|
128
|
-
},
|
|
129
|
-
`${module.id ?? module.name ?? idx}`
|
|
130
|
-
)) })
|
|
131
|
-
}
|
|
132
|
-
)
|
|
133
|
-
] })
|
|
134
|
-
] }),
|
|
135
|
-
!isCollapsed && !hideCenterOptions && /* @__PURE__ */ jsxs("div", { className: "center_options_container", children: [
|
|
136
|
-
/* @__PURE__ */ jsx("div", { className: "left_tabs_container", children: /* @__PURE__ */ jsx("ul", { children: threadList.map((thread, idx) => /* @__PURE__ */ jsx(
|
|
137
|
-
"li",
|
|
138
|
-
{
|
|
139
|
-
className: `${activeThread === thread ? "active" : ""} ${thread === "Home" ? "home" : ""}`,
|
|
140
|
-
role: "tab",
|
|
141
|
-
tabIndex: 0,
|
|
142
|
-
onClick: () => {
|
|
143
|
-
setActiveThread(thread);
|
|
144
|
-
handleThreadClick == null ? void 0 : handleThreadClick(thread, idx);
|
|
145
|
-
},
|
|
146
|
-
onKeyDown: (e) => {
|
|
147
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
148
|
-
e.preventDefault();
|
|
149
|
-
setActiveThread(thread);
|
|
150
|
-
handleThreadClick == null ? void 0 : handleThreadClick(thread, idx);
|
|
151
|
-
}
|
|
152
|
-
},
|
|
153
|
-
children: thread === "Home" ? /* @__PURE__ */ jsx("img", { alt: t("chatBot.moduleMenu.homeAlt"), draggable: false, src: HomeIcon }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
154
|
-
thread,
|
|
155
|
-
/* @__PURE__ */ jsx(
|
|
156
|
-
"span",
|
|
157
|
-
{
|
|
158
|
-
className: "close_thread",
|
|
159
|
-
role: "button",
|
|
160
|
-
tabIndex: 0,
|
|
161
|
-
onKeyDown: (e) => {
|
|
162
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
163
|
-
e.preventDefault();
|
|
164
|
-
e.stopPropagation();
|
|
165
|
-
handleCloseThread(e, idx);
|
|
166
|
-
}
|
|
167
|
-
},
|
|
168
|
-
children: /* @__PURE__ */ jsx(
|
|
169
|
-
"img",
|
|
170
|
-
{
|
|
171
|
-
alt: t("chatBot.moduleMenu.closeThreadAlt"),
|
|
172
|
-
draggable: false,
|
|
173
|
-
src: CloseThreadIcon,
|
|
174
|
-
onClick: (e) => {
|
|
175
|
-
handleCloseThread(e, idx);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
)
|
|
179
|
-
}
|
|
180
|
-
)
|
|
181
|
-
] })
|
|
182
|
-
},
|
|
183
|
-
idx
|
|
184
|
-
)) }) }),
|
|
185
|
-
/* @__PURE__ */ jsx("div", { className: "right_info_container" })
|
|
186
|
-
] }),
|
|
187
|
-
/* @__PURE__ */ jsxs("div", { className: "right_close_save_icon_container", children: [
|
|
188
|
-
onMinimiseChatBot && !isFullWidth && /* @__PURE__ */ jsx("div", { className: "minimise_icon_container", children: /* @__PURE__ */ jsx(
|
|
189
|
-
Button,
|
|
190
|
-
{
|
|
191
|
-
className: "chatbot-component-header-close-icon",
|
|
192
|
-
icon: /* @__PURE__ */ jsx(default_1$2, {}),
|
|
193
|
-
size: "small",
|
|
194
|
-
type: "default",
|
|
195
|
-
variant: "text",
|
|
196
|
-
onClick: onMinimiseChatBot
|
|
197
|
-
}
|
|
198
|
-
) }),
|
|
199
|
-
handleSavedChat && /* @__PURE__ */ jsx("div", { className: "save_icon_container", children: /* @__PURE__ */ jsx(
|
|
200
|
-
Button,
|
|
201
|
-
{
|
|
202
|
-
icon: /* @__PURE__ */ jsx(default_1$3, {}),
|
|
203
|
-
iconPlacement: "left",
|
|
204
|
-
size: "small",
|
|
205
|
-
type: "default",
|
|
206
|
-
variant: "text",
|
|
207
|
-
onClick: handleSavedChat
|
|
208
|
-
}
|
|
209
|
-
) }),
|
|
210
|
-
onToggleCollapse && !isFullWidth && /* @__PURE__ */ jsx("div", { className: "collapse_icon_container", children: /* @__PURE__ */ jsx(
|
|
211
|
-
Button,
|
|
212
|
-
{
|
|
213
|
-
"aria-label": isCollapsed ? "Expand chatbot" : "Collapse chatbot",
|
|
214
|
-
icon: /* @__PURE__ */ jsx(
|
|
215
|
-
"img",
|
|
216
|
-
{
|
|
217
|
-
alt: "",
|
|
218
|
-
draggable: false,
|
|
219
|
-
height: isCollapsed ? 24 : 26,
|
|
220
|
-
src: isCollapsed ? ExpandIcon : CollapseIcon,
|
|
221
|
-
width: isCollapsed ? 24 : 26
|
|
222
|
-
}
|
|
223
|
-
),
|
|
224
|
-
size: "small",
|
|
225
|
-
type: "default",
|
|
226
|
-
variant: "text",
|
|
227
|
-
onClick: onToggleCollapse
|
|
228
|
-
}
|
|
229
|
-
) }),
|
|
230
|
-
!isFullWidth && /* @__PURE__ */ jsx("div", { className: "close_icon_container", children: /* @__PURE__ */ jsx(
|
|
231
|
-
Button,
|
|
232
|
-
{
|
|
233
|
-
icon: /* @__PURE__ */ jsx(default_1$4, {}),
|
|
234
|
-
iconPlacement: "left",
|
|
235
|
-
size: "small",
|
|
236
|
-
type: "default",
|
|
237
|
-
variant: "text",
|
|
238
|
-
onClick: onClose
|
|
239
|
-
}
|
|
240
|
-
) })
|
|
241
|
-
] })
|
|
242
|
-
]
|
|
243
|
-
}
|
|
244
|
-
);
|
|
245
|
-
}
|
|
246
|
-
export {
|
|
247
|
-
ChatbotModuleMenu
|
|
248
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constant.d.ts","sourceRoot":"","sources":["../../../src/components/Chatbot/constant.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAQ/C,eAAO,MAAM,SAAS,EAAE,OAAO,EAS9B,CAAC;AACF,eAAO,MAAM,gBAAgB,EAAE,OAAO,EAA4C,CAAC;AACnF,eAAO,MAAM,eAAe,EAAE,OAI7B,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { getAssetUrl } from "../../utils/assetBase.js";
|
|
2
|
-
const NotificationIcon = getAssetUrl("icons/bell.svg");
|
|
3
|
-
const BookMarkIcon = getAssetUrl("icons/bookmarkIcon.svg");
|
|
4
|
-
const HistoryIcon = getAssetUrl("icons/historyIcon.svg");
|
|
5
|
-
const NewChatIcon = getAssetUrl("icons/newChatIcon.svg");
|
|
6
|
-
const PageIcon = getAssetUrl("icons/pageIcon.svg");
|
|
7
|
-
const menuItems = [
|
|
8
|
-
{ key: "bookmark", icon: BookMarkIcon },
|
|
9
|
-
{ key: "history", icon: HistoryIcon },
|
|
10
|
-
{ key: "page", icon: PageIcon },
|
|
11
|
-
{
|
|
12
|
-
key: "notification",
|
|
13
|
-
icon: NotificationIcon,
|
|
14
|
-
iconClassName: "chatbot-component-menu-container-icon-notification"
|
|
15
|
-
}
|
|
16
|
-
];
|
|
17
|
-
const mandatoryTabList = [{ key: "history", icon: HistoryIcon }];
|
|
18
|
-
const newChatMenuItem = {
|
|
19
|
-
key: "newchat",
|
|
20
|
-
icon: NewChatIcon,
|
|
21
|
-
className: "chatbot-component-menu-container-icon-new-chat"
|
|
22
|
-
};
|
|
23
|
-
export {
|
|
24
|
-
mandatoryTabList,
|
|
25
|
-
menuItems,
|
|
26
|
-
newChatMenuItem
|
|
27
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ConversationScreenProps } from './Chatbot.types';
|
|
2
|
-
|
|
3
|
-
export declare function ConversationScreen({ userChats, setUserChats, onSendIconClick, conversation, isAssistantThinking, thinking, activeList, onLikeClick, onDislikeClick, inputText, handleRefresh, handleSaveChat, handleMicClick, suggestionBanner, isStopIcon, onStopIconClick, onCloseSuggestionBanner, showSuggestionBanner, customInputComponent, footerText, isCollapsed, }: ConversationScreenProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
//# sourceMappingURL=conversationScreen.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"conversationScreen.d.ts","sourceRoot":"","sources":["../../../src/components/Chatbot/conversationScreen.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAe,uBAAuB,EAAsB,MAAM,iBAAiB,CAAC;AAGhG,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,EACT,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,QAAQ,EACR,UAAU,EACV,WAAW,EACX,cAAc,EACd,SAAS,EACT,aAAa,EACb,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,UAAU,EACV,WAAW,GACZ,EAAE,uBAAuB,2CA8NzB"}
|