impact-chatbot 2.3.5 → 2.3.6
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/index.cjs.js +112 -18
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +112 -18
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -29,7 +29,6 @@ import agGridColumnFormatter from 'core/Utils/agGrid/column-formatter';
|
|
|
29
29
|
import CoreChart from 'core/Utils/core-charts';
|
|
30
30
|
import makeStyles$1 from '@mui/styles/makeStyles';
|
|
31
31
|
import globalStyles$1 from 'core/Styles/globalStyles';
|
|
32
|
-
import CircularProgress$1 from '@mui/material/CircularProgress';
|
|
33
32
|
import FormatListBulletedOutlinedIcon from '@mui/icons-material/FormatListBulletedOutlined';
|
|
34
33
|
import PsychologyOutlinedIcon from '@mui/icons-material/PsychologyOutlined';
|
|
35
34
|
import { stopAgentFlow } from 'core/commonComponents/smartBot/services/chatbot-services';
|
|
@@ -4431,7 +4430,7 @@ const Rectangle = ({ type, icon, title, description, onClick, hoverable }) => {
|
|
|
4431
4430
|
return (jsx("div", { className: `${classes.rectangle} ${classes[type]} ${hoverable ? classes.rectangleHoverable : ''}`, onClick: onClick, children: jsxs("div", { className: classes.textContainer, children: [jsx(Typography, { className: classes.title, children: title }), jsx(Typography, { className: classes.description, children: description })] }) }));
|
|
4432
4431
|
};
|
|
4433
4432
|
const ChatPlaceholder = (props) => {
|
|
4434
|
-
const { dateFormat, chatDataRef, currentMode, setShowChatPlaceholder, setLoader, setCurrentAgentId, baseUrl, setBaseUrl, setCurrentSessionId, customChatConfig, chatDataInfoRef, setChatDataState, userInput, legacyAgentScreen, activeConversationId, chatBodyRef, chatbotContext, setInitValue, setSessionId, thinkingContent, setThinkingContent, isThinking, setIsThinking, chatId, setChatId, isStop, setIsStop, functionsRef, functionsState, setFunctionsState, thinkingHeaderMessage, setThinkingHeaderMessage, uniqueChatId, setUniqueChatId, fieldNumber, setFieldNumber, } = props;
|
|
4433
|
+
const { dateFormat, chatDataRef, currentMode, setShowChatPlaceholder, setLoader, setCurrentAgentId, baseUrl, setBaseUrl, setCurrentSessionId, customChatConfig, chatDataInfoRef, setChatDataState, userInput, legacyAgentScreen, activeConversationId, chatBodyRef, chatbotContext, setInitValue, setSessionId, thinkingContent, setThinkingContent, isThinking, setIsThinking, chatId, setChatId, isStop, setIsStop, functionsRef, functionsState, setFunctionsState, thinkingHeaderMessage, setThinkingHeaderMessage, uniqueChatId, setUniqueChatId, fieldNumber, setFieldNumber, questions, displayQuestions } = props;
|
|
4435
4434
|
const classes = useStyles$5();
|
|
4436
4435
|
globalStyles();
|
|
4437
4436
|
const [cardList, setCardList] = useState([]);
|
|
@@ -4488,10 +4487,16 @@ const ChatPlaceholder = (props) => {
|
|
|
4488
4487
|
setLoading(false);
|
|
4489
4488
|
}
|
|
4490
4489
|
};
|
|
4491
|
-
if (baseUrl && legacyAgentScreen) {
|
|
4490
|
+
if (baseUrl && legacyAgentScreen && !displayQuestions) {
|
|
4492
4491
|
loadCards();
|
|
4493
4492
|
}
|
|
4494
|
-
|
|
4493
|
+
if (questions &&
|
|
4494
|
+
Array.isArray(questions) &&
|
|
4495
|
+
questions.length > 0 &&
|
|
4496
|
+
displayQuestions) {
|
|
4497
|
+
setCardList(questions);
|
|
4498
|
+
}
|
|
4499
|
+
}, [baseUrl, questions, displayQuestions]);
|
|
4495
4500
|
useEffect(() => {
|
|
4496
4501
|
getBaseUrl();
|
|
4497
4502
|
}, []);
|
|
@@ -4544,7 +4549,7 @@ const ChatPlaceholder = (props) => {
|
|
|
4544
4549
|
description: card.description || card.helpText || "",
|
|
4545
4550
|
agentId: card.agentId || card.id
|
|
4546
4551
|
}));
|
|
4547
|
-
const dataToMap = legacyAgentScreen ? transformedCardList : rectangleData;
|
|
4552
|
+
const dataToMap = legacyAgentScreen || displayQuestions ? transformedCardList : rectangleData;
|
|
4548
4553
|
return (jsxs("div", { className: classes.placeholderContainer, children: [jsx("div", { className: classes.centerIconContainer, children: jsx(SvgCenter3D, { className: classes.centerIcon }) }), jsx(Typography, { variant: "h1", className: classes.heading, children: "Alan's Capabilities" }), jsx(Typography, { variant: "body1", className: classes.headingHelperText, children: "Discover potential issues & opportunities Alan can help you with!" }), jsx("div", { className: classes.rectanglesContainer, children: dataToMap.map((item, index) => (jsx(Rectangle, { type: item.type, icon: item.icon, title: item.title, description: item.description, onClick: () => handleRectangleClick(item?.agentId, item?.title), hoverable: legacyAgentScreen }, index))) })] }));
|
|
4549
4554
|
};
|
|
4550
4555
|
|
|
@@ -5432,6 +5437,68 @@ const useStyles$2 = makeStyles$1((theme) => ({
|
|
|
5432
5437
|
transform: "rotate(360deg)",
|
|
5433
5438
|
},
|
|
5434
5439
|
},
|
|
5440
|
+
"@keyframes skeletonRowExpand": {
|
|
5441
|
+
"0%": {
|
|
5442
|
+
width: pxToRem(31),
|
|
5443
|
+
gap: 0,
|
|
5444
|
+
},
|
|
5445
|
+
"20%": {
|
|
5446
|
+
width: "40%",
|
|
5447
|
+
gap: 0,
|
|
5448
|
+
},
|
|
5449
|
+
"30%": {
|
|
5450
|
+
width: "70%",
|
|
5451
|
+
gap: pxToRem(2),
|
|
5452
|
+
},
|
|
5453
|
+
"40%": {
|
|
5454
|
+
width: "100%",
|
|
5455
|
+
gap: pxToRem(4),
|
|
5456
|
+
},
|
|
5457
|
+
"70%": {
|
|
5458
|
+
width: "70%",
|
|
5459
|
+
gap: pxToRem(2),
|
|
5460
|
+
},
|
|
5461
|
+
"80%": {
|
|
5462
|
+
width: "40%",
|
|
5463
|
+
gap: 0,
|
|
5464
|
+
},
|
|
5465
|
+
"100%": {
|
|
5466
|
+
width: pxToRem(31),
|
|
5467
|
+
gap: 0,
|
|
5468
|
+
},
|
|
5469
|
+
},
|
|
5470
|
+
"@keyframes skeletonSquareFade": {
|
|
5471
|
+
"0%": {
|
|
5472
|
+
opacity: 0,
|
|
5473
|
+
width: 0,
|
|
5474
|
+
marginRight: 0,
|
|
5475
|
+
},
|
|
5476
|
+
"35%": {
|
|
5477
|
+
opacity: 0,
|
|
5478
|
+
width: 0,
|
|
5479
|
+
marginRight: 0,
|
|
5480
|
+
},
|
|
5481
|
+
"45%": {
|
|
5482
|
+
opacity: 1,
|
|
5483
|
+
width: pxToRem(31),
|
|
5484
|
+
marginRight: pxToRem(8),
|
|
5485
|
+
},
|
|
5486
|
+
"60%": {
|
|
5487
|
+
opacity: 1,
|
|
5488
|
+
width: pxToRem(31),
|
|
5489
|
+
marginRight: pxToRem(8),
|
|
5490
|
+
},
|
|
5491
|
+
"75%": {
|
|
5492
|
+
opacity: 0,
|
|
5493
|
+
width: 0,
|
|
5494
|
+
marginRight: 0,
|
|
5495
|
+
},
|
|
5496
|
+
"100%": {
|
|
5497
|
+
opacity: 0,
|
|
5498
|
+
width: 0,
|
|
5499
|
+
marginRight: 0,
|
|
5500
|
+
},
|
|
5501
|
+
},
|
|
5435
5502
|
},
|
|
5436
5503
|
stepsContainer: {
|
|
5437
5504
|
display: "flex",
|
|
@@ -5513,19 +5580,46 @@ const useStyles$2 = makeStyles$1((theme) => ({
|
|
|
5513
5580
|
loaderContainer: {
|
|
5514
5581
|
display: "flex",
|
|
5515
5582
|
flexDirection: "column",
|
|
5516
|
-
|
|
5583
|
+
gap: pxToRem(10),
|
|
5584
|
+
padding: `${pxToRem(20)} ${pxToRem(16)}`,
|
|
5585
|
+
},
|
|
5586
|
+
skeletonRowWrapper: {
|
|
5587
|
+
display: "flex",
|
|
5517
5588
|
alignItems: "center",
|
|
5518
|
-
padding: pxToRem(40),
|
|
5519
5589
|
},
|
|
5520
|
-
|
|
5521
|
-
|
|
5590
|
+
skeletonSquare: {
|
|
5591
|
+
width: 0,
|
|
5592
|
+
height: pxToRem(30),
|
|
5593
|
+
borderRadius: pxToRem(4),
|
|
5594
|
+
background: "linear-gradient(266deg, rgba(220, 220, 220, 0.60) -5.22%, rgba(255, 255, 255, 0.80) 4.31%, rgba(200, 200, 200, 0.40) 17.94%)",
|
|
5595
|
+
opacity: 0.2,
|
|
5596
|
+
flexShrink: 0,
|
|
5597
|
+
animation: "skeletonSquareFade 1.8s ease-out infinite",
|
|
5522
5598
|
},
|
|
5523
|
-
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5599
|
+
skeletonSquareDelayed: {
|
|
5600
|
+
animationDelay: "0.2s",
|
|
5601
|
+
},
|
|
5602
|
+
skeletonRow: {
|
|
5603
|
+
display: "flex",
|
|
5604
|
+
flexDirection: "column",
|
|
5605
|
+
gap: 0,
|
|
5606
|
+
overflow: "hidden",
|
|
5607
|
+
animation: "skeletonRowExpand 1.8s ease-out infinite",
|
|
5608
|
+
},
|
|
5609
|
+
skeletonRowDelayed: {
|
|
5610
|
+
animationDelay: "0.2s",
|
|
5611
|
+
},
|
|
5612
|
+
skeletonBlock: {
|
|
5613
|
+
width: "100%",
|
|
5614
|
+
height: pxToRem(15),
|
|
5615
|
+
background: "linear-gradient(266deg, rgba(220, 220, 220, 0.60) -5.22%, rgba(255, 255, 255, 0.80) 4.31%, rgba(200, 200, 200, 0.40) 17.94%)",
|
|
5616
|
+
opacity: 0.2,
|
|
5617
|
+
"&:first-child": {
|
|
5618
|
+
borderRadius: `${pxToRem(4)} ${pxToRem(4)} 0 0`,
|
|
5619
|
+
},
|
|
5620
|
+
"&:last-child": {
|
|
5621
|
+
borderRadius: `0 0 ${pxToRem(4)} ${pxToRem(4)}`,
|
|
5622
|
+
},
|
|
5529
5623
|
},
|
|
5530
5624
|
accordionAnimated: {
|
|
5531
5625
|
animation: "$slideDown 0.4s ease-out forwards",
|
|
@@ -5655,7 +5749,7 @@ const Steps$1 = ({ steps, setSteps, done, setTabValue, setDone, finalStepDone, s
|
|
|
5655
5749
|
const hasQuestions = questions.length > 0;
|
|
5656
5750
|
if (!hasQuestions) {
|
|
5657
5751
|
if (currentMode === "agent" && steps.length === 1) {
|
|
5658
|
-
return (jsxs("div", { className: classes.loaderContainer, children: [jsx(
|
|
5752
|
+
return (jsxs("div", { className: classes.loaderContainer, children: [jsxs("div", { className: classes.skeletonRowWrapper, children: [jsx("div", { className: classes.skeletonSquare }), jsxs("div", { className: classes.skeletonRow, children: [jsx("div", { className: classes.skeletonBlock }), jsx("div", { className: classes.skeletonBlock })] })] }), jsxs("div", { className: classes.skeletonRowWrapper, children: [jsx("div", { className: `${classes.skeletonSquare} ${classes.skeletonSquareDelayed}` }), jsxs("div", { className: `${classes.skeletonRow} ${classes.skeletonRowDelayed}`, children: [jsx("div", { className: classes.skeletonBlock }), jsx("div", { className: classes.skeletonBlock })] })] })] }));
|
|
5659
5753
|
}
|
|
5660
5754
|
if (steps.length > 0) {
|
|
5661
5755
|
const fallbackQuestion = "Processing Request";
|
|
@@ -9598,7 +9692,7 @@ let chatbotFilterCustomConfig = {
|
|
|
9598
9692
|
};
|
|
9599
9693
|
|
|
9600
9694
|
const SmartBot = (props) => {
|
|
9601
|
-
const { userName, partialClose, setPartialClose, forceOpen, customBaseUrl = "" } = props;
|
|
9695
|
+
const { userName, partialClose, setPartialClose, forceOpen, customBaseUrl = "", displayQuestions, questions = [] } = props;
|
|
9602
9696
|
const { showModal, setShowModal, minimizedMode, setMinimizedMode, userInput, setUserInput, position, setPosition, flowType, setFlowType, screenName, setScreenName, questionIndex, setQuestionIndex, currentAppLink, setCurrentAppLink, loader, setLoader, enableRefreshAction, setEnableRefreshAction, refreshLoader, setRefreshLoader, chatDataState, setChatDataState, showExtendedContent, setShowExtendedContent, currentMode, setCurrentMode, selectedModule, setSelectedModule, isCardVisible, setIsCardVisible, templateData, setTemplateData, showAlert, setShowAlert, grabPositionRef, chatDataRef, chatBodyRef, minimizedBtnRef, chatDataScreenLinkRef, navigate, location, dispatch, globalClasses, classes, dateFormat, filterReducerState, activeConversationId, setActiveConversationId, isModuleChanged, setIsModuleChanged, showChatPlaceholder, setShowChatPlaceholder, currentAgentId, setCurrentAgentId, baseUrl = customBaseUrl, setBaseUrl, currentSessionId, setCurrentSessionId, notificationData, agentTaskCompleted, setAgentTaskCompleted, customChatConfig, setCustomChatConfig, setMiddleWareFunction, chatBotInfoRef, chatDataInfoRef, initValue, setInitValue, sessionId, setSessionId, thinkingContent, setThinkingContent, isThinking, setIsThinking, chatId, setChatId, isStop, setIsStop, functionsRef, functionsState, setFunctionsState, thinkingHeaderMessage, setThinkingHeaderMessage, legacyAgentScreen, setLegacyAgentScreen, uniqueChatId, setUniqueChatId, fieldNumber, setFieldNumber, thinkingContext, isModalOpen, setIsModalOpen, utilityList, setUtilityList, isUploadModalOpen, setIsUploadModalOpen, isRefreshTriggered, setIsRefreshTriggered, } = useChatState();
|
|
9603
9697
|
// Add state for confirmation dialogs
|
|
9604
9698
|
useState(false);
|
|
@@ -10297,7 +10391,7 @@ const SmartBot = (props) => {
|
|
|
10297
10391
|
},
|
|
10298
10392
|
icon: jsx(SvgNavigationIcon, {}),
|
|
10299
10393
|
},
|
|
10300
|
-
], utilityList: utilityList, isAssistantThinking: loader, isCustomScreen: showChatPlaceholder, customScreenJsx: jsx(ChatPlaceholder, { dateFormat: dateFormat, chatDataRef: chatDataRef, currentMode: currentMode, setShowChatPlaceholder: setShowChatPlaceholder, setLoader: setLoader, setCurrentAgentId: setCurrentAgentId, baseUrl: baseUrl, setBaseUrl: setBaseUrl, setCurrentSessionId: setCurrentSessionId, customChatConfig: customChatConfig, chatDataInfoRef: chatDataInfoRef, setChatDataState: setChatDataState, userInput: userInput, legacyAgentScreen: legacyAgentScreen, activeConversationId: activeConversationId, chatBodyRef: chatBodyRef, chatbotContext: chatbotContext, setInitValue: setInitValue, setSessionId: setSessionId, thinkingContent: thinkingContext?.thinkingContent, setThinkingContent: setThinkingContent, isThinking: isThinking, setIsThinking: setIsThinking, chatId: chatId, setChatId: setChatId, isStop: isStop, setIsStop: setIsStop, functionsRef: functionsRef, functionsState: functionsState, setFunctionsState: setFunctionsState, thinkingHeaderMessage: thinkingContext?.thinkingHeaderMessage, setThinkingHeaderMessage: setThinkingHeaderMessage, uniqueChatId: uniqueChatId, setUniqueChatId: setUniqueChatId, fieldNumber: fieldNumber, setFieldNumber: setFieldNumber }), inputText: userInput, threadList: ["Home"], hideMenuArrow: hideMenu, newChatScreen: newChatScreen, isModuleListLoading: modulesLoading, suggestionBanner: {
|
|
10394
|
+
], utilityList: utilityList, isAssistantThinking: loader, isCustomScreen: showChatPlaceholder, customScreenJsx: jsx(ChatPlaceholder, { dateFormat: dateFormat, chatDataRef: chatDataRef, currentMode: currentMode, setShowChatPlaceholder: setShowChatPlaceholder, setLoader: setLoader, setCurrentAgentId: setCurrentAgentId, baseUrl: baseUrl, setBaseUrl: setBaseUrl, setCurrentSessionId: setCurrentSessionId, customChatConfig: customChatConfig, chatDataInfoRef: chatDataInfoRef, setChatDataState: setChatDataState, userInput: userInput, legacyAgentScreen: legacyAgentScreen, activeConversationId: activeConversationId, chatBodyRef: chatBodyRef, chatbotContext: chatbotContext, setInitValue: setInitValue, setSessionId: setSessionId, thinkingContent: thinkingContext?.thinkingContent, setThinkingContent: setThinkingContent, isThinking: isThinking, setIsThinking: setIsThinking, chatId: chatId, setChatId: setChatId, isStop: isStop, setIsStop: setIsStop, functionsRef: functionsRef, functionsState: functionsState, setFunctionsState: setFunctionsState, thinkingHeaderMessage: thinkingContext?.thinkingHeaderMessage, setThinkingHeaderMessage: setThinkingHeaderMessage, uniqueChatId: uniqueChatId, setUniqueChatId: setUniqueChatId, fieldNumber: fieldNumber, setFieldNumber: setFieldNumber, displayQuestions: displayQuestions, questions: questions }), inputText: userInput, threadList: ["Home"], hideMenuArrow: hideMenu, newChatScreen: newChatScreen, isModuleListLoading: modulesLoading, suggestionBanner: {
|
|
10301
10395
|
freeTextHeading: "Try adding more details :",
|
|
10302
10396
|
freeTextContent: "Alan works better when you provide more context and pointed questions",
|
|
10303
10397
|
}, isStopIcon: isStop, onStopIconClick: onStopIconClick, footerText: "AI-generated responses may contain errors\u2014please verify important information", showSuggestionBanner: showSuggestionBanner, onCloseSuggestionBanner: () => {
|