@smartspace/chat-ui 1.13.1-dev.5faa59f → 1.13.1-dev.7dc0bb5
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.d.ts +10 -0
- package/dist/index.js +34 -21
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -515,6 +515,11 @@ declare function mapThreadsResponseDtoToModel(dto: ThreadsResponseDto): ThreadsR
|
|
|
515
515
|
declare function mapSignalRThreadSummaryToModel(summary: SignalR.MessageThreadSummary): MessageThread;
|
|
516
516
|
|
|
517
517
|
declare const workspaceResponseSchema: z.ZodObject<{
|
|
518
|
+
connectors: z.ZodArray<z.ZodObject<{
|
|
519
|
+
id: z.ZodString;
|
|
520
|
+
kind: z.ZodString;
|
|
521
|
+
name: z.ZodString;
|
|
522
|
+
}, z.core.$strip>>;
|
|
518
523
|
createdAt: z.ZodISODateTime;
|
|
519
524
|
createdByUserId: z.ZodString;
|
|
520
525
|
dataSpaces: z.ZodArray<z.ZodObject<{
|
|
@@ -751,6 +756,11 @@ declare const workspaceUsersResponseSchema: z.ZodArray<z.ZodObject<{
|
|
|
751
756
|
}, z.core.$strip>>;
|
|
752
757
|
declare const workspacesListResponseSchema: z.ZodObject<{
|
|
753
758
|
data: z.ZodArray<z.ZodObject<{
|
|
759
|
+
connectors: z.ZodArray<z.ZodObject<{
|
|
760
|
+
id: z.ZodString;
|
|
761
|
+
kind: z.ZodString;
|
|
762
|
+
name: z.ZodString;
|
|
763
|
+
}, z.core.$strip>>;
|
|
754
764
|
createdAt: z.ZodISODateTime;
|
|
755
765
|
createdByUserId: z.ZodString;
|
|
756
766
|
dataSpaces: z.ZodArray<z.ZodObject<{
|
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
|
-
|
|
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") {
|
|
@@ -20179,25 +20186,28 @@ var MessageItem = ({
|
|
|
20179
20186
|
let groupOpen = false;
|
|
20180
20187
|
let keyCounter = 0;
|
|
20181
20188
|
let lastStatusNode = null;
|
|
20189
|
+
const groupHasAnything = () => groupContent.length > 0 || groupFiles.length > 0 || groupSources.length > 0;
|
|
20182
20190
|
const flush = (nextType) => {
|
|
20183
|
-
|
|
20184
|
-
|
|
20185
|
-
|
|
20186
|
-
|
|
20187
|
-
|
|
20188
|
-
|
|
20189
|
-
|
|
20190
|
-
|
|
20191
|
-
|
|
20192
|
-
|
|
20193
|
-
|
|
20194
|
-
|
|
20195
|
-
|
|
20196
|
-
|
|
20197
|
-
|
|
20198
|
-
|
|
20199
|
-
|
|
20200
|
-
|
|
20191
|
+
if (groupHasAnything()) {
|
|
20192
|
+
bubbles.push(
|
|
20193
|
+
/* @__PURE__ */ jsx(
|
|
20194
|
+
MessageBubble,
|
|
20195
|
+
{
|
|
20196
|
+
createdBy: lastCreatedBy,
|
|
20197
|
+
createdByUserId: lastCreatedByUserId,
|
|
20198
|
+
createdAt: lastCreatedAt,
|
|
20199
|
+
type: groupType,
|
|
20200
|
+
content: groupContent,
|
|
20201
|
+
files: groupFiles,
|
|
20202
|
+
sources: groupSources,
|
|
20203
|
+
chatbotName,
|
|
20204
|
+
userOutput: null,
|
|
20205
|
+
userInput: null
|
|
20206
|
+
},
|
|
20207
|
+
`bubble-${message.id ?? "msg"}-${keyCounter++}`
|
|
20208
|
+
)
|
|
20209
|
+
);
|
|
20210
|
+
}
|
|
20201
20211
|
groupContent = [];
|
|
20202
20212
|
groupFiles = [];
|
|
20203
20213
|
groupSources = [];
|
|
@@ -20229,6 +20239,9 @@ var MessageItem = ({
|
|
|
20229
20239
|
case "prompt":
|
|
20230
20240
|
case "response":
|
|
20231
20241
|
case "content": {
|
|
20242
|
+
if (v.value === "") {
|
|
20243
|
+
continue;
|
|
20244
|
+
}
|
|
20232
20245
|
lastStatusNode = null;
|
|
20233
20246
|
if (groupContent.length > 0) flush(v.type);
|
|
20234
20247
|
if (v.value == null) {
|
|
@@ -20283,7 +20296,7 @@ var MessageItem = ({
|
|
|
20283
20296
|
}
|
|
20284
20297
|
case "sources": {
|
|
20285
20298
|
groupSources = coerceSources(v.value);
|
|
20286
|
-
groupOpen = true;
|
|
20299
|
+
if (groupSources.length > 0) groupOpen = true;
|
|
20287
20300
|
break;
|
|
20288
20301
|
}
|
|
20289
20302
|
default: {
|
|
@@ -20297,7 +20310,7 @@ var MessageItem = ({
|
|
|
20297
20310
|
lastCreatedBy = v.createdBy;
|
|
20298
20311
|
lastCreatedByUserId = v.createdByUserId;
|
|
20299
20312
|
}
|
|
20300
|
-
if (groupOpen) {
|
|
20313
|
+
if (groupOpen && groupHasAnything()) {
|
|
20301
20314
|
bubbles.push(
|
|
20302
20315
|
/* @__PURE__ */ jsx(
|
|
20303
20316
|
MessageBubble,
|