@apteva/apteva-kit 0.1.62 → 0.1.64
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 +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +8 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -186,23 +186,23 @@ interface SendMessageParams {
|
|
|
186
186
|
*/
|
|
187
187
|
declare const WIDGET_DEFINITIONS: {
|
|
188
188
|
readonly card: {
|
|
189
|
-
readonly schema: "title, description?, image?, footer
|
|
189
|
+
readonly schema: "title, description?, image?, footer?, actions?: [{type, label}]";
|
|
190
190
|
readonly example: "@ui:card[{\"title\": \"Summary\", \"description\": \"Details here\"}]";
|
|
191
191
|
};
|
|
192
192
|
readonly list: {
|
|
193
|
-
readonly schema: "items: [{id, title, subtitle?, description?}]";
|
|
193
|
+
readonly schema: "items: [{id, title, subtitle?, description?}], actions?: [{type, label}]";
|
|
194
194
|
readonly example: "@ui:list[{\"items\": [{\"id\": \"1\", \"title\": \"Item\", \"subtitle\": \"Info\"}]}]";
|
|
195
195
|
};
|
|
196
196
|
readonly button_group: {
|
|
197
|
-
readonly schema: "buttons: [{id, label, variant?}]";
|
|
197
|
+
readonly schema: "buttons: [{id, label, variant?}] - Use for standalone buttons only, NOT for form submits";
|
|
198
198
|
readonly example: "@ui:button_group[{\"buttons\": [{\"id\": \"ok\", \"label\": \"OK\"}]}]";
|
|
199
199
|
};
|
|
200
200
|
readonly form: {
|
|
201
|
-
readonly schema: "fields: [{name, type, label, required?}]";
|
|
202
|
-
readonly example: "@ui:form[{\"fields\": [{\"name\": \"
|
|
201
|
+
readonly schema: "title?, fields: [{name, type: text|password|number|select|checkbox|textarea|date, label, required?, placeholder?, options?}], actions: [{type, label}] - Button is built-in via actions, do NOT add separate button";
|
|
202
|
+
readonly example: "@ui:form[{\"title\": \"Settings\", \"fields\": [{\"name\": \"apiKey\", \"type\": \"password\", \"label\": \"API Key\", \"required\": true}], \"actions\": [{\"type\": \"save\", \"label\": \"Save\"}]}]";
|
|
203
203
|
};
|
|
204
204
|
readonly table: {
|
|
205
|
-
readonly schema: "columns: [{key, label}], rows: [...]";
|
|
205
|
+
readonly schema: "columns: [{key, label}], rows: [...], striped?, compact?";
|
|
206
206
|
readonly example: "@ui:table[{\"columns\": [{\"key\": \"name\", \"label\": \"Name\"}], \"rows\": [{\"name\": \"A\"}]}]";
|
|
207
207
|
};
|
|
208
208
|
readonly image: {
|
package/dist/index.d.ts
CHANGED
|
@@ -186,23 +186,23 @@ interface SendMessageParams {
|
|
|
186
186
|
*/
|
|
187
187
|
declare const WIDGET_DEFINITIONS: {
|
|
188
188
|
readonly card: {
|
|
189
|
-
readonly schema: "title, description?, image?, footer
|
|
189
|
+
readonly schema: "title, description?, image?, footer?, actions?: [{type, label}]";
|
|
190
190
|
readonly example: "@ui:card[{\"title\": \"Summary\", \"description\": \"Details here\"}]";
|
|
191
191
|
};
|
|
192
192
|
readonly list: {
|
|
193
|
-
readonly schema: "items: [{id, title, subtitle?, description?}]";
|
|
193
|
+
readonly schema: "items: [{id, title, subtitle?, description?}], actions?: [{type, label}]";
|
|
194
194
|
readonly example: "@ui:list[{\"items\": [{\"id\": \"1\", \"title\": \"Item\", \"subtitle\": \"Info\"}]}]";
|
|
195
195
|
};
|
|
196
196
|
readonly button_group: {
|
|
197
|
-
readonly schema: "buttons: [{id, label, variant?}]";
|
|
197
|
+
readonly schema: "buttons: [{id, label, variant?}] - Use for standalone buttons only, NOT for form submits";
|
|
198
198
|
readonly example: "@ui:button_group[{\"buttons\": [{\"id\": \"ok\", \"label\": \"OK\"}]}]";
|
|
199
199
|
};
|
|
200
200
|
readonly form: {
|
|
201
|
-
readonly schema: "fields: [{name, type, label, required?}]";
|
|
202
|
-
readonly example: "@ui:form[{\"fields\": [{\"name\": \"
|
|
201
|
+
readonly schema: "title?, fields: [{name, type: text|password|number|select|checkbox|textarea|date, label, required?, placeholder?, options?}], actions: [{type, label}] - Button is built-in via actions, do NOT add separate button";
|
|
202
|
+
readonly example: "@ui:form[{\"title\": \"Settings\", \"fields\": [{\"name\": \"apiKey\", \"type\": \"password\", \"label\": \"API Key\", \"required\": true}], \"actions\": [{\"type\": \"save\", \"label\": \"Save\"}]}]";
|
|
203
203
|
};
|
|
204
204
|
readonly table: {
|
|
205
|
-
readonly schema: "columns: [{key, label}], rows: [...]";
|
|
205
|
+
readonly schema: "columns: [{key, label}], rows: [...], striped?, compact?";
|
|
206
206
|
readonly example: "@ui:table[{\"columns\": [{\"key\": \"name\", \"label\": \"Name\"}], \"rows\": [{\"name\": \"A\"}]}]";
|
|
207
207
|
};
|
|
208
208
|
readonly image: {
|
package/dist/index.js
CHANGED
|
@@ -596,13 +596,14 @@ function parseWidgetsFromText(text) {
|
|
|
596
596
|
const trimmedJson = jsonContent.trim();
|
|
597
597
|
const parsed = JSON.parse(trimmedJson);
|
|
598
598
|
const widgetId = `widget-${widgetType}-${simpleHash(trimmedJson)}`;
|
|
599
|
-
const { meta, ...props } = parsed;
|
|
599
|
+
const { meta, actions, ...props } = parsed;
|
|
600
600
|
segments.push({
|
|
601
601
|
type: "widget",
|
|
602
602
|
widget: {
|
|
603
603
|
type: widgetType,
|
|
604
604
|
id: widgetId,
|
|
605
605
|
props,
|
|
606
|
+
...actions && { actions },
|
|
606
607
|
...meta && { meta }
|
|
607
608
|
}
|
|
608
609
|
});
|
|
@@ -639,23 +640,23 @@ function parseWidgetsFromText(text) {
|
|
|
639
640
|
// src/utils/widget-context.ts
|
|
640
641
|
var WIDGET_DEFINITIONS = {
|
|
641
642
|
card: {
|
|
642
|
-
schema: "title, description?, image?, footer
|
|
643
|
+
schema: "title, description?, image?, footer?, actions?: [{type, label}]",
|
|
643
644
|
example: '@ui:card[{"title": "Summary", "description": "Details here"}]'
|
|
644
645
|
},
|
|
645
646
|
list: {
|
|
646
|
-
schema: "items: [{id, title, subtitle?, description?}]",
|
|
647
|
+
schema: "items: [{id, title, subtitle?, description?}], actions?: [{type, label}]",
|
|
647
648
|
example: '@ui:list[{"items": [{"id": "1", "title": "Item", "subtitle": "Info"}]}]'
|
|
648
649
|
},
|
|
649
650
|
button_group: {
|
|
650
|
-
schema: "buttons: [{id, label, variant?}]",
|
|
651
|
+
schema: "buttons: [{id, label, variant?}] - Use for standalone buttons only, NOT for form submits",
|
|
651
652
|
example: '@ui:button_group[{"buttons": [{"id": "ok", "label": "OK"}]}]'
|
|
652
653
|
},
|
|
653
654
|
form: {
|
|
654
|
-
schema: "fields: [{name, type, label, required?}]",
|
|
655
|
-
example: '@ui:form[{"fields": [{"name": "
|
|
655
|
+
schema: "title?, fields: [{name, type: text|password|number|select|checkbox|textarea|date, label, required?, placeholder?, options?}], actions: [{type, label}] - Button is built-in via actions, do NOT add separate button",
|
|
656
|
+
example: '@ui:form[{"title": "Settings", "fields": [{"name": "apiKey", "type": "password", "label": "API Key", "required": true}], "actions": [{"type": "save", "label": "Save"}]}]'
|
|
656
657
|
},
|
|
657
658
|
table: {
|
|
658
|
-
schema: "columns: [{key, label}], rows: [...]",
|
|
659
|
+
schema: "columns: [{key, label}], rows: [...], striped?, compact?",
|
|
659
660
|
example: '@ui:table[{"columns": [{"key": "name", "label": "Name"}], "rows": [{"name": "A"}]}]'
|
|
660
661
|
},
|
|
661
662
|
image: {
|