@apteva/apteva-kit 0.1.24 → 0.1.25

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
@@ -20,6 +20,8 @@ interface Widget {
20
20
  id: string;
21
21
  props: Record<string, any>;
22
22
  actions?: Action[];
23
+ /** Additional data not displayed but captured via onWidgetRender */
24
+ meta?: Record<string, any>;
23
25
  }
24
26
  interface CardWidget extends Widget {
25
27
  type: 'card';
package/dist/index.d.ts CHANGED
@@ -20,6 +20,8 @@ interface Widget {
20
20
  id: string;
21
21
  props: Record<string, any>;
22
22
  actions?: Action[];
23
+ /** Additional data not displayed but captured via onWidgetRender */
24
+ meta?: Record<string, any>;
23
25
  }
24
26
  interface CardWidget extends Widget {
25
27
  type: 'card';
package/dist/index.js CHANGED
@@ -594,14 +594,16 @@ function parseWidgetsFromText(text) {
594
594
  }
595
595
  try {
596
596
  const trimmedJson = jsonContent.trim();
597
- const props = JSON.parse(trimmedJson);
597
+ const parsed = JSON.parse(trimmedJson);
598
598
  const widgetId = `widget-${widgetType}-${simpleHash(trimmedJson)}`;
599
+ const { meta, ...props } = parsed;
599
600
  segments.push({
600
601
  type: "widget",
601
602
  widget: {
602
603
  type: widgetType,
603
604
  id: widgetId,
604
- props
605
+ props,
606
+ ...meta && { meta }
605
607
  }
606
608
  });
607
609
  hasWidgets = true;