@assistant-ui/react-generative-ui 0.0.21 → 0.0.22
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/LICENSE +1 -1
- package/dist/JSONGenerativeUI.client.d.ts.map +1 -1
- package/dist/JSONGenerativeUI.client.js +30 -13
- package/dist/JSONGenerativeUI.client.js.map +1 -1
- package/dist/RadioGroupScope.d.ts +6 -0
- package/dist/RadioGroupScope.d.ts.map +1 -0
- package/dist/RadioGroupScope.js +25 -0
- package/dist/RadioGroupScope.js.map +1 -0
- package/dist/a2ui/BindingContext.d.ts +11 -0
- package/dist/a2ui/BindingContext.d.ts.map +1 -0
- package/dist/a2ui/BindingContext.js +12 -0
- package/dist/a2ui/BindingContext.js.map +1 -0
- package/dist/a2ui/PresentRenderer.d.ts +11 -0
- package/dist/a2ui/PresentRenderer.d.ts.map +1 -0
- package/dist/a2ui/PresentRenderer.js +39 -0
- package/dist/a2ui/PresentRenderer.js.map +1 -0
- package/dist/a2ui/convert.d.ts +6 -0
- package/dist/a2ui/convert.d.ts.map +1 -1
- package/dist/a2ui/convert.js +344 -83
- package/dist/a2ui/convert.js.map +1 -1
- package/dist/a2ui/dataModel.d.ts +9 -0
- package/dist/a2ui/dataModel.d.ts.map +1 -0
- package/dist/a2ui/dataModel.js +44 -0
- package/dist/a2ui/dataModel.js.map +1 -0
- package/dist/a2ui/reducer.d.ts +5 -0
- package/dist/a2ui/reducer.d.ts.map +1 -1
- package/dist/a2ui/reducer.js +3 -3
- package/dist/a2ui/reducer.js.map +1 -1
- package/dist/a2ui/types.d.ts +8 -2
- package/dist/a2ui/types.d.ts.map +1 -1
- package/dist/a2ui/types.js.map +1 -1
- package/dist/a2ui/valueFunctions.d.ts +16 -0
- package/dist/a2ui/valueFunctions.d.ts.map +1 -0
- package/dist/a2ui/valueFunctions.js +332 -0
- package/dist/a2ui/valueFunctions.js.map +1 -0
- package/dist/actionRegistry.d.ts +1 -1
- package/dist/actionRegistry.js.map +1 -1
- package/dist/answeredValues.d.ts +16 -0
- package/dist/answeredValues.d.ts.map +1 -0
- package/dist/answeredValues.js +37 -0
- package/dist/answeredValues.js.map +1 -0
- package/dist/constants.d.ts +2 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +3 -1
- package/dist/constants.js.map +1 -1
- package/dist/fieldReferences.d.ts +9 -0
- package/dist/fieldReferences.d.ts.map +1 -0
- package/dist/fieldReferences.js +53 -0
- package/dist/fieldReferences.js.map +1 -0
- package/dist/generativeUIToJSX.js +3 -3
- package/dist/generativeUIToJSX.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.server.js +2 -2
- package/dist/index.shared.js +2 -2
- package/dist/ir.d.ts +1 -1
- package/dist/ir.js.map +1 -1
- package/dist/renderGenerativeUI.d.ts.map +1 -1
- package/dist/renderGenerativeUI.js +12 -1
- package/dist/renderGenerativeUI.js.map +1 -1
- package/dist/slack/constants.d.ts +2 -0
- package/dist/slack/constants.d.ts.map +1 -1
- package/dist/slack/constants.js +3 -1
- package/dist/slack/constants.js.map +1 -1
- package/dist/slack/decodeBlockAction.d.ts +3 -1
- package/dist/slack/decodeBlockAction.d.ts.map +1 -1
- package/dist/slack/decodeBlockAction.js +58 -7
- package/dist/slack/decodeBlockAction.js.map +1 -1
- package/dist/slack/fromSlackBlocks.d.ts.map +1 -1
- package/dist/slack/fromSlackBlocks.js +20 -3
- package/dist/slack/fromSlackBlocks.js.map +1 -1
- package/dist/slack/toSlackBlocks.d.ts.map +1 -1
- package/dist/slack/toSlackBlocks.js +187 -19
- package/dist/slack/toSlackBlocks.js.map +1 -1
- package/dist/slack/types.d.ts +4 -0
- package/dist/slack/types.d.ts.map +1 -1
- package/dist/teams/constants.d.ts +1 -1
- package/dist/teams/constants.d.ts.map +1 -1
- package/dist/teams/constants.js +1 -1
- package/dist/teams/constants.js.map +1 -1
- package/dist/teams/decodeSubmitData.d.ts +4 -0
- package/dist/teams/decodeSubmitData.d.ts.map +1 -1
- package/dist/teams/decodeSubmitData.js +6 -1
- package/dist/teams/decodeSubmitData.js.map +1 -1
- package/dist/teams/toAdaptiveCard.d.ts +5 -4
- package/dist/teams/toAdaptiveCard.d.ts.map +1 -1
- package/dist/teams/toAdaptiveCard.js +56 -17
- package/dist/teams/toAdaptiveCard.js.map +1 -1
- package/dist/teams/types.d.ts +4 -1
- package/dist/teams/types.d.ts.map +1 -1
- package/dist/vocabulary/alert.d.ts +9 -2
- package/dist/vocabulary/alert.d.ts.map +1 -1
- package/dist/vocabulary/alert.js +116 -19
- package/dist/vocabulary/alert.js.map +1 -1
- package/dist/vocabulary/collectFormValues.d.ts +2 -1
- package/dist/vocabulary/collectFormValues.d.ts.map +1 -1
- package/dist/vocabulary/collectFormValues.js +10 -3
- package/dist/vocabulary/collectFormValues.js.map +1 -1
- package/dist/vocabulary/data.d.ts +22 -5
- package/dist/vocabulary/data.d.ts.map +1 -1
- package/dist/vocabulary/data.js +278 -83
- package/dist/vocabulary/data.js.map +1 -1
- package/dist/vocabulary/dispatch.d.ts +3 -2
- package/dist/vocabulary/dispatch.d.ts.map +1 -1
- package/dist/vocabulary/dispatch.js +33 -4
- package/dist/vocabulary/dispatch.js.map +1 -1
- package/dist/vocabulary/fact.d.ts +8 -1
- package/dist/vocabulary/fact.d.ts.map +1 -1
- package/dist/vocabulary/fact.js +37 -11
- package/dist/vocabulary/fact.js.map +1 -1
- package/dist/vocabulary/form.d.ts.map +1 -1
- package/dist/vocabulary/form.js +3 -3
- package/dist/vocabulary/form.js.map +1 -1
- package/dist/vocabulary/formatValue.d.ts +7 -0
- package/dist/vocabulary/formatValue.d.ts.map +1 -0
- package/dist/vocabulary/formatValue.js +76 -0
- package/dist/vocabulary/formatValue.js.map +1 -0
- package/dist/vocabulary/icon.d.ts +1 -1
- package/dist/vocabulary/interactive.d.ts +137 -8
- package/dist/vocabulary/interactive.d.ts.map +1 -1
- package/dist/vocabulary/interactive.js +404 -103
- package/dist/vocabulary/interactive.js.map +1 -1
- package/dist/vocabulary/layout.d.ts.map +1 -1
- package/dist/vocabulary/layout.js +4 -4
- package/dist/vocabulary/layout.js.map +1 -1
- package/dist/vocabulary/list.js +2 -2
- package/dist/vocabulary/list.js.map +1 -1
- package/dist/vocabulary/text.d.ts +1 -1
- package/package.json +6 -3
- package/src/JSONGenerativeUI.client.tsx +84 -40
- package/src/JSONGenerativeUI.test.tsx +964 -68
- package/src/RadioGroupScope.server.test.tsx +24 -0
- package/src/RadioGroupScope.tsx +34 -0
- package/src/a2ui/BindingContext.ts +26 -0
- package/src/a2ui/PresentRenderer.tsx +83 -0
- package/src/a2ui/convert.test.ts +1795 -179
- package/src/a2ui/convert.ts +629 -132
- package/src/a2ui/dataModel.ts +69 -0
- package/src/a2ui/reducer.test.ts +35 -0
- package/src/a2ui/reducer.ts +5 -4
- package/src/a2ui/types.ts +9 -2
- package/src/a2ui/valueFunctions.test.ts +271 -0
- package/src/a2ui/valueFunctions.ts +523 -0
- package/src/actionRegistry.ts +1 -1
- package/src/answeredValues.test.ts +33 -0
- package/src/answeredValues.tsx +70 -0
- package/src/constants.ts +4 -0
- package/src/fieldReferences.test.ts +66 -0
- package/src/fieldReferences.ts +83 -0
- package/src/generativeUIToJSX.test.ts +18 -0
- package/src/generativeUIToJSX.ts +4 -6
- package/src/index.server.test.ts +106 -0
- package/src/ir.ts +1 -1
- package/src/renderGenerativeUI.test.tsx +14 -5
- package/src/renderGenerativeUI.tsx +30 -1
- package/src/slack/a2uiSlack.test.ts +198 -0
- package/src/slack/constants.ts +3 -0
- package/src/slack/decodeBlockAction.test.ts +98 -0
- package/src/slack/decodeBlockAction.ts +110 -17
- package/src/slack/fromSlackBlocks.test.ts +222 -3
- package/src/slack/fromSlackBlocks.ts +53 -2
- package/src/slack/toSlackBlocks.test.ts +682 -3
- package/src/slack/toSlackBlocks.ts +374 -23
- package/src/slack/types.ts +4 -0
- package/src/teams/constants.ts +1 -1
- package/src/teams/decodeSubmitData.test.ts +33 -0
- package/src/teams/decodeSubmitData.ts +9 -1
- package/src/teams/toAdaptiveCard.test.ts +219 -0
- package/src/teams/toAdaptiveCard.ts +93 -19
- package/src/teams/types.ts +4 -1
- package/src/vocabulary/alert.test.tsx +288 -7
- package/src/vocabulary/alert.tsx +168 -26
- package/src/vocabulary/collectFormValues.test.ts +28 -1
- package/src/vocabulary/collectFormValues.ts +25 -5
- package/src/vocabulary/data.test.tsx +248 -6
- package/src/vocabulary/data.tsx +398 -100
- package/src/vocabulary/dispatch.ts +63 -2
- package/src/vocabulary/fact.test.tsx +67 -0
- package/src/vocabulary/fact.tsx +40 -9
- package/src/vocabulary/form.tsx +7 -2
- package/src/vocabulary/formatValue.test.ts +72 -0
- package/src/vocabulary/formatValue.ts +127 -0
- package/src/vocabulary/index.test.ts +2 -0
- package/src/vocabulary/interactive.dispatch.test.tsx +167 -79
- package/src/vocabulary/interactive.dom.test.tsx +1699 -0
- package/src/vocabulary/interactive.test.tsx +60 -4
- package/src/vocabulary/interactive.tsx +770 -151
- package/src/vocabulary/layout.test.tsx +6 -4
- package/src/vocabulary/layout.tsx +13 -2
- package/src/vocabulary/list.tsx +2 -2
|
@@ -3,10 +3,12 @@ import { copyBounded } from "../convert/copyBounded.js";
|
|
|
3
3
|
import { boundSpec, clampReasonDetail } from "../convert/boundSpec.js";
|
|
4
4
|
import { isElement } from "../convert/isElement.js";
|
|
5
5
|
import { takeRun } from "../convert/takeRun.js";
|
|
6
|
+
import { factTrend, formatFactDelta, formatValue } from "../vocabulary/formatValue.js";
|
|
6
7
|
import { PAYLOAD_SOFT_CAP, buildCard, buildSubmitAction, utf8ByteLength } from "./constants.js";
|
|
7
8
|
//#region src/teams/toAdaptiveCard.ts
|
|
8
9
|
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
9
10
|
const asString = (value) => typeof value === "string" ? value : "";
|
|
11
|
+
const asFiniteNumber = (value) => typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
10
12
|
const DATE_PATTERN = /^\d{4}-\d{2}-\d{2}$/;
|
|
11
13
|
const SUBTLE_COLORS = /* @__PURE__ */ new Set([
|
|
12
14
|
"secondary",
|
|
@@ -93,8 +95,10 @@ function applyPending(element, separator, spacing) {
|
|
|
93
95
|
}
|
|
94
96
|
const toChoice = (option) => {
|
|
95
97
|
if (!isRecord(option) || typeof option["value"] !== "string") return;
|
|
98
|
+
const label = asString(option["label"]);
|
|
99
|
+
const description = asString(option["description"]);
|
|
96
100
|
return {
|
|
97
|
-
title:
|
|
101
|
+
title: description ? [label, description].filter(Boolean).join(": ") : label,
|
|
98
102
|
value: option["value"]
|
|
99
103
|
};
|
|
100
104
|
};
|
|
@@ -113,10 +117,15 @@ const choicesFrom = (optionsProp, component, context) => {
|
|
|
113
117
|
function convertFacts(facts) {
|
|
114
118
|
return {
|
|
115
119
|
type: "FactSet",
|
|
116
|
-
facts: facts.map((fact) =>
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
+
facts: facts.map((fact) => {
|
|
121
|
+
const value = asString(fact.props["value"]);
|
|
122
|
+
const delta = fact.props["delta"];
|
|
123
|
+
const deltaText = typeof delta === "string" ? formatFactDelta(delta, factTrend(delta, fact.props["trend"])) : void 0;
|
|
124
|
+
return {
|
|
125
|
+
title: asString(fact.props["label"]),
|
|
126
|
+
value: deltaText === void 0 ? value : `${value} (${deltaText})`
|
|
127
|
+
};
|
|
128
|
+
})
|
|
120
129
|
};
|
|
121
130
|
}
|
|
122
131
|
function convertButtons(buttons, context) {
|
|
@@ -147,11 +156,6 @@ const ALERT_STYLE_MAP = {
|
|
|
147
156
|
warning: "warning",
|
|
148
157
|
danger: "attention"
|
|
149
158
|
};
|
|
150
|
-
const stringifyCell = (value) => {
|
|
151
|
-
if (typeof value === "string") return value;
|
|
152
|
-
if (typeof value === "number" || typeof value === "boolean") return String(value);
|
|
153
|
-
return "";
|
|
154
|
-
};
|
|
155
159
|
function convertTable(props, context) {
|
|
156
160
|
const { items: rawColumns, truncated: columnsTruncated } = clampArray(props["columns"], 20);
|
|
157
161
|
const { items: rawRows, truncated: rowsTruncated } = clampArray(props["rows"], 100);
|
|
@@ -170,9 +174,9 @@ function convertTable(props, context) {
|
|
|
170
174
|
} : void 0;
|
|
171
175
|
const dataRows = rawRows.map((row) => ({
|
|
172
176
|
type: "TableRow",
|
|
173
|
-
cells: (Array.isArray(row) ? copyBounded(row, 20).items : []).map((cell) => ({
|
|
177
|
+
cells: (Array.isArray(row) ? copyBounded(row, 20).items : []).map((cell, index) => ({
|
|
174
178
|
type: "TableCell",
|
|
175
|
-
items: [textBlock(
|
|
179
|
+
items: [textBlock(formatValue(cell, isRecord(rawColumns[index]) ? rawColumns[index]["format"] : void 0))]
|
|
176
180
|
}))
|
|
177
181
|
}));
|
|
178
182
|
return {
|
|
@@ -257,11 +261,13 @@ function convertElement(element, context, depth) {
|
|
|
257
261
|
const name = asString(props["name"]);
|
|
258
262
|
const placeholder = asString(props["placeholder"]);
|
|
259
263
|
const label = asString(props["label"]);
|
|
264
|
+
const defaultValue = props["defaultValue"];
|
|
260
265
|
return withCompanionSubmit(element, {
|
|
261
266
|
type: "Input.ChoiceSet",
|
|
262
267
|
id: reservedSafeId(name || "select", "Select", context),
|
|
263
268
|
style: "compact",
|
|
264
269
|
choices: choicesFrom(props["options"], "Select", context),
|
|
270
|
+
...typeof defaultValue === "string" && defaultValue ? { value: defaultValue } : {},
|
|
265
271
|
...placeholder ? { placeholder } : {},
|
|
266
272
|
...label ? { label } : {}
|
|
267
273
|
}, context);
|
|
@@ -279,6 +285,20 @@ function convertElement(element, context, depth) {
|
|
|
279
285
|
...label ? { label } : {}
|
|
280
286
|
}, context);
|
|
281
287
|
}
|
|
288
|
+
case "CheckboxGroup": {
|
|
289
|
+
const name = asString(props["name"]);
|
|
290
|
+
const label = asString(props["label"]);
|
|
291
|
+
const checked = Array.isArray(props["defaultValue"]) ? props["defaultValue"].filter((value) => typeof value === "string" && value !== "") : [];
|
|
292
|
+
return withCompanionSubmit(element, {
|
|
293
|
+
type: "Input.ChoiceSet",
|
|
294
|
+
id: reservedSafeId(name || "checkboxgroup", "CheckboxGroup", context),
|
|
295
|
+
style: "expanded",
|
|
296
|
+
isMultiSelect: true,
|
|
297
|
+
choices: choicesFrom(props["options"], "CheckboxGroup", context),
|
|
298
|
+
...checked.length > 0 ? { value: checked.join(",") } : {},
|
|
299
|
+
...label ? { label } : {}
|
|
300
|
+
}, context);
|
|
301
|
+
}
|
|
282
302
|
case "Checkbox": {
|
|
283
303
|
const name = asString(props["name"]);
|
|
284
304
|
const label = asString(props["label"]);
|
|
@@ -291,16 +311,34 @@ function convertElement(element, context, depth) {
|
|
|
291
311
|
valueOff: "false"
|
|
292
312
|
}, context);
|
|
293
313
|
}
|
|
314
|
+
case "Slider": {
|
|
315
|
+
const name = asString(props["name"]);
|
|
316
|
+
const label = asString(props["label"]);
|
|
317
|
+
const min = asFiniteNumber(props["min"]);
|
|
318
|
+
const max = asFiniteNumber(props["max"]);
|
|
319
|
+
const defaultValue = asFiniteNumber(props["defaultValue"]);
|
|
320
|
+
return withCompanionSubmit(element, {
|
|
321
|
+
type: "Input.Number",
|
|
322
|
+
id: reservedSafeId(name || "slider", "Slider", context),
|
|
323
|
+
...label ? { label } : {},
|
|
324
|
+
...min !== void 0 ? { min } : {},
|
|
325
|
+
...max !== void 0 ? { max } : {},
|
|
326
|
+
...defaultValue !== void 0 ? { value: defaultValue } : {}
|
|
327
|
+
}, context);
|
|
328
|
+
}
|
|
294
329
|
case "Input": {
|
|
295
330
|
const name = asString(props["name"]);
|
|
296
331
|
const label = asString(props["label"]);
|
|
297
332
|
const placeholder = asString(props["placeholder"]);
|
|
333
|
+
const defaultValue = props["defaultValue"];
|
|
298
334
|
return withCompanionSubmit(element, {
|
|
299
335
|
type: "Input.Text",
|
|
300
336
|
id: reservedSafeId(name || "input", "Input", context),
|
|
337
|
+
...props["inputType"] === "password" ? { style: "password" } : {},
|
|
301
338
|
...label ? { label } : {},
|
|
302
339
|
...placeholder ? { placeholder } : {},
|
|
303
|
-
...
|
|
340
|
+
...typeof defaultValue === "string" && defaultValue ? { value: defaultValue } : {},
|
|
341
|
+
...props["multiline"] === true && (props["inputType"] === void 0 || props["inputType"] === "text") ? { isMultiline: true } : {}
|
|
304
342
|
}, context);
|
|
305
343
|
}
|
|
306
344
|
case "DatePicker": {
|
|
@@ -490,10 +528,11 @@ function convertRootToCard(root, context) {
|
|
|
490
528
|
* Converts a generative-ui tree into a Microsoft Teams Adaptive Card and
|
|
491
529
|
* non-fatal conversion warnings. Sizes, weights, and colors map to Adaptive
|
|
492
530
|
* Card's semantic enums rather than raw values. An Input/Select/RadioGroup/
|
|
493
|
-
* Checkbox/DatePicker whose id would be the reserved
|
|
494
|
-
* is renamed with a warning (see `decodeSubmitData`).
|
|
495
|
-
* unknown `$type` is skipped with a "dropped" warning, and a
|
|
496
|
-
* resolves to an empty card plus a "dropped" warning instead
|
|
531
|
+
* CheckboxGroup/Checkbox/Slider/DatePicker whose id would be the reserved
|
|
532
|
+
* {@link RESERVED_INPUT_ID} is renamed with a warning (see `decodeSubmitData`).
|
|
533
|
+
* Never throws: an unknown `$type` is skipped with a "dropped" warning, and a
|
|
534
|
+
* malformed input resolves to an empty card plus a "dropped" warning instead
|
|
535
|
+
* of throwing.
|
|
497
536
|
*/
|
|
498
537
|
function toAdaptiveCard(node, _options) {
|
|
499
538
|
const context = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toAdaptiveCard.js","names":[],"sources":["../../src/teams/toAdaptiveCard.ts"],"sourcesContent":["import {\n MAX_TRAVERSAL_DEPTH,\n boundSpec,\n clampReasonDetail,\n} from \"../convert/boundSpec\";\nimport { copyBounded } from \"../convert/copyBounded\";\nimport { isElement } from \"../convert/isElement\";\nimport { takeRun } from \"../convert/takeRun\";\nimport {\n normalizeSpec,\n type NormalizedUIElement,\n type NormalizedUINode,\n} from \"../ir\";\nimport {\n CHOICE_OPTION_CAP,\n PAYLOAD_SOFT_CAP,\n PRIMARY_ACTION_CAP,\n TABLE_COLUMN_CAP,\n TABLE_ROW_CAP,\n buildCard,\n buildSubmitAction,\n utf8ByteLength,\n} from \"./constants\";\nimport type {\n AdaptiveCardResult,\n TeamsActionSet,\n TeamsAdaptiveCard,\n TeamsCardElement,\n TeamsColumn,\n TeamsContainer,\n TeamsContainerStyle,\n TeamsConversionWarning,\n TeamsFact,\n TeamsInputChoice,\n TeamsTable,\n TeamsTableColumnDefinition,\n TeamsTableRow,\n TeamsTextBlock,\n TeamsTextSize,\n ToAdaptiveCardOptions,\n} from \"./types\";\n\n/** Shared mutable conversion state threaded through one top-level conversion. */\nexport interface ConversionContext {\n readonly warnings: TeamsConversionWarning[];\n usedInputIds: Set<string>;\n}\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nconst asString = (value: unknown): string =>\n typeof value === \"string\" ? value : \"\";\n\nconst DATE_PATTERN = /^\\d{4}-\\d{2}-\\d{2}$/;\n\nconst SUBTLE_COLORS = new Set([\n \"secondary\",\n \"alpha-70\",\n \"white\",\n \"white-70\",\n \"white-50\",\n]);\nconst isSubtleColor = (color: unknown): boolean =>\n typeof color === \"string\" && SUBTLE_COLORS.has(color);\n\nconst BOLDER_WEIGHTS = new Set([\"medium\", \"semibold\", \"bold\"]);\nconst isBolderWeight = (weight: unknown): boolean =>\n typeof weight === \"string\" && BOLDER_WEIGHTS.has(weight);\n\nconst TEXT_SIZE_MAP: Record<string, TeamsTextSize> = {\n sm: \"small\",\n lg: \"medium\",\n xl: \"large\",\n \"2xl\": \"extraLarge\",\n \"3xl\": \"extraLarge\",\n};\n\nconst warn = (\n context: ConversionContext,\n code: TeamsConversionWarning[\"code\"],\n component: string,\n detail: string,\n) => {\n context.warnings.push({ code, component, detail });\n};\n\n/**\n * The `aui` key is reserved for the submit envelope (see\n * {@link buildSubmitData} and `decodeSubmitData`): Adaptive Cards merge\n * every input's current value into the same submit object keyed by its\n * `id`, so an input id of `aui` would clobber the envelope. Renamed to an\n * unused id derived from `aui_` instead of being emitted as-is.\n */\nconst RESERVED_INPUT_ID = \"aui\";\n\nfunction reservedSafeId(\n id: string,\n component: string,\n context: ConversionContext,\n): string {\n const reserved = id === RESERVED_INPUT_ID;\n const base = reserved ? `${RESERVED_INPUT_ID}_` : id;\n let candidate = base;\n let n = 2;\n while (context.usedInputIds.has(candidate)) {\n candidate = `${base}_${n}`;\n n += 1;\n }\n if (reserved) {\n warn(\n context,\n \"fallback\",\n component,\n `the input id \"${RESERVED_INPUT_ID}\" collides with the submit envelope's reserved key and was renamed to \"${candidate}\".`,\n );\n } else if (candidate !== base) {\n warn(\n context,\n \"fallback\",\n component,\n `the input id \"${base}\" was already used on this card and was renamed to \"${candidate}\".`,\n );\n }\n context.usedInputIds.add(candidate);\n return candidate;\n}\n\n/**\n * The shared bounded-iteration primitive: copies `value` to `cap` entries\n * without ever reading past that many indices, so a hostile array (sparse or\n * proxied with a fabricated `length`) cannot stall the event loop.\n */\nconst clampArray = (\n value: unknown,\n cap: number,\n): { readonly items: unknown[]; readonly truncated: boolean } => {\n if (!Array.isArray(value)) return { items: [], truncated: false };\n return copyBounded(value, cap);\n};\n\nconst normalizedList = (\n node: NormalizedUINode | undefined,\n): NormalizedUINode[] => {\n if (node === undefined || node === null) return [];\n if (!Array.isArray(node)) return [node];\n return node.flatMap((child) => normalizedList(child));\n};\n\nfunction textBlock(\n text: string,\n extra?: Partial<Omit<TeamsTextBlock, \"type\" | \"text\" | \"wrap\">>,\n): TeamsTextBlock {\n return { type: \"TextBlock\", text, wrap: true, ...extra };\n}\n\nfunction applyPending(\n element: TeamsCardElement,\n separator: boolean,\n spacing: boolean,\n): TeamsCardElement {\n if (!separator && !spacing) return element;\n return {\n ...element,\n ...(separator ? { separator: true as const } : {}),\n ...(spacing ? { spacing: \"large\" as const } : {}),\n };\n}\n\nconst toChoice = (option: unknown): TeamsInputChoice | undefined => {\n if (!isRecord(option) || typeof option[\"value\"] !== \"string\") {\n return undefined;\n }\n return { title: asString(option[\"label\"]), value: option[\"value\"] };\n};\n\nconst choicesFrom = (\n optionsProp: unknown,\n component: string,\n context: ConversionContext,\n): TeamsInputChoice[] => {\n const { items, truncated } = clampArray(optionsProp, CHOICE_OPTION_CAP);\n if (truncated) {\n warn(\n context,\n \"clamped\",\n component,\n `options were clamped to ${CHOICE_OPTION_CAP} entries.`,\n );\n }\n const choices: TeamsInputChoice[] = [];\n for (const item of items) {\n const choice = toChoice(item);\n if (choice !== undefined) choices.push(choice);\n }\n const dropped = items.length - choices.length;\n if (dropped > 0) {\n warn(\n context,\n \"dropped\",\n component,\n `${dropped} ${dropped === 1 ? \"option was\" : \"options were\"} dropped for want of a string value.`,\n );\n }\n return choices;\n};\n\nfunction convertFacts(facts: readonly NormalizedUIElement[]): TeamsCardElement {\n const set: TeamsFact[] = facts.map((fact) => ({\n title: asString(fact.props[\"label\"]),\n value: asString(fact.props[\"value\"]),\n }));\n return { type: \"FactSet\", facts: set };\n}\n\n// Action.Submit has no visual style concept, so a Button's `buttonStyle`\n// (positive/destructive or otherwise) has nothing to map onto and is dropped.\nfunction convertButtons(\n buttons: readonly NormalizedUIElement[],\n context: ConversionContext,\n): TeamsActionSet {\n if (buttons.length > PRIMARY_ACTION_CAP) {\n warn(\n context,\n \"fallback\",\n \"Button\",\n `actions beyond ${PRIMARY_ACTION_CAP} were set to secondary mode.`,\n );\n }\n const actions = buttons.map((button, index) =>\n buildSubmitAction(\n asString(button.props[\"label\"]),\n button.action,\n index >= PRIMARY_ACTION_CAP ? \"secondary\" : undefined,\n ),\n );\n return { type: \"ActionSet\", actions };\n}\n\nfunction withCompanionSubmit(\n element: NormalizedUIElement,\n input: TeamsCardElement,\n context: ConversionContext,\n): TeamsCardElement[] {\n if (element.action === undefined) return [input];\n warn(\n context,\n \"fallback\",\n element.type,\n \"Teams inputs cannot dispatch on change; a companion submit action was appended.\",\n );\n return [\n input,\n {\n type: \"ActionSet\",\n actions: [buildSubmitAction(\"Submit\", element.action)],\n },\n ];\n}\n\nfunction cardFooterActionSet(\n props: Readonly<Record<string, unknown>>,\n): TeamsActionSet | undefined {\n const actions = ([\"confirm\", \"cancel\"] as const)\n .map((key) => props[key])\n .filter(isRecord)\n .map((footer) =>\n buildSubmitAction(asString(footer[\"label\"]), footer[\"$action\"]),\n );\n return actions.length > 0 ? { type: \"ActionSet\", actions } : undefined;\n}\n\nconst ALERT_STYLE_MAP: Record<string, TeamsContainerStyle> = {\n info: \"accent\",\n success: \"good\",\n warning: \"warning\",\n danger: \"attention\",\n};\n\nconst stringifyCell = (value: unknown): string => {\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\" || typeof value === \"boolean\")\n return String(value);\n return \"\";\n};\n\nfunction convertTable(\n props: Readonly<Record<string, unknown>>,\n context: ConversionContext,\n): TeamsTable {\n const { items: rawColumns, truncated: columnsTruncated } = clampArray(\n props[\"columns\"],\n TABLE_COLUMN_CAP,\n );\n const { items: rawRows, truncated: rowsTruncated } = clampArray(\n props[\"rows\"],\n TABLE_ROW_CAP,\n );\n if (columnsTruncated) {\n warn(\n context,\n \"clamped\",\n \"Table\",\n `columns were clamped to ${TABLE_COLUMN_CAP} entries.`,\n );\n }\n if (rowsTruncated) {\n warn(\n context,\n \"clamped\",\n \"Table\",\n `rows were clamped to ${TABLE_ROW_CAP} entries.`,\n );\n }\n\n const unlabeled = rawColumns.filter(\n (column) => !isRecord(column) || typeof column[\"label\"] !== \"string\",\n ).length;\n if (unlabeled > 0) {\n warn(\n context,\n \"dropped\",\n \"Table\",\n `${unlabeled} column ${unlabeled === 1 ? \"header was\" : \"headers were\"} left blank for want of a string label.`,\n );\n }\n const hasColumns = rawColumns.length > 0;\n const columns: TeamsTableColumnDefinition[] = rawColumns.map(() => ({\n width: 1 as const,\n }));\n const headerRow: TeamsTableRow | undefined = hasColumns\n ? {\n type: \"TableRow\",\n cells: rawColumns.map((column) => ({\n type: \"TableCell\" as const,\n items: [textBlock(isRecord(column) ? asString(column[\"label\"]) : \"\")],\n })),\n }\n : undefined;\n const dataRows: TeamsTableRow[] = rawRows.map((row) => ({\n type: \"TableRow\",\n cells: (Array.isArray(row)\n ? copyBounded(row, TABLE_COLUMN_CAP).items\n : []\n ).map((cell) => ({\n type: \"TableCell\" as const,\n items: [textBlock(stringifyCell(cell))],\n })),\n }));\n\n return {\n type: \"Table\",\n firstRowAsHeaders: hasColumns,\n columns,\n rows: headerRow !== undefined ? [headerRow, ...dataRows] : dataRows,\n };\n}\n\nfunction convertListViewItem(\n element: NormalizedUIElement,\n context: ConversionContext,\n depth: number,\n): TeamsContainer {\n const items = convertSequence(element.children, context, depth + 1);\n const selectAction = isRecord(element.action)\n ? buildSubmitAction(\"Open\", element.action)\n : undefined;\n return {\n type: \"Container\",\n items,\n ...(selectAction !== undefined ? { selectAction } : {}),\n };\n}\n\n/**\n * Converts a child whose output is thrown away, and reports whether anything\n * was lost with it. A scratch context keeps the ids it claims out of the card,\n * where they would rename a control that survives; only its `dropped` warnings\n * are forwarded, because those describe the tree the caller wrote, while a\n * clamp or a rename would describe content never delivered.\n */\nexport const discardedChild = (\n child: NormalizedUINode,\n context: ConversionContext,\n depth: number,\n): boolean => {\n const scratch: ConversionContext = {\n ...context,\n warnings: [],\n usedInputIds: new Set(context.usedInputIds),\n };\n const produced = convertSequence(child, scratch, depth).length > 0;\n const lost = scratch.warnings.filter((warning) => warning.code === \"dropped\");\n context.warnings.push(...lost);\n return produced || lost.length > 0;\n};\n\nexport function convertElement(\n element: NormalizedUIElement,\n context: ConversionContext,\n depth: number,\n): TeamsCardElement[] {\n const { props } = element;\n switch (element.type) {\n case \"Header\":\n return [\n textBlock(asString(props[\"text\"]), {\n size: \"large\",\n weight: \"bolder\",\n style: \"heading\",\n }),\n ];\n case \"Text\": {\n const mappedSize =\n typeof props[\"size\"] === \"string\"\n ? TEXT_SIZE_MAP[props[\"size\"]]\n : undefined;\n return [\n textBlock(asString(props[\"value\"]), {\n ...(mappedSize !== undefined ? { size: mappedSize } : {}),\n ...(isBolderWeight(props[\"weight\"]) ? { weight: \"bolder\" } : {}),\n ...(isSubtleColor(props[\"color\"]) ? { isSubtle: true } : {}),\n }),\n ];\n }\n case \"Caption\":\n return [\n textBlock(asString(props[\"value\"]), { size: \"small\", isSubtle: true }),\n ];\n case \"Badge\":\n return [\n textBlock(asString(props[\"value\"]), { size: \"small\", isSubtle: true }),\n ];\n case \"Markdown\":\n // Teams renders a strict subset of markdown (no headings, tables, images,\n // preformatted blocks, or blockquotes); unsupported syntax renders literally.\n return [textBlock(asString(props[\"value\"]))];\n case \"Fact\":\n return [convertFacts([element])];\n case \"Image\": {\n const size = props[\"size\"];\n let mappedSize: \"small\" | \"medium\" | \"large\" | undefined;\n if (size === \"sm\") mappedSize = \"small\";\n else if (size === \"md\") mappedSize = \"medium\";\n else if (size === \"lg\") mappedSize = \"large\";\n else if (typeof size === \"number\") {\n warn(context, \"dropped\", \"Image\", \"A numeric size was dropped.\");\n }\n return [\n {\n type: \"Image\",\n url: asString(props[\"src\"]),\n altText: asString(props[\"alt\"]),\n ...(mappedSize !== undefined ? { size: mappedSize } : {}),\n },\n ];\n }\n case \"Divider\":\n case \"Spacer\":\n case \"Icon\":\n return [];\n case \"Button\":\n return [convertButtons([element], context)];\n case \"Select\": {\n const name = asString(props[\"name\"]);\n const placeholder = asString(props[\"placeholder\"]);\n const label = asString(props[\"label\"]);\n const input: TeamsCardElement = {\n type: \"Input.ChoiceSet\",\n id: reservedSafeId(name || \"select\", \"Select\", context),\n style: \"compact\",\n choices: choicesFrom(props[\"options\"], \"Select\", context),\n ...(placeholder ? { placeholder } : {}),\n ...(label ? { label } : {}),\n };\n return withCompanionSubmit(element, input, context);\n }\n case \"RadioGroup\": {\n const name = asString(props[\"name\"]);\n const label = asString(props[\"label\"]);\n const defaultValue = props[\"defaultValue\"];\n const input: TeamsCardElement = {\n type: \"Input.ChoiceSet\",\n id: reservedSafeId(name || \"radiogroup\", \"RadioGroup\", context),\n style: \"expanded\",\n choices: choicesFrom(props[\"options\"], \"RadioGroup\", context),\n ...(typeof defaultValue === \"string\" && defaultValue\n ? { value: defaultValue }\n : {}),\n ...(label ? { label } : {}),\n };\n return withCompanionSubmit(element, input, context);\n }\n case \"Checkbox\": {\n const name = asString(props[\"name\"]);\n const label = asString(props[\"label\"]);\n const input: TeamsCardElement = {\n type: \"Input.Toggle\",\n id: reservedSafeId(name || label || \"checkbox\", \"Checkbox\", context),\n title: label,\n value: props[\"defaultChecked\"] === true ? \"true\" : \"false\",\n valueOn: \"true\",\n valueOff: \"false\",\n };\n return withCompanionSubmit(element, input, context);\n }\n case \"Input\": {\n const name = asString(props[\"name\"]);\n const label = asString(props[\"label\"]);\n const placeholder = asString(props[\"placeholder\"]);\n const input: TeamsCardElement = {\n type: \"Input.Text\",\n id: reservedSafeId(name || \"input\", \"Input\", context),\n ...(label ? { label } : {}),\n ...(placeholder ? { placeholder } : {}),\n ...(props[\"multiline\"] === true ? { isMultiline: true } : {}),\n };\n return withCompanionSubmit(element, input, context);\n }\n case \"DatePicker\": {\n const name = asString(props[\"name\"]);\n const label = asString(props[\"label\"]);\n const rawValue = props[\"value\"];\n const value =\n typeof rawValue === \"string\" && DATE_PATTERN.test(rawValue)\n ? rawValue\n : undefined;\n const rawMin = props[\"min\"];\n const min =\n typeof rawMin === \"string\" && DATE_PATTERN.test(rawMin)\n ? rawMin\n : undefined;\n const rawMax = props[\"max\"];\n const max =\n typeof rawMax === \"string\" && DATE_PATTERN.test(rawMax)\n ? rawMax\n : undefined;\n const input: TeamsCardElement = {\n type: \"Input.Date\",\n id: reservedSafeId(name || \"datepicker\", \"DatePicker\", context),\n ...(label ? { label } : {}),\n ...(value !== undefined ? { value } : {}),\n ...(min !== undefined ? { min } : {}),\n ...(max !== undefined ? { max } : {}),\n };\n return withCompanionSubmit(element, input, context);\n }\n case \"Form\":\n return [\n ...convertSequence(element.children, context, depth + 1),\n {\n type: \"ActionSet\",\n actions: [buildSubmitAction(\"Submit\", element.action)],\n },\n ];\n case \"Card\": {\n const titleText = asString(props[\"title\"]);\n const items: TeamsCardElement[] = [];\n if (titleText) {\n items.push(\n textBlock(titleText, {\n size: \"large\",\n weight: \"bolder\",\n style: \"heading\",\n }),\n );\n }\n items.push(...convertSequence(element.children, context, depth + 1));\n const container: TeamsContainer = {\n type: \"Container\",\n style: \"default\",\n items,\n };\n const actionSet = cardFooterActionSet(props);\n return actionSet !== undefined ? [container, actionSet] : [container];\n }\n case \"Col\":\n case \"Box\":\n return [\n {\n type: \"Container\",\n items: convertSequence(element.children, context, depth + 1),\n },\n ];\n case \"Row\": {\n const children = normalizedList(element.children);\n if (children.length > 3) {\n warn(context, \"advisory\", \"Row\", \"Teams recommends at most 3 columns.\");\n }\n const columns: TeamsColumn[] = children.map((child) => ({\n type: \"Column\",\n width: \"auto\",\n items: convertSequence(child, context, depth + 1),\n }));\n return [{ type: \"ColumnSet\", columns }];\n }\n case \"ListView\": {\n const containers: TeamsContainer[] = [];\n let discarded = 0;\n for (const child of normalizedList(element.children)) {\n if (isElement(child) && child.type === \"ListViewItem\") {\n containers.push(convertListViewItem(child, context, depth + 1));\n continue;\n }\n if (discardedChild(child, context, depth + 1)) discarded += 1;\n }\n if (discarded > 0) {\n warn(\n context,\n \"dropped\",\n \"ListView\",\n `${discarded} non-item ${discarded === 1 ? \"child was\" : \"children were\"} dropped.`,\n );\n }\n return containers.map((container, index) =>\n index > 0 ? { ...container, separator: true } : container,\n );\n }\n case \"ListViewItem\":\n return [convertListViewItem(element, context, depth)];\n case \"Table\":\n return [convertTable(props, context)];\n case \"Alert\": {\n const tone = props[\"tone\"] ?? \"info\";\n const style =\n typeof tone === \"string\"\n ? (ALERT_STYLE_MAP[tone] ?? \"default\")\n : \"default\";\n const titleText = asString(props[\"title\"]);\n const description = asString(props[\"description\"]);\n const items: TeamsCardElement[] = [];\n if (titleText) items.push(textBlock(titleText, { weight: \"bolder\" }));\n if (description) items.push(textBlock(description));\n return [{ type: \"Container\", style, items }];\n }\n case \"Carousel\": {\n warn(\n context,\n \"fallback\",\n \"Carousel\",\n \"A carousel was rendered as sequential cards because it is not at the root.\",\n );\n const cards: NormalizedUIElement[] = [];\n let droppedCards = 0;\n for (const child of normalizedList(element.children)) {\n if (isElement(child) && child.type === \"Card\") {\n cards.push(child);\n continue;\n }\n if (discardedChild(child, context, depth + 1)) droppedCards += 1;\n }\n if (droppedCards > 0) {\n warn(\n context,\n \"dropped\",\n \"Carousel\",\n `${droppedCards} non-card ${droppedCards === 1 ? \"child was\" : \"children were\"} dropped.`,\n );\n }\n return cards.flatMap((card) => convertElement(card, context, depth + 1));\n }\n case \"Chart\":\n warn(\n context,\n \"dropped\",\n \"Chart\",\n \"Chart was replaced by a Teams omission note.\",\n );\n return [\n textBlock(\"Chart omitted on Teams.\", { isSubtle: true, size: \"small\" }),\n ];\n default:\n warn(\n context,\n \"dropped\",\n element.type,\n \"Unknown component type was dropped.\",\n );\n return [];\n }\n}\n\n/**\n * Walks a normalized sequence into card body elements. Nested arrays are\n * flattened into one flat sibling sequence first (via {@link normalizedList}),\n * so a `Divider`/`Fact`/`Button` run merges correctly even when the model\n * wrapped some of its siblings in their own array. Consecutive `Fact`\n * siblings merge into one FactSet and consecutive `Button` siblings merge\n * into one ActionSet; a `Divider`/`Spacer` emits nothing itself but sets\n * `separator`/`spacing` on the next emitted sibling (a trailing or orphan\n * one is dropped silently, since there is no sibling left to carry it).\n * `depth` advances by exactly one per element-nesting level: this call does\n * not itself add a level, since flattening a sibling array or converting a\n * sibling element is not a descent; only a container's own recursive\n * `convertSequence(children, depth + 1)` call is.\n */\nexport function convertSequence(\n node: NormalizedUINode | undefined,\n context: ConversionContext,\n depth: number,\n): TeamsCardElement[] {\n if (node === undefined || node === null || depth > MAX_TRAVERSAL_DEPTH) {\n return [];\n }\n const nodes = normalizedList(node);\n const items: TeamsCardElement[] = [];\n let pendingSeparator = false;\n let pendingSpacing = false;\n\n const emit = (converted: TeamsCardElement[]) => {\n const [first, ...rest] = converted;\n if (first === undefined) return;\n items.push(applyPending(first, pendingSeparator, pendingSpacing), ...rest);\n pendingSeparator = false;\n pendingSpacing = false;\n };\n\n for (let index = 0; index < nodes.length;) {\n const current = nodes[index];\n if (current === undefined || current === null) {\n index += 1;\n continue;\n }\n if (isElement(current) && current.type === \"Divider\") {\n pendingSeparator = true;\n index += 1;\n continue;\n }\n if (isElement(current) && current.type === \"Spacer\") {\n pendingSpacing = true;\n index += 1;\n continue;\n }\n if (isElement(current) && current.type === \"Fact\") {\n const { run: facts, next } = takeRun(\n nodes,\n index,\n (candidate) => candidate.type === \"Fact\",\n );\n index = next;\n emit([convertFacts(facts)]);\n continue;\n }\n if (isElement(current) && current.type === \"Button\") {\n const { run: buttons, next } = takeRun(\n nodes,\n index,\n (candidate) => candidate.type === \"Button\",\n );\n index = next;\n emit([convertButtons(buttons, context)]);\n continue;\n }\n if (typeof current === \"string\" || typeof current === \"number\") {\n emit([textBlock(String(current))]);\n } else {\n emit(convertElement(current as NormalizedUIElement, context, depth));\n }\n index += 1;\n }\n return items;\n}\n\n/** Builds a full card (schema envelope plus body) from an already-normalized root, checking the soft payload budget. */\nexport function convertRootToCard(\n root: NormalizedUINode | readonly NormalizedUINode[],\n context: ConversionContext,\n): TeamsAdaptiveCard {\n context.usedInputIds = new Set();\n const body = convertSequence(root, context, 0);\n const card = buildCard(body);\n const size = utf8ByteLength(JSON.stringify(card));\n if (size > PAYLOAD_SOFT_CAP) {\n warn(\n context,\n \"advisory\",\n \"Root\",\n `the card is ${size} bytes, over the ${PAYLOAD_SOFT_CAP}-byte soft budget kept below Teams' 100 KB bot message limit.`,\n );\n }\n return card;\n}\n\n/**\n * Converts a generative-ui tree into a Microsoft Teams Adaptive Card and\n * non-fatal conversion warnings. Sizes, weights, and colors map to Adaptive\n * Card's semantic enums rather than raw values. An Input/Select/RadioGroup/\n * Checkbox/DatePicker whose id would be the reserved {@link RESERVED_INPUT_ID}\n * is renamed with a warning (see `decodeSubmitData`). Never throws: an\n * unknown `$type` is skipped with a \"dropped\" warning, and a malformed input\n * resolves to an empty card plus a \"dropped\" warning instead of throwing.\n */\nexport function toAdaptiveCard(\n node: unknown,\n _options?: ToAdaptiveCardOptions,\n): AdaptiveCardResult {\n const context: ConversionContext = { warnings: [], usedInputIds: new Set() };\n try {\n const bounded = boundSpec(node, (reason) =>\n warn(context, \"clamped\", \"Root\", clampReasonDetail(reason)),\n );\n const { root } = normalizeSpec(bounded as never);\n return {\n card: convertRootToCard(root, context),\n warnings: context.warnings,\n };\n } catch {\n return {\n card: buildCard([]),\n warnings: [\n {\n code: \"dropped\",\n component: \"Root\",\n detail: \"Input could not be converted.\",\n },\n ],\n };\n }\n}\n"],"mappings":";;;;;;;AAgDA,MAAM,YAAY,UAChB,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAErE,MAAM,YAAY,UAChB,OAAO,UAAU,WAAW,QAAQ;AAEtC,MAAM,eAAe;AAErB,MAAM,gCAAgB,IAAI,IAAI;CAC5B;CACA;CACA;CACA;CACA;AACF,CAAC;AACD,MAAM,iBAAiB,UACrB,OAAO,UAAU,YAAY,cAAc,IAAI,KAAK;AAEtD,MAAM,iCAAiB,IAAI,IAAI;CAAC;CAAU;CAAY;AAAM,CAAC;AAC7D,MAAM,kBAAkB,WACtB,OAAO,WAAW,YAAY,eAAe,IAAI,MAAM;AAEzD,MAAM,gBAA+C;CACnD,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,OAAO;CACP,OAAO;AACT;AAEA,MAAM,QACJ,SACA,MACA,WACA,WACG;CACH,QAAQ,SAAS,KAAK;EAAE;EAAM;EAAW;CAAO,CAAC;AACnD;;;;;;;;AASA,MAAM,oBAAoB;AAE1B,SAAS,eACP,IACA,WACA,SACQ;CACR,MAAM,WAAW,OAAO;CACxB,MAAM,OAAO,WAAW,GAAG,kBAAkB,KAAK;CAClD,IAAI,YAAY;CAChB,IAAI,IAAI;CACR,OAAO,QAAQ,aAAa,IAAI,SAAS,GAAG;EAC1C,YAAY,G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iveCard.js","names":[],"sources":["../../src/teams/toAdaptiveCard.ts"],"sourcesContent":["import {\n MAX_TRAVERSAL_DEPTH,\n boundSpec,\n clampReasonDetail,\n} from \"../convert/boundSpec\";\nimport { copyBounded } from \"../convert/copyBounded\";\nimport { isElement } from \"../convert/isElement\";\nimport { takeRun } from \"../convert/takeRun\";\nimport {\n normalizeSpec,\n type NormalizedUIElement,\n type NormalizedUINode,\n} from \"../ir\";\nimport {\n factTrend,\n formatFactDelta,\n formatValue,\n} from \"../vocabulary/formatValue\";\nimport {\n CHOICE_OPTION_CAP,\n PAYLOAD_SOFT_CAP,\n PRIMARY_ACTION_CAP,\n TABLE_COLUMN_CAP,\n TABLE_ROW_CAP,\n buildCard,\n buildSubmitAction,\n utf8ByteLength,\n} from \"./constants\";\nimport type {\n AdaptiveCardResult,\n TeamsActionSet,\n TeamsAdaptiveCard,\n TeamsCardElement,\n TeamsColumn,\n TeamsContainer,\n TeamsContainerStyle,\n TeamsConversionWarning,\n TeamsFact,\n TeamsInputChoice,\n TeamsTable,\n TeamsTableColumnDefinition,\n TeamsTableRow,\n TeamsTextBlock,\n TeamsTextSize,\n ToAdaptiveCardOptions,\n} from \"./types\";\n\n/** Shared mutable conversion state threaded through one top-level conversion. */\nexport interface ConversionContext {\n readonly warnings: TeamsConversionWarning[];\n usedInputIds: Set<string>;\n}\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nconst asString = (value: unknown): string =>\n typeof value === \"string\" ? value : \"\";\n\nconst asFiniteNumber = (value: unknown): number | undefined =>\n typeof value === \"number\" && Number.isFinite(value) ? value : undefined;\n\nconst DATE_PATTERN = /^\\d{4}-\\d{2}-\\d{2}$/;\n\nconst SUBTLE_COLORS = new Set([\n \"secondary\",\n \"alpha-70\",\n \"white\",\n \"white-70\",\n \"white-50\",\n]);\nconst isSubtleColor = (color: unknown): boolean =>\n typeof color === \"string\" && SUBTLE_COLORS.has(color);\n\nconst BOLDER_WEIGHTS = new Set([\"medium\", \"semibold\", \"bold\"]);\nconst isBolderWeight = (weight: unknown): boolean =>\n typeof weight === \"string\" && BOLDER_WEIGHTS.has(weight);\n\nconst TEXT_SIZE_MAP: Record<string, TeamsTextSize> = {\n sm: \"small\",\n lg: \"medium\",\n xl: \"large\",\n \"2xl\": \"extraLarge\",\n \"3xl\": \"extraLarge\",\n};\n\nconst warn = (\n context: ConversionContext,\n code: TeamsConversionWarning[\"code\"],\n component: string,\n detail: string,\n) => {\n context.warnings.push({ code, component, detail });\n};\n\n/**\n * The `aui` key is reserved for the submit envelope (see\n * {@link buildSubmitData} and `decodeSubmitData`): Adaptive Cards merge\n * every input's current value into the same submit object keyed by its\n * `id`, so an input id of `aui` would clobber the envelope. Renamed to an\n * unused id derived from `aui_` instead of being emitted as-is.\n */\nconst RESERVED_INPUT_ID = \"aui\";\n\nfunction reservedSafeId(\n id: string,\n component: string,\n context: ConversionContext,\n): string {\n const reserved = id === RESERVED_INPUT_ID;\n const base = reserved ? `${RESERVED_INPUT_ID}_` : id;\n let candidate = base;\n let n = 2;\n while (context.usedInputIds.has(candidate)) {\n candidate = `${base}_${n}`;\n n += 1;\n }\n if (reserved) {\n warn(\n context,\n \"fallback\",\n component,\n `the input id \"${RESERVED_INPUT_ID}\" collides with the submit envelope's reserved key and was renamed to \"${candidate}\".`,\n );\n } else if (candidate !== base) {\n warn(\n context,\n \"fallback\",\n component,\n `the input id \"${base}\" was already used on this card and was renamed to \"${candidate}\".`,\n );\n }\n context.usedInputIds.add(candidate);\n return candidate;\n}\n\n/**\n * The shared bounded-iteration primitive: copies `value` to `cap` entries\n * without ever reading past that many indices, so a hostile array (sparse or\n * proxied with a fabricated `length`) cannot stall the event loop.\n */\nconst clampArray = (\n value: unknown,\n cap: number,\n): { readonly items: unknown[]; readonly truncated: boolean } => {\n if (!Array.isArray(value)) return { items: [], truncated: false };\n return copyBounded(value, cap);\n};\n\nconst normalizedList = (\n node: NormalizedUINode | undefined,\n): NormalizedUINode[] => {\n if (node === undefined || node === null) return [];\n if (!Array.isArray(node)) return [node];\n return node.flatMap((child) => normalizedList(child));\n};\n\nfunction textBlock(\n text: string,\n extra?: Partial<Omit<TeamsTextBlock, \"type\" | \"text\" | \"wrap\">>,\n): TeamsTextBlock {\n return { type: \"TextBlock\", text, wrap: true, ...extra };\n}\n\nfunction applyPending(\n element: TeamsCardElement,\n separator: boolean,\n spacing: boolean,\n): TeamsCardElement {\n if (!separator && !spacing) return element;\n return {\n ...element,\n ...(separator ? { separator: true as const } : {}),\n ...(spacing ? { spacing: \"large\" as const } : {}),\n };\n}\n\nconst toChoice = (option: unknown): TeamsInputChoice | undefined => {\n if (!isRecord(option) || typeof option[\"value\"] !== \"string\") {\n return undefined;\n }\n const label = asString(option[\"label\"]);\n const description = asString(option[\"description\"]);\n return {\n title: description\n ? [label, description].filter(Boolean).join(\": \")\n : label,\n value: option[\"value\"],\n };\n};\n\nconst choicesFrom = (\n optionsProp: unknown,\n component: string,\n context: ConversionContext,\n): TeamsInputChoice[] => {\n const { items, truncated } = clampArray(optionsProp, CHOICE_OPTION_CAP);\n if (truncated) {\n warn(\n context,\n \"clamped\",\n component,\n `options were clamped to ${CHOICE_OPTION_CAP} entries.`,\n );\n }\n const choices: TeamsInputChoice[] = [];\n for (const item of items) {\n const choice = toChoice(item);\n if (choice !== undefined) choices.push(choice);\n }\n const dropped = items.length - choices.length;\n if (dropped > 0) {\n warn(\n context,\n \"dropped\",\n component,\n `${dropped} ${dropped === 1 ? \"option was\" : \"options were\"} dropped for want of a string value.`,\n );\n }\n return choices;\n};\n\nfunction convertFacts(facts: readonly NormalizedUIElement[]): TeamsCardElement {\n const set: TeamsFact[] = facts.map((fact) => {\n const value = asString(fact.props[\"value\"]);\n const delta = fact.props[\"delta\"];\n const deltaText =\n typeof delta === \"string\"\n ? formatFactDelta(delta, factTrend(delta, fact.props[\"trend\"]))\n : undefined;\n return {\n title: asString(fact.props[\"label\"]),\n value: deltaText === undefined ? value : `${value} (${deltaText})`,\n };\n });\n return { type: \"FactSet\", facts: set };\n}\n\n// Action.Submit has no visual style concept, so a Button's `buttonStyle`\n// (positive/destructive or otherwise) has nothing to map onto and is dropped.\nfunction convertButtons(\n buttons: readonly NormalizedUIElement[],\n context: ConversionContext,\n): TeamsActionSet {\n if (buttons.length > PRIMARY_ACTION_CAP) {\n warn(\n context,\n \"fallback\",\n \"Button\",\n `actions beyond ${PRIMARY_ACTION_CAP} were set to secondary mode.`,\n );\n }\n const actions = buttons.map((button, index) =>\n buildSubmitAction(\n asString(button.props[\"label\"]),\n button.action,\n index >= PRIMARY_ACTION_CAP ? \"secondary\" : undefined,\n ),\n );\n return { type: \"ActionSet\", actions };\n}\n\nfunction withCompanionSubmit(\n element: NormalizedUIElement,\n input: TeamsCardElement,\n context: ConversionContext,\n): TeamsCardElement[] {\n if (element.action === undefined) return [input];\n warn(\n context,\n \"fallback\",\n element.type,\n \"Teams inputs cannot dispatch on change; a companion submit action was appended.\",\n );\n return [\n input,\n {\n type: \"ActionSet\",\n actions: [buildSubmitAction(\"Submit\", element.action)],\n },\n ];\n}\n\nfunction cardFooterActionSet(\n props: Readonly<Record<string, unknown>>,\n): TeamsActionSet | undefined {\n const actions = ([\"confirm\", \"cancel\"] as const)\n .map((key) => props[key])\n .filter(isRecord)\n .map((footer) =>\n buildSubmitAction(asString(footer[\"label\"]), footer[\"$action\"]),\n );\n return actions.length > 0 ? { type: \"ActionSet\", actions } : undefined;\n}\n\nconst ALERT_STYLE_MAP: Record<string, TeamsContainerStyle> = {\n info: \"accent\",\n success: \"good\",\n warning: \"warning\",\n danger: \"attention\",\n};\n\nfunction convertTable(\n props: Readonly<Record<string, unknown>>,\n context: ConversionContext,\n): TeamsTable {\n const { items: rawColumns, truncated: columnsTruncated } = clampArray(\n props[\"columns\"],\n TABLE_COLUMN_CAP,\n );\n const { items: rawRows, truncated: rowsTruncated } = clampArray(\n props[\"rows\"],\n TABLE_ROW_CAP,\n );\n if (columnsTruncated) {\n warn(\n context,\n \"clamped\",\n \"Table\",\n `columns were clamped to ${TABLE_COLUMN_CAP} entries.`,\n );\n }\n if (rowsTruncated) {\n warn(\n context,\n \"clamped\",\n \"Table\",\n `rows were clamped to ${TABLE_ROW_CAP} entries.`,\n );\n }\n\n const unlabeled = rawColumns.filter(\n (column) => !isRecord(column) || typeof column[\"label\"] !== \"string\",\n ).length;\n if (unlabeled > 0) {\n warn(\n context,\n \"dropped\",\n \"Table\",\n `${unlabeled} column ${unlabeled === 1 ? \"header was\" : \"headers were\"} left blank for want of a string label.`,\n );\n }\n const hasColumns = rawColumns.length > 0;\n const columns: TeamsTableColumnDefinition[] = rawColumns.map(() => ({\n width: 1 as const,\n }));\n const headerRow: TeamsTableRow | undefined = hasColumns\n ? {\n type: \"TableRow\",\n cells: rawColumns.map((column) => ({\n type: \"TableCell\" as const,\n items: [textBlock(isRecord(column) ? asString(column[\"label\"]) : \"\")],\n })),\n }\n : undefined;\n const dataRows: TeamsTableRow[] = rawRows.map((row) => ({\n type: \"TableRow\",\n cells: (Array.isArray(row)\n ? copyBounded(row, TABLE_COLUMN_CAP).items\n : []\n ).map((cell, index) => ({\n type: \"TableCell\" as const,\n items: [\n textBlock(\n formatValue(\n cell,\n isRecord(rawColumns[index])\n ? rawColumns[index][\"format\"]\n : undefined,\n ),\n ),\n ],\n })),\n }));\n\n return {\n type: \"Table\",\n firstRowAsHeaders: hasColumns,\n columns,\n rows: headerRow !== undefined ? [headerRow, ...dataRows] : dataRows,\n };\n}\n\nfunction convertListViewItem(\n element: NormalizedUIElement,\n context: ConversionContext,\n depth: number,\n): TeamsContainer {\n const items = convertSequence(element.children, context, depth + 1);\n const selectAction = isRecord(element.action)\n ? buildSubmitAction(\"Open\", element.action)\n : undefined;\n return {\n type: \"Container\",\n items,\n ...(selectAction !== undefined ? { selectAction } : {}),\n };\n}\n\n/**\n * Converts a child whose output is thrown away, and reports whether anything\n * was lost with it. A scratch context keeps the ids it claims out of the card,\n * where they would rename a control that survives; only its `dropped` warnings\n * are forwarded, because those describe the tree the caller wrote, while a\n * clamp or a rename would describe content never delivered.\n */\nexport const discardedChild = (\n child: NormalizedUINode,\n context: ConversionContext,\n depth: number,\n): boolean => {\n const scratch: ConversionContext = {\n ...context,\n warnings: [],\n usedInputIds: new Set(context.usedInputIds),\n };\n const produced = convertSequence(child, scratch, depth).length > 0;\n const lost = scratch.warnings.filter((warning) => warning.code === \"dropped\");\n context.warnings.push(...lost);\n return produced || lost.length > 0;\n};\n\nexport function convertElement(\n element: NormalizedUIElement,\n context: ConversionContext,\n depth: number,\n): TeamsCardElement[] {\n const { props } = element;\n switch (element.type) {\n case \"Header\":\n return [\n textBlock(asString(props[\"text\"]), {\n size: \"large\",\n weight: \"bolder\",\n style: \"heading\",\n }),\n ];\n case \"Text\": {\n const mappedSize =\n typeof props[\"size\"] === \"string\"\n ? TEXT_SIZE_MAP[props[\"size\"]]\n : undefined;\n return [\n textBlock(asString(props[\"value\"]), {\n ...(mappedSize !== undefined ? { size: mappedSize } : {}),\n ...(isBolderWeight(props[\"weight\"]) ? { weight: \"bolder\" } : {}),\n ...(isSubtleColor(props[\"color\"]) ? { isSubtle: true } : {}),\n }),\n ];\n }\n case \"Caption\":\n return [\n textBlock(asString(props[\"value\"]), { size: \"small\", isSubtle: true }),\n ];\n case \"Badge\":\n return [\n textBlock(asString(props[\"value\"]), { size: \"small\", isSubtle: true }),\n ];\n case \"Markdown\":\n // Teams renders a strict subset of markdown (no headings, tables, images,\n // preformatted blocks, or blockquotes); unsupported syntax renders literally.\n return [textBlock(asString(props[\"value\"]))];\n case \"Fact\":\n return [convertFacts([element])];\n case \"Image\": {\n const size = props[\"size\"];\n let mappedSize: \"small\" | \"medium\" | \"large\" | undefined;\n if (size === \"sm\") mappedSize = \"small\";\n else if (size === \"md\") mappedSize = \"medium\";\n else if (size === \"lg\") mappedSize = \"large\";\n else if (typeof size === \"number\") {\n warn(context, \"dropped\", \"Image\", \"A numeric size was dropped.\");\n }\n return [\n {\n type: \"Image\",\n url: asString(props[\"src\"]),\n altText: asString(props[\"alt\"]),\n ...(mappedSize !== undefined ? { size: mappedSize } : {}),\n },\n ];\n }\n case \"Divider\":\n case \"Spacer\":\n case \"Icon\":\n return [];\n case \"Button\":\n return [convertButtons([element], context)];\n case \"Select\": {\n const name = asString(props[\"name\"]);\n const placeholder = asString(props[\"placeholder\"]);\n const label = asString(props[\"label\"]);\n const defaultValue = props[\"defaultValue\"];\n const input: TeamsCardElement = {\n type: \"Input.ChoiceSet\",\n id: reservedSafeId(name || \"select\", \"Select\", context),\n style: \"compact\",\n choices: choicesFrom(props[\"options\"], \"Select\", context),\n ...(typeof defaultValue === \"string\" && defaultValue\n ? { value: defaultValue }\n : {}),\n ...(placeholder ? { placeholder } : {}),\n ...(label ? { label } : {}),\n };\n return withCompanionSubmit(element, input, context);\n }\n case \"RadioGroup\": {\n const name = asString(props[\"name\"]);\n const label = asString(props[\"label\"]);\n const defaultValue = props[\"defaultValue\"];\n const input: TeamsCardElement = {\n type: \"Input.ChoiceSet\",\n id: reservedSafeId(name || \"radiogroup\", \"RadioGroup\", context),\n style: \"expanded\",\n choices: choicesFrom(props[\"options\"], \"RadioGroup\", context),\n ...(typeof defaultValue === \"string\" && defaultValue\n ? { value: defaultValue }\n : {}),\n ...(label ? { label } : {}),\n };\n return withCompanionSubmit(element, input, context);\n }\n case \"CheckboxGroup\": {\n const name = asString(props[\"name\"]);\n const label = asString(props[\"label\"]);\n const checked = Array.isArray(props[\"defaultValue\"])\n ? props[\"defaultValue\"].filter(\n (value): value is string =>\n typeof value === \"string\" && value !== \"\",\n )\n : [];\n const input: TeamsCardElement = {\n type: \"Input.ChoiceSet\",\n id: reservedSafeId(name || \"checkboxgroup\", \"CheckboxGroup\", context),\n style: \"expanded\",\n isMultiSelect: true,\n choices: choicesFrom(props[\"options\"], \"CheckboxGroup\", context),\n ...(checked.length > 0 ? { value: checked.join(\",\") } : {}),\n ...(label ? { label } : {}),\n };\n return withCompanionSubmit(element, input, context);\n }\n case \"Checkbox\": {\n const name = asString(props[\"name\"]);\n const label = asString(props[\"label\"]);\n const input: TeamsCardElement = {\n type: \"Input.Toggle\",\n id: reservedSafeId(name || label || \"checkbox\", \"Checkbox\", context),\n title: label,\n value: props[\"defaultChecked\"] === true ? \"true\" : \"false\",\n valueOn: \"true\",\n valueOff: \"false\",\n };\n return withCompanionSubmit(element, input, context);\n }\n case \"Slider\": {\n const name = asString(props[\"name\"]);\n const label = asString(props[\"label\"]);\n const min = asFiniteNumber(props[\"min\"]);\n const max = asFiniteNumber(props[\"max\"]);\n const defaultValue = asFiniteNumber(props[\"defaultValue\"]);\n const input = {\n type: \"Input.Number\",\n id: reservedSafeId(name || \"slider\", \"Slider\", context),\n ...(label ? { label } : {}),\n ...(min !== undefined ? { min } : {}),\n ...(max !== undefined ? { max } : {}),\n ...(defaultValue !== undefined ? { value: defaultValue } : {}),\n } as unknown as TeamsCardElement;\n return withCompanionSubmit(element, input, context);\n }\n case \"Input\": {\n const name = asString(props[\"name\"]);\n const label = asString(props[\"label\"]);\n const placeholder = asString(props[\"placeholder\"]);\n const defaultValue = props[\"defaultValue\"];\n const input: TeamsCardElement = {\n type: \"Input.Text\",\n id: reservedSafeId(name || \"input\", \"Input\", context),\n ...(props[\"inputType\"] === \"password\" ? { style: \"password\" } : {}),\n ...(label ? { label } : {}),\n ...(placeholder ? { placeholder } : {}),\n ...(typeof defaultValue === \"string\" && defaultValue\n ? { value: defaultValue }\n : {}),\n ...(props[\"multiline\"] === true &&\n (props[\"inputType\"] === undefined || props[\"inputType\"] === \"text\")\n ? { isMultiline: true }\n : {}),\n };\n return withCompanionSubmit(element, input, context);\n }\n case \"DatePicker\": {\n const name = asString(props[\"name\"]);\n const label = asString(props[\"label\"]);\n const rawValue = props[\"value\"];\n const value =\n typeof rawValue === \"string\" && DATE_PATTERN.test(rawValue)\n ? rawValue\n : undefined;\n const rawMin = props[\"min\"];\n const min =\n typeof rawMin === \"string\" && DATE_PATTERN.test(rawMin)\n ? rawMin\n : undefined;\n const rawMax = props[\"max\"];\n const max =\n typeof rawMax === \"string\" && DATE_PATTERN.test(rawMax)\n ? rawMax\n : undefined;\n const input: TeamsCardElement = {\n type: \"Input.Date\",\n id: reservedSafeId(name || \"datepicker\", \"DatePicker\", context),\n ...(label ? { label } : {}),\n ...(value !== undefined ? { value } : {}),\n ...(min !== undefined ? { min } : {}),\n ...(max !== undefined ? { max } : {}),\n };\n return withCompanionSubmit(element, input, context);\n }\n case \"Form\":\n return [\n ...convertSequence(element.children, context, depth + 1),\n {\n type: \"ActionSet\",\n actions: [buildSubmitAction(\"Submit\", element.action)],\n },\n ];\n case \"Card\": {\n const titleText = asString(props[\"title\"]);\n const items: TeamsCardElement[] = [];\n if (titleText) {\n items.push(\n textBlock(titleText, {\n size: \"large\",\n weight: \"bolder\",\n style: \"heading\",\n }),\n );\n }\n items.push(...convertSequence(element.children, context, depth + 1));\n const container: TeamsContainer = {\n type: \"Container\",\n style: \"default\",\n items,\n };\n const actionSet = cardFooterActionSet(props);\n return actionSet !== undefined ? [container, actionSet] : [container];\n }\n case \"Col\":\n case \"Box\":\n return [\n {\n type: \"Container\",\n items: convertSequence(element.children, context, depth + 1),\n },\n ];\n case \"Row\": {\n const children = normalizedList(element.children);\n if (children.length > 3) {\n warn(context, \"advisory\", \"Row\", \"Teams recommends at most 3 columns.\");\n }\n const columns: TeamsColumn[] = children.map((child) => ({\n type: \"Column\",\n width: \"auto\",\n items: convertSequence(child, context, depth + 1),\n }));\n return [{ type: \"ColumnSet\", columns }];\n }\n case \"ListView\": {\n const containers: TeamsContainer[] = [];\n let discarded = 0;\n for (const child of normalizedList(element.children)) {\n if (isElement(child) && child.type === \"ListViewItem\") {\n containers.push(convertListViewItem(child, context, depth + 1));\n continue;\n }\n if (discardedChild(child, context, depth + 1)) discarded += 1;\n }\n if (discarded > 0) {\n warn(\n context,\n \"dropped\",\n \"ListView\",\n `${discarded} non-item ${discarded === 1 ? \"child was\" : \"children were\"} dropped.`,\n );\n }\n return containers.map((container, index) =>\n index > 0 ? { ...container, separator: true } : container,\n );\n }\n case \"ListViewItem\":\n return [convertListViewItem(element, context, depth)];\n case \"Table\":\n return [convertTable(props, context)];\n case \"Alert\": {\n const tone = props[\"tone\"] ?? \"info\";\n const style =\n typeof tone === \"string\"\n ? (ALERT_STYLE_MAP[tone] ?? \"default\")\n : \"default\";\n const titleText = asString(props[\"title\"]);\n const description = asString(props[\"description\"]);\n const items: TeamsCardElement[] = [];\n if (titleText) items.push(textBlock(titleText, { weight: \"bolder\" }));\n if (description) items.push(textBlock(description));\n return [{ type: \"Container\", style, items }];\n }\n case \"Carousel\": {\n warn(\n context,\n \"fallback\",\n \"Carousel\",\n \"A carousel was rendered as sequential cards because it is not at the root.\",\n );\n const cards: NormalizedUIElement[] = [];\n let droppedCards = 0;\n for (const child of normalizedList(element.children)) {\n if (isElement(child) && child.type === \"Card\") {\n cards.push(child);\n continue;\n }\n if (discardedChild(child, context, depth + 1)) droppedCards += 1;\n }\n if (droppedCards > 0) {\n warn(\n context,\n \"dropped\",\n \"Carousel\",\n `${droppedCards} non-card ${droppedCards === 1 ? \"child was\" : \"children were\"} dropped.`,\n );\n }\n return cards.flatMap((card) => convertElement(card, context, depth + 1));\n }\n case \"Chart\":\n warn(\n context,\n \"dropped\",\n \"Chart\",\n \"Chart was replaced by a Teams omission note.\",\n );\n return [\n textBlock(\"Chart omitted on Teams.\", { isSubtle: true, size: \"small\" }),\n ];\n default:\n warn(\n context,\n \"dropped\",\n element.type,\n \"Unknown component type was dropped.\",\n );\n return [];\n }\n}\n\n/**\n * Walks a normalized sequence into card body elements. Nested arrays are\n * flattened into one flat sibling sequence first (via {@link normalizedList}),\n * so a `Divider`/`Fact`/`Button` run merges correctly even when the model\n * wrapped some of its siblings in their own array. Consecutive `Fact`\n * siblings merge into one FactSet and consecutive `Button` siblings merge\n * into one ActionSet; a `Divider`/`Spacer` emits nothing itself but sets\n * `separator`/`spacing` on the next emitted sibling (a trailing or orphan\n * one is dropped silently, since there is no sibling left to carry it).\n * `depth` advances by exactly one per element-nesting level: this call does\n * not itself add a level, since flattening a sibling array or converting a\n * sibling element is not a descent; only a container's own recursive\n * `convertSequence(children, depth + 1)` call is.\n */\nexport function convertSequence(\n node: NormalizedUINode | undefined,\n context: ConversionContext,\n depth: number,\n): TeamsCardElement[] {\n if (node === undefined || node === null || depth > MAX_TRAVERSAL_DEPTH) {\n return [];\n }\n const nodes = normalizedList(node);\n const items: TeamsCardElement[] = [];\n let pendingSeparator = false;\n let pendingSpacing = false;\n\n const emit = (converted: TeamsCardElement[]) => {\n const [first, ...rest] = converted;\n if (first === undefined) return;\n items.push(applyPending(first, pendingSeparator, pendingSpacing), ...rest);\n pendingSeparator = false;\n pendingSpacing = false;\n };\n\n for (let index = 0; index < nodes.length;) {\n const current = nodes[index];\n if (current === undefined || current === null) {\n index += 1;\n continue;\n }\n if (isElement(current) && current.type === \"Divider\") {\n pendingSeparator = true;\n index += 1;\n continue;\n }\n if (isElement(current) && current.type === \"Spacer\") {\n pendingSpacing = true;\n index += 1;\n continue;\n }\n if (isElement(current) && current.type === \"Fact\") {\n const { run: facts, next } = takeRun(\n nodes,\n index,\n (candidate) => candidate.type === \"Fact\",\n );\n index = next;\n emit([convertFacts(facts)]);\n continue;\n }\n if (isElement(current) && current.type === \"Button\") {\n const { run: buttons, next } = takeRun(\n nodes,\n index,\n (candidate) => candidate.type === \"Button\",\n );\n index = next;\n emit([convertButtons(buttons, context)]);\n continue;\n }\n if (typeof current === \"string\" || typeof current === \"number\") {\n emit([textBlock(String(current))]);\n } else {\n emit(convertElement(current as NormalizedUIElement, context, depth));\n }\n index += 1;\n }\n return items;\n}\n\n/** Builds a full card (schema envelope plus body) from an already-normalized root, checking the soft payload budget. */\nexport function convertRootToCard(\n root: NormalizedUINode | readonly NormalizedUINode[],\n context: ConversionContext,\n): TeamsAdaptiveCard {\n context.usedInputIds = new Set();\n const body = convertSequence(root, context, 0);\n const card = buildCard(body);\n const size = utf8ByteLength(JSON.stringify(card));\n if (size > PAYLOAD_SOFT_CAP) {\n warn(\n context,\n \"advisory\",\n \"Root\",\n `the card is ${size} bytes, over the ${PAYLOAD_SOFT_CAP}-byte soft budget kept below Teams' 100 KB bot message limit.`,\n );\n }\n return card;\n}\n\n/**\n * Converts a generative-ui tree into a Microsoft Teams Adaptive Card and\n * non-fatal conversion warnings. Sizes, weights, and colors map to Adaptive\n * Card's semantic enums rather than raw values. An Input/Select/RadioGroup/\n * CheckboxGroup/Checkbox/Slider/DatePicker whose id would be the reserved\n * {@link RESERVED_INPUT_ID} is renamed with a warning (see `decodeSubmitData`).\n * Never throws: an unknown `$type` is skipped with a \"dropped\" warning, and a\n * malformed input resolves to an empty card plus a \"dropped\" warning instead\n * of throwing.\n */\nexport function toAdaptiveCard(\n node: unknown,\n _options?: ToAdaptiveCardOptions,\n): AdaptiveCardResult {\n const context: ConversionContext = { warnings: [], usedInputIds: new Set() };\n try {\n const bounded = boundSpec(node, (reason) =>\n warn(context, \"clamped\", \"Root\", clampReasonDetail(reason)),\n );\n const { root } = normalizeSpec(bounded as never);\n return {\n card: convertRootToCard(root, context),\n warnings: context.warnings,\n };\n } catch {\n return {\n card: buildCard([]),\n warnings: [\n {\n code: \"dropped\",\n component: \"Root\",\n detail: \"Input could not be converted.\",\n },\n ],\n };\n }\n}\n"],"mappings":";;;;;;;;AAqDA,MAAM,YAAY,UAChB,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAErE,MAAM,YAAY,UAChB,OAAO,UAAU,WAAW,QAAQ;AAEtC,MAAM,kBAAkB,UACtB,OAAO,UAAU,YAAY,OAAO,SAAS,KAAK,IAAI,QAAQ,KAAA;AAEhE,MAAM,eAAe;AAErB,MAAM,gCAAgB,IAAI,IAAI;CAC5B;CACA;CACA;CACA;CACA;AACF,CAAC;AACD,MAAM,iBAAiB,UACrB,OAAO,UAAU,YAAY,cAAc,IAAI,KAAK;AAEtD,MAAM,iCAAiB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U,OAAO,OAAO,CAAC,CAAC,CAAC;OAEjC,KAAK,eAAe,SAAgC,SAAS,KAAK,CAAC;EAErE,SAAS;CACX;CACA,OAAO;AACT;;AAGA,SAAgB,kBACd,MACA,SACmB;CACnB,QAAQ,+BAAe,IAAI,IAAI;CAC/B,MAAM,OAAO,gBAAgB,MAAM,SAAS,CAAC;CAC7C,MAAM,OAAO,UAAU,IAAI;CAC3B,MAAM,OAAO,eAAe,KAAK,UAAU,IAAI,CAAC;CAChD,IAAI,OAAA,KACF,KACE,SACA,YACA,QACA,eAAe,KAAK,mBAAmB,iBAAiB,8DAC1D;CAEF,OAAO;AACT;;;;;;;;;;;AAYA,SAAgB,eACd,MACA,UACoB;CACpB,MAAM,UAA6B;EAAE,UAAU,CAAC;EAAG,8BAAc,IAAI,IAAI;CAAE;CAC3E,IAAI;EACF,MAAM,UAAU,UAAU,OAAO,WAC/B,KAAK,SAAS,WAAW,QAAQ,kBAAkB,MAAM,CAAC,CAC5D;EACA,MAAM,EAAE,SAAS,cAAc,OAAgB;EAC/C,OAAO;GACL,MAAM,kBAAkB,MAAM,OAAO;GACrC,UAAU,QAAQ;EACpB;CACF,QAAQ;EACN,OAAO;GACL,MAAM,UAAU,CAAC,CAAC;GAClB,UAAU,CACR;IACE,MAAM;IACN,WAAW;IACX,QAAQ;GACV,CACF;EACF;CACF;AACF"}
|
package/dist/teams/types.d.ts
CHANGED
|
@@ -89,11 +89,12 @@ export interface TeamsInputChoice {
|
|
|
89
89
|
readonly title: string;
|
|
90
90
|
readonly value: string;
|
|
91
91
|
}
|
|
92
|
-
/** A dropdown (`compact`) or
|
|
92
|
+
/** A dropdown (`compact`), radio group (`expanded`), or checkbox group (`expanded` with `isMultiSelect`) input. */
|
|
93
93
|
export interface TeamsInputChoiceSet {
|
|
94
94
|
readonly type: "Input.ChoiceSet";
|
|
95
95
|
readonly id: string;
|
|
96
96
|
readonly style: "compact" | "expanded";
|
|
97
|
+
readonly isMultiSelect?: true;
|
|
97
98
|
readonly choices: readonly TeamsInputChoice[];
|
|
98
99
|
readonly placeholder?: string;
|
|
99
100
|
readonly label?: string;
|
|
@@ -116,8 +117,10 @@ export interface TeamsInputToggle {
|
|
|
116
117
|
export interface TeamsInputText {
|
|
117
118
|
readonly type: "Input.Text";
|
|
118
119
|
readonly id: string;
|
|
120
|
+
readonly style?: "password";
|
|
119
121
|
readonly label?: string;
|
|
120
122
|
readonly placeholder?: string;
|
|
123
|
+
readonly value?: string;
|
|
121
124
|
readonly isMultiline?: true;
|
|
122
125
|
readonly separator?: true;
|
|
123
126
|
readonly spacing?: "large";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/teams/types.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,YAAY,CAAC;AAExE,wEAAwE;AACxE,MAAM,MAAM,mBAAmB,GAC3B,SAAS,GACT,UAAU,GACV,MAAM,GACN,WAAW,GACX,SAAS,GACT,QAAQ,CAAC;AAEb,wEAAwE;AACxE,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,IAAI,CAAC,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC;IAC3B,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC;IACzB,QAAQ,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,wBAAwB;AACxB,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,OAAO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AAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,WAAW,EAAE,yCAAyC,CAAC;IAChE,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAC;CACrC;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;IAC/D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,kJAAkJ;AAClJ,MAAM,WAAW,qBAAqB;CAAG;AAEzC,0EAA0E;AAC1E,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,sBAAsB,EAAE,CAAC;CAC7C;AAED,qFAAqF;AACrF,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,WAAW,EAAE,mBAAmB,EAAE,CAAC;IAC5C,QAAQ,CAAC,gBAAgB,CAAC,EAAE,UAAU,CAAC;IACvC,QAAQ,CAAC,QAAQ,EAAE,sBAAsB,EAAE,CAAC;CAC7C"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
1
2
|
import { z } from "zod";
|
|
3
|
+
type CarouselRenderProps = {
|
|
4
|
+
label?: string;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
};
|
|
7
|
+
declare function CarouselRender({ label, children }: CarouselRenderProps): React.JSX.Element;
|
|
2
8
|
export declare const alertVocabulary: {
|
|
3
9
|
Alert: {
|
|
4
10
|
description: string;
|
|
@@ -12,14 +18,15 @@ export declare const alertVocabulary: {
|
|
|
12
18
|
warning: "warning";
|
|
13
19
|
}>>;
|
|
14
20
|
}, z.core.$strip>;
|
|
15
|
-
render: ({ title, description, tone, children }: any) =>
|
|
21
|
+
render: ({ title, description, tone, children }: any) => React.JSX.Element;
|
|
16
22
|
};
|
|
17
23
|
Carousel: {
|
|
18
24
|
description: string;
|
|
19
25
|
properties: z.ZodObject<{
|
|
20
26
|
label: z.ZodOptional<z.ZodString>;
|
|
21
27
|
}, z.core.$strip>;
|
|
22
|
-
render:
|
|
28
|
+
render: typeof CarouselRender;
|
|
23
29
|
};
|
|
24
30
|
};
|
|
31
|
+
export {};
|
|
25
32
|
//# sourceMappingURL=alert.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../src/vocabulary/alert.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../src/vocabulary/alert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,KAAK,mBAAmB,GAAG;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAQF,iBAAS,cAAc,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,mBAAmB,qBAyJ/D;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;CA0CG,CAAC"}
|
package/dist/vocabulary/alert.js
CHANGED
|
@@ -1,10 +1,124 @@
|
|
|
1
1
|
import { ALERT_TONES } from "../ir.js";
|
|
2
2
|
import { toTextContent } from "./toTextContent.js";
|
|
3
|
-
import
|
|
3
|
+
import * as React from "react";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
//#region src/vocabulary/alert.tsx
|
|
7
7
|
const MAX_CARDS = 10;
|
|
8
|
+
function CarouselRender({ label, children }) {
|
|
9
|
+
const carouselId = React.useId();
|
|
10
|
+
const carouselRef = React.useRef(null);
|
|
11
|
+
const [measurement, setMeasurement] = React.useState(void 0);
|
|
12
|
+
const cards = React.Children.toArray(children).slice(0, MAX_CARDS);
|
|
13
|
+
const n = cards.length;
|
|
14
|
+
React.useEffect(() => {
|
|
15
|
+
const carousel = carouselRef.current;
|
|
16
|
+
if (!carousel) return;
|
|
17
|
+
const measure = () => {
|
|
18
|
+
const maxScrollLeft = Math.max(carousel.scrollWidth - carousel.clientWidth, 0);
|
|
19
|
+
const position = Math.abs(carousel.scrollLeft);
|
|
20
|
+
const next = {
|
|
21
|
+
overflows: maxScrollLeft > 0,
|
|
22
|
+
atStart: position <= 1,
|
|
23
|
+
atEnd: position >= maxScrollLeft - 1
|
|
24
|
+
};
|
|
25
|
+
setMeasurement((current) => current?.overflows === next.overflows && current.atStart === next.atStart && current.atEnd === next.atEnd ? current : next);
|
|
26
|
+
};
|
|
27
|
+
measure();
|
|
28
|
+
carousel.addEventListener("scroll", measure, { passive: true });
|
|
29
|
+
window.addEventListener("resize", measure);
|
|
30
|
+
const resizeObserver = typeof ResizeObserver === "undefined" ? void 0 : new ResizeObserver(measure);
|
|
31
|
+
resizeObserver?.observe(carousel);
|
|
32
|
+
carousel.querySelectorAll(":scope > [data-aui=\"carousel-slide\"]").forEach((slide) => resizeObserver?.observe(slide));
|
|
33
|
+
return () => {
|
|
34
|
+
carousel.removeEventListener("scroll", measure);
|
|
35
|
+
window.removeEventListener("resize", measure);
|
|
36
|
+
resizeObserver?.disconnect();
|
|
37
|
+
};
|
|
38
|
+
}, [n]);
|
|
39
|
+
const move = (direction) => {
|
|
40
|
+
const carousel = carouselRef.current;
|
|
41
|
+
if (!carousel) return;
|
|
42
|
+
const rtl = getComputedStyle(carousel).direction === "rtl";
|
|
43
|
+
const startOf = (element) => {
|
|
44
|
+
const rect = element.getBoundingClientRect();
|
|
45
|
+
return rtl ? -rect.right : rect.left;
|
|
46
|
+
};
|
|
47
|
+
const edge = startOf(carousel);
|
|
48
|
+
const starts = Array.from(carousel.querySelectorAll(":scope > [data-aui=\"carousel-slide\"]"), startOf);
|
|
49
|
+
let current = 0;
|
|
50
|
+
starts.forEach((start, index) => {
|
|
51
|
+
if (Math.abs(start - edge) < Math.abs((starts[current] ?? start) - edge)) current = index;
|
|
52
|
+
});
|
|
53
|
+
const origin = starts[current];
|
|
54
|
+
const target = starts[current + (direction === "next" ? 1 : -1)];
|
|
55
|
+
if (origin === void 0 || target === void 0) return;
|
|
56
|
+
carousel.scrollBy({ left: rtl ? origin - target : target - origin });
|
|
57
|
+
};
|
|
58
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
59
|
+
"data-aui": "carousel-frame",
|
|
60
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
61
|
+
ref: carouselRef,
|
|
62
|
+
id: carouselId,
|
|
63
|
+
"data-aui": "carousel",
|
|
64
|
+
role: label ? "region" : "group",
|
|
65
|
+
"aria-roledescription": "carousel",
|
|
66
|
+
"aria-label": label,
|
|
67
|
+
tabIndex: 0,
|
|
68
|
+
children: cards.map((card, i) => /* @__PURE__ */ jsx("div", {
|
|
69
|
+
"data-aui": "carousel-slide",
|
|
70
|
+
role: "group",
|
|
71
|
+
"aria-roledescription": "slide",
|
|
72
|
+
"aria-label": `${i + 1} of ${n}`,
|
|
73
|
+
children: card
|
|
74
|
+
}, i))
|
|
75
|
+
}), measurement?.overflows ? /* @__PURE__ */ jsxs("div", {
|
|
76
|
+
"data-aui": "carousel-controls",
|
|
77
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
78
|
+
type: "button",
|
|
79
|
+
"data-aui": "carousel-prev",
|
|
80
|
+
"aria-label": "Previous slide",
|
|
81
|
+
"aria-controls": carouselId,
|
|
82
|
+
disabled: measurement.atStart,
|
|
83
|
+
onClick: () => move("previous"),
|
|
84
|
+
children: /* @__PURE__ */ jsx("svg", {
|
|
85
|
+
"aria-hidden": "true",
|
|
86
|
+
viewBox: "0 0 24 24",
|
|
87
|
+
width: "16",
|
|
88
|
+
height: "16",
|
|
89
|
+
fill: "none",
|
|
90
|
+
stroke: "currentColor",
|
|
91
|
+
strokeWidth: "2",
|
|
92
|
+
strokeLinecap: "round",
|
|
93
|
+
strokeLinejoin: "round",
|
|
94
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
95
|
+
d: "M9 5l7 7-7 7",
|
|
96
|
+
transform: "translate(24 0) scale(-1 1)"
|
|
97
|
+
})
|
|
98
|
+
})
|
|
99
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
100
|
+
type: "button",
|
|
101
|
+
"data-aui": "carousel-next",
|
|
102
|
+
"aria-label": "Next slide",
|
|
103
|
+
"aria-controls": carouselId,
|
|
104
|
+
disabled: measurement.atEnd,
|
|
105
|
+
onClick: () => move("next"),
|
|
106
|
+
children: /* @__PURE__ */ jsx("svg", {
|
|
107
|
+
"aria-hidden": "true",
|
|
108
|
+
viewBox: "0 0 24 24",
|
|
109
|
+
width: "16",
|
|
110
|
+
height: "16",
|
|
111
|
+
fill: "none",
|
|
112
|
+
stroke: "currentColor",
|
|
113
|
+
strokeWidth: "2",
|
|
114
|
+
strokeLinecap: "round",
|
|
115
|
+
strokeLinejoin: "round",
|
|
116
|
+
children: /* @__PURE__ */ jsx("path", { d: "M9 5l7 7-7 7" })
|
|
117
|
+
})
|
|
118
|
+
})]
|
|
119
|
+
}) : null]
|
|
120
|
+
});
|
|
121
|
+
}
|
|
8
122
|
const alertVocabulary = {
|
|
9
123
|
Alert: {
|
|
10
124
|
description: "A highlighted message conveying urgency. `tone` drives the severity.",
|
|
@@ -37,24 +151,7 @@ const alertVocabulary = {
|
|
|
37
151
|
Carousel: {
|
|
38
152
|
description: "A horizontally scrollable group of `Card` children (max 10). Set `label` for an accessible name.",
|
|
39
153
|
properties: z.object({ label: z.string().optional().describe("Accessible label for the carousel.") }),
|
|
40
|
-
render:
|
|
41
|
-
const cards = Children.toArray(children).slice(0, MAX_CARDS);
|
|
42
|
-
const n = cards.length;
|
|
43
|
-
return /* @__PURE__ */ jsx("div", {
|
|
44
|
-
"data-aui": "carousel",
|
|
45
|
-
role: label ? "region" : "group",
|
|
46
|
-
"aria-roledescription": "carousel",
|
|
47
|
-
"aria-label": label,
|
|
48
|
-
tabIndex: 0,
|
|
49
|
-
children: cards.map((card, i) => /* @__PURE__ */ jsx("div", {
|
|
50
|
-
"data-aui": "carousel-slide",
|
|
51
|
-
role: "group",
|
|
52
|
-
"aria-roledescription": "slide",
|
|
53
|
-
"aria-label": `${i + 1} of ${n}`,
|
|
54
|
-
children: card
|
|
55
|
-
}, i))
|
|
56
|
-
});
|
|
57
|
-
}
|
|
154
|
+
render: CarouselRender
|
|
58
155
|
}
|
|
59
156
|
};
|
|
60
157
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.js","names":[],"sources":["../../src/vocabulary/alert.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"alert.js","names":[],"sources":["../../src/vocabulary/alert.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { z } from \"zod\";\nimport type { GenerativeUILibrary } from \"../types\";\nimport { ALERT_TONES } from \"../ir\";\nimport { toTextContent } from \"./toTextContent\";\n\nconst MAX_CARDS = 10;\n\ntype CarouselRenderProps = {\n label?: string;\n children?: React.ReactNode;\n};\n\ntype CarouselMeasurement = {\n overflows: boolean;\n atStart: boolean;\n atEnd: boolean;\n};\n\nfunction CarouselRender({ label, children }: CarouselRenderProps) {\n const carouselId = React.useId();\n const carouselRef = React.useRef<HTMLDivElement>(null);\n const [measurement, setMeasurement] = React.useState<\n CarouselMeasurement | undefined\n >(undefined);\n const cards = React.Children.toArray(children).slice(0, MAX_CARDS);\n const n = cards.length;\n\n React.useEffect(() => {\n const carousel = carouselRef.current;\n if (!carousel) return;\n\n const measure = () => {\n const maxScrollLeft = Math.max(\n carousel.scrollWidth - carousel.clientWidth,\n 0,\n );\n const position = Math.abs(carousel.scrollLeft);\n const next = {\n overflows: maxScrollLeft > 0,\n atStart: position <= 1,\n atEnd: position >= maxScrollLeft - 1,\n };\n setMeasurement((current) =>\n current?.overflows === next.overflows &&\n current.atStart === next.atStart &&\n current.atEnd === next.atEnd\n ? current\n : next,\n );\n };\n\n measure();\n carousel.addEventListener(\"scroll\", measure, { passive: true });\n window.addEventListener(\"resize\", measure);\n const resizeObserver =\n typeof ResizeObserver === \"undefined\"\n ? undefined\n : new ResizeObserver(measure);\n resizeObserver?.observe(carousel);\n carousel\n .querySelectorAll(':scope > [data-aui=\"carousel-slide\"]')\n .forEach((slide) => resizeObserver?.observe(slide));\n\n return () => {\n carousel.removeEventListener(\"scroll\", measure);\n window.removeEventListener(\"resize\", measure);\n resizeObserver?.disconnect();\n };\n }, [n]);\n\n const move = (direction: \"previous\" | \"next\") => {\n const carousel = carouselRef.current;\n if (!carousel) return;\n\n const rtl = getComputedStyle(carousel).direction === \"rtl\";\n const startOf = (element: Element) => {\n const rect = element.getBoundingClientRect();\n return rtl ? -rect.right : rect.left;\n };\n const edge = startOf(carousel);\n const starts = Array.from(\n carousel.querySelectorAll(':scope > [data-aui=\"carousel-slide\"]'),\n startOf,\n );\n let current = 0;\n starts.forEach((start, index) => {\n if (\n Math.abs(start - edge) < Math.abs((starts[current] ?? start) - edge)\n ) {\n current = index;\n }\n });\n const origin = starts[current];\n const target = starts[current + (direction === \"next\" ? 1 : -1)];\n if (origin === undefined || target === undefined) return;\n carousel.scrollBy({ left: rtl ? origin - target : target - origin });\n };\n\n return (\n <div data-aui=\"carousel-frame\">\n <div\n ref={carouselRef}\n id={carouselId}\n data-aui=\"carousel\"\n role={label ? \"region\" : \"group\"}\n aria-roledescription=\"carousel\"\n aria-label={label}\n tabIndex={0}\n >\n {cards.map((card, i) => (\n <div\n key={i}\n data-aui=\"carousel-slide\"\n role=\"group\"\n aria-roledescription=\"slide\"\n aria-label={`${i + 1} of ${n}`}\n >\n {card}\n </div>\n ))}\n </div>\n {measurement?.overflows ? (\n <div data-aui=\"carousel-controls\">\n <button\n type=\"button\"\n data-aui=\"carousel-prev\"\n aria-label=\"Previous slide\"\n aria-controls={carouselId}\n disabled={measurement.atStart}\n onClick={() => move(\"previous\")}\n >\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n width=\"16\"\n height=\"16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M9 5l7 7-7 7\" transform=\"translate(24 0) scale(-1 1)\" />\n </svg>\n </button>\n <button\n type=\"button\"\n data-aui=\"carousel-next\"\n aria-label=\"Next slide\"\n aria-controls={carouselId}\n disabled={measurement.atEnd}\n onClick={() => move(\"next\")}\n >\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n width=\"16\"\n height=\"16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M9 5l7 7-7 7\" />\n </svg>\n </button>\n </div>\n ) : null}\n </div>\n );\n}\n\nexport const alertVocabulary = {\n Alert: {\n description:\n \"A highlighted message conveying urgency. `tone` drives the severity.\",\n properties: z.object({\n title: z.string().optional().describe(\"Alert title.\"),\n description: z\n .string()\n .optional()\n .describe(\"Supporting description text.\"),\n tone: z\n .enum(ALERT_TONES)\n .optional()\n .describe(\"Severity tone; defaults to `info`.\"),\n }),\n render: ({ title, description, tone, children }) => {\n const alertTitle = toTextContent(title);\n const alertDescription = toTextContent(description);\n return (\n <div data-aui=\"alert\" data-aui-tone={tone ?? \"info\"} role=\"alert\">\n {alertTitle ? (\n <header data-aui=\"alert-title\">{alertTitle}</header>\n ) : null}\n {alertDescription ? (\n <p data-aui=\"alert-desc\">{alertDescription}</p>\n ) : null}\n {children}\n </div>\n );\n },\n },\n Carousel: {\n description:\n \"A horizontally scrollable group of `Card` children (max 10). Set `label` for an accessible name.\",\n properties: z.object({\n label: z\n .string()\n .optional()\n .describe(\"Accessible label for the carousel.\"),\n }),\n render: CarouselRender,\n },\n} satisfies GenerativeUILibrary;\n"],"mappings":";;;;;;AAMA,MAAM,YAAY;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