From fe48decf0bf170db874951a9c6c8c0f9401d9c55 Mon Sep 17 00:00:00 2001 From: Google Maps SDK Team Date: Thu, 11 Jun 2026 17:24:22 +0000 Subject: [PATCH] build: update attribution id, add npm badges and keywords PiperOrigin-RevId: 930604070 --- client/web/README.md | 10 +++- client/web/package-lock.json | 4 +- client/web/package.json | 12 ++++- .../src/lit/custom-components/google_map.ts | 53 ++++++------------- .../src/lit/custom-components/place_card.ts | 32 +++++------ 5 files changed, 53 insertions(+), 58 deletions(-) diff --git a/client/web/README.md b/client/web/README.md index aefbacb..f4ca495 100644 --- a/client/web/README.md +++ b/client/web/README.md @@ -1,6 +1,14 @@ # Maps Agentic UI Toolkit Web Client Library -This package provides the Web (Lit-based) client library for the Maps Agentic UI Toolkit (MAUI). It includes components and utilities to render A2UI surfaces and communicate with an A2A agent server. +![Alpha](https://img.shields.io/badge/release-alpha-orange) +[![Python CI](https://github.com/googlemaps/a2ui/actions/workflows/python-ci.yml/badge.svg)](https://github.com/googlemaps/a2ui/actions/workflows/python-ci.yml) +[![Web CI](https://github.com/googlemaps/a2ui/actions/workflows/web-ci.yml/badge.svg)](https://github.com/googlemaps/a2ui/actions/workflows/web-ci.yml) +[![GitHub License](https://img.shields.io/github/license/googlemaps/a2ui?color=blue&v=1)](https://github.com/googlemaps/a2ui/blob/main/LICENSE) +[![npm](https://img.shields.io/npm/v/@googlemaps/a2ui)](https://npmjs.com/package/@googlemaps/a2ui) + +This package provides the Web (Lit-based) client library for the Maps Agentic UI +Toolkit (MAUI). It includes components and utilities to render A2UI surfaces and +communicate with an A2A agent server. Note: This library only works when paired with an Agent that can generate A2UI. See [Agentic UI Toolkit samples](https://github.com/googlemaps-samples/a2ui) for a reference implementation of an A2A Agent. diff --git a/client/web/package-lock.json b/client/web/package-lock.json index 0a6c481..06e5198 100644 --- a/client/web/package-lock.json +++ b/client/web/package-lock.json @@ -1,12 +1,12 @@ { "name": "@googlemaps/a2ui", - "version": "0.1.5", + "version": "0.1.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@googlemaps/a2ui", - "version": "0.1.5", + "version": "0.1.6", "license": "Apache-2.0", "dependencies": { "@a2a-js/sdk": "^0.3.8", diff --git a/client/web/package.json b/client/web/package.json index 9ba814a..91e1ceb 100644 --- a/client/web/package.json +++ b/client/web/package.json @@ -1,6 +1,6 @@ { "name": "@googlemaps/a2ui", - "version": "0.1.5", + "version": "0.1.6", "description": "Maps Agentic UI Toolkit Library", "main": "./dist/src/lit/index.js", "types": "./dist/src/lit/index.d.ts", @@ -56,7 +56,15 @@ "files": [ "dist/src" ], - "keywords": [], + "keywords": [ + "google", + "maps", + "agentic", + "ui", + "a2ui", + "visualization", + "grounding" + ], "author": "Google", "license": "Apache-2.0", "repository": { diff --git a/client/web/src/lit/custom-components/google_map.ts b/client/web/src/lit/custom-components/google_map.ts index 2bad424..1b71768 100644 --- a/client/web/src/lit/custom-components/google_map.ts +++ b/client/web/src/lit/custom-components/google_map.ts @@ -14,14 +14,13 @@ limitations under the License. */ -import { html, css, nothing, PropertyValues, unsafeCSS } from "lit"; -import { customElement, property, query } from "lit/decorators.js"; -import * as Primitives from "@a2ui/web_core/types/primitives"; -import { styleMap } from "lit/directives/style-map.js"; -import { structuralStyles } from "@a2ui/web_core"; -import { z } from 'zod'; -import { ComponentApi, DynamicNumberSchema, DynamicStringSchema } from "@a2ui/web_core/v0_9"; -import { A2uiLitElement, A2uiController } from "@a2ui/lit/v0_9"; +import {A2uiController, A2uiLitElement} from '@a2ui/lit/v0_9'; +import {structuralStyles} from '@a2ui/web_core'; +import {ComponentApi, DynamicNumberSchema, DynamicStringSchema} from '@a2ui/web_core/v0_9'; +import {css, html, nothing, PropertyValues, unsafeCSS} from 'lit'; +import {customElement} from 'lit/decorators.js'; +import {styleMap} from 'lit/directives/style-map.js'; +import {z} from 'zod'; const LatLngSchema = z.object({ lat: DynamicNumberSchema, @@ -40,6 +39,7 @@ const MapPinSchema = z.object({ placeId: DynamicStringSchema.optional(), }).strict(); +/** A2UI GoogleMap interface. */ export const GoogleMapApi = { name: 'GoogleMap', schema: z @@ -91,41 +91,18 @@ declare global { } } -type A2UIParam = LiteralOrPath | null; - -interface LiteralOrPath { - path?: string; - literal?: T; -} - -// Marker interface for A2UI data -interface MarkerValue { - lat: Primitives.NumberValue; - lng: Primitives.NumberValue; - label: Primitives.StringValue; - placeId: Primitives.StringValue; -} - -// Translated marker interface for use in UI -interface Marker { - lat: number; - lng: number; - label: string | null; -} - +/** A2UI Custom Component for GoogleMap */ @customElement("a2ui-googlemap") export class GoogleMap extends A2uiLitElement { - @property() - accessor heading: Primitives.NumberValue | null = null; - - @query("gmp-map-3d") - accessor map3dElement!: HTMLElement & Map3DElement; + get map3dElement(): HTMLElement&Map3DElement { + return this.renderRoot.querySelector('gmp-map-3d') as HTMLElement & + Map3DElement; + } protected createController() { return new A2uiController(this, GoogleMapApi); } - #geocoder: google.maps.Geocoder | null = null; #markers: HTMLElement[] = []; #prevCenter: { lat: number; lng: number } | null = null; #prevMarkers: any = null; @@ -342,7 +319,7 @@ export class GoogleMap extends A2uiLitElement { center="${lat},${lng},0" tilt="${tilt}" mode="${mode}" - max-tilt=${mode === "roadmap" ? "0" : nothing} + max-tilt=${mode === 'roadmap' ? '0' : nothing} heading="${heading}" map-id="2d6e1a27a57efe3c9479f6fc" internal-usage-attribution-ids="gmp_web_a2ui_v0.0.2_exp" @@ -351,6 +328,7 @@ export class GoogleMap extends A2uiLitElement { origin="${route.origin.lat},${route.origin.lng}" destination="${route.destination.lat},${route.destination.lng}" autofits-camera + internal-usage-attribution-ids="gmp_web_a2ui_v0.0.2_exp" >`)} @@ -358,6 +336,7 @@ export class GoogleMap extends A2uiLitElement { } } +/** A2UI Definition for GoogleMap component */ export const A2uiGoogleMap = { ...GoogleMapApi, tagName: "a2ui-googlemap", diff --git a/client/web/src/lit/custom-components/place_card.ts b/client/web/src/lit/custom-components/place_card.ts index 6611e1f..fc0fd70 100644 --- a/client/web/src/lit/custom-components/place_card.ts +++ b/client/web/src/lit/custom-components/place_card.ts @@ -14,15 +14,13 @@ limitations under the License. */ -import { html, css, nothing, unsafeCSS } from "lit"; -import { z } from 'zod' -import { customElement, property } from "lit/decorators.js"; - -import * as Primitives from "@a2ui/web_core/types/primitives"; -import { styleMap } from "lit/directives/style-map.js"; -import { structuralStyles } from "@a2ui/web_core"; -import { A2uiController, A2uiLitElement } from "@a2ui/lit/v0_9"; -import { ComponentApi, DynamicStringSchema } from "@a2ui/web_core/v0_9"; +import {A2uiController, A2uiLitElement} from '@a2ui/lit/v0_9'; +import {structuralStyles} from '@a2ui/web_core'; +import {ComponentApi, DynamicStringSchema} from '@a2ui/web_core/v0_9'; +import {css, html, nothing, unsafeCSS} from 'lit'; +import {customElement} from 'lit/decorators.js'; +import {styleMap} from 'lit/directives/style-map.js'; +import {z} from 'zod' export const PlaceCardApi = { @@ -42,11 +40,9 @@ declare global { } } -@customElement("a2ui-placecard") +/** A2UI Custom Component for PlaceCard */ +@customElement('a2ui-placecard') export class PlaceCard extends A2uiLitElement { - - - protected createController() { return new A2uiController(this, PlaceCardApi); } @@ -81,8 +77,11 @@ export class PlaceCard extends A2uiLitElement { return html`
- - + + + @@ -99,7 +98,8 @@ export class PlaceCard extends A2uiLitElement { } } +/** A2UI Definition for PlaceCard component */ export const A2uiPlaceCard = { ...PlaceCardApi, tagName: "a2ui-placecard", -}; \ No newline at end of file +};