diff --git a/client/android/GoogleMapsA2UI/src/main/assets/index.html b/client/android/GoogleMapsA2UI/src/main/assets/index.html index dcab209..0367398 100644 --- a/client/android/GoogleMapsA2UI/src/main/assets/index.html +++ b/client/android/GoogleMapsA2UI/src/main/assets/index.html @@ -27,1457 +27,7634 @@ v: "alpha", }); - - + + diff --git a/client/android/GoogleMapsA2UI/src/test/java/com/google/android/libraries/mapsplatform/a2ui/A2UIAttributionIdTests.kt b/client/android/GoogleMapsA2UI/src/test/java/com/google/android/libraries/mapsplatform/a2ui/A2UIAttributionIdTests.kt index 7a4ab99..d62e520 100644 --- a/client/android/GoogleMapsA2UI/src/test/java/com/google/android/libraries/mapsplatform/a2ui/A2UIAttributionIdTests.kt +++ b/client/android/GoogleMapsA2UI/src/test/java/com/google/android/libraries/mapsplatform/a2ui/A2UIAttributionIdTests.kt @@ -33,16 +33,16 @@ class A2UIAttributionIdTests { val htmlContent = InputStreamReader(inputStream).readText() assertTrue( - "Expected the generated attribution ID to contain the Web identifier 'gmp_web_maui_v0.1.9_atoui'", - htmlContent.contains("gmp_web_maui_v0.1.9_atoui"), + "Expected the generated attribution ID to contain the Web identifier 'gmp_web_maui_v0.1.10_atoui'", + htmlContent.contains("gmp_web_maui_v0.1.10_atoui"), ) assertTrue( - "Expected the generated attribution ID to contain the Android identifier 'gmp_android_maui_v0.1.9_atoui'", - htmlContent.contains("gmp_android_maui_v0.1.9_atoui"), + "Expected the generated attribution ID to contain the Android identifier 'gmp_android_maui_v0.1.10_atoui'", + htmlContent.contains("gmp_android_maui_v0.1.10_atoui"), ) assertTrue( - "Expected the generated attribution ID to contain the combined Web and Android identifier string 'gmp_web_maui_v0.1.9_atoui,gmp_android_maui_v0.1.9_atoui'", - htmlContent.contains("gmp_web_maui_v0.1.9_atoui,gmp_android_maui_v0.1.9_atoui"), + "Expected the generated attribution ID to contain the combined Web and Android identifier string 'gmp_web_maui_v0.1.10_atoui,gmp_android_maui_v0.1.10_atoui'", + htmlContent.contains("gmp_web_maui_v0.1.10_atoui,gmp_android_maui_v0.1.10_atoui"), ) } } diff --git a/client/android/web_build/src/main.ts b/client/android/web_build/src/main.ts index 1e78f2f..9e12fb1 100644 --- a/client/android/web_build/src/main.ts +++ b/client/android/web_build/src/main.ts @@ -20,7 +20,7 @@ import {customElement} from 'lit/decorators.js'; import {A2UICoreShell} from './core-shell'; (window as any)['A2UI_ATTRIBUTION_ID'] = - 'gmp_web_maui_v0.1.9_atoui,gmp_android_maui_v0.1.9_atoui'; + 'gmp_web_maui_v0.1.10_atoui,gmp_android_maui_v0.1.10_atoui'; const PLACE_CARD_THUMBNAIL_MIN_WIDTH = 350; diff --git a/client/ios/GoogleMapsA2UI/Sources/GoogleMapsA2UI/Resources/index.html b/client/ios/GoogleMapsA2UI/Sources/GoogleMapsA2UI/Resources/index.html index 2b583b9..bfd325e 100644 --- a/client/ios/GoogleMapsA2UI/Sources/GoogleMapsA2UI/Resources/index.html +++ b/client/ios/GoogleMapsA2UI/Sources/GoogleMapsA2UI/Resources/index.html @@ -27,1457 +27,7631 @@ v: "alpha", }); - - + + diff --git a/client/ios/GoogleMapsA2UI/Tests/A2UIAttributionIdTests.swift b/client/ios/GoogleMapsA2UI/Tests/A2UIAttributionIdTests.swift index 8500b1c..951b146 100644 --- a/client/ios/GoogleMapsA2UI/Tests/A2UIAttributionIdTests.swift +++ b/client/ios/GoogleMapsA2UI/Tests/A2UIAttributionIdTests.swift @@ -25,16 +25,16 @@ final class A2UIAttributionIdTests: XCTestCase { let htmlString = localContent.html XCTAssertTrue( - htmlString.contains("gmp_web_maui_v0.1.9_atoui"), - "Expected the generated attribution ID to contain the Web identifier 'gmp_web_maui_v0.1.9_atoui'" + htmlString.contains("gmp_web_maui_v0.1.10_atoui"), + "Expected the generated attribution ID to contain the Web identifier 'gmp_web_maui_v0.1.10_atoui'" ) XCTAssertTrue( - htmlString.contains("gmp_ios_maui_v0.1.9_atoui"), - "Expected the generated attribution ID to contain the iOS identifier 'gmp_ios_maui_v0.1.9_atoui'" + htmlString.contains("gmp_ios_maui_v0.1.10_atoui"), + "Expected the generated attribution ID to contain the iOS identifier 'gmp_ios_maui_v0.1.10_atoui'" ) XCTAssertTrue( - htmlString.contains("gmp_web_maui_v0.1.9_atoui,gmp_ios_maui_v0.1.9_atoui"), - "Expected the generated attribution ID to contain the combined Web and iOS identifier string 'gmp_web_maui_v0.1.9_atoui,gmp_ios_maui_v0.1.9_atoui'" + htmlString.contains("gmp_web_maui_v0.1.10_atoui,gmp_ios_maui_v0.1.10_atoui"), + "Expected the generated attribution ID to contain the combined Web and iOS identifier string 'gmp_web_maui_v0.1.10_atoui,gmp_ios_maui_v0.1.10_atoui'" ) } } diff --git a/client/ios/web_build/src/main.ts b/client/ios/web_build/src/main.ts index ce2c780..ce36a8a 100644 --- a/client/ios/web_build/src/main.ts +++ b/client/ios/web_build/src/main.ts @@ -19,7 +19,7 @@ import {type PropertyValues} from 'lit'; import {A2UICoreShell} from './core-shell'; (window as any)['A2UI_ATTRIBUTION_ID'] = - 'gmp_web_maui_v0.1.9_atoui,gmp_ios_maui_v0.1.9_atoui'; + 'gmp_web_maui_v0.1.10_atoui,gmp_ios_maui_v0.1.10_atoui'; const PLACE_CARD_THUMBNAIL_MIN_WIDTH = 350; diff --git a/client/web/package.json b/client/web/package.json index 474718a..16ab3ff 100644 --- a/client/web/package.json +++ b/client/web/package.json @@ -1,6 +1,6 @@ { "name": "@googlemaps/a2ui", - "version": "0.1.9", + "version": "0.1.10", "description": "Maps Agentic UI Toolkit Library", "main": "./dist/src/lit/index.js", "types": "./dist/src/lit/index.d.ts", diff --git a/client/web/src/lit/custom-components/google_map.ts b/client/web/src/lit/custom-components/google_map.ts index 4dddde3..c4c60d9 100644 --- a/client/web/src/lit/custom-components/google_map.ts +++ b/client/web/src/lit/custom-components/google_map.ts @@ -423,7 +423,7 @@ export class GoogleMap extends A2uiLitElement { color-scheme=${this.colorScheme ?? nothing} map-id="2d6e1a27a57efe3c9479f6fc" internal-usage-attribution-ids="${ - (window as any)['A2UI_ATTRIBUTION_ID'] || 'gmp_web_maui_v0.1.9_atoui'}" + (window as any)['A2UI_ATTRIBUTION_ID'] || 'gmp_web_maui_v0.1.10_atoui'}" >${ routes.map( (route: any) => html` @@ -434,7 +434,7 @@ export class GoogleMap extends A2uiLitElement { autofits-camera internal-usage-attribution-ids="${ (window as any)['A2UI_ATTRIBUTION_ID'] || - 'gmp_web_maui_v0.1.9_atoui'}" + 'gmp_web_maui_v0.1.10_atoui'}" >`)} diff --git a/client/web/src/lit/custom-components/google_map_test.ts b/client/web/src/lit/custom-components/google_map_test.ts index 319c3f6..ade250f 100644 --- a/client/web/src/lit/custom-components/google_map_test.ts +++ b/client/web/src/lit/custom-components/google_map_test.ts @@ -82,7 +82,7 @@ describe('GoogleMap Component', () => { // 4. Assert that the attribute has the correct fallback ID const attrId = gmpMap3d!.getAttribute('internal-usage-attribution-ids'); - expect(attrId).toBe('gmp_web_maui_v0.1.9_atoui'); + expect(attrId).toBe('gmp_web_maui_v0.1.10_atoui'); // Cleanup document.body.removeChild(element); diff --git a/client/web/src/lit/custom-components/place_details_compact.ts b/client/web/src/lit/custom-components/place_details_compact.ts index 01149cd..7104d18 100644 --- a/client/web/src/lit/custom-components/place_details_compact.ts +++ b/client/web/src/lit/custom-components/place_details_compact.ts @@ -121,7 +121,8 @@ export class PlaceDetailsCompact extends + (window as any)['A2UI_ATTRIBUTION_ID'] || + 'gmp_web_maui_v0.1.10_atoui'}"> diff --git a/client/web/src/lit/custom-components/place_details_compact_test.ts b/client/web/src/lit/custom-components/place_details_compact_test.ts index 2af05c6..0f172a9 100644 --- a/client/web/src/lit/custom-components/place_details_compact_test.ts +++ b/client/web/src/lit/custom-components/place_details_compact_test.ts @@ -40,7 +40,7 @@ describe('PlaceDetailsCompact Component', () => { // 4. Assert that the attribute has the correct fallback ID const attrId = detailsCompact!.getAttribute('internal-usage-attribution-ids'); - expect(attrId).toBe('gmp_web_maui_v0.1.9_atoui'); + expect(attrId).toBe('gmp_web_maui_v0.1.10_atoui'); // Cleanup document.body.removeChild(element); diff --git a/client/web/src/lit/custom-components/place_pin_marker_constants.ts b/client/web/src/lit/custom-components/place_pin_marker_constants.ts index e8d07c2..2a1b35e 100644 --- a/client/web/src/lit/custom-components/place_pin_marker_constants.ts +++ b/client/web/src/lit/custom-components/place_pin_marker_constants.ts @@ -191,6 +191,17 @@ export const PLACE_PIN_MARKER_STYLES: CSSResult = css` height: 20px; border-radius: 50%; z-index: 1; + /* + * The glyph SVGs are laid out inline on the text baseline, so the line box + * (and therefore the per-category offsets below) depends on the inherited + * text metrics. Pin them here, matching the marker labels' font, so a host + * page's global typography (e.g. a larger line-height or font-size on + * :root or body, which would otherwise be inherited) cannot shift the + * glyph inside the disc. + */ + font-family: "Google Sans", sans-serif; + font-size: 16px; + line-height: normal; /* * The per-POI circle colors are set as custom properties on the element * (see createPlacePinMarkerTemplate) so that both palettes travel with the diff --git a/client/web/src/lit/custom-components/place_pin_marker_test.ts b/client/web/src/lit/custom-components/place_pin_marker_test.ts index 379bc01..740c328 100644 --- a/client/web/src/lit/custom-components/place_pin_marker_test.ts +++ b/client/web/src/lit/custom-components/place_pin_marker_test.ts @@ -135,6 +135,48 @@ describe('PlacePinMarker Module', () => { expect(css).not.toContain('light-dark(#4c3cff'); }); + it('keeps the glyph position independent of host page typography', () => { + /** Returns the glyph's offset inside its disc under the given host font. */ + function glyphOffset(hostFont: string): {top: number, left: number} { + const host = document.createElement('div'); + host.style.font = hostFont; + document.body.append(host); + try { + const root = host.attachShadow({mode: 'open'}); + root.adoptedStyleSheets = [PLACE_PIN_MARKER_STYLES.styleSheet!]; + const template = createPlacePinMarkerTemplate({ + label: 'Cafe', + placePrimaryType: 'food_and_drink', + }); + // The builder appends to the