impact-chatbot 2.3.14 → 2.3.16

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
@@ -891,6 +891,25 @@ const replaceSpecialCharacter = (str) => {
891
891
  return result;
892
892
  }
893
893
  };
894
+ /**
895
+ * @function
896
+ * @description Function is used to return string by replacing the special characters with respective key mapped to SPECIAL_CHARACTER_MAPPING
897
+ * @param {String} str
898
+ * @returns {String} key of mapped special character used in the string
899
+ */
900
+ const replaceSpecialCharToCharCode = (str) => {
901
+ let re = new RegExp(`[${Object.values(SPECIAL_CHARACTER_MAPPING).join("")}]`, "g");
902
+ return str.replace(re, function (matched) {
903
+ let code;
904
+ for (const [key, value] of Object.entries(SPECIAL_CHARACTER_MAPPING)) {
905
+ if (value === matched) {
906
+ code = key;
907
+ return code;
908
+ }
909
+ }
910
+ return code;
911
+ });
912
+ };
894
913
 
895
914
  /**
896
915
  * Utility functions extracted from core/Utils/functions/utils.js
@@ -4490,7 +4509,7 @@ const Rectangle = ({ type, icon, title, description, onClick, hoverable }) => {
4490
4509
  React.useEffect(() => {
4491
4510
  checkTruncation();
4492
4511
  }, [title, checkTruncation]);
4493
- return (jsxRuntime.jsxs("div", { className: `${classes.rectangle} ${classes[type]} ${hoverable ? classes.rectangleHoverable : ''}`, onClick: onClick, title: isTruncated ? title : null, children: [jsxRuntime.jsxs("div", { className: classes.textContainer, children: [jsxRuntime.jsx(material.Typography, { className: classes.title, ref: titleRef, children: title }), jsxRuntime.jsx(material.Typography, { className: classes.description, children: description })] }), jsxRuntime.jsx("div", { className: classes.iconContainer, children: jsxRuntime.jsx("div", { className: classes.icon, children: icon }) })] }));
4512
+ return (jsxRuntime.jsx("div", { className: `${classes.rectangle} ${classes[type]} ${hoverable ? classes.rectangleHoverable : ''}`, onClick: onClick, title: isTruncated ? title : null, children: jsxRuntime.jsxs("div", { className: classes.textContainer, children: [jsxRuntime.jsx(material.Typography, { className: classes.title, ref: titleRef, children: title }), jsxRuntime.jsx(material.Typography, { className: classes.description, children: description })] }) }));
4494
4513
  };
4495
4514
  const ChatPlaceholder = (props) => {
4496
4515
  const { dateFormat, chatDataRef, currentMode, setShowChatPlaceholder, setLoader, setCurrentAgentId, baseUrl, setBaseUrl, setCurrentSessionId, customChatConfig, chatDataInfoRef, setChatDataState, userInput, legacyAgentScreen, activeConversationId, chatBodyRef, chatbotContext, setInitValue, setSessionId, thinkingContent, setThinkingContent, isThinking, setIsThinking, chatId, setChatId, isStop, setIsStop, functionsRef, functionsState, setFunctionsState, thinkingHeaderMessage, setThinkingHeaderMessage, uniqueChatId, setUniqueChatId, fieldNumber, setFieldNumber, setAdditionalArgs, questions, displayQuestions } = props;
@@ -6774,7 +6793,7 @@ const InputContent = ({ bodyText }) => {
6774
6793
  setValue(newValue);
6775
6794
  chatbotContext[bodyText?.paramName] = {
6776
6795
  ...chatbotContext?.[bodyText?.paramName],
6777
- [bodyText?.paramName]: newValue,
6796
+ [bodyText?.paramName]: replaceSpecialCharToCharCode(newValue),
6778
6797
  updated: true,
6779
6798
  type: inputType,
6780
6799
  };