impact-chatbot 2.3.87 → 2.3.88

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 CHANGED
@@ -107,6 +107,18 @@ const getAgentVisibilityData = () => {
107
107
  console.error("getSmartBotVisibilityData error", error);
108
108
  }
109
109
  };
110
+ const getHideNavbotData = async (applicationCode) => {
111
+ try {
112
+ let { data } = await tenantConfigActions.tenantConfigApiCache(applicationCode, {
113
+ attribute_name: "hide_navbot",
114
+ })();
115
+ return data?.data?.[0]?.attribute_value?.value;
116
+ }
117
+ catch (error) {
118
+ console.error("getHideNavbotData error", error);
119
+ return false;
120
+ }
121
+ };
110
122
  const getAgentExceptionUserList = (applicationCode) => {
111
123
  try {
112
124
  return tenantConfigActions.tenantConfigApiCache(applicationCode, {
@@ -1154,13 +1166,6 @@ const resolveInternalPath = (href) => {
1154
1166
  return null;
1155
1167
  }
1156
1168
  };
1157
- /**
1158
- * Minimizes the chat window so the user can see the screen they navigated to.
1159
- * SmartBot (index.tsx) listens for this event and sets partialClose.
1160
- */
1161
- const minimizeChatBot = () => {
1162
- window.dispatchEvent(new CustomEvent("smartBotMinimize"));
1163
- };
1164
1169
  /**
1165
1170
  * Anchor rendered inside chatbot markdown. Internal links are navigated through
1166
1171
  * react-router so the chatbot is not remounted by a full page load.
@@ -1179,7 +1184,6 @@ const MarkdownLink = ({ href, children, ...props }) => {
1179
1184
  if (currentPath !== internalPath) {
1180
1185
  navigate(internalPath);
1181
1186
  }
1182
- minimizeChatBot();
1183
1187
  };
1184
1188
  return (jsxRuntime.jsx("a", { href: href, target: "_self", onClick: handleClick, ...props, children: children }));
1185
1189
  };
@@ -1282,7 +1286,6 @@ const TextRenderer = ({ text, thinking }) => {
1282
1286
  if (currentPath !== internalPath) {
1283
1287
  navigate(internalPath);
1284
1288
  }
1285
- minimizeChatBot();
1286
1289
  };
1287
1290
  // If the input contains rich HTML, render it directly with DOMPurify sanitization
1288
1291
  if (containsRichHtml(text)) {
@@ -15304,9 +15307,11 @@ const SmartBot = (props) => {
15304
15307
  skipHierarchyCall: true,
15305
15308
  })();
15306
15309
  let showAgentIcon = await getAgentVisibilityData();
15310
+ let appCode = utils$2.getApplicationCodeFromURL(applicationName);
15311
+ let hideNavbot = await getHideNavbotData(appCode);
15312
+ const filterNavigationTab = (tabs) => hideNavbot ? tabs.filter((tab) => tab.name !== "Navigation") : tabs;
15307
15313
  if (!lodash.isEmpty(accessDataResponse) &&
15308
15314
  showAgentIcon?.data?.data[0]?.attribute_value?.value) {
15309
- let appCode = utils$2.getApplicationCodeFromURL(applicationName);
15310
15315
  let list = await getAgentExceptionUserList(appCode);
15311
15316
  let isWhitelisted = false;
15312
15317
  if (list?.data?.data[0]?.attribute_value?.allow_all) {
@@ -15518,7 +15523,7 @@ const SmartBot = (props) => {
15518
15523
  icon: jsxRuntime.jsx(SvgNavigationIcon, {}),
15519
15524
  }
15520
15525
  ];
15521
- setTabList(tabListData);
15526
+ setTabList(filterNavigationTab(tabListData));
15522
15527
  }
15523
15528
  else {
15524
15529
  setCurrentMode("navigation");