@apteva/apteva-kit 0.1.34 → 0.1.35
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 +36 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +36 -11
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1325,23 +1325,48 @@ function Message({ message, onAction, enableWidgets, onWidgetRender }) {
|
|
|
1325
1325
|
] });
|
|
1326
1326
|
}
|
|
1327
1327
|
if (contentSegments && contentSegments.length > 0) {
|
|
1328
|
-
return
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1328
|
+
return null;
|
|
1329
|
+
}
|
|
1330
|
+
return renderTextContent(message.content);
|
|
1331
|
+
};
|
|
1332
|
+
const renderSegmentedContent = () => {
|
|
1333
|
+
if (!contentSegments || contentSegments.length === 0) {
|
|
1334
|
+
return null;
|
|
1335
|
+
}
|
|
1336
|
+
const elements = [];
|
|
1337
|
+
contentSegments.forEach((segment, index) => {
|
|
1338
|
+
if (segment.type === "text" && segment.content) {
|
|
1339
|
+
elements.push(
|
|
1340
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1341
|
+
"div",
|
|
1342
|
+
{
|
|
1343
|
+
className: "apteva-message-bubble apteva-message-assistant",
|
|
1344
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "apteva-message-content-assistant", children: renderTextContent(segment.content) })
|
|
1345
|
+
},
|
|
1346
|
+
`text-${index}`
|
|
1347
|
+
)
|
|
1348
|
+
);
|
|
1349
|
+
} else if (segment.type === "tool") {
|
|
1350
|
+
elements.push(
|
|
1351
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "apteva-tool-call-standalone", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1333
1352
|
ToolCall,
|
|
1334
1353
|
{
|
|
1335
1354
|
name: segment.name,
|
|
1336
1355
|
status: segment.result !== void 0 ? "completed" : "running"
|
|
1337
1356
|
}
|
|
1338
|
-
) }, segment.id)
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
return renderTextContent(message.content);
|
|
1357
|
+
) }, segment.id)
|
|
1358
|
+
);
|
|
1359
|
+
}
|
|
1360
|
+
});
|
|
1361
|
+
return elements;
|
|
1344
1362
|
};
|
|
1363
|
+
if (!isUser && contentSegments && contentSegments.length > 0) {
|
|
1364
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "apteva-message-segmented", children: [
|
|
1365
|
+
renderSegmentedContent(),
|
|
1366
|
+
message.widgets && message.widgets.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "apteva-message-widgets", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Widgets, { widgets: message.widgets, onAction, layout: "stack" }) }),
|
|
1367
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "apteva-message-timestamp apteva-message-timestamp-assistant", suppressHydrationWarning: true, children: message.timestamp.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) })
|
|
1368
|
+
] });
|
|
1369
|
+
}
|
|
1345
1370
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1346
1371
|
"div",
|
|
1347
1372
|
{
|