@smartspace/chat-ui 1.14.2-main.de9869c → 1.14.4-main.3b9a36d
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 +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -566,6 +566,11 @@ declare function mapThreadsResponseDtoToModel(dto: ThreadsResponseDto): ThreadsR
|
|
|
566
566
|
declare function mapSignalRThreadSummaryToModel(summary: SignalR.MessageThreadSummary): MessageThread;
|
|
567
567
|
|
|
568
568
|
declare const workspaceResponseSchema: z.ZodObject<{
|
|
569
|
+
connectors: z.ZodArray<z.ZodObject<{
|
|
570
|
+
id: z.ZodString;
|
|
571
|
+
kind: z.ZodString;
|
|
572
|
+
name: z.ZodString;
|
|
573
|
+
}, z.core.$strip>>;
|
|
569
574
|
createdAt: z.ZodISODateTime;
|
|
570
575
|
createdByUserId: z.ZodString;
|
|
571
576
|
dataSpaces: z.ZodArray<z.ZodObject<{
|
|
@@ -802,6 +807,11 @@ declare const workspaceUsersResponseSchema: z.ZodArray<z.ZodObject<{
|
|
|
802
807
|
}, z.core.$strip>>;
|
|
803
808
|
declare const workspacesListResponseSchema: z.ZodObject<{
|
|
804
809
|
data: z.ZodArray<z.ZodObject<{
|
|
810
|
+
connectors: z.ZodArray<z.ZodObject<{
|
|
811
|
+
id: z.ZodString;
|
|
812
|
+
kind: z.ZodString;
|
|
813
|
+
name: z.ZodString;
|
|
814
|
+
}, z.core.$strip>>;
|
|
805
815
|
createdAt: z.ZodISODateTime;
|
|
806
816
|
createdByUserId: z.ZodString;
|
|
807
817
|
dataSpaces: z.ZodArray<z.ZodObject<{
|
package/dist/index.js
CHANGED
|
@@ -20175,7 +20175,14 @@ function pushContent(items, value) {
|
|
|
20175
20175
|
return;
|
|
20176
20176
|
}
|
|
20177
20177
|
if (Array.isArray(value)) {
|
|
20178
|
-
|
|
20178
|
+
const looksLikeContent = value.every(
|
|
20179
|
+
(it) => it != null && typeof it === "object" && ("text" in it || "image" in it)
|
|
20180
|
+
);
|
|
20181
|
+
if (looksLikeContent) {
|
|
20182
|
+
items.push(...value);
|
|
20183
|
+
} else {
|
|
20184
|
+
items.push({ text: "```json\n" + JSON.stringify(value, null, 2) + "\n```" });
|
|
20185
|
+
}
|
|
20179
20186
|
return;
|
|
20180
20187
|
}
|
|
20181
20188
|
if (typeof value === "object") {
|
|
@@ -20250,25 +20257,28 @@ var MessageItem = ({
|
|
|
20250
20257
|
let groupOpen = false;
|
|
20251
20258
|
let keyCounter = 0;
|
|
20252
20259
|
let lastStatusNode = null;
|
|
20260
|
+
const groupHasAnything = () => groupContent.length > 0 || groupFiles.length > 0 || groupSources.length > 0;
|
|
20253
20261
|
const flush = (nextType) => {
|
|
20254
|
-
|
|
20255
|
-
|
|
20256
|
-
|
|
20257
|
-
|
|
20258
|
-
|
|
20259
|
-
|
|
20260
|
-
|
|
20261
|
-
|
|
20262
|
-
|
|
20263
|
-
|
|
20264
|
-
|
|
20265
|
-
|
|
20266
|
-
|
|
20267
|
-
|
|
20268
|
-
|
|
20269
|
-
|
|
20270
|
-
|
|
20271
|
-
|
|
20262
|
+
if (groupHasAnything()) {
|
|
20263
|
+
bubbles.push(
|
|
20264
|
+
/* @__PURE__ */ jsx(
|
|
20265
|
+
MessageBubble,
|
|
20266
|
+
{
|
|
20267
|
+
createdBy: lastCreatedBy,
|
|
20268
|
+
createdByUserId: lastCreatedByUserId,
|
|
20269
|
+
createdAt: lastCreatedAt,
|
|
20270
|
+
type: groupType,
|
|
20271
|
+
content: groupContent,
|
|
20272
|
+
files: groupFiles,
|
|
20273
|
+
sources: groupSources,
|
|
20274
|
+
chatbotName,
|
|
20275
|
+
userOutput: null,
|
|
20276
|
+
userInput: null
|
|
20277
|
+
},
|
|
20278
|
+
`bubble-${message.id ?? "msg"}-${keyCounter++}`
|
|
20279
|
+
)
|
|
20280
|
+
);
|
|
20281
|
+
}
|
|
20272
20282
|
groupContent = [];
|
|
20273
20283
|
groupFiles = [];
|
|
20274
20284
|
groupSources = [];
|
|
@@ -20301,6 +20311,9 @@ var MessageItem = ({
|
|
|
20301
20311
|
case "prompt":
|
|
20302
20312
|
case "response":
|
|
20303
20313
|
case "content": {
|
|
20314
|
+
if (v.value === "") {
|
|
20315
|
+
continue;
|
|
20316
|
+
}
|
|
20304
20317
|
lastStatusNode = null;
|
|
20305
20318
|
if (groupContent.length > 0) flush(v.type);
|
|
20306
20319
|
if (v.value == null) {
|
|
@@ -20355,7 +20368,7 @@ var MessageItem = ({
|
|
|
20355
20368
|
}
|
|
20356
20369
|
case "sources": {
|
|
20357
20370
|
groupSources = coerceSources(v.value);
|
|
20358
|
-
groupOpen = true;
|
|
20371
|
+
if (groupSources.length > 0) groupOpen = true;
|
|
20359
20372
|
break;
|
|
20360
20373
|
}
|
|
20361
20374
|
default: {
|
|
@@ -20369,7 +20382,7 @@ var MessageItem = ({
|
|
|
20369
20382
|
lastCreatedBy = v.createdBy;
|
|
20370
20383
|
lastCreatedByUserId = v.createdByUserId;
|
|
20371
20384
|
}
|
|
20372
|
-
if (groupOpen) {
|
|
20385
|
+
if (groupOpen && groupHasAnything()) {
|
|
20373
20386
|
bubbles.push(
|
|
20374
20387
|
/* @__PURE__ */ jsx(
|
|
20375
20388
|
MessageBubble,
|