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 +16 -11
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +16 -11
- package/dist/index.esm.js.map +1 -1
- package/dist/services/chatbot-services.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -85,6 +85,18 @@ const getAgentVisibilityData = () => {
|
|
|
85
85
|
console.error("getSmartBotVisibilityData error", error);
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
|
+
const getHideNavbotData = async (applicationCode) => {
|
|
89
|
+
try {
|
|
90
|
+
let { data } = await tenantConfigApiCache(applicationCode, {
|
|
91
|
+
attribute_name: "hide_navbot",
|
|
92
|
+
})();
|
|
93
|
+
return data?.data?.[0]?.attribute_value?.value;
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
console.error("getHideNavbotData error", error);
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
};
|
|
88
100
|
const getAgentExceptionUserList = (applicationCode) => {
|
|
89
101
|
try {
|
|
90
102
|
return tenantConfigApiCache(applicationCode, {
|
|
@@ -1132,13 +1144,6 @@ const resolveInternalPath = (href) => {
|
|
|
1132
1144
|
return null;
|
|
1133
1145
|
}
|
|
1134
1146
|
};
|
|
1135
|
-
/**
|
|
1136
|
-
* Minimizes the chat window so the user can see the screen they navigated to.
|
|
1137
|
-
* SmartBot (index.tsx) listens for this event and sets partialClose.
|
|
1138
|
-
*/
|
|
1139
|
-
const minimizeChatBot = () => {
|
|
1140
|
-
window.dispatchEvent(new CustomEvent("smartBotMinimize"));
|
|
1141
|
-
};
|
|
1142
1147
|
/**
|
|
1143
1148
|
* Anchor rendered inside chatbot markdown. Internal links are navigated through
|
|
1144
1149
|
* react-router so the chatbot is not remounted by a full page load.
|
|
@@ -1157,7 +1162,6 @@ const MarkdownLink = ({ href, children, ...props }) => {
|
|
|
1157
1162
|
if (currentPath !== internalPath) {
|
|
1158
1163
|
navigate(internalPath);
|
|
1159
1164
|
}
|
|
1160
|
-
minimizeChatBot();
|
|
1161
1165
|
};
|
|
1162
1166
|
return (jsx("a", { href: href, target: "_self", onClick: handleClick, ...props, children: children }));
|
|
1163
1167
|
};
|
|
@@ -1260,7 +1264,6 @@ const TextRenderer = ({ text, thinking }) => {
|
|
|
1260
1264
|
if (currentPath !== internalPath) {
|
|
1261
1265
|
navigate(internalPath);
|
|
1262
1266
|
}
|
|
1263
|
-
minimizeChatBot();
|
|
1264
1267
|
};
|
|
1265
1268
|
// If the input contains rich HTML, render it directly with DOMPurify sanitization
|
|
1266
1269
|
if (containsRichHtml(text)) {
|
|
@@ -15282,9 +15285,11 @@ const SmartBot = (props) => {
|
|
|
15282
15285
|
skipHierarchyCall: true,
|
|
15283
15286
|
})();
|
|
15284
15287
|
let showAgentIcon = await getAgentVisibilityData();
|
|
15288
|
+
let appCode = getApplicationCodeFromURL(applicationName);
|
|
15289
|
+
let hideNavbot = await getHideNavbotData(appCode);
|
|
15290
|
+
const filterNavigationTab = (tabs) => hideNavbot ? tabs.filter((tab) => tab.name !== "Navigation") : tabs;
|
|
15285
15291
|
if (!isEmpty$1(accessDataResponse) &&
|
|
15286
15292
|
showAgentIcon?.data?.data[0]?.attribute_value?.value) {
|
|
15287
|
-
let appCode = getApplicationCodeFromURL(applicationName);
|
|
15288
15293
|
let list = await getAgentExceptionUserList(appCode);
|
|
15289
15294
|
let isWhitelisted = false;
|
|
15290
15295
|
if (list?.data?.data[0]?.attribute_value?.allow_all) {
|
|
@@ -15496,7 +15501,7 @@ const SmartBot = (props) => {
|
|
|
15496
15501
|
icon: jsx(SvgNavigationIcon, {}),
|
|
15497
15502
|
}
|
|
15498
15503
|
];
|
|
15499
|
-
setTabList(tabListData);
|
|
15504
|
+
setTabList(filterNavigationTab(tabListData));
|
|
15500
15505
|
}
|
|
15501
15506
|
else {
|
|
15502
15507
|
setCurrentMode("navigation");
|