chore(a2ui): ignore lit dist build output

This commit is contained in:
Peter Steinberger
2025-12-17 19:13:40 +00:00
parent db7eeee07b
commit e275ba8d2e
223 changed files with 3 additions and 10129 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1,752 +0,0 @@
export * as Events from "./events/events.js";
export * as Types from "./types/types.js";
export * as Primitives from "./types/primitives.js";
export * as Styles from "./styles/index.js";
import * as Guards from "./data/guards.js";
import { create as createSignalA2uiMessageProcessor } from "./data/signal-model-processor.js";
import { A2uiMessageProcessor } from "./data/model-processor.js";
export declare const Data: {
createSignalA2uiMessageProcessor: typeof createSignalA2uiMessageProcessor;
A2uiMessageProcessor: typeof A2uiMessageProcessor;
Guards: typeof Guards;
};
export declare const Schemas: {
A2UIClientEventMessage: {
title: string;
description: string;
type: string;
additionalProperties: boolean;
properties: {
beginRendering: {
type: string;
description: string;
additionalProperties: boolean;
properties: {
surfaceId: {
type: string;
description: string;
};
root: {
type: string;
description: string;
};
styles: {
type: string;
description: string;
additionalProperties: boolean;
properties: {
font: {
type: string;
description: string;
};
primaryColor: {
type: string;
description: string;
pattern: string;
};
};
};
};
required: string[];
};
surfaceUpdate: {
type: string;
description: string;
additionalProperties: boolean;
properties: {
surfaceId: {
type: string;
description: string;
};
components: {
type: string;
description: string;
minItems: number;
items: {
type: string;
description: string;
additionalProperties: boolean;
properties: {
id: {
type: string;
description: string;
};
weight: {
type: string;
description: string;
};
component: {
type: string;
description: string;
additionalProperties: boolean;
properties: {
Text: {
type: string;
additionalProperties: boolean;
properties: {
text: {
type: string;
description: string;
additionalProperties: boolean;
properties: {
literalString: {
type: string;
};
path: {
type: string;
};
};
};
usageHint: {
type: string;
description: string;
enum: string[];
};
};
required: string[];
};
Image: {
type: string;
additionalProperties: boolean;
properties: {
url: {
type: string;
description: string;
additionalProperties: boolean;
properties: {
literalString: {
type: string;
};
path: {
type: string;
};
};
};
fit: {
type: string;
description: string;
enum: string[];
};
usageHint: {
type: string;
description: string;
enum: string[];
};
};
required: string[];
};
Icon: {
type: string;
additionalProperties: boolean;
properties: {
name: {
type: string;
description: string;
additionalProperties: boolean;
properties: {
literalString: {
type: string;
enum: string[];
};
path: {
type: string;
};
};
};
};
required: string[];
};
Video: {
type: string;
additionalProperties: boolean;
properties: {
url: {
type: string;
description: string;
additionalProperties: boolean;
properties: {
literalString: {
type: string;
};
path: {
type: string;
};
};
};
};
required: string[];
};
AudioPlayer: {
type: string;
additionalProperties: boolean;
properties: {
url: {
type: string;
description: string;
additionalProperties: boolean;
properties: {
literalString: {
type: string;
};
path: {
type: string;
};
};
};
description: {
type: string;
description: string;
additionalProperties: boolean;
properties: {
literalString: {
type: string;
};
path: {
type: string;
};
};
};
};
required: string[];
};
Row: {
type: string;
additionalProperties: boolean;
properties: {
children: {
type: string;
description: string;
additionalProperties: boolean;
properties: {
explicitList: {
type: string;
items: {
type: string;
};
};
template: {
type: string;
description: string;
additionalProperties: boolean;
properties: {
componentId: {
type: string;
};
dataBinding: {
type: string;
};
};
required: string[];
};
};
};
distribution: {
type: string;
description: string;
enum: string[];
};
alignment: {
type: string;
description: string;
enum: string[];
};
};
required: string[];
};
Column: {
type: string;
additionalProperties: boolean;
properties: {
children: {
type: string;
description: string;
additionalProperties: boolean;
properties: {
explicitList: {
type: string;
items: {
type: string;
};
};
template: {
type: string;
description: string;
additionalProperties: boolean;
properties: {
componentId: {
type: string;
};
dataBinding: {
type: string;
};
};
required: string[];
};
};
};
distribution: {
type: string;
description: string;
enum: string[];
};
alignment: {
type: string;
description: string;
enum: string[];
};
};
required: string[];
};
List: {
type: string;
additionalProperties: boolean;
properties: {
children: {
type: string;
description: string;
additionalProperties: boolean;
properties: {
explicitList: {
type: string;
items: {
type: string;
};
};
template: {
type: string;
description: string;
additionalProperties: boolean;
properties: {
componentId: {
type: string;
};
dataBinding: {
type: string;
};
};
required: string[];
};
};
};
direction: {
type: string;
description: string;
enum: string[];
};
alignment: {
type: string;
description: string;
enum: string[];
};
};
required: string[];
};
Card: {
type: string;
additionalProperties: boolean;
properties: {
child: {
type: string;
description: string;
};
};
required: string[];
};
Tabs: {
type: string;
additionalProperties: boolean;
properties: {
tabItems: {
type: string;
description: string;
items: {
type: string;
additionalProperties: boolean;
properties: {
title: {
type: string;
description: string;
additionalProperties: boolean;
properties: {
literalString: {
type: string;
};
path: {
type: string;
};
};
};
child: {
type: string;
};
};
required: string[];
};
};
};
required: string[];
};
Divider: {
type: string;
additionalProperties: boolean;
properties: {
axis: {
type: string;
description: string;
enum: string[];
};
};
};
Modal: {
type: string;
additionalProperties: boolean;
properties: {
entryPointChild: {
type: string;
description: string;
};
contentChild: {
type: string;
description: string;
};
};
required: string[];
};
Button: {
type: string;
additionalProperties: boolean;
properties: {
child: {
type: string;
description: string;
};
primary: {
type: string;
description: string;
};
action: {
type: string;
description: string;
additionalProperties: boolean;
properties: {
name: {
type: string;
};
context: {
type: string;
items: {
type: string;
additionalProperties: boolean;
properties: {
key: {
type: string;
};
value: {
type: string;
description: string;
additionalProperties: boolean;
properties: {
path: {
type: string;
};
literalString: {
type: string;
};
literalNumber: {
type: string;
};
literalBoolean: {
type: string;
};
};
};
};
required: string[];
};
};
};
required: string[];
};
};
required: string[];
};
CheckBox: {
type: string;
additionalProperties: boolean;
properties: {
label: {
type: string;
description: string;
additionalProperties: boolean;
properties: {
literalString: {
type: string;
};
path: {
type: string;
};
};
};
value: {
type: string;
description: string;
additionalProperties: boolean;
properties: {
literalBoolean: {
type: string;
};
path: {
type: string;
};
};
};
};
required: string[];
};
TextField: {
type: string;
additionalProperties: boolean;
properties: {
label: {
type: string;
description: string;
additionalProperties: boolean;
properties: {
literalString: {
type: string;
};
path: {
type: string;
};
};
};
text: {
type: string;
description: string;
additionalProperties: boolean;
properties: {
literalString: {
type: string;
};
path: {
type: string;
};
};
};
textFieldType: {
type: string;
description: string;
enum: string[];
};
validationRegexp: {
type: string;
description: string;
};
};
required: string[];
};
DateTimeInput: {
type: string;
additionalProperties: boolean;
properties: {
value: {
type: string;
description: string;
additionalProperties: boolean;
properties: {
literalString: {
type: string;
};
path: {
type: string;
};
};
};
enableDate: {
type: string;
description: string;
};
enableTime: {
type: string;
description: string;
};
outputFormat: {
type: string;
description: string;
};
};
required: string[];
};
MultipleChoice: {
type: string;
additionalProperties: boolean;
properties: {
selections: {
type: string;
description: string;
additionalProperties: boolean;
properties: {
literalArray: {
type: string;
items: {
type: string;
};
};
path: {
type: string;
};
};
};
options: {
type: string;
description: string;
items: {
type: string;
additionalProperties: boolean;
properties: {
label: {
type: string;
description: string;
additionalProperties: boolean;
properties: {
literalString: {
type: string;
};
path: {
type: string;
};
};
};
value: {
type: string;
description: string;
};
};
required: string[];
};
};
maxAllowedSelections: {
type: string;
description: string;
};
};
required: string[];
};
Slider: {
type: string;
additionalProperties: boolean;
properties: {
value: {
type: string;
description: string;
additionalProperties: boolean;
properties: {
literalNumber: {
type: string;
};
path: {
type: string;
};
};
};
minValue: {
type: string;
description: string;
};
maxValue: {
type: string;
description: string;
};
};
required: string[];
};
};
};
};
required: string[];
};
};
};
required: string[];
};
dataModelUpdate: {
type: string;
description: string;
additionalProperties: boolean;
properties: {
surfaceId: {
type: string;
description: string;
};
path: {
type: string;
description: string;
};
contents: {
type: string;
description: string;
items: {
type: string;
description: string;
additionalProperties: boolean;
properties: {
key: {
type: string;
description: string;
};
valueString: {
type: string;
};
valueNumber: {
type: string;
};
valueBoolean: {
type: string;
};
valueMap: {
description: string;
type: string;
items: {
type: string;
description: string;
additionalProperties: boolean;
properties: {
key: {
type: string;
};
valueString: {
type: string;
};
valueNumber: {
type: string;
};
valueBoolean: {
type: string;
};
};
required: string[];
};
};
};
required: string[];
};
};
};
required: string[];
};
deleteSurface: {
type: string;
description: string;
additionalProperties: boolean;
properties: {
surfaceId: {
type: string;
description: string;
};
};
required: string[];
};
};
};
};
//# sourceMappingURL=core.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/0.8/core.ts"],"names":[],"mappings":"AAgBA,OAAO,KA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEnB,CAAC"}

View File

@@ -1,32 +0,0 @@
/*
Copyright 2025 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
export * as Events from "./events/events.js";
export * as Types from "./types/types.js";
export * as Primitives from "./types/primitives.js";
export * as Styles from "./styles/index.js";
import * as Guards from "./data/guards.js";
import { create as createSignalA2uiMessageProcessor } from "./data/signal-model-processor.js";
import { A2uiMessageProcessor } from "./data/model-processor.js";
import A2UIClientEventMessage from "./schemas/server_to_client_with_standard_catalog.json" with { type: "json" };
export const Data = {
createSignalA2uiMessageProcessor,
A2uiMessageProcessor,
Guards,
};
export const Schemas = {
A2UIClientEventMessage,
};
//# sourceMappingURL=core.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../../src/0.8/core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,MAAM,IAAI,gCAAgC,EAAE,MAAM,kCAAkC,CAAC;AAC9F,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,sBAAsB,MAAM,uDAAuD,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAEjH,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,gCAAgC;IAChC,oBAAoB;IACpB,MAAM;CACP,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,sBAAsB;CACvB,CAAC"}

View File

@@ -1,24 +0,0 @@
import { ComponentArrayReference, ResolvedAudioPlayer, ResolvedButton, ResolvedCard, ResolvedCheckbox, ResolvedColumn, ResolvedDateTimeInput, ResolvedDivider, ResolvedIcon, ResolvedImage, ResolvedList, ResolvedModal, ResolvedMultipleChoice, ResolvedRow, ResolvedSlider, ResolvedTabs, ResolvedText, ResolvedTextField, ResolvedVideo, ValueMap } from "../types/types";
export declare function isValueMap(value: unknown): value is ValueMap;
export declare function isPath(key: string, value: unknown): value is string;
export declare function isObject(value: unknown): value is Record<string, unknown>;
export declare function isComponentArrayReference(value: unknown): value is ComponentArrayReference;
export declare function isResolvedAudioPlayer(props: unknown): props is ResolvedAudioPlayer;
export declare function isResolvedButton(props: unknown): props is ResolvedButton;
export declare function isResolvedCard(props: unknown): props is ResolvedCard;
export declare function isResolvedCheckbox(props: unknown): props is ResolvedCheckbox;
export declare function isResolvedColumn(props: unknown): props is ResolvedColumn;
export declare function isResolvedDateTimeInput(props: unknown): props is ResolvedDateTimeInput;
export declare function isResolvedDivider(props: unknown): props is ResolvedDivider;
export declare function isResolvedImage(props: unknown): props is ResolvedImage;
export declare function isResolvedIcon(props: unknown): props is ResolvedIcon;
export declare function isResolvedList(props: unknown): props is ResolvedList;
export declare function isResolvedModal(props: unknown): props is ResolvedModal;
export declare function isResolvedMultipleChoice(props: unknown): props is ResolvedMultipleChoice;
export declare function isResolvedRow(props: unknown): props is ResolvedRow;
export declare function isResolvedSlider(props: unknown): props is ResolvedSlider;
export declare function isResolvedTabs(props: unknown): props is ResolvedTabs;
export declare function isResolvedText(props: unknown): props is ResolvedText;
export declare function isResolvedTextField(props: unknown): props is ResolvedTextField;
export declare function isResolvedVideo(props: unknown): props is ResolvedVideo;
//# sourceMappingURL=guards.d.ts.map

View File

@@ -1 +0,0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OAAO,GAAG,KAAK,IAAI,eAAe,CAI1E;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAEtE;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAEpE;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAOpE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAQtE;AAED,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,sBAAsB,CAEjC;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAOlE;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAExE;AAYD,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAOpE;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAEpE;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,iBAAiB,CAE5B;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAEtE"}

View File

@@ -1,153 +0,0 @@
/*
Copyright 2025 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
export function isValueMap(value) {
return isObject(value) && "key" in value;
}
export function isPath(key, value) {
return key === "path" && typeof value === "string";
}
export function isObject(value) {
return typeof value === "object" && value !== null && !Array.isArray(value);
}
export function isComponentArrayReference(value) {
if (!isObject(value))
return false;
return "explicitList" in value || "template" in value;
}
function isStringValue(value) {
return (isObject(value) &&
("path" in value ||
("literal" in value && typeof value.literal === "string") ||
"literalString" in value));
}
function isNumberValue(value) {
return (isObject(value) &&
("path" in value ||
("literal" in value && typeof value.literal === "number") ||
"literalNumber" in value));
}
function isBooleanValue(value) {
return (isObject(value) &&
("path" in value ||
("literal" in value && typeof value.literal === "boolean") ||
"literalBoolean" in value));
}
function isAnyComponentNode(value) {
if (!isObject(value))
return false;
const hasBaseKeys = "id" in value && "type" in value && "properties" in value;
if (!hasBaseKeys)
return false;
return true;
}
export function isResolvedAudioPlayer(props) {
return isObject(props) && "url" in props && isStringValue(props.url);
}
export function isResolvedButton(props) {
return (isObject(props) &&
"child" in props &&
isAnyComponentNode(props.child) &&
"action" in props);
}
export function isResolvedCard(props) {
if (!isObject(props))
return false;
if (!("child" in props)) {
if (!("children" in props)) {
return false;
}
else {
return (Array.isArray(props.children) &&
props.children.every(isAnyComponentNode));
}
}
return isAnyComponentNode(props.child);
}
export function isResolvedCheckbox(props) {
return (isObject(props) &&
"label" in props &&
isStringValue(props.label) &&
"value" in props &&
isBooleanValue(props.value));
}
export function isResolvedColumn(props) {
return (isObject(props) &&
"children" in props &&
Array.isArray(props.children) &&
props.children.every(isAnyComponentNode));
}
export function isResolvedDateTimeInput(props) {
return isObject(props) && "value" in props && isStringValue(props.value);
}
export function isResolvedDivider(props) {
// Dividers can have all optional properties, so just checking if
// it's an object is enough.
return isObject(props);
}
export function isResolvedImage(props) {
return isObject(props) && "url" in props && isStringValue(props.url);
}
export function isResolvedIcon(props) {
return isObject(props) && "name" in props && isStringValue(props.name);
}
export function isResolvedList(props) {
return (isObject(props) &&
"children" in props &&
Array.isArray(props.children) &&
props.children.every(isAnyComponentNode));
}
export function isResolvedModal(props) {
return (isObject(props) &&
"entryPointChild" in props &&
isAnyComponentNode(props.entryPointChild) &&
"contentChild" in props &&
isAnyComponentNode(props.contentChild));
}
export function isResolvedMultipleChoice(props) {
return isObject(props) && "selections" in props;
}
export function isResolvedRow(props) {
return (isObject(props) &&
"children" in props &&
Array.isArray(props.children) &&
props.children.every(isAnyComponentNode));
}
export function isResolvedSlider(props) {
return isObject(props) && "value" in props && isNumberValue(props.value);
}
function isResolvedTabItem(item) {
return (isObject(item) &&
"title" in item &&
isStringValue(item.title) &&
"child" in item &&
isAnyComponentNode(item.child));
}
export function isResolvedTabs(props) {
return (isObject(props) &&
"tabItems" in props &&
Array.isArray(props.tabItems) &&
props.tabItems.every(isResolvedTabItem));
}
export function isResolvedText(props) {
return isObject(props) && "text" in props && isStringValue(props.text);
}
export function isResolvedTextField(props) {
return isObject(props) && "label" in props && isStringValue(props.label);
}
export function isResolvedVideo(props) {
return isObject(props) && "url" in props && isStringValue(props.url);
}
//# sourceMappingURL=guards.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"guards.js","sourceRoot":"","sources":["../../../../src/0.8/data/guards.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AA4BH,MAAM,UAAU,UAAU,CAAC,KAAc;IACvC,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,KAAK,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,GAAW,EAAE,KAAc;IAChD,OAAO,GAAG,KAAK,MAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,MAAM,UAAU,yBAAyB,CACvC,KAAc;IAEd,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACnC,OAAO,cAAc,IAAI,KAAK,IAAI,UAAU,IAAI,KAAK,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ode, DataValue, Surface, MessageProcessor } from "../types/types";
/**
* Processes and consolidates A2UIProtocolMessage objects into a structured,
* hierarchical model of UI surfaces.
*/
export declare class A2uiMessageProcessor implements MessageProcessor {
#private;
readonly opts: {
mapCtor: MapConstructor;
arrayCtor: ArrayConstructor;
setCtor: SetConstructor;
objCtor: ObjectConstructor;
};
static readonly DEFAULT_SURFACE_ID = "@default";
constructor(opts?: {
mapCtor: MapConstructor;
arrayCtor: ArrayConstructor;
setCtor: SetConstructor;
objCtor: ObjectConstructor;
});
getSurfaces(): ReadonlyMap<string, Surface>;
clearSurfaces(): void;
processMessages(messages: ServerToClientMessage[]): void;
/**
* Retrieves the data for a given component node and a relative path string.
* This correctly handles the special `.` path, which refers to the node's
* own data context.
*/
getData(node: AnyComponentNode, relativePath: string, surfaceId?: string): DataValue | null;
setData(node: AnyComponentNode | null, relativePath: string, value: DataValue, surfaceId?: string): void;
resolvePath(path: string, dataContextPath?: string): string;
}
//# sourceMappingURL=model-processor.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"model-processor.d.ts","sourceRoot":"","sources":["../../../../src/0.8/data/model-processor.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAKhB,SAAS,EAIT,OAAO,EAGP,gBAAgB,EAGjB,MAAM,gBAAgB,CAAC;AA0BxB;;;GAGG;AACH,qBAAa,oBAAqB,YAAW,gBAAgB;;IAUzD,QAAQ,CAAC,IAAI,EAAE;QACb,OAAO,EAAE,cAAc,CAAC;QACxB,SAAS,EAAE,gBAAgB,CAAC;QAC5B,OAAO,EAAE,cAAc,CAAC;QACxB,OAAO,EAAE,iBAAiB,CAAC;KAC5B;IAdH,MAAM,CAAC,QAAQ,CAAC,kBAAkB,cAAc;gBASrC,IAAI,GAAE;QACb,OAAO,EAAE,cAAc,CAAC;QACxB,SAAS,EAAE,gBAAgB,CAAC;QAC5B,OAAO,EAAE,cAAc,CAAC;QACxB,OAAO,EAAE,iBAAiB,CAAC;KACwC;IAUvE,WAAW,IAAI,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC;IAI3C,aAAa;IAIb,eAAe,CAAC,QAAQ,EAAE,qBAAqB,EAAE,GAAG,IAAI;IA6BxD;;;;OAIG;IACH,OAAO,CACL,IAAI,EAAE,gBAAgB,EACtB,YAAY,EAAE,MAAM,EACpB,SAAS,SAA0C,GAClD,SAAS,GAAG,IAAI;IAkBnB,OAAO,CACL,IAAI,EAAE,gBAAgB,GAAG,IAAI,EAC7B,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,SAAS,EAChB,SAAS,SAA0C,GAClD,IAAI;IAuBP,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM;CA8qB5D"}

View File

@@ -1,632 +0,0 @@
/*
Copyright 2025 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { isComponentArrayReference, isObject, isPath, isResolvedAudioPlayer, isResolvedButton, isResolvedCard, isResolvedCheckbox, isResolvedColumn, isResolvedDateTimeInput, isResolvedDivider, isResolvedIcon, isResolvedImage, isResolvedList, isResolvedModal, isResolvedMultipleChoice, isResolvedRow, isResolvedSlider, isResolvedTabs, isResolvedText, isResolvedTextField, isResolvedVideo, } from "./guards.js";
/**
* Processes and consolidates A2UIProtocolMessage objects into a structured,
* hierarchical model of UI surfaces.
*/
export class A2uiMessageProcessor {
static { this.DEFAULT_SURFACE_ID = "@default"; }
#mapCtor = Map;
#arrayCtor = Array;
#setCtor = Set;
#objCtor = Object;
#surfaces;
constructor(opts = { mapCtor: Map, arrayCtor: Array, setCtor: Set, objCtor: Object }) {
this.opts = opts;
this.#arrayCtor = opts.arrayCtor;
this.#mapCtor = opts.mapCtor;
this.#setCtor = opts.setCtor;
this.#objCtor = opts.objCtor;
this.#surfaces = new opts.mapCtor();
}
getSurfaces() {
return this.#surfaces;
}
clearSurfaces() {
this.#surfaces.clear();
}
processMessages(messages) {
for (const message of messages) {
if (message.beginRendering) {
this.#handleBeginRendering(message.beginRendering, message.beginRendering.surfaceId);
}
if (message.surfaceUpdate) {
this.#handleSurfaceUpdate(message.surfaceUpdate, message.surfaceUpdate.surfaceId);
}
if (message.dataModelUpdate) {
this.#handleDataModelUpdate(message.dataModelUpdate, message.dataModelUpdate.surfaceId);
}
if (message.deleteSurface) {
this.#handleDeleteSurface(message.deleteSurface);
}
}
}
/**
* Retrieves the data for a given component node and a relative path string.
* This correctly handles the special `.` path, which refers to the node's
* own data context.
*/
getData(node, relativePath, surfaceId = A2uiMessageProcessor.DEFAULT_SURFACE_ID) {
const surface = this.#getOrCreateSurface(surfaceId);
if (!surface)
return null;
let finalPath;
// The special `.` path means the final path is the node's data context
// path and so we return the dataContextPath as-is.
if (relativePath === "." || relativePath === "") {
finalPath = node.dataContextPath ?? "/";
}
else {
// For all other paths, resolve them against the node's context.
finalPath = this.resolvePath(relativePath, node.dataContextPath);
}
return this.#getDataByPath(surface.dataModel, finalPath);
}
setData(node, relativePath, value, surfaceId = A2uiMessageProcessor.DEFAULT_SURFACE_ID) {
if (!node) {
console.warn("No component node set");
return;
}
const surface = this.#getOrCreateSurface(surfaceId);
if (!surface)
return;
let finalPath;
// The special `.` path means the final path is the node's data context
// path and so we return the dataContextPath as-is.
if (relativePath === "." || relativePath === "") {
finalPath = node.dataContextPath ?? "/";
}
else {
// For all other paths, resolve them against the node's context.
finalPath = this.resolvePath(relativePath, node.dataContextPath);
}
this.#setDataByPath(surface.dataModel, finalPath, value);
}
resolvePath(path, dataContextPath) {
// If the path is absolute, it overrides any context.
if (path.startsWith("/")) {
return path;
}
if (dataContextPath && dataContextPath !== "/") {
// Ensure there's exactly one slash between the context and the path.
return dataContextPath.endsWith("/")
? `${dataContextPath}${path}`
: `${dataContextPath}/${path}`;
}
// Fallback for no context or root context: make it an absolute path.
return `/${path}`;
}
#parseIfJsonString(value) {
if (typeof value !== "string") {
return value;
}
const trimmedValue = value.trim();
if ((trimmedValue.startsWith("{") && trimmedValue.endsWith("}")) ||
(trimmedValue.startsWith("[") && trimmedValue.endsWith("]"))) {
try {
// It looks like JSON, attempt to parse it.
return JSON.parse(value);
}
catch (e) {
// It looked like JSON but wasn't. Keep the original string.
console.warn(`Failed to parse potential JSON string: "${value.substring(0, 50)}..."`, e);
return value; // Return original string
}
}
// It's a string, but not JSON-like.
return value;
}
/**
* Converts a specific array format [{key: "...", value_string: "..."}, ...]
* into a standard Map. It also attempts to parse any string values that
* appear to be stringified JSON.
*/
#convertKeyValueArrayToMap(arr) {
const map = new this.#mapCtor();
for (const item of arr) {
if (!isObject(item) || !("key" in item))
continue;
const key = item.key;
// Find the value, which is in a property prefixed with "value".
const valueKey = this.#findValueKey(item);
if (!valueKey)
continue;
let value = item[valueKey];
// It's a valueMap. We must recursively convert it.
if (valueKey === "valueMap" && Array.isArray(value)) {
value = this.#convertKeyValueArrayToMap(value);
}
else if (typeof value === "string") {
value = this.#parseIfJsonString(value);
}
this.#setDataByPath(map, key, value);
}
return map;
}
#setDataByPath(root, path, value) {
// Check if the incoming value is the special key-value array format.
if (Array.isArray(value) &&
(value.length === 0 || (isObject(value[0]) && "key" in value[0]))) {
// Check for "set primitive at path" convention:
// path: "/messages/123", contents: [{ key: ".", valueString: "hi" }]
if (value.length === 1 && isObject(value[0]) && value[0].key === ".") {
const item = value[0];
const valueKey = this.#findValueKey(item);
if (valueKey) {
// Extract the primitive value
value = item[valueKey];
// We must still process this value in case it's a valueMap or
// a JSON string.
if (valueKey === "valueMap" && Array.isArray(value)) {
value = this.#convertKeyValueArrayToMap(value);
}
else if (typeof value === "string") {
value = this.#parseIfJsonString(value);
}
// Now, `value` is the primitive (e.g., "hi"), and we continue
// the function.
}
else {
// Malformed, but fall back to existing behavior.
value = this.#convertKeyValueArrayToMap(value);
}
}
else {
value = this.#convertKeyValueArrayToMap(value);
}
}
const segments = this.#normalizePath(path)
.split("/")
.filter((s) => s);
if (segments.length === 0) {
// Root data can either be a Map or an Object. If we receive an Object,
// however, we will normalize it to a proper Map.
if (value instanceof Map || isObject(value)) {
// Normalize an Object to a Map.
if (!(value instanceof Map) && isObject(value)) {
value = new this.#mapCtor(Object.entries(value));
}
root.clear();
for (const [key, v] of value.entries()) {
root.set(key, v);
}
}
else {
console.error("Cannot set root of DataModel to a non-Map value.");
}
return;
}
let current = root;
for (let i = 0; i < segments.length - 1; i++) {
const segment = segments[i];
let target;
if (current instanceof Map) {
target = current.get(segment);
}
else if (Array.isArray(current) && /^\d+$/.test(segment)) {
target = current[parseInt(segment, 10)];
}
if (target === undefined ||
typeof target !== "object" ||
target === null) {
target = new this.#mapCtor();
if (current instanceof this.#mapCtor) {
current.set(segment, target);
}
else if (Array.isArray(current)) {
current[parseInt(segment, 10)] = target;
}
}
current = target;
}
const finalSegment = segments[segments.length - 1];
const storedValue = value;
if (current instanceof this.#mapCtor) {
current.set(finalSegment, storedValue);
}
else if (Array.isArray(current) && /^\d+$/.test(finalSegment)) {
current[parseInt(finalSegment, 10)] = storedValue;
}
}
/**
* Normalizes a path string into a consistent, slash-delimited format.
* Converts bracket notation and dot notation in a two-pass.
* e.g., "bookRecommendations[0].title" -> "/bookRecommendations/0/title"
* e.g., "book.0.title" -> "/book/0/title"
*/
#normalizePath(path) {
// 1. Replace all bracket accessors `[index]` with dot accessors `.index`
const dotPath = path.replace(/\[(\d+)\]/g, ".$1");
// 2. Split by dots
const segments = dotPath.split(".");
// 3. Join with slashes and ensure it starts with a slash
return "/" + segments.filter((s) => s.length > 0).join("/");
}
#getDataByPath(root, path) {
const segments = this.#normalizePath(path)
.split("/")
.filter((s) => s);
let current = root;
for (const segment of segments) {
if (current === undefined || current === null)
return null;
if (current instanceof Map) {
current = current.get(segment);
}
else if (Array.isArray(current) && /^\d+$/.test(segment)) {
current = current[parseInt(segment, 10)];
}
else if (isObject(current)) {
current = current[segment];
}
else {
// If we need to traverse deeper but `current` is a primitive, the path is invalid.
return null;
}
}
return current;
}
#getOrCreateSurface(surfaceId) {
let surface = this.#surfaces.get(surfaceId);
if (!surface) {
surface = new this.#objCtor({
rootComponentId: null,
componentTree: null,
dataModel: new this.#mapCtor(),
components: new this.#mapCtor(),
styles: new this.#objCtor(),
});
this.#surfaces.set(surfaceId, surface);
}
return surface;
}
#handleBeginRendering(message, surfaceId) {
const surface = this.#getOrCreateSurface(surfaceId);
surface.rootComponentId = message.root;
surface.styles = message.styles ?? {};
this.#rebuildComponentTree(surface);
}
#handleSurfaceUpdate(message, surfaceId) {
const surface = this.#getOrCreateSurface(surfaceId);
for (const component of message.components) {
surface.components.set(component.id, component);
}
this.#rebuildComponentTree(surface);
}
#handleDataModelUpdate(message, surfaceId) {
const surface = this.#getOrCreateSurface(surfaceId);
const path = message.path ?? "/";
this.#setDataByPath(surface.dataModel, path, message.contents);
this.#rebuildComponentTree(surface);
}
#handleDeleteSurface(message) {
this.#surfaces.delete(message.surfaceId);
}
/**
* Starts at the root component of the surface and builds out the tree
* recursively. This process involves resolving all properties of the child
* components, and expanding on any explicit children lists or templates
* found in the structure.
*
* @param surface The surface to be built.
*/
#rebuildComponentTree(surface) {
if (!surface.rootComponentId) {
surface.componentTree = null;
return;
}
// Track visited nodes to avoid circular references.
const visited = new this.#setCtor();
surface.componentTree = this.#buildNodeRecursive(surface.rootComponentId, surface, visited, "/", "" // Initial idSuffix.
);
}
/** Finds a value key in a map. */
#findValueKey(value) {
return Object.keys(value).find((k) => k.startsWith("value"));
}
/**
* Builds out the nodes recursively.
*/
#buildNodeRecursive(baseComponentId, surface, visited, dataContextPath, idSuffix = "") {
const fullId = `${baseComponentId}${idSuffix}`; // Construct the full ID
const { components } = surface;
if (!components.has(baseComponentId)) {
return null;
}
if (visited.has(fullId)) {
throw new Error(`Circular dependency for component "${fullId}".`);
}
visited.add(fullId);
const componentData = components.get(baseComponentId);
const componentProps = componentData.component ?? {};
const componentType = Object.keys(componentProps)[0];
const unresolvedProperties = componentProps[componentType];
// Manually build the resolvedProperties object by resolving each value in
// the component's properties.
const resolvedProperties = new this.#objCtor();
if (isObject(unresolvedProperties)) {
for (const [key, value] of Object.entries(unresolvedProperties)) {
resolvedProperties[key] = this.#resolvePropertyValue(value, surface, visited, dataContextPath, idSuffix, key);
}
}
visited.delete(fullId);
// Now that we have the resolved properties in place we can go ahead and
// ensure that they meet expectations in terms of types and so forth,
// casting them into the specific shape for usage.
const baseNode = {
id: fullId,
dataContextPath,
weight: componentData.weight ?? "initial",
};
switch (componentType) {
case "Text":
if (!isResolvedText(resolvedProperties)) {
throw new Error(`Invalid data; expected ${componentType}`);
}
return new this.#objCtor({
...baseNode,
type: "Text",
properties: resolvedProperties,
});
case "Image":
if (!isResolvedImage(resolvedProperties)) {
throw new Error(`Invalid data; expected ${componentType}`);
}
return new this.#objCtor({
...baseNode,
type: "Image",
properties: resolvedProperties,
});
case "Icon":
if (!isResolvedIcon(resolvedProperties)) {
throw new Error(`Invalid data; expected ${componentType}`);
}
return new this.#objCtor({
...baseNode,
type: "Icon",
properties: resolvedProperties,
});
case "Video":
if (!isResolvedVideo(resolvedProperties)) {
throw new Error(`Invalid data; expected ${componentType}`);
}
return new this.#objCtor({
...baseNode,
type: "Video",
properties: resolvedProperties,
});
case "AudioPlayer":
if (!isResolvedAudioPlayer(resolvedProperties)) {
throw new Error(`Invalid data; expected ${componentType}`);
}
return new this.#objCtor({
...baseNode,
type: "AudioPlayer",
properties: resolvedProperties,
});
case "Row":
if (!isResolvedRow(resolvedProperties)) {
throw new Error(`Invalid data; expected ${componentType}`);
}
return new this.#objCtor({
...baseNode,
type: "Row",
properties: resolvedProperties,
});
case "Column":
if (!isResolvedColumn(resolvedProperties)) {
throw new Error(`Invalid data; expected ${componentType}`);
}
return new this.#objCtor({
...baseNode,
type: "Column",
properties: resolvedProperties,
});
case "List":
if (!isResolvedList(resolvedProperties)) {
throw new Error(`Invalid data; expected ${componentType}`);
}
return new this.#objCtor({
...baseNode,
type: "List",
properties: resolvedProperties,
});
case "Card":
if (!isResolvedCard(resolvedProperties)) {
throw new Error(`Invalid data; expected ${componentType}`);
}
return new this.#objCtor({
...baseNode,
type: "Card",
properties: resolvedProperties,
});
case "Tabs":
if (!isResolvedTabs(resolvedProperties)) {
throw new Error(`Invalid data; expected ${componentType}`);
}
return new this.#objCtor({
...baseNode,
type: "Tabs",
properties: resolvedProperties,
});
case "Divider":
if (!isResolvedDivider(resolvedProperties)) {
throw new Error(`Invalid data; expected ${componentType}`);
}
return new this.#objCtor({
...baseNode,
type: "Divider",
properties: resolvedProperties,
});
case "Modal":
if (!isResolvedModal(resolvedProperties)) {
throw new Error(`Invalid data; expected ${componentType}`);
}
return new this.#objCtor({
...baseNode,
type: "Modal",
properties: resolvedProperties,
});
case "Button":
if (!isResolvedButton(resolvedProperties)) {
throw new Error(`Invalid data; expected ${componentType}`);
}
return new this.#objCtor({
...baseNode,
type: "Button",
properties: resolvedProperties,
});
case "CheckBox":
if (!isResolvedCheckbox(resolvedProperties)) {
throw new Error(`Invalid data; expected ${componentType}`);
}
return new this.#objCtor({
...baseNode,
type: "CheckBox",
properties: resolvedProperties,
});
case "TextField":
if (!isResolvedTextField(resolvedProperties)) {
throw new Error(`Invalid data; expected ${componentType}`);
}
return new this.#objCtor({
...baseNode,
type: "TextField",
properties: resolvedProperties,
});
case "DateTimeInput":
if (!isResolvedDateTimeInput(resolvedProperties)) {
throw new Error(`Invalid data; expected ${componentType}`);
}
return new this.#objCtor({
...baseNode,
type: "DateTimeInput",
properties: resolvedProperties,
});
case "MultipleChoice":
if (!isResolvedMultipleChoice(resolvedProperties)) {
throw new Error(`Invalid data; expected ${componentType}`);
}
return new this.#objCtor({
...baseNode,
type: "MultipleChoice",
properties: resolvedProperties,
});
case "Slider":
if (!isResolvedSlider(resolvedProperties)) {
throw new Error(`Invalid data; expected ${componentType}`);
}
return new this.#objCtor({
...baseNode,
type: "Slider",
properties: resolvedProperties,
});
default:
// Catch-all for other custom component types.
return new this.#objCtor({
...baseNode,
type: componentType,
properties: resolvedProperties,
});
}
}
/**
* Recursively resolves an individual property value. If a property indicates
* a child node (a string that matches a component ID), an explicitList of
* children, or a template, these will be built out here.
*/
#resolvePropertyValue(value, surface, visited, dataContextPath, idSuffix = "", propertyKey = null) {
const isComponentIdReferenceKey = (key) => key === "child" || key.endsWith("Child");
// 1. If it's a string that matches a component ID, build that node.
if (typeof value === "string" &&
propertyKey &&
isComponentIdReferenceKey(propertyKey) &&
surface.components.has(value)) {
return this.#buildNodeRecursive(value, surface, visited, dataContextPath, idSuffix);
}
// 2. If it's a ComponentArrayReference (e.g., a `children` property),
// resolve the list and return an array of nodes.
if (isComponentArrayReference(value)) {
if (value.explicitList) {
return value.explicitList.map((id) => this.#buildNodeRecursive(id, surface, visited, dataContextPath, idSuffix));
}
if (value.template) {
const fullDataPath = this.resolvePath(value.template.dataBinding, dataContextPath);
const data = this.#getDataByPath(surface.dataModel, fullDataPath);
const template = value.template;
// Handle Array data.
if (Array.isArray(data)) {
return data.map((_, index) => {
// Create a synthetic ID based on the template ID and the
// full index path of the data (e.g., template-id:0:1)
const parentIndices = dataContextPath
.split("/")
.filter((segment) => /^\d+$/.test(segment));
const newIndices = [...parentIndices, index];
const newSuffix = `:${newIndices.join(":")}`;
const childDataContextPath = `${fullDataPath}/${index}`;
return this.#buildNodeRecursive(template.componentId, // baseId
surface, visited, childDataContextPath, newSuffix // new suffix
);
});
}
// Handle Map data.
const mapCtor = this.#mapCtor;
if (data instanceof mapCtor) {
return Array.from(data.keys(), (key) => {
const newSuffix = `:${key}`;
const childDataContextPath = `${fullDataPath}/${key}`;
return this.#buildNodeRecursive(template.componentId, // baseId
surface, visited, childDataContextPath, newSuffix // new suffix
);
});
}
// Return empty array if the data is not ready yet.
return new this.#arrayCtor();
}
}
// 3. If it's a plain array, resolve each of its items.
if (Array.isArray(value)) {
return value.map((item) => this.#resolvePropertyValue(item, surface, visited, dataContextPath, idSuffix, propertyKey));
}
// 4. If it's a plain object, resolve each of its properties.
if (isObject(value)) {
const newObj = new this.#objCtor();
for (const [key, propValue] of Object.entries(value)) {
// Special case for paths. Here we might get /item/ or ./ on the front
// of the path which isn't what we want. In this case we check the
// dataContextPath and if 1) it's not the default and 2) we also see the
// path beginning with /item/ or ./we trim it.
let propertyValue = propValue;
if (isPath(key, propValue) && dataContextPath !== "/") {
propertyValue = propValue
.replace(/^\.?\/item/, "")
.replace(/^\.?\/text/, "")
.replace(/^\.?\/label/, "")
.replace(/^\.?\//, "");
newObj[key] = propertyValue;
continue;
}
newObj[key] = this.#resolvePropertyValue(propertyValue, surface, visited, dataContextPath, idSuffix, key);
}
return newObj;
}
// 5. Otherwise, it's a primitive value.
return value;
}
}
//# sourceMappingURL=model-processor.js.map

File diff suppressed because one or more lines are too long

View File

@@ -1,3 +0,0 @@
import { A2uiMessageProcessor } from "./model-processor.js";
export declare function create(): A2uiMessageProcessor;
//# sourceMappingURL=signal-model-processor.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"signal-model-processor.d.ts","sourceRoot":"","sources":["../../../../src/0.8/data/signal-model-processor.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAO5D,wBAAgB,MAAM,yBAOrB"}

View File

@@ -1,29 +0,0 @@
/*
Copyright 2025 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { A2uiMessageProcessor } from "./model-processor.js";
import { SignalArray } from "signal-utils/array";
import { SignalMap } from "signal-utils/map";
import { SignalObject } from "signal-utils/object";
import { SignalSet } from "signal-utils/set";
export function create() {
return new A2uiMessageProcessor({
arrayCtor: SignalArray,
mapCtor: SignalMap,
objCtor: SignalObject,
setCtor: SignalSet,
});
}
//# sourceMappingURL=signal-model-processor.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"signal-model-processor.js","sourceRoot":"","sources":["../../../../src/0.8/data/signal-model-processor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,MAAM,UAAU,MAAM;IACpB,OAAO,IAAI,oBAAoB,CAAC;QAC9B,SAAS,EAAE,WAA0C;QACrD,OAAO,EAAE,SAAsC;QAC/C,OAAO,EAAE,YAA4C;QACrD,OAAO,EAAE,SAAsC;KAChD,CAAC,CAAC;AACL,CAAC"}

View File

@@ -1,12 +0,0 @@
import { Action } from "../types/components.js";
import { AnyComponentNode } from "../types/types.js";
import { BaseEventDetail } from "./base.js";
type Namespace = "a2ui";
export interface A2UIAction extends BaseEventDetail<`${Namespace}.action`> {
readonly action: Action;
readonly dataContextPath: string;
readonly sourceComponentId: string;
readonly sourceComponent: AnyComponentNode | null;
}
export {};
//# sourceMappingURL=a2ui.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"a2ui.d.ts","sourceRoot":"","sources":["../../../../src/0.8/events/a2ui.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,KAAK,SAAS,GAAG,MAAM,CAAC;AAExB,MAAM,WAAW,UAAW,SAAQ,eAAe,CAAC,GAAG,SAAS,SAAS,CAAC;IACxE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,eAAe,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACnD"}

View File

@@ -1,17 +0,0 @@
/*
Copyright 2025 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
export {};
//# sourceMappingURL=a2ui.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"a2ui.js","sourceRoot":"","sources":["../../../../src/0.8/events/a2ui.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG"}

View File

@@ -1,4 +0,0 @@
export interface BaseEventDetail<EventType extends string> {
readonly eventType: EventType;
}
//# sourceMappingURL=base.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/0.8/events/base.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,eAAe,CAAC,SAAS,SAAS,MAAM;IACvD,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;CAC/B"}

View File

@@ -1,17 +0,0 @@
/*
Copyright 2025 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
export {};
//# sourceMappingURL=base.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../../src/0.8/events/base.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG"}

View File

@@ -1,20 +0,0 @@
import type * as A2UI from "./a2ui.js";
import { BaseEventDetail } from "./base.js";
type EnforceEventTypeMatch<T extends Record<string, BaseEventDetail<string>>> = {
[K in keyof T]: T[K] extends BaseEventDetail<infer EventType> ? EventType extends K ? T[K] : never : never;
};
export type StateEventDetailMap = EnforceEventTypeMatch<{
"a2ui.action": A2UI.A2UIAction;
}>;
export declare class StateEvent<T extends keyof StateEventDetailMap> extends CustomEvent<StateEventDetailMap[T]> {
readonly payload: StateEventDetailMap[T];
static eventName: string;
constructor(payload: StateEventDetailMap[T]);
}
declare global {
interface HTMLElementEventMap {
a2uiaction: StateEvent<"a2ui.action">;
}
}
export {};
//# sourceMappingURL=events.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../src/0.8/events/events.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,KAAK,IAAI,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAQ5C,KAAK,qBAAqB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC,IAC1E;KACG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,eAAe,CAAC,MAAM,SAAS,CAAC,GACzD,SAAS,SAAS,CAAC,GACjB,CAAC,CAAC,CAAC,CAAC,GACJ,KAAK,GACP,KAAK;CACV,CAAC;AAEJ,MAAM,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;IACtD,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC;CAChC,CAAC,CAAC;AAEH,qBAAa,UAAU,CACrB,CAAC,SAAS,MAAM,mBAAmB,CACnC,SAAQ,WAAW,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC;IAG/B,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAFpD,MAAM,CAAC,SAAS,SAAgB;gBAEX,OAAO,EAAE,mBAAmB,CAAC,CAAC,CAAC;CAGrD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,mBAAmB;QAC3B,UAAU,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC;KACvC;CACF"}

View File

@@ -1,28 +0,0 @@
/*
Copyright 2025 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
const eventInit = {
bubbles: true,
cancelable: true,
composed: true,
};
export class StateEvent extends CustomEvent {
static { this.eventName = "a2uiaction"; }
constructor(payload) {
super(StateEvent.eventName, { detail: payload, ...eventInit });
this.payload = payload;
}
}
//# sourceMappingURL=events.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../../../src/0.8/events/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,MAAM,SAAS,GAAG;IAChB,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,IAAI;IAChB,QAAQ,EAAE,IAAI;CACf,CAAC;AAeF,MAAM,OAAO,UAEX,SAAQ,WAAmC;aACpC,cAAS,GAAG,YAAY,CAAC;IAEhC,YAAqB,OAA+B;QAClD,KAAK,CAAC,UAAU,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,CAAC,CAAC;QAD5C,YAAO,GAAP,OAAO,CAAwB;IAEpD,CAAC"}

View File

@@ -1,3 +0,0 @@
export * from "./core.js";
export * as UI from "./ui/ui.js";
//# sourceMappingURL=index.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/0.8/index.ts"],"names":[],"mappings":"AAgBA,cAAc,WAAW,CAAC;AAC1B,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC"}

View File

@@ -1,18 +0,0 @@
/*
Copyright 2025 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
export * from "./core.js";
export * as UI from "./ui/ui.js";
//# sourceMappingURL=index.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/0.8/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,WAAW,CAAC;AAC1B,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC"}

View File

@@ -1,2 +0,0 @@
export {};
//# sourceMappingURL=model.test.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"model.test.d.ts","sourceRoot":"","sources":["../../../src/0.8/model.test.ts"],"names":[],"mappings":""}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -1,827 +0,0 @@
{
"title": "A2UI Message Schema",
"description": "Describes a JSON payload for an A2UI (Agent to UI) message, which is used to dynamically construct and update user interfaces. A message MUST contain exactly ONE of the action properties: 'beginRendering', 'surfaceUpdate', 'dataModelUpdate', or 'deleteSurface'.",
"type": "object",
"additionalProperties": false,
"properties": {
"beginRendering": {
"type": "object",
"description": "Signals the client to begin rendering a surface with a root component and specific styles.",
"additionalProperties": false,
"properties": {
"surfaceId": {
"type": "string",
"description": "The unique identifier for the UI surface to be rendered."
},
"root": {
"type": "string",
"description": "The ID of the root component to render."
},
"styles": {
"type": "object",
"description": "Styling information for the UI.",
"additionalProperties": false,
"properties": {
"font": {
"type": "string",
"description": "The primary font for the UI."
},
"primaryColor": {
"type": "string",
"description": "The primary UI color as a hexadecimal code (e.g., '#00BFFF').",
"pattern": "^#[0-9a-fA-F]{6}$"
}
}
}
},
"required": ["root", "surfaceId"]
},
"surfaceUpdate": {
"type": "object",
"description": "Updates a surface with a new set of components.",
"additionalProperties": false,
"properties": {
"surfaceId": {
"type": "string",
"description": "The unique identifier for the UI surface to be updated. If you are adding a new surface this *must* be a new, unique identified that has never been used for any existing surfaces shown."
},
"components": {
"type": "array",
"description": "A list containing all UI components for the surface.",
"minItems": 1,
"items": {
"type": "object",
"description": "Represents a *single* component in a UI widget tree. This component could be one of many supported types.",
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"description": "The unique identifier for this component."
},
"weight": {
"type": "number",
"description": "The relative weight of this component within a Row or Column. This corresponds to the CSS 'flex-grow' property. Note: this may ONLY be set when the component is a direct descendant of a Row or Column."
},
"component": {
"type": "object",
"description": "A wrapper object that MUST contain exactly one key, which is the name of the component type (e.g., 'Heading'). The value is an object containing the properties for that specific component.",
"additionalProperties": false,
"properties": {
"Text": {
"type": "object",
"additionalProperties": false,
"properties": {
"text": {
"type": "object",
"description": "The text content to display. This can be a literal string or a reference to a value in the data model ('path', e.g., '/doc/title'). While simple Markdown formatting is supported (i.e. without HTML, images, or links), utilizing dedicated UI components is generally preferred for a richer and more structured presentation.",
"additionalProperties": false,
"properties": {
"literalString": {
"type": "string"
},
"path": {
"type": "string"
}
}
},
"usageHint": {
"type": "string",
"description": "A hint for the base text style. One of:\n- `h1`: Largest heading.\n- `h2`: Second largest heading.\n- `h3`: Third largest heading.\n- `h4`: Fourth largest heading.\n- `h5`: Fifth largest heading.\n- `caption`: Small text for captions.\n- `body`: Standard body text.",
"enum": [
"h1",
"h2",
"h3",
"h4",
"h5",
"caption",
"body"
]
}
},
"required": ["text"]
},
"Image": {
"type": "object",
"additionalProperties": false,
"properties": {
"url": {
"type": "object",
"description": "The URL of the image to display. This can be a literal string ('literal') or a reference to a value in the data model ('path', e.g. '/thumbnail/url').",
"additionalProperties": false,
"properties": {
"literalString": {
"type": "string"
},
"path": {
"type": "string"
}
}
},
"fit": {
"type": "string",
"description": "Specifies how the image should be resized to fit its container. This corresponds to the CSS 'object-fit' property.",
"enum": [
"contain",
"cover",
"fill",
"none",
"scale-down"
]
},
"usageHint": {
"type": "string",
"description": "A hint for the image size and style. One of:\n- `icon`: Small square icon.\n- `avatar`: Circular avatar image.\n- `smallFeature`: Small feature image.\n- `mediumFeature`: Medium feature image.\n- `largeFeature`: Large feature image.\n- `header`: Full-width, full bleed, header image.",
"enum": [
"icon",
"avatar",
"smallFeature",
"mediumFeature",
"largeFeature",
"header"
]
}
},
"required": ["url"]
},
"Icon": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "object",
"description": "The name of the icon to display. This can be a literal string or a reference to a value in the data model ('path', e.g. '/form/submit').",
"additionalProperties": false,
"properties": {
"literalString": {
"type": "string",
"enum": [
"accountCircle",
"add",
"arrowBack",
"arrowForward",
"attachFile",
"calendarToday",
"call",
"camera",
"check",
"close",
"delete",
"download",
"edit",
"event",
"error",
"favorite",
"favoriteOff",
"folder",
"help",
"home",
"info",
"locationOn",
"lock",
"lockOpen",
"mail",
"menu",
"moreVert",
"moreHoriz",
"notificationsOff",
"notifications",
"payment",
"person",
"phone",
"photo",
"print",
"refresh",
"search",
"send",
"settings",
"share",
"shoppingCart",
"star",
"starHalf",
"starOff",
"upload",
"visibility",
"visibilityOff",
"warning"
]
},
"path": {
"type": "string"
}
}
}
},
"required": ["name"]
},
"Video": {
"type": "object",
"additionalProperties": false,
"properties": {
"url": {
"type": "object",
"description": "The URL of the video to display. This can be a literal string or a reference to a value in the data model ('path', e.g. '/video/url').",
"additionalProperties": false,
"properties": {
"literalString": {
"type": "string"
},
"path": {
"type": "string"
}
}
}
},
"required": ["url"]
},
"AudioPlayer": {
"type": "object",
"additionalProperties": false,
"properties": {
"url": {
"type": "object",
"description": "The URL of the audio to be played. This can be a literal string ('literal') or a reference to a value in the data model ('path', e.g. '/song/url').",
"additionalProperties": false,
"properties": {
"literalString": {
"type": "string"
},
"path": {
"type": "string"
}
}
},
"description": {
"type": "object",
"description": "A description of the audio, such as a title or summary. This can be a literal string or a reference to a value in the data model ('path', e.g. '/song/title').",
"additionalProperties": false,
"properties": {
"literalString": {
"type": "string"
},
"path": {
"type": "string"
}
}
}
},
"required": ["url"]
},
"Row": {
"type": "object",
"additionalProperties": false,
"properties": {
"children": {
"type": "object",
"description": "Defines the children. Use 'explicitList' for a fixed set of children, or 'template' to generate children from a data list.",
"additionalProperties": false,
"properties": {
"explicitList": {
"type": "array",
"items": {
"type": "string"
}
},
"template": {
"type": "object",
"description": "A template for generating a dynamic list of children from a data model list. `componentId` is the component to use as a template, and `dataBinding` is the path to the map of components in the data model. Values in the map will define the list of children.",
"additionalProperties": false,
"properties": {
"componentId": {
"type": "string"
},
"dataBinding": {
"type": "string"
}
},
"required": ["componentId", "dataBinding"]
}
}
},
"distribution": {
"type": "string",
"description": "Defines the arrangement of children along the main axis (horizontally). This corresponds to the CSS 'justify-content' property.",
"enum": [
"center",
"end",
"spaceAround",
"spaceBetween",
"spaceEvenly",
"start"
]
},
"alignment": {
"type": "string",
"description": "Defines the alignment of children along the cross axis (vertically). This corresponds to the CSS 'align-items' property.",
"enum": ["start", "center", "end", "stretch"]
}
},
"required": ["children"]
},
"Column": {
"type": "object",
"additionalProperties": false,
"properties": {
"children": {
"type": "object",
"description": "Defines the children. Use 'explicitList' for a fixed set of children, or 'template' to generate children from a data list.",
"additionalProperties": false,
"properties": {
"explicitList": {
"type": "array",
"items": {
"type": "string"
}
},
"template": {
"type": "object",
"description": "A template for generating a dynamic list of children from a data model list. `componentId` is the component to use as a template, and `dataBinding` is the path to the map of components in the data model. Values in the map will define the list of children.",
"additionalProperties": false,
"properties": {
"componentId": {
"type": "string"
},
"dataBinding": {
"type": "string"
}
},
"required": ["componentId", "dataBinding"]
}
}
},
"distribution": {
"type": "string",
"description": "Defines the arrangement of children along the main axis (vertically). This corresponds to the CSS 'justify-content' property.",
"enum": [
"start",
"center",
"end",
"spaceBetween",
"spaceAround",
"spaceEvenly"
]
},
"alignment": {
"type": "string",
"description": "Defines the alignment of children along the cross axis (horizontally). This corresponds to the CSS 'align-items' property.",
"enum": ["center", "end", "start", "stretch"]
}
},
"required": ["children"]
},
"List": {
"type": "object",
"additionalProperties": false,
"properties": {
"children": {
"type": "object",
"description": "Defines the children. Use 'explicitList' for a fixed set of children, or 'template' to generate children from a data list.",
"additionalProperties": false,
"properties": {
"explicitList": {
"type": "array",
"items": {
"type": "string"
}
},
"template": {
"type": "object",
"description": "A template for generating a dynamic list of children from a data model list. `componentId` is the component to use as a template, and `dataBinding` is the path to the map of components in the data model. Values in the map will define the list of children.",
"additionalProperties": false,
"properties": {
"componentId": {
"type": "string"
},
"dataBinding": {
"type": "string"
}
},
"required": ["componentId", "dataBinding"]
}
}
},
"direction": {
"type": "string",
"description": "The direction in which the list items are laid out.",
"enum": ["vertical", "horizontal"]
},
"alignment": {
"type": "string",
"description": "Defines the alignment of children along the cross axis.",
"enum": ["start", "center", "end", "stretch"]
}
},
"required": ["children"]
},
"Card": {
"type": "object",
"additionalProperties": false,
"properties": {
"child": {
"type": "string",
"description": "The ID of the component to be rendered inside the card."
}
},
"required": ["child"]
},
"Tabs": {
"type": "object",
"additionalProperties": false,
"properties": {
"tabItems": {
"type": "array",
"description": "An array of objects, where each object defines a tab with a title and a child component.",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"title": {
"type": "object",
"description": "The tab title. Defines the value as either a literal value or a path to data model value (e.g. '/options/title').",
"additionalProperties": false,
"properties": {
"literalString": {
"type": "string"
},
"path": {
"type": "string"
}
}
},
"child": {
"type": "string"
}
},
"required": ["title", "child"]
}
}
},
"required": ["tabItems"]
},
"Divider": {
"type": "object",
"additionalProperties": false,
"properties": {
"axis": {
"type": "string",
"description": "The orientation of the divider.",
"enum": ["horizontal", "vertical"]
}
}
},
"Modal": {
"type": "object",
"additionalProperties": false,
"properties": {
"entryPointChild": {
"type": "string",
"description": "The ID of the component that opens the modal when interacted with (e.g., a button)."
},
"contentChild": {
"type": "string",
"description": "The ID of the component to be displayed inside the modal."
}
},
"required": ["entryPointChild", "contentChild"]
},
"Button": {
"type": "object",
"additionalProperties": false,
"properties": {
"child": {
"type": "string",
"description": "The ID of the component to display in the button, typically a Text component."
},
"primary": {
"type": "boolean",
"description": "Indicates if this button should be styled as the primary action."
},
"action": {
"type": "object",
"description": "The client-side action to be dispatched when the button is clicked. It includes the action's name and an optional context payload.",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"context": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "object",
"description": "Defines the value to be included in the context as either a literal value or a path to a data model value (e.g. '/user/name').",
"additionalProperties": false,
"properties": {
"path": {
"type": "string"
},
"literalString": {
"type": "string"
},
"literalNumber": {
"type": "number"
},
"literalBoolean": {
"type": "boolean"
}
}
}
},
"required": ["key", "value"]
}
}
},
"required": ["name"]
}
},
"required": ["child", "action"]
},
"CheckBox": {
"type": "object",
"additionalProperties": false,
"properties": {
"label": {
"type": "object",
"description": "The text to display next to the checkbox. Defines the value as either a literal value or a path to data model ('path', e.g. '/option/label').",
"additionalProperties": false,
"properties": {
"literalString": {
"type": "string"
},
"path": {
"type": "string"
}
}
},
"value": {
"type": "object",
"description": "The current state of the checkbox (true for checked, false for unchecked). This can be a literal boolean ('literalBoolean') or a reference to a value in the data model ('path', e.g. '/filter/open').",
"additionalProperties": false,
"properties": {
"literalBoolean": {
"type": "boolean"
},
"path": {
"type": "string"
}
}
}
},
"required": ["label", "value"]
},
"TextField": {
"type": "object",
"additionalProperties": false,
"properties": {
"label": {
"type": "object",
"description": "The text label for the input field. This can be a literal string or a reference to a value in the data model ('path, e.g. '/user/name').",
"additionalProperties": false,
"properties": {
"literalString": {
"type": "string"
},
"path": {
"type": "string"
}
}
},
"text": {
"type": "object",
"description": "The value of the text field. This can be a literal string or a reference to a value in the data model ('path', e.g. '/user/name').",
"additionalProperties": false,
"properties": {
"literalString": {
"type": "string"
},
"path": {
"type": "string"
}
}
},
"textFieldType": {
"type": "string",
"description": "The type of input field to display.",
"enum": [
"date",
"longText",
"number",
"shortText",
"obscured"
]
},
"validationRegexp": {
"type": "string",
"description": "A regular expression used for client-side validation of the input."
}
},
"required": ["label"]
},
"DateTimeInput": {
"type": "object",
"additionalProperties": false,
"properties": {
"value": {
"type": "object",
"description": "The selected date and/or time value. This can be a literal string ('literalString') or a reference to a value in the data model ('path', e.g. '/user/dob').",
"additionalProperties": false,
"properties": {
"literalString": {
"type": "string"
},
"path": {
"type": "string"
}
}
},
"enableDate": {
"type": "boolean",
"description": "If true, allows the user to select a date."
},
"enableTime": {
"type": "boolean",
"description": "If true, allows the user to select a time."
},
"outputFormat": {
"type": "string",
"description": "The desired format for the output string after a date or time is selected."
}
},
"required": ["value"]
},
"MultipleChoice": {
"type": "object",
"additionalProperties": false,
"properties": {
"selections": {
"type": "object",
"description": "The currently selected values for the component. This can be a literal array of strings or a path to an array in the data model('path', e.g. '/hotel/options').",
"additionalProperties": false,
"properties": {
"literalArray": {
"type": "array",
"items": {
"type": "string"
}
},
"path": {
"type": "string"
}
}
},
"options": {
"type": "array",
"description": "An array of available options for the user to choose from.",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"label": {
"type": "object",
"description": "The text to display for this option. This can be a literal string or a reference to a value in the data model (e.g. '/option/label').",
"additionalProperties": false,
"properties": {
"literalString": {
"type": "string"
},
"path": {
"type": "string"
}
}
},
"value": {
"type": "string",
"description": "The value to be associated with this option when selected."
}
},
"required": ["label", "value"]
}
},
"maxAllowedSelections": {
"type": "integer",
"description": "The maximum number of options that the user is allowed to select."
}
},
"required": ["selections", "options"]
},
"Slider": {
"type": "object",
"additionalProperties": false,
"properties": {
"value": {
"type": "object",
"description": "The current value of the slider. This can be a literal number ('literalNumber') or a reference to a value in the data model ('path', e.g. '/restaurant/cost').",
"additionalProperties": false,
"properties": {
"literalNumber": {
"type": "number"
},
"path": {
"type": "string"
}
}
},
"minValue": {
"type": "number",
"description": "The minimum value of the slider."
},
"maxValue": {
"type": "number",
"description": "The maximum value of the slider."
}
},
"required": ["value"]
}
}
}
},
"required": ["id", "component"]
}
}
},
"required": ["surfaceId", "components"]
},
"dataModelUpdate": {
"type": "object",
"description": "Updates the data model for a surface.",
"additionalProperties": false,
"properties": {
"surfaceId": {
"type": "string",
"description": "The unique identifier for the UI surface this data model update applies to."
},
"path": {
"type": "string",
"description": "An optional path to a location within the data model (e.g., '/user/name'). If omitted, or set to '/', the entire data model will be replaced."
},
"contents": {
"type": "array",
"description": "An array of data entries. Each entry must contain a 'key' and exactly one corresponding typed 'value*' property.",
"items": {
"type": "object",
"description": "A single data entry. Exactly one 'value*' property should be provided alongside the key.",
"additionalProperties": false,
"properties": {
"key": {
"type": "string",
"description": "The key for this data entry."
},
"valueString": {
"type": "string"
},
"valueNumber": {
"type": "number"
},
"valueBoolean": {
"type": "boolean"
},
"valueMap": {
"description": "Represents a map as an adjacency list.",
"type": "array",
"items": {
"type": "object",
"description": "One entry in the map. Exactly one 'value*' property should be provided alongside the key.",
"additionalProperties": false,
"properties": {
"key": {
"type": "string"
},
"valueString": {
"type": "string"
},
"valueNumber": {
"type": "number"
},
"valueBoolean": {
"type": "boolean"
}
},
"required": ["key"]
}
}
},
"required": ["key"]
}
}
},
"required": ["contents", "surfaceId"]
},
"deleteSurface": {
"type": "object",
"description": "Signals the client to delete the surface identified by 'surfaceId'.",
"additionalProperties": false,
"properties": {
"surfaceId": {
"type": "string",
"description": "The unique identifier for the UI surface to be deleted."
}
},
"required": ["surfaceId"]
}
}
}

View File

@@ -1,2 +0,0 @@
export declare const behavior: string;
//# sourceMappingURL=behavior.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"behavior.d.ts","sourceRoot":"","sources":["../../../../src/0.8/styles/behavior.ts"],"names":[],"mappings":"AA4BA,eAAO,MAAM,QAAQ,QA0BpB,CAAC"}

View File

@@ -1,54 +0,0 @@
/*
Copyright 2025 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
const opacityBehavior = `
&:not([disabled]) {
cursor: pointer;
opacity: var(--opacity, 0);
transition: opacity var(--speed, 0.2s) cubic-bezier(0, 0, 0.3, 1);
&:hover,
&:focus {
opacity: 1;
}
}`;
export const behavior = `
${new Array(21)
.fill(0)
.map((_, idx) => {
return `.behavior-ho-${idx * 5} {
--opacity: ${idx / 20};
${opacityBehavior}
}`;
})
.join("\n")}
.behavior-o-s {
overflow: scroll;
}
.behavior-o-a {
overflow: auto;
}
.behavior-o-h {
overflow: hidden;
}
.behavior-sw-n {
scrollbar-width: none;
}
`;
//# sourceMappingURL=behavior.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"behavior.js","sourceRoot":"","sources":["../../../../src/0.8/styles/behavior.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,eAAe,GAAG;;;;;;;;;;IAUpB,CAAC;AAEL,MAAM,CAAC,MAAM,QAAQ,GAAG;IACpB,IAAI,KAAK,CAAC,EAAE,CAAC;KACZ,IAAI,CAAC,CAAC,CAAC;KACP,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE;IACd,OAAO,gBAAgB,GAAG,GAAG,CAAC;uBACb,GAAG,GAAG,EAAE;YACnB,eAAe;UACjB,CAAC;AACP,CAAC,CAAC;KACD,IAAI,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;CAiBd,CAAC"}

View File

@@ -1,2 +0,0 @@
export declare const border: string;
//# sourceMappingURL=border.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"border.d.ts","sourceRoot":"","sources":["../../../../src/0.8/styles/border.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,MAAM,QAuBlB,CAAC"}

View File

@@ -1,41 +0,0 @@
/*
Copyright 2025 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { grid } from "./shared.js";
export const border = `
${new Array(25)
.fill(0)
.map((_, idx) => {
return `
.border-bw-${idx} { border-width: ${idx}px; }
.border-btw-${idx} { border-top-width: ${idx}px; }
.border-bbw-${idx} { border-bottom-width: ${idx}px; }
.border-blw-${idx} { border-left-width: ${idx}px; }
.border-brw-${idx} { border-right-width: ${idx}px; }
.border-ow-${idx} { outline-width: ${idx}px; }
.border-br-${idx} { border-radius: ${idx * grid}px; overflow: hidden;}`;
})
.join("\n")}
.border-br-50pc {
border-radius: 50%;
}
.border-bs-s {
border-style: solid;
}
`;
//# sourceMappingURL=border.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"border.js","sourceRoot":"","sources":["../../../../src/0.8/styles/border.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,MAAM,CAAC,MAAM,MAAM,GAAG;IAClB,IAAI,KAAK,CAAC,EAAE,CAAC;KACZ,IAAI,CAAC,CAAC,CAAC;KACP,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE;IACd,OAAO;qBACQ,GAAG,oBAAoB,GAAG;sBACzB,GAAG,wBAAwB,GAAG;sBAC9B,GAAG,2BAA2B,GAAG;sBACjC,GAAG,yBAAyB,GAAG;sBAC/B,GAAG,0BAA0B,GAAG;;qBAEjC,GAAG,qBAAqB,GAAG;qBAC3B,GAAG,qBAAqB,GAAG,GAAG,IAAI,wBAAwB,CAAC;AAC5E,CAAC,CAAC;KACD,IAAI,CAAC,IAAI,CAAC;;;;;;;;;CASd,CAAC"}

View File

@@ -1,2 +0,0 @@
export declare const colors: string[];
//# sourceMappingURL=colors.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../../../src/0.8/styles/colors.ts"],"names":[],"mappings":"AAmFA,eAAO,MAAM,MAAM,UAgBlB,CAAC"}

View File

@@ -1,80 +0,0 @@
/*
Copyright 2025 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { shades } from "../types/colors.js";
import { toProp } from "./utils.js";
const color = (src) => `
${src
.map((key) => {
const inverseKey = getInverseKey(key);
return `.color-bc-${key} { border-color: light-dark(var(${toProp(key)}), var(${toProp(inverseKey)})); }`;
})
.join("\n")}
${src
.map((key) => {
const inverseKey = getInverseKey(key);
const vals = [
`.color-bgc-${key} { background-color: light-dark(var(${toProp(key)}), var(${toProp(inverseKey)})); }`,
`.color-bbgc-${key}::backdrop { background-color: light-dark(var(${toProp(key)}), var(${toProp(inverseKey)})); }`,
];
for (let o = 0.1; o < 1; o += 0.1) {
vals.push(`.color-bbgc-${key}_${(o * 100).toFixed(0)}::backdrop {
background-color: light-dark(oklch(from var(${toProp(key)}) l c h / calc(alpha * ${o.toFixed(1)})), oklch(from var(${toProp(inverseKey)}) l c h / calc(alpha * ${o.toFixed(1)})) );
}
`);
}
return vals.join("\n");
})
.join("\n")}
${src
.map((key) => {
const inverseKey = getInverseKey(key);
return `.color-c-${key} { color: light-dark(var(${toProp(key)}), var(${toProp(inverseKey)})); }`;
})
.join("\n")}
`;
const getInverseKey = (key) => {
const match = key.match(/^([a-z]+)(\d+)$/);
if (!match)
return key;
const [, prefix, shadeStr] = match;
const shade = parseInt(shadeStr, 10);
const target = 100 - shade;
const inverseShade = shades.reduce((prev, curr) => Math.abs(curr - target) < Math.abs(prev - target) ? curr : prev);
return `${prefix}${inverseShade}`;
};
const keyFactory = (prefix) => {
return shades.map((v) => `${prefix}${v}`);
};
export const colors = [
color(keyFactory("p")),
color(keyFactory("s")),
color(keyFactory("t")),
color(keyFactory("n")),
color(keyFactory("nv")),
color(keyFactory("e")),
`
.color-bgc-transparent {
background-color: transparent;
}
:host {
color-scheme: var(--color-scheme);
}
`,
];
//# sourceMappingURL=colors.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"colors.js","sourceRoot":"","sources":["../../../../src/0.8/styles/colors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAA8B,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,KAAK,GAAG,CAA2B,GAAkB,EAAE,EAAE,CAC7D;MACI,GAAG;KACF,GAAG,CAAC,CAAC,GAAW,EAAE,EAAE;IACnB,MAAM,UAAU,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,aAAa,GAAG,mCAAmC,MAAM,CAC9D,GAAG,CACJ,UAAU,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC;AACvC,CAAC,CAAC;KACD,IAAI,CAAC,IAAI,CAAC;;MAEX,GAAG;KACF,GAAG,CAAC,CAAC,GAAW,EAAE,EAAE;IACnB,MAAM,UAAU,GAAG,aAAa,C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KAAK,GAAG,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IACrC,MAAM,MAAM,GAAG,GAAG,GAAG,KAAK,CAAC;IAC3B,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAChD,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAChE,CAAC;IACF,OAAO,GAAG,MAAM,GAAG,YAAY,EAAE,CAAC;AACpC,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAA2B,MAAS,EAAE,EAAE;IACzD,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,MAAM,GAAG,CAAC,EAAE,CAAkB,CAAC;AAC7D,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACtB,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACtB,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACtB,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACtB,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACvB,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACtB;;;;;;;;GAQC;CACF,CAAC"}

View File

@@ -1,11 +0,0 @@
/**
* CSS classes for Google Symbols.
*
* Usage:
*
* ```html
* <span class="g-icon">pen_spark</span>
* ```
*/
export declare const icons = "\n .g-icon {\n font-family: \"Material Symbols Outlined\", \"Google Symbols\";\n font-weight: normal;\n font-style: normal;\n font-display: optional;\n font-size: 20px;\n width: 1em;\n height: 1em;\n user-select: none;\n line-height: 1;\n letter-spacing: normal;\n text-transform: none;\n display: inline-block;\n white-space: nowrap;\n word-wrap: normal;\n direction: ltr;\n -webkit-font-feature-settings: \"liga\";\n -webkit-font-smoothing: antialiased;\n overflow: hidden;\n\n font-variation-settings: \"FILL\" 0, \"wght\" 300, \"GRAD\" 0, \"opsz\" 48,\n \"ROND\" 100;\n\n &.filled {\n font-variation-settings: \"FILL\" 1, \"wght\" 300, \"GRAD\" 0, \"opsz\" 48,\n \"ROND\" 100;\n }\n\n &.filled-heavy {\n font-variation-settings: \"FILL\" 1, \"wght\" 700, \"GRAD\" 0, \"opsz\" 48,\n \"ROND\" 100;\n }\n }\n";
//# sourceMappingURL=icons.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../../src/0.8/styles/icons.ts"],"names":[],"mappings":"AAgBA;;;;;;;;GAQG;AACH,eAAO,MAAM,KAAK,k5BAkCjB,CAAC"}

View File

@@ -1,60 +0,0 @@
/*
Copyright 2025 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/**
* CSS classes for Google Symbols.
*
* Usage:
*
* ```html
* <span class="g-icon">pen_spark</span>
* ```
*/
export const icons = `
.g-icon {
font-family: "Material Symbols Outlined", "Google Symbols";
font-weight: normal;
font-style: normal;
font-display: optional;
font-size: 20px;
width: 1em;
height: 1em;
user-select: none;
line-height: 1;
letter-spacing: normal;
text-transform: none;
display: inline-block;
white-space: nowrap;
word-wrap: normal;
direction: ltr;
-webkit-font-feature-settings: "liga";
-webkit-font-smoothing: antialiased;
overflow: hidden;
font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 48,
"ROND" 100;
&.filled {
font-variation-settings: "FILL" 1, "wght" 300, "GRAD" 0, "opsz" 48,
"ROND" 100;
}
&.filled-heavy {
font-variation-settings: "FILL" 1, "wght" 700, "GRAD" 0, "opsz" 48,
"ROND" 100;
}
}
`;
//# sourceMappingURL=icons.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"icons.js","sourceRoot":"","sources":["../../../../src/0.8/styles/icons.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCpB,CAAC"}

View File

@@ -1,3 +0,0 @@
export * from "./utils.js";
export declare const structuralStyles: string;
//# sourceMappingURL=index.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/0.8/styles/index.ts"],"names":[],"mappings":"AAwBA,cAAc,YAAY,CAAC;AAE3B,eAAO,MAAM,gBAAgB,EAAE,MAUlB,CAAC"}

View File

@@ -1,35 +0,0 @@
/*
Copyright 2025 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { behavior } from "./behavior.js";
import { border } from "./border.js";
import { colors } from "./colors.js";
import { icons } from "./icons.js";
import { layout } from "./layout.js";
import { opacity } from "./opacity.js";
import { type } from "./type.js";
export * from "./utils.js";
export const structuralStyles = [
behavior,
border,
colors,
icons,
layout,
opacity,
type,
]
.flat(Infinity)
.join("\n");
//# sourceMappingURL=index.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/0.8/styles/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,cAAc,YAAY,CAAC;AAE3B,MAAM,CAAC,MAAM,gBAAgB,GAAW;IACtC,QAAQ;IACR,MAAM;IACN,MAAM;IACN,KAAK;IACL,MAAM;IACN,OAAO;IACP,IAAI;CACL;KACE,IAAI,CAAC,QAAQ,CAAC;KACd,IAAI,CAAC,IAAI,CAAC,CAAC"}

View File

@@ -1,2 +0,0 @@
export declare const layout: string;
//# sourceMappingURL=layout.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../src/0.8/styles/layout.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,MAAM,QAwNlB,CAAC"}

View File

@@ -1,232 +0,0 @@
/*
Copyright 2025 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { grid } from "./shared.js";
export const layout = `
:host {
${new Array(16)
.fill(0)
.map((_, idx) => {
return `--g-${idx + 1}: ${(idx + 1) * grid}px;`;
})
.join("\n")}
}
${new Array(49)
.fill(0)
.map((_, index) => {
const idx = index - 24;
const lbl = idx < 0 ? `n${Math.abs(idx)}` : idx.toString();
return `
.layout-p-${lbl} { --padding: ${idx * grid}px; padding: var(--padding); }
.layout-pt-${lbl} { padding-top: ${idx * grid}px; }
.layout-pr-${lbl} { padding-right: ${idx * grid}px; }
.layout-pb-${lbl} { padding-bottom: ${idx * grid}px; }
.layout-pl-${lbl} { padding-left: ${idx * grid}px; }
.layout-m-${lbl} { --margin: ${idx * grid}px; margin: var(--margin); }
.layout-mt-${lbl} { margin-top: ${idx * grid}px; }
.layout-mr-${lbl} { margin-right: ${idx * grid}px; }
.layout-mb-${lbl} { margin-bottom: ${idx * grid}px; }
.layout-ml-${lbl} { margin-left: ${idx * grid}px; }
.layout-t-${lbl} { top: ${idx * grid}px; }
.layout-r-${lbl} { right: ${idx * grid}px; }
.layout-b-${lbl} { bottom: ${idx * grid}px; }
.layout-l-${lbl} { left: ${idx * grid}px; }`;
})
.join("\n")}
${new Array(25)
.fill(0)
.map((_, idx) => {
return `
.layout-g-${idx} { gap: ${idx * grid}px; }`;
})
.join("\n")}
${new Array(8)
.fill(0)
.map((_, idx) => {
return `
.layout-grd-col${idx + 1} { grid-template-columns: ${"1fr "
.repeat(idx + 1)
.trim()}; }`;
})
.join("\n")}
.layout-pos-a {
position: absolute;
}
.layout-pos-rel {
position: relative;
}
.layout-dsp-none {
display: none;
}
.layout-dsp-block {
display: block;
}
.layout-dsp-grid {
display: grid;
}
.layout-dsp-iflex {
display: inline-flex;
}
.layout-dsp-flexvert {
display: flex;
flex-direction: column;
}
.layout-dsp-flexhor {
display: flex;
flex-direction: row;
}
.layout-fw-w {
flex-wrap: wrap;
}
.layout-al-fs {
align-items: start;
}
.layout-al-fe {
align-items: end;
}
.layout-al-c {
align-items: center;
}
.layout-as-n {
align-self: normal;
}
.layout-js-c {
justify-self: center;
}
.layout-sp-c {
justify-content: center;
}
.layout-sp-ev {
justify-content: space-evenly;
}
.layout-sp-bt {
justify-content: space-between;
}
.layout-sp-s {
justify-content: start;
}
.layout-sp-e {
justify-content: end;
}
.layout-ji-e {
justify-items: end;
}
.layout-r-none {
resize: none;
}
.layout-fs-c {
field-sizing: content;
}
.layout-fs-n {
field-sizing: none;
}
.layout-flx-0 {
flex: 0 0 auto;
}
.layout-flx-1 {
flex: 1 0 auto;
}
.layout-c-s {
contain: strict;
}
/** Widths **/
${new Array(10)
.fill(0)
.map((_, idx) => {
const weight = (idx + 1) * 10;
return `.layout-w-${weight} { width: ${weight}%; max-width: ${weight}%; }`;
})
.join("\n")}
${new Array(16)
.fill(0)
.map((_, idx) => {
const weight = idx * grid;
return `.layout-wp-${idx} { width: ${weight}px; }`;
})
.join("\n")}
/** Heights **/
${new Array(10)
.fill(0)
.map((_, idx) => {
const height = (idx + 1) * 10;
return `.layout-h-${height} { height: ${height}%; }`;
})
.join("\n")}
${new Array(16)
.fill(0)
.map((_, idx) => {
const height = idx * grid;
return `.layout-hp-${idx} { height: ${height}px; }`;
})
.join("\n")}
.layout-el-cv {
& img,
& video {
width: 100%;
height: 100%;
object-fit: cover;
margin: 0;
}
}
.layout-ar-sq {
aspect-ratio: 1 / 1;
}
.layout-ex-fb {
margin: calc(var(--padding) * -1) 0 0 calc(var(--padding) * -1);
width: calc(100% + var(--padding) * 2);
height: calc(100% + var(--padding) * 2);
}
`;
//# sourceMappingURL=layout.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../../../src/0.8/styles/layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,MAAM,CAAC,MAAM,MAAM,GAAG;;MAEhB,IAAI,KAAK,CAAC,EAAE,CAAC;KACZ,IAAI,CAAC,CAAC,CAAC;KACP,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE;IACd,OAAO,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,IAAI,KAAK,CAAC;AAClD,CAAC,CAAC;KACD,IAAI,CAAC,IAAI,CAAC;;;IAGb,IAAI,KAAK,CAAC,EAAE,CAAC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AC,CAAC,CAAC;KACP,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE;IACd,MAAM,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC;IAC1B,OAAO,cAAc,GAAG,cAAc,MAAM,OAAO,CAAC;AACtD,CAAC,CAAC;KACD,IAAI,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;CAqBd,CAAC"}

View File

@@ -1,2 +0,0 @@
export declare const opacity: string;
//# sourceMappingURL=opacity.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"opacity.d.ts","sourceRoot":"","sources":["../../../../src/0.8/styles/opacity.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,OAAO,QAOnB,CAAC"}

View File

@@ -1,24 +0,0 @@
/*
Copyright 2025 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
export const opacity = `
${new Array(21)
.fill(0)
.map((_, idx) => {
return `.opacity-el-${idx * 5} { opacity: ${idx / 20}; }`;
})
.join("\n")}
`;
//# sourceMappingURL=opacity.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"opacity.js","sourceRoot":"","sources":["../../../../src/0.8/styles/opacity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG;IACnB,IAAI,KAAK,CAAC,EAAE,CAAC;KACZ,IAAI,CAAC,CAAC,CAAC;KACP,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE;IACd,OAAO,eAAe,GAAG,GAAG,CAAC,eAAe,GAAG,GAAG,EAAE,KAAK,CAAC;AAC5D,CAAC,CAAC;KACD,IAAI,CAAC,IAAI,CAAC;CACd,CAAC"}

View File

@@ -1,2 +0,0 @@
export declare const grid = 4;
//# sourceMappingURL=shared.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../src/0.8/styles/shared.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,IAAI,IAAI,CAAC"}

View File

@@ -1,17 +0,0 @@
/*
Copyright 2025 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
export const grid = 4;
//# sourceMappingURL=shared.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../../src/0.8/styles/shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC"}

View File

@@ -1,2 +0,0 @@
export declare const type: string;
//# sourceMappingURL=type.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../../src/0.8/styles/type.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,IAAI,QA2IhB,CAAC"}

View File

@@ -1,156 +0,0 @@
/*
Copyright 2025 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
export const type = `
:host {
--default-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
--default-font-family-mono: "Courier New", Courier, monospace;
}
.typography-f-s {
font-family: var(--font-family, var(--default-font-family));
font-optical-sizing: auto;
font-variation-settings: "slnt" 0, "wdth" 100, "GRAD" 0;
}
.typography-f-sf {
font-family: var(--font-family-flex, var(--default-font-family));
font-optical-sizing: auto;
}
.typography-f-c {
font-family: var(--font-family-mono, var(--default-font-family));
font-optical-sizing: auto;
font-variation-settings: "slnt" 0, "wdth" 100, "GRAD" 0;
}
.typography-v-r {
font-variation-settings: "slnt" 0, "wdth" 100, "GRAD" 0, "ROND" 100;
}
.typography-ta-s {
text-align: start;
}
.typography-ta-c {
text-align: center;
}
.typography-fs-n {
font-style: normal;
}
.typography-fs-i {
font-style: italic;
}
.typography-sz-ls {
font-size: 11px;
line-height: 16px;
}
.typography-sz-lm {
font-size: 12px;
line-height: 16px;
}
.typography-sz-ll {
font-size: 14px;
line-height: 20px;
}
.typography-sz-bs {
font-size: 12px;
line-height: 16px;
}
.typography-sz-bm {
font-size: 14px;
line-height: 20px;
}
.typography-sz-bl {
font-size: 16px;
line-height: 24px;
}
.typography-sz-ts {
font-size: 14px;
line-height: 20px;
}
.typography-sz-tm {
font-size: 16px;
line-height: 24px;
}
.typography-sz-tl {
font-size: 22px;
line-height: 28px;
}
.typography-sz-hs {
font-size: 24px;
line-height: 32px;
}
.typography-sz-hm {
font-size: 28px;
line-height: 36px;
}
.typography-sz-hl {
font-size: 32px;
line-height: 40px;
}
.typography-sz-ds {
font-size: 36px;
line-height: 44px;
}
.typography-sz-dm {
font-size: 45px;
line-height: 52px;
}
.typography-sz-dl {
font-size: 57px;
line-height: 64px;
}
.typography-ws-p {
white-space: pre-line;
}
.typography-ws-nw {
white-space: nowrap;
}
.typography-td-none {
text-decoration: none;
}
/** Weights **/
${new Array(9)
.fill(0)
.map((_, idx) => {
const weight = (idx + 1) * 100;
return `.typography-w-${weight} { font-weight: ${weight}; }`;
})
.join("\n")}
`;
//# sourceMappingURL=type.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../../../src/0.8/styles/type.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAC,MAAM,IAAI,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoIhB,IAAI,KAAK,CAAC,CAAC,CAAC;KACX,IAAI,CAAC,CAAC,CAAC;KACP,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE;IACd,MAAM,MAAM,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;IAC/B,OAAO,iBAAiB,MAAM,mBAAmB,MAAM,KAAK,CAAC;AAC/D,CAAC,CAAC;KACD,IAAI,CAAC,IAAI,CAAC;CACd,CAAC"}

View File

@@ -1,6 +0,0 @@
import { ColorPalettes } from "../types/colors.js";
export declare function merge(...classes: Array<Record<string, boolean>>): Record<string, boolean>;
export declare function appendToAll(target: Record<string, string[]>, exclusions: string[], ...classes: Array<Record<string, boolean>>): Record<string, string[]>;
export declare function createThemeStyles(palettes: ColorPalettes): Record<string, string>;
export declare function toProp(key: string): string;
//# sourceMappingURL=utils.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/0.8/styles/utils.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,wBAAgB,KAAK,CAAC,GAAG,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,2BAkB/D;AAED,wBAAgB,WAAW,CACzB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAChC,UAAU,EAAE,MAAM,EAAE,EACpB,GAAG,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,4BAwC3C;AAED,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,aAAa,GACtB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUxB;AAED,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,UAMjC"}

View File

@@ -1,81 +0,0 @@
/*
Copyright 2025 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
export function merge(...classes) {
const styles = {};
for (const clazz of classes) {
for (const [key, val] of Object.entries(clazz)) {
const prefix = key.split("-").with(-1, "").join("-");
const existingKeys = Object.keys(styles).filter((key) => key.startsWith(prefix));
for (const existingKey of existingKeys) {
delete styles[existingKey];
}
styles[key] = val;
}
}
return styles;
}
export function appendToAll(target, exclusions, ...classes) {
const updatedTarget = structuredClone(target);
// Step through each of the new blocks we've been handed.
for (const clazz of classes) {
// For each of the items in the list, create the prefix value, e.g., for
// typography-f-s reduce to typography-f-. This will allow us to find any
// and all matches across the target that have the same prefix and swap them
// out for the updated item.
for (const key of Object.keys(clazz)) {
const prefix = key.split("-").with(-1, "").join("-");
// Now we have the prefix step through all iteme in the target, and
// replace the value in the array when we find it.
for (const [tagName, classesToAdd] of Object.entries(updatedTarget)) {
if (exclusions.includes(tagName)) {
continue;
}
let found = false;
for (let t = 0; t < classesToAdd.length; t++) {
if (classesToAdd[t].startsWith(prefix)) {
found = true;
// In theory we should be able to break after finding a single
// entry here because we shouldn't have items with the same prefix
// in the array, but for safety we'll run to the end of the array
// and ensure we've captured all possible items with the prefix.
classesToAdd[t] = key;
}
}
if (!found) {
classesToAdd.push(key);
}
}
}
}
return updatedTarget;
}
export function createThemeStyles(palettes) {
const styles = {};
for (const palette of Object.values(palettes)) {
for (const [key, val] of Object.entries(palette)) {
const prop = toProp(key);
styles[prop] = val;
}
}
return styles;
}
export function toProp(key) {
if (key.startsWith("nv")) {
return `--nv-${key.slice(2)}`;
}
return `--${key[0]}-${key.slice(1)}`;
}
//# sourceMappingURL=utils.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/0.8/styles/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,MAAM,UAAU,KAAK,CAAC,GAAG,OAAuC;IAC9D,MAAM,MAAM,GAA4B,EAAE,CAAC;IAC3C,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,KAAK,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAC/C,MAAM,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACrD,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CACtD,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CACvB,CAAC;YAEF,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE,CAAC;gBACvC,OAAO,MAAM,CAAC,WAAW,CAAC,CAAC;YAC7B,CAAC;YAED,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;QACpB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,WAAW,CACzB,MAAgC,EAChC,UAAoB,EACpB,GAAG,OAAuC;IAE1C,MAAM,aAAa,GAA6B,eAAe,CAAC,MAAM,CAAC,CAAC;IACxE,yDAAyD;IACzD,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,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C,GAAG,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YACjD,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;YACzB,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC;QACrB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,GAAW;IAChC,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACzB,OAAO,QAAQ,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IAChC,CAAC;IAED,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AACvC,CAAC"}

View File

@@ -1,66 +0,0 @@
/**
* A message from the client describing its capabilities, such as the component
* catalog it supports. Exactly ONE of the properties in this object must be
* set.
*/
export type ClientCapabilitiesUri = string;
export type ClientCapabilitiesDynamic = {
components: {
[key: string]: unknown;
};
styles: {
[key: string]: unknown;
};
};
export type ClientCapabilities = {
catalogUri: ClientCapabilitiesUri;
} | {
dynamicCatalog: ClientCapabilitiesDynamic;
};
/**
* A message sent from the client to the server. Exactly ONE of the properties
* in this object must be set.
*/
export interface ClientToServerMessage {
userAction?: UserAction;
clientUiCapabilities?: ClientCapabilities;
error?: ClientError;
/** Demo content */
request?: unknown;
}
/**
* Represents a user-initiated action, sent from the client to the server.
*/
export interface UserAction {
/**
* The name of the action.
*/
name: string;
/**
* The ID of the surface.
*/
surfaceId: string;
/**
* The ID of the component that triggered the event.
*/
sourceComponentId: string;
/**
* An ISO timestamp of when the event occurred.
*/
timestamp: string;
/**
* A JSON object containing the key-value pairs from the component's
* `action.context`, after resolving all data bindings.
*/
context?: {
[k: string]: unknown;
};
}
/**
* A message from the client indicating an error occurred, for example,
* during UI rendering.
*/
export interface ClientError {
[k: string]: unknown;
}
//# sourceMappingURL=client-event.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"client-event.d.ts","sourceRoot":"","sources":["../../../../src/0.8/types/client-event.ts"],"names":[],"mappings":"AAgBA;;;;GAIG;AAEH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAC3C,MAAM,MAAM,yBAAyB,GAAG;IACtC,UAAU,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IACvC,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAC1B;IAAE,UAAU,EAAE,qBAAqB,CAAA;CAAE,GACrC;IAAE,cAAc,EAAE,yBAAyB,CAAA;CAAE,CAAC;AAElD;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,oBAAoB,CAAC,EAAE,kBAAkB,CAAC;IAC1C,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,mBAAmB;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE;QACR,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;KACtB,CAAC;CACH;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACtB"}

View File

@@ -1,17 +0,0 @@
/*
Copyright 2025 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
export {};
//# sourceMappingURL=client-event.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"client-event.js","sourceRoot":"","sources":["../../../../src/0.8/types/client-event.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG"}

View File

@@ -1,25 +0,0 @@
type ColorShade = 0 | 5 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 50 | 60 | 70 | 80 | 90 | 95 | 98 | 99 | 100;
export type PaletteKeyVals = "n" | "nv" | "p" | "s" | "t" | "e";
export declare const shades: ColorShade[];
type CreatePalette<Prefix extends PaletteKeyVals> = {
[Key in `${Prefix}${ColorShade}`]: string;
};
export type PaletteKey<Prefix extends PaletteKeyVals> = Array<keyof CreatePalette<Prefix>>;
export type PaletteKeys = {
neutral: PaletteKey<"n">;
neutralVariant: PaletteKey<"nv">;
primary: PaletteKey<"p">;
secondary: PaletteKey<"s">;
tertiary: PaletteKey<"t">;
error: PaletteKey<"e">;
};
export type ColorPalettes = {
neutral: CreatePalette<"n">;
neutralVariant: CreatePalette<"nv">;
primary: CreatePalette<"p">;
secondary: CreatePalette<"s">;
tertiary: CreatePalette<"t">;
error: CreatePalette<"e">;
};
export {};
//# sourceMappingURL=colors.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../../../src/0.8/types/colors.ts"],"names":[],"mappings":"AAgBA,KAAK,UAAU,GACX,CAAC,GACD,CAAC,GACD,EAAE,GACF,EAAE,GACF,EAAE,GACF,EAAE,GACF,EAAE,GACF,EAAE,GACF,EAAE,GACF,EAAE,GACF,EAAE,GACF,EAAE,GACF,EAAE,GACF,EAAE,GACF,EAAE,GACF,EAAE,GACF,EAAE,GACF,GAAG,CAAC;AAER,MAAM,MAAM,cAAc,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAChE,eAAO,MAAM,MAAM,EAAE,UAAU,EAE9B,CAAC;AAEF,KAAK,aAAa,CAAC,MAAM,SAAS,cAAc,IAAI;KACjD,GAAG,IAAI,GAAG,MAAM,GAAG,UAAU,EAAE,GAAG,MAAM;CAC1C,CAAC;AAEF,MAAM,MAAM,UAAU,CAAC,MAAM,SAAS,cAAc,IAAI,KAAK,CAC3D,MAAM,aAAa,CAAC,MAAM,CAAC,CAC5B,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;IACzB,cAAc,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;IACjC,OAAO,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;IACzB,SAAS,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;IAC3B,QAAQ,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;IAC1B,KAAK,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;IAC5B,cAAc,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;IACpC,OAAO,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;IAC5B,SAAS,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;IAC9B,QAAQ,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;IAC7B,KAAK,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;CAC3B,CAAC"}

View File

@@ -1,19 +0,0 @@
/*
Copyright 2025 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
export const shades = [
0, 5, 10, 15, 20, 25, 30, 35, 40, 50, 60, 70, 80, 90, 95, 98, 99, 100,
];
//# sourceMappingURL=colors.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"colors.js","sourceRoot":"","sources":["../../../../src/0.8/types/colors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAuBH,MAAM,CAAC,MAAM,MAAM,GAAiB;IAClC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG;CACtE,CAAC"}

View File

@@ -1,174 +0,0 @@
import { StringValue } from "./primitives";
export interface Action {
/**
* A unique name identifying the action (e.g., 'submitForm').
*/
name: string;
/**
* A key-value map of data bindings to be resolved when the action is triggered.
*/
context?: {
key: string;
/**
* The dynamic value. Define EXACTLY ONE of the nested properties.
*/
value: {
/**
* A data binding reference to a location in the data model (e.g., '/user/name').
*/
path?: string;
/**
* A fixed, hardcoded string value.
*/
literalString?: string;
literalNumber?: number;
literalBoolean?: boolean;
};
}[];
}
export interface Text {
text: StringValue;
usageHint: "h1" | "h2" | "h3" | "h4" | "h5" | "caption" | "body";
}
export interface Image {
url: StringValue;
usageHint: "icon" | "avatar" | "smallFeature" | "mediumFeature" | "largeFeature" | "header";
fit?: "contain" | "cover" | "fill" | "none" | "scale-down";
}
export interface Icon {
name: StringValue;
}
export interface Video {
url: StringValue;
}
export interface AudioPlayer {
url: StringValue;
/**
* A label, title, or placeholder text.
*/
description?: StringValue;
}
export interface Tabs {
/**
* A list of tabs, each with a title and a child component ID.
*/
tabItems: {
/**
* The title of the tab.
*/
title: {
/**
* A data binding reference to a location in the data model (e.g., '/user/name').
*/
path?: string;
/**
* A fixed, hardcoded string value.
*/
literalString?: string;
};
/**
* A reference to a component instance by its unique ID.
*/
child: string;
}[];
}
export interface Divider {
/**
* The orientation.
*/
axis?: "horizontal" | "vertical";
/**
* The color of the divider (e.g., hex code or semantic name).
*/
color?: string;
/**
* The thickness of the divider.
*/
thickness?: number;
}
export interface Modal {
/**
* The ID of the component (e.g., a button) that triggers the modal.
*/
entryPointChild: string;
/**
* The ID of the component to display as the modal's content.
*/
contentChild: string;
}
export interface Button {
/**
* The ID of the component to display as the button's content.
*/
child: string;
/**
* Represents a user-initiated action.
*/
action: Action;
}
export interface Checkbox {
label: StringValue;
value: {
/**
* A data binding reference to a location in the data model (e.g., '/user/name').
*/
path?: string;
literalBoolean?: boolean;
};
}
export interface TextField {
text?: StringValue;
/**
* A label, title, or placeholder text.
*/
label: StringValue;
type?: "shortText" | "number" | "date" | "longText";
/**
* A regex string to validate the input.
*/
validationRegexp?: string;
}
export interface DateTimeInput {
value: StringValue;
enableDate?: boolean;
enableTime?: boolean;
/**
* The string format for the output (e.g., 'YYYY-MM-DD').
*/
outputFormat?: string;
}
export interface MultipleChoice {
selections: {
/**
* A data binding reference to a location in the data model (e.g., '/user/name').
*/
path?: string;
literalArray?: string[];
};
options?: {
label: {
/**
* A data binding reference to a location in the data model (e.g., '/user/name').
*/
path?: string;
/**
* A fixed, hardcoded string value.
*/
literalString?: string;
};
value: string;
}[];
maxAllowedSelections?: number;
}
export interface Slider {
value: {
/**
* A data binding reference to a location in the data model (e.g., '/user/name').
*/
path?: string;
literalNumber?: number;
};
minValue?: number;
maxValue?: number;
}
//# sourceMappingURL=components.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../../src/0.8/types/components.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,IAAI,E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ACF,KAAK,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;IACJ,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE;QACL;;WAEG;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}

View File

@@ -1,17 +0,0 @@
/*
Copyright 2025 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
export {};
//# sourceMappingURL=components.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"components.js","sourceRoot":"","sources":["../../../../src/0.8/types/components.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG"}

View File

@@ -1,43 +0,0 @@
export interface StringValue {
/**
* A data binding reference to a location in the data model (e.g., '/user/name').
*/
path?: string;
/**
* A fixed, hardcoded string value.
*/
literalString?: string;
/**
* A fixed, hardcoded string value.
*/
literal?: string;
}
export interface NumberValue {
/**
* A data binding reference to a location in the data model (e.g., '/user/name').
*/
path?: string;
/**
* A fixed, hardcoded number value.
*/
literalNumber?: number;
/**
* A fixed, hardcoded number value.
*/
literal?: number;
}
export interface BooleanValue {
/**
* A data binding reference to a location in the data model (e.g., '/user/name').
*/
path?: string;
/**
* A fixed, hardcoded boolean value.
*/
literalBoolean?: boolean;
/**
* A fixed, hardcoded boolean value.
*/
literal?: boolean;
}
//# sourceMappingURL=primitives.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../../../src/0.8/types/primitives.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}

View File

@@ -1,17 +0,0 @@
/*
Copyright 2025 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
export {};
//# sourceMappingURL=primitives.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"primitives.js","sourceRoot":"","sources":["../../../../src/0.8/types/primitives.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG"}

View File

@@ -1,390 +0,0 @@
export { type ClientToServerMessage as A2UIClientEventMessage, type ClientCapabilitiesDynamic, } from "./client-event.js";
export { type Action } from "./components.js";
import { AudioPlayer, Button, Checkbox, DateTimeInput, Divider, Icon, Image, MultipleChoice, Slider, Text, TextField, Video } from "./components";
import { StringValue } from "./primitives";
export type MessageProcessor = {
getSurfaces(): ReadonlyMap<string, Surface>;
clearSurfaces(): void;
processMessages(messages: ServerToClientMessage[]): void;
/**
* Retrieves the data for a given component node and a relative path string.
* This correctly handles the special `.` path, which refers to the node's
* own data context.
*/
getData(node: AnyComponentNode, relativePath: string, surfaceId: string): DataValue | null;
setData(node: AnyComponentNode | null, relativePath: string, value: DataValue, surfaceId: string): void;
resolvePath(path: string, dataContextPath?: string): string;
};
export type Theme = {
components: {
AudioPlayer: Record<string, boolean>;
Button: Record<string, boolean>;
Card: Record<string, boolean>;
Column: Record<string, boolean>;
CheckBox: {
container: Record<string, boolean>;
element: Record<string, boolean>;
label: Record<string, boolean>;
};
DateTimeInput: {
container: Record<string, boolean>;
element: Record<string, boolean>;
label: Record<string, boolean>;
};
Divider: Record<string, boolean>;
Image: {
all: Record<string, boolean>;
icon: Record<string, boolean>;
avatar: Record<string, boolean>;
smallFeature: Record<string, boolean>;
mediumFeature: Record<string, boolean>;
largeFeature: Record<string, boolean>;
header: Record<string, boolean>;
};
Icon: Record<string, boolean>;
List: Record<string, boolean>;
Modal: {
backdrop: Record<string, boolean>;
element: Record<string, boolean>;
};
MultipleChoice: {
container: Record<string, boolean>;
element: Record<string, boolean>;
label: Record<string, boolean>;
};
Row: Record<string, boolean>;
Slider: {
container: Record<string, boolean>;
element: Record<string, boolean>;
label: Record<string, boolean>;
};
Tabs: {
container: Record<string, boolean>;
element: Record<string, boolean>;
controls: {
all: Record<string, boolean>;
selected: Record<string, boolean>;
};
};
Text: {
all: Record<string, boolean>;
h1: Record<string, boolean>;
h2: Record<string, boolean>;
h3: Record<string, boolean>;
h4: Record<string, boolean>;
h5: Record<string, boolean>;
caption: Record<string, boolean>;
body: Record<string, boolean>;
};
TextField: {
container: Record<string, boolean>;
element: Record<string, boolean>;
label: Record<string, boolean>;
};
Video: Record<string, boolean>;
};
elements: {
a: Record<string, boolean>;
audio: Record<string, boolean>;
body: Record<string, boolean>;
button: Record<string, boolean>;
h1: Record<string, boolean>;
h2: Record<string, boolean>;
h3: Record<string, boolean>;
h4: Record<string, boolean>;
h5: Record<string, boolean>;
iframe: Record<string, boolean>;
input: Record<string, boolean>;
p: Record<string, boolean>;
pre: Record<string, boolean>;
textarea: Record<string, boolean>;
video: Record<string, boolean>;
};
markdown: {
p: string[];
h1: string[];
h2: string[];
h3: string[];
h4: string[];
h5: string[];
ul: string[];
ol: string[];
li: string[];
a: string[];
strong: string[];
em: string[];
};
additionalStyles?: {
AudioPlayer?: Record<string, string>;
Button?: Record<string, string>;
Card?: Record<string, string>;
Column?: Record<string, string>;
CheckBox?: Record<string, string>;
DateTimeInput?: Record<string, string>;
Divider?: Record<string, string>;
Heading?: Record<string, string>;
Icon?: Record<string, string>;
Image?: Record<string, string>;
List?: Record<string, string>;
Modal?: Record<string, string>;
MultipleChoice?: Record<string, string>;
Row?: Record<string, string>;
Slider?: Record<string, string>;
Tabs?: Record<string, string>;
Text?: Record<string, string> | {
h1: Record<string, string>;
h2: Record<string, string>;
h3: Record<string, string>;
h4: Record<string, string>;
h5: Record<string, string>;
body: Record<string, string>;
caption: Record<string, string>;
};
TextField?: Record<string, string>;
Video?: Record<string, string>;
};
};
/**
* Represents a user-initiated action, sent from the client to the server.
*/
export interface UserAction {
/**
* The name of the action, taken from the component's `action.action`
* property.
*/
actionName: string;
/**
* The `id` of the component that triggered the event.
*/
sourceComponentId: string;
/**
* An ISO 8601 timestamp of when the event occurred.
*/
timestamp: string;
/**
* A JSON object containing the key-value pairs from the component's
* `action.context`, after resolving all data bindings.
*/
context?: {
[k: string]: unknown;
};
}
/** A recursive type for any valid JSON-like value in the data model. */
export type DataValue = string | number | boolean | null | DataMap | DataObject | DataArray;
export type DataObject = {
[key: string]: DataValue;
};
export type DataMap = Map<string, DataValue>;
export type DataArray = DataValue[];
/** A template for creating components from a list in the data model. */
export interface ComponentArrayTemplate {
componentId: string;
dataBinding: string;
}
/** Defines a list of child components, either explicitly or via a template. */
export interface ComponentArrayReference {
explicitList?: string[];
template?: ComponentArrayTemplate;
}
/** Represents the general shape of a component's properties. */
export type ComponentProperties = {
children?: ComponentArrayReference;
child?: string;
[k: string]: unknown;
};
/** A raw component instance from a SurfaceUpdate message. */
export interface ComponentInstance {
id: string;
weight?: number;
component?: ComponentProperties;
}
export interface BeginRenderingMessage {
surfaceId: string;
root: string;
styles?: Record<string, string>;
}
export interface SurfaceUpdateMessage {
surfaceId: string;
components: ComponentInstance[];
}
export interface DataModelUpdate {
surfaceId: string;
path?: string;
contents: ValueMap[];
}
export type ValueMap = DataObject & {
key: string;
/** May be JSON */
valueString?: string;
valueNumber?: number;
valueBoolean?: boolean;
valueMap?: ValueMap[];
};
export interface DeleteSurfaceMessage {
surfaceId: string;
}
export interface ServerToClientMessage {
beginRendering?: BeginRenderingMessage;
surfaceUpdate?: SurfaceUpdateMessage;
dataModelUpdate?: DataModelUpdate;
deleteSurface?: DeleteSurfaceMessage;
}
/**
* A recursive type for any value that can appear within a resolved component
* tree. This is the main type that makes the recursive resolution possible.
*/
export type ResolvedValue = string | number | boolean | null | AnyComponentNode | ResolvedMap | ResolvedArray;
/** A generic map where each value has been recursively resolved. */
export type ResolvedMap = {
[key: string]: ResolvedValue;
};
/** A generic array where each item has been recursively resolved. */
export type ResolvedArray = ResolvedValue[];
/**
* A base interface that all component nodes share.
*/
interface BaseComponentNode {
id: string;
weight?: number;
dataContextPath?: string;
slotName?: string;
}
export interface TextNode extends BaseComponentNode {
type: "Text";
properties: ResolvedText;
}
export interface ImageNode extends BaseComponentNode {
type: "Image";
properties: ResolvedImage;
}
export interface IconNode extends BaseComponentNode {
type: "Icon";
properties: ResolvedIcon;
}
export interface VideoNode extends BaseComponentNode {
type: "Video";
properties: ResolvedVideo;
}
export interface AudioPlayerNode extends BaseComponentNode {
type: "AudioPlayer";
properties: ResolvedAudioPlayer;
}
export interface RowNode extends BaseComponentNode {
type: "Row";
properties: ResolvedRow;
}
export interface ColumnNode extends BaseComponentNode {
type: "Column";
properties: ResolvedColumn;
}
export interface ListNode extends BaseComponentNode {
type: "List";
properties: ResolvedList;
}
export interface CardNode extends BaseComponentNode {
type: "Card";
properties: ResolvedCard;
}
export interface TabsNode extends BaseComponentNode {
type: "Tabs";
properties: ResolvedTabs;
}
export interface DividerNode extends BaseComponentNode {
type: "Divider";
properties: ResolvedDivider;
}
export interface ModalNode extends BaseComponentNode {
type: "Modal";
properties: ResolvedModal;
}
export interface ButtonNode extends BaseComponentNode {
type: "Button";
properties: ResolvedButton;
}
export interface CheckboxNode extends BaseComponentNode {
type: "CheckBox";
properties: ResolvedCheckbox;
}
export interface TextFieldNode extends BaseComponentNode {
type: "TextField";
properties: ResolvedTextField;
}
export interface DateTimeInputNode extends BaseComponentNode {
type: "DateTimeInput";
properties: ResolvedDateTimeInput;
}
export interface MultipleChoiceNode extends BaseComponentNode {
type: "MultipleChoice";
properties: ResolvedMultipleChoice;
}
export interface SliderNode extends BaseComponentNode {
type: "Slider";
properties: ResolvedSlider;
}
export interface CustomNode extends BaseComponentNode {
type: string;
properties: CustomNodeProperties;
}
/**
* The complete discriminated union of all possible resolved component nodes.
* A renderer would use this type for any given node in the component tree.
*/
export type AnyComponentNode = TextNode | IconNode | ImageNode | VideoNode | AudioPlayerNode | RowNode | ColumnNode | ListNode | CardNode | TabsNode | DividerNode | ModalNode | ButtonNode | CheckboxNode | TextFieldNode | DateTimeInputNode | MultipleChoiceNode | SliderNode | CustomNode;
export type ResolvedText = Text;
export type ResolvedIcon = Icon;
export type ResolvedImage = Image;
export type ResolvedVideo = Video;
export type ResolvedAudioPlayer = AudioPlayer;
export type ResolvedDivider = Divider;
export type ResolvedCheckbox = Checkbox;
export type ResolvedTextField = TextField;
export type ResolvedDateTimeInput = DateTimeInput;
export type ResolvedMultipleChoice = MultipleChoice;
export type ResolvedSlider = Slider;
export interface ResolvedRow {
children: AnyComponentNode[];
distribution?: "start" | "center" | "end" | "spaceBetween" | "spaceAround" | "spaceEvenly";
alignment?: "start" | "center" | "end" | "stretch";
}
export interface ResolvedColumn {
children: AnyComponentNode[];
distribution?: "start" | "center" | "end" | "spaceBetween" | "spaceAround" | "spaceEvenly";
alignment?: "start" | "center" | "end" | "stretch";
}
export interface ResolvedButton {
child: AnyComponentNode;
action: Button["action"];
}
export interface ResolvedList {
children: AnyComponentNode[];
direction?: "vertical" | "horizontal";
alignment?: "start" | "center" | "end" | "stretch";
}
export interface ResolvedCard {
child: AnyComponentNode;
children: AnyComponentNode[];
}
export interface ResolvedTabItem {
title: StringValue;
child: AnyComponentNode;
}
export interface ResolvedTabs {
tabItems: ResolvedTabItem[];
}
export interface ResolvedModal {
entryPointChild: AnyComponentNode;
contentChild: AnyComponentNode;
}
export interface CustomNodeProperties {
[k: string]: ResolvedValue;
}
export type SurfaceID = string;
/** The complete state of a single UI surface. */
export interface Surface {
rootComponentId: string | null;
componentTree: AnyComponentNode | null;
dataModel: DataMap;
components: Map<string, ComponentInstance>;
styles: Record<string, string>;
}
//# sourceMappingURL=types.d.ts.map

File diff suppressed because one or more lines are too long

View File

@@ -1,17 +0,0 @@
/*
Copyright 2025 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
export {};
//# sourceMappingURL=types.js.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/0.8/types/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG"}

View File

@@ -1,9 +0,0 @@
import { Root } from "./root.js";
import { StringValue } from "../types/primitives.js";
export declare class Audio extends Root {
#private;
accessor url: StringValue | null;
static styles: import("lit").CSSResult[];
render(): import("lit").TemplateResult<1>;
}
//# sourceMappingURL=audio.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"audio.d.ts","sourceRoot":"","sources":["../../../../src/0.8/ui/audio.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAMrD,qBACa,KAAM,SAAQ,IAAI;;IAE7B,QAAQ,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAAQ;IAExC,MAAM,CAAC,MAAM,4BAmBX;IAoCF,MAAM;CAUP"}

Some files were not shown because too many files have changed in this diff Show More