impact-chatbot 2.3.95 → 2.3.97
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 +14 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +14 -5
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -686,7 +686,8 @@ const parseResponse = (data, type, agentId = "", currentMode = "", disableTimeAn
|
|
|
686
686
|
isRequired: data?.data?.isRequired,
|
|
687
687
|
isDisabled: data?.data?.isDisabled,
|
|
688
688
|
isMulti: data?.data?.isMulti,
|
|
689
|
-
paramName: data?.data?.param_name
|
|
689
|
+
paramName: data?.data?.param_name,
|
|
690
|
+
is_static: data?.data?.is_static
|
|
690
691
|
}
|
|
691
692
|
};
|
|
692
693
|
case "datePicker":
|
|
@@ -2564,7 +2565,7 @@ const useAgentFlow = (dateFormat, chatDataRef, currentMode, setShowChatPlacehold
|
|
|
2564
2565
|
};
|
|
2565
2566
|
};
|
|
2566
2567
|
|
|
2567
|
-
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) => {
|
|
2568
|
+
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) => {
|
|
2568
2569
|
const navSessionIdRef = useRef(navSessionId);
|
|
2569
2570
|
useEffect(() => {
|
|
2570
2571
|
navSessionIdRef.current = navSessionId;
|
|
@@ -2575,6 +2576,10 @@ const useChatFlow = (chatDataRef, setLoader, setFlowType, setScreenName, setUser
|
|
|
2575
2576
|
useEffect(() => {
|
|
2576
2577
|
uniqueChatIdRef.current = uniqueChatId;
|
|
2577
2578
|
}, [uniqueChatId]);
|
|
2579
|
+
const answerModeRef = useRef(answerMode);
|
|
2580
|
+
useEffect(() => {
|
|
2581
|
+
answerModeRef.current = answerMode;
|
|
2582
|
+
}, [answerMode]);
|
|
2578
2583
|
const { prepareDataAndSendToAgent, setAgentFlow, processResponse, } = useAgentFlow(dateFormat, chatDataRef, currentMode, setShowChatPlaceholder, setLoader, baseUrl, setCurrentSessionId, customChatConfig, chatDataInfoRef, {
|
|
2579
2584
|
setChatDataState,
|
|
2580
2585
|
activeConversationId,
|
|
@@ -2755,6 +2760,10 @@ const useChatFlow = (chatDataRef, setLoader, setFlowType, setScreenName, setUser
|
|
|
2755
2760
|
}
|
|
2756
2761
|
if (data.flow_type === "agent" && data.actionType === "direct") {
|
|
2757
2762
|
data.baseUrl = baseUrl;
|
|
2763
|
+
// Use the current answer mode selected by the user on the UI
|
|
2764
|
+
if (!data.answerMode) {
|
|
2765
|
+
data.answerMode = answerModeRef.current;
|
|
2766
|
+
}
|
|
2758
2767
|
// Reset the timer before the request goes out (same as index.jsx
|
|
2759
2768
|
// handleSendMessage). Without this the new ThinkinHeaderInfo mounts while
|
|
2760
2769
|
// the previous response's "completed" state is still in Redux and freezes
|
|
@@ -7382,7 +7391,7 @@ const SelectContent = ({ bodyText, isFormDisabled = false, messageIndex }) => {
|
|
|
7382
7391
|
const dispatch = useDispatch();
|
|
7383
7392
|
// Cross-filter cascading context (optional — graceful fallback when not wrapped)
|
|
7384
7393
|
const crossFilterCtx = useCrossFilterContext();
|
|
7385
|
-
const isCascading = crossFilterCtx?.isEnabled && paramName;
|
|
7394
|
+
const isCascading = crossFilterCtx?.isEnabled && paramName && !bodyText?.is_static;
|
|
7386
7395
|
const isMountedRef = useRef(false);
|
|
7387
7396
|
if (isEmpty$1(bodyText))
|
|
7388
7397
|
return null;
|
|
@@ -8139,7 +8148,7 @@ const StepFormContent = ({ formData, messageIndex = 0, isFormDisabled = false, s
|
|
|
8139
8148
|
if (!formData || !Array.isArray(formData))
|
|
8140
8149
|
return [];
|
|
8141
8150
|
const configs = formData
|
|
8142
|
-
.filter((item) => item?.type === "select" && item?.data?.param_name)
|
|
8151
|
+
.filter((item) => item?.type === "select" && item?.data?.param_name && !item?.data?.is_static)
|
|
8143
8152
|
.map((item) => {
|
|
8144
8153
|
const data = item.data;
|
|
8145
8154
|
const paramName = data.param_name;
|
|
@@ -15553,7 +15562,7 @@ const SmartBot = (props) => {
|
|
|
15553
15562
|
const [chatBotWidth, setChatBotWidth] = useState(null);
|
|
15554
15563
|
const [tabList, setTabList] = useState([]);
|
|
15555
15564
|
useRef(0);
|
|
15556
|
-
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);
|
|
15565
|
+
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);
|
|
15557
15566
|
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);
|
|
15558
15567
|
const { refreshAndUpdateUserManual, configureBotActions, displaySnackMessages, } = useBotConfiguration(setRefreshLoader, setEnableRefreshAction, dispatch);
|
|
15559
15568
|
const { prepareDataAndSendToAgent, processResponse } = useAgentFlow(dateFormat, chatDataRef, currentMode, setShowChatPlaceholder, setLoader, baseUrl, setCurrentSessionId, customChatConfig, chatDataInfoRef, {
|