@xapp/chat-widget 1.88.0 → 1.90.0

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.js CHANGED
@@ -1900,7 +1900,15 @@ function sendGreeting(PRECHAT_FORM_ENABLED) {
1900
1900
  }
1901
1901
 
1902
1902
  function sendMessage(msg) {
1903
- return function (chatServer) { return function () {
1903
+ return function (chatServer) { return function (dispatch, getState) {
1904
+ var state = getState();
1905
+ // Don't allow visitor to send message if offline
1906
+ if (state.accountStatus === "offline" && !state.isChatting)
1907
+ return;
1908
+ // Write user message to Redux before server send so it appears above streaming response
1909
+ if (msg.msg) {
1910
+ dispatch(writeMessage(msg.msg, state.visitor, +new Date()));
1911
+ }
1904
1912
  chatServer.sendChatMsgRequest(msg, function () { });
1905
1913
  }; };
1906
1914
  }
@@ -4089,6 +4097,7 @@ var MCPChat = /** @class */ (function () {
4089
4097
  text: accumulatedText || data.response.response || "",
4090
4098
  options: options,
4091
4099
  sources: sources,
4100
+ displays: data.response.displays,
4092
4101
  };
4093
4102
  // Capture tool calls before flushing (debug mode)
4094
4103
  var toolCalls_1 = _this.config.debugMode ? __spreadArray$1([], _this.currentToolCalls, true) : undefined;