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.
@@ -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
@@ -708,7 +708,8 @@ const parseResponse = (data, type, agentId = "", currentMode = "", disableTimeAn
708
708
  isRequired: data?.data?.isRequired,
709
709
  isDisabled: data?.data?.isDisabled,
710
710
  isMulti: data?.data?.isMulti,
711
- paramName: data?.data?.param_name
711
+ paramName: data?.data?.param_name,
712
+ is_static: data?.data?.is_static
712
713
  }
713
714
  };
714
715
  case "datePicker":
@@ -2586,7 +2587,7 @@ const useAgentFlow = (dateFormat, chatDataRef, currentMode, setShowChatPlacehold
2586
2587
  };
2587
2588
  };
2588
2589
 
2589
- 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) => {
2590
2591
  const navSessionIdRef = React.useRef(navSessionId);
2591
2592
  React.useEffect(() => {
2592
2593
  navSessionIdRef.current = navSessionId;
@@ -2597,6 +2598,10 @@ const useChatFlow = (chatDataRef, setLoader, setFlowType, setScreenName, setUser
2597
2598
  React.useEffect(() => {
2598
2599
  uniqueChatIdRef.current = uniqueChatId;
2599
2600
  }, [uniqueChatId]);
2601
+ const answerModeRef = React.useRef(answerMode);
2602
+ React.useEffect(() => {
2603
+ answerModeRef.current = answerMode;
2604
+ }, [answerMode]);
2600
2605
  const { prepareDataAndSendToAgent, setAgentFlow, processResponse, } = useAgentFlow(dateFormat, chatDataRef, currentMode, setShowChatPlaceholder, setLoader, baseUrl, setCurrentSessionId, customChatConfig, chatDataInfoRef, {
2601
2606
  setChatDataState,
2602
2607
  activeConversationId,
@@ -2777,6 +2782,10 @@ const useChatFlow = (chatDataRef, setLoader, setFlowType, setScreenName, setUser
2777
2782
  }
2778
2783
  if (data.flow_type === "agent" && data.actionType === "direct") {
2779
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
+ }
2780
2789
  // Reset the timer before the request goes out (same as index.jsx
2781
2790
  // handleSendMessage). Without this the new ThinkinHeaderInfo mounts while
2782
2791
  // the previous response's "completed" state is still in Redux and freezes
@@ -7404,7 +7413,7 @@ const SelectContent = ({ bodyText, isFormDisabled = false, messageIndex }) => {
7404
7413
  const dispatch = reactRedux.useDispatch();
7405
7414
  // Cross-filter cascading context (optional — graceful fallback when not wrapped)
7406
7415
  const crossFilterCtx = useCrossFilterContext();
7407
- const isCascading = crossFilterCtx?.isEnabled && paramName;
7416
+ const isCascading = crossFilterCtx?.isEnabled && paramName && !bodyText?.is_static;
7408
7417
  const isMountedRef = React.useRef(false);
7409
7418
  if (lodash.isEmpty(bodyText))
7410
7419
  return null;
@@ -8161,7 +8170,7 @@ const StepFormContent = ({ formData, messageIndex = 0, isFormDisabled = false, s
8161
8170
  if (!formData || !Array.isArray(formData))
8162
8171
  return [];
8163
8172
  const configs = formData
8164
- .filter((item) => item?.type === "select" && item?.data?.param_name)
8173
+ .filter((item) => item?.type === "select" && item?.data?.param_name && !item?.data?.is_static)
8165
8174
  .map((item) => {
8166
8175
  const data = item.data;
8167
8176
  const paramName = data.param_name;
@@ -15575,7 +15584,7 @@ const SmartBot = (props) => {
15575
15584
  const [chatBotWidth, setChatBotWidth] = React.useState(null);
15576
15585
  const [tabList, setTabList] = React.useState([]);
15577
15586
  React.useRef(0);
15578
- 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);
15579
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);
15580
15589
  const { refreshAndUpdateUserManual, configureBotActions, displaySnackMessages, } = useBotConfiguration(setRefreshLoader, setEnableRefreshAction, dispatch);
15581
15590
  const { prepareDataAndSendToAgent, processResponse } = useAgentFlow(dateFormat, chatDataRef, currentMode, setShowChatPlaceholder, setLoader, baseUrl, setCurrentSessionId, customChatConfig, chatDataInfoRef, {