@apteva/apteva-kit 0.1.79 → 0.1.81
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.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -644,7 +644,8 @@ function parseWidgetsFromText(text) {
|
|
|
644
644
|
type: widgetType,
|
|
645
645
|
id: widgetId,
|
|
646
646
|
props: widgetType === "table" ? { rows: items, columns: [] } : { items },
|
|
647
|
-
isStreaming
|
|
647
|
+
isStreaming
|
|
648
|
+
// Use actual streaming state from items array parsing
|
|
648
649
|
}
|
|
649
650
|
});
|
|
650
651
|
hasWidgets = true;
|
|
@@ -738,8 +739,8 @@ var WIDGET_DEFINITIONS = {
|
|
|
738
739
|
example: '@ui:card[{"title": "Summary", "description": "Details here"}]'
|
|
739
740
|
},
|
|
740
741
|
list: {
|
|
741
|
-
schema: "items: [{id, title, subtitle?, description
|
|
742
|
-
example: '@ui:list[{"items": [{"id": "1", "title": "Item", "subtitle": "Info"}]}]'
|
|
742
|
+
schema: "items: [{id, title, subtitle?, description?, image?, meta?: {any extra data}}], actions?: [{type, label}] - meta is sent as action payload when clicked",
|
|
743
|
+
example: '@ui:list[{"items": [{"id": "1", "title": "Item", "subtitle": "Info", "meta": {"key": "value"}}]}]'
|
|
743
744
|
},
|
|
744
745
|
button_group: {
|
|
745
746
|
schema: "buttons: [{id, label, variant?}] - Use for standalone buttons only, NOT for form submits",
|
|
@@ -781,7 +782,7 @@ WRONG: @ui:list{"items": [...]} (missing square brackets)
|
|
|
781
782
|
`;
|
|
782
783
|
}
|
|
783
784
|
context += `
|
|
784
|
-
|
|
785
|
+
Per-item "meta" is sent as payload on action click.
|
|
785
786
|
`;
|
|
786
787
|
return context;
|
|
787
788
|
}
|
|
@@ -871,7 +872,7 @@ function List({ widget, onAction }) {
|
|
|
871
872
|
{
|
|
872
873
|
onClick: () => onAction?.({
|
|
873
874
|
type: action.type,
|
|
874
|
-
payload: item.
|
|
875
|
+
payload: item.meta || item,
|
|
875
876
|
widgetId: widget.id,
|
|
876
877
|
timestamp: /* @__PURE__ */ new Date()
|
|
877
878
|
}),
|