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.esm.js CHANGED
@@ -869,6 +869,25 @@ const replaceSpecialCharacter = (str) => {
869
869
  return result;
870
870
  }
871
871
  };
872
+ /**
873
+ * @function
874
+ * @description Function is used to return string by replacing the special characters with respective key mapped to SPECIAL_CHARACTER_MAPPING
875
+ * @param {String} str
876
+ * @returns {String} key of mapped special character used in the string
877
+ */
878
+ const replaceSpecialCharToCharCode = (str) => {
879
+ let re = new RegExp(`[${Object.values(SPECIAL_CHARACTER_MAPPING).join("")}]`, "g");
880
+ return str.replace(re, function (matched) {
881
+ let code;
882
+ for (const [key, value] of Object.entries(SPECIAL_CHARACTER_MAPPING)) {
883
+ if (value === matched) {
884
+ code = key;
885
+ return code;
886
+ }
887
+ }
888
+ return code;
889
+ });
890
+ };
872
891
 
873
892
  /**
874
893
  * Utility functions extracted from core/Utils/functions/utils.js
@@ -4468,7 +4487,7 @@ const Rectangle = ({ type, icon, title, description, onClick, hoverable }) => {
4468
4487
  useEffect(() => {
4469
4488
  checkTruncation();
4470
4489
  }, [title, checkTruncation]);
4471
- return (jsxs("div", { className: `${classes.rectangle} ${classes[type]} ${hoverable ? classes.rectangleHoverable : ''}`, onClick: onClick, title: isTruncated ? title : null, children: [jsxs("div", { className: classes.textContainer, children: [jsx(Typography, { className: classes.title, ref: titleRef, children: title }), jsx(Typography, { className: classes.description, children: description })] }), jsx("div", { className: classes.iconContainer, children: jsx("div", { className: classes.icon, children: icon }) })] }));
4490
+ return (jsx("div", { className: `${classes.rectangle} ${classes[type]} ${hoverable ? classes.rectangleHoverable : ''}`, onClick: onClick, title: isTruncated ? title : null, children: jsxs("div", { className: classes.textContainer, children: [jsx(Typography, { className: classes.title, ref: titleRef, children: title }), jsx(Typography, { className: classes.description, children: description })] }) }));
4472
4491
  };
4473
4492
  const ChatPlaceholder = (props) => {
4474
4493
  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;
@@ -6752,7 +6771,7 @@ const InputContent = ({ bodyText }) => {
6752
6771
  setValue(newValue);
6753
6772
  chatbotContext[bodyText?.paramName] = {
6754
6773
  ...chatbotContext?.[bodyText?.paramName],
6755
- [bodyText?.paramName]: newValue,
6774
+ [bodyText?.paramName]: replaceSpecialCharToCharCode(newValue),
6756
6775
  updated: true,
6757
6776
  type: inputType,
6758
6777
  };