@nuxt/scripts 1.0.0-beta.6 → 1.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/devtools-client/200.html +1 -0
- package/dist/devtools-client/404.html +1 -0
- package/dist/devtools-client/_fonts/4ppnHhMi-pBsWSPo7mY0avYxlDoAg1N3PTzCwXLZ5rA-d9oibkGnTd1JL3tc_xnaVgBLYmOB8kjrK2cvZaqwj9s.woff2 +0 -0
- package/dist/devtools-client/_fonts/4qBuU9MRVUlPZNPSF7Xom_sK8RBEnfYu-9VXFrdq8A8-8TDwLE1HAj1sQn7XxVWtM_7sIaPM-DTdO3Pf8U2DF1U.woff2 +0 -0
- package/dist/devtools-client/_fonts/6dYsbWUd_BpKJ7mdDihgOcya1gHXLpJBuMYXux3WMjE-q3fYNS8YbW5n7ZeXI2vSNgkRWW5VDPKAl51SNTjG2qk.woff2 +0 -0
- package/dist/devtools-client/_fonts/Lr-hqqZZsYmCt0ITUlr1CUrWim9fsKvoDFZliMxgNHY-iTa_Yt_PzhOY9TX7ZXdSlEPim6iRt92xhECwaxWxd5w.woff2 +0 -0
- package/dist/devtools-client/_fonts/OknHvWI6KtYn1JQBzX7eSpNDBQ8520F9TvSUJYkVf6A-xeZn9253svK_8Q2LD0XEruY_MnEsuCRO5LenPoggC0Y.woff2 +0 -0
- package/dist/devtools-client/_fonts/PV2hrQG6wq5BlIPDjdL1IcOflycaghyt5MHzlBqZtlo-lb_WexLz3VZqfTN0oi554iBH5tT2j2UFEV-XErCAS3E.woff2 +0 -0
- package/dist/devtools-client/_fonts/UA7OtwYHwGN_HjcVGTdmiQxUit7FlqkCwxVUWSeXVnQ-B4OXCFOL_tWrYODpQTc07aMaj0c2cewTOmBRWR9tD-A.woff2 +0 -0
- package/dist/devtools-client/_fonts/VE4cDVCv5MxbFM7ZLoLCGbIpNd71zhp7MDI9lmN5Y7I-xZyDYCUVrd6LV8eVGF3Um3UZjBFuUtDGtvdyTBBRYBo.woff2 +0 -0
- package/dist/devtools-client/_fonts/fVoGbnMbBFd5L9BBp9fUPavUSkZ_EmsQNSyadkT-108-U4T0khaeLQSIhtt9eVvaCEKJjtWJ4ioRJOf8hvqkWY0.woff2 +0 -0
- package/dist/devtools-client/_fonts/lQAxeCEs1R0Lw-H9XRU1RlOARQN8J6npRsPjyEDMe5s-_DUSLEkO3tKTuun_gSnDLoQPVEnpOnyqZMOw0ByZ6PA.woff2 +0 -0
- package/dist/devtools-client/_fonts/lntlqNHKLV2n82yTwMde70QqOjcfLE2XJ5oKZ3vRPWc-z6TxpIZQdWXztWLr9_OFWqt_WJJoeGtuK_-XQMZGQwE.woff2 +0 -0
- package/dist/devtools-client/_fonts/qxAYvKsXWeYv731eb-h5TRurcdIP_W44mpNdX-HABAk-zUDeMEFlNtNbrwvT9JxLEBg0TphGy70O6RfIoIX_ZwU.woff2 +0 -0
- package/dist/devtools-client/_nuxt/B3kN3DAy.js +1 -0
- package/dist/devtools-client/_nuxt/B8PEiB0p.js +1 -0
- package/dist/devtools-client/_nuxt/C8jhSQ8l.js +1 -0
- package/dist/devtools-client/_nuxt/CJD6wrkT.js +188 -0
- package/dist/devtools-client/_nuxt/CfOsp0mU.js +1 -0
- package/dist/devtools-client/_nuxt/DKL6PHO3.js +1 -0
- package/dist/devtools-client/_nuxt/ajngqPCs.js +1 -0
- package/dist/devtools-client/_nuxt/builds/latest.json +1 -0
- package/dist/devtools-client/_nuxt/builds/meta/b800a0be-5cab-4ea6-89e3-dd3a85690a73.json +1 -0
- package/dist/devtools-client/_nuxt/dlaR8P-P.js +1 -0
- package/dist/devtools-client/_nuxt/entry.BwpOBArY.css +1 -0
- package/dist/devtools-client/_nuxt/error-404.CvOVjXeC.css +1 -0
- package/dist/devtools-client/_nuxt/error-500.BIm53nmx.css +1 -0
- package/dist/devtools-client/_nuxt/first-party.C8Ha4JLM.css +1 -0
- package/dist/devtools-client/_nuxt/index.CA-OpSj0.css +1 -0
- package/dist/devtools-client/_nuxt/registry.B9lnjF_b.css +1 -0
- package/dist/devtools-client/_nuxt/wDzz0qaB.js +1 -0
- package/dist/devtools-client/docs/index.html +1 -0
- package/dist/devtools-client/first-party/index.html +1 -0
- package/dist/devtools-client/index.html +1 -0
- package/dist/devtools-client/registry/index.html +1 -0
- package/dist/module.d.mts +29 -84
- package/dist/module.d.ts +121 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +941 -757
- package/dist/registry.d.mts +91 -4
- package/dist/registry.d.ts +93 -0
- package/dist/registry.mjs +669 -324
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.d.vue.ts +15 -79
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue +78 -180
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue.d.ts +15 -79
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.d.vue.ts +6 -55
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.vue +12 -83
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.vue.d.ts +6 -55
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsCircle.d.vue.ts +5 -1
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsCircle.vue +24 -38
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsCircle.vue.d.ts +5 -1
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsGeoJson.d.vue.ts +43 -0
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsGeoJson.vue +60 -0
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsGeoJson.vue.d.ts +43 -0
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsHeatmapLayer.d.vue.ts +4 -0
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsHeatmapLayer.vue +22 -26
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsHeatmapLayer.vue.d.ts +4 -0
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsInfoWindow.d.vue.ts +9 -5
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsInfoWindow.vue +56 -57
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsInfoWindow.vue.d.ts +9 -5
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.d.vue.ts +24 -41
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.vue +69 -73
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.vue.d.ts +24 -41
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.d.vue.ts +36 -4
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.vue +82 -37
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.vue.d.ts +36 -4
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.d.vue.ts +78 -0
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue +222 -0
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue.d.ts +78 -0
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPinElement.d.vue.ts +10 -3
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPinElement.vue +9 -41
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPinElement.vue.d.ts +10 -3
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolygon.d.vue.ts +7 -3
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolygon.vue +23 -38
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolygon.vue.d.ts +7 -3
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolyline.d.vue.ts +7 -3
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolyline.vue +23 -38
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolyline.vue.d.ts +7 -3
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsRectangle.d.vue.ts +7 -3
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsRectangle.vue +24 -38
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsRectangle.vue.d.ts +7 -3
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsStaticMap.d.vue.ts +200 -0
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsStaticMap.vue +165 -0
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsStaticMap.vue.d.ts +200 -0
- package/dist/runtime/components/GoogleMaps/bindGoogleMapsEvents.d.ts +13 -0
- package/dist/runtime/components/GoogleMaps/bindGoogleMapsEvents.js +8 -0
- package/dist/runtime/components/GoogleMaps/injectionKeys.d.ts +10 -0
- package/dist/runtime/components/GoogleMaps/injectionKeys.js +2 -0
- package/dist/runtime/components/GoogleMaps/useGoogleMapsResource.d.ts +48 -0
- package/dist/runtime/components/GoogleMaps/useGoogleMapsResource.js +51 -0
- package/dist/runtime/components/ScriptBlueskyEmbed.d.vue.ts +85 -0
- package/dist/runtime/components/ScriptBlueskyEmbed.vue +88 -0
- package/dist/runtime/components/ScriptBlueskyEmbed.vue.d.ts +85 -0
- package/dist/runtime/components/ScriptCrisp.vue +1 -1
- package/dist/runtime/components/ScriptGoogleAdsense.vue +1 -1
- package/dist/runtime/components/ScriptGravatar.d.vue.ts +22 -0
- package/dist/runtime/components/ScriptGravatar.vue +46 -0
- package/dist/runtime/components/ScriptGravatar.vue.d.ts +22 -0
- package/dist/runtime/components/ScriptInstagramEmbed.d.vue.ts +1 -2
- package/dist/runtime/components/ScriptInstagramEmbed.vue +8 -3
- package/dist/runtime/components/ScriptInstagramEmbed.vue.d.ts +1 -2
- package/dist/runtime/components/ScriptIntercom.vue +4 -3
- package/dist/runtime/components/ScriptPayPalButtons.d.vue.ts +43 -32
- package/dist/runtime/components/ScriptPayPalButtons.vue +48 -79
- package/dist/runtime/components/ScriptPayPalButtons.vue.d.ts +43 -32
- package/dist/runtime/components/ScriptPayPalMessages.d.vue.ts +37 -23
- package/dist/runtime/components/ScriptPayPalMessages.vue +46 -50
- package/dist/runtime/components/ScriptPayPalMessages.vue.d.ts +37 -23
- package/dist/runtime/components/ScriptStripePricingTable.vue +2 -2
- package/dist/runtime/components/ScriptVimeoPlayer.d.vue.ts +9 -0
- package/dist/runtime/components/ScriptVimeoPlayer.vue +13 -10
- package/dist/runtime/components/ScriptVimeoPlayer.vue.d.ts +9 -0
- package/dist/runtime/components/ScriptXEmbed.d.vue.ts +0 -2
- package/dist/runtime/components/ScriptXEmbed.vue +14 -8
- package/dist/runtime/components/ScriptXEmbed.vue.d.ts +0 -2
- package/dist/runtime/components/ScriptYouTubePlayer.d.vue.ts +2 -2
- package/dist/runtime/components/ScriptYouTubePlayer.vue +11 -5
- package/dist/runtime/components/ScriptYouTubePlayer.vue.d.ts +2 -2
- package/dist/runtime/composables/useScript.js +148 -8
- package/dist/runtime/composables/useScriptEventPage.js +2 -2
- package/dist/runtime/composables/useScriptTriggerConsent.d.ts +10 -0
- package/dist/runtime/composables/useScriptTriggerConsent.js +33 -20
- package/dist/runtime/composables/useScriptTriggerElement.js +1 -1
- package/dist/runtime/composables/useScriptTriggerIdleTimeout.js +1 -1
- package/dist/runtime/devtools-standalone-bridge.client.d.ts +8 -0
- package/dist/runtime/devtools-standalone-bridge.client.js +50 -0
- package/dist/runtime/registry/bing-uet.d.ts +20 -0
- package/dist/runtime/registry/bing-uet.js +29 -0
- package/dist/runtime/registry/bluesky-embed.d.ts +116 -0
- package/dist/runtime/registry/bluesky-embed.js +72 -0
- package/dist/runtime/registry/clarity.d.ts +10 -15
- package/dist/runtime/registry/clarity.js +22 -31
- package/dist/runtime/registry/cloudflare-web-analytics.d.ts +2 -13
- package/dist/runtime/registry/cloudflare-web-analytics.js +2 -14
- package/dist/runtime/registry/crisp.d.ts +10 -40
- package/dist/runtime/registry/crisp.js +2 -33
- package/dist/runtime/registry/databuddy-analytics.d.ts +2 -35
- package/dist/runtime/registry/databuddy-analytics.js +20 -45
- package/dist/runtime/registry/fathom-analytics.d.ts +7 -26
- package/dist/runtime/registry/fathom-analytics.js +3 -25
- package/dist/runtime/registry/google-adsense.d.ts +3 -11
- package/dist/runtime/registry/google-adsense.js +2 -11
- package/dist/runtime/registry/google-analytics.d.ts +3 -5
- package/dist/runtime/registry/google-analytics.js +3 -8
- package/dist/runtime/registry/google-maps.d.ts +3 -9
- package/dist/runtime/registry/google-maps.js +2 -8
- package/dist/runtime/registry/google-recaptcha.d.ts +2 -6
- package/dist/runtime/registry/google-recaptcha.js +4 -12
- package/dist/runtime/registry/google-sign-in.d.ts +2 -13
- package/dist/runtime/registry/google-sign-in.js +2 -22
- package/dist/runtime/registry/google-tag-manager.d.ts +3 -28
- package/dist/runtime/registry/google-tag-manager.js +4 -27
- package/dist/runtime/registry/gravatar.d.ts +26 -0
- package/dist/runtime/registry/gravatar.js +36 -0
- package/dist/runtime/registry/hotjar.d.ts +4 -6
- package/dist/runtime/registry/hotjar.js +2 -5
- package/dist/runtime/registry/instagram-embed.d.ts +3 -18
- package/dist/runtime/registry/instagram-embed.js +4 -19
- package/dist/runtime/registry/intercom.d.ts +5 -13
- package/dist/runtime/registry/intercom.js +2 -12
- package/dist/runtime/registry/matomo-analytics.d.ts +3 -12
- package/dist/runtime/registry/matomo-analytics.js +3 -12
- package/dist/runtime/registry/meta-pixel.d.ts +4 -6
- package/dist/runtime/registry/meta-pixel.js +2 -4
- package/dist/runtime/registry/mixpanel-analytics.d.ts +22 -0
- package/dist/runtime/registry/mixpanel-analytics.js +46 -0
- package/dist/runtime/registry/npm.d.ts +3 -7
- package/dist/runtime/registry/npm.js +2 -9
- package/dist/runtime/registry/paypal.d.ts +4 -25
- package/dist/runtime/registry/paypal.js +3 -66
- package/dist/runtime/registry/plausible-analytics.js +19 -14
- package/dist/runtime/registry/posthog.d.ts +10 -12
- package/dist/runtime/registry/posthog.js +4 -13
- package/dist/runtime/registry/reddit-pixel.d.ts +5 -6
- package/dist/runtime/registry/reddit-pixel.js +2 -4
- package/dist/runtime/registry/rybbit-analytics.d.ts +2 -14
- package/dist/runtime/registry/rybbit-analytics.js +10 -20
- package/dist/runtime/registry/schemas.d.ts +982 -0
- package/dist/runtime/registry/schemas.js +937 -0
- package/dist/runtime/registry/segment.d.ts +2 -5
- package/dist/runtime/registry/segment.js +2 -5
- package/dist/runtime/registry/snapchat-pixel.d.ts +5 -34
- package/dist/runtime/registry/snapchat-pixel.js +2 -20
- package/dist/runtime/registry/stripe.d.ts +3 -4
- package/dist/runtime/registry/stripe.js +2 -4
- package/dist/runtime/registry/tiktok-pixel.d.ts +4 -7
- package/dist/runtime/registry/tiktok-pixel.js +2 -6
- package/dist/runtime/registry/umami-analytics.d.ts +2 -31
- package/dist/runtime/registry/umami-analytics.js +2 -36
- package/dist/runtime/registry/vercel-analytics.d.ts +29 -0
- package/dist/runtime/registry/vercel-analytics.js +84 -0
- package/dist/runtime/registry/vimeo-player.d.ts +2 -2
- package/dist/runtime/registry/vimeo-player.js +1 -1
- package/dist/runtime/registry/x-embed.d.ts +3 -17
- package/dist/runtime/registry/x-embed.js +3 -18
- package/dist/runtime/registry/x-pixel.d.ts +4 -7
- package/dist/runtime/registry/x-pixel.js +2 -5
- package/dist/runtime/registry/youtube-player.d.ts +7 -7
- package/dist/runtime/registry/youtube-player.js +1 -1
- package/dist/runtime/server/bluesky-embed-image.d.ts +2 -0
- package/dist/runtime/server/bluesky-embed-image.js +7 -0
- package/dist/runtime/server/bluesky-embed.d.ts +16 -0
- package/dist/runtime/server/bluesky-embed.js +59 -0
- package/dist/runtime/server/google-maps-geocode-proxy.d.ts +2 -0
- package/dist/runtime/server/google-maps-geocode-proxy.js +34 -0
- package/dist/runtime/server/google-static-maps-proxy.js +2 -13
- package/dist/runtime/server/gravatar-proxy.d.ts +2 -0
- package/dist/runtime/server/gravatar-proxy.js +46 -0
- package/dist/runtime/server/instagram-embed-asset.js +8 -41
- package/dist/runtime/server/instagram-embed-image.js +6 -53
- package/dist/runtime/server/instagram-embed.d.ts +16 -0
- package/dist/runtime/server/instagram-embed.js +176 -35
- package/dist/runtime/server/proxy-handler.js +142 -95
- package/dist/runtime/server/utils/image-proxy.d.ts +12 -0
- package/dist/runtime/server/utils/image-proxy.js +70 -0
- package/dist/runtime/server/utils/privacy.d.ts +1 -10
- package/dist/runtime/server/utils/privacy.js +60 -40
- package/dist/runtime/server/x-embed-image.js +5 -49
- package/dist/runtime/server/x-embed.js +3 -2
- package/dist/runtime/types.d.ts +272 -51
- package/dist/runtime/types.js +0 -2
- package/dist/runtime/utils/pure.d.ts +1 -1
- package/dist/runtime/utils.d.ts +6 -4
- package/dist/runtime/utils.js +31 -14
- package/dist/stats.d.mts +202 -0
- package/dist/stats.d.ts +202 -0
- package/dist/stats.mjs +3875 -0
- package/dist/types-source.d.mts +17 -0
- package/dist/types-source.d.ts +17 -0
- package/dist/types-source.mjs +3414 -0
- package/dist/types.d.mts +4 -2
- package/package.json +35 -61
- package/README.md +0 -86
- package/dist/client/200.html +0 -1
- package/dist/client/404.html +0 -1
- package/dist/client/_nuxt/BPQ3VLAy.js +0 -1
- package/dist/client/_nuxt/BpR-tlZc.js +0 -1
- package/dist/client/_nuxt/CBbMDhE2.js +0 -162
- package/dist/client/_nuxt/CEMAW3aB.js +0 -1
- package/dist/client/_nuxt/MWkREqzj.js +0 -1
- package/dist/client/_nuxt/builds/latest.json +0 -1
- package/dist/client/_nuxt/builds/meta/762d443a-0880-424f-bda8-2b32b39d43ec.json +0 -1
- package/dist/client/_nuxt/entry.D45OuV0w.css +0 -1
- package/dist/client/_nuxt/error-404.B57D-jUQ.css +0 -1
- package/dist/client/_nuxt/error-500.DTHUW7BI.css +0 -1
- package/dist/client/index.html +0 -1
- package/dist/runtime/components/ScriptPayPalMarks.d.vue.ts +0 -52
- package/dist/runtime/components/ScriptPayPalMarks.vue +0 -69
- package/dist/runtime/components/ScriptPayPalMarks.vue.d.ts +0 -52
- package/dist/runtime/validation/mock.d.ts +0 -42
- package/dist/runtime/validation/mock.js +0 -21
- package/dist/runtime/validation/valibot.d.ts +0 -1
- package/dist/runtime/validation/valibot.js +0 -1
- /package/dist/{client → devtools-client}/_nuxt/CVO1_9PV.js +0 -0
- /package/dist/{client → devtools-client}/_nuxt/Cp-IABpG.js +0 -0
- /package/dist/{client → devtools-client}/_nuxt/D0r3Knsf.js +0 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
export type StaticMapFormat = 'png' | 'jpg' | 'gif' | 'png8' | 'png32' | 'jpg-baseline';
|
|
2
|
+
export type StaticMapType = 'roadmap' | 'satellite' | 'terrain' | 'hybrid';
|
|
3
|
+
import type { ImgHTMLAttributes, ReservedProps } from 'vue';
|
|
4
|
+
declare const _default: typeof __VLS_export;
|
|
5
|
+
export default _default;
|
|
6
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
7
|
+
/**
|
|
8
|
+
* The center of the map. Accepts a "lat,lng" string or a LatLngLiteral object.
|
|
9
|
+
*/
|
|
10
|
+
center?: string | {
|
|
11
|
+
lat: number;
|
|
12
|
+
lng: number;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Zoom level (0-21).
|
|
16
|
+
*/
|
|
17
|
+
zoom?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Explicit pixel size for the Static Maps API request, e.g. "640x400".
|
|
20
|
+
* When omitted, the component measures its rendered dimensions on mount and uses those.
|
|
21
|
+
* Falls back to "640x400" during SSR or when dimensions can't be measured.
|
|
22
|
+
*/
|
|
23
|
+
size?: `${number}x${number}`;
|
|
24
|
+
/**
|
|
25
|
+
* Device pixel ratio for the static map image (1 or 2).
|
|
26
|
+
*/
|
|
27
|
+
scale?: 1 | 2;
|
|
28
|
+
/**
|
|
29
|
+
* Image format.
|
|
30
|
+
*/
|
|
31
|
+
format?: StaticMapFormat;
|
|
32
|
+
/**
|
|
33
|
+
* Map type.
|
|
34
|
+
*/
|
|
35
|
+
maptype?: StaticMapType;
|
|
36
|
+
/**
|
|
37
|
+
* Cloud-based map styling ID.
|
|
38
|
+
*/
|
|
39
|
+
mapId?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Map markers. Supports multiple markers via string array.
|
|
42
|
+
* @see https://developers.google.com/maps/documentation/maps-static/start#Markers
|
|
43
|
+
*/
|
|
44
|
+
markers?: string | string[];
|
|
45
|
+
/**
|
|
46
|
+
* Polyline paths. Supports multiple paths via string array.
|
|
47
|
+
* @see https://developers.google.com/maps/documentation/maps-static/start#Paths
|
|
48
|
+
*/
|
|
49
|
+
path?: string | string[];
|
|
50
|
+
/**
|
|
51
|
+
* Locations that should be visible on the map.
|
|
52
|
+
*/
|
|
53
|
+
visible?: string | string[];
|
|
54
|
+
/**
|
|
55
|
+
* Map styling. Accepts raw Static Maps API style strings or Google Maps JS API MapTypeStyle objects.
|
|
56
|
+
*/
|
|
57
|
+
style?: string | string[] | google.maps.MapTypeStyle[];
|
|
58
|
+
/**
|
|
59
|
+
* Language code for map labels.
|
|
60
|
+
*/
|
|
61
|
+
language?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Region bias.
|
|
64
|
+
*/
|
|
65
|
+
region?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Digital signature for requests without an API key.
|
|
68
|
+
*/
|
|
69
|
+
signature?: string;
|
|
70
|
+
/**
|
|
71
|
+
* API key override. When the proxy is enabled, this is ignored and the server-side key is used instead.
|
|
72
|
+
*/
|
|
73
|
+
apiKey?: string;
|
|
74
|
+
/**
|
|
75
|
+
* CSS width for the container element.
|
|
76
|
+
*/
|
|
77
|
+
width?: number | string;
|
|
78
|
+
/**
|
|
79
|
+
* CSS height for the container element.
|
|
80
|
+
*/
|
|
81
|
+
height?: number | string;
|
|
82
|
+
/**
|
|
83
|
+
* Image loading strategy.
|
|
84
|
+
*/
|
|
85
|
+
loading?: "eager" | "lazy";
|
|
86
|
+
/**
|
|
87
|
+
* Object-fit for the image within its container.
|
|
88
|
+
*/
|
|
89
|
+
objectFit?: "cover" | "contain" | "fill" | "none" | "scale-down";
|
|
90
|
+
/**
|
|
91
|
+
* Additional attributes for the `<img>` element.
|
|
92
|
+
*/
|
|
93
|
+
imgAttrs?: ImgHTMLAttributes & ReservedProps & Record<string, unknown>;
|
|
94
|
+
}, {
|
|
95
|
+
src: import("vue").ComputedRef<string>;
|
|
96
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
97
|
+
/**
|
|
98
|
+
* The center of the map. Accepts a "lat,lng" string or a LatLngLiteral object.
|
|
99
|
+
*/
|
|
100
|
+
center?: string | {
|
|
101
|
+
lat: number;
|
|
102
|
+
lng: number;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Zoom level (0-21).
|
|
106
|
+
*/
|
|
107
|
+
zoom?: number;
|
|
108
|
+
/**
|
|
109
|
+
* Explicit pixel size for the Static Maps API request, e.g. "640x400".
|
|
110
|
+
* When omitted, the component measures its rendered dimensions on mount and uses those.
|
|
111
|
+
* Falls back to "640x400" during SSR or when dimensions can't be measured.
|
|
112
|
+
*/
|
|
113
|
+
size?: `${number}x${number}`;
|
|
114
|
+
/**
|
|
115
|
+
* Device pixel ratio for the static map image (1 or 2).
|
|
116
|
+
*/
|
|
117
|
+
scale?: 1 | 2;
|
|
118
|
+
/**
|
|
119
|
+
* Image format.
|
|
120
|
+
*/
|
|
121
|
+
format?: StaticMapFormat;
|
|
122
|
+
/**
|
|
123
|
+
* Map type.
|
|
124
|
+
*/
|
|
125
|
+
maptype?: StaticMapType;
|
|
126
|
+
/**
|
|
127
|
+
* Cloud-based map styling ID.
|
|
128
|
+
*/
|
|
129
|
+
mapId?: string;
|
|
130
|
+
/**
|
|
131
|
+
* Map markers. Supports multiple markers via string array.
|
|
132
|
+
* @see https://developers.google.com/maps/documentation/maps-static/start#Markers
|
|
133
|
+
*/
|
|
134
|
+
markers?: string | string[];
|
|
135
|
+
/**
|
|
136
|
+
* Polyline paths. Supports multiple paths via string array.
|
|
137
|
+
* @see https://developers.google.com/maps/documentation/maps-static/start#Paths
|
|
138
|
+
*/
|
|
139
|
+
path?: string | string[];
|
|
140
|
+
/**
|
|
141
|
+
* Locations that should be visible on the map.
|
|
142
|
+
*/
|
|
143
|
+
visible?: string | string[];
|
|
144
|
+
/**
|
|
145
|
+
* Map styling. Accepts raw Static Maps API style strings or Google Maps JS API MapTypeStyle objects.
|
|
146
|
+
*/
|
|
147
|
+
style?: string | string[] | google.maps.MapTypeStyle[];
|
|
148
|
+
/**
|
|
149
|
+
* Language code for map labels.
|
|
150
|
+
*/
|
|
151
|
+
language?: string;
|
|
152
|
+
/**
|
|
153
|
+
* Region bias.
|
|
154
|
+
*/
|
|
155
|
+
region?: string;
|
|
156
|
+
/**
|
|
157
|
+
* Digital signature for requests without an API key.
|
|
158
|
+
*/
|
|
159
|
+
signature?: string;
|
|
160
|
+
/**
|
|
161
|
+
* API key override. When the proxy is enabled, this is ignored and the server-side key is used instead.
|
|
162
|
+
*/
|
|
163
|
+
apiKey?: string;
|
|
164
|
+
/**
|
|
165
|
+
* CSS width for the container element.
|
|
166
|
+
*/
|
|
167
|
+
width?: number | string;
|
|
168
|
+
/**
|
|
169
|
+
* CSS height for the container element.
|
|
170
|
+
*/
|
|
171
|
+
height?: number | string;
|
|
172
|
+
/**
|
|
173
|
+
* Image loading strategy.
|
|
174
|
+
*/
|
|
175
|
+
loading?: "eager" | "lazy";
|
|
176
|
+
/**
|
|
177
|
+
* Object-fit for the image within its container.
|
|
178
|
+
*/
|
|
179
|
+
objectFit?: "cover" | "contain" | "fill" | "none" | "scale-down";
|
|
180
|
+
/**
|
|
181
|
+
* Additional attributes for the `<img>` element.
|
|
182
|
+
*/
|
|
183
|
+
imgAttrs?: ImgHTMLAttributes & ReservedProps & Record<string, unknown>;
|
|
184
|
+
}> & Readonly<{}>, {
|
|
185
|
+
loading: "eager" | "lazy";
|
|
186
|
+
width: number | string;
|
|
187
|
+
height: number | string;
|
|
188
|
+
zoom: number;
|
|
189
|
+
objectFit: "cover" | "contain" | "fill" | "none" | "scale-down";
|
|
190
|
+
scale: 1 | 2;
|
|
191
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
192
|
+
default?: (props: {
|
|
193
|
+
src: string;
|
|
194
|
+
}) => any;
|
|
195
|
+
}>;
|
|
196
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
197
|
+
new (): {
|
|
198
|
+
$slots: S;
|
|
199
|
+
};
|
|
200
|
+
};
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { scriptRuntimeConfig } from "#nuxt-scripts/utils";
|
|
3
|
+
import { defu } from "defu";
|
|
4
|
+
import { useHead, useRuntimeConfig } from "nuxt/app";
|
|
5
|
+
import { withQuery } from "ufo";
|
|
6
|
+
import { computed, onMounted, ref } from "vue";
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<script setup>
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
center: { type: [String, Object], required: false },
|
|
12
|
+
zoom: { type: Number, required: false, default: 15 },
|
|
13
|
+
size: { type: null, required: false },
|
|
14
|
+
scale: { type: Number, required: false, default: 2 },
|
|
15
|
+
format: { type: String, required: false },
|
|
16
|
+
maptype: { type: String, required: false },
|
|
17
|
+
mapId: { type: String, required: false },
|
|
18
|
+
markers: { type: [String, Array], required: false },
|
|
19
|
+
path: { type: [String, Array], required: false },
|
|
20
|
+
visible: { type: [String, Array], required: false },
|
|
21
|
+
style: { type: [String, Array], required: false },
|
|
22
|
+
language: { type: String, required: false },
|
|
23
|
+
region: { type: String, required: false },
|
|
24
|
+
signature: { type: String, required: false },
|
|
25
|
+
apiKey: { type: String, required: false },
|
|
26
|
+
width: { type: [Number, String], required: false, default: 640 },
|
|
27
|
+
height: { type: [Number, String], required: false, default: 400 },
|
|
28
|
+
loading: { type: String, required: false, default: "lazy" },
|
|
29
|
+
objectFit: { type: String, required: false, default: "cover" },
|
|
30
|
+
imgAttrs: { type: Object, required: false }
|
|
31
|
+
});
|
|
32
|
+
const runtimeConfig = useRuntimeConfig();
|
|
33
|
+
const proxyConfig = runtimeConfig.public["nuxt-scripts"]?.googleStaticMapsProxy;
|
|
34
|
+
const apiKey = props.apiKey || scriptRuntimeConfig("googleMaps")?.apiKey;
|
|
35
|
+
const useProxy = !props.apiKey && proxyConfig?.enabled;
|
|
36
|
+
if (import.meta.dev) {
|
|
37
|
+
if (!apiKey && !useProxy)
|
|
38
|
+
console.warn("[nuxt-scripts] ScriptGoogleMapsStaticMap requires a Google Maps API key with Static Maps API access. Set NUXT_PUBLIC_SCRIPTS_GOOGLE_MAPS_API_KEY in your .env, or enable the proxy via `scripts.registry.googleMaps`.");
|
|
39
|
+
}
|
|
40
|
+
const rootEl = ref();
|
|
41
|
+
const measuredSize = ref();
|
|
42
|
+
function clampStaticMapSize(width, height, max = 640) {
|
|
43
|
+
const ratio = Math.min(1, max / Math.max(width, height));
|
|
44
|
+
return `${Math.max(1, Math.floor(width * ratio))}x${Math.max(1, Math.floor(height * ratio))}`;
|
|
45
|
+
}
|
|
46
|
+
onMounted(() => {
|
|
47
|
+
if (props.size || !rootEl.value)
|
|
48
|
+
return;
|
|
49
|
+
const { offsetWidth, offsetHeight } = rootEl.value;
|
|
50
|
+
if (offsetWidth > 0 && offsetHeight > 0) {
|
|
51
|
+
measuredSize.value = clampStaticMapSize(offsetWidth, offsetHeight);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
function toCssUnit(value) {
|
|
55
|
+
return typeof value === "number" ? `${value}px` : value;
|
|
56
|
+
}
|
|
57
|
+
const PIXEL_VALUE_RE = /^\d+(?:px)?$/i;
|
|
58
|
+
function isPixelValue(value) {
|
|
59
|
+
if (typeof value === "number")
|
|
60
|
+
return true;
|
|
61
|
+
return PIXEL_VALUE_RE.test(value);
|
|
62
|
+
}
|
|
63
|
+
function transformMapStyles(styles) {
|
|
64
|
+
return styles.map((s) => {
|
|
65
|
+
const feature = s.featureType ? `feature:${s.featureType}` : "";
|
|
66
|
+
const element = s.elementType ? `element:${s.elementType}` : "";
|
|
67
|
+
const rules = (s.stylers || []).map((styler) => {
|
|
68
|
+
return Object.entries(styler).map(([key, value]) => {
|
|
69
|
+
if (key === "color" && typeof value === "string")
|
|
70
|
+
value = value.replace("#", "0x");
|
|
71
|
+
return `${key}:${value}`;
|
|
72
|
+
}).join("|");
|
|
73
|
+
}).filter(Boolean).join("|");
|
|
74
|
+
return [feature, element, rules].filter(Boolean).join("|");
|
|
75
|
+
}).filter(Boolean);
|
|
76
|
+
}
|
|
77
|
+
function resolveStyle(style) {
|
|
78
|
+
if (!style)
|
|
79
|
+
return void 0;
|
|
80
|
+
if (typeof style === "string")
|
|
81
|
+
return style;
|
|
82
|
+
if (Array.isArray(style) && style.length > 0 && typeof style[0] === "string")
|
|
83
|
+
return style;
|
|
84
|
+
return transformMapStyles(style);
|
|
85
|
+
}
|
|
86
|
+
function resolveCenter(center) {
|
|
87
|
+
if (!center)
|
|
88
|
+
return void 0;
|
|
89
|
+
if (typeof center === "string")
|
|
90
|
+
return center;
|
|
91
|
+
return `${center.lat},${center.lng}`;
|
|
92
|
+
}
|
|
93
|
+
const resolvedSize = computed(() => {
|
|
94
|
+
if (props.size)
|
|
95
|
+
return props.size;
|
|
96
|
+
if (measuredSize.value)
|
|
97
|
+
return measuredSize.value;
|
|
98
|
+
if (isPixelValue(props.width) && isPixelValue(props.height))
|
|
99
|
+
return clampStaticMapSize(Number.parseInt(String(props.width)), Number.parseInt(String(props.height)));
|
|
100
|
+
return "640x400";
|
|
101
|
+
});
|
|
102
|
+
const src = computed(() => {
|
|
103
|
+
const query = {
|
|
104
|
+
center: resolveCenter(props.center),
|
|
105
|
+
zoom: props.zoom,
|
|
106
|
+
size: resolvedSize.value,
|
|
107
|
+
scale: props.scale,
|
|
108
|
+
format: props.format,
|
|
109
|
+
maptype: props.maptype,
|
|
110
|
+
map_id: props.mapId,
|
|
111
|
+
markers: props.markers,
|
|
112
|
+
path: props.path,
|
|
113
|
+
visible: props.visible,
|
|
114
|
+
style: resolveStyle(props.style),
|
|
115
|
+
language: props.language,
|
|
116
|
+
region: props.region,
|
|
117
|
+
signature: props.signature,
|
|
118
|
+
key: useProxy ? void 0 : apiKey
|
|
119
|
+
};
|
|
120
|
+
for (const key of Object.keys(query)) {
|
|
121
|
+
if (query[key] === void 0)
|
|
122
|
+
delete query[key];
|
|
123
|
+
}
|
|
124
|
+
const baseUrl = useProxy ? "/_scripts/proxy/google-static-maps" : "https://maps.googleapis.com/maps/api/staticmap";
|
|
125
|
+
return withQuery(baseUrl, query);
|
|
126
|
+
});
|
|
127
|
+
const imgAttributes = computed(() => {
|
|
128
|
+
return defu(props.imgAttrs, {
|
|
129
|
+
src: src.value,
|
|
130
|
+
alt: "Google Maps",
|
|
131
|
+
loading: props.loading,
|
|
132
|
+
style: {
|
|
133
|
+
width: "100%",
|
|
134
|
+
height: "100%",
|
|
135
|
+
objectFit: props.objectFit,
|
|
136
|
+
display: "block"
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
const rootStyle = computed(() => ({
|
|
141
|
+
width: toCssUnit(props.width),
|
|
142
|
+
height: toCssUnit(props.height),
|
|
143
|
+
maxWidth: "100%",
|
|
144
|
+
overflow: "hidden"
|
|
145
|
+
}));
|
|
146
|
+
if (import.meta.server) {
|
|
147
|
+
useHead({
|
|
148
|
+
link: [
|
|
149
|
+
{
|
|
150
|
+
rel: props.loading === "eager" ? "preconnect" : "dns-prefetch",
|
|
151
|
+
href: useProxy ? void 0 : "https://maps.googleapis.com"
|
|
152
|
+
}
|
|
153
|
+
].filter((l) => l.href)
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
defineExpose({ src });
|
|
157
|
+
</script>
|
|
158
|
+
|
|
159
|
+
<template>
|
|
160
|
+
<div ref="rootEl" :style="rootStyle">
|
|
161
|
+
<slot :src="src">
|
|
162
|
+
<img v-bind="imgAttributes">
|
|
163
|
+
</slot>
|
|
164
|
+
</div>
|
|
165
|
+
</template>
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
export type StaticMapFormat = 'png' | 'jpg' | 'gif' | 'png8' | 'png32' | 'jpg-baseline';
|
|
2
|
+
export type StaticMapType = 'roadmap' | 'satellite' | 'terrain' | 'hybrid';
|
|
3
|
+
import type { ImgHTMLAttributes, ReservedProps } from 'vue';
|
|
4
|
+
declare const _default: typeof __VLS_export;
|
|
5
|
+
export default _default;
|
|
6
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
7
|
+
/**
|
|
8
|
+
* The center of the map. Accepts a "lat,lng" string or a LatLngLiteral object.
|
|
9
|
+
*/
|
|
10
|
+
center?: string | {
|
|
11
|
+
lat: number;
|
|
12
|
+
lng: number;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Zoom level (0-21).
|
|
16
|
+
*/
|
|
17
|
+
zoom?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Explicit pixel size for the Static Maps API request, e.g. "640x400".
|
|
20
|
+
* When omitted, the component measures its rendered dimensions on mount and uses those.
|
|
21
|
+
* Falls back to "640x400" during SSR or when dimensions can't be measured.
|
|
22
|
+
*/
|
|
23
|
+
size?: `${number}x${number}`;
|
|
24
|
+
/**
|
|
25
|
+
* Device pixel ratio for the static map image (1 or 2).
|
|
26
|
+
*/
|
|
27
|
+
scale?: 1 | 2;
|
|
28
|
+
/**
|
|
29
|
+
* Image format.
|
|
30
|
+
*/
|
|
31
|
+
format?: StaticMapFormat;
|
|
32
|
+
/**
|
|
33
|
+
* Map type.
|
|
34
|
+
*/
|
|
35
|
+
maptype?: StaticMapType;
|
|
36
|
+
/**
|
|
37
|
+
* Cloud-based map styling ID.
|
|
38
|
+
*/
|
|
39
|
+
mapId?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Map markers. Supports multiple markers via string array.
|
|
42
|
+
* @see https://developers.google.com/maps/documentation/maps-static/start#Markers
|
|
43
|
+
*/
|
|
44
|
+
markers?: string | string[];
|
|
45
|
+
/**
|
|
46
|
+
* Polyline paths. Supports multiple paths via string array.
|
|
47
|
+
* @see https://developers.google.com/maps/documentation/maps-static/start#Paths
|
|
48
|
+
*/
|
|
49
|
+
path?: string | string[];
|
|
50
|
+
/**
|
|
51
|
+
* Locations that should be visible on the map.
|
|
52
|
+
*/
|
|
53
|
+
visible?: string | string[];
|
|
54
|
+
/**
|
|
55
|
+
* Map styling. Accepts raw Static Maps API style strings or Google Maps JS API MapTypeStyle objects.
|
|
56
|
+
*/
|
|
57
|
+
style?: string | string[] | google.maps.MapTypeStyle[];
|
|
58
|
+
/**
|
|
59
|
+
* Language code for map labels.
|
|
60
|
+
*/
|
|
61
|
+
language?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Region bias.
|
|
64
|
+
*/
|
|
65
|
+
region?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Digital signature for requests without an API key.
|
|
68
|
+
*/
|
|
69
|
+
signature?: string;
|
|
70
|
+
/**
|
|
71
|
+
* API key override. When the proxy is enabled, this is ignored and the server-side key is used instead.
|
|
72
|
+
*/
|
|
73
|
+
apiKey?: string;
|
|
74
|
+
/**
|
|
75
|
+
* CSS width for the container element.
|
|
76
|
+
*/
|
|
77
|
+
width?: number | string;
|
|
78
|
+
/**
|
|
79
|
+
* CSS height for the container element.
|
|
80
|
+
*/
|
|
81
|
+
height?: number | string;
|
|
82
|
+
/**
|
|
83
|
+
* Image loading strategy.
|
|
84
|
+
*/
|
|
85
|
+
loading?: "eager" | "lazy";
|
|
86
|
+
/**
|
|
87
|
+
* Object-fit for the image within its container.
|
|
88
|
+
*/
|
|
89
|
+
objectFit?: "cover" | "contain" | "fill" | "none" | "scale-down";
|
|
90
|
+
/**
|
|
91
|
+
* Additional attributes for the `<img>` element.
|
|
92
|
+
*/
|
|
93
|
+
imgAttrs?: ImgHTMLAttributes & ReservedProps & Record<string, unknown>;
|
|
94
|
+
}, {
|
|
95
|
+
src: import("vue").ComputedRef<string>;
|
|
96
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
97
|
+
/**
|
|
98
|
+
* The center of the map. Accepts a "lat,lng" string or a LatLngLiteral object.
|
|
99
|
+
*/
|
|
100
|
+
center?: string | {
|
|
101
|
+
lat: number;
|
|
102
|
+
lng: number;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Zoom level (0-21).
|
|
106
|
+
*/
|
|
107
|
+
zoom?: number;
|
|
108
|
+
/**
|
|
109
|
+
* Explicit pixel size for the Static Maps API request, e.g. "640x400".
|
|
110
|
+
* When omitted, the component measures its rendered dimensions on mount and uses those.
|
|
111
|
+
* Falls back to "640x400" during SSR or when dimensions can't be measured.
|
|
112
|
+
*/
|
|
113
|
+
size?: `${number}x${number}`;
|
|
114
|
+
/**
|
|
115
|
+
* Device pixel ratio for the static map image (1 or 2).
|
|
116
|
+
*/
|
|
117
|
+
scale?: 1 | 2;
|
|
118
|
+
/**
|
|
119
|
+
* Image format.
|
|
120
|
+
*/
|
|
121
|
+
format?: StaticMapFormat;
|
|
122
|
+
/**
|
|
123
|
+
* Map type.
|
|
124
|
+
*/
|
|
125
|
+
maptype?: StaticMapType;
|
|
126
|
+
/**
|
|
127
|
+
* Cloud-based map styling ID.
|
|
128
|
+
*/
|
|
129
|
+
mapId?: string;
|
|
130
|
+
/**
|
|
131
|
+
* Map markers. Supports multiple markers via string array.
|
|
132
|
+
* @see https://developers.google.com/maps/documentation/maps-static/start#Markers
|
|
133
|
+
*/
|
|
134
|
+
markers?: string | string[];
|
|
135
|
+
/**
|
|
136
|
+
* Polyline paths. Supports multiple paths via string array.
|
|
137
|
+
* @see https://developers.google.com/maps/documentation/maps-static/start#Paths
|
|
138
|
+
*/
|
|
139
|
+
path?: string | string[];
|
|
140
|
+
/**
|
|
141
|
+
* Locations that should be visible on the map.
|
|
142
|
+
*/
|
|
143
|
+
visible?: string | string[];
|
|
144
|
+
/**
|
|
145
|
+
* Map styling. Accepts raw Static Maps API style strings or Google Maps JS API MapTypeStyle objects.
|
|
146
|
+
*/
|
|
147
|
+
style?: string | string[] | google.maps.MapTypeStyle[];
|
|
148
|
+
/**
|
|
149
|
+
* Language code for map labels.
|
|
150
|
+
*/
|
|
151
|
+
language?: string;
|
|
152
|
+
/**
|
|
153
|
+
* Region bias.
|
|
154
|
+
*/
|
|
155
|
+
region?: string;
|
|
156
|
+
/**
|
|
157
|
+
* Digital signature for requests without an API key.
|
|
158
|
+
*/
|
|
159
|
+
signature?: string;
|
|
160
|
+
/**
|
|
161
|
+
* API key override. When the proxy is enabled, this is ignored and the server-side key is used instead.
|
|
162
|
+
*/
|
|
163
|
+
apiKey?: string;
|
|
164
|
+
/**
|
|
165
|
+
* CSS width for the container element.
|
|
166
|
+
*/
|
|
167
|
+
width?: number | string;
|
|
168
|
+
/**
|
|
169
|
+
* CSS height for the container element.
|
|
170
|
+
*/
|
|
171
|
+
height?: number | string;
|
|
172
|
+
/**
|
|
173
|
+
* Image loading strategy.
|
|
174
|
+
*/
|
|
175
|
+
loading?: "eager" | "lazy";
|
|
176
|
+
/**
|
|
177
|
+
* Object-fit for the image within its container.
|
|
178
|
+
*/
|
|
179
|
+
objectFit?: "cover" | "contain" | "fill" | "none" | "scale-down";
|
|
180
|
+
/**
|
|
181
|
+
* Additional attributes for the `<img>` element.
|
|
182
|
+
*/
|
|
183
|
+
imgAttrs?: ImgHTMLAttributes & ReservedProps & Record<string, unknown>;
|
|
184
|
+
}> & Readonly<{}>, {
|
|
185
|
+
loading: "eager" | "lazy";
|
|
186
|
+
width: number | string;
|
|
187
|
+
height: number | string;
|
|
188
|
+
zoom: number;
|
|
189
|
+
objectFit: "cover" | "contain" | "fill" | "none" | "scale-down";
|
|
190
|
+
scale: 1 | 2;
|
|
191
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
192
|
+
default?: (props: {
|
|
193
|
+
src: string;
|
|
194
|
+
}) => any;
|
|
195
|
+
}>;
|
|
196
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
197
|
+
new (): {
|
|
198
|
+
$slots: S;
|
|
199
|
+
};
|
|
200
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bind Google Maps event listeners that forward to Vue emit.
|
|
3
|
+
*
|
|
4
|
+
* Two categories:
|
|
5
|
+
* - `noPayload`: emits with no arguments (state-change events like `position_changed`)
|
|
6
|
+
* - `withPayload`: forwards the first argument from the listener (mouse events, etc.)
|
|
7
|
+
*/
|
|
8
|
+
export declare function bindGoogleMapsEvents(instance: {
|
|
9
|
+
addListener: (event: string, handler: (...args: any[]) => void) => void;
|
|
10
|
+
}, emit: (...args: any[]) => void, config: {
|
|
11
|
+
noPayload?: readonly string[];
|
|
12
|
+
withPayload?: readonly string[];
|
|
13
|
+
}): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export function bindGoogleMapsEvents(instance, emit, config) {
|
|
2
|
+
config.noPayload?.forEach((event) => {
|
|
3
|
+
instance.addListener(event, () => emit(event));
|
|
4
|
+
});
|
|
5
|
+
config.withPayload?.forEach((event) => {
|
|
6
|
+
instance.addListener(event, (payload) => emit(event, payload));
|
|
7
|
+
});
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { InjectionKey, Ref, ShallowRef } from 'vue';
|
|
2
|
+
export declare const MAP_INJECTION_KEY: InjectionKey<{
|
|
3
|
+
map: ShallowRef<google.maps.Map | undefined>;
|
|
4
|
+
mapsApi: Ref<typeof google.maps | undefined>;
|
|
5
|
+
/** Close the previously active InfoWindow and register a new one as active */
|
|
6
|
+
activateInfoWindow: (iw: google.maps.InfoWindow) => void;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const MARKER_INJECTION_KEY: InjectionKey<{
|
|
9
|
+
advancedMarkerElement: ShallowRef<google.maps.marker.AdvancedMarkerElement | undefined>;
|
|
10
|
+
}>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { InjectionKey, Ref, ShallowRef } from 'vue';
|
|
2
|
+
export declare const MAP_INJECTION_KEY: InjectionKey<{
|
|
3
|
+
map: ShallowRef<google.maps.Map | undefined>;
|
|
4
|
+
mapsApi: Ref<typeof google.maps | undefined>;
|
|
5
|
+
/** Close the previously active InfoWindow and register a new one as active */
|
|
6
|
+
activateInfoWindow: (iw: google.maps.InfoWindow) => void;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const MARKER_INJECTION_KEY: InjectionKey<{
|
|
9
|
+
advancedMarkerElement: ShallowRef<google.maps.marker.AdvancedMarkerElement | undefined>;
|
|
10
|
+
}>;
|
|
11
|
+
/**
|
|
12
|
+
* Bind Google Maps event listeners that forward to Vue emit.
|
|
13
|
+
*
|
|
14
|
+
* Two categories:
|
|
15
|
+
* - `noPayload`: emits with no arguments (state-change events like `position_changed`)
|
|
16
|
+
* - `withPayload`: forwards the first argument from the listener (mouse events, etc.)
|
|
17
|
+
*/
|
|
18
|
+
export declare function bindGoogleMapsEvents(instance: {
|
|
19
|
+
addListener: (event: string, handler: (...args: any[]) => void) => void;
|
|
20
|
+
}, emit: (...args: any[]) => void, config: {
|
|
21
|
+
noPayload?: readonly string[];
|
|
22
|
+
withPayload?: readonly string[];
|
|
23
|
+
}): void;
|
|
24
|
+
export interface GoogleMapsResourceContext {
|
|
25
|
+
map: google.maps.Map;
|
|
26
|
+
mapsApi: typeof google.maps;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Composable for safely managing Google Maps resource lifecycle.
|
|
30
|
+
*
|
|
31
|
+
* Handles the common pattern: wait for map readiness → async create → cleanup on unmount.
|
|
32
|
+
*
|
|
33
|
+
* Safety guarantees:
|
|
34
|
+
* - No watchers created after `await` (prevents orphaned watchers that leak memory)
|
|
35
|
+
* - Unmount guard prevents resource creation after component unmount
|
|
36
|
+
* - Resources created during the async gap are immediately cleaned up
|
|
37
|
+
* - Resource ref is always nulled on unmount to allow GC
|
|
38
|
+
*/
|
|
39
|
+
export declare function useGoogleMapsResource<T>({ ready, create, cleanup, }: {
|
|
40
|
+
/** Additional readiness condition beyond map + mapsApi being available */
|
|
41
|
+
ready?: () => boolean;
|
|
42
|
+
/** Create the Google Maps resource. Receives map context snapshot. May be async. */
|
|
43
|
+
create: (ctx: GoogleMapsResourceContext) => Promise<T> | T;
|
|
44
|
+
/** Clean up the resource. Called on unmount, or immediately if resource was created after unmount. */
|
|
45
|
+
cleanup?: (resource: T, ctx: {
|
|
46
|
+
mapsApi: typeof google.maps;
|
|
47
|
+
}) => void;
|
|
48
|
+
}): ShallowRef<T | undefined>;
|