impact-chatbot 2.3.96 → 2.3.98
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/hooks/useChatFlow.d.ts +1 -1
- package/dist/index.cjs.js +16 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +16 -2
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const useChatFlow: (chatDataRef: any, setLoader: any, setFlowType: any, setScreenName: any, setUserInput: any, setQuestionIndex: any, setCurrentAppLink: any, flowType: any, screenName: any, questionIndex: any, userInput: any, dateFormat: any, currentMode: any, activeConversationId: any, setIsModuleChanged: any, chatBodyRef: any, filterReducerState: any, dispatch: any, navigate: any, setShowChatPlaceholder: any, baseUrl: any, setChatDataState: any, setCurrentSessionId: any, customChatConfig: any, chatDataInfoRef: any, chatbotContext: any, setInitValue: any, setSessionId: any, thinkingContent: any, setThinkingContent: any, isThinking: any, setIsThinking: any, chatId: any, setChatId: any, isStop: any, setIsStop: any, functionsRef: any, functionsState: any, setFunctionsState: any, thinkingHeaderMessage: any, setThinkingHeaderMessage: any, uniqueChatId: any, initValue: any, sessionId: any, fieldNumber: any, setFieldNumber: any, additionalArgs: any, setActiveConversationId: any, navSessionId: any, setNavSessionId: any, setUniqueChatId: any, setAdditionalArgs: any) => {
|
|
1
|
+
export declare const useChatFlow: (chatDataRef: any, setLoader: any, setFlowType: any, setScreenName: any, setUserInput: any, setQuestionIndex: any, setCurrentAppLink: any, flowType: any, screenName: any, questionIndex: any, userInput: any, dateFormat: any, currentMode: any, activeConversationId: any, setIsModuleChanged: any, chatBodyRef: any, filterReducerState: any, dispatch: any, navigate: any, setShowChatPlaceholder: any, baseUrl: any, setChatDataState: any, setCurrentSessionId: any, customChatConfig: any, chatDataInfoRef: any, chatbotContext: any, setInitValue: any, setSessionId: any, thinkingContent: any, setThinkingContent: any, isThinking: any, setIsThinking: any, chatId: any, setChatId: any, isStop: any, setIsStop: any, functionsRef: any, functionsState: any, setFunctionsState: any, thinkingHeaderMessage: any, setThinkingHeaderMessage: any, uniqueChatId: any, initValue: any, sessionId: any, fieldNumber: any, setFieldNumber: any, additionalArgs: any, setActiveConversationId: any, navSessionId: any, setNavSessionId: any, setUniqueChatId: any, setAdditionalArgs: any, answerMode: any) => {
|
|
2
2
|
setUserFlow: (data: any) => Promise<void>;
|
|
3
3
|
setUserScreenAndFlow: (data: any) => void;
|
|
4
4
|
fetchUserResultsFromQuery: (refObject: any, fetchQuestions?: boolean, inputValue?: any, conversationId?: any) => Promise<void>;
|
package/dist/index.cjs.js
CHANGED
|
@@ -2587,7 +2587,7 @@ const useAgentFlow = (dateFormat, chatDataRef, currentMode, setShowChatPlacehold
|
|
|
2587
2587
|
};
|
|
2588
2588
|
};
|
|
2589
2589
|
|
|
2590
|
-
const useChatFlow = (chatDataRef, setLoader, setFlowType, setScreenName, setUserInput, setQuestionIndex, setCurrentAppLink, flowType, screenName, questionIndex, userInput, dateFormat, currentMode, activeConversationId, setIsModuleChanged, chatBodyRef, filterReducerState, dispatch, navigate, setShowChatPlaceholder, baseUrl, setChatDataState, setCurrentSessionId, customChatConfig, chatDataInfoRef, chatbotContext, setInitValue, setSessionId, thinkingContent, setThinkingContent, isThinking, setIsThinking, chatId, setChatId, isStop, setIsStop, functionsRef, functionsState, setFunctionsState, thinkingHeaderMessage, setThinkingHeaderMessage, uniqueChatId, initValue, sessionId, fieldNumber, setFieldNumber, additionalArgs, setActiveConversationId, navSessionId, setNavSessionId, setUniqueChatId, setAdditionalArgs) => {
|
|
2590
|
+
const useChatFlow = (chatDataRef, setLoader, setFlowType, setScreenName, setUserInput, setQuestionIndex, setCurrentAppLink, flowType, screenName, questionIndex, userInput, dateFormat, currentMode, activeConversationId, setIsModuleChanged, chatBodyRef, filterReducerState, dispatch, navigate, setShowChatPlaceholder, baseUrl, setChatDataState, setCurrentSessionId, customChatConfig, chatDataInfoRef, chatbotContext, setInitValue, setSessionId, thinkingContent, setThinkingContent, isThinking, setIsThinking, chatId, setChatId, isStop, setIsStop, functionsRef, functionsState, setFunctionsState, thinkingHeaderMessage, setThinkingHeaderMessage, uniqueChatId, initValue, sessionId, fieldNumber, setFieldNumber, additionalArgs, setActiveConversationId, navSessionId, setNavSessionId, setUniqueChatId, setAdditionalArgs, answerMode) => {
|
|
2591
2591
|
const navSessionIdRef = React.useRef(navSessionId);
|
|
2592
2592
|
React.useEffect(() => {
|
|
2593
2593
|
navSessionIdRef.current = navSessionId;
|
|
@@ -2598,6 +2598,10 @@ const useChatFlow = (chatDataRef, setLoader, setFlowType, setScreenName, setUser
|
|
|
2598
2598
|
React.useEffect(() => {
|
|
2599
2599
|
uniqueChatIdRef.current = uniqueChatId;
|
|
2600
2600
|
}, [uniqueChatId]);
|
|
2601
|
+
const answerModeRef = React.useRef(answerMode);
|
|
2602
|
+
React.useEffect(() => {
|
|
2603
|
+
answerModeRef.current = answerMode;
|
|
2604
|
+
}, [answerMode]);
|
|
2601
2605
|
const { prepareDataAndSendToAgent, setAgentFlow, processResponse, } = useAgentFlow(dateFormat, chatDataRef, currentMode, setShowChatPlaceholder, setLoader, baseUrl, setCurrentSessionId, customChatConfig, chatDataInfoRef, {
|
|
2602
2606
|
setChatDataState,
|
|
2603
2607
|
activeConversationId,
|
|
@@ -2778,6 +2782,10 @@ const useChatFlow = (chatDataRef, setLoader, setFlowType, setScreenName, setUser
|
|
|
2778
2782
|
}
|
|
2779
2783
|
if (data.flow_type === "agent" && data.actionType === "direct") {
|
|
2780
2784
|
data.baseUrl = baseUrl;
|
|
2785
|
+
// Use the current answer mode selected by the user on the UI
|
|
2786
|
+
if (!data.answerMode) {
|
|
2787
|
+
data.answerMode = answerModeRef.current;
|
|
2788
|
+
}
|
|
2781
2789
|
// Reset the timer before the request goes out (same as index.jsx
|
|
2782
2790
|
// handleSendMessage). Without this the new ThinkinHeaderInfo mounts while
|
|
2783
2791
|
// the previous response's "completed" state is still in Redux and freezes
|
|
@@ -15576,7 +15584,7 @@ const SmartBot = (props) => {
|
|
|
15576
15584
|
const [chatBotWidth, setChatBotWidth] = React.useState(null);
|
|
15577
15585
|
const [tabList, setTabList] = React.useState([]);
|
|
15578
15586
|
React.useRef(0);
|
|
15579
|
-
const { setUserFlow, setUserScreenAndFlow, fetchUserResultsFromQuery, getCurrentDateTimeString, setLink, } = useChatFlow(chatDataRef, setLoader, setFlowType, setScreenName, setUserInput, setQuestionIndex, setCurrentAppLink, flowType, screenName, questionIndex, userInput, dateFormat, currentMode, activeConversationId, setIsModuleChanged, chatBodyRef, filterReducerState, dispatch, navigate, setShowChatPlaceholder, baseUrl, setChatDataState, setCurrentSessionId, customChatConfig, chatDataInfoRef, chatbotContext, setInitValue, setSessionId, thinkingContent, setThinkingContent, isThinking, setIsThinking, chatId, setChatId, isStop, setIsStop, functionsRef, functionsState, setFunctionsState, thinkingHeaderMessage, setThinkingHeaderMessage, uniqueChatId, initValue, sessionId, fieldNumber, setFieldNumber, additionalArgs, setActiveConversationId, navSessionId, setNavSessionId, setUniqueChatId, setAdditionalArgs);
|
|
15587
|
+
const { setUserFlow, setUserScreenAndFlow, fetchUserResultsFromQuery, getCurrentDateTimeString, setLink, } = useChatFlow(chatDataRef, setLoader, setFlowType, setScreenName, setUserInput, setQuestionIndex, setCurrentAppLink, flowType, screenName, questionIndex, userInput, dateFormat, currentMode, activeConversationId, setIsModuleChanged, chatBodyRef, filterReducerState, dispatch, navigate, setShowChatPlaceholder, baseUrl, setChatDataState, setCurrentSessionId, customChatConfig, chatDataInfoRef, chatbotContext, setInitValue, setSessionId, thinkingContent, setThinkingContent, isThinking, setIsThinking, chatId, setChatId, isStop, setIsStop, functionsRef, functionsState, setFunctionsState, thinkingHeaderMessage, setThinkingHeaderMessage, uniqueChatId, initValue, sessionId, fieldNumber, setFieldNumber, additionalArgs, setActiveConversationId, navSessionId, setNavSessionId, setUniqueChatId, setAdditionalArgs, answerMode);
|
|
15580
15588
|
const { parseSavedFlow, saveCurrentChanges, endCurrentSession, clearChatSession, initiateNewChat, hasUnsavedChanges, } = useChatSession(chatDataRef, setFlowType, setScreenName, setUserInput, setTemplateData, chatDataScreenLinkRef, setShowModal, setMinimizedMode, setSelectedModule, setChatDataState, currentMode, setUserFlow, getCurrentDateTimeString, setCurrentAppLink, selectedModule, fetchUserResultsFromQuery, props.closeBot, activeConversationId, setActiveConversationId, setShowChatPlaceholder);
|
|
15581
15589
|
const { refreshAndUpdateUserManual, configureBotActions, displaySnackMessages, } = useBotConfiguration(setRefreshLoader, setEnableRefreshAction, dispatch);
|
|
15582
15590
|
const { prepareDataAndSendToAgent, processResponse } = useAgentFlow(dateFormat, chatDataRef, currentMode, setShowChatPlaceholder, setLoader, baseUrl, setCurrentSessionId, customChatConfig, chatDataInfoRef, {
|
|
@@ -16684,6 +16692,12 @@ const SmartBot = (props) => {
|
|
|
16684
16692
|
const root = smartBotWrapperRef.current;
|
|
16685
16693
|
if (!root)
|
|
16686
16694
|
return;
|
|
16695
|
+
// If the bot container is hidden, skip collapse — prevents the
|
|
16696
|
+
// "Collapse chatbot" button from being programmatically clicked while
|
|
16697
|
+
// the bot is invisible, which would leave it in collapsed state when
|
|
16698
|
+
// the user reopens it (see: Ask Iris opens minimized on second open).
|
|
16699
|
+
if (root.classList.contains(classes.hideBotStyle))
|
|
16700
|
+
return;
|
|
16687
16701
|
if (root.contains(e.target))
|
|
16688
16702
|
return; // interaction inside the bot → ignore
|
|
16689
16703
|
// The Rename / Delete modals render in a MUI portal outside the bot's DOM
|