@nuxt/scripts 1.3.5 → 2.0.0-beta.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/THIRD_PARTY_LICENSES.md +124 -0
- package/dist/devtools-client/200.html +1 -1
- package/dist/devtools-client/404.html +1 -1
- package/dist/devtools-client/_nuxt/{B551Pnuh.js → 2p1_IuX2.js} +1 -1
- package/dist/devtools-client/_nuxt/{KxC4Q3ev.js → 9elIQxwW.js} +1 -1
- package/dist/devtools-client/_nuxt/{DTP8MRtW.js → BNPn63Jz.js} +1 -1
- package/dist/devtools-client/_nuxt/BjRLaDIG.js +152 -0
- package/dist/devtools-client/_nuxt/BtNUYBXT.js +8 -0
- package/dist/devtools-client/_nuxt/CDDBpkXG.js +3 -0
- package/dist/devtools-client/_nuxt/Cpb0XAYP.js +1 -0
- package/dist/devtools-client/_nuxt/DAsiyhPm.js +6 -0
- package/dist/devtools-client/_nuxt/{VICyrUSM.js → DabLKy7M.js} +1 -1
- package/dist/devtools-client/_nuxt/Dat651Oh.js +1 -0
- package/dist/devtools-client/_nuxt/DcG2ZXvY.js +1 -0
- package/dist/devtools-client/_nuxt/DmlGWZ2X.js +1 -0
- package/dist/devtools-client/_nuxt/KsX6Az5B.js +1 -0
- package/dist/devtools-client/_nuxt/RL1np866.js +28 -0
- package/dist/devtools-client/_nuxt/UmWNrBO5.js +2 -0
- package/dist/devtools-client/_nuxt/builds/latest.json +1 -1
- package/dist/devtools-client/_nuxt/builds/meta/e28b96f1-78e8-41a4-ad6f-904cd078f85e.json +1 -0
- package/dist/devtools-client/_nuxt/{entry.CYUdJFoE.css → entry.9HJPJ6Hp.css} +1 -1
- package/dist/devtools-client/_nuxt/error-404.DnwL1N6v.css +1 -0
- package/dist/devtools-client/_nuxt/error-500.DEbXRLdm.css +1 -0
- package/dist/devtools-client/docs/index.html +1 -1
- package/dist/devtools-client/first-party/index.html +1 -1
- package/dist/devtools-client/index.html +1 -1
- package/dist/devtools-client/registry/index.html +1 -1
- package/dist/module.d.mts +2 -86
- package/dist/module.d.ts +2 -86
- package/dist/module.json +3 -3
- package/dist/module.mjs +71 -328
- package/dist/registry.mjs +54 -22
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.d.vue.ts +1 -28
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue +7 -50
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue.d.ts +1 -28
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.d.vue.ts +0 -8
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue +1 -13
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue.d.ts +0 -8
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsStaticMap.d.vue.ts +4 -4
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsStaticMap.vue +9 -15
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsStaticMap.vue.d.ts +4 -4
- package/dist/runtime/components/GoogleMaps/useGoogleMapsResource.d.ts +0 -22
- package/dist/runtime/components/GoogleMaps/useGoogleMapsResource.js +0 -31
- package/dist/runtime/components/Leaflet/ScriptLeafletGeoJson.d.vue.ts +31 -0
- package/dist/runtime/components/Leaflet/ScriptLeafletGeoJson.vue +43 -0
- package/dist/runtime/components/Leaflet/ScriptLeafletGeoJson.vue.d.ts +31 -0
- package/dist/runtime/components/Leaflet/ScriptLeafletMap.d.vue.ts +90 -0
- package/dist/runtime/components/Leaflet/ScriptLeafletMap.vue +171 -0
- package/dist/runtime/components/Leaflet/ScriptLeafletMap.vue.d.ts +90 -0
- package/dist/runtime/components/Leaflet/ScriptLeafletMarker.d.vue.ts +47 -0
- package/dist/runtime/components/Leaflet/ScriptLeafletMarker.vue +70 -0
- package/dist/runtime/components/Leaflet/ScriptLeafletMarker.vue.d.ts +47 -0
- package/dist/runtime/components/Leaflet/ScriptLeafletPopup.d.vue.ts +31 -0
- package/dist/runtime/components/Leaflet/ScriptLeafletPopup.vue +81 -0
- package/dist/runtime/components/Leaflet/ScriptLeafletPopup.vue.d.ts +31 -0
- package/dist/runtime/components/Leaflet/ScriptLeafletTileLayer.d.vue.ts +26 -0
- package/dist/runtime/components/Leaflet/ScriptLeafletTileLayer.vue +38 -0
- package/dist/runtime/components/Leaflet/ScriptLeafletTileLayer.vue.d.ts +26 -0
- package/dist/runtime/components/Leaflet/useLeafletResource.d.ts +30 -0
- package/dist/runtime/components/Leaflet/useLeafletResource.js +46 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreGeoJson.d.vue.ts +39 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreGeoJson.vue +84 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreGeoJson.vue.d.ts +39 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreMap.d.vue.ts +122 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreMap.vue +214 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreMap.vue.d.ts +122 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreMarker.d.vue.ts +35 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreMarker.vue +98 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreMarker.vue.d.ts +35 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreNavigationControl.d.vue.ts +12 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreNavigationControl.vue +23 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreNavigationControl.vue.d.ts +12 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibrePopup.d.vue.ts +31 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibrePopup.vue +99 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibrePopup.vue.d.ts +31 -0
- package/dist/runtime/components/MapLibre/useMapLibreResource.d.ts +23 -0
- package/dist/runtime/components/MapLibre/useMapLibreResource.js +41 -0
- package/dist/runtime/components/ScriptCrisp.vue +20 -18
- package/dist/runtime/components/ScriptDeskCrew.d.vue.ts +40 -0
- package/dist/runtime/components/ScriptDeskCrew.vue +82 -0
- package/dist/runtime/components/ScriptDeskCrew.vue.d.ts +40 -0
- package/dist/runtime/components/ScriptIntercom.vue +21 -19
- package/dist/runtime/components/ScriptLoadingIndicator.d.vue.ts +1 -1
- package/dist/runtime/components/ScriptLoadingIndicator.vue.d.ts +1 -1
- package/dist/runtime/components/ScriptPayPalButtons.vue +7 -3
- package/dist/runtime/components/ScriptPayPalMessages.vue +8 -4
- package/dist/runtime/composables/useScript.js +96 -49
- package/dist/runtime/composables/useScriptProxyUrl.d.ts +4 -8
- package/dist/runtime/composables/useScriptProxyUrl.js +0 -7
- package/dist/runtime/composables/useScriptTriggerIdleTimeout.d.ts +2 -1
- package/dist/runtime/composables/useScriptTriggerIdleTimeout.js +3 -34
- package/dist/runtime/composables/useScriptTriggerInteraction.d.ts +2 -1
- package/dist/runtime/composables/useScriptTriggerInteraction.js +13 -46
- package/dist/runtime/composables/useScriptTriggerServiceWorker.d.ts +2 -1
- package/dist/runtime/composables/useScriptTriggerServiceWorker.js +5 -38
- package/dist/runtime/leaflet-styles.d.ts +13 -0
- package/dist/runtime/leaflet-styles.js +684 -0
- package/dist/runtime/maplibre-styles.d.ts +7 -0
- package/dist/runtime/maplibre-styles.js +25 -0
- package/dist/runtime/npm-script-api-state.d.ts +4 -0
- package/dist/runtime/npm-script-api-state.js +13 -0
- package/dist/runtime/registry/crisp.d.ts +1 -1
- package/dist/runtime/registry/crisp.js +30 -18
- package/dist/runtime/registry/deskcrew.d.ts +52 -0
- package/dist/runtime/registry/deskcrew.js +31 -0
- package/dist/runtime/registry/google-analytics.d.ts +0 -2
- package/dist/runtime/registry/google-maps.d.ts +2 -11
- package/dist/runtime/registry/google-maps.js +31 -10
- package/dist/runtime/registry/google-tag-manager.d.ts +9 -3
- package/dist/runtime/registry/leaflet.d.ts +13 -0
- package/dist/runtime/registry/leaflet.js +29 -0
- package/dist/runtime/registry/maplibre.d.ts +13 -0
- package/dist/runtime/registry/maplibre.js +29 -0
- package/dist/runtime/registry/matomo-analytics.js +1 -8
- package/dist/runtime/registry/plausible-analytics.d.ts +4 -16
- package/dist/runtime/registry/plausible-analytics.js +15 -58
- package/dist/runtime/registry/rybbit-analytics.d.ts +0 -4
- package/dist/runtime/registry/rybbit-analytics.js +1 -4
- package/dist/runtime/registry/schemas.d.ts +61 -5
- package/dist/runtime/registry/schemas.js +64 -5
- package/dist/runtime/registry/tiktok-pixel.d.ts +2 -12
- package/dist/runtime/registry/tiktok-pixel.js +1 -1
- package/dist/runtime/registry/usercentrics.js +46 -6
- package/dist/runtime/registry/youtube-player.d.ts +3 -4
- package/dist/runtime/registry/youtube-player.js +30 -23
- package/dist/runtime/server/bluesky-embed-image.d.ts +1 -1
- package/dist/runtime/server/bluesky-embed.d.ts +1 -1
- package/dist/runtime/server/bluesky-embed.js +3 -6
- package/dist/runtime/server/gravatar-proxy.d.ts +1 -1
- package/dist/runtime/server/gravatar-proxy.js +2 -3
- package/dist/runtime/server/instagram-embed-asset.d.ts +1 -1
- package/dist/runtime/server/instagram-embed-image.d.ts +1 -1
- package/dist/runtime/server/instagram-embed.d.ts +1 -1
- package/dist/runtime/server/instagram-embed.js +4 -7
- package/dist/runtime/server/utils/cached-upstream.d.ts +6 -11
- package/dist/runtime/server/utils/cached-upstream.js +94 -23
- package/dist/runtime/server/utils/embed-rewriters.d.ts +3 -5
- package/dist/runtime/server/utils/embed-rewriters.js +8 -8
- package/dist/runtime/server/utils/image-proxy.d.ts +1 -1
- package/dist/runtime/server/utils/image-proxy.js +2 -3
- package/dist/runtime/server/utils/instagram-embed.d.ts +6 -6
- package/dist/runtime/server/utils/instagram-embed.js +18 -19
- package/dist/runtime/server/utils/proxy-url.d.ts +5 -6
- package/dist/runtime/server/utils/proxy-url.js +1 -4
- package/dist/runtime/server/x-embed-image.d.ts +1 -1
- package/dist/runtime/server/x-embed.d.ts +48 -1
- package/dist/runtime/server/x-embed.js +3 -6
- package/dist/runtime/types.d.ts +13 -13
- package/dist/runtime/utils/abortable-promise.js +26 -5
- package/dist/runtime/utils/nuxt-ready-script-trigger.d.ts +3 -0
- package/dist/runtime/utils/nuxt-ready-script-trigger.js +16 -0
- package/dist/runtime/utils.js +21 -32
- package/dist/stats.mjs +13 -0
- package/dist/types-source.mjs +1173 -100
- package/dist/types.d.mts +2 -2
- package/package.json +34 -21
- package/LICENSE.md +0 -9
- package/bin/cli.mjs +0 -2
- package/dist/cli.d.mts +0 -2
- package/dist/cli.d.ts +0 -2
- package/dist/cli.mjs +0 -50
- package/dist/devtools-client/_nuxt/8ltZ0o6d.js +0 -1
- package/dist/devtools-client/_nuxt/B8_EBdhg.js +0 -152
- package/dist/devtools-client/_nuxt/BKdLzFmX.js +0 -3
- package/dist/devtools-client/_nuxt/Bf2Kt1P0.js +0 -28
- package/dist/devtools-client/_nuxt/CC0GKROJ.js +0 -1
- package/dist/devtools-client/_nuxt/CH5oUfNi.js +0 -1
- package/dist/devtools-client/_nuxt/CMXzQxJZ.js +0 -1
- package/dist/devtools-client/_nuxt/CP7c-Js6.js +0 -8
- package/dist/devtools-client/_nuxt/C_v3_O0R.js +0 -6
- package/dist/devtools-client/_nuxt/CxN78VhB.js +0 -1
- package/dist/devtools-client/_nuxt/Dkc7iTdR.js +0 -1
- package/dist/devtools-client/_nuxt/builds/meta/173480db-0944-415b-962d-d619682f0042.json +0 -1
- package/dist/devtools-client/_nuxt/error-404.Bq2JQbJs.css +0 -1
- package/dist/devtools-client/_nuxt/error-500.5E_FOzlc.css +0 -1
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.d.vue.ts +0 -13
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.vue +0 -15
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.vue.d.ts +0 -13
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsHeatmapLayer.d.vue.ts +0 -27
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsHeatmapLayer.vue +0 -34
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsHeatmapLayer.vue.d.ts +0 -27
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPinElement.d.vue.ts +0 -13
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPinElement.vue +0 -11
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPinElement.vue.d.ts +0 -13
- package/dist/runtime/components/GoogleMaps/bindGoogleMapsEvents.d.ts +0 -13
- package/dist/runtime/components/GoogleMaps/bindGoogleMapsEvents.js +0 -8
- package/dist/runtime/components/GoogleMaps/injectionKeys.d.ts +0 -10
- package/dist/runtime/components/GoogleMaps/injectionKeys.js +0 -2
- package/dist/runtime/composables/useScriptProxyToken.d.ts +0 -12
- package/dist/runtime/composables/useScriptProxyToken.js +0 -4
- package/dist/runtime/npm-script-stub.d.ts +0 -20
- package/dist/runtime/npm-script-stub.js +0 -72
- package/dist/runtime/plugins/proxy-token.server.d.ts +0 -10
- package/dist/runtime/plugins/proxy-token.server.js +0 -17
- package/dist/runtime/server/google-maps-geocode-proxy.d.ts +0 -2
- package/dist/runtime/server/google-maps-geocode-proxy.js +0 -43
- package/dist/runtime/server/google-static-maps-proxy.d.ts +0 -2
- package/dist/runtime/server/google-static-maps-proxy.js +0 -56
- package/dist/runtime/server/utils/proxy-query.d.ts +0 -2
- package/dist/runtime/server/utils/proxy-query.js +0 -10
- package/dist/runtime/server/utils/sign-constants.d.ts +0 -16
- package/dist/runtime/server/utils/sign-constants.js +0 -5
- package/dist/runtime/server/utils/sign.d.ts +0 -101
- package/dist/runtime/server/utils/sign.js +0 -91
- package/dist/runtime/server/utils/withSigning.d.ts +0 -23
- package/dist/runtime/server/utils/withSigning.js +0 -19
- package/dist/runtime/unhead-features.d.ts +0 -1
- package/dist/runtime/unhead-features.js +0 -3
package/dist/registry.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { joinURL, withQuery, withBase } from 'ufo';
|
|
2
|
-
import { AhrefsAnalyticsOptions, CloudflareWebAnalyticsOptions, VercelAnalyticsOptions, PostHogOptions, FathomAnalyticsOptions, MatomoAnalyticsOptions, RybbitAnalyticsOptions, DatabuddyAnalyticsOptions, SegmentOptions, MixpanelAnalyticsOptions, BingUetOptions, MetaPixelOptions, XPixelOptions, TikTokPixelOptions, SnapTrPixelOptions, RedditPixelOptions, LinkedInInsightOptions, GoogleAdsenseOptions, IntercomOptions, HotjarOptions, ClarityOptions, StripeOptions, GoogleMapsOptions, BlueskyEmbedOptions, InstagramEmbedOptions, XEmbedOptions, CrispOptions, NpmOptions, CalendlyOptions, GoogleRecaptchaOptions, GoogleSignInOptions, GoogleTagManagerOptions, GoogleAnalyticsOptions, UmamiAnalyticsOptions, UsercentricsOptions, GravatarOptions, SpeedCurveOptions } from '../dist/runtime/registry/schemas.js';
|
|
2
|
+
import { AhrefsAnalyticsOptions, CloudflareWebAnalyticsOptions, VercelAnalyticsOptions, PostHogOptions, FathomAnalyticsOptions, MatomoAnalyticsOptions, RybbitAnalyticsOptions, DatabuddyAnalyticsOptions, SegmentOptions, MixpanelAnalyticsOptions, BingUetOptions, MetaPixelOptions, XPixelOptions, TikTokPixelOptions, SnapTrPixelOptions, RedditPixelOptions, LinkedInInsightOptions, GoogleAdsenseOptions, IntercomOptions, HotjarOptions, ClarityOptions, StripeOptions, GoogleMapsOptions, LeafletOptions, MapLibreOptions, BlueskyEmbedOptions, InstagramEmbedOptions, XEmbedOptions, CrispOptions, DeskCrewOptions, NpmOptions, CalendlyOptions, GoogleRecaptchaOptions, GoogleSignInOptions, GoogleTagManagerOptions, GoogleAnalyticsOptions, UmamiAnalyticsOptions, UsercentricsOptions, GravatarOptions, SpeedCurveOptions } from '../dist/runtime/registry/schemas.js';
|
|
3
3
|
|
|
4
4
|
const LOGOS = {
|
|
5
5
|
ahrefsAnalytics: `<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><path fill="#FF6A00" d="M9.6 4h4.8a4.8 4.8 0 0 1 4.8 4.8v4.8H9.6A4.8 4.8 0 0 1 4.8 8.8 4.8 4.8 0 0 1 9.6 4Zm14.4 24h-4.8a4.8 4.8 0 0 1-4.8-4.8v-9.6h4.8A4.8 4.8 0 0 1 24 18.4Z"/></svg>`,
|
|
@@ -41,12 +41,18 @@ const LOGOS = {
|
|
|
41
41
|
vimeoPlayer: `<svg xmlns="http://www.w3.org/2000/svg" width="36.74" height="32" viewBox="0 0 256 223"><path fill="#32B8E8" d="M255.876 51.662c-1.139 24.968-18.545 59.157-52.209 102.55c-34.806 45.327-64.254 67.989-88.343 67.989c-14.918 0-27.551-13.799-37.863-41.406c-6.892-25.306-13.775-50.61-20.664-75.915c-7.663-27.592-15.878-41.406-24.661-41.406c-1.915 0-8.617 4.038-20.091 12.081L0 60.008a3257.325 3257.325 0 0 0 37.36-33.38C54.21 12.038 66.86 4.366 75.29 3.59c19.925-1.917 32.187 11.728 36.79 40.938c4.974 31.514 8.415 51.116 10.35 58.788c5.742 26.145 12.06 39.201 18.965 39.201c5.358 0 13.407-8.478 24.138-25.436c10.722-16.963 16.464-29.868 17.24-38.733c1.525-14.638-4.22-21.975-17.24-21.975c-6.128 0-12.447 1.413-18.946 4.206c12.58-41.29 36.618-61.343 72.1-60.199c26.304.773 38.705 17.867 37.19 51.282"/></svg>`,
|
|
42
42
|
youtubePlayer: `<svg xmlns="http://www.w3.org/2000/svg" width="45.52" height="32" viewBox="0 0 256 180"><path fill="red" d="M250.346 28.075A32.18 32.18 0 0 0 227.69 5.418C207.824 0 127.87 0 127.87 0S47.912.164 28.046 5.582A32.18 32.18 0 0 0 5.39 28.24c-6.009 35.298-8.34 89.084.165 122.97a32.18 32.18 0 0 0 22.656 22.657c19.866 5.418 99.822 5.418 99.822 5.418s79.955 0 99.82-5.418a32.18 32.18 0 0 0 22.657-22.657c6.338-35.348 8.291-89.1-.164-123.134"/><path fill="#FFF" d="m102.421 128.06l66.328-38.418l-66.328-38.418z"/></svg>`,
|
|
43
43
|
googleMaps: `<svg xmlns="http://www.w3.org/2000/svg" width="22.33" height="32" viewBox="0 0 256 367"><path fill="#34A853" d="M70.585 271.865a370.712 370.712 0 0 1 28.911 42.642c7.374 13.982 10.448 23.463 15.837 40.31c3.305 9.308 6.292 12.086 12.714 12.086c6.998 0 10.173-4.726 12.626-12.035c5.094-15.91 9.091-28.052 15.397-39.525c12.374-22.15 27.75-41.833 42.858-60.75c4.09-5.354 30.534-36.545 42.439-61.156c0 0 14.632-27.035 14.632-64.792c0-35.318-14.43-59.813-14.43-59.813l-41.545 11.126l-25.23 66.451l-6.242 9.163l-1.248 1.66l-1.66 2.078l-2.914 3.319l-4.164 4.163l-22.467 18.304l-56.17 32.432z"/><path fill="#FBBC04" d="M12.612 188.892c13.709 31.313 40.145 58.839 58.031 82.995l95.001-112.534s-13.384 17.504-37.662 17.504c-27.043 0-48.89-21.595-48.89-48.825c0-18.673 11.234-31.501 11.234-31.501l-64.489 17.28z"/><path fill="#4285F4" d="M166.705 5.787c31.552 10.173 58.558 31.53 74.893 63.023l-75.925 90.478s11.234-13.06 11.234-31.617c0-27.864-23.463-48.68-48.81-48.68c-23.969 0-37.735 17.475-37.735 17.475v-57z"/><path fill="#1A73E8" d="M30.015 45.765C48.86 23.218 82.02 0 127.736 0c22.18 0 38.89 5.823 38.89 5.823L90.29 96.516H36.205z"/><path fill="#EA4335" d="M12.612 188.892S0 164.194 0 128.414c0-33.817 13.146-63.377 30.015-82.649l60.318 50.759z"/></svg>`,
|
|
44
|
+
leaflet: `<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><rect width="32" height="32" rx="6" fill="#199900"/><path fill="#fff" d="M8 5h5v17h11v5H8z"/><path fill="#9ee493" d="M18 6c4 0 7 2 8 6c-4 1-7 0-8-6Z"/></svg>`,
|
|
45
|
+
maplibre: `<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><rect width="32" height="32" rx="6" fill="#396CB2"/><path fill="#fff" d="M16 5a10 10 0 1 0 0 20a10 10 0 0 0 0-20m0 3c1.2 0 2.7 2.3 3 6h-6c.3-3.7 1.8-6 3-6m-6.7 6a7 7 0 0 1 3-4.8c-.7 1.4-1.1 3-1.3 4.8zm0 3H11c.2 1.8.6 3.4 1.3 4.8A7 7 0 0 1 9.3 17m6.7 5c-1.2 0-2.7-2.3-3-5h6c-.3 2.7-1.8 5-3 5m3.7-.2c.7-1.4 1.1-3 1.3-4.8h1.7a7 7 0 0 1-3 4.8M21 14c-.2-1.8-.6-3.4-1.3-4.8a7 7 0 0 1 3 4.8z"/></svg>`,
|
|
44
46
|
blueskyEmbed: `<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 568 501"><path fill="#1185FE" d="M123.121 33.664C188.241 82.553 258.281 181.68 284 234.873c25.719-53.192 95.759-152.32 160.879-201.21C491.866-1.611 568-28.906 568 57.947c0 17.346-9.945 145.713-15.778 166.555c-20.275 72.453-94.155 90.933-159.875 79.748c114.875 19.831 144.097 85.561 81.022 151.291C363.929 569.326 289.18 462.062 284 449.7c-.36-.86-.36-.86 0 0c-5.18 12.362-79.929 119.626-189.369 5.84c-63.075-65.729-33.853-131.46 81.022-151.29c-65.72 11.184-139.6-7.296-159.875-79.749C9.945 203.659 0 75.291 0 57.946C0-28.906 76.134-1.612 123.121 33.664"/></svg>`,
|
|
45
47
|
instagramEmbed: `<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 256 256"><g fill="none"><rect width="256" height="256" fill="url(#skillIconsInstagram0)" rx="60"/><rect width="256" height="256" fill="url(#skillIconsInstagram1)" rx="60"/><path fill="#fff" d="M128.009 28c-27.158 0-30.567.119-41.233.604c-10.646.488-17.913 2.173-24.271 4.646c-6.578 2.554-12.157 5.971-17.716 11.531c-5.563 5.559-8.98 11.138-11.542 17.713c-2.48 6.36-4.167 13.63-4.646 24.271c-.477 10.667-.602 14.077-.602 41.236s.12 30.557.604 41.223c.49 10.646 2.175 17.913 4.646 24.271c2.556 6.578 5.973 12.157 11.533 17.716c5.557 5.563 11.136 8.988 17.709 11.542c6.363 2.473 13.631 4.158 24.275 4.646c10.668.485 14.073.604 41.23.604c27.161 0 30.559-.119 41.225-.604c10.646-.488 17.921-2.173 24.284-4.646c6.575-2.554 12.146-5.979 17.702-11.542c5.563-5.559 8.98-11.138 11.542-17.716c2.458-6.358 4.145-13.625 4.646-24.271c.48-10.666.604-14.066.604-41.223s-.124-30.569-.604-41.236c-.501-10.646-2.188-17.911-4.646-24.271c-2.562-6.575-5.979-12.154-11.542-17.713c-5.559-5.56-11.13-8.977-17.716-11.531c-6.375-2.473-13.646-4.158-24.292-4.646C158.57 28.119 155.164 28 128.009 28m-8.868 18.021h8.868c26.695 0 29.855.103 40.41.582c9.751.446 15.042 2.079 18.567 3.454c4.667 1.813 7.992 3.979 11.492 7.48c3.5 3.5 5.666 6.829 7.483 11.496c1.375 3.525 3.012 8.813 3.454 18.563c.479 10.558.588 13.719.588 40.413s-.109 29.854-.588 40.412c-.446 9.75-2.079 15.042-3.454 18.563c-1.813 4.667-3.983 7.992-7.483 11.492a30.94 30.94 0 0 1-11.492 7.479c-3.521 1.379-8.812 3.013-18.567 3.458c-10.554.48-13.711.589-40.41.589c-26.702 0-29.859-.109-40.413-.589c-9.75-.449-15.046-2.079-18.571-3.458c-4.667-1.813-8-3.979-11.5-7.479s-5.666-6.825-7.483-11.496c-1.375-3.521-3.012-8.813-3.454-18.563c-.479-10.558-.583-13.715-.583-40.42c0-26.704.104-29.856.583-40.413c.446-9.75 2.079-15.042 3.454-18.567c1.813-4.667 3.983-7.996 11.5-11.5a30.804 30.804 0 0 1 11.496-7.479c3.525-1.375 8.821-3.013 18.571-3.458c9.238-.421 12.82-.546 31.505-.563zm62.496 16.604c-6.625 0-12 5.37-12 12c0 6.625 5.375 12 12 12c6.625 0 12-5.375 12-12s-5.375-12-12-12m-53.628 14.021c-28.272 0-51.196 22.924-51.196 51.196s22.924 51.2 51.196 51.2c28.271 0 51.2-22.929 51.2-51.2c0-28.272-22.929-51.196-51.2-51.196m0 18.021c18.334 0 33.183 14.846 33.183 33.175c0 18.334-14.849 33.184-33.183 33.184c-18.33 0-33.175-14.85-33.175-33.184c0-18.329 14.845-33.175 33.175-33.175"/><defs><radialGradient id="skillIconsInstagram0" cx="0" cy="0" r="1" gradientTransform="matrix(0 -253.715 235.975 0 68 275.717)" gradientUnits="userSpaceOnUse"><stop stop-color="#FD5"/><stop offset=".1" stop-color="#FD5"/><stop offset=".5" stop-color="#FF543E"/><stop offset="1" stop-color="#C837AB"/></radialGradient><radialGradient id="skillIconsInstagram1" cx="0" cy="0" r="1" gradientTransform="matrix(22.25952 111.2976 -458.39518 91.75449 -42.881 18.441)" gradientUnits="userSpaceOnUse"><stop stop-color="#3771C8"/><stop offset=".128" stop-color="#3771C8"/><stop offset="1" stop-color="#60F" stop-opacity="0"/></radialGradient></defs></g></svg>`,
|
|
46
48
|
xEmbed: {
|
|
47
49
|
light: `<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="#000" d="M18.205 2.25h3.308l-7.227 8.26l8.502 11.24H16.13l-5.214-6.817L4.95 21.75H1.64l7.73-8.835L1.215 2.25H8.04l4.713 6.231zm-1.161 17.52h1.833L7.045 4.126H5.078z"/></svg>`,
|
|
48
50
|
dark: `<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="#fff" d="M18.205 2.25h3.308l-7.227 8.26l8.502 11.24H16.13l-5.214-6.817L4.95 21.75H1.64l7.73-8.835L1.215 2.25H8.04l4.713 6.231zm-1.161 17.52h1.833L7.045 4.126H5.078z"/></svg>`
|
|
49
51
|
},
|
|
52
|
+
deskcrew: {
|
|
53
|
+
light: `<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><rect width="32" height="32" rx="7" fill="#0f172a"/><path d="M8.5 10.5 12.5 16l-4 5.5" fill="none" stroke="#fff" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/><path d="M15.5 21.5h8" fill="none" stroke="#fff" stroke-width="2.2" stroke-linecap="round"/></svg>`,
|
|
54
|
+
dark: `<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><rect width="32" height="32" rx="7" fill="#fff"/><path d="M8.5 10.5 12.5 16l-4 5.5" fill="none" stroke="#0f172a" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/><path d="M15.5 21.5h8" fill="none" stroke="#0f172a" stroke-width="2.2" stroke-linecap="round"/></svg>`
|
|
55
|
+
},
|
|
50
56
|
crisp: {
|
|
51
57
|
light: `<svg height="30" width="35" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><filter id="a" height="138.7%" width="131.4%" x="-15.7%" y="-15.1%"><feMorphology in="SourceAlpha" operator="dilate" radius="1" result="shadowSpreadOuter1"/><feOffset dy="1" in="shadowSpreadOuter1" result="shadowOffsetOuter1"/><feGaussianBlur in="shadowOffsetOuter1" result="shadowBlurOuter1" stdDeviation="1"/><feComposite in="shadowBlurOuter1" in2="SourceAlpha" operator="out" result="shadowBlurOuter1"/><feColorMatrix in="shadowBlurOuter1" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.07 0"/></filter><path id="b" d="M14.23 20.46l-9.65 1.1L3 5.12 30.07 2l1.58 16.46-9.37 1.07-3.5 5.72-4.55-4.8z"/></defs><g fill="none" fill-rule="evenodd"><use fill="#000" filter="url(#a)" xlink:href="#b"/><use fill="#1972f5" stroke="#1972f5" stroke-width="2" xlink:href="#b"/></g></svg>`,
|
|
52
58
|
dark: `<svg height="30" width="35" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><filter id="a" height="138.7%" width="131.4%" x="-15.7%" y="-15.1%"><feMorphology in="SourceAlpha" operator="dilate" radius="1" result="shadowSpreadOuter1"/><feOffset dy="1" in="shadowSpreadOuter1" result="shadowOffsetOuter1"/><feGaussianBlur in="shadowOffsetOuter1" result="shadowBlurOuter1" stdDeviation="1"/><feComposite in="shadowBlurOuter1" in2="SourceAlpha" operator="out" result="shadowBlurOuter1"/><feColorMatrix in="shadowBlurOuter1" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.07 0"/></filter><path id="b" d="M14.23 20.46l-9.65 1.1L3 5.12 30.07 2l1.58 16.46-9.37 1.07-3.5 5.72-4.55-4.8z"/></defs><g fill="none" fill-rule="evenodd"><use fill="#000" filter="url(#a)" xlink:href="#b"/><use fill="#fff" stroke="#fff" stroke-width="2" xlink:href="#b"/></g></svg>`
|
|
@@ -137,12 +143,15 @@ const registryMeta = [
|
|
|
137
143
|
m("vimeoPlayer", "Vimeo Player", "video", "useScriptVimeoPlayer", { bundle: true, proxy: true }, PRIVACY_IP_ONLY),
|
|
138
144
|
// content
|
|
139
145
|
m("googleMaps", "Google Maps", "content", "useScriptGoogleMaps", {}, null),
|
|
146
|
+
m("leaflet", "Leaflet", "content", "useScriptLeaflet", { bundle: true }, null),
|
|
147
|
+
m("maplibre", "MapLibre GL JS", "content", "useScriptMapLibre", { bundle: true }, null),
|
|
140
148
|
m("instagramEmbed", "Instagram Embed", "content", false, {}, null),
|
|
141
149
|
m("xEmbed", "X Embed", "content", false, {}, null),
|
|
142
150
|
m("blueskyEmbed", "Bluesky Embed", "content", false, {}, null),
|
|
143
151
|
// support
|
|
144
152
|
m("intercom", "Intercom", "support", "useScriptIntercom", { bundle: true, proxy: true }, PRIVACY_IP_ONLY),
|
|
145
153
|
m("crisp", "Crisp", "support", "useScriptCrisp", { bundle: true }, null),
|
|
154
|
+
m("deskcrew", "DeskCrew", "support", "useScriptDeskCrew", {}, null),
|
|
146
155
|
// cdn
|
|
147
156
|
m("npm", "NPM", "cdn", "useScriptNpm", { bundle: true }, null),
|
|
148
157
|
// utility
|
|
@@ -239,16 +248,15 @@ async function registry(resolve) {
|
|
|
239
248
|
def("plausibleAnalytics", {
|
|
240
249
|
label: "Plausible Analytics",
|
|
241
250
|
category: "analytics",
|
|
242
|
-
envDefaults: {
|
|
251
|
+
envDefaults: { scriptId: "" },
|
|
243
252
|
bundle: {
|
|
244
253
|
resolve: (options) => {
|
|
245
254
|
const userSrc = options?.scriptInput?.src;
|
|
246
255
|
if (typeof userSrc === "string" && userSrc.trim().length > 0)
|
|
247
256
|
return userSrc.trim();
|
|
248
|
-
if (options?.scriptId)
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
return options?.extension ? `https://plausible.io/js/script.${extensions}.js` : "https://plausible.io/js/script.js";
|
|
257
|
+
if (!options?.scriptId)
|
|
258
|
+
throw new TypeError("plausibleAnalytics requires scriptId");
|
|
259
|
+
return `https://plausible.io/js/pa-${options.scriptId}.js`;
|
|
252
260
|
}
|
|
253
261
|
},
|
|
254
262
|
proxy: {
|
|
@@ -571,10 +579,11 @@ async function registry(resolve) {
|
|
|
571
579
|
// Clarity buckets visitors across letter/hash-prefixed shards (a/b/c/d/e/k/...).
|
|
572
580
|
// Microsoft adds shards over time, so an enumerated list silently 403s
|
|
573
581
|
// through the proxy when an unlisted letter is rolled out (#728-class bug).
|
|
574
|
-
// `*.clarity.ms` covers the full surface at runtime
|
|
575
|
-
//
|
|
576
|
-
//
|
|
577
|
-
|
|
582
|
+
// `*.clarity.ms` covers the full surface at runtime. Literal hosts are
|
|
583
|
+
// also required because build-time URL rewriting filters wildcards; the
|
|
584
|
+
// bootstrap currently loads its SDK from `scripts`, uploads to `p`, and
|
|
585
|
+
// synchronizes consent through `c`.
|
|
586
|
+
domains: ["www.clarity.ms", "scripts.clarity.ms", "p.clarity.ms", "c.clarity.ms", "*.clarity.ms"],
|
|
578
587
|
privacy: PRIVACY_HEATMAP
|
|
579
588
|
},
|
|
580
589
|
partytown: { forwards: ["clarity"] }
|
|
@@ -626,11 +635,22 @@ async function registry(resolve) {
|
|
|
626
635
|
schema: GoogleMapsOptions,
|
|
627
636
|
label: "Google Maps",
|
|
628
637
|
envDefaults: { apiKey: "" },
|
|
638
|
+
category: "content"
|
|
639
|
+
}),
|
|
640
|
+
def("leaflet", {
|
|
641
|
+
schema: LeafletOptions,
|
|
642
|
+
label: "Leaflet",
|
|
643
|
+
src: "https://unpkg.com/leaflet@1.9.4/dist/leaflet.js",
|
|
629
644
|
category: "content",
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
645
|
+
bundle: true
|
|
646
|
+
}),
|
|
647
|
+
def("maplibre", {
|
|
648
|
+
composableName: "useScriptMapLibre",
|
|
649
|
+
schema: MapLibreOptions,
|
|
650
|
+
label: "MapLibre GL JS",
|
|
651
|
+
src: "https://unpkg.com/maplibre-gl@5.24.0/dist/maplibre-gl.js",
|
|
652
|
+
category: "content",
|
|
653
|
+
bundle: true
|
|
634
654
|
}),
|
|
635
655
|
def("blueskyEmbed", {
|
|
636
656
|
composableName: false,
|
|
@@ -638,8 +658,8 @@ async function registry(resolve) {
|
|
|
638
658
|
label: "Bluesky Embed",
|
|
639
659
|
category: "content",
|
|
640
660
|
serverHandlers: [
|
|
641
|
-
{ route: "/_scripts/embed/bluesky", handler: "./runtime/server/bluesky-embed"
|
|
642
|
-
{ route: "/_scripts/embed/bluesky-image", handler: "./runtime/server/bluesky-embed-image"
|
|
661
|
+
{ route: "/_scripts/embed/bluesky", handler: "./runtime/server/bluesky-embed" },
|
|
662
|
+
{ route: "/_scripts/embed/bluesky-image", handler: "./runtime/server/bluesky-embed-image" }
|
|
643
663
|
]
|
|
644
664
|
}),
|
|
645
665
|
def("instagramEmbed", {
|
|
@@ -648,9 +668,9 @@ async function registry(resolve) {
|
|
|
648
668
|
label: "Instagram Embed",
|
|
649
669
|
category: "content",
|
|
650
670
|
serverHandlers: [
|
|
651
|
-
{ route: "/_scripts/embed/instagram", handler: "./runtime/server/instagram-embed"
|
|
652
|
-
{ route: "/_scripts/embed/instagram-image", handler: "./runtime/server/instagram-embed-image"
|
|
653
|
-
{ route: "/_scripts/embed/instagram-asset", handler: "./runtime/server/instagram-embed-asset"
|
|
671
|
+
{ route: "/_scripts/embed/instagram", handler: "./runtime/server/instagram-embed" },
|
|
672
|
+
{ route: "/_scripts/embed/instagram-image", handler: "./runtime/server/instagram-embed-image" },
|
|
673
|
+
{ route: "/_scripts/embed/instagram-asset", handler: "./runtime/server/instagram-embed-asset" }
|
|
654
674
|
]
|
|
655
675
|
}),
|
|
656
676
|
def("xEmbed", {
|
|
@@ -659,8 +679,8 @@ async function registry(resolve) {
|
|
|
659
679
|
label: "X Embed",
|
|
660
680
|
category: "content",
|
|
661
681
|
serverHandlers: [
|
|
662
|
-
{ route: "/_scripts/embed/x", handler: "./runtime/server/x-embed"
|
|
663
|
-
{ route: "/_scripts/embed/x-image", handler: "./runtime/server/x-embed-image"
|
|
682
|
+
{ route: "/_scripts/embed/x", handler: "./runtime/server/x-embed" },
|
|
683
|
+
{ route: "/_scripts/embed/x-image", handler: "./runtime/server/x-embed-image" }
|
|
664
684
|
]
|
|
665
685
|
}),
|
|
666
686
|
// support
|
|
@@ -671,6 +691,18 @@ async function registry(resolve) {
|
|
|
671
691
|
envDefaults: { id: "" },
|
|
672
692
|
bundle: true
|
|
673
693
|
}),
|
|
694
|
+
// DeskCrew serves one mutable bundle from its own origin and derives its API
|
|
695
|
+
// origin from the executing script's own `src`. Bundling to /_scripts/assets
|
|
696
|
+
// would repoint every widget API call at the consuming site's origin, and
|
|
697
|
+
// proxying would put the consuming site's server in the path of live chat
|
|
698
|
+
// polling. Both capabilities are therefore intentionally absent.
|
|
699
|
+
def("deskcrew", {
|
|
700
|
+
schema: DeskCrewOptions,
|
|
701
|
+
label: "DeskCrew",
|
|
702
|
+
category: "support",
|
|
703
|
+
composableName: "useScriptDeskCrew",
|
|
704
|
+
envDefaults: { widgetKey: "", board: "" }
|
|
705
|
+
}),
|
|
674
706
|
// cdn
|
|
675
707
|
def("npm", {
|
|
676
708
|
schema: NpmOptions,
|
|
@@ -793,7 +825,7 @@ async function registry(resolve) {
|
|
|
793
825
|
privacy: PRIVACY_IP_ONLY
|
|
794
826
|
},
|
|
795
827
|
serverHandlers: [
|
|
796
|
-
{ route: "/_scripts/proxy/gravatar", handler: "./runtime/server/gravatar-proxy"
|
|
828
|
+
{ route: "/_scripts/proxy/gravatar", handler: "./runtime/server/gravatar-proxy" }
|
|
797
829
|
]
|
|
798
830
|
}),
|
|
799
831
|
def("speedcurve", {
|
|
@@ -11,24 +11,6 @@ export interface ScriptGoogleMapsProps {
|
|
|
11
11
|
* Defines the Google Maps API key. Must have access to the Static Maps API as well.
|
|
12
12
|
*/
|
|
13
13
|
apiKey?: string;
|
|
14
|
-
/**
|
|
15
|
-
* A latitude / longitude of where to focus the map.
|
|
16
|
-
*
|
|
17
|
-
* @deprecated Pass `center` via `mapOptions` instead. The top-level `center`
|
|
18
|
-
* prop will be removed in a future major version. When both are set,
|
|
19
|
-
* `mapOptions.center` wins.
|
|
20
|
-
* @see https://scripts.nuxt.com/docs/migration-guide/v0-to-v1
|
|
21
|
-
*/
|
|
22
|
-
center?: google.maps.LatLng | google.maps.LatLngLiteral | `${string},${string}`;
|
|
23
|
-
/**
|
|
24
|
-
* Zoom level for the map (0-21). Reactive: changing this will update the map.
|
|
25
|
-
*
|
|
26
|
-
* @deprecated Pass `zoom` via `mapOptions` instead. The top-level `zoom`
|
|
27
|
-
* prop will be removed in a future major version. When both are set,
|
|
28
|
-
* `mapOptions.zoom` wins.
|
|
29
|
-
* @see https://scripts.nuxt.com/docs/migration-guide/v0-to-v1
|
|
30
|
-
*/
|
|
31
|
-
zoom?: number;
|
|
32
14
|
/**
|
|
33
15
|
* Options for the map.
|
|
34
16
|
*/
|
|
@@ -80,22 +62,13 @@ export interface ScriptGoogleMapsExpose {
|
|
|
80
62
|
* `undefined` if not yet loaded.
|
|
81
63
|
*/
|
|
82
64
|
mapsApi: ShallowRef<typeof google.maps | undefined>;
|
|
83
|
-
/**
|
|
84
|
-
* A reference to the loaded Google Maps API namespace, or `undefined` if not
|
|
85
|
-
* yet loaded.
|
|
86
|
-
*
|
|
87
|
-
* @deprecated Use `mapsApi` instead. The `googleMaps` alias will be removed
|
|
88
|
-
* in a future major version.
|
|
89
|
-
* @see https://scripts.nuxt.com/docs/migration-guide/v0-to-v1
|
|
90
|
-
*/
|
|
91
|
-
googleMaps: ShallowRef<typeof google.maps | undefined>;
|
|
92
65
|
/**
|
|
93
66
|
* A reference to the Google Map instance, or `undefined` if not yet initialized.
|
|
94
67
|
*/
|
|
95
68
|
map: ShallowRef<google.maps.Map | undefined>;
|
|
96
69
|
/**
|
|
97
70
|
* Utility function to resolve a location query (e.g. "New York, NY") to latitude/longitude coordinates.
|
|
98
|
-
* Uses
|
|
71
|
+
* Uses the client Places service and caches results for the current page session.
|
|
99
72
|
*/
|
|
100
73
|
resolveQueryToLatLng: (query: string) => Promise<google.maps.LatLng | google.maps.LatLngLiteral | undefined>;
|
|
101
74
|
/**
|
|
@@ -4,19 +4,17 @@ export { MAP_INJECTION_KEY } from "./useGoogleMapsResource";
|
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { defu } from "defu";
|
|
7
|
-
import { tryUseNuxtApp, useHead
|
|
8
|
-
import { computed, nextTick, onBeforeUnmount, onMounted, onUnmounted, provide, ref, shallowRef, toRaw,
|
|
7
|
+
import { tryUseNuxtApp, useHead } from "nuxt/app";
|
|
8
|
+
import { computed, nextTick, onBeforeUnmount, onMounted, onUnmounted, provide, ref, shallowRef, toRaw, useTemplateRef, watch } from "vue";
|
|
9
9
|
import { useScriptTriggerElement } from "#nuxt-scripts/composables/useScriptTriggerElement";
|
|
10
10
|
import { useScriptGoogleMaps } from "#nuxt-scripts/registry/google-maps";
|
|
11
|
-
import { scriptRuntimeConfig
|
|
11
|
+
import { scriptRuntimeConfig } from "#nuxt-scripts/utils";
|
|
12
12
|
import { createAbortablePromise } from "../../utils/abortable-promise";
|
|
13
13
|
import ScriptAriaLoadingIndicator from "../ScriptAriaLoadingIndicator.vue";
|
|
14
|
-
import {
|
|
14
|
+
import { MAP_INJECTION_KEY, waitForMapsReady } from "./useGoogleMapsResource";
|
|
15
15
|
const props = defineProps({
|
|
16
16
|
trigger: { type: [String, Array, Boolean], required: false, default: ["mouseenter", "mouseover", "mousedown"] },
|
|
17
17
|
apiKey: { type: String, required: false },
|
|
18
|
-
center: { type: null, required: false },
|
|
19
|
-
zoom: { type: Number, required: false },
|
|
20
18
|
mapOptions: { type: null, required: false },
|
|
21
19
|
region: { type: String, required: false },
|
|
22
20
|
language: { type: String, required: false },
|
|
@@ -32,7 +30,6 @@ defineSlots();
|
|
|
32
30
|
const DIGITS_ONLY_RE = /^\d+$/;
|
|
33
31
|
const DIGITS_PX_RE = /^\d+px$/i;
|
|
34
32
|
const apiKey = props.apiKey || scriptRuntimeConfig("googleMaps")?.apiKey;
|
|
35
|
-
const runtimeConfig = useRuntimeConfig();
|
|
36
33
|
const nuxtColorMode = computed(() => {
|
|
37
34
|
const value = tryUseNuxtApp()?.$colorMode?.value;
|
|
38
35
|
return value === "dark" || value === "light" ? value : void 0;
|
|
@@ -53,20 +50,7 @@ const lifecycleController = new AbortController();
|
|
|
53
50
|
let isUnmounted = false;
|
|
54
51
|
if (import.meta.dev) {
|
|
55
52
|
if (!apiKey)
|
|
56
|
-
throw new Error("GoogleMaps requires an API key. Enable it in your nuxt.config:\n\n scripts: {\n registry: {\n googleMaps:
|
|
57
|
-
const attrs = useAttrs();
|
|
58
|
-
const removedProps = {
|
|
59
|
-
markers: "Use child <ScriptGoogleMapsMarker> components instead.",
|
|
60
|
-
centerMarker: 'Use a child <ScriptGoogleMapsMarker :position="center" /> instead.',
|
|
61
|
-
placeholderOptions: "Use <ScriptGoogleMapsStaticMap> inside the #placeholder slot instead.",
|
|
62
|
-
placeholderAttrs: "Use <ScriptGoogleMapsStaticMap> with :img-attrs instead.",
|
|
63
|
-
aboveTheFold: 'Use <ScriptGoogleMapsStaticMap loading="eager"> inside #placeholder instead.'
|
|
64
|
-
};
|
|
65
|
-
for (const [prop, message] of Object.entries(removedProps)) {
|
|
66
|
-
if (prop in attrs)
|
|
67
|
-
console.warn(`[nuxt-scripts] <ScriptGoogleMaps> prop "${prop}" was removed in v1. ${message} See https://scripts.nuxt.com/docs/migration-guide/v0-to-v1`);
|
|
68
|
-
}
|
|
69
|
-
warnDeprecatedTopLevelMapProps({ center: props.center, zoom: props.zoom });
|
|
53
|
+
throw new Error("GoogleMaps requires an API key. Enable it in your nuxt.config:\n\n scripts: {\n registry: {\n googleMaps: {}\n }\n }\n\nThen set NUXT_PUBLIC_SCRIPTS_GOOGLE_MAPS_API_KEY in your .env file.\n\nAlternatively, pass `api-key` directly on the <ScriptGoogleMaps> component (note: this exposes the key client-side).");
|
|
70
54
|
}
|
|
71
55
|
const rootEl = useTemplateRef("rootEl");
|
|
72
56
|
const mapEl = useTemplateRef("mapEl");
|
|
@@ -86,7 +70,6 @@ const options = computed(() => {
|
|
|
86
70
|
return defu(
|
|
87
71
|
{ center: centerOverride.value, mapId, colorScheme: currentColorScheme.value },
|
|
88
72
|
props.mapOptions,
|
|
89
|
-
{ center: props.center, zoom: props.zoom },
|
|
90
73
|
{ zoom: 15 }
|
|
91
74
|
);
|
|
92
75
|
});
|
|
@@ -109,7 +92,7 @@ function getCenterWatchKey(center) {
|
|
|
109
92
|
return void 0;
|
|
110
93
|
}
|
|
111
94
|
const controlledCenterKey = computed(() => {
|
|
112
|
-
return getCenterWatchKey(centerOverride.value) || getCenterWatchKey(props.mapOptions?.center)
|
|
95
|
+
return getCenterWatchKey(centerOverride.value) || getCenterWatchKey(props.mapOptions?.center);
|
|
113
96
|
});
|
|
114
97
|
function getReactiveMapOptions(options2) {
|
|
115
98
|
const { center: _, zoom: __, mapId: ___, colorScheme: ____, ...rest } = options2;
|
|
@@ -144,20 +127,6 @@ async function resolveQueryToLatLng(query) {
|
|
|
144
127
|
if (queryToLatLngCache.has(query)) {
|
|
145
128
|
return Promise.resolve(queryToLatLngCache.get(query));
|
|
146
129
|
}
|
|
147
|
-
const endpoints = runtimeConfig.public["nuxt-scripts"]?.endpoints;
|
|
148
|
-
if (endpoints?.googleMaps) {
|
|
149
|
-
const data = await $fetch(`${scriptsPrefix()}/proxy/google-maps-geocode`, {
|
|
150
|
-
params: { address: query },
|
|
151
|
-
signal: lifecycleController.signal
|
|
152
|
-
});
|
|
153
|
-
if (data.status === "OK" && data.results?.[0]?.geometry?.location) {
|
|
154
|
-
const loc = data.results[0].geometry.location;
|
|
155
|
-
const latLng = { lat: loc.lat, lng: loc.lng };
|
|
156
|
-
queryToLatLngCache.set(query, latLng);
|
|
157
|
-
return latLng;
|
|
158
|
-
}
|
|
159
|
-
throw new Error(`No location found for ${query}`);
|
|
160
|
-
}
|
|
161
130
|
await waitForMapsReady({ mapsApi, map, status, load, signal: lifecycleController.signal });
|
|
162
131
|
const placesService = new mapsApi.value.places.PlacesService(map.value);
|
|
163
132
|
const result = await new Promise((resolve, reject) => {
|
|
@@ -208,22 +177,10 @@ function importLibrary(key) {
|
|
|
208
177
|
}
|
|
209
178
|
const exposed = {
|
|
210
179
|
mapsApi,
|
|
211
|
-
// Plain alias for production. In dev, replaced below with a getter that
|
|
212
|
-
// emits a one-shot deprecation warning. Both forms return the same
|
|
213
|
-
// shallow ref as `mapsApi`.
|
|
214
|
-
googleMaps: mapsApi,
|
|
215
180
|
map,
|
|
216
181
|
resolveQueryToLatLng,
|
|
217
182
|
importLibrary
|
|
218
183
|
};
|
|
219
|
-
if (import.meta.dev) {
|
|
220
|
-
defineDeprecatedAlias(
|
|
221
|
-
exposed,
|
|
222
|
-
"googleMaps",
|
|
223
|
-
"mapsApi",
|
|
224
|
-
'[nuxt-scripts] <ScriptGoogleMaps> expose key "googleMaps" is deprecated; use "mapsApi" instead. See https://scripts.nuxt.com/docs/migration-guide/v0-to-v1'
|
|
225
|
-
);
|
|
226
|
-
}
|
|
227
184
|
defineExpose(exposed);
|
|
228
185
|
let activeInfoWindow;
|
|
229
186
|
provide(MAP_INJECTION_KEY, {
|
|
@@ -287,7 +244,7 @@ onMounted(() => {
|
|
|
287
244
|
map.value.setZoom(zoom);
|
|
288
245
|
}
|
|
289
246
|
});
|
|
290
|
-
watch(
|
|
247
|
+
watch(() => getCenterWatchKey(props.mapOptions?.center), () => {
|
|
291
248
|
centerOverride.value = void 0;
|
|
292
249
|
});
|
|
293
250
|
watch([controlledCenterKey, isMapReady, map], async (_, __, onCleanup) => {
|
|
@@ -11,24 +11,6 @@ export interface ScriptGoogleMapsProps {
|
|
|
11
11
|
* Defines the Google Maps API key. Must have access to the Static Maps API as well.
|
|
12
12
|
*/
|
|
13
13
|
apiKey?: string;
|
|
14
|
-
/**
|
|
15
|
-
* A latitude / longitude of where to focus the map.
|
|
16
|
-
*
|
|
17
|
-
* @deprecated Pass `center` via `mapOptions` instead. The top-level `center`
|
|
18
|
-
* prop will be removed in a future major version. When both are set,
|
|
19
|
-
* `mapOptions.center` wins.
|
|
20
|
-
* @see https://scripts.nuxt.com/docs/migration-guide/v0-to-v1
|
|
21
|
-
*/
|
|
22
|
-
center?: google.maps.LatLng | google.maps.LatLngLiteral | `${string},${string}`;
|
|
23
|
-
/**
|
|
24
|
-
* Zoom level for the map (0-21). Reactive: changing this will update the map.
|
|
25
|
-
*
|
|
26
|
-
* @deprecated Pass `zoom` via `mapOptions` instead. The top-level `zoom`
|
|
27
|
-
* prop will be removed in a future major version. When both are set,
|
|
28
|
-
* `mapOptions.zoom` wins.
|
|
29
|
-
* @see https://scripts.nuxt.com/docs/migration-guide/v0-to-v1
|
|
30
|
-
*/
|
|
31
|
-
zoom?: number;
|
|
32
14
|
/**
|
|
33
15
|
* Options for the map.
|
|
34
16
|
*/
|
|
@@ -80,22 +62,13 @@ export interface ScriptGoogleMapsExpose {
|
|
|
80
62
|
* `undefined` if not yet loaded.
|
|
81
63
|
*/
|
|
82
64
|
mapsApi: ShallowRef<typeof google.maps | undefined>;
|
|
83
|
-
/**
|
|
84
|
-
* A reference to the loaded Google Maps API namespace, or `undefined` if not
|
|
85
|
-
* yet loaded.
|
|
86
|
-
*
|
|
87
|
-
* @deprecated Use `mapsApi` instead. The `googleMaps` alias will be removed
|
|
88
|
-
* in a future major version.
|
|
89
|
-
* @see https://scripts.nuxt.com/docs/migration-guide/v0-to-v1
|
|
90
|
-
*/
|
|
91
|
-
googleMaps: ShallowRef<typeof google.maps | undefined>;
|
|
92
65
|
/**
|
|
93
66
|
* A reference to the Google Map instance, or `undefined` if not yet initialized.
|
|
94
67
|
*/
|
|
95
68
|
map: ShallowRef<google.maps.Map | undefined>;
|
|
96
69
|
/**
|
|
97
70
|
* Utility function to resolve a location query (e.g. "New York, NY") to latitude/longitude coordinates.
|
|
98
|
-
* Uses
|
|
71
|
+
* Uses the client Places service and caches results for the current page session.
|
|
99
72
|
*/
|
|
100
73
|
resolveQueryToLatLng: (query: string) => Promise<google.maps.LatLng | google.maps.LatLngLiteral | undefined>;
|
|
101
74
|
/**
|
|
@@ -69,14 +69,6 @@ export interface ScriptGoogleMapsOverlayViewSlots {
|
|
|
69
69
|
export interface ScriptGoogleMapsOverlayViewExpose {
|
|
70
70
|
/** The underlying `OverlayView` instance. */
|
|
71
71
|
overlayView: ShallowRef<google.maps.OverlayView | undefined>;
|
|
72
|
-
/**
|
|
73
|
-
* The underlying `OverlayView` instance.
|
|
74
|
-
*
|
|
75
|
-
* @deprecated Use `overlayView` instead. The `overlay` alias will be
|
|
76
|
-
* removed in a future major version.
|
|
77
|
-
* @see https://scripts.nuxt.com/docs/migration-guide/v0-to-v1
|
|
78
|
-
*/
|
|
79
|
-
overlay: ShallowRef<google.maps.OverlayView | undefined>;
|
|
80
72
|
/** The current data-state of the overlay, either 'open' or 'closed'. */
|
|
81
73
|
dataState: Readonly<ShallowRef<'open' | 'closed'>>;
|
|
82
74
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { computed, inject, shallowRef, useTemplateRef, watch } from "vue";
|
|
7
7
|
import { MARKER_CLUSTERER_INJECTION_KEY } from "./types";
|
|
8
|
-
import {
|
|
8
|
+
import { MARKER_INJECTION_KEY, normalizeLatLng, useGoogleMapsResource } from "./useGoogleMapsResource";
|
|
9
9
|
defineOptions({
|
|
10
10
|
inheritAttrs: false
|
|
11
11
|
});
|
|
@@ -227,20 +227,8 @@ if (markerClustererContext && markerContext) {
|
|
|
227
227
|
}
|
|
228
228
|
const exposed = {
|
|
229
229
|
overlayView: overlay,
|
|
230
|
-
// Plain alias for production. In dev, replaced below with a getter that
|
|
231
|
-
// emits a one-shot deprecation warning. Both forms return the same
|
|
232
|
-
// shallow ref as `overlayView`.
|
|
233
|
-
overlay,
|
|
234
230
|
dataState
|
|
235
231
|
};
|
|
236
|
-
if (import.meta.dev) {
|
|
237
|
-
defineDeprecatedAlias(
|
|
238
|
-
exposed,
|
|
239
|
-
"overlay",
|
|
240
|
-
"overlayView",
|
|
241
|
-
'[nuxt-scripts] <ScriptGoogleMapsOverlayView> expose key "overlay" is deprecated; use "overlayView" instead. See https://scripts.nuxt.com/docs/migration-guide/v0-to-v1'
|
|
242
|
-
);
|
|
243
|
-
}
|
|
244
232
|
defineExpose(exposed);
|
|
245
233
|
</script>
|
|
246
234
|
|
|
@@ -69,14 +69,6 @@ export interface ScriptGoogleMapsOverlayViewSlots {
|
|
|
69
69
|
export interface ScriptGoogleMapsOverlayViewExpose {
|
|
70
70
|
/** The underlying `OverlayView` instance. */
|
|
71
71
|
overlayView: ShallowRef<google.maps.OverlayView | undefined>;
|
|
72
|
-
/**
|
|
73
|
-
* The underlying `OverlayView` instance.
|
|
74
|
-
*
|
|
75
|
-
* @deprecated Use `overlayView` instead. The `overlay` alias will be
|
|
76
|
-
* removed in a future major version.
|
|
77
|
-
* @see https://scripts.nuxt.com/docs/migration-guide/v0-to-v1
|
|
78
|
-
*/
|
|
79
|
-
overlay: ShallowRef<google.maps.OverlayView | undefined>;
|
|
80
72
|
/** The current data-state of the overlay, either 'open' or 'closed'. */
|
|
81
73
|
dataState: Readonly<ShallowRef<'open' | 'closed'>>;
|
|
82
74
|
}
|
|
@@ -64,11 +64,11 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
64
64
|
*/
|
|
65
65
|
region?: string;
|
|
66
66
|
/**
|
|
67
|
-
*
|
|
67
|
+
* Google Maps digital signature for the complete request URL. Requires an API key.
|
|
68
68
|
*/
|
|
69
69
|
signature?: string;
|
|
70
70
|
/**
|
|
71
|
-
* API key override.
|
|
71
|
+
* Public API key override. Falls back to the Google Maps registry key.
|
|
72
72
|
*/
|
|
73
73
|
apiKey?: string;
|
|
74
74
|
/**
|
|
@@ -158,11 +158,11 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
158
158
|
*/
|
|
159
159
|
region?: string;
|
|
160
160
|
/**
|
|
161
|
-
*
|
|
161
|
+
* Google Maps digital signature for the complete request URL. Requires an API key.
|
|
162
162
|
*/
|
|
163
163
|
signature?: string;
|
|
164
164
|
/**
|
|
165
|
-
* API key override.
|
|
165
|
+
* Public API key override. Falls back to the Google Maps registry key.
|
|
166
166
|
*/
|
|
167
167
|
apiKey?: string;
|
|
168
168
|
/**
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { defu } from "defu";
|
|
3
|
-
import { useHead
|
|
3
|
+
import { useHead } from "nuxt/app";
|
|
4
4
|
import { withQuery } from "ufo";
|
|
5
5
|
import { computed, onMounted, ref } from "vue";
|
|
6
6
|
import { scriptRuntimeConfig } from "#nuxt-scripts/utils";
|
|
7
|
-
import { useScriptProxyUrl } from "../../composables/useScriptProxyUrl";
|
|
8
7
|
</script>
|
|
9
8
|
|
|
10
9
|
<script setup>
|
|
@@ -32,14 +31,12 @@ const props = defineProps({
|
|
|
32
31
|
alt: { type: String, required: false, default: "Google Maps" }
|
|
33
32
|
});
|
|
34
33
|
defineSlots();
|
|
35
|
-
const runtimeConfig = useRuntimeConfig();
|
|
36
|
-
const proxyConfig = runtimeConfig.public["nuxt-scripts"]?.googleStaticMapsProxy;
|
|
37
34
|
const apiKey = props.apiKey || scriptRuntimeConfig("googleMaps")?.apiKey;
|
|
38
|
-
const useProxy = !props.apiKey && proxyConfig?.enabled;
|
|
39
|
-
const proxyUrl = useScriptProxyUrl();
|
|
40
35
|
if (import.meta.dev) {
|
|
41
|
-
if (!apiKey
|
|
42
|
-
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
|
|
36
|
+
if (!apiKey)
|
|
37
|
+
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 pass the apiKey prop.");
|
|
38
|
+
if (props.signature && !props.size)
|
|
39
|
+
console.warn("[nuxt-scripts] ScriptGoogleMapsStaticMap requires an explicit size when using a digital signature because the signature covers the complete request URL.");
|
|
43
40
|
}
|
|
44
41
|
const rootEl = ref();
|
|
45
42
|
const measuredSize = ref();
|
|
@@ -48,7 +45,7 @@ function clampStaticMapSize(width, height, max = 640) {
|
|
|
48
45
|
return `${Math.max(1, Math.floor(width * ratio))}x${Math.max(1, Math.floor(height * ratio))}`;
|
|
49
46
|
}
|
|
50
47
|
onMounted(() => {
|
|
51
|
-
if (props.size || !rootEl.value)
|
|
48
|
+
if (props.size || props.signature || !rootEl.value)
|
|
52
49
|
return;
|
|
53
50
|
const { offsetWidth, offsetHeight } = rootEl.value;
|
|
54
51
|
if (offsetWidth > 0 && offsetHeight > 0) {
|
|
@@ -118,16 +115,13 @@ const src = computed(() => {
|
|
|
118
115
|
style: resolveStyle(props.style),
|
|
119
116
|
language: props.language,
|
|
120
117
|
region: props.region,
|
|
121
|
-
|
|
122
|
-
|
|
118
|
+
key: apiKey,
|
|
119
|
+
signature: props.signature
|
|
123
120
|
};
|
|
124
121
|
for (const key of Object.keys(query)) {
|
|
125
122
|
if (query[key] === void 0)
|
|
126
123
|
delete query[key];
|
|
127
124
|
}
|
|
128
|
-
if (useProxy) {
|
|
129
|
-
return proxyUrl("/_scripts/proxy/google-static-maps", query);
|
|
130
|
-
}
|
|
131
125
|
return withQuery("https://maps.googleapis.com/maps/api/staticmap", query);
|
|
132
126
|
});
|
|
133
127
|
const imgAttributes = computed(() => {
|
|
@@ -149,7 +143,7 @@ const rootStyle = computed(() => ({
|
|
|
149
143
|
maxWidth: "100%",
|
|
150
144
|
overflow: "hidden"
|
|
151
145
|
}));
|
|
152
|
-
if (import.meta.server
|
|
146
|
+
if (import.meta.server) {
|
|
153
147
|
useHead({
|
|
154
148
|
link: [
|
|
155
149
|
{
|
|
@@ -64,11 +64,11 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
64
64
|
*/
|
|
65
65
|
region?: string;
|
|
66
66
|
/**
|
|
67
|
-
*
|
|
67
|
+
* Google Maps digital signature for the complete request URL. Requires an API key.
|
|
68
68
|
*/
|
|
69
69
|
signature?: string;
|
|
70
70
|
/**
|
|
71
|
-
* API key override.
|
|
71
|
+
* Public API key override. Falls back to the Google Maps registry key.
|
|
72
72
|
*/
|
|
73
73
|
apiKey?: string;
|
|
74
74
|
/**
|
|
@@ -158,11 +158,11 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
158
158
|
*/
|
|
159
159
|
region?: string;
|
|
160
160
|
/**
|
|
161
|
-
*
|
|
161
|
+
* Google Maps digital signature for the complete request URL. Requires an API key.
|
|
162
162
|
*/
|
|
163
163
|
signature?: string;
|
|
164
164
|
/**
|
|
165
|
-
* API key override.
|
|
165
|
+
* Public API key override. Falls back to the Google Maps registry key.
|
|
166
166
|
*/
|
|
167
167
|
apiKey?: string;
|
|
168
168
|
/**
|
|
@@ -35,28 +35,6 @@ export interface GoogleMapsResourceContext {
|
|
|
35
35
|
* return plain objects rather than real `LatLng` instances.
|
|
36
36
|
*/
|
|
37
37
|
export declare function normalizeLatLng(p: google.maps.LatLng | google.maps.LatLngLiteral): google.maps.LatLngLiteral;
|
|
38
|
-
/**
|
|
39
|
-
* Defines a deprecated property alias on an exposed object. Reading the alias
|
|
40
|
-
* returns the value of the canonical key and emits a one-shot
|
|
41
|
-
* `console.warn` (so repeated reads don't spam the console).
|
|
42
|
-
*
|
|
43
|
-
* Used to provide backward-compatible renames on `defineExpose` payloads
|
|
44
|
-
* without breaking existing template-ref consumers. Call sites should wrap
|
|
45
|
-
* this in `if (import.meta.dev)` so production builds skip the getter
|
|
46
|
-
* entirely and the alias stays a plain data property.
|
|
47
|
-
*/
|
|
48
|
-
export declare function defineDeprecatedAlias<T extends object, K extends keyof T>(target: T, alias: string, canonicalKey: K, message: string): T;
|
|
49
|
-
/**
|
|
50
|
-
* Emits dev-mode deprecation warnings for the legacy top-level `center` and
|
|
51
|
-
* `zoom` props on `<ScriptGoogleMaps>`. Both props still work, but new code
|
|
52
|
-
* should pass them via `mapOptions` instead.
|
|
53
|
-
*
|
|
54
|
-
* Returns the number of warnings emitted (useful for tests).
|
|
55
|
-
*/
|
|
56
|
-
export declare function warnDeprecatedTopLevelMapProps(props: {
|
|
57
|
-
center?: unknown;
|
|
58
|
-
zoom?: unknown;
|
|
59
|
-
}): number;
|
|
60
38
|
/**
|
|
61
39
|
* Wait until the Google Maps API and a Map instance are both available.
|
|
62
40
|
*
|