@assistant-ui/react-generative-ui 0.0.18 → 0.0.19
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/JSONGenerativeUI.client.d.ts +1 -2
- package/dist/JSONGenerativeUI.client.d.ts.map +1 -1
- package/dist/JSONGenerativeUI.server.d.ts +1 -2
- package/dist/JSONGenerativeUI.server.d.ts.map +1 -1
- package/dist/JSONGenerativeUI.shared.d.ts +8 -9
- package/dist/JSONGenerativeUI.shared.d.ts.map +1 -1
- package/dist/a2ui/convert.d.ts +1 -2
- package/dist/a2ui/convert.d.ts.map +1 -1
- package/dist/a2ui/reducer.d.ts +1 -2
- package/dist/a2ui/reducer.d.ts.map +1 -1
- package/dist/a2ui/types.d.ts +17 -18
- package/dist/a2ui/types.d.ts.map +1 -1
- package/dist/actionRegistry.d.ts +5 -6
- package/dist/actionRegistry.d.ts.map +1 -1
- package/dist/buildPresentParameters.d.ts +2 -3
- package/dist/buildPresentParameters.d.ts.map +1 -1
- package/dist/constants.d.ts +2 -2
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +2 -1
- package/dist/constants.js.map +1 -1
- package/dist/convert/boundSpec.d.ts +7 -8
- package/dist/convert/boundSpec.d.ts.map +1 -1
- package/dist/convert/copyBounded.d.ts +1 -2
- package/dist/convert/copyBounded.d.ts.map +1 -1
- package/dist/convert/isElement.d.ts +1 -2
- package/dist/convert/isElement.d.ts.map +1 -1
- package/dist/convert/takeRun.d.ts +1 -2
- package/dist/convert/takeRun.d.ts.map +1 -1
- package/dist/defineGenerativeComponents.d.ts +1 -2
- package/dist/defineGenerativeComponents.d.ts.map +1 -1
- package/dist/generativeUIToJSX.d.ts +2 -3
- package/dist/generativeUIToJSX.d.ts.map +1 -1
- package/dist/ir.d.ts +28 -29
- package/dist/ir.d.ts.map +1 -1
- package/dist/renderGenerativeUI.d.ts +1 -2
- package/dist/renderGenerativeUI.d.ts.map +1 -1
- package/dist/slack/constants.d.ts +35 -36
- package/dist/slack/constants.d.ts.map +1 -1
- package/dist/slack/decodeBlockAction.d.ts +1 -2
- package/dist/slack/decodeBlockAction.d.ts.map +1 -1
- package/dist/slack/fromSlackBlocks.d.ts +1 -2
- package/dist/slack/fromSlackBlocks.d.ts.map +1 -1
- package/dist/slack/toSlackBlocks.d.ts +1 -2
- package/dist/slack/toSlackBlocks.d.ts.map +1 -1
- package/dist/slack/types.d.ts +32 -33
- package/dist/slack/types.d.ts.map +1 -1
- package/dist/teams/constants.d.ts +14 -15
- package/dist/teams/constants.d.ts.map +1 -1
- package/dist/teams/decodeSubmitData.d.ts +1 -2
- package/dist/teams/decodeSubmitData.d.ts.map +1 -1
- package/dist/teams/toAdaptiveCard.d.ts +6 -7
- package/dist/teams/toAdaptiveCard.d.ts.map +1 -1
- package/dist/teams/toTeamsAttachments.d.ts +1 -2
- package/dist/teams/toTeamsAttachments.d.ts.map +1 -1
- package/dist/teams/types.d.ts +29 -30
- package/dist/teams/types.d.ts.map +1 -1
- package/dist/types.d.ts +9 -10
- package/dist/types.d.ts.map +1 -1
- package/dist/vocabulary/alert.d.ts +1 -2
- package/dist/vocabulary/alert.d.ts.map +1 -1
- package/dist/vocabulary/collectFormValues.d.ts +6 -5
- package/dist/vocabulary/collectFormValues.d.ts.map +1 -1
- package/dist/vocabulary/collectFormValues.js +3 -2
- package/dist/vocabulary/collectFormValues.js.map +1 -1
- package/dist/vocabulary/data.d.ts +1 -2
- package/dist/vocabulary/data.d.ts.map +1 -1
- package/dist/vocabulary/dispatch.d.ts +2 -3
- package/dist/vocabulary/dispatch.d.ts.map +1 -1
- package/dist/vocabulary/fact.d.ts +1 -2
- package/dist/vocabulary/fact.d.ts.map +1 -1
- package/dist/vocabulary/form.d.ts +1 -2
- package/dist/vocabulary/form.d.ts.map +1 -1
- package/dist/vocabulary/icon.d.ts +1 -2
- package/dist/vocabulary/icon.d.ts.map +1 -1
- package/dist/vocabulary/index.d.ts +1 -2
- package/dist/vocabulary/index.d.ts.map +1 -1
- package/dist/vocabulary/interactive.d.ts +4 -4
- package/dist/vocabulary/interactive.d.ts.map +1 -1
- package/dist/vocabulary/interactive.js +2 -0
- package/dist/vocabulary/interactive.js.map +1 -1
- package/dist/vocabulary/layout.d.ts +1 -2
- package/dist/vocabulary/layout.d.ts.map +1 -1
- package/dist/vocabulary/list.d.ts +1 -2
- package/dist/vocabulary/list.d.ts.map +1 -1
- package/dist/vocabulary/media.d.ts +1 -2
- package/dist/vocabulary/media.d.ts.map +1 -1
- package/dist/vocabulary/text.d.ts +2 -3
- package/dist/vocabulary/text.d.ts.map +1 -1
- package/dist/vocabulary/toTextContent.d.ts +1 -2
- package/dist/vocabulary/toTextContent.d.ts.map +1 -1
- package/package.json +12 -10
- package/src/constants.ts +2 -0
- package/src/slack/fromSlackBlocks.test.ts +4 -1
- package/src/slack/toSlackBlocks.test.ts +8 -4
- package/src/teams/toAdaptiveCard.test.ts +5 -3
- package/src/vocabulary/collectFormValues.test.ts +38 -0
- package/src/vocabulary/collectFormValues.ts +11 -2
- package/src/vocabulary/form.test.tsx +1 -0
- package/src/vocabulary/interactive.test.tsx +14 -1
- package/src/vocabulary/interactive.tsx +8 -1
- package/src/vocabulary/layout.test.tsx +1 -0
- package/src/vocabulary/list.test.tsx +5 -4
- package/dist/node_modules/.pnpm/@types_json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts +0 -141
- package/dist/node_modules/.pnpm/@types_json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts.map +0 -1
package/dist/teams/types.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
//#region src/teams/types.d.ts
|
|
2
2
|
/** A TextBlock size, from Adaptive Card's closed size enum. */
|
|
3
|
-
type TeamsTextSize = "small" | "medium" | "large" | "extraLarge";
|
|
3
|
+
export type TeamsTextSize = "small" | "medium" | "large" | "extraLarge";
|
|
4
4
|
/** A Container's style, driving its accent color in Teams' renderer. */
|
|
5
|
-
type TeamsContainerStyle = "default" | "emphasis" | "good" | "attention" | "warning" | "accent";
|
|
5
|
+
export type TeamsContainerStyle = "default" | "emphasis" | "good" | "attention" | "warning" | "accent";
|
|
6
6
|
/** A run of wrapped text. Every TextBlock we emit sets `wrap: true`. */
|
|
7
|
-
interface TeamsTextBlock {
|
|
7
|
+
export interface TeamsTextBlock {
|
|
8
8
|
readonly type: "TextBlock";
|
|
9
9
|
readonly text: string;
|
|
10
10
|
readonly wrap: true;
|
|
@@ -16,7 +16,7 @@ interface TeamsTextBlock {
|
|
|
16
16
|
readonly spacing?: "large";
|
|
17
17
|
}
|
|
18
18
|
/** An image element. */
|
|
19
|
-
interface TeamsImage {
|
|
19
|
+
export interface TeamsImage {
|
|
20
20
|
readonly type: "Image";
|
|
21
21
|
readonly url: string;
|
|
22
22
|
readonly altText?: string;
|
|
@@ -25,19 +25,19 @@ interface TeamsImage {
|
|
|
25
25
|
readonly spacing?: "large";
|
|
26
26
|
}
|
|
27
27
|
/** One label/value entry inside a {@link TeamsFactSet}. */
|
|
28
|
-
interface TeamsFact {
|
|
28
|
+
export interface TeamsFact {
|
|
29
29
|
readonly title: string;
|
|
30
30
|
readonly value: string;
|
|
31
31
|
}
|
|
32
32
|
/** A set of label/value facts, rendered as an aligned two-column list. */
|
|
33
|
-
interface TeamsFactSet {
|
|
33
|
+
export interface TeamsFactSet {
|
|
34
34
|
readonly type: "FactSet";
|
|
35
35
|
readonly facts: readonly TeamsFact[];
|
|
36
36
|
readonly separator?: true;
|
|
37
37
|
readonly spacing?: "large";
|
|
38
38
|
}
|
|
39
39
|
/** The `aui` envelope nested inside every {@link TeamsSubmitAction}'s `data`. */
|
|
40
|
-
interface TeamsSubmitData {
|
|
40
|
+
export interface TeamsSubmitData {
|
|
41
41
|
readonly aui: {
|
|
42
42
|
readonly type: string;
|
|
43
43
|
readonly payload?: Record<string, unknown>;
|
|
@@ -48,23 +48,23 @@ interface TeamsSubmitData {
|
|
|
48
48
|
* {@link decodeSubmitData} can invert it out of the merged `activity.value`
|
|
49
49
|
* a Teams bot receives, alongside whatever other named inputs shared the card.
|
|
50
50
|
*/
|
|
51
|
-
interface TeamsSubmitAction {
|
|
51
|
+
export interface TeamsSubmitAction {
|
|
52
52
|
readonly type: "Action.Submit";
|
|
53
53
|
readonly title: string;
|
|
54
54
|
readonly data: TeamsSubmitData;
|
|
55
55
|
readonly mode?: "secondary";
|
|
56
56
|
}
|
|
57
57
|
/** The action shape accepted at the card's top-level `actions` field. */
|
|
58
|
-
type TeamsCardAction = TeamsSubmitAction;
|
|
58
|
+
export type TeamsCardAction = TeamsSubmitAction;
|
|
59
59
|
/** A bar of submit actions, rendered inline in the body flow. */
|
|
60
|
-
interface TeamsActionSet {
|
|
60
|
+
export interface TeamsActionSet {
|
|
61
61
|
readonly type: "ActionSet";
|
|
62
62
|
readonly actions: readonly TeamsSubmitAction[];
|
|
63
63
|
readonly separator?: true;
|
|
64
64
|
readonly spacing?: "large";
|
|
65
65
|
}
|
|
66
66
|
/** A bordered grouping container. */
|
|
67
|
-
interface TeamsContainer {
|
|
67
|
+
export interface TeamsContainer {
|
|
68
68
|
readonly type: "Container";
|
|
69
69
|
readonly style?: TeamsContainerStyle;
|
|
70
70
|
readonly items: readonly TeamsCardElement[];
|
|
@@ -73,25 +73,25 @@ interface TeamsContainer {
|
|
|
73
73
|
readonly spacing?: "large";
|
|
74
74
|
}
|
|
75
75
|
/** One column inside a {@link TeamsColumnSet}. */
|
|
76
|
-
interface TeamsColumn {
|
|
76
|
+
export interface TeamsColumn {
|
|
77
77
|
readonly type: "Column";
|
|
78
78
|
readonly width: "auto";
|
|
79
79
|
readonly items: readonly TeamsCardElement[];
|
|
80
80
|
}
|
|
81
81
|
/** A horizontal row of columns. */
|
|
82
|
-
interface TeamsColumnSet {
|
|
82
|
+
export interface TeamsColumnSet {
|
|
83
83
|
readonly type: "ColumnSet";
|
|
84
84
|
readonly columns: readonly TeamsColumn[];
|
|
85
85
|
readonly separator?: true;
|
|
86
86
|
readonly spacing?: "large";
|
|
87
87
|
}
|
|
88
88
|
/** One selectable choice inside a {@link TeamsInputChoiceSet}. */
|
|
89
|
-
interface TeamsInputChoice {
|
|
89
|
+
export interface TeamsInputChoice {
|
|
90
90
|
readonly title: string;
|
|
91
91
|
readonly value: string;
|
|
92
92
|
}
|
|
93
93
|
/** A dropdown (`compact`) or radio group (`expanded`) input. */
|
|
94
|
-
interface TeamsInputChoiceSet {
|
|
94
|
+
export interface TeamsInputChoiceSet {
|
|
95
95
|
readonly type: "Input.ChoiceSet";
|
|
96
96
|
readonly id: string;
|
|
97
97
|
readonly style: "compact" | "expanded";
|
|
@@ -103,7 +103,7 @@ interface TeamsInputChoiceSet {
|
|
|
103
103
|
readonly spacing?: "large";
|
|
104
104
|
}
|
|
105
105
|
/** A checkbox-shaped boolean input. */
|
|
106
|
-
interface TeamsInputToggle {
|
|
106
|
+
export interface TeamsInputToggle {
|
|
107
107
|
readonly type: "Input.Toggle";
|
|
108
108
|
readonly id: string;
|
|
109
109
|
readonly title: string;
|
|
@@ -114,7 +114,7 @@ interface TeamsInputToggle {
|
|
|
114
114
|
readonly spacing?: "large";
|
|
115
115
|
}
|
|
116
116
|
/** A single or multi-line text input. */
|
|
117
|
-
interface TeamsInputText {
|
|
117
|
+
export interface TeamsInputText {
|
|
118
118
|
readonly type: "Input.Text";
|
|
119
119
|
readonly id: string;
|
|
120
120
|
readonly label?: string;
|
|
@@ -124,7 +124,7 @@ interface TeamsInputText {
|
|
|
124
124
|
readonly spacing?: "large";
|
|
125
125
|
}
|
|
126
126
|
/** A date input, restricted to `YYYY-MM-DD` values. */
|
|
127
|
-
interface TeamsInputDate {
|
|
127
|
+
export interface TeamsInputDate {
|
|
128
128
|
readonly type: "Input.Date";
|
|
129
129
|
readonly id: string;
|
|
130
130
|
readonly label?: string;
|
|
@@ -135,21 +135,21 @@ interface TeamsInputDate {
|
|
|
135
135
|
readonly spacing?: "large";
|
|
136
136
|
}
|
|
137
137
|
/** One cell inside a {@link TeamsTableRow}. */
|
|
138
|
-
interface TeamsTableCell {
|
|
138
|
+
export interface TeamsTableCell {
|
|
139
139
|
readonly type: "TableCell";
|
|
140
140
|
readonly items: readonly TeamsTextBlock[];
|
|
141
141
|
}
|
|
142
142
|
/** One row inside a {@link TeamsTable}. */
|
|
143
|
-
interface TeamsTableRow {
|
|
143
|
+
export interface TeamsTableRow {
|
|
144
144
|
readonly type: "TableRow";
|
|
145
145
|
readonly cells: readonly TeamsTableCell[];
|
|
146
146
|
}
|
|
147
147
|
/** A column width definition inside a {@link TeamsTable}. */
|
|
148
|
-
interface TeamsTableColumnDefinition {
|
|
148
|
+
export interface TeamsTableColumnDefinition {
|
|
149
149
|
readonly width: 1;
|
|
150
150
|
}
|
|
151
151
|
/** A native table. `rows[0]` is the header row when `firstRowAsHeaders` is true. */
|
|
152
|
-
interface TeamsTable {
|
|
152
|
+
export interface TeamsTable {
|
|
153
153
|
readonly type: "Table";
|
|
154
154
|
readonly firstRowAsHeaders: boolean;
|
|
155
155
|
readonly columns: readonly TeamsTableColumnDefinition[];
|
|
@@ -158,9 +158,9 @@ interface TeamsTable {
|
|
|
158
158
|
readonly spacing?: "large";
|
|
159
159
|
}
|
|
160
160
|
/** A body element emitted by {@link toAdaptiveCard}. */
|
|
161
|
-
type TeamsCardElement = TeamsTextBlock | TeamsImage | TeamsFactSet | TeamsActionSet | TeamsContainer | TeamsColumnSet | TeamsInputChoiceSet | TeamsInputToggle | TeamsInputText | TeamsInputDate | TeamsTable;
|
|
161
|
+
export type TeamsCardElement = TeamsTextBlock | TeamsImage | TeamsFactSet | TeamsActionSet | TeamsContainer | TeamsColumnSet | TeamsInputChoiceSet | TeamsInputToggle | TeamsInputText | TeamsInputDate | TeamsTable;
|
|
162
162
|
/** A Microsoft Teams Adaptive Card, pinned to schema version 1.5 (the Teams desktop/web cap; mobile clients cap at 1.2). */
|
|
163
|
-
interface TeamsAdaptiveCard {
|
|
163
|
+
export interface TeamsAdaptiveCard {
|
|
164
164
|
readonly $schema: "http://adaptivecards.io/schemas/adaptive-card.json";
|
|
165
165
|
readonly type: "AdaptiveCard";
|
|
166
166
|
readonly version: "1.5";
|
|
@@ -168,7 +168,7 @@ interface TeamsAdaptiveCard {
|
|
|
168
168
|
readonly actions: readonly TeamsCardAction[];
|
|
169
169
|
}
|
|
170
170
|
/** An Adaptive Card wrapped as a bot-framework message attachment. */
|
|
171
|
-
interface TeamsCardAttachment {
|
|
171
|
+
export interface TeamsCardAttachment {
|
|
172
172
|
readonly contentType: "application/vnd.microsoft.card.adaptive";
|
|
173
173
|
readonly content: TeamsAdaptiveCard;
|
|
174
174
|
}
|
|
@@ -182,24 +182,23 @@ interface TeamsCardAttachment {
|
|
|
182
182
|
* such as a payload over the byte budget or a `Row` past the recommended
|
|
183
183
|
* column count.
|
|
184
184
|
*/
|
|
185
|
-
interface TeamsConversionWarning {
|
|
185
|
+
export interface TeamsConversionWarning {
|
|
186
186
|
readonly code: "clamped" | "dropped" | "fallback" | "advisory";
|
|
187
187
|
readonly component: string;
|
|
188
188
|
readonly detail: string;
|
|
189
189
|
}
|
|
190
190
|
/** Options accepted by {@link toAdaptiveCard} and {@link toTeamsAttachments}. Reserved for future extension; no options are currently defined. */
|
|
191
|
-
interface ToAdaptiveCardOptions {}
|
|
191
|
+
export interface ToAdaptiveCardOptions {}
|
|
192
192
|
/** The card and non-fatal warnings produced by {@link toAdaptiveCard}. */
|
|
193
|
-
interface AdaptiveCardResult {
|
|
193
|
+
export interface AdaptiveCardResult {
|
|
194
194
|
readonly card: TeamsAdaptiveCard;
|
|
195
195
|
readonly warnings: TeamsConversionWarning[];
|
|
196
196
|
}
|
|
197
197
|
/** The attachments and non-fatal warnings produced by {@link toTeamsAttachments}. */
|
|
198
|
-
interface TeamsAttachmentsResult {
|
|
198
|
+
export interface TeamsAttachmentsResult {
|
|
199
199
|
readonly attachments: TeamsCardAttachment[];
|
|
200
200
|
readonly attachmentLayout?: "carousel";
|
|
201
201
|
readonly warnings: TeamsConversionWarning[];
|
|
202
202
|
}
|
|
203
203
|
//#endregion
|
|
204
|
-
export { AdaptiveCardResult, TeamsActionSet, TeamsAdaptiveCard, TeamsAttachmentsResult, TeamsCardAction, TeamsCardAttachment, TeamsCardElement, TeamsColumn, TeamsColumnSet, TeamsContainer, TeamsContainerStyle, TeamsConversionWarning, TeamsFact, TeamsFactSet, TeamsImage, TeamsInputChoice, TeamsInputChoiceSet, TeamsInputDate, TeamsInputText, TeamsInputToggle, TeamsSubmitAction, TeamsSubmitData, TeamsTable, TeamsTableCell, TeamsTableColumnDefinition, TeamsTableRow, TeamsTextBlock, TeamsTextSize, ToAdaptiveCardOptions };
|
|
205
204
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../../src/teams/types.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../src/teams/types.ts"],"mappings":";;YACY;;YAGA;;iBASK;WACN;WACA;WACA;WACA,OAAO;WACP;WACA;WACA;WACA;WACA;;;iBAIM;WACN;WACA;WACA;WACA;WACA;WACA;;;iBAIM;WACN;WACA;;;iBAIM;WACN;WACA,gBAAgB;WAChB;WACA;;;iBAIM;WACN;aACE;aACA,UAAU;;;;;;;;iBASN;WACN;WACA;WACA,MAAM;WACN;;;YAIC,kBAAkB;;iBAGb;WACN;WACA,kBAAkB;WAClB;WACA;;;iBAIM;WACN;WACA,QAAQ;WACR,gBAAgB;WAChB,eAAe;WACf;WACA;;;iBAIM;WACN;WACA;WACA,gBAAgB;;;iBAIV;WACN;WACA,kBAAkB;WAClB;WACA;;;iBAIM;WACN;WACA;;;iBAIM;WACN;WACA;WACA;WACA,kBAAkB;WAClB;WACA;WACA;WACA;WACA;;;iBAIM;WACN;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;iBAIM;WACN;WACA;WACA;WACA;WACA;WACA;WACA;;;iBAIM;WACN;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;iBAIM;WACN;WACA,gBAAgB;;;iBAIV;WACN;WACA,gBAAgB;;;iBAIV;WACN;;;iBAIM;WACN;WACA;WACA,kBAAkB;WAClB,eAAe;WACf;WACA;;;YAIC,mBACR,iBACA,aACA,eACA,iBACA,iBACA,iBACA,sBACA,mBACA,iBACA,iBACA;;iBAGa;WACN;WACA;WACA;WACA,eAAe;WACf,kBAAkB;;;iBAIZ;WACN;WACA,SAAS;;;;;;;;;;;;iBAaH;WACN;WACA;WACA;;;iBAIM;;iBAGA;WACN,MAAM;WACN,UAAU;;;iBAIJ;WACN,aAAa;WACb;WACA,UAAU"}
|
package/dist/types.d.ts
CHANGED
|
@@ -9,22 +9,22 @@ import { ZodType } from "zod";
|
|
|
9
9
|
* `props`. Alias of {@link NormalizedUIElement}; kept under its old name so the
|
|
10
10
|
* package's public surface stays append-only.
|
|
11
11
|
*/
|
|
12
|
-
type GenerativeUIElement = NormalizedUIElement;
|
|
13
|
-
type GenerativeUIProps = NormalizedUIElement["props"];
|
|
12
|
+
export type GenerativeUIElement = NormalizedUIElement;
|
|
13
|
+
export type GenerativeUIProps = NormalizedUIElement["props"];
|
|
14
14
|
/**
|
|
15
15
|
* Anything renderable as generative UI — mirrors React's `ReactNode`: an
|
|
16
16
|
* element, primitive text, a list of nodes, or nothing. Widened beyond the
|
|
17
17
|
* model payload (a {@link GenerativeUIElement}) with the renderer's
|
|
18
18
|
* null/boolean/undefined inputs.
|
|
19
19
|
*/
|
|
20
|
-
type GenerativeUINode = GenerativeUIElement | string | number | boolean | null | undefined | GenerativeUINode[];
|
|
21
|
-
type GenerativeUIAction = Action;
|
|
20
|
+
export type GenerativeUINode = GenerativeUIElement | string | number | boolean | null | undefined | GenerativeUINode[];
|
|
21
|
+
export type GenerativeUIAction = Action;
|
|
22
22
|
/** Whether a node's props are still streaming in or have fully arrived. */
|
|
23
|
-
type GenerativeUIStatus = "streaming" | "done";
|
|
23
|
+
export type GenerativeUIStatus = "streaming" | "done";
|
|
24
24
|
/** The dispatcher an interactive component calls to fire its `$action`. */
|
|
25
|
-
type GenerativeUIDispatch = (action: Action) => unknown;
|
|
25
|
+
export type GenerativeUIDispatch = (action: Action) => unknown;
|
|
26
26
|
/** The render context threaded through {@link renderGenerativeUI}. */
|
|
27
|
-
type GenerativeUIRenderContext = {
|
|
27
|
+
export type GenerativeUIRenderContext = {
|
|
28
28
|
/** Whether the tool call's arguments are still streaming or are complete. */
|
|
29
29
|
status: GenerativeUIStatus;
|
|
30
30
|
dispatch?: GenerativeUIDispatch;
|
|
@@ -68,7 +68,7 @@ type StaticRenderProps<P> = P & {
|
|
|
68
68
|
* fine (each node is mounted on its own fiber), but a given node must keep its
|
|
69
69
|
* `type` across renders for hook identity to be stable.
|
|
70
70
|
*/
|
|
71
|
-
type GenerativeUIComponent<P = any> = {
|
|
71
|
+
export type GenerativeUIComponent<P = any> = {
|
|
72
72
|
/** Natural-language description shown to the model when selecting the component. */
|
|
73
73
|
description: string;
|
|
74
74
|
/** Schema for the props the model must provide. Drives the tool parameters. */
|
|
@@ -95,7 +95,6 @@ type GenerativeUIComponent<P = any> = {
|
|
|
95
95
|
*
|
|
96
96
|
* This registry is the security boundary — any `type` not present is rejected.
|
|
97
97
|
*/
|
|
98
|
-
type GenerativeUILibrary = Record<string, GenerativeUIComponent>;
|
|
98
|
+
export type GenerativeUILibrary = Record<string, GenerativeUIComponent>;
|
|
99
99
|
//#endregion
|
|
100
|
-
export { GenerativeUIAction, GenerativeUIComponent, GenerativeUIDispatch, GenerativeUIElement, GenerativeUILibrary, GenerativeUINode, GenerativeUIProps, GenerativeUIRenderContext, GenerativeUIStatus };
|
|
101
100
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../src/types.ts"],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../src/types.ts"],"mappings":";;;;;;;;;;;YAWY,sBAAsB;YAEtB,oBAAoB;;;;;;;YAQpB,mBACR,qEAMA;YAEQ,qBAAqB;;YAGrB;;YAGA,wBAAwB,QAAQ;;YAGhC;;EAEV,QAAQ;EACR,WAAW;;;;;;;;;;;KAYR,qBAAqB,MACrB,QAAQ;EACP,WAAW;EACX;EACA,UAAU;EACV,YAAY;MAEb;EACC,WAAW;EACX;EACA,UAAU;EACV,YAAY;;;KAIb,kBAAkB,KAAK;EAC1B,WAAW;EACX;EACA,UAAU;EACV,YAAY;;;;;;;;;;;;;;YAeF,sBAAsB;;EAG5B;;EAEA,YAAY,QAAQ;;;;;;;EAOpB;EACA,SAAS,OAAO,qBAAqB,OAAO;;EAG5C;EACA,YAAY,QAAQ;;EAEpB;EACA,SAAS,OAAO,kBAAkB,OAAO;;;;;;;;;YAUnC,sBAAsB,eAAe"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/vocabulary/alert.d.ts
|
|
3
|
-
declare const alertVocabulary: {
|
|
3
|
+
export declare const alertVocabulary: {
|
|
4
4
|
Alert: {
|
|
5
5
|
description: string;
|
|
6
6
|
properties: z.ZodObject<{
|
|
@@ -24,5 +24,4 @@ declare const alertVocabulary: {
|
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
26
|
//#endregion
|
|
27
|
-
export { alertVocabulary };
|
|
28
27
|
//# sourceMappingURL=alert.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.d.ts","names":[],"sources":["../../src/vocabulary/alert.tsx"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"alert.d.ts","names":[],"sources":["../../src/vocabulary/alert.tsx"],"mappings":";;qBAQa"}
|
|
@@ -3,21 +3,22 @@ import { FormEvent } from "react";
|
|
|
3
3
|
/**
|
|
4
4
|
* The subset of `HTMLInputElement`/`HTMLSelectElement`/`HTMLTextAreaElement` that {@link collectFormValues} reads. A structural type rather than the DOM interfaces themselves, so a plain object can stand in for a form control in tests.
|
|
5
5
|
*/
|
|
6
|
-
type FormControlElementLike = {
|
|
6
|
+
export type FormControlElementLike = {
|
|
7
7
|
readonly name: string;
|
|
8
8
|
readonly type: string;
|
|
9
9
|
readonly value: string;
|
|
10
10
|
readonly checked?: boolean;
|
|
11
11
|
readonly disabled: boolean;
|
|
12
|
+
readonly hasAttribute: (name: string) => boolean;
|
|
13
|
+
readonly matches?: ((selector: string) => boolean) | undefined;
|
|
12
14
|
};
|
|
13
15
|
/**
|
|
14
|
-
* Collects a submitted form's named control values into a plain object, keyed by `name`, in document order. Reads each control's live DOM state rather than `FormData`, so a checkbox resolves to its `checked` boolean instead of an on/off string. A radio group resolves to its checked option's `value`, or `undefined` if none is checked. Any other repeated `name` resolves to an array of its controls' values, in document order. Controls without a `name`, or that are
|
|
16
|
+
* Collects a submitted form's named control values into a plain object, keyed by `name`, in document order. Reads each control's live DOM state rather than `FormData`, so a checkbox resolves to its `checked` boolean instead of an on/off string. A radio group resolves to its checked option's `value`, or `undefined` if none is checked. Any other repeated `name` resolves to an array of its controls' values, in document order. Controls without a `name`, that carry `data-aui-generated-name`, or that are effectively disabled, including through an ancestor disabled fieldset outside its first legend, are skipped entirely.
|
|
15
17
|
*/
|
|
16
|
-
declare function collectFormValues(elements: ArrayLike<FormControlElementLike>): Record<string, unknown>;
|
|
18
|
+
export declare function collectFormValues(elements: ArrayLike<FormControlElementLike>): Record<string, unknown>;
|
|
17
19
|
/**
|
|
18
20
|
* Convenience wrapper around {@link collectFormValues} for a native form submit event; the cast from `HTMLFormControlsCollection` to `ArrayLike<FormControlElementLike>` lives here once instead of at every call site.
|
|
19
21
|
*/
|
|
20
|
-
declare function collectFormValuesFromEvent(event: FormEvent<HTMLFormElement>): Record<string, unknown>;
|
|
22
|
+
export declare function collectFormValuesFromEvent(event: FormEvent<HTMLFormElement>): Record<string, unknown>;
|
|
21
23
|
//#endregion
|
|
22
|
-
export { FormControlElementLike, collectFormValues, collectFormValuesFromEvent };
|
|
23
24
|
//# sourceMappingURL=collectFormValues.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectFormValues.d.ts","names":[],"sources":["../../src/vocabulary/collectFormValues.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"collectFormValues.d.ts","names":[],"sources":["../../src/vocabulary/collectFormValues.ts"],"mappings":";;;;;YAMY;WACD;WACA;WACA;WACA;WACA;WACA,eAAe;WACf,YAAY;;;;;wBAMP,kBACd,UAAU,UAAU,0BACnB;;;;wBAsCa,2BACd,OAAO,UAAU,mBAChB"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import "../constants.js";
|
|
1
2
|
//#region src/vocabulary/collectFormValues.ts
|
|
2
3
|
/**
|
|
3
|
-
* Collects a submitted form's named control values into a plain object, keyed by `name`, in document order. Reads each control's live DOM state rather than `FormData`, so a checkbox resolves to its `checked` boolean instead of an on/off string. A radio group resolves to its checked option's `value`, or `undefined` if none is checked. Any other repeated `name` resolves to an array of its controls' values, in document order. Controls without a `name`, or that are
|
|
4
|
+
* Collects a submitted form's named control values into a plain object, keyed by `name`, in document order. Reads each control's live DOM state rather than `FormData`, so a checkbox resolves to its `checked` boolean instead of an on/off string. A radio group resolves to its checked option's `value`, or `undefined` if none is checked. Any other repeated `name` resolves to an array of its controls' values, in document order. Controls without a `name`, that carry `data-aui-generated-name`, or that are effectively disabled, including through an ancestor disabled fieldset outside its first legend, are skipped entirely.
|
|
4
5
|
*/
|
|
5
6
|
function collectFormValues(elements) {
|
|
6
7
|
const values = Object.create(null);
|
|
7
8
|
for (const element of Array.from(elements)) {
|
|
8
9
|
const { name, disabled } = element;
|
|
9
|
-
if (!name || disabled) continue;
|
|
10
|
+
if (!name || disabled || element.hasAttribute("data-aui-generated-name") || element.matches?.(":disabled")) continue;
|
|
10
11
|
if (element.type === "radio") {
|
|
11
12
|
if (element.checked) values[name] = element.value;
|
|
12
13
|
else if (!Object.hasOwn(values, name)) values[name] = void 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectFormValues.js","names":[],"sources":["../../src/vocabulary/collectFormValues.ts"],"sourcesContent":["import type { FormEvent } from \"react\";\n\n/**\n * The subset of `HTMLInputElement`/`HTMLSelectElement`/`HTMLTextAreaElement` that {@link collectFormValues} reads. A structural type rather than the DOM interfaces themselves, so a plain object can stand in for a form control in tests.\n */\nexport type FormControlElementLike = {\n readonly name: string;\n readonly type: string;\n readonly value: string;\n readonly checked?: boolean;\n readonly disabled: boolean;\n};\n\n/**\n * Collects a submitted form's named control values into a plain object, keyed by `name`, in document order. Reads each control's live DOM state rather than `FormData`, so a checkbox resolves to its `checked` boolean instead of an on/off string. A radio group resolves to its checked option's `value`, or `undefined` if none is checked. Any other repeated `name` resolves to an array of its controls' values, in document order. Controls without a `name`, or that are
|
|
1
|
+
{"version":3,"file":"collectFormValues.js","names":[],"sources":["../../src/vocabulary/collectFormValues.ts"],"sourcesContent":["import type { FormEvent } from \"react\";\nimport { GENERATED_NAME_ATTR } from \"../constants\";\n\n/**\n * The subset of `HTMLInputElement`/`HTMLSelectElement`/`HTMLTextAreaElement` that {@link collectFormValues} reads. A structural type rather than the DOM interfaces themselves, so a plain object can stand in for a form control in tests.\n */\nexport type FormControlElementLike = {\n readonly name: string;\n readonly type: string;\n readonly value: string;\n readonly checked?: boolean;\n readonly disabled: boolean;\n readonly hasAttribute: (name: string) => boolean;\n readonly matches?: ((selector: string) => boolean) | undefined;\n};\n\n/**\n * Collects a submitted form's named control values into a plain object, keyed by `name`, in document order. Reads each control's live DOM state rather than `FormData`, so a checkbox resolves to its `checked` boolean instead of an on/off string. A radio group resolves to its checked option's `value`, or `undefined` if none is checked. Any other repeated `name` resolves to an array of its controls' values, in document order. Controls without a `name`, that carry `data-aui-generated-name`, or that are effectively disabled, including through an ancestor disabled fieldset outside its first legend, are skipped entirely.\n */\nexport function collectFormValues(\n elements: ArrayLike<FormControlElementLike>,\n): Record<string, unknown> {\n const values: Record<string, unknown> = Object.create(null);\n\n for (const element of Array.from(elements)) {\n const { name, disabled } = element;\n if (\n !name ||\n disabled ||\n element.hasAttribute(GENERATED_NAME_ATTR) ||\n element.matches?.(\":disabled\")\n )\n continue;\n\n if (element.type === \"radio\") {\n if (element.checked) values[name] = element.value;\n else if (!Object.hasOwn(values, name)) values[name] = undefined;\n continue;\n }\n\n const value: string | boolean =\n element.type === \"checkbox\" ? (element.checked ?? false) : element.value;\n\n if (Object.hasOwn(values, name)) {\n const existing = values[name];\n values[name] = Array.isArray(existing)\n ? [...existing, value]\n : [existing, value];\n } else {\n values[name] = value;\n }\n }\n\n return values;\n}\n\n/**\n * Convenience wrapper around {@link collectFormValues} for a native form submit event; the cast from `HTMLFormControlsCollection` to `ArrayLike<FormControlElementLike>` lives here once instead of at every call site.\n */\nexport function collectFormValuesFromEvent(\n event: FormEvent<HTMLFormElement>,\n): Record<string, unknown> {\n return collectFormValues(\n event.currentTarget\n .elements as unknown as ArrayLike<FormControlElementLike>,\n );\n}\n"],"mappings":";;;;;AAmBA,SAAgB,kBACd,UACyB;CACzB,MAAM,SAAkC,OAAO,OAAO,IAAI;CAE1D,KAAK,MAAM,WAAW,MAAM,KAAK,QAAQ,GAAG;EAC1C,MAAM,EAAE,MAAM,aAAa;EAC3B,IACE,CAAC,QACD,YACA,QAAQ,aAAA,yBAAgC,KACxC,QAAQ,UAAU,WAAW,GAE7B;EAEF,IAAI,QAAQ,SAAS,SAAS;GAC5B,IAAI,QAAQ,SAAS,OAAO,QAAQ,QAAQ;QACvC,IAAI,CAAC,OAAO,OAAO,QAAQ,IAAI,GAAG,OAAO,QAAQ,KAAA;GACtD;EACF;EAEA,MAAM,QACJ,QAAQ,SAAS,aAAc,QAAQ,WAAW,QAAS,QAAQ;EAErE,IAAI,OAAO,OAAO,QAAQ,IAAI,GAAG;GAC/B,MAAM,WAAW,OAAO;GACxB,OAAO,QAAQ,MAAM,QAAQ,QAAQ,IACjC,CAAC,GAAG,UAAU,KAAK,IACnB,CAAC,UAAU,KAAK;EACtB,OACE,OAAO,QAAQ;CAEnB;CAEA,OAAO;AACT;;;;AAKA,SAAgB,2BACd,OACyB;CACzB,OAAO,kBACL,MAAM,cACH,QACL;AACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/vocabulary/data.d.ts
|
|
3
|
-
declare const dataVocabulary: {
|
|
3
|
+
export declare const dataVocabulary: {
|
|
4
4
|
Table: {
|
|
5
5
|
description: string;
|
|
6
6
|
properties: z.ZodObject<{
|
|
@@ -48,5 +48,4 @@ declare const dataVocabulary: {
|
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
50
|
//#endregion
|
|
51
|
-
export { dataVocabulary };
|
|
52
51
|
//# sourceMappingURL=data.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data.d.ts","names":[],"sources":["../../src/vocabulary/data.tsx"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"data.d.ts","names":[],"sources":["../../src/vocabulary/data.tsx"],"mappings":";;qBAmSa"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Action } from "../ir.js";
|
|
2
2
|
import { GenerativeUIDispatch } from "../types.js";
|
|
3
3
|
//#region src/vocabulary/dispatch.d.ts
|
|
4
|
-
declare const actionAttr: (a: Action | undefined) => string | undefined;
|
|
4
|
+
export declare const actionAttr: (a: Action | undefined) => string | undefined;
|
|
5
5
|
/**
|
|
6
6
|
* Fires `$action` through `$dispatch` when both are present, merging a runtime value into the payload under the reserved `$input` key (not `value`) so the user's input never clobbers a model-supplied `value` field. No-op when no registry is wired. The returned promise from an async handler is caught and re-thrown on a microtask so rejections surface rather than going unhandled.
|
|
7
7
|
*/
|
|
8
|
-
declare const fire: ($action: Action | undefined, $dispatch: GenerativeUIDispatch | undefined, input?: unknown) => void;
|
|
8
|
+
export declare const fire: ($action: Action | undefined, $dispatch: GenerativeUIDispatch | undefined, input?: unknown) => void;
|
|
9
9
|
//#endregion
|
|
10
|
-
export { actionAttr, fire };
|
|
11
10
|
//# sourceMappingURL=dispatch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatch.d.ts","names":[],"sources":["../../src/vocabulary/dispatch.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"dispatch.d.ts","names":[],"sources":["../../src/vocabulary/dispatch.ts"],"mappings":";;;qBAGa,aAAc,GAAG;;;;qBAMjB,OACX,SAAS,oBACT,WAAW,kCACX"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/vocabulary/fact.d.ts
|
|
3
|
-
declare const factVocabulary: {
|
|
3
|
+
export declare const factVocabulary: {
|
|
4
4
|
Fact: {
|
|
5
5
|
description: string;
|
|
6
6
|
properties: z.ZodObject<{
|
|
@@ -11,5 +11,4 @@ declare const factVocabulary: {
|
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
//#endregion
|
|
14
|
-
export { factVocabulary };
|
|
15
14
|
//# sourceMappingURL=fact.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fact.d.ts","names":[],"sources":["../../src/vocabulary/fact.tsx"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"fact.d.ts","names":[],"sources":["../../src/vocabulary/fact.tsx"],"mappings":";;qBAIa"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/vocabulary/form.d.ts
|
|
3
|
-
declare const formVocabulary: {
|
|
3
|
+
export declare const formVocabulary: {
|
|
4
4
|
Form: {
|
|
5
5
|
description: string;
|
|
6
6
|
properties: z.ZodObject<{
|
|
@@ -10,5 +10,4 @@ declare const formVocabulary: {
|
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
12
|
//#endregion
|
|
13
|
-
export { formVocabulary };
|
|
14
13
|
//# sourceMappingURL=form.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.d.ts","names":[],"sources":["../../src/vocabulary/form.tsx"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"form.d.ts","names":[],"sources":["../../src/vocabulary/form.tsx"],"mappings":";;qBAKa"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/vocabulary/icon.d.ts
|
|
3
|
-
declare const iconVocabulary: {
|
|
3
|
+
export declare const iconVocabulary: {
|
|
4
4
|
Icon: {
|
|
5
5
|
description: string;
|
|
6
6
|
properties: z.ZodObject<{
|
|
@@ -40,5 +40,4 @@ declare const iconVocabulary: {
|
|
|
40
40
|
};
|
|
41
41
|
};
|
|
42
42
|
//#endregion
|
|
43
|
-
export { iconVocabulary };
|
|
44
43
|
//# sourceMappingURL=icon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.d.ts","names":[],"sources":["../../src/vocabulary/icon.tsx"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"icon.d.ts","names":[],"sources":["../../src/vocabulary/icon.tsx"],"mappings":";;qBAyIa"}
|
|
@@ -9,7 +9,6 @@ import { GenerativeUILibrary } from "../types.js";
|
|
|
9
9
|
* `new JSONGenerativeUI({ library: defaultGenerativeUILibrary })`, and override
|
|
10
10
|
* or extend entries with their own `defineGenerativeComponents`.
|
|
11
11
|
*/
|
|
12
|
-
declare const defaultGenerativeUILibrary: GenerativeUILibrary;
|
|
12
|
+
export declare const defaultGenerativeUILibrary: GenerativeUILibrary;
|
|
13
13
|
//#endregion
|
|
14
|
-
export { defaultGenerativeUILibrary };
|
|
15
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/vocabulary/index.ts"],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/vocabulary/index.ts"],"mappings":";;;;;;;;;;;qBAqBa,4BAA4B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Action } from "../ir.js";
|
|
2
|
-
import { GenerativeUIDispatch } from "../types.js";
|
|
2
|
+
import { GenerativeUIDispatch, GenerativeUIStatus } from "../types.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/vocabulary/interactive.d.ts
|
|
5
5
|
type Option = {
|
|
@@ -11,19 +11,20 @@ type RadioGroupRenderProps = {
|
|
|
11
11
|
name?: string;
|
|
12
12
|
label?: string;
|
|
13
13
|
defaultValue?: string;
|
|
14
|
+
$status: GenerativeUIStatus;
|
|
14
15
|
$action?: Action;
|
|
15
16
|
$dispatch?: GenerativeUIDispatch;
|
|
16
17
|
};
|
|
17
18
|
declare function RadioGroupRender({ options, name, label, defaultValue, $action, $dispatch }: RadioGroupRenderProps): import("react").JSX.Element;
|
|
18
|
-
declare const interactiveVocabulary: {
|
|
19
|
+
export declare const interactiveVocabulary: {
|
|
19
20
|
Button: {
|
|
20
21
|
description: string;
|
|
21
22
|
properties: z.ZodObject<{
|
|
22
23
|
label: z.ZodString;
|
|
23
24
|
buttonStyle: z.ZodOptional<z.ZodEnum<{
|
|
24
25
|
danger: "danger";
|
|
25
|
-
secondary: "secondary";
|
|
26
26
|
primary: "primary";
|
|
27
|
+
secondary: "secondary";
|
|
27
28
|
outline: "outline";
|
|
28
29
|
ghost: "ghost";
|
|
29
30
|
}>>;
|
|
@@ -90,5 +91,4 @@ declare const interactiveVocabulary: {
|
|
|
90
91
|
};
|
|
91
92
|
};
|
|
92
93
|
//#endregion
|
|
93
|
-
export { interactiveVocabulary };
|
|
94
94
|
//# sourceMappingURL=interactive.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive.d.ts","names":[],"sources":["../../src/vocabulary/interactive.tsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"interactive.d.ts","names":[],"sources":["../../src/vocabulary/interactive.tsx"],"mappings":";;;;KAkBK;EAAW;EAAe;;KAU1B;EACH,SAAS;EACT;EACA;EACA;EACA,SAAS;EACT,UAAU;EACV,YAAY;;iBAGL,mBACP,SACA,MACA,OACA,cACA,SACA,aACC,wCAAqB,IAAA;qBA6BX"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { GENERATED_NAME_ATTR } from "../constants.js";
|
|
1
2
|
import { BUTTON_STYLES } from "../ir.js";
|
|
2
3
|
import { toTextContent } from "./toTextContent.js";
|
|
3
4
|
import { actionAttr, fire } from "./dispatch.js";
|
|
@@ -23,6 +24,7 @@ function RadioGroupRender({ options, name, label, defaultValue, $action, $dispat
|
|
|
23
24
|
children: [/* @__PURE__ */ jsx("input", {
|
|
24
25
|
type: "radio",
|
|
25
26
|
name: fieldName,
|
|
27
|
+
...name == null ? { [GENERATED_NAME_ATTR]: "" } : {},
|
|
26
28
|
value: option.value,
|
|
27
29
|
defaultChecked: defaultValue === option.value,
|
|
28
30
|
onChange: () => fire($action, $dispatch, option.value)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive.js","names":[],"sources":["../../src/vocabulary/interactive.tsx"],"sourcesContent":["import { useId } from \"react\";\nimport { z } from \"zod\";\nimport type { Action } from \"../ir\";\nimport { BUTTON_STYLES } from \"../ir\";\nimport type { GenerativeUIDispatch, GenerativeUILibrary } from \"../types\";\nimport { actionAttr, fire } from \"./dispatch\";\nimport { toTextContent } from \"./toTextContent\";\n\nconst optionSchema = z.object({\n label: z.string(),\n value: z.string(),\n});\n\ntype Option = { label: string; value: string };\n\nconst isOption = (option: unknown): option is Option =>\n option !== null &&\n typeof option === \"object\" &&\n \"label\" in option &&\n typeof option.label === \"string\" &&\n \"value\" in option &&\n typeof option.value === \"string\";\n\ntype RadioGroupRenderProps = {\n options: Option[];\n name?: string;\n label?: string;\n defaultValue?: string;\n $action?: Action;\n $dispatch?: GenerativeUIDispatch;\n};\n\nfunction RadioGroupRender({\n options,\n name,\n label,\n defaultValue,\n $action,\n $dispatch,\n}: RadioGroupRenderProps) {\n const generatedName = useId();\n const fieldName = name ?? generatedName;\n const safeOptions = Array.isArray(options) ? options : [];\n return (\n <fieldset\n data-aui=\"radiogroup\"\n data-aui-action={actionAttr($action)}\n aria-label={label}\n >\n {safeOptions.map((option, i) =>\n isOption(option) ? (\n <label key={i} data-aui=\"radiogroup-option\">\n <input\n type=\"radio\"\n name={fieldName}\n value={option.value}\n defaultChecked={defaultValue === option.value}\n onChange={() => fire($action, $dispatch, option.value)}\n />\n {option.label}\n </label>\n ) : null,\n )}\n </fieldset>\n );\n}\n\nexport const interactiveVocabulary = {\n Button: {\n description:\n \"A clickable button. Carries `$action` describing the side effect or resume value. Set `submit` to submit an ancestor Form/Card instead of firing `$action` on click.\",\n properties: z.object({\n label: z.string().describe(\"Button label.\"),\n buttonStyle: z.enum(BUTTON_STYLES).optional().describe(\"Visual style.\"),\n block: z\n .boolean()\n .optional()\n .describe(\"Whether the button spans the full width.\"),\n submit: z\n .boolean()\n .optional()\n .describe(\n \"Render as a submit button for an ancestor Form/Card instead of a click button.\",\n ),\n }),\n render: ({\n label,\n buttonStyle,\n block,\n submit,\n $action,\n $dispatch,\n children,\n }) => (\n <button\n type={submit ? \"submit\" : \"button\"}\n data-aui=\"button\"\n data-aui-style={buttonStyle}\n data-aui-block={block || undefined}\n data-aui-submit={submit || undefined}\n data-aui-action={actionAttr($action)}\n onClick={submit ? undefined : () => fire($action, $dispatch)}\n >\n {toTextContent(label)}\n {children}\n </button>\n ),\n },\n Select: {\n description:\n \"A dropdown selector. Carries `$action` describing the on-select behavior.\",\n properties: z.object({\n options: z.array(optionSchema).describe(\"Selectable options.\"),\n placeholder: z\n .string()\n .optional()\n .describe(\"Placeholder shown when nothing is selected.\"),\n label: z\n .string()\n .optional()\n .describe(\"Accessible label for the control.\"),\n name: z.string().optional().describe(\"Field name used inside a Form.\"),\n }),\n render: ({\n options,\n placeholder,\n label,\n name,\n $action,\n $dispatch,\n children,\n }) => {\n const placeholderText = toTextContent(placeholder);\n return (\n <select\n data-aui=\"select\"\n data-aui-action={actionAttr($action)}\n name={name}\n aria-label={label}\n defaultValue=\"\"\n onChange={(e) => fire($action, $dispatch, e.currentTarget.value)}\n >\n {placeholderText ? (\n <option value=\"\" disabled>\n {placeholderText}\n </option>\n ) : null}\n {(Array.isArray(options) ? options : []).map((option, i) =>\n isOption(option) ? (\n <option key={i} value={option.value}>\n {option.label}\n </option>\n ) : null,\n )}\n {children}\n </select>\n );\n },\n },\n Input: {\n description:\n \"A text input. Carries `$action` describing the on-submit behavior.\",\n properties: z.object({\n placeholder: z.string().optional().describe(\"Placeholder text.\"),\n multiline: z\n .boolean()\n .optional()\n .describe(\"Render a textarea instead of a single-line input.\"),\n label: z\n .string()\n .optional()\n .describe(\"Accessible label for the control.\"),\n name: z.string().optional().describe(\"Field name used inside a Form.\"),\n }),\n render: ({ placeholder, multiline, label, name, $action, $dispatch }) => {\n const submit = (v: string) => fire($action, $dispatch, v);\n return multiline ? (\n <textarea\n data-aui=\"input\"\n data-aui-multiline\n data-aui-action={actionAttr($action)}\n name={name}\n aria-label={label}\n placeholder={placeholder}\n onKeyDown={(e) => {\n if (\n e.key !== \"Enter\" ||\n !(e.ctrlKey || e.metaKey) ||\n e.nativeEvent.isComposing\n )\n return;\n if (e.currentTarget.form) {\n e.preventDefault();\n HTMLFormElement.prototype.requestSubmit.call(\n e.currentTarget.form,\n );\n } else {\n submit(e.currentTarget.value);\n }\n }}\n />\n ) : (\n <input\n data-aui=\"input\"\n data-aui-action={actionAttr($action)}\n name={name}\n aria-label={label}\n placeholder={placeholder}\n onKeyDown={(e) => {\n if (\n e.key === \"Enter\" &&\n !e.nativeEvent.isComposing &&\n !e.currentTarget.form\n )\n submit(e.currentTarget.value);\n }}\n />\n );\n },\n },\n DatePicker: {\n description:\n \"A date input. Carries `$action` describing the on-select behavior.\",\n properties: z.object({\n value: z.string().optional().describe(\"Initial date (YYYY-MM-DD).\"),\n min: z.string().optional().describe(\"Minimum date (YYYY-MM-DD).\"),\n max: z.string().optional().describe(\"Maximum date (YYYY-MM-DD).\"),\n label: z\n .string()\n .optional()\n .describe(\"Accessible label for the control.\"),\n name: z.string().optional().describe(\"Field name used inside a Form.\"),\n }),\n render: ({ value, min, max, label, name, $action, $dispatch }) => (\n <input\n type=\"date\"\n data-aui=\"datepicker\"\n data-aui-action={actionAttr($action)}\n name={name}\n aria-label={label}\n defaultValue={value}\n min={min}\n max={max}\n onChange={(e) => fire($action, $dispatch, e.currentTarget.value)}\n />\n ),\n },\n Checkbox: {\n description:\n \"A checkbox with a label. Carries `$action` describing the on-change behavior.\",\n properties: z.object({\n label: z.string().describe(\"Label text next to the checkbox.\"),\n name: z.string().optional().describe(\"Field name used inside a Form.\"),\n defaultChecked: z\n .boolean()\n .optional()\n .describe(\"Whether the checkbox starts checked.\"),\n }),\n render: ({ label, name, defaultChecked, $action, $dispatch }) => (\n <label data-aui=\"checkbox\">\n <input\n type=\"checkbox\"\n data-aui-action={actionAttr($action)}\n name={name}\n defaultChecked={defaultChecked}\n onChange={(e) => fire($action, $dispatch, e.currentTarget.checked)}\n />\n <span data-aui=\"checkbox-label\">{toTextContent(label)}</span>\n </label>\n ),\n },\n RadioGroup: {\n description:\n \"A group of mutually exclusive radio options. Carries `$action` describing the on-change behavior.\",\n properties: z.object({\n options: z.array(optionSchema).describe(\"Selectable options.\"),\n name: z.string().optional().describe(\"Field name used inside a Form.\"),\n label: z.string().optional().describe(\"Accessible name for the group.\"),\n defaultValue: z.string().optional().describe(\"Initially selected value.\"),\n }),\n render: RadioGroupRender,\n },\n} satisfies GenerativeUILibrary;\n"],"mappings":";;;;;;;AAQA,MAAM,eAAe,EAAE,OAAO;CAC5B,OAAO,EAAE,OAAO;CAChB,OAAO,EAAE,OAAO;AAClB,CAAC;AAID,MAAM,YAAY,WAChB,WAAW,QACX,OAAO,WAAW,YAClB,WAAW,UACX,OAAO,OAAO,UAAU,YACxB,WAAW,UACX,OAAO,OAAO,UAAU;AAW1B,SAAS,iBAAiB,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AO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,gCAAgC;GACrE,gBAAgB,EACb,QAAQ,CAAC,CACT,SAAS,CAAC,CACV,SAAS,sCAAsC;EACpD,CAAC;EACD,SAAS,EAAE,OAAO,MAAM,gBAAgB,SAAS,gBAC/C,qBAAC,SAAD;GAAO,YAAS;GAAhB,UAAA,CACE,oBAAC,SAAD;IACE,MAAK;IACL,mBAAiB,WAAW,OAAO;IAC7B;IACU;IAChB,WAAW,MAAM,KAAK,SAAS,WAAW,EAAE,cAAc,OAAO;GAClE,CAAA,GACD,oBAAC,QAAD;IAAM,YAAS;IAAkB,UAAA,cAAc,KAAK;GAAQ,CAAA,CACvD;;CAEX;CACA,YAAY;EACV,aACE;EACF,YAAY,EAAE,OAAO;GACnB,SAAS,EAAE,MAAM,YAAY,CAAC,CAAC,SAAS,qBAAqB;GAC7D,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,gCAAgC;GACrE,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,gCAAgC;GACtE,cAAc,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,2BAA2B;EAC1E,CAAC;EACD,QAAQ;CACV;AACF"}
|
|
1
|
+
{"version":3,"file":"interactive.js","names":[],"sources":["../../src/vocabulary/interactive.tsx"],"sourcesContent":["import { useId } from \"react\";\nimport { z } from \"zod\";\nimport { GENERATED_NAME_ATTR } from \"../constants\";\nimport type { Action } from \"../ir\";\nimport { BUTTON_STYLES } from \"../ir\";\nimport type {\n GenerativeUIDispatch,\n GenerativeUILibrary,\n GenerativeUIStatus,\n} from \"../types\";\nimport { actionAttr, fire } from \"./dispatch\";\nimport { toTextContent } from \"./toTextContent\";\n\nconst optionSchema = z.object({\n label: z.string(),\n value: z.string(),\n});\n\ntype Option = { label: string; value: string };\n\nconst isOption = (option: unknown): option is Option =>\n option !== null &&\n typeof option === \"object\" &&\n \"label\" in option &&\n typeof option.label === \"string\" &&\n \"value\" in option &&\n typeof option.value === \"string\";\n\ntype RadioGroupRenderProps = {\n options: Option[];\n name?: string;\n label?: string;\n defaultValue?: string;\n $status: GenerativeUIStatus;\n $action?: Action;\n $dispatch?: GenerativeUIDispatch;\n};\n\nfunction RadioGroupRender({\n options,\n name,\n label,\n defaultValue,\n $action,\n $dispatch,\n}: RadioGroupRenderProps) {\n const generatedName = useId();\n const fieldName = name ?? generatedName;\n const safeOptions = Array.isArray(options) ? options : [];\n return (\n <fieldset\n data-aui=\"radiogroup\"\n data-aui-action={actionAttr($action)}\n aria-label={label}\n >\n {safeOptions.map((option, i) =>\n isOption(option) ? (\n <label key={i} data-aui=\"radiogroup-option\">\n <input\n type=\"radio\"\n name={fieldName}\n {...(name == null ? { [GENERATED_NAME_ATTR]: \"\" } : {})}\n value={option.value}\n defaultChecked={defaultValue === option.value}\n onChange={() => fire($action, $dispatch, option.value)}\n />\n {option.label}\n </label>\n ) : null,\n )}\n </fieldset>\n );\n}\n\nexport const interactiveVocabulary = {\n Button: {\n description:\n \"A clickable button. Carries `$action` describing the side effect or resume value. Set `submit` to submit an ancestor Form/Card instead of firing `$action` on click.\",\n properties: z.object({\n label: z.string().describe(\"Button label.\"),\n buttonStyle: z.enum(BUTTON_STYLES).optional().describe(\"Visual style.\"),\n block: z\n .boolean()\n .optional()\n .describe(\"Whether the button spans the full width.\"),\n submit: z\n .boolean()\n .optional()\n .describe(\n \"Render as a submit button for an ancestor Form/Card instead of a click button.\",\n ),\n }),\n render: ({\n label,\n buttonStyle,\n block,\n submit,\n $action,\n $dispatch,\n children,\n }) => (\n <button\n type={submit ? \"submit\" : \"button\"}\n data-aui=\"button\"\n data-aui-style={buttonStyle}\n data-aui-block={block || undefined}\n data-aui-submit={submit || undefined}\n data-aui-action={actionAttr($action)}\n onClick={submit ? undefined : () => fire($action, $dispatch)}\n >\n {toTextContent(label)}\n {children}\n </button>\n ),\n },\n Select: {\n description:\n \"A dropdown selector. Carries `$action` describing the on-select behavior.\",\n properties: z.object({\n options: z.array(optionSchema).describe(\"Selectable options.\"),\n placeholder: z\n .string()\n .optional()\n .describe(\"Placeholder shown when nothing is selected.\"),\n label: z\n .string()\n .optional()\n .describe(\"Accessible label for the control.\"),\n name: z.string().optional().describe(\"Field name used inside a Form.\"),\n }),\n render: ({\n options,\n placeholder,\n label,\n name,\n $action,\n $dispatch,\n children,\n }) => {\n const placeholderText = toTextContent(placeholder);\n return (\n <select\n data-aui=\"select\"\n data-aui-action={actionAttr($action)}\n name={name}\n aria-label={label}\n defaultValue=\"\"\n onChange={(e) => fire($action, $dispatch, e.currentTarget.value)}\n >\n {placeholderText ? (\n <option value=\"\" disabled>\n {placeholderText}\n </option>\n ) : null}\n {(Array.isArray(options) ? options : []).map((option, i) =>\n isOption(option) ? (\n <option key={i} value={option.value}>\n {option.label}\n </option>\n ) : null,\n )}\n {children}\n </select>\n );\n },\n },\n Input: {\n description:\n \"A text input. Carries `$action` describing the on-submit behavior.\",\n properties: z.object({\n placeholder: z.string().optional().describe(\"Placeholder text.\"),\n multiline: z\n .boolean()\n .optional()\n .describe(\"Render a textarea instead of a single-line input.\"),\n label: z\n .string()\n .optional()\n .describe(\"Accessible label for the control.\"),\n name: z.string().optional().describe(\"Field name used inside a Form.\"),\n }),\n render: ({ placeholder, multiline, label, name, $action, $dispatch }) => {\n const submit = (v: string) => fire($action, $dispatch, v);\n return multiline ? (\n <textarea\n data-aui=\"input\"\n data-aui-multiline\n data-aui-action={actionAttr($action)}\n name={name}\n aria-label={label}\n placeholder={placeholder}\n onKeyDown={(e) => {\n if (\n e.key !== \"Enter\" ||\n !(e.ctrlKey || e.metaKey) ||\n e.nativeEvent.isComposing\n )\n return;\n if (e.currentTarget.form) {\n e.preventDefault();\n HTMLFormElement.prototype.requestSubmit.call(\n e.currentTarget.form,\n );\n } else {\n submit(e.currentTarget.value);\n }\n }}\n />\n ) : (\n <input\n data-aui=\"input\"\n data-aui-action={actionAttr($action)}\n name={name}\n aria-label={label}\n placeholder={placeholder}\n onKeyDown={(e) => {\n if (\n e.key === \"Enter\" &&\n !e.nativeEvent.isComposing &&\n !e.currentTarget.form\n )\n submit(e.currentTarget.value);\n }}\n />\n );\n },\n },\n DatePicker: {\n description:\n \"A date input. Carries `$action` describing the on-select behavior.\",\n properties: z.object({\n value: z.string().optional().describe(\"Initial date (YYYY-MM-DD).\"),\n min: z.string().optional().describe(\"Minimum date (YYYY-MM-DD).\"),\n max: z.string().optional().describe(\"Maximum date (YYYY-MM-DD).\"),\n label: z\n .string()\n .optional()\n .describe(\"Accessible label for the control.\"),\n name: z.string().optional().describe(\"Field name used inside a Form.\"),\n }),\n render: ({ value, min, max, label, name, $action, $dispatch }) => (\n <input\n type=\"date\"\n data-aui=\"datepicker\"\n data-aui-action={actionAttr($action)}\n name={name}\n aria-label={label}\n defaultValue={value}\n min={min}\n max={max}\n onChange={(e) => fire($action, $dispatch, e.currentTarget.value)}\n />\n ),\n },\n Checkbox: {\n description:\n \"A checkbox with a label. Carries `$action` describing the on-change behavior.\",\n properties: z.object({\n label: z.string().describe(\"Label text next to the checkbox.\"),\n name: z.string().optional().describe(\"Field name used inside a Form.\"),\n defaultChecked: z\n .boolean()\n .optional()\n .describe(\"Whether the checkbox starts checked.\"),\n }),\n render: ({ label, name, defaultChecked, $action, $dispatch }) => (\n <label data-aui=\"checkbox\">\n <input\n type=\"checkbox\"\n data-aui-action={actionAttr($action)}\n name={name}\n defaultChecked={defaultChecked}\n onChange={(e) => fire($action, $dispatch, e.currentTarget.checked)}\n />\n <span data-aui=\"checkbox-label\">{toTextContent(label)}</span>\n </label>\n ),\n },\n RadioGroup: {\n description:\n \"A group of mutually exclusive radio options. Carries `$action` describing the on-change behavior.\",\n properties: z.object({\n options: z.array(optionSchema).describe(\"Selectable options.\"),\n name: z.string().optional().describe(\"Field name used inside a Form.\"),\n label: z.string().optional().describe(\"Accessible name for the group.\"),\n defaultValue: z.string().optional().describe(\"Initially selected value.\"),\n }),\n render: RadioGroupRender,\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|
+
export declare const layoutVocabulary: {
|
|
4
4
|
Card: {
|
|
5
5
|
description: string;
|
|
6
6
|
properties: z.ZodObject<{
|
|
@@ -78,5 +78,4 @@ declare const layoutVocabulary: {
|
|
|
78
78
|
};
|
|
79
79
|
};
|
|
80
80
|
//#endregion
|
|
81
|
-
export { layoutVocabulary };
|
|
82
81
|
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","names":[],"sources":["../../src/vocabulary/layout.tsx"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"layout.d.ts","names":[],"sources":["../../src/vocabulary/layout.tsx"],"mappings":";;qBAwBa"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/vocabulary/list.d.ts
|
|
3
|
-
declare const listVocabulary: {
|
|
3
|
+
export declare const listVocabulary: {
|
|
4
4
|
ListView: {
|
|
5
5
|
description: string;
|
|
6
6
|
properties: z.ZodObject<{}, z.core.$strip>;
|
|
@@ -13,5 +13,4 @@ declare const listVocabulary: {
|
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
15
|
//#endregion
|
|
16
|
-
export { listVocabulary };
|
|
17
16
|
//# sourceMappingURL=list.d.ts.map
|