impact-ui 5.0.4-alpha.2 → 5.0.4-chatbot.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/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/ThumbDownOutlined.js +4 -0
- package/dist/_virtual/ThumbUpOutlined.js +4 -0
- package/dist/_virtual/VolumeUpOutlined.js +4 -0
- package/dist/_virtual/index10.js +3 -3
- package/dist/_virtual/index11.js +3 -3
- package/dist/_virtual/index12.js +3 -3
- package/dist/_virtual/index5.js +1 -1
- package/dist/_virtual/index6.js +3 -3
- package/dist/_virtual/index7.js +3 -3
- package/dist/_virtual/index8.js +3 -3
- package/dist/_virtual/index9.js +3 -3
- package/dist/components/Button/index.js +1 -1
- package/dist/components/Chatbot/Chatbot.types.d.ts +191 -18
- 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 +226 -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 +213 -0
- package/dist/components/Chatbot/conversationScreen.d.ts +1 -1
- package/dist/components/Chatbot/conversationScreen.d.ts.map +1 -1
- package/dist/components/Chatbot/conversationScreen.js +5 -3
- package/dist/components/Chatbot/index.d.ts +2 -2
- package/dist/components/Chatbot/index.d.ts.map +1 -1
- package/dist/components/Chatbot/index.js +100 -50
- 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 +470 -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 +311 -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 +387 -70
- 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/TableV36/Table.types.d.ts +8 -7
- package/dist/components/TableV36/Table.types.d.ts.map +1 -1
- package/dist/components/TableV36/index.d.ts.map +1 -1
- package/dist/components/TableV36/index.js +39 -110
- package/dist/components/TableV36/tableFunctions.d.ts.map +1 -1
- package/dist/components/TableV36/tableFunctions.js +15 -14
- package/dist/components/TableV36/tableUtils.d.ts +0 -14
- package/dist/components/TableV36/tableUtils.d.ts.map +1 -1
- package/dist/components/TableV36/tableUtils.js +0 -32
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/locales/de-DE.json.d.ts +51 -0
- package/dist/locales/de-DE.json.js +51 -0
- package/dist/locales/en-US.json.d.ts +51 -0
- package/dist/locales/en-US.json.js +51 -0
- package/dist/locales/es-ES.json.d.ts +51 -0
- package/dist/locales/es-ES.json.js +51 -0
- package/dist/mcp-component-registry.json +257 -188
- package/dist/node_modules/@impactsmartsuite/impact-icons/dist/index.js +280 -48
- 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/ThumbDownOutlined.js +17 -0
- package/dist/node_modules/@mui/icons-material/ThumbUpOutlined.js +17 -0
- package/dist/node_modules/@mui/icons-material/VolumeUpOutlined.js +17 -0
- package/dist/node_modules/@mui/system/colorManipulator.js +2 -2
- package/dist/node_modules/@mui/system/createStyled.js +6 -6
- package/dist/node_modules/@mui/system/useThemeWithoutDefault.js +1 -1
- package/dist/stories/chatBotApiMock.d.ts +476 -0
- package/dist/stories/chatBotApiMock.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useState } from "react";
|
|
3
|
+
import default_1 from "../../node_modules/@mui/icons-material/Add.js";
|
|
4
|
+
import default_1$1 from "../../node_modules/@mui/icons-material/AttachFileOutlined.js";
|
|
5
|
+
import default_1$3 from "../../node_modules/@mui/icons-material/KeyboardArrowDown.js";
|
|
6
|
+
import default_1$2 from "../../node_modules/@mui/icons-material/KeyboardArrowUp.js";
|
|
7
|
+
import { ChatBotMicIcon as ChatBotMicIcon_default } from "../../node_modules/@impactsmartsuite/impact-icons/dist/index.js";
|
|
8
|
+
import default_1$4 from "../../node_modules/@mui/icons-material/StopRounded.js";
|
|
9
|
+
import default_1$5 from "../../node_modules/@mui/icons-material/NorthRounded.js";
|
|
10
|
+
import TextareaAutosize from "react-textarea-autosize";
|
|
11
|
+
import { Button } from "../Button/index.js";
|
|
12
|
+
import { Menu } from "../Menu/index.js";
|
|
13
|
+
import { Tooltip } from "../Tooltip/index.js";
|
|
14
|
+
import { useTranslation } from "../../i18n/useTranslation.js";
|
|
15
|
+
const DEFAULT_MODEL = { label: "Auto", value: "auto" };
|
|
16
|
+
const COMPOSER_ACTION_SELECTOR = 'button, a, input, textarea, select, label, [role="button"], [role="menuitem"]';
|
|
17
|
+
function ChatbotComposer({
|
|
18
|
+
inputValue,
|
|
19
|
+
setInputValue,
|
|
20
|
+
handleMicClick,
|
|
21
|
+
customInputComponent,
|
|
22
|
+
modelOptions,
|
|
23
|
+
selectedModel,
|
|
24
|
+
onModelChange,
|
|
25
|
+
onAddClick,
|
|
26
|
+
onAttachClick,
|
|
27
|
+
onSend,
|
|
28
|
+
onStop,
|
|
29
|
+
isStopIcon = false,
|
|
30
|
+
placeholder
|
|
31
|
+
}) {
|
|
32
|
+
const { t } = useTranslation();
|
|
33
|
+
const composerRef = useRef(null);
|
|
34
|
+
const textareaRef = useRef(null);
|
|
35
|
+
const [modelAnchorEl, setModelAnchorEl] = useState(null);
|
|
36
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
37
|
+
const isModelOpen = Boolean(modelAnchorEl);
|
|
38
|
+
const hasContent = inputValue.trim().length > 0;
|
|
39
|
+
const isActive = isFocused || hasContent;
|
|
40
|
+
const options = (modelOptions == null ? void 0 : modelOptions.length) ? modelOptions : [DEFAULT_MODEL];
|
|
41
|
+
const activeOption = options.find((option) => option.value === selectedModel) ?? options[0] ?? DEFAULT_MODEL;
|
|
42
|
+
const handleModelClose = () => {
|
|
43
|
+
setModelAnchorEl(null);
|
|
44
|
+
};
|
|
45
|
+
const handleSend = () => {
|
|
46
|
+
if (!hasContent || isStopIcon) return;
|
|
47
|
+
onSend == null ? void 0 : onSend();
|
|
48
|
+
};
|
|
49
|
+
const handleBoxMouseDown = (event) => {
|
|
50
|
+
var _a;
|
|
51
|
+
const target = event.target;
|
|
52
|
+
if (target == null ? void 0 : target.closest(COMPOSER_ACTION_SELECTOR)) return;
|
|
53
|
+
event.preventDefault();
|
|
54
|
+
(_a = textareaRef.current) == null ? void 0 : _a.focus();
|
|
55
|
+
};
|
|
56
|
+
if (customInputComponent) {
|
|
57
|
+
return /* @__PURE__ */ jsx("div", { className: "chatbot-composer", children: customInputComponent });
|
|
58
|
+
}
|
|
59
|
+
return /* @__PURE__ */ jsx(
|
|
60
|
+
"form",
|
|
61
|
+
{
|
|
62
|
+
ref: composerRef,
|
|
63
|
+
className: "chatbot-composer",
|
|
64
|
+
onSubmit: (event) => {
|
|
65
|
+
event.preventDefault();
|
|
66
|
+
handleSend();
|
|
67
|
+
},
|
|
68
|
+
children: /* @__PURE__ */ jsxs(
|
|
69
|
+
"div",
|
|
70
|
+
{
|
|
71
|
+
className: [
|
|
72
|
+
"chatbot-composer-box",
|
|
73
|
+
isActive ? "is-active" : "",
|
|
74
|
+
hasContent ? "has-content" : "",
|
|
75
|
+
isStopIcon ? "is-stopping" : ""
|
|
76
|
+
].filter(Boolean).join(" "),
|
|
77
|
+
onMouseDown: handleBoxMouseDown,
|
|
78
|
+
children: [
|
|
79
|
+
/* @__PURE__ */ jsx(
|
|
80
|
+
TextareaAutosize,
|
|
81
|
+
{
|
|
82
|
+
ref: textareaRef,
|
|
83
|
+
"aria-label": placeholder ?? t("chatBot.irisInputPlaceholder"),
|
|
84
|
+
className: "chatbot-composer-textarea",
|
|
85
|
+
maxRows: 6,
|
|
86
|
+
minRows: 1,
|
|
87
|
+
id: "chatbot-composer-textarea",
|
|
88
|
+
name: "chatbot-composer-textarea",
|
|
89
|
+
placeholder: placeholder ?? t("chatBot.irisInputPlaceholder"),
|
|
90
|
+
value: inputValue,
|
|
91
|
+
onBlur: () => {
|
|
92
|
+
setIsFocused(false);
|
|
93
|
+
},
|
|
94
|
+
onChange: (event) => {
|
|
95
|
+
setInputValue(event.target.value);
|
|
96
|
+
},
|
|
97
|
+
onFocus: () => {
|
|
98
|
+
setIsFocused(true);
|
|
99
|
+
},
|
|
100
|
+
onKeyDown: (event) => {
|
|
101
|
+
if (event.key === "Enter" && !event.shiftKey) {
|
|
102
|
+
event.preventDefault();
|
|
103
|
+
handleSend();
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
),
|
|
108
|
+
/* @__PURE__ */ jsxs("div", { className: "chatbot-composer-toolbar", children: [
|
|
109
|
+
/* @__PURE__ */ jsxs("div", { className: "chatbot-composer-toolbar-left", children: [
|
|
110
|
+
/* @__PURE__ */ jsx(Tooltip, { title: t("chatBot.composer.add"), variant: "tertiary", children: /* @__PURE__ */ jsx(
|
|
111
|
+
Button,
|
|
112
|
+
{
|
|
113
|
+
"aria-label": t("chatBot.composer.add"),
|
|
114
|
+
className: "chatbot-composer-icon-button",
|
|
115
|
+
icon: /* @__PURE__ */ jsx(default_1, { fontSize: "small" }),
|
|
116
|
+
type: "default",
|
|
117
|
+
variant: "text",
|
|
118
|
+
onClick: onAddClick
|
|
119
|
+
}
|
|
120
|
+
) }),
|
|
121
|
+
/* @__PURE__ */ jsx(Tooltip, { title: t("chatBot.composer.attach"), variant: "tertiary", children: /* @__PURE__ */ jsx(
|
|
122
|
+
Button,
|
|
123
|
+
{
|
|
124
|
+
"aria-label": t("chatBot.composer.attach"),
|
|
125
|
+
className: "chatbot-composer-icon-button",
|
|
126
|
+
icon: /* @__PURE__ */ jsx(default_1$1, { fontSize: "small" }),
|
|
127
|
+
type: "default",
|
|
128
|
+
variant: "text",
|
|
129
|
+
onClick: onAttachClick
|
|
130
|
+
}
|
|
131
|
+
) })
|
|
132
|
+
] }),
|
|
133
|
+
/* @__PURE__ */ jsxs("div", { className: "chatbot-composer-toolbar-right", children: [
|
|
134
|
+
/* @__PURE__ */ jsxs("div", { className: "chatbot-composer-model", children: [
|
|
135
|
+
/* @__PURE__ */ jsx(Tooltip, { title: t("chatBot.composer.model"), variant: "tertiary", children: /* @__PURE__ */ jsx(
|
|
136
|
+
Button,
|
|
137
|
+
{
|
|
138
|
+
"aria-controls": isModelOpen ? "chatbot-composer-model-menu" : void 0,
|
|
139
|
+
"aria-expanded": isModelOpen,
|
|
140
|
+
"aria-haspopup": "true",
|
|
141
|
+
"aria-label": t("chatBot.composer.model"),
|
|
142
|
+
className: "chatbot-composer-model-trigger",
|
|
143
|
+
icon: isModelOpen ? /* @__PURE__ */ jsx(default_1$2, { fontSize: "small" }) : /* @__PURE__ */ jsx(default_1$3, { fontSize: "small" }),
|
|
144
|
+
iconPlacement: "right",
|
|
145
|
+
variant: "text",
|
|
146
|
+
onClick: (event) => {
|
|
147
|
+
setModelAnchorEl(isModelOpen ? null : event.currentTarget);
|
|
148
|
+
},
|
|
149
|
+
children: activeOption.label
|
|
150
|
+
}
|
|
151
|
+
) }),
|
|
152
|
+
/* @__PURE__ */ jsx(
|
|
153
|
+
Menu,
|
|
154
|
+
{
|
|
155
|
+
MenuProps: {
|
|
156
|
+
anchorOrigin: {
|
|
157
|
+
vertical: "top",
|
|
158
|
+
horizontal: "left"
|
|
159
|
+
},
|
|
160
|
+
transformOrigin: {
|
|
161
|
+
vertical: "bottom",
|
|
162
|
+
horizontal: "left"
|
|
163
|
+
},
|
|
164
|
+
PaperProps: {
|
|
165
|
+
style: {
|
|
166
|
+
width: 200
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
anchorEl: modelAnchorEl,
|
|
171
|
+
id: "chatbot-composer-model-menu",
|
|
172
|
+
open: isModelOpen,
|
|
173
|
+
options: options.map((option) => ({
|
|
174
|
+
label: option.label,
|
|
175
|
+
value: option.value,
|
|
176
|
+
onClick: () => {
|
|
177
|
+
onModelChange == null ? void 0 : onModelChange(option.value);
|
|
178
|
+
handleModelClose();
|
|
179
|
+
}
|
|
180
|
+
})),
|
|
181
|
+
selected: { value: activeOption.value },
|
|
182
|
+
onClose: handleModelClose
|
|
183
|
+
}
|
|
184
|
+
)
|
|
185
|
+
] }),
|
|
186
|
+
handleMicClick && /* @__PURE__ */ jsx(Tooltip, { title: t("chatBot.composer.mic"), variant: "tertiary", children: /* @__PURE__ */ jsx(
|
|
187
|
+
Button,
|
|
188
|
+
{
|
|
189
|
+
"aria-label": t("chatBot.composer.mic"),
|
|
190
|
+
className: "chatbot-composer-icon-button",
|
|
191
|
+
icon: /* @__PURE__ */ jsx(ChatBotMicIcon_default, { height: 16, width: 16 }),
|
|
192
|
+
type: "default",
|
|
193
|
+
variant: "text",
|
|
194
|
+
onClick: handleMicClick
|
|
195
|
+
}
|
|
196
|
+
) }),
|
|
197
|
+
isStopIcon ? /* @__PURE__ */ jsx(Tooltip, { title: t("chatBot.composer.stop"), variant: "tertiary", children: /* @__PURE__ */ jsx(
|
|
198
|
+
Button,
|
|
199
|
+
{
|
|
200
|
+
"aria-label": t("chatBot.composer.stop"),
|
|
201
|
+
icon: /* @__PURE__ */ jsx(default_1$4, { height: 16, width: 16 }),
|
|
202
|
+
type: "default",
|
|
203
|
+
variant: "primary",
|
|
204
|
+
onClick: onStop
|
|
205
|
+
}
|
|
206
|
+
) }) : hasContent && /* @__PURE__ */ jsx(Tooltip, { title: t("chatBot.composer.send"), variant: "tertiary", children: /* @__PURE__ */ jsx(
|
|
207
|
+
Button,
|
|
208
|
+
{
|
|
209
|
+
"aria-label": t("chatBot.composer.send"),
|
|
210
|
+
htmlType: "submit",
|
|
211
|
+
icon: /* @__PURE__ */ jsx(default_1$5, { fontSize: "small" }),
|
|
212
|
+
type: "default",
|
|
213
|
+
variant: "primary"
|
|
214
|
+
}
|
|
215
|
+
) })
|
|
216
|
+
] })
|
|
217
|
+
] })
|
|
218
|
+
]
|
|
219
|
+
}
|
|
220
|
+
)
|
|
221
|
+
}
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
export {
|
|
225
|
+
ChatbotComposer
|
|
226
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ChatbotGreetingHeaderProps } from './Chatbot.types';
|
|
2
|
+
|
|
3
|
+
export declare function ChatbotGreetingHeader({ title, variant, onClose, onMenuClick, onBackClick, onNewChatClick, onToggleCollapse, onMinimiseChatBot, isCollapsed, isFullWidth, dragHandleProps, }: ChatbotGreetingHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
//# sourceMappingURL=chatbotGreetingHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatbotGreetingHeader.d.ts","sourceRoot":"","sources":["../../../src/components/Chatbot/chatbotGreetingHeader.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAKlE,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,OAAoB,EACpB,OAAO,EACP,WAAW,EACX,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,WAAmB,EACnB,WAAmB,EACnB,eAAe,GAChB,EAAE,0BAA0B,2CAkN5B"}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import default_1 from "../../node_modules/@mui/icons-material/ArrowBack.js";
|
|
4
|
+
import default_1$2 from "../../node_modules/@mui/icons-material/Clear.js";
|
|
5
|
+
import default_1$1 from "../../node_modules/@mui/icons-material/Menu.js";
|
|
6
|
+
import { ChatbotNewChat as ChatbotNewChat_default, ChatbotCollapse as ChatbotCollapse_default, ChatbotWindow as ChatbotWindow_default, ChatbotSidebar as ChatbotSidebar_default, ChatbotFloating as ChatbotFloating_default, ChatbotFullScreen as ChatbotFullScreen_default } from "../../node_modules/@impactsmartsuite/impact-icons/dist/index.js";
|
|
7
|
+
import { getAssetUrl } from "../../utils/assetBase.js";
|
|
8
|
+
import { Button } from "../Button/index.js";
|
|
9
|
+
import { Menu } from "../Menu/index.js";
|
|
10
|
+
import { Tooltip } from "../Tooltip/index.js";
|
|
11
|
+
import { useTranslation } from "../../i18n/useTranslation.js";
|
|
12
|
+
const IrisMark = getAssetUrl("icons/smartBotAlan.svg");
|
|
13
|
+
const HEADER_ICON_SIZE = 16;
|
|
14
|
+
function ChatbotGreetingHeader({
|
|
15
|
+
title,
|
|
16
|
+
variant = "greeting",
|
|
17
|
+
onClose,
|
|
18
|
+
onMenuClick,
|
|
19
|
+
onBackClick,
|
|
20
|
+
onNewChatClick,
|
|
21
|
+
onToggleCollapse,
|
|
22
|
+
onMinimiseChatBot,
|
|
23
|
+
isCollapsed = false,
|
|
24
|
+
isFullWidth = false,
|
|
25
|
+
dragHandleProps
|
|
26
|
+
}) {
|
|
27
|
+
const { t } = useTranslation();
|
|
28
|
+
const [windowAnchorEl, setWindowAnchorEl] = useState(null);
|
|
29
|
+
const isWindowMenuOpen = Boolean(windowAnchorEl);
|
|
30
|
+
const selectedLayout = isCollapsed ? "collapse" : "sidebar";
|
|
31
|
+
const isConversation = variant === "conversation";
|
|
32
|
+
const isMenuOrList = variant === "menu" || variant === "list";
|
|
33
|
+
const showNewChat = (isConversation || isMenuOrList) && Boolean(onNewChatClick);
|
|
34
|
+
const handleToggleLayout = () => {
|
|
35
|
+
onToggleCollapse == null ? void 0 : onToggleCollapse();
|
|
36
|
+
onMinimiseChatBot == null ? void 0 : onMinimiseChatBot();
|
|
37
|
+
};
|
|
38
|
+
const handleWindowMenuClose = () => {
|
|
39
|
+
setWindowAnchorEl(null);
|
|
40
|
+
};
|
|
41
|
+
const showWindowControls = Boolean(onToggleCollapse) && !isFullWidth;
|
|
42
|
+
const handleHeaderPointerDown = (event) => {
|
|
43
|
+
var _a;
|
|
44
|
+
if (isWindowMenuOpen) return;
|
|
45
|
+
(_a = dragHandleProps == null ? void 0 : dragHandleProps.onPointerDown) == null ? void 0 : _a.call(dragHandleProps, event);
|
|
46
|
+
};
|
|
47
|
+
return /* @__PURE__ */ jsxs(
|
|
48
|
+
"header",
|
|
49
|
+
{
|
|
50
|
+
className: `chatbot-greeting-header ${dragHandleProps && !isWindowMenuOpen ? "is-draggable" : ""}${isConversation || isMenuOrList ? " is-conversation" : ""}`,
|
|
51
|
+
onPointerDown: handleHeaderPointerDown,
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ jsxs("div", { className: "chatbot-greeting-header-left", children: [
|
|
54
|
+
isMenuOrList ? /* @__PURE__ */ jsx(Tooltip, { title: t("chatBot.irisMenu.back"), variant: "tertiary", children: /* @__PURE__ */ jsx(
|
|
55
|
+
Button,
|
|
56
|
+
{
|
|
57
|
+
"aria-label": t("chatBot.irisMenu.back"),
|
|
58
|
+
className: "chatbot-greeting-header-button-ghost",
|
|
59
|
+
icon: /* @__PURE__ */ jsx(default_1, { fontSize: "small" }),
|
|
60
|
+
size: isCollapsed ? "small" : "large",
|
|
61
|
+
type: "default",
|
|
62
|
+
variant: "text",
|
|
63
|
+
onClick: onBackClick,
|
|
64
|
+
onPointerDown: (event) => event.stopPropagation()
|
|
65
|
+
}
|
|
66
|
+
) }) : /* @__PURE__ */ jsx(Tooltip, { title: t("chatBot.greeting.menu"), variant: "tertiary", children: /* @__PURE__ */ jsx(
|
|
67
|
+
Button,
|
|
68
|
+
{
|
|
69
|
+
"aria-label": t("chatBot.greeting.menu"),
|
|
70
|
+
className: "chatbot-greeting-header-button-ghost",
|
|
71
|
+
icon: /* @__PURE__ */ jsx(default_1$1, { fontSize: "small" }),
|
|
72
|
+
size: isCollapsed ? "small" : "large",
|
|
73
|
+
type: "default",
|
|
74
|
+
variant: "text",
|
|
75
|
+
onClick: onMenuClick,
|
|
76
|
+
onPointerDown: (event) => event.stopPropagation()
|
|
77
|
+
}
|
|
78
|
+
) }),
|
|
79
|
+
isConversation || isMenuOrList ? /* @__PURE__ */ jsx("h1", { className: "chatbot-greeting-conversation-title", children: title ?? (isMenuOrList ? t("chatBot.irisMenu.title") : t("chatBot.greeting.brand")) }) : /* @__PURE__ */ jsxs("div", { className: "chatbot-greeting-brand", children: [
|
|
80
|
+
/* @__PURE__ */ jsx("img", { alt: "", className: "chatbot-greeting-brand-mark", src: IrisMark }),
|
|
81
|
+
/* @__PURE__ */ jsx("span", { className: "chatbot-greeting-brand-title", children: title ?? t("chatBot.greeting.brand") })
|
|
82
|
+
] })
|
|
83
|
+
] }),
|
|
84
|
+
/* @__PURE__ */ jsxs("div", { className: "chatbot-greeting-header-right", children: [
|
|
85
|
+
showNewChat && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
86
|
+
/* @__PURE__ */ jsx(Tooltip, { title: t("chatBot.menu.newChat"), variant: "tertiary", children: /* @__PURE__ */ jsx(
|
|
87
|
+
Button,
|
|
88
|
+
{
|
|
89
|
+
"aria-label": t("chatBot.menu.newChat"),
|
|
90
|
+
icon: /* @__PURE__ */ jsx(ChatbotNewChat_default, {}),
|
|
91
|
+
type: "default",
|
|
92
|
+
variant: "tertiary",
|
|
93
|
+
onClick: onNewChatClick,
|
|
94
|
+
onPointerDown: (event) => event.stopPropagation(),
|
|
95
|
+
size: isCollapsed ? "medium" : "large"
|
|
96
|
+
}
|
|
97
|
+
) }),
|
|
98
|
+
showWindowControls && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "chatbot-greeting-header-divider" })
|
|
99
|
+
] }),
|
|
100
|
+
showWindowControls && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
101
|
+
/* @__PURE__ */ jsx(Tooltip, { title: t("chatBot.greeting.window"), variant: "tertiary", children: /* @__PURE__ */ jsx(
|
|
102
|
+
Button,
|
|
103
|
+
{
|
|
104
|
+
"aria-controls": isWindowMenuOpen ? "chatbot-greeting-window-menu" : void 0,
|
|
105
|
+
"aria-expanded": isWindowMenuOpen,
|
|
106
|
+
"aria-haspopup": "true",
|
|
107
|
+
"aria-label": t("chatBot.greeting.window"),
|
|
108
|
+
className: [
|
|
109
|
+
"chatbot-greeting-header-window",
|
|
110
|
+
isWindowMenuOpen ? "chatbot-greeting-header-button-active" : ""
|
|
111
|
+
].filter(Boolean).join(" "),
|
|
112
|
+
icon: isCollapsed ? /* @__PURE__ */ jsx(ChatbotCollapse_default, { height: HEADER_ICON_SIZE, width: HEADER_ICON_SIZE }) : /* @__PURE__ */ jsx(ChatbotWindow_default, { height: HEADER_ICON_SIZE, width: HEADER_ICON_SIZE }),
|
|
113
|
+
size: isCollapsed ? "medium" : "large",
|
|
114
|
+
type: "default",
|
|
115
|
+
variant: "text",
|
|
116
|
+
onClick: (event) => {
|
|
117
|
+
setWindowAnchorEl(isWindowMenuOpen ? null : event.currentTarget);
|
|
118
|
+
},
|
|
119
|
+
onPointerDown: (event) => event.stopPropagation()
|
|
120
|
+
}
|
|
121
|
+
) }),
|
|
122
|
+
/* @__PURE__ */ jsx(
|
|
123
|
+
Menu,
|
|
124
|
+
{
|
|
125
|
+
MenuProps: {
|
|
126
|
+
anchorOrigin: {
|
|
127
|
+
vertical: "bottom",
|
|
128
|
+
horizontal: "right"
|
|
129
|
+
},
|
|
130
|
+
transformOrigin: {
|
|
131
|
+
vertical: "top",
|
|
132
|
+
horizontal: "right"
|
|
133
|
+
},
|
|
134
|
+
// Chatbot shell is z-index 1300; keep the menu above so collapsed-drag
|
|
135
|
+
// hits don't steal clicks from menu items / backdrop.
|
|
136
|
+
slotProps: {
|
|
137
|
+
root: {
|
|
138
|
+
sx: { zIndex: 2e3 }
|
|
139
|
+
},
|
|
140
|
+
paper: {
|
|
141
|
+
className: "chatbot-greeting-window-menu-paper",
|
|
142
|
+
style: {
|
|
143
|
+
width: 182,
|
|
144
|
+
minWidth: 180,
|
|
145
|
+
maxWidth: 240
|
|
146
|
+
},
|
|
147
|
+
onPointerDown: (event) => {
|
|
148
|
+
event.stopPropagation();
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
anchorEl: windowAnchorEl,
|
|
154
|
+
id: "chatbot-greeting-window-menu",
|
|
155
|
+
open: isWindowMenuOpen,
|
|
156
|
+
options: [
|
|
157
|
+
{
|
|
158
|
+
label: t("chatBot.greeting.layout.sidebar"),
|
|
159
|
+
value: "sidebar",
|
|
160
|
+
icon: /* @__PURE__ */ jsx(ChatbotSidebar_default, { height: 14, width: 14 }),
|
|
161
|
+
onClick: () => {
|
|
162
|
+
if (isCollapsed) handleToggleLayout();
|
|
163
|
+
handleWindowMenuClose();
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
label: t("chatBot.greeting.layout.collapse"),
|
|
168
|
+
value: "collapse",
|
|
169
|
+
icon: /* @__PURE__ */ jsx(ChatbotCollapse_default, { height: 14, width: 14 }),
|
|
170
|
+
onClick: () => {
|
|
171
|
+
if (!isCollapsed) handleToggleLayout();
|
|
172
|
+
handleWindowMenuClose();
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
label: t("chatBot.greeting.layout.floating"),
|
|
177
|
+
value: "floating",
|
|
178
|
+
icon: /* @__PURE__ */ jsx(ChatbotFloating_default, { height: 14, width: 14 }),
|
|
179
|
+
disabled: true
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
label: t("chatBot.greeting.layout.fullScreen"),
|
|
183
|
+
value: "fullScreen",
|
|
184
|
+
icon: /* @__PURE__ */ jsx(ChatbotFullScreen_default, { height: 14, width: 14 }),
|
|
185
|
+
disabled: true
|
|
186
|
+
}
|
|
187
|
+
],
|
|
188
|
+
selected: { value: selectedLayout },
|
|
189
|
+
onClose: handleWindowMenuClose
|
|
190
|
+
}
|
|
191
|
+
)
|
|
192
|
+
] }),
|
|
193
|
+
!isFullWidth && onClose && /* @__PURE__ */ jsx(Tooltip, { title: t("chatBot.closeAlt"), variant: "tertiary", children: /* @__PURE__ */ jsx(
|
|
194
|
+
Button,
|
|
195
|
+
{
|
|
196
|
+
"aria-label": t("chatBot.closeAlt"),
|
|
197
|
+
className: "chatbot-greeting-header-close",
|
|
198
|
+
icon: /* @__PURE__ */ jsx(default_1$2, { fontSize: "small" }),
|
|
199
|
+
size: isCollapsed ? "medium" : "large",
|
|
200
|
+
type: "default",
|
|
201
|
+
variant: "text",
|
|
202
|
+
onClick: onClose,
|
|
203
|
+
onPointerDown: (event) => event.stopPropagation()
|
|
204
|
+
}
|
|
205
|
+
) })
|
|
206
|
+
] })
|
|
207
|
+
]
|
|
208
|
+
}
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
export {
|
|
212
|
+
ChatbotGreetingHeader
|
|
213
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ConversationScreenProps } from './Chatbot.types';
|
|
2
2
|
|
|
3
|
-
export declare function ConversationScreen({ userChats, setUserChats, onSendIconClick, conversation, isAssistantThinking, activeList, onLikeClick, onDislikeClick, inputText, handleRefresh, handleSaveChat, handleMicClick, suggestionBanner, isStopIcon, onStopIconClick, onCloseSuggestionBanner, showSuggestionBanner, customInputComponent, footerText, isCollapsed, }: ConversationScreenProps): import("react/jsx-runtime").JSX.Element;
|
|
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
4
|
//# sourceMappingURL=conversationScreen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsxs, jsx, Fragment as Fragment$1 } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useRef, useEffect, Fragment } from "react";
|
|
3
3
|
import moment from "moment";
|
|
4
4
|
import { ChatBotFooter } from "./chatBotFooter.js";
|
|
5
5
|
import ChatInput from "./chatInput.js";
|
|
6
6
|
import { getDateLabel, formatAMPM } from "./utils.js";
|
|
7
|
+
import { IrisThinking } from "./irisThinking.js";
|
|
7
8
|
import { useTranslation } from "../../i18n/useTranslation.js";
|
|
8
9
|
function ConversationScreen({
|
|
9
10
|
userChats,
|
|
@@ -11,6 +12,7 @@ function ConversationScreen({
|
|
|
11
12
|
onSendIconClick,
|
|
12
13
|
conversation,
|
|
13
14
|
isAssistantThinking,
|
|
15
|
+
thinking,
|
|
14
16
|
activeList,
|
|
15
17
|
onLikeClick,
|
|
16
18
|
onDislikeClick,
|
|
@@ -167,14 +169,14 @@ function ConversationScreen({
|
|
|
167
169
|
] }) : null
|
|
168
170
|
] }, idx);
|
|
169
171
|
}),
|
|
170
|
-
isAssistantThinking && /* @__PURE__ */
|
|
172
|
+
isAssistantThinking && /* @__PURE__ */ jsx("div", { className: "assistant_chat_messages_container", children: thinking ? /* @__PURE__ */ jsx(IrisThinking, { thinking }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
171
173
|
/* @__PURE__ */ jsx("div", { className: "chat_logo_circle" }),
|
|
172
174
|
/* @__PURE__ */ jsxs("div", { className: `loading_messages ${isAssistantThinking ? "" : "dis_none"}`, children: [
|
|
173
175
|
/* @__PURE__ */ jsx("span", { className: "dot" }),
|
|
174
176
|
/* @__PURE__ */ jsx("span", { className: "dot" }),
|
|
175
177
|
/* @__PURE__ */ jsx("span", { className: "dot" })
|
|
176
178
|
] })
|
|
177
|
-
] })
|
|
179
|
+
] }) })
|
|
178
180
|
]
|
|
179
181
|
}
|
|
180
182
|
),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ChatbotProps } from './Chatbot.types';
|
|
2
2
|
|
|
3
|
-
export type { ChatbotProps } from './Chatbot.types';
|
|
4
|
-
export declare function ChatBotComponent({ onClose, userName, isChatBotOpen, setIsChatBotOpen, conversation,
|
|
3
|
+
export type { ChatbotProps, IrisAssistantActionKey, } from './Chatbot.types';
|
|
4
|
+
export declare function ChatBotComponent({ onClose, userName, isChatBotOpen, setIsChatBotOpen, conversation, formComponent: _formComponent, tableComponent: _tableComponent, preDefinedQuestions, addedByYouQuestions, onSendIconClick, isAssistantThinking, thinking, moduleList, onModuleClick, tabList, handleSavedChat, threadList, activeThread, isCustomScreen, customScreenJsx, onLikeClick, onDislikeClick, onRegenerateClick, onSpeakClick, onRevertClick, defaultAssistantActions, handleNewChatClick, inputText, handleRefresh, handleSaveChat, handleMicClick, hideMenuArrow, newChatScreen, isModuleListLoading, suggestionBanner, isStopIcon, onStopIconClick, landingScreen, footerText, onCloseSuggestionBanner, showSuggestionBanner, utilityList, customInputComponent, onHistoryPanelClick, historyPanelData, onHistorySearchChange, onHistorySelectConversation, onHistoryToggleGroup, historyOpenGroups, onHistoryMenuAction, isConversationLoading, showHistoryPanel, isFullWidth, activeConversationId, handleCloseThread, handleThreadClick, onMinimiseChatBot, onChatBotResize, defaultCollapsed, suggestedPrompts, onSuggestedPromptClick, modelOptions, selectedModel, onModelChange, onAddClick, onAttachClick, onMenuClick, onFooterLinkClick, artifacts, onSelectArtifact, onIrisMenuFilterSelect, onArtifactMenuAction, }: ChatbotProps): import("react/jsx-runtime").JSX.Element | null;
|
|
5
5
|
export declare namespace ChatBotComponent {
|
|
6
6
|
var displayName: string;
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Chatbot/index.tsx"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,YAAY,EAAwB,MAAM,iBAAiB,CAAC;AAC1E,OAAO,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Chatbot/index.tsx"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,YAAY,EAAwB,MAAM,iBAAiB,CAAC;AAC1E,OAAO,sBAAsB,CAAC;AAqD9B,YAAY,EACV,YAAY,EACZ,sBAAsB,GACvB,MAAM,iBAAiB,CAAC;AAoCzB,wBAAgB,gBAAgB,CAAC,EAC/B,OAAO,EACP,QAAQ,EACR,aAAa,EACb,gBAAgB,EAChB,YAAiD,EACjD,aAAa,EAAE,cAAc,EAC7B,cAAc,EAAE,eAAe,EAC/B,mBAAmB,EACnB,mBAAmB,EACnB,eAA0B,EAC1B,mBAA2B,EAC3B,QAAQ,EACR,UAAe,EACf,aAAwB,EACxB,OAAO,EACP,eAAe,EACf,UAA6C,EAC7C,YAAmB,EACnB,cAAsB,EACtB,eAAsB,EACtB,WAAsB,EACtB,cAAyB,EACzB,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,uBAAuB,EACvB,kBAA6B,EAC7B,SAAc,EACd,aAAa,EACb,cAAc,EACd,cAAc,EACd,aAAqB,EACrB,aAAqB,EACrB,mBAA2B,EAC3B,gBAAgB,EAChB,UAAkB,EAClB,eAA0B,EAC1B,aAAqB,EACrB,UAAU,EACV,uBAAkC,EAClC,oBAA4B,EAC5B,WAAgB,EAChB,oBAA2B,EAC3B,mBAA8B,EAC9B,gBAAqB,EACrB,qBAAgC,EAChC,2BAAsC,EACtC,oBAA+B,EAC/B,iBAAiB,EACjB,mBAA8B,EAC9B,qBAA6B,EAC7B,gBAAuB,EACvB,WAAmB,EACnB,oBAAoB,EACpB,iBAA4B,EAC5B,iBAA4B,EAC5B,iBAAiB,EACjB,eAA0B,EAC1B,gBAAwB,EACxB,gBAAqB,EACrB,sBAAsB,EACtB,YAAY,EACZ,aAAa,EACb,aAAa,EACb,UAAU,EACV,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,SAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,GACrB,EAAE,YAAY,kDA2fd;yBApkBe,gBAAgB"}
|