@nuxt/scripts 1.0.0-beta.21 → 1.0.0-beta.23
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/client/200.html +1 -1
- package/dist/client/404.html +1 -1
- package/dist/client/_nuxt/{BlmrFwhD.js → B7aPLMNo.js} +1 -1
- package/dist/client/_nuxt/{DvbTvDd0.js → BNNMZFwZ.js} +21 -21
- package/dist/client/_nuxt/{BwCYQWJt.js → Bh9fd9qr.js} +1 -1
- package/dist/client/_nuxt/{ZrewjUYk.js → UTi7FhVv.js} +1 -1
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/39ee5395-65bb-4a46-82e0-e68853f94418.json +1 -0
- package/dist/client/_nuxt/error-404.DMdWw4vT.css +1 -0
- package/dist/client/_nuxt/error-500.CROTF27X.css +1 -0
- package/dist/client/index.html +1 -1
- package/dist/module.d.mts +2 -2
- package/dist/module.d.ts +2 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +60 -52
- package/dist/registry.mjs +30 -4
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.d.vue.ts +3 -3
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue +14 -1
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue.d.ts +3 -3
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.d.vue.ts +2 -2
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.vue.d.ts +2 -2
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.d.vue.ts +2 -2
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.vue.d.ts +2 -2
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolygon.d.vue.ts +2 -2
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolygon.vue.d.ts +2 -2
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolyline.d.vue.ts +2 -2
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolyline.vue.d.ts +2 -2
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsRectangle.d.vue.ts +2 -2
- package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsRectangle.vue.d.ts +2 -2
- package/dist/runtime/components/ScriptBlueskyEmbed.d.vue.ts +87 -0
- package/dist/runtime/components/ScriptBlueskyEmbed.vue +85 -0
- package/dist/runtime/components/ScriptBlueskyEmbed.vue.d.ts +87 -0
- package/dist/runtime/components/ScriptInstagramEmbed.d.vue.ts +2 -2
- package/dist/runtime/components/ScriptInstagramEmbed.vue +4 -1
- package/dist/runtime/components/ScriptInstagramEmbed.vue.d.ts +2 -2
- package/dist/runtime/components/ScriptXEmbed.d.vue.ts +2 -2
- package/dist/runtime/components/ScriptXEmbed.vue +5 -2
- package/dist/runtime/components/ScriptXEmbed.vue.d.ts +2 -2
- package/dist/runtime/registry/bluesky-embed.d.ts +116 -0
- package/dist/runtime/registry/bluesky-embed.js +72 -0
- package/dist/runtime/registry/gravatar.js +2 -2
- package/dist/runtime/registry/schemas.d.ts +20 -3
- package/dist/runtime/registry/schemas.js +20 -3
- package/dist/runtime/registry/x-embed.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 +1 -12
- package/dist/runtime/server/gravatar-proxy.js +1 -16
- package/dist/runtime/server/instagram-embed-asset.js +8 -42
- package/dist/runtime/server/instagram-embed-image.js +6 -54
- package/dist/runtime/server/instagram-embed.d.ts +16 -0
- package/dist/runtime/server/instagram-embed.js +171 -42
- 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/x-embed-image.js +5 -49
- package/dist/runtime/types.d.ts +11 -0
- package/dist/runtime/utils.d.ts +1 -0
- package/dist/runtime/utils.js +11 -2
- package/dist/stats.mjs +1 -1
- package/dist/types-source.d.mts +0 -2
- package/dist/types-source.d.ts +0 -2
- package/dist/types-source.mjs +1960 -941
- package/package.json +8 -7
- package/dist/client/_nuxt/builds/meta/6660a023-888d-415f-b66d-ce774e6f8f11.json +0 -1
- package/dist/client/_nuxt/error-404.CHeaW3dp.css +0 -1
- package/dist/client/_nuxt/error-500.DvOvWme_.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as a,f as s,h as u,i as r,g as h}from"./
|
|
1
|
+
import{u as a,f as s,h as u,i as r,g as h}from"./BNNMZFwZ.js";function i(t){const e=t||s();return e.ssrContext?.head||e.runWithContext(()=>{if(u()){const n=r(h);if(!n)throw new Error("[nuxt] [unhead] Missing Unhead instance.");return n}})}function d(t,e={}){const n=e.head||i(e.nuxt);return a(t,{head:n,...e})}export{d as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as s,
|
|
1
|
+
import{_ as s,o as a,c as i,a as t,t as n,b as u,w as c,d as l,e as d}from"./BNNMZFwZ.js";import{u as f}from"./Bh9fd9qr.js";const p={class:"antialiased bg-white dark:bg-[#020420] dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-[#020420] tracking-wide"},m={class:"max-w-520px text-center"},h=["textContent"],b=["textContent"],x=["textContent"],g={class:"flex items-center justify-center w-full"},y={__name:"error-404",props:{appName:{type:String,default:"Nuxt"},status:{type:Number,default:404},statusText:{type:String,default:"Page not found"},description:{type:String,default:"Sorry, the page you are looking for could not be found."},backHome:{type:String,default:"Go back home"}},setup(e){const r=e;return f({title:`${r.status} - ${r.statusText} | ${r.appName}`,script:[{innerHTML:`!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver(e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)}).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?r.credentials="include":"anonymous"===e.crossOrigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();`}],style:[{innerHTML:'*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}h1,h2{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}h1,h2,p{margin:0}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }'}]}),(k,w)=>{const o=d;return a(),i("div",p,[t("div",m,[t("h1",{class:"font-semibold leading-none mb-4 sm:text-[110px] tabular-nums text-[80px]",textContent:n(e.status)},null,8,h),t("h2",{class:"font-semibold mb-2 sm:text-3xl text-2xl",textContent:n(e.statusText)},null,8,b),t("p",{class:"mb-4 px-2 text-[#64748B] text-md",textContent:n(e.description)},null,8,x),t("div",g,[u(o,{to:"/",class:"font-medium hover:text-[#00DC82] text-sm underline underline-offset-3"},{default:c(()=>[l(n(e.backHome),1)]),_:1})])])])}}},N=s(y,[["__scopeId","data-v-428a09fd"]]);export{N as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"39ee5395-65bb-4a46-82e0-e68853f94418","timestamp":1773403960379}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"39ee5395-65bb-4a46-82e0-e68853f94418","timestamp":1773403960379,"prerendered":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.grid[data-v-428a09fd]{display:grid}.mb-2[data-v-428a09fd]{margin-bottom:.5rem}.mb-4[data-v-428a09fd]{margin-bottom:1rem}.max-w-520px[data-v-428a09fd]{max-width:520px}.min-h-screen[data-v-428a09fd]{min-height:100vh}.w-full[data-v-428a09fd]{width:100%}.flex[data-v-428a09fd]{display:flex}.place-content-center[data-v-428a09fd]{place-content:center}.items-center[data-v-428a09fd]{align-items:center}.justify-center[data-v-428a09fd]{justify-content:center}.overflow-hidden[data-v-428a09fd]{overflow:hidden}.bg-white[data-v-428a09fd]{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.px-2[data-v-428a09fd]{padding-left:.5rem;padding-right:.5rem}.text-center[data-v-428a09fd]{text-align:center}.text-\[80px\][data-v-428a09fd]{font-size:80px}.text-2xl[data-v-428a09fd]{font-size:1.5rem;line-height:2rem}.text-sm[data-v-428a09fd]{font-size:.875rem;line-height:1.25rem}.text-\[\#020420\][data-v-428a09fd]{--un-text-opacity:1;color:rgb(2 4 32/var(--un-text-opacity))}.text-\[\#64748B\][data-v-428a09fd]{--un-text-opacity:1;color:rgb(100 116 139/var(--un-text-opacity))}.hover\:text-\[\#00DC82\][data-v-428a09fd]:hover{--un-text-opacity:1;color:rgb(0 220 130/var(--un-text-opacity))}.font-medium[data-v-428a09fd]{font-weight:500}.font-semibold[data-v-428a09fd]{font-weight:600}.leading-none[data-v-428a09fd]{line-height:1}.tracking-wide[data-v-428a09fd]{letter-spacing:.025em}.font-sans[data-v-428a09fd]{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.tabular-nums[data-v-428a09fd]{--un-numeric-spacing:tabular-nums;font-variant-numeric:var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)}.underline[data-v-428a09fd]{text-decoration-line:underline}.underline-offset-3[data-v-428a09fd]{text-underline-offset:3px}.antialiased[data-v-428a09fd]{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media(prefers-color-scheme:dark){.dark\:bg-\[\#020420\][data-v-428a09fd]{--un-bg-opacity:1;background-color:rgb(2 4 32/var(--un-bg-opacity))}.dark\:text-white[data-v-428a09fd]{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity))}}@media(min-width:640px){.sm\:text-\[110px\][data-v-428a09fd]{font-size:110px}.sm\:text-3xl[data-v-428a09fd]{font-size:1.875rem;line-height:2.25rem}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.grid[data-v-95a1915b]{display:grid}.mb-2[data-v-95a1915b]{margin-bottom:.5rem}.mb-4[data-v-95a1915b]{margin-bottom:1rem}.max-w-520px[data-v-95a1915b]{max-width:520px}.min-h-screen[data-v-95a1915b]{min-height:100vh}.place-content-center[data-v-95a1915b]{place-content:center}.overflow-hidden[data-v-95a1915b]{overflow:hidden}.bg-white[data-v-95a1915b]{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.px-2[data-v-95a1915b]{padding-left:.5rem;padding-right:.5rem}.text-center[data-v-95a1915b]{text-align:center}.text-\[80px\][data-v-95a1915b]{font-size:80px}.text-2xl[data-v-95a1915b]{font-size:1.5rem;line-height:2rem}.text-\[\#020420\][data-v-95a1915b]{--un-text-opacity:1;color:rgb(2 4 32/var(--un-text-opacity))}.text-\[\#64748B\][data-v-95a1915b]{--un-text-opacity:1;color:rgb(100 116 139/var(--un-text-opacity))}.font-semibold[data-v-95a1915b]{font-weight:600}.leading-none[data-v-95a1915b]{line-height:1}.tracking-wide[data-v-95a1915b]{letter-spacing:.025em}.font-sans[data-v-95a1915b]{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.tabular-nums[data-v-95a1915b]{--un-numeric-spacing:tabular-nums;font-variant-numeric:var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)}.antialiased[data-v-95a1915b]{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media(prefers-color-scheme:dark){.dark\:bg-\[\#020420\][data-v-95a1915b]{--un-bg-opacity:1;background-color:rgb(2 4 32/var(--un-bg-opacity))}.dark\:text-white[data-v-95a1915b]{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity))}}@media(min-width:640px){.sm\:text-\[110px\][data-v-95a1915b]{font-size:110px}.sm\:text-3xl[data-v-95a1915b]{font-size:1.875rem;line-height:2.25rem}}
|
package/dist/client/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__nuxt-scripts/_nuxt/entry.CACgbLJl.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__nuxt-scripts/_nuxt/entry.CACgbLJl.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BNNMZFwZ.js"><script type="module" src="/__nuxt-scripts/_nuxt/BNNMZFwZ.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{"nuxt-scripts":{version:"",defaultScriptOptions:{trigger:"onNuxtReady"},googleStaticMapsProxy:"",endpoints:{}}},app:{baseURL:"/__nuxt-scripts",buildId:"39ee5395-65bb-4a46-82e0-e68853f94418",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1773403965676,false]</script></body></html>
|
package/dist/module.d.mts
CHANGED
|
@@ -24,7 +24,7 @@ interface FirstPartyOptions {
|
|
|
24
24
|
* Path prefix for serving bundled scripts.
|
|
25
25
|
*
|
|
26
26
|
* This is where the downloaded and rewritten script files are served from.
|
|
27
|
-
* @default '/_scripts'
|
|
27
|
+
* @default '/_scripts/assets'
|
|
28
28
|
* @example '/_analytics'
|
|
29
29
|
*/
|
|
30
30
|
prefix?: string;
|
|
@@ -33,7 +33,7 @@ interface FirstPartyOptions {
|
|
|
33
33
|
*
|
|
34
34
|
* Analytics collection requests are proxied through these paths.
|
|
35
35
|
* For example, Google Analytics collection goes to `/_scripts/c/ga/g/collect`.
|
|
36
|
-
* @default '/
|
|
36
|
+
* @default '/_scripts/c'
|
|
37
37
|
* @example '/_tracking'
|
|
38
38
|
*/
|
|
39
39
|
collectPrefix?: string;
|
package/dist/module.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ interface FirstPartyOptions {
|
|
|
24
24
|
* Path prefix for serving bundled scripts.
|
|
25
25
|
*
|
|
26
26
|
* This is where the downloaded and rewritten script files are served from.
|
|
27
|
-
* @default '/_scripts'
|
|
27
|
+
* @default '/_scripts/assets'
|
|
28
28
|
* @example '/_analytics'
|
|
29
29
|
*/
|
|
30
30
|
prefix?: string;
|
|
@@ -33,7 +33,7 @@ interface FirstPartyOptions {
|
|
|
33
33
|
*
|
|
34
34
|
* Analytics collection requests are proxied through these paths.
|
|
35
35
|
* For example, Google Analytics collection goes to `/_scripts/c/ga/g/collect`.
|
|
36
|
-
* @default '/
|
|
36
|
+
* @default '/_scripts/c'
|
|
37
37
|
* @example '/_tracking'
|
|
38
38
|
*/
|
|
39
39
|
collectPrefix?: string;
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -32,7 +32,7 @@ function bundleStorage() {
|
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
function setupPublicAssetStrategy(options = {}) {
|
|
35
|
-
const assetsBaseURL = options.prefix || "/_scripts";
|
|
35
|
+
const assetsBaseURL = options.prefix || "/_scripts/assets";
|
|
36
36
|
const nuxt = useNuxt();
|
|
37
37
|
const storage = bundleStorage();
|
|
38
38
|
addDevServerHandler({
|
|
@@ -156,18 +156,28 @@ const AUTO_INJECT_DEFS = [
|
|
|
156
156
|
function autoInjectProxyEndpoints(registry, runtimeConfig, collectPrefix) {
|
|
157
157
|
for (const def of AUTO_INJECT_DEFS) {
|
|
158
158
|
const entry = registry[def.registryKey];
|
|
159
|
-
if (!entry
|
|
159
|
+
if (!entry)
|
|
160
160
|
continue;
|
|
161
|
-
const config = Array.isArray(entry) ? entry[0] : entry;
|
|
162
|
-
if (!config || config[def.configField])
|
|
163
|
-
continue;
|
|
164
|
-
config[def.configField] = def.computeValue(collectPrefix, config);
|
|
165
161
|
const rtScripts = runtimeConfig.public?.scripts;
|
|
166
162
|
const rtEntry = rtScripts?.[def.registryKey];
|
|
167
|
-
|
|
168
|
-
|
|
163
|
+
const rtConfig = rtEntry && typeof rtEntry === "object" ? Array.isArray(rtEntry) ? rtEntry[0] : rtEntry : void 0;
|
|
164
|
+
let config;
|
|
165
|
+
if (entry === true || entry === "mock") {
|
|
166
|
+
if (!rtConfig)
|
|
167
|
+
continue;
|
|
168
|
+
config = rtConfig;
|
|
169
|
+
} else if (typeof entry === "object") {
|
|
170
|
+
config = Array.isArray(entry) ? entry[0] : entry;
|
|
171
|
+
}
|
|
172
|
+
if (!config || config[def.configField])
|
|
173
|
+
continue;
|
|
174
|
+
const value = def.computeValue(collectPrefix, config);
|
|
175
|
+
if (typeof entry === "object") {
|
|
176
|
+
config[def.configField] = value;
|
|
169
177
|
if (rtConfig)
|
|
170
|
-
rtConfig[def.configField] =
|
|
178
|
+
rtConfig[def.configField] = value;
|
|
179
|
+
} else {
|
|
180
|
+
config[def.configField] = value;
|
|
171
181
|
}
|
|
172
182
|
}
|
|
173
183
|
}
|
|
@@ -237,9 +247,9 @@ function generateInterceptPluginContents(interceptRules) {
|
|
|
237
247
|
function resolveFirstPartyConfig(config) {
|
|
238
248
|
const enabled = !!config.firstParty;
|
|
239
249
|
const prefix = typeof config.firstParty === "object" ? config.firstParty.prefix : void 0;
|
|
240
|
-
const collectPrefix = typeof config.firstParty === "object" ? config.firstParty.collectPrefix || "/
|
|
250
|
+
const collectPrefix = typeof config.firstParty === "object" ? config.firstParty.collectPrefix || "/_scripts/c" : "/_scripts/c";
|
|
241
251
|
const privacy = typeof config.firstParty === "object" ? config.firstParty.privacy : void 0;
|
|
242
|
-
const assetsPrefix = prefix || config.assets?.prefix || "/_scripts";
|
|
252
|
+
const assetsPrefix = prefix || config.assets?.prefix || "/_scripts/assets";
|
|
243
253
|
return { enabled, prefix, collectPrefix, privacy, assetsPrefix };
|
|
244
254
|
}
|
|
245
255
|
async function setupFirstPartyHandlers(firstParty, resolvePath) {
|
|
@@ -259,11 +269,11 @@ async function setupFirstPartyHandlers(firstParty, resolvePath) {
|
|
|
259
269
|
return interceptRules;
|
|
260
270
|
}
|
|
261
271
|
function finalizeFirstParty(opts) {
|
|
262
|
-
const { firstParty, interceptRules, registryScriptsWithImport, nuxtOptions } = opts;
|
|
272
|
+
const { firstParty, interceptRules, registryScripts, registryScriptsWithImport, nuxtOptions } = opts;
|
|
263
273
|
const proxyConfigs = getAllProxyConfigs(firstParty.collectPrefix);
|
|
264
274
|
const registryKeys = Object.keys(opts.registry || {});
|
|
265
275
|
const scriptByKey = /* @__PURE__ */ new Map();
|
|
266
|
-
for (const script of
|
|
276
|
+
for (const script of registryScripts) {
|
|
267
277
|
if (script.registryKey) {
|
|
268
278
|
scriptByKey.set(script.registryKey, script);
|
|
269
279
|
}
|
|
@@ -712,7 +722,7 @@ async function isCacheExpired(storage, filename, cacheMaxAge = SEVEN_DAYS_IN_MS)
|
|
|
712
722
|
}
|
|
713
723
|
return Date.now() - meta.timestamp > cacheMaxAge;
|
|
714
724
|
}
|
|
715
|
-
function normalizeScriptData(src, assetsBaseURL = "/_scripts") {
|
|
725
|
+
function normalizeScriptData(src, assetsBaseURL = "/_scripts/assets") {
|
|
716
726
|
if (hasProtocol(src, { acceptRelative: true })) {
|
|
717
727
|
src = src.replace(PROTOCOL_RELATIVE_RE, "https://");
|
|
718
728
|
const url = parseURL(src);
|
|
@@ -1374,17 +1384,18 @@ const module$1 = defineNuxtModule({
|
|
|
1374
1384
|
if (unheadVersion?.startsWith("1")) {
|
|
1375
1385
|
logger.error(`Nuxt Scripts requires Unhead >= 2, you are using v${unheadVersion}. Please run \`nuxi upgrade --clean\` to upgrade...`);
|
|
1376
1386
|
}
|
|
1387
|
+
const googleMapsEnabled = config.googleStaticMapsProxy?.enabled || !!config.registry?.googleMaps;
|
|
1377
1388
|
nuxt.options.runtimeConfig["nuxt-scripts"] = {
|
|
1378
1389
|
version,
|
|
1379
1390
|
// Private proxy config with API key (server-side only)
|
|
1380
|
-
googleStaticMapsProxy:
|
|
1391
|
+
googleStaticMapsProxy: googleMapsEnabled ? { apiKey: nuxt.options.runtimeConfig.public.scripts?.googleMaps?.apiKey } : void 0
|
|
1381
1392
|
};
|
|
1382
1393
|
nuxt.options.runtimeConfig.public["nuxt-scripts"] = {
|
|
1383
1394
|
// expose for devtools
|
|
1384
1395
|
version: nuxt.options.dev ? version : void 0,
|
|
1385
1396
|
defaultScriptOptions: config.defaultScriptOptions,
|
|
1386
1397
|
// Only expose enabled and cacheMaxAge to client, not apiKey
|
|
1387
|
-
googleStaticMapsProxy:
|
|
1398
|
+
googleStaticMapsProxy: googleMapsEnabled ? { enabled: true, cacheMaxAge: config.googleStaticMapsProxy?.cacheMaxAge ?? 3600 } : void 0
|
|
1388
1399
|
};
|
|
1389
1400
|
if (config.registry) {
|
|
1390
1401
|
nuxt.options.runtimeConfig.public = nuxt.options.runtimeConfig.public || {};
|
|
@@ -1512,6 +1523,7 @@ const module$1 = defineNuxtModule({
|
|
|
1512
1523
|
firstParty,
|
|
1513
1524
|
interceptRules,
|
|
1514
1525
|
registry: config.registry,
|
|
1526
|
+
registryScripts,
|
|
1515
1527
|
registryScriptsWithImport,
|
|
1516
1528
|
nuxtOptions: nuxt.options
|
|
1517
1529
|
});
|
|
@@ -1543,43 +1555,39 @@ const module$1 = defineNuxtModule({
|
|
|
1543
1555
|
await p?.();
|
|
1544
1556
|
});
|
|
1545
1557
|
});
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
{
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1558
|
+
const enabledEndpoints = {};
|
|
1559
|
+
for (const script of scripts) {
|
|
1560
|
+
if (!script.serverHandlers?.length || !script.registryKey)
|
|
1561
|
+
continue;
|
|
1562
|
+
const isEnabled = script.registryKey === "googleMaps" ? config.googleStaticMapsProxy?.enabled || config.registry?.googleMaps : config.registry?.[script.registryKey];
|
|
1563
|
+
if (!isEnabled)
|
|
1564
|
+
continue;
|
|
1565
|
+
enabledEndpoints[script.registryKey] = true;
|
|
1566
|
+
for (const handler of script.serverHandlers) {
|
|
1567
|
+
addServerHandler({
|
|
1568
|
+
route: handler.route,
|
|
1569
|
+
handler: handler.handler,
|
|
1570
|
+
middleware: handler.middleware
|
|
1571
|
+
});
|
|
1572
|
+
}
|
|
1573
|
+
if (script.registryKey === "gravatar") {
|
|
1574
|
+
const gravatarConfig = typeof config.registry?.gravatar === "object" && !Array.isArray(config.registry.gravatar) ? config.registry.gravatar : {};
|
|
1575
|
+
nuxt.options.runtimeConfig.public["nuxt-scripts"] = defu(
|
|
1576
|
+
{ gravatarProxy: { cacheMaxAge: gravatarConfig.cacheMaxAge ?? 3600 } },
|
|
1577
|
+
nuxt.options.runtimeConfig.public["nuxt-scripts"]
|
|
1578
|
+
);
|
|
1579
|
+
}
|
|
1580
|
+
if (script.registryKey === "googleMaps") {
|
|
1581
|
+
nuxt.options.runtimeConfig["nuxt-scripts"] = defu(
|
|
1582
|
+
{ googleMapsGeocodeProxy: { apiKey: nuxt.options.runtimeConfig.public.scripts?.googleMaps?.apiKey } },
|
|
1583
|
+
nuxt.options.runtimeConfig["nuxt-scripts"]
|
|
1584
|
+
);
|
|
1585
|
+
}
|
|
1562
1586
|
}
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
addServerHandler({
|
|
1568
|
-
route: "/api/_scripts/x-embed-image",
|
|
1569
|
-
handler: await resolvePath("./runtime/server/x-embed-image")
|
|
1570
|
-
});
|
|
1571
|
-
addServerHandler({
|
|
1572
|
-
route: "/api/_scripts/instagram-embed",
|
|
1573
|
-
handler: await resolvePath("./runtime/server/instagram-embed")
|
|
1574
|
-
});
|
|
1575
|
-
addServerHandler({
|
|
1576
|
-
route: "/api/_scripts/instagram-embed-image",
|
|
1577
|
-
handler: await resolvePath("./runtime/server/instagram-embed-image")
|
|
1578
|
-
});
|
|
1579
|
-
addServerHandler({
|
|
1580
|
-
route: "/api/_scripts/instagram-embed-asset",
|
|
1581
|
-
handler: await resolvePath("./runtime/server/instagram-embed-asset")
|
|
1582
|
-
});
|
|
1587
|
+
nuxt.options.runtimeConfig.public["nuxt-scripts"] = defu(
|
|
1588
|
+
{ endpoints: enabledEndpoints },
|
|
1589
|
+
nuxt.options.runtimeConfig.public["nuxt-scripts"]
|
|
1590
|
+
);
|
|
1583
1591
|
if (nuxt.options.dev) {
|
|
1584
1592
|
setupDevToolsUI(config, resolvePath);
|
|
1585
1593
|
}
|
package/dist/registry.mjs
CHANGED
|
@@ -336,13 +336,32 @@ async function registry(resolve) {
|
|
|
336
336
|
import: {
|
|
337
337
|
name: "useScriptGoogleMaps",
|
|
338
338
|
from: await resolve("./runtime/registry/google-maps")
|
|
339
|
-
}
|
|
339
|
+
},
|
|
340
|
+
serverHandlers: [
|
|
341
|
+
{ route: "/_scripts/proxy/google-static-maps", handler: await resolve("./runtime/server/google-static-maps-proxy") },
|
|
342
|
+
{ route: "/_scripts/proxy/google-maps-geocode", handler: await resolve("./runtime/server/google-maps-geocode-proxy") }
|
|
343
|
+
]
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
registryKey: "blueskyEmbed",
|
|
347
|
+
label: "Bluesky Embed",
|
|
348
|
+
category: "content",
|
|
349
|
+
logo: `<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>`,
|
|
350
|
+
serverHandlers: [
|
|
351
|
+
{ route: "/_scripts/embed/bluesky", handler: await resolve("./runtime/server/bluesky-embed") },
|
|
352
|
+
{ route: "/_scripts/embed/bluesky-image", handler: await resolve("./runtime/server/bluesky-embed-image") }
|
|
353
|
+
]
|
|
340
354
|
},
|
|
341
355
|
{
|
|
342
356
|
registryKey: "instagramEmbed",
|
|
343
357
|
label: "Instagram Embed",
|
|
344
358
|
category: "content",
|
|
345
|
-
logo: `<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
|
|
359
|
+
logo: `<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>`,
|
|
360
|
+
serverHandlers: [
|
|
361
|
+
{ route: "/_scripts/embed/instagram", handler: await resolve("./runtime/server/instagram-embed") },
|
|
362
|
+
{ route: "/_scripts/embed/instagram-image", handler: await resolve("./runtime/server/instagram-embed-image") },
|
|
363
|
+
{ route: "/_scripts/embed/instagram-asset", handler: await resolve("./runtime/server/instagram-embed-asset") }
|
|
364
|
+
]
|
|
346
365
|
},
|
|
347
366
|
{
|
|
348
367
|
registryKey: "xEmbed",
|
|
@@ -351,7 +370,11 @@ async function registry(resolve) {
|
|
|
351
370
|
logo: {
|
|
352
371
|
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>`,
|
|
353
372
|
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>`
|
|
354
|
-
}
|
|
373
|
+
},
|
|
374
|
+
serverHandlers: [
|
|
375
|
+
{ route: "/_scripts/embed/x", handler: await resolve("./runtime/server/x-embed") },
|
|
376
|
+
{ route: "/_scripts/embed/x-image", handler: await resolve("./runtime/server/x-embed-image") }
|
|
377
|
+
]
|
|
355
378
|
},
|
|
356
379
|
// chat
|
|
357
380
|
{
|
|
@@ -480,7 +503,10 @@ async function registry(resolve) {
|
|
|
480
503
|
import: {
|
|
481
504
|
name: "useScriptGravatar",
|
|
482
505
|
from: await resolve("./runtime/registry/gravatar")
|
|
483
|
-
}
|
|
506
|
+
},
|
|
507
|
+
serverHandlers: [
|
|
508
|
+
{ route: "/_scripts/proxy/gravatar", handler: await resolve("./runtime/server/gravatar-proxy") }
|
|
509
|
+
]
|
|
484
510
|
}
|
|
485
511
|
];
|
|
486
512
|
}
|
|
@@ -107,7 +107,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
107
107
|
readonly googleMaps: Ref<typeof google.maps | undefined, typeof google.maps | undefined>;
|
|
108
108
|
readonly map: ShallowRef<google.maps.Map | undefined>;
|
|
109
109
|
readonly createAdvancedMapMarker: (_options?: google.maps.marker.AdvancedMarkerElementOptions | `${string},${string}`) => Promise<google.maps.marker.AdvancedMarkerElement | undefined>;
|
|
110
|
-
readonly resolveQueryToLatLang: (query: string) => Promise<google.maps.LatLng | undefined>;
|
|
110
|
+
readonly resolveQueryToLatLang: (query: string) => Promise<google.maps.LatLng | google.maps.LatLngLiteral | undefined>;
|
|
111
111
|
readonly importLibrary: {
|
|
112
112
|
(key: "marker"): Promise<google.maps.MarkerLibrary>;
|
|
113
113
|
(key: "places"): Promise<google.maps.PlacesLibrary>;
|
|
@@ -122,7 +122,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
122
122
|
readonly googleMaps: Ref<typeof google.maps | undefined, typeof google.maps | undefined>;
|
|
123
123
|
readonly map: ShallowRef<google.maps.Map | undefined>;
|
|
124
124
|
readonly createAdvancedMapMarker: (_options?: google.maps.marker.AdvancedMarkerElementOptions | `${string},${string}`) => Promise<google.maps.marker.AdvancedMarkerElement | undefined>;
|
|
125
|
-
readonly resolveQueryToLatLang: (query: string) => Promise<google.maps.LatLng | undefined>;
|
|
125
|
+
readonly resolveQueryToLatLang: (query: string) => Promise<google.maps.LatLng | google.maps.LatLngLiteral | undefined>;
|
|
126
126
|
readonly importLibrary: {
|
|
127
127
|
(key: "marker"): Promise<google.maps.MarkerLibrary>;
|
|
128
128
|
(key: "places"): Promise<google.maps.PlacesLibrary>;
|
|
@@ -216,7 +216,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
216
216
|
readonly googleMaps: Ref<typeof google.maps | undefined, typeof google.maps | undefined>;
|
|
217
217
|
readonly map: ShallowRef<google.maps.Map | undefined>;
|
|
218
218
|
readonly createAdvancedMapMarker: (_options?: google.maps.marker.AdvancedMarkerElementOptions | `${string},${string}`) => Promise<google.maps.marker.AdvancedMarkerElement | undefined>;
|
|
219
|
-
readonly resolveQueryToLatLang: (query: string) => Promise<google.maps.LatLng | undefined>;
|
|
219
|
+
readonly resolveQueryToLatLang: (query: string) => Promise<google.maps.LatLng | google.maps.LatLngLiteral | undefined>;
|
|
220
220
|
readonly importLibrary: {
|
|
221
221
|
(key: "marker"): Promise<google.maps.MarkerLibrary>;
|
|
222
222
|
(key: "places"): Promise<google.maps.PlacesLibrary>;
|
|
@@ -127,6 +127,19 @@ async function resolveQueryToLatLang(query) {
|
|
|
127
127
|
if (queryToLatLngCache.has(query)) {
|
|
128
128
|
return Promise.resolve(queryToLatLngCache.get(query));
|
|
129
129
|
}
|
|
130
|
+
const endpoints = runtimeConfig.public["nuxt-scripts"]?.endpoints;
|
|
131
|
+
if (endpoints?.googleMaps) {
|
|
132
|
+
const data = await $fetch("/_scripts/proxy/google-maps-geocode", {
|
|
133
|
+
params: { address: query }
|
|
134
|
+
});
|
|
135
|
+
if (data.status === "OK" && data.results?.[0]?.geometry?.location) {
|
|
136
|
+
const loc = data.results[0].geometry.location;
|
|
137
|
+
const latLng = { lat: loc.lat, lng: loc.lng };
|
|
138
|
+
queryToLatLngCache.set(query, latLng);
|
|
139
|
+
return latLng;
|
|
140
|
+
}
|
|
141
|
+
throw new Error(`No location found for ${query}`);
|
|
142
|
+
}
|
|
130
143
|
return new Promise(async (resolve, reject) => {
|
|
131
144
|
if (!mapsApi.value) {
|
|
132
145
|
await load();
|
|
@@ -321,7 +334,7 @@ const placeholder = computed(() => {
|
|
|
321
334
|
return m;
|
|
322
335
|
}).join("|")
|
|
323
336
|
});
|
|
324
|
-
const baseUrl = proxyConfig?.enabled ? "/_scripts/google-static-maps
|
|
337
|
+
const baseUrl = proxyConfig?.enabled ? "/_scripts/proxy/google-static-maps" : "https://maps.googleapis.com/maps/api/staticmap";
|
|
325
338
|
return withQuery(baseUrl, placeholderOptions);
|
|
326
339
|
});
|
|
327
340
|
const placeholderAttrs = computed(() => {
|
|
@@ -107,7 +107,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
107
107
|
readonly googleMaps: Ref<typeof google.maps | undefined, typeof google.maps | undefined>;
|
|
108
108
|
readonly map: ShallowRef<google.maps.Map | undefined>;
|
|
109
109
|
readonly createAdvancedMapMarker: (_options?: google.maps.marker.AdvancedMarkerElementOptions | `${string},${string}`) => Promise<google.maps.marker.AdvancedMarkerElement | undefined>;
|
|
110
|
-
readonly resolveQueryToLatLang: (query: string) => Promise<google.maps.LatLng | undefined>;
|
|
110
|
+
readonly resolveQueryToLatLang: (query: string) => Promise<google.maps.LatLng | google.maps.LatLngLiteral | undefined>;
|
|
111
111
|
readonly importLibrary: {
|
|
112
112
|
(key: "marker"): Promise<google.maps.MarkerLibrary>;
|
|
113
113
|
(key: "places"): Promise<google.maps.PlacesLibrary>;
|
|
@@ -122,7 +122,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
122
122
|
readonly googleMaps: Ref<typeof google.maps | undefined, typeof google.maps | undefined>;
|
|
123
123
|
readonly map: ShallowRef<google.maps.Map | undefined>;
|
|
124
124
|
readonly createAdvancedMapMarker: (_options?: google.maps.marker.AdvancedMarkerElementOptions | `${string},${string}`) => Promise<google.maps.marker.AdvancedMarkerElement | undefined>;
|
|
125
|
-
readonly resolveQueryToLatLang: (query: string) => Promise<google.maps.LatLng | undefined>;
|
|
125
|
+
readonly resolveQueryToLatLang: (query: string) => Promise<google.maps.LatLng | google.maps.LatLngLiteral | undefined>;
|
|
126
126
|
readonly importLibrary: {
|
|
127
127
|
(key: "marker"): Promise<google.maps.MarkerLibrary>;
|
|
128
128
|
(key: "places"): Promise<google.maps.PlacesLibrary>;
|
|
@@ -216,7 +216,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
216
216
|
readonly googleMaps: Ref<typeof google.maps | undefined, typeof google.maps | undefined>;
|
|
217
217
|
readonly map: ShallowRef<google.maps.Map | undefined>;
|
|
218
218
|
readonly createAdvancedMapMarker: (_options?: google.maps.marker.AdvancedMarkerElementOptions | `${string},${string}`) => Promise<google.maps.marker.AdvancedMarkerElement | undefined>;
|
|
219
|
-
readonly resolveQueryToLatLang: (query: string) => Promise<google.maps.LatLng | undefined>;
|
|
219
|
+
readonly resolveQueryToLatLang: (query: string) => Promise<google.maps.LatLng | google.maps.LatLngLiteral | undefined>;
|
|
220
220
|
readonly importLibrary: {
|
|
221
221
|
(key: "marker"): Promise<google.maps.MarkerLibrary>;
|
|
222
222
|
(key: "places"): Promise<google.maps.PlacesLibrary>;
|
|
@@ -7,8 +7,8 @@ export default _default;
|
|
|
7
7
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
8
8
|
options?: Omit<google.maps.marker.AdvancedMarkerElementOptions, "map">;
|
|
9
9
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
10
|
-
click: (payload: google.maps.MapMouseEvent) => any;
|
|
11
10
|
contextmenu: (payload: google.maps.MapMouseEvent) => any;
|
|
11
|
+
click: (payload: google.maps.MapMouseEvent) => any;
|
|
12
12
|
dblclick: (payload: google.maps.MapMouseEvent) => any;
|
|
13
13
|
drag: (payload: google.maps.MapMouseEvent) => any;
|
|
14
14
|
dragend: (payload: google.maps.MapMouseEvent) => any;
|
|
@@ -31,8 +31,8 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
31
31
|
}, string, import("vue").PublicProps, Readonly<{
|
|
32
32
|
options?: Omit<google.maps.marker.AdvancedMarkerElementOptions, "map">;
|
|
33
33
|
}> & Readonly<{
|
|
34
|
-
onClick?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
|
|
35
34
|
onContextmenu?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
|
|
35
|
+
onClick?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
|
|
36
36
|
onDblclick?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
|
|
37
37
|
onDrag?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
|
|
38
38
|
onDragend?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
|
|
@@ -7,8 +7,8 @@ export default _default;
|
|
|
7
7
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
8
8
|
options?: Omit<google.maps.marker.AdvancedMarkerElementOptions, "map">;
|
|
9
9
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
10
|
-
click: (payload: google.maps.MapMouseEvent) => any;
|
|
11
10
|
contextmenu: (payload: google.maps.MapMouseEvent) => any;
|
|
11
|
+
click: (payload: google.maps.MapMouseEvent) => any;
|
|
12
12
|
dblclick: (payload: google.maps.MapMouseEvent) => any;
|
|
13
13
|
drag: (payload: google.maps.MapMouseEvent) => any;
|
|
14
14
|
dragend: (payload: google.maps.MapMouseEvent) => any;
|
|
@@ -31,8 +31,8 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
31
31
|
}, string, import("vue").PublicProps, Readonly<{
|
|
32
32
|
options?: Omit<google.maps.marker.AdvancedMarkerElementOptions, "map">;
|
|
33
33
|
}> & Readonly<{
|
|
34
|
-
onClick?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
|
|
35
34
|
onContextmenu?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
|
|
35
|
+
onClick?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
|
|
36
36
|
onDblclick?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
|
|
37
37
|
onDrag?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
|
|
38
38
|
onDragend?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
|
|
@@ -7,8 +7,8 @@ export default _default;
|
|
|
7
7
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
8
8
|
options?: Omit<google.maps.MarkerOptions, "map">;
|
|
9
9
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
10
|
-
click: (payload: google.maps.MapMouseEvent) => any;
|
|
11
10
|
contextmenu: (payload: google.maps.MapMouseEvent) => any;
|
|
11
|
+
click: (payload: google.maps.MapMouseEvent) => any;
|
|
12
12
|
dblclick: (payload: google.maps.MapMouseEvent) => any;
|
|
13
13
|
drag: (payload: google.maps.MapMouseEvent) => any;
|
|
14
14
|
dragend: (payload: google.maps.MapMouseEvent) => any;
|
|
@@ -31,8 +31,8 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
31
31
|
}, string, import("vue").PublicProps, Readonly<{
|
|
32
32
|
options?: Omit<google.maps.MarkerOptions, "map">;
|
|
33
33
|
}> & Readonly<{
|
|
34
|
-
onClick?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
|
|
35
34
|
onContextmenu?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
|
|
35
|
+
onClick?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
|
|
36
36
|
onDblclick?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
|
|
37
37
|
onDrag?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
|
|
38
38
|
onDragend?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
|
|
@@ -7,8 +7,8 @@ export default _default;
|
|
|
7
7
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
8
8
|
options?: Omit<google.maps.MarkerOptions, "map">;
|
|
9
9
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
10
|
-
click: (payload: google.maps.MapMouseEvent) => any;
|
|
11
10
|
contextmenu: (payload: google.maps.MapMouseEvent) => any;
|
|
11
|
+
click: (payload: google.maps.MapMouseEvent) => any;
|
|
12
12
|
dblclick: (payload: google.maps.MapMouseEvent) => any;
|
|
13
13
|
drag: (payload: google.maps.MapMouseEvent) => any;
|
|
14
14
|
dragend: (payload: google.maps.MapMouseEvent) => any;
|
|
@@ -31,8 +31,8 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
31
31
|
}, string, import("vue").PublicProps, Readonly<{
|
|
32
32
|
options?: Omit<google.maps.MarkerOptions, "map">;
|
|
33
33
|
}> & Readonly<{
|
|
34
|
-
onClick?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
|
|
35
34
|
onContextmenu?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
|
|
35
|
+
onClick?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
|
|
36
36
|
onDblclick?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
|
|
37
37
|
onDrag?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
|
|
38
38
|
onDragend?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
|
|
@@ -2,8 +2,8 @@ type __VLS_Props = {
|
|
|
2
2
|
options?: Omit<google.maps.PolygonOptions, 'map'>;
|
|
3
3
|
};
|
|
4
4
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
5
|
-
click: (payload: google.maps.PolyMouseEvent) => any;
|
|
6
5
|
contextmenu: (payload: google.maps.PolyMouseEvent) => any;
|
|
6
|
+
click: (payload: google.maps.PolyMouseEvent) => any;
|
|
7
7
|
dblclick: (payload: google.maps.PolyMouseEvent) => any;
|
|
8
8
|
drag: (payload: google.maps.MapMouseEvent) => any;
|
|
9
9
|
dragend: (payload: google.maps.MapMouseEvent) => any;
|
|
@@ -14,8 +14,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
14
14
|
mouseover: (payload: google.maps.PolyMouseEvent) => any;
|
|
15
15
|
mouseup: (payload: google.maps.PolyMouseEvent) => any;
|
|
16
16
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
17
|
-
onClick?: ((payload: google.maps.PolyMouseEvent) => any) | undefined;
|
|
18
17
|
onContextmenu?: ((payload: google.maps.PolyMouseEvent) => any) | undefined;
|
|
18
|
+
onClick?: ((payload: google.maps.PolyMouseEvent) => any) | undefined;
|
|
19
19
|
onDblclick?: ((payload: google.maps.PolyMouseEvent) => any) | undefined;
|
|
20
20
|
onDrag?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
|
|
21
21
|
onDragend?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
|
|
@@ -2,8 +2,8 @@ type __VLS_Props = {
|
|
|
2
2
|
options?: Omit<google.maps.PolygonOptions, 'map'>;
|
|
3
3
|
};
|
|
4
4
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
5
|
-
click: (payload: google.maps.PolyMouseEvent) => any;
|
|
6
5
|
contextmenu: (payload: google.maps.PolyMouseEvent) => any;
|
|
6
|
+
click: (payload: google.maps.PolyMouseEvent) => any;
|
|
7
7
|
dblclick: (payload: google.maps.PolyMouseEvent) => any;
|
|
8
8
|
drag: (payload: google.maps.MapMouseEvent) => any;
|
|
9
9
|
dragend: (payload: google.maps.MapMouseEvent) => any;
|
|
@@ -14,8 +14,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
14
14
|
mouseover: (payload: google.maps.PolyMouseEvent) => any;
|
|
15
15
|
mouseup: (payload: google.maps.PolyMouseEvent) => any;
|
|
16
16
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
17
|
-
onClick?: ((payload: google.maps.PolyMouseEvent) => any) | undefined;
|
|
18
17
|
onContextmenu?: ((payload: google.maps.PolyMouseEvent) => any) | undefined;
|
|
18
|
+
onClick?: ((payload: google.maps.PolyMouseEvent) => any) | undefined;
|
|
19
19
|
onDblclick?: ((payload: google.maps.PolyMouseEvent) => any) | undefined;
|
|
20
20
|
onDrag?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
|
|
21
21
|
onDragend?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
|
|
@@ -2,8 +2,8 @@ type __VLS_Props = {
|
|
|
2
2
|
options?: Omit<google.maps.PolylineOptions, 'map'>;
|
|
3
3
|
};
|
|
4
4
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
5
|
-
click: (payload: google.maps.PolyMouseEvent) => any;
|
|
6
5
|
contextmenu: (payload: google.maps.PolyMouseEvent) => any;
|
|
6
|
+
click: (payload: google.maps.PolyMouseEvent) => any;
|
|
7
7
|
dblclick: (payload: google.maps.PolyMouseEvent) => any;
|
|
8
8
|
drag: (payload: google.maps.MapMouseEvent) => any;
|
|
9
9
|
dragend: (payload: google.maps.MapMouseEvent) => any;
|
|
@@ -14,8 +14,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
14
14
|
mouseover: (payload: google.maps.PolyMouseEvent) => any;
|
|
15
15
|
mouseup: (payload: google.maps.PolyMouseEvent) => any;
|
|
16
16
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
17
|
-
onClick?: ((payload: google.maps.PolyMouseEvent) => any) | undefined;
|
|
18
17
|
onContextmenu?: ((payload: google.maps.PolyMouseEvent) => any) | undefined;
|
|
18
|
+
onClick?: ((payload: google.maps.PolyMouseEvent) => any) | undefined;
|
|
19
19
|
onDblclick?: ((payload: google.maps.PolyMouseEvent) => any) | undefined;
|
|
20
20
|
onDrag?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
|
|
21
21
|
onDragend?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
|
|
@@ -2,8 +2,8 @@ type __VLS_Props = {
|
|
|
2
2
|
options?: Omit<google.maps.PolylineOptions, 'map'>;
|
|
3
3
|
};
|
|
4
4
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
5
|
-
click: (payload: google.maps.PolyMouseEvent) => any;
|
|
6
5
|
contextmenu: (payload: google.maps.PolyMouseEvent) => any;
|
|
6
|
+
click: (payload: google.maps.PolyMouseEvent) => any;
|
|
7
7
|
dblclick: (payload: google.maps.PolyMouseEvent) => any;
|
|
8
8
|
drag: (payload: google.maps.MapMouseEvent) => any;
|
|
9
9
|
dragend: (payload: google.maps.MapMouseEvent) => any;
|
|
@@ -14,8 +14,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
14
14
|
mouseover: (payload: google.maps.PolyMouseEvent) => any;
|
|
15
15
|
mouseup: (payload: google.maps.PolyMouseEvent) => any;
|
|
16
16
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
17
|
-
onClick?: ((payload: google.maps.PolyMouseEvent) => any) | undefined;
|
|
18
17
|
onContextmenu?: ((payload: google.maps.PolyMouseEvent) => any) | undefined;
|
|
18
|
+
onClick?: ((payload: google.maps.PolyMouseEvent) => any) | undefined;
|
|
19
19
|
onDblclick?: ((payload: google.maps.PolyMouseEvent) => any) | undefined;
|
|
20
20
|
onDrag?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
|
|
21
21
|
onDragend?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
|