@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 CHANGED
@@ -85,7 +85,7 @@ interface ListItem {
85
85
  subtitle?: string;
86
86
  description?: string;
87
87
  image?: string;
88
- metadata?: Record<string, any>;
88
+ meta?: Record<string, any>;
89
89
  backgroundColor?: string;
90
90
  }
91
91
  interface ChartWidget extends Widget {
@@ -192,8 +192,8 @@ declare const WIDGET_DEFINITIONS: {
192
192
  readonly example: "@ui:card[{\"title\": \"Summary\", \"description\": \"Details here\"}]";
193
193
  };
194
194
  readonly list: {
195
- readonly schema: "items: [{id, title, subtitle?, description?}], actions?: [{type, label}]";
196
- readonly example: "@ui:list[{\"items\": [{\"id\": \"1\", \"title\": \"Item\", \"subtitle\": \"Info\"}]}]";
195
+ readonly schema: "items: [{id, title, subtitle?, description?, image?, meta?: {any extra data}}], actions?: [{type, label}] - meta is sent as action payload when clicked";
196
+ readonly example: "@ui:list[{\"items\": [{\"id\": \"1\", \"title\": \"Item\", \"subtitle\": \"Info\", \"meta\": {\"key\": \"value\"}}]}]";
197
197
  };
198
198
  readonly button_group: {
199
199
  readonly schema: "buttons: [{id, label, variant?}] - Use for standalone buttons only, NOT for form submits";
package/dist/index.d.ts CHANGED
@@ -85,7 +85,7 @@ interface ListItem {
85
85
  subtitle?: string;
86
86
  description?: string;
87
87
  image?: string;
88
- metadata?: Record<string, any>;
88
+ meta?: Record<string, any>;
89
89
  backgroundColor?: string;
90
90
  }
91
91
  interface ChartWidget extends Widget {
@@ -192,8 +192,8 @@ declare const WIDGET_DEFINITIONS: {
192
192
  readonly example: "@ui:card[{\"title\": \"Summary\", \"description\": \"Details here\"}]";
193
193
  };
194
194
  readonly list: {
195
- readonly schema: "items: [{id, title, subtitle?, description?}], actions?: [{type, label}]";
196
- readonly example: "@ui:list[{\"items\": [{\"id\": \"1\", \"title\": \"Item\", \"subtitle\": \"Info\"}]}]";
195
+ readonly schema: "items: [{id, title, subtitle?, description?, image?, meta?: {any extra data}}], actions?: [{type, label}] - meta is sent as action payload when clicked";
196
+ readonly example: "@ui:list[{\"items\": [{\"id\": \"1\", \"title\": \"Item\", \"subtitle\": \"Info\", \"meta\": {\"key\": \"value\"}}]}]";
197
197
  };
198
198
  readonly button_group: {
199
199
  readonly schema: "buttons: [{id, label, variant?}] - Use for standalone buttons only, NOT for form submits";
package/dist/index.js 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: true
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?}], actions?: [{type, label}]",
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
- Meta example: @ui:list[{"items": [{"id": "1", "title": "X"}], "meta": {"items": [{"id": "1", "title": "X", "extra": "..."}]}}]
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: () => _optionalChain([onAction, 'optionalCall', _3 => _3({
873
874
  type: action.type,
874
- payload: item.metadata || item,
875
+ payload: item.meta || item,
875
876
  widgetId: widget.id,
876
877
  timestamp: /* @__PURE__ */ new Date()
877
878
  })]),