@deepagents/react-genai 7.45.1 → 7.45.3

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
@@ -1150,7 +1150,7 @@ function sr(e) {
1150
1150
  }
1151
1151
  function cr(e, t) {
1152
1152
  if (typeof e != "string") return e;
1153
- let n = sr(hr(e, dr(t))).replace(/<(\w[\w-]*)((?:\s+[\w-]+="[^"]*")+)\s*(\/?>)/g, (e, t, n, r) => `<${t}${n.replace(/\s+/g, " ").replace(/"([^"]*)"/g, (e, t) => `"${t.replace(/\*/g, "&#42;")}"`)}${r}`);
1153
+ let n = sr(hr(e, dr(t))).replace(/<(\w[\w-]*)((?:\s+[\w-]+="[^"]*")+)\s*(\/?>)/g, (e, t, n, r) => `<${t}${n.replace(/\s+/g, " ")}${r}`);
1154
1154
  return n = n.replace(/\/>(\s*)</g, (e, t, n, r) => !t.includes("\n") && ur(r, n) ? e : "/>\n\n<"), gr(n, t);
1155
1155
  }
1156
1156
  var lr = /<\w[\w-]*(?:"(?:\\.|[^"])*"|[^>"])*>|<\/[\w-]+\s*>/g;
@@ -1190,7 +1190,7 @@ function gr(e, t, n = !1) {
1190
1190
  }
1191
1191
  if (e[c - 1] === "/") {
1192
1192
  let t = e.slice(a, c + 1);
1193
- n ? i += "<div>" + t + "</div>" : ur(e, a) ? i += "<span>" + t.slice(0, -2).trimEnd() + "></" + s + "></span>" : (i += t, e[c + 1] === "\n" && c + 2 < e.length && e[c + 2] !== "\n" && (i += "\n")), a = c + 1;
1193
+ n ? i += "<div>" + t + "</div>" : ur(e, a) ? i += "<span>" + t.slice(0, -2).trimEnd() + "></" + s + "></span>" : (i += t.slice(0, -2).trimEnd() + "></" + s + ">", e[c + 1] === "\n" && c + 2 < e.length && e[c + 2] !== "\n" && (i += "\n")), a = c + 1;
1194
1194
  continue;
1195
1195
  }
1196
1196
  let l = vr(e, c + 1, s);
@@ -1203,7 +1203,12 @@ function gr(e, t, n = !1) {
1203
1203
  continue;
1204
1204
  }
1205
1205
  let u = e.slice(a, c + 1), d = e.slice(c + 1, l.start), f = e.slice(l.start, l.end), p = gr(d, t, !0);
1206
- n ? i += "<div>" + u + p + f + "</div>" : i = yr(i) + "<div>" + u + p + f + "</div>", a = l.end;
1206
+ if (n) i += "<div>" + u + p + f + "</div>";
1207
+ else {
1208
+ let t = p.includes("\n") ? "\n" : "";
1209
+ i = yr(i) + "<div>" + t + u + p + f + t + "</div>", e[l.end] === "\n" && l.end + 1 < e.length && e[l.end + 1] !== "\n" && (i += "\n");
1210
+ }
1211
+ a = l.end;
1207
1212
  }
1208
1213
  return i;
1209
1214
  }