@kite-copilot/chat-panel 0.2.22 → 0.2.23

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/auto.cjs CHANGED
@@ -888,6 +888,9 @@ function DataRenderer({ type, data }) {
888
888
  var import_jsx_runtime9 = require("react/jsx-runtime");
889
889
  var DEFAULT_AGENT_URL = "http://localhost:5002";
890
890
  var PANEL_WIDTH = 340;
891
+ function unescapeJsonString(str) {
892
+ return str.replace(/\\\\n/g, "\n").replace(/\\\\t/g, " ").replace(/\\\\"/g, '"').replace(/\\\\\\\\/g, "\\").replace(/\\n/g, "\n").replace(/\\t/g, " ").replace(/\\"/g, '"').replace(/\\\\/g, "\\");
893
+ }
891
894
  function renderMarkdown(text) {
892
895
  if (!text) return null;
893
896
  const lines = text.split("\n");
@@ -1525,6 +1528,7 @@ function ChatPanel({
1525
1528
  } catch {
1526
1529
  }
1527
1530
  }
1531
+ textToStream = unescapeJsonString(textToStream);
1528
1532
  const tokens = textToStream.split(" ");
1529
1533
  let i = 0;
1530
1534
  const intervalId = window.setInterval(() => {
package/dist/auto.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createKiteChat
3
- } from "./chunk-SIPUO7GU.js";
3
+ } from "./chunk-MIJSRC3X.js";
4
4
 
5
5
  // src/auto.ts
6
6
  function mountKiteChat(config) {
@@ -887,6 +887,9 @@ import { ArrowLeft, ArrowUp, Command, CornerDownLeft, CheckCircle2 as CheckCircl
887
887
  import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
888
888
  var DEFAULT_AGENT_URL = "http://localhost:5002";
889
889
  var PANEL_WIDTH = 340;
890
+ function unescapeJsonString(str) {
891
+ return str.replace(/\\\\n/g, "\n").replace(/\\\\t/g, " ").replace(/\\\\"/g, '"').replace(/\\\\\\\\/g, "\\").replace(/\\n/g, "\n").replace(/\\t/g, " ").replace(/\\"/g, '"').replace(/\\\\/g, "\\");
892
+ }
890
893
  function renderMarkdown(text) {
891
894
  if (!text) return null;
892
895
  const lines = text.split("\n");
@@ -1524,6 +1527,7 @@ function ChatPanel({
1524
1527
  } catch {
1525
1528
  }
1526
1529
  }
1530
+ textToStream = unescapeJsonString(textToStream);
1527
1531
  const tokens = textToStream.split(" ");
1528
1532
  let i = 0;
1529
1533
  const intervalId = window.setInterval(() => {