@apteva/apteva-kit 0.1.84 → 0.1.87

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
@@ -1204,6 +1204,24 @@ function Form({ widget, onAction }) {
1204
1204
  ] });
1205
1205
  }
1206
1206
 
1207
+ // src/components/Widgets/widget-library/Image.tsx
1208
+
1209
+ function Image({ widget }) {
1210
+ const { src, alt, caption } = widget.props;
1211
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "figure", { className: "overflow-hidden rounded-xl", children: [
1212
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1213
+ "img",
1214
+ {
1215
+ src,
1216
+ alt,
1217
+ className: "w-full h-auto object-contain bg-neutral-100 dark:bg-neutral-800",
1218
+ loading: "lazy"
1219
+ }
1220
+ ),
1221
+ caption && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "figcaption", { className: "mt-2 text-center text-sm text-neutral-600 dark:text-neutral-400", children: caption })
1222
+ ] });
1223
+ }
1224
+
1207
1225
  // src/components/Widgets/WidgetRenderer.tsx
1208
1226
 
1209
1227
  function WidgetRenderer({ widget, onAction }) {
@@ -1221,6 +1239,8 @@ function WidgetRenderer({ widget, onAction }) {
1221
1239
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Table, { widget, onAction });
1222
1240
  case "form":
1223
1241
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Form, { widget, onAction });
1242
+ case "image":
1243
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Image, { widget });
1224
1244
  default:
1225
1245
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "p-4 border border-yellow-300 bg-yellow-50 rounded-lg", children: [
1226
1246
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "text-sm text-yellow-800", children: [
@@ -2991,11 +3011,19 @@ ${widgetContext}` : widgetContext;
2991
3011
  }
2992
3012
  break;
2993
3013
  case "tool_stream":
2994
- if (chunk.tool_id && chunk.event === "chunk" && chunk.content) {
3014
+ if (chunk.tool_id) {
2995
3015
  const toolSegment = contentSegments.find((s) => s.type === "tool" && s.id === chunk.tool_id);
2996
3016
  if (toolSegment) {
2997
- toolSegment.streamOutput = chunk.content;
2998
- updateMessage();
3017
+ if (chunk.event === "chunk" && chunk.content) {
3018
+ if (toolSegment.pendingReset) {
3019
+ toolSegment.streamOutput = "";
3020
+ toolSegment.pendingReset = false;
3021
+ }
3022
+ toolSegment.streamOutput = (toolSegment.streamOutput || "") + chunk.content;
3023
+ updateMessage();
3024
+ } else if (chunk.event === "log" || chunk.event === "progress") {
3025
+ toolSegment.pendingReset = true;
3026
+ }
2999
3027
  }
3000
3028
  }
3001
3029
  break;