From 48892da7bbaa5e745a62e8cbf0ecbf3cb55669a9 Mon Sep 17 00:00:00 2001 From: Damian Glowala Date: Sun, 5 Apr 2026 10:40:29 +0200 Subject: [PATCH 1/9] refactor(google-maps): overhaul `` and `` --- .../GoogleMaps/ScriptGoogleMaps.vue | 408 ++++++++++-------- .../ScriptGoogleMapsOverlayView.vue | 407 +++++++++-------- playground/pages/index.vue | 6 - .../third-parties/google-maps/center.vue | 1 + .../third-parties/google-maps/emit-test.vue | 5 +- .../google-maps/geojson-test.vue | 3 +- .../third-parties/google-maps/markers.vue | 3 - .../pages/third-parties/google-maps/null.vue | 5 +- .../google-maps/nuxt-scripts.vue | 8 +- .../google-maps/overlay-animated.vue | 74 +--- .../google-maps/overlay-popup.vue | 21 +- .../pages/third-parties/google-maps/query.vue | 35 +- .../pages/third-parties/google-maps/sfcs.vue | 32 +- .../third-parties/google-maps/styled.vue | 19 - 14 files changed, 552 insertions(+), 475 deletions(-) delete mode 100644 playground/pages/third-parties/google-maps/styled.vue diff --git a/packages/script/src/runtime/components/GoogleMaps/ScriptGoogleMaps.vue b/packages/script/src/runtime/components/GoogleMaps/ScriptGoogleMaps.vue index 5ae811fb5..13664c793 100644 --- a/packages/script/src/runtime/components/GoogleMaps/ScriptGoogleMaps.vue +++ b/packages/script/src/runtime/components/GoogleMaps/ScriptGoogleMaps.vue @@ -1,129 +1,165 @@ - + + diff --git a/packages/script/src/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue b/packages/script/src/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue index ff96595b9..a3dcf0d0b 100644 --- a/packages/script/src/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue +++ b/packages/script/src/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue @@ -1,62 +1,89 @@ diff --git a/playground/pages/index.vue b/playground/pages/index.vue index 416dd71d0..dcfa1b1f8 100644 --- a/playground/pages/index.vue +++ b/playground/pages/index.vue @@ -187,12 +187,6 @@ const content = registryScripts logo: registryScripts.find(s => s.label === 'Google Maps')?.logo, registryScript: null, }, - { - name: 'Google Maps (Styled)', - path: '/third-parties/google-maps/styled', - logo: registryScripts.find(s => s.label === 'Google Maps')?.logo, - registryScript: null, - }, { name: 'Google Maps (SFCs)', path: '/third-parties/google-maps/sfcs', diff --git a/playground/pages/third-parties/google-maps/center.vue b/playground/pages/third-parties/google-maps/center.vue index 9ab6131b9..540822b5f 100644 --- a/playground/pages/third-parties/google-maps/center.vue +++ b/playground/pages/third-parties/google-maps/center.vue @@ -4,6 +4,7 @@ import { ref } from 'vue' const mapOptions = ref({ center: { lat: -34.397, lng: 150.644 }, }) + function changeQuery() { mapOptions.value = { center: { diff --git a/playground/pages/third-parties/google-maps/emit-test.vue b/playground/pages/third-parties/google-maps/emit-test.vue index 973a5b910..946a0210d 100644 --- a/playground/pages/third-parties/google-maps/emit-test.vue +++ b/playground/pages/third-parties/google-maps/emit-test.vue @@ -1,6 +1,5 @@ diff --git a/playground/pages/third-parties/google-maps/overlay-animated.vue b/playground/pages/third-parties/google-maps/overlay-animated.vue index b9f1db219..c931cf9f7 100644 --- a/playground/pages/third-parties/google-maps/overlay-animated.vue +++ b/playground/pages/third-parties/google-maps/overlay-animated.vue @@ -32,11 +32,9 @@ function close(id: number) { Click a marker to open/close. Uses data-state attribute for CSS enter/leave animations.

-
-
-

- {{ place.name }} -

- -
-
- ★ {{ place.rating }} - ({{ place.reviews }} reviews) -
-

- {{ place.desc }} -

+
+

+ {{ place.name }} +

+
+
+ ★ {{ place.rating }} + ({{ place.reviews }} reviews) +
+

+ {{ place.desc }} +

- diff --git a/playground/pages/third-parties/google-maps/overlay-popup.vue b/playground/pages/third-parties/google-maps/overlay-popup.vue index 950548543..fad901bd0 100644 --- a/playground/pages/third-parties/google-maps/overlay-popup.vue +++ b/playground/pages/third-parties/google-maps/overlay-popup.vue @@ -19,11 +19,9 @@ const places = [ Click a marker to show a fully custom popup. Click again or press × to close. Uses v-if for multiple markers.

-

{{ place.name }} @@ -60,9 +58,22 @@ const places = [ -

+ + diff --git a/playground/pages/third-parties/google-maps/query.vue b/playground/pages/third-parties/google-maps/query.vue index 9a6448700..2d045aa5b 100644 --- a/playground/pages/third-parties/google-maps/query.vue +++ b/playground/pages/third-parties/google-maps/query.vue @@ -1,15 +1,29 @@ @@ -17,10 +31,13 @@ function changeQuery() {
diff --git a/playground/pages/third-parties/google-maps/sfcs.vue b/playground/pages/third-parties/google-maps/sfcs.vue index c3617dac8..cfac77046 100644 --- a/playground/pages/third-parties/google-maps/sfcs.vue +++ b/playground/pages/third-parties/google-maps/sfcs.vue @@ -65,22 +65,22 @@ const zoom = ref(8) const googleMapsRef = useTemplateRef('googleMapsRef') -whenever(() => googleMapsRef.value?.googleMaps, (googleMaps) => { +whenever(() => googleMapsRef.value?.mapsApi, (mapsApi) => { heatmapLayerData.value.push(...[ - new googleMaps.LatLng(-33.8688, 151.2093), - new googleMaps.LatLng(-33.8690, 151.2100), - new googleMaps.LatLng(-33.8700, 151.2150), - new googleMaps.LatLng(-33.8710, 151.2200), - new googleMaps.LatLng(-33.8720, 151.2250), - new googleMaps.LatLng(-33.8730, 151.2300), - new googleMaps.LatLng(-33.8740, 151.2350), - new googleMaps.LatLng(-33.8750, 151.2400), - new googleMaps.LatLng(-33.8760, 151.2450), - new googleMaps.LatLng(-33.8770, 151.2500), - new googleMaps.LatLng(-33.8780, 151.2550), - new googleMaps.LatLng(-33.8790, 151.2600), - new googleMaps.LatLng(-33.8800, 151.2650), - new googleMaps.LatLng(-33.8810, 151.2700), + new mapsApi.LatLng(-33.8688, 151.2093), + new mapsApi.LatLng(-33.8690, 151.2100), + new mapsApi.LatLng(-33.8700, 151.2150), + new mapsApi.LatLng(-33.8710, 151.2200), + new mapsApi.LatLng(-33.8720, 151.2250), + new mapsApi.LatLng(-33.8730, 151.2300), + new mapsApi.LatLng(-33.8740, 151.2350), + new mapsApi.LatLng(-33.8750, 151.2400), + new mapsApi.LatLng(-33.8760, 151.2450), + new mapsApi.LatLng(-33.8770, 151.2500), + new mapsApi.LatLng(-33.8780, 151.2550), + new mapsApi.LatLng(-33.8790, 151.2600), + new mapsApi.LatLng(-33.8800, 151.2650), + new mapsApi.LatLng(-33.8810, 151.2700), ]) }) @@ -92,10 +92,10 @@ whenever(() => googleMapsRef.value?.googleMaps, (googleMaps) => { api-key="AIzaSyAOEIQ_xOdLx2dNwnFMzyJoswwvPCTcGzU" :width="1280" :height="720" - :zoom="zoom" :map-options="{ center: { lat: -34.397, lng: 150.644 }, mapId: 'DEMO_MAP_ID', + zoom, }" > -const mapOptions = { - center: { lat: -34.397, lng: 150.644 }, - styles: [{ elementType: 'labels', stylers: [{ visibility: 'off' }, { color: '#f49f53' }] }, { featureType: 'landscape', stylers: [{ color: '#f9ddc5' }, { lightness: -7 }] }, { featureType: 'road', stylers: [{ color: '#813033' }, { lightness: 43 }] }, { featureType: 'poi.business', stylers: [{ color: '#645c20' }, { lightness: 38 }] }, { featureType: 'water', stylers: [{ color: '#1994bf' }, { saturation: -69 }, { gamma: 0.99 }, { lightness: 43 }] }, { featureType: 'road.local', elementType: 'geometry.fill', stylers: [{ color: '#f19f53' }, { weight: 1.3 }, { visibility: 'on' }, { lightness: 16 }] }, { featureType: 'poi.business' }, { featureType: 'poi.park', stylers: [{ color: '#645c20' }, { lightness: 39 }] }, { featureType: 'poi.school', stylers: [{ color: '#a95521' }, { lightness: 35 }] }, {}, { featureType: 'poi.medical', elementType: 'geometry.fill', stylers: [{ color: '#813033' }, { lightness: 38 }, { visibility: 'off' }] }, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, { elementType: 'labels' }, { featureType: 'poi.sports_complex', stylers: [{ color: '#9e5916' }, { lightness: 32 }] }, {}, { featureType: 'poi.government', stylers: [{ color: '#9e5916' }, { lightness: 46 }] }, { featureType: 'transit.station', stylers: [{ visibility: 'off' }] }, { featureType: 'transit.line', stylers: [{ color: '#813033' }, { lightness: 22 }] }, { featureType: 'transit', stylers: [{ lightness: 38 }] }, { featureType: 'road.local', elementType: 'geometry.stroke', stylers: [{ color: '#f19f53' }, { lightness: -10 }] }, {}, {}, {}], -} satisfies google.maps.MapOptions - - - From 0ea65d821f199d10af74b7c3bbca8e8897eb970d Mon Sep 17 00:00:00 2001 From: Damian Glowala Date: Sun, 5 Apr 2026 10:42:59 +0200 Subject: [PATCH 2/9] chore: lint --- test/e2e-dev/first-party.test.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/e2e-dev/first-party.test.ts b/test/e2e-dev/first-party.test.ts index 7397d106a..b69e24c2f 100644 --- a/test/e2e-dev/first-party.test.ts +++ b/test/e2e-dev/first-party.test.ts @@ -1,9 +1,9 @@ import { existsSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs' import { join } from 'node:path' import { createResolver } from '@nuxt/kit' +import { getProxyDef, registry } from '@nuxt/scripts/registry' import { $fetch, getBrowser, setup, url } from '@nuxt/test-utils/e2e' import { afterAll, beforeAll, describe, expect, it } from 'vitest' -import { getProxyDef, registry } from '@nuxt/scripts/registry' const { resolve } = createResolver(import.meta.url) const fixtureDir = resolve('../fixtures/first-party') @@ -96,7 +96,6 @@ const ANONYMIZED_FINGERPRINT_PARAMS = [ 'client_user_agent', ] - /** Check that a capture has a fully-resolved privacy object with all six boolean flags. */ function hasResolvedPrivacy(c: Record): boolean { const p = c.privacy From 6fcebc96119c8894e1a81a7716867f073187fcdf Mon Sep 17 00:00:00 2001 From: Damian Glowala Date: Sun, 5 Apr 2026 10:51:47 +0200 Subject: [PATCH 3/9] add missing shallowRef import --- .../components/GoogleMaps/ScriptGoogleMapsOverlayView.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/script/src/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue b/packages/script/src/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue index a3dcf0d0b..f8e1db349 100644 --- a/packages/script/src/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue +++ b/packages/script/src/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue @@ -1,7 +1,7 @@