@smartspace/chat-ui 1.13.1-pr.389.323eee6 → 1.13.1-pr.392.b95fc82

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
@@ -20104,7 +20104,14 @@ function pushContent(items, value) {
20104
20104
  return;
20105
20105
  }
20106
20106
  if (Array.isArray(value)) {
20107
- items.push(...value);
20107
+ const looksLikeContent = value.every(
20108
+ (it) => it != null && typeof it === "object" && ("text" in it || "image" in it)
20109
+ );
20110
+ if (looksLikeContent) {
20111
+ items.push(...value);
20112
+ } else {
20113
+ items.push({ text: "```json\n" + JSON.stringify(value, null, 2) + "\n```" });
20114
+ }
20108
20115
  return;
20109
20116
  }
20110
20117
  if (typeof value === "object") {