@nuxt/scripts 2.0.0-beta.1 → 2.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/devtools-client/200.html +1 -1
- package/dist/devtools-client/404.html +1 -1
- package/dist/devtools-client/_nuxt/{Cpb0XAYP.js → B-kTnbRv.js} +1 -1
- package/dist/devtools-client/_nuxt/{BjRLaDIG.js → BuTlAAeI.js} +1 -1
- package/dist/devtools-client/_nuxt/{BtNUYBXT.js → C41E8Pp1.js} +1 -1
- package/dist/devtools-client/_nuxt/{DmlGWZ2X.js → Cbmw_5H5.js} +1 -1
- package/dist/devtools-client/_nuxt/{DcG2ZXvY.js → DiZU_C4m.js} +1 -1
- package/dist/devtools-client/_nuxt/{RL1np866.js → LFNkKKtz.js} +2 -2
- package/dist/devtools-client/_nuxt/builds/latest.json +1 -1
- package/dist/devtools-client/_nuxt/builds/meta/a61c6f9c-0e40-40f8-973e-d57734b1be2f.json +1 -0
- package/dist/devtools-client/_nuxt/{entry.9HJPJ6Hp.css → entry.CYUdJFoE.css} +1 -1
- 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.json +1 -1
- package/dist/module.mjs +12 -18
- package/dist/registry.mjs +5 -4
- package/dist/runtime/components/Leaflet/ScriptLeafletMap.d.vue.ts +1 -1
- package/dist/runtime/components/Leaflet/ScriptLeafletMap.vue.d.ts +1 -1
- package/dist/runtime/components/MapLibre/ScriptMapLibreMap.d.vue.ts +18 -18
- package/dist/runtime/components/MapLibre/ScriptMapLibreMap.vue.d.ts +18 -18
- package/dist/runtime/components/ScriptCarbonAds.vue +3 -2
- package/dist/runtime/components/ScriptPayPalButtons.d.vue.ts +1 -1
- package/dist/runtime/components/ScriptPayPalButtons.vue.d.ts +1 -1
- package/dist/runtime/components/ScriptPayPalMessages.d.vue.ts +1 -1
- package/dist/runtime/components/ScriptPayPalMessages.vue.d.ts +1 -1
- package/dist/runtime/maplibre-styles.d.ts +16 -6
- package/dist/runtime/maplibre-styles.js +9 -9
- package/dist/runtime/registry/_gcm-consent.js +30 -7
- package/dist/runtime/registry/maplibre.d.ts +7 -1
- package/dist/runtime/registry/maplibre.js +23 -15
- package/dist/runtime/registry/schemas.d.ts +6 -6
- package/dist/runtime/registry/schemas.js +6 -6
- package/dist/runtime/registry/speedcurve.js +12 -3
- package/dist/runtime/server/utils/network-dispatcher.node.js +136 -11
- package/dist/stats.mjs +2 -1
- package/dist/types-source.mjs +35 -6
- package/package.json +4 -4
- package/dist/devtools-client/_nuxt/builds/meta/e28b96f1-78e8-41a4-ad6f-904cd078f85e.json +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-scripts/_nuxt/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-scripts/_nuxt/LFNkKKtz.js"}}</script><link rel="stylesheet" href="/__nuxt-scripts/_nuxt/entry.CYUdJFoE.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/LFNkKKtz.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/2p1_IuX2.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/CDDBpkXG.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/UmWNrBO5.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/C41E8Pp1.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DK3Fl9T5.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DAsiyhPm.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/KsX6Az5B.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/Dat651Oh.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BuTlAAeI.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BDNMzG2s.js"><script type="module" src="/__nuxt-scripts/_nuxt/LFNkKKtz.js" crossorigin></script><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DMbpbO54.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/qhed-kSA.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BgS3c2Ky.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/VbXTXTou.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BZCL-v6S.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt-scripts/_nuxt/error-404.DnwL1N6v.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BNPn63Jz.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt-scripts/_nuxt/error-500.DEbXRLdm.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/9elIQxwW.js"><script>"use strict";(()=>{const o=window,e=document.documentElement,c=["dark","light"],s=getStorageValue("localStorage","nuxt-color-mode")||"system";let r=s==="system"?f():s;const l=e.getAttribute("data-color-mode-forced");l&&(r=l),i(r),o["__NUXT_COLOR_MODE__"]={preference:s,value:r,getColorScheme:f,addColorScheme:i,removeColorScheme:d};function i(t){const a=""+t+"",n="";e.classList?e.classList.add(a):e.className+=" "+a,n&&e.setAttribute("data-"+n,t)}function d(t){const a=""+t+"",n="";e.classList?e.classList.remove(a):e.className=e.className.replace(new RegExp(a,"g"),""),n&&e.removeAttribute("data-"+n)}function u(t){return o.matchMedia("(prefers-color-scheme"+t+")")}function f(){if(o.matchMedia&&u("").media!=="not all"){for(const t of c)if(u(":"+t).matches)return t}return"light"}})();function getStorageValue(o,e){switch(o){case"localStorage":try{return window.localStorage.getItem(e)}catch{return null}case"sessionStorage":try{return window.sessionStorage.getItem(e)}catch{return null}case"cookie":try{return getCookie(e)}catch{return null}default:return null}}function getCookie(o){const c=("; "+window.document.cookie).split("; "+o+"=");if(c.length===2){const s=c.pop();return s?s.split(";").shift():null}}</script></head><body><div id="__nuxt" class="isolate"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-scripts",buildId:"a61c6f9c-0e40-40f8-973e-d57734b1be2f",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1787197064003,false]</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-scripts/_nuxt/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-scripts/_nuxt/LFNkKKtz.js"}}</script><link rel="stylesheet" href="/__nuxt-scripts/_nuxt/entry.CYUdJFoE.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/LFNkKKtz.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/2p1_IuX2.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/CDDBpkXG.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/UmWNrBO5.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/C41E8Pp1.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DK3Fl9T5.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DAsiyhPm.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/KsX6Az5B.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/Dat651Oh.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BuTlAAeI.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BDNMzG2s.js"><script type="module" src="/__nuxt-scripts/_nuxt/LFNkKKtz.js" crossorigin></script><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DMbpbO54.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/qhed-kSA.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BgS3c2Ky.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/VbXTXTou.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BZCL-v6S.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt-scripts/_nuxt/error-404.DnwL1N6v.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BNPn63Jz.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt-scripts/_nuxt/error-500.DEbXRLdm.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/9elIQxwW.js"><script>"use strict";(()=>{const o=window,e=document.documentElement,c=["dark","light"],s=getStorageValue("localStorage","nuxt-color-mode")||"system";let r=s==="system"?f():s;const l=e.getAttribute("data-color-mode-forced");l&&(r=l),i(r),o["__NUXT_COLOR_MODE__"]={preference:s,value:r,getColorScheme:f,addColorScheme:i,removeColorScheme:d};function i(t){const a=""+t+"",n="";e.classList?e.classList.add(a):e.className+=" "+a,n&&e.setAttribute("data-"+n,t)}function d(t){const a=""+t+"",n="";e.classList?e.classList.remove(a):e.className=e.className.replace(new RegExp(a,"g"),""),n&&e.removeAttribute("data-"+n)}function u(t){return o.matchMedia("(prefers-color-scheme"+t+")")}function f(){if(o.matchMedia&&u("").media!=="not all"){for(const t of c)if(u(":"+t).matches)return t}return"light"}})();function getStorageValue(o,e){switch(o){case"localStorage":try{return window.localStorage.getItem(e)}catch{return null}case"sessionStorage":try{return window.sessionStorage.getItem(e)}catch{return null}case"cookie":try{return getCookie(e)}catch{return null}default:return null}}function getCookie(o){const c=("; "+window.document.cookie).split("; "+o+"=");if(c.length===2){const s=c.pop();return s?s.split(";").shift():null}}</script></head><body><div id="__nuxt" class="isolate"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-scripts",buildId:"a61c6f9c-0e40-40f8-973e-d57734b1be2f",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1787197064004,false]</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-scripts/_nuxt/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-scripts/_nuxt/LFNkKKtz.js"}}</script><link rel="stylesheet" href="/__nuxt-scripts/_nuxt/entry.CYUdJFoE.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/LFNkKKtz.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/2p1_IuX2.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/CDDBpkXG.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/UmWNrBO5.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/C41E8Pp1.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DK3Fl9T5.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DAsiyhPm.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/KsX6Az5B.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/Dat651Oh.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BuTlAAeI.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BDNMzG2s.js"><script type="module" src="/__nuxt-scripts/_nuxt/LFNkKKtz.js" crossorigin></script><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DMbpbO54.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/qhed-kSA.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BgS3c2Ky.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/VbXTXTou.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BZCL-v6S.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt-scripts/_nuxt/error-404.DnwL1N6v.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BNPn63Jz.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt-scripts/_nuxt/error-500.DEbXRLdm.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/9elIQxwW.js"><script>"use strict";(()=>{const o=window,e=document.documentElement,c=["dark","light"],s=getStorageValue("localStorage","nuxt-color-mode")||"system";let r=s==="system"?f():s;const l=e.getAttribute("data-color-mode-forced");l&&(r=l),i(r),o["__NUXT_COLOR_MODE__"]={preference:s,value:r,getColorScheme:f,addColorScheme:i,removeColorScheme:d};function i(t){const a=""+t+"",n="";e.classList?e.classList.add(a):e.className+=" "+a,n&&e.setAttribute("data-"+n,t)}function d(t){const a=""+t+"",n="";e.classList?e.classList.remove(a):e.className=e.className.replace(new RegExp(a,"g"),""),n&&e.removeAttribute("data-"+n)}function u(t){return o.matchMedia("(prefers-color-scheme"+t+")")}function f(){if(o.matchMedia&&u("").media!=="not all"){for(const t of c)if(u(":"+t).matches)return t}return"light"}})();function getStorageValue(o,e){switch(o){case"localStorage":try{return window.localStorage.getItem(e)}catch{return null}case"sessionStorage":try{return window.sessionStorage.getItem(e)}catch{return null}case"cookie":try{return getCookie(e)}catch{return null}default:return null}}function getCookie(o){const c=("; "+window.document.cookie).split("; "+o+"=");if(c.length===2){const s=c.pop();return s?s.split(";").shift():null}}</script></head><body><div id="__nuxt" class="isolate"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-scripts",buildId:"a61c6f9c-0e40-40f8-973e-d57734b1be2f",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1787197064005,false]</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-scripts/_nuxt/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-scripts/_nuxt/LFNkKKtz.js"}}</script><link rel="stylesheet" href="/__nuxt-scripts/_nuxt/entry.CYUdJFoE.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/LFNkKKtz.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/2p1_IuX2.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/CDDBpkXG.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/UmWNrBO5.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/C41E8Pp1.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DK3Fl9T5.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DAsiyhPm.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/KsX6Az5B.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/Dat651Oh.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BuTlAAeI.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BDNMzG2s.js"><script type="module" src="/__nuxt-scripts/_nuxt/LFNkKKtz.js" crossorigin></script><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DMbpbO54.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/qhed-kSA.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BgS3c2Ky.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/VbXTXTou.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BZCL-v6S.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt-scripts/_nuxt/error-404.DnwL1N6v.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BNPn63Jz.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt-scripts/_nuxt/error-500.DEbXRLdm.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/9elIQxwW.js"><script>"use strict";(()=>{const o=window,e=document.documentElement,c=["dark","light"],s=getStorageValue("localStorage","nuxt-color-mode")||"system";let r=s==="system"?f():s;const l=e.getAttribute("data-color-mode-forced");l&&(r=l),i(r),o["__NUXT_COLOR_MODE__"]={preference:s,value:r,getColorScheme:f,addColorScheme:i,removeColorScheme:d};function i(t){const a=""+t+"",n="";e.classList?e.classList.add(a):e.className+=" "+a,n&&e.setAttribute("data-"+n,t)}function d(t){const a=""+t+"",n="";e.classList?e.classList.remove(a):e.className=e.className.replace(new RegExp(a,"g"),""),n&&e.removeAttribute("data-"+n)}function u(t){return o.matchMedia("(prefers-color-scheme"+t+")")}function f(){if(o.matchMedia&&u("").media!=="not all"){for(const t of c)if(u(":"+t).matches)return t}return"light"}})();function getStorageValue(o,e){switch(o){case"localStorage":try{return window.localStorage.getItem(e)}catch{return null}case"sessionStorage":try{return window.sessionStorage.getItem(e)}catch{return null}case"cookie":try{return getCookie(e)}catch{return null}default:return null}}function getCookie(o){const c=("; "+window.document.cookie).split("; "+o+"=");if(c.length===2){const s=c.pop();return s?s.split(";").shift():null}}</script></head><body><div id="__nuxt" class="isolate"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-scripts",buildId:"a61c6f9c-0e40-40f8-973e-d57734b1be2f",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1787197064004,false]</script></body></html>
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -443,26 +443,21 @@ function isVue(id, opts = {}) {
|
|
|
443
443
|
}
|
|
444
444
|
return true;
|
|
445
445
|
}
|
|
446
|
-
const JS_RE$1 = /\.(?:[cm]?j|t)sx?$/;
|
|
447
|
-
function isJS(id) {
|
|
448
|
-
const { pathname } = parseURL(decodeURIComponent(pathToFileURL(id).href));
|
|
449
|
-
return JS_RE$1.test(pathname);
|
|
450
|
-
}
|
|
451
446
|
|
|
452
|
-
const VUE_RE$1 = /\.vue/;
|
|
447
|
+
const VUE_RE$1 = /\.vue(?:\?|$)/;
|
|
448
|
+
const USE_SCRIPT_CODE_MARKER$1 = "useScript";
|
|
453
449
|
function NuxtScriptsCheckScripts() {
|
|
454
450
|
return createUnplugin(() => {
|
|
455
451
|
return {
|
|
456
452
|
name: "nuxt-scripts:check-scripts",
|
|
457
453
|
transform: {
|
|
458
454
|
filter: {
|
|
459
|
-
id: VUE_RE$1
|
|
455
|
+
id: VUE_RE$1,
|
|
456
|
+
code: USE_SCRIPT_CODE_MARKER$1
|
|
460
457
|
},
|
|
461
458
|
handler(code, id) {
|
|
462
459
|
if (!isVue(id, { type: ["script"] }))
|
|
463
460
|
return;
|
|
464
|
-
if (!code.includes("useScript"))
|
|
465
|
-
return;
|
|
466
461
|
let nameNode;
|
|
467
462
|
let errorNode;
|
|
468
463
|
parseAndWalk(code, id, (_node) => {
|
|
@@ -1040,9 +1035,10 @@ function rewriteScriptUrlsAST(content, filename, rewrites, sdkPatches, options)
|
|
|
1040
1035
|
|
|
1041
1036
|
const SEVEN_DAYS_IN_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
1042
1037
|
const PROTOCOL_RELATIVE_RE = /^\/\//;
|
|
1043
|
-
const VUE_RE = /\.vue/;
|
|
1044
|
-
const JS_RE = /\.[cm]?[jt]sx
|
|
1038
|
+
const VUE_RE = /\.vue(?:\?|$)/;
|
|
1039
|
+
const JS_RE = /\.[cm]?[jt]sx?(?:\?|$)/;
|
|
1045
1040
|
const TEST_RE = /\.(?:test|spec)\./;
|
|
1041
|
+
const USE_SCRIPT_CODE_MARKER = "useScript";
|
|
1046
1042
|
const UPPERCASE_RE = /^[A-Z]$/;
|
|
1047
1043
|
const USE_SCRIPT_RE = /^useScript/;
|
|
1048
1044
|
function calculateIntegrity(content, algorithm = "sha384") {
|
|
@@ -1173,12 +1169,11 @@ function NuxtScriptBundleTransformer(options = {
|
|
|
1173
1169
|
id: {
|
|
1174
1170
|
include: [VUE_RE, JS_RE],
|
|
1175
1171
|
exclude: [TEST_RE]
|
|
1176
|
-
}
|
|
1172
|
+
},
|
|
1173
|
+
code: USE_SCRIPT_CODE_MARKER
|
|
1177
1174
|
},
|
|
1178
1175
|
async handler(code, id) {
|
|
1179
|
-
if (!isVue(id, { type: ["template", "script"] })
|
|
1180
|
-
return;
|
|
1181
|
-
if (!code.includes("useScript"))
|
|
1176
|
+
if (VUE_RE.test(id) && !isVue(id, { type: ["template", "script"] }))
|
|
1182
1177
|
return;
|
|
1183
1178
|
const s = new MagicString(code);
|
|
1184
1179
|
const deferredOps = [];
|
|
@@ -2323,9 +2318,8 @@ Options: configure platform rewrites, switch to server-rendered mode, or disable
|
|
|
2323
2318
|
}
|
|
2324
2319
|
}
|
|
2325
2320
|
const moduleInstallPromises = /* @__PURE__ */ new Map();
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
});
|
|
2321
|
+
if (nuxt.options.dev)
|
|
2322
|
+
addBuildPlugin(NuxtScriptsCheckScripts());
|
|
2329
2323
|
addBuildPlugin(NuxtScriptBundleTransformer({
|
|
2330
2324
|
nuxt,
|
|
2331
2325
|
scripts: registryScriptsWithImport,
|
package/dist/registry.mjs
CHANGED
|
@@ -144,7 +144,7 @@ const registryMeta = [
|
|
|
144
144
|
// content
|
|
145
145
|
m("googleMaps", "Google Maps", "content", "useScriptGoogleMaps", {}, null),
|
|
146
146
|
m("leaflet", "Leaflet", "content", "useScriptLeaflet", { bundle: true }, null),
|
|
147
|
-
m("maplibre", "MapLibre GL JS", "content", "useScriptMapLibre", {
|
|
147
|
+
m("maplibre", "MapLibre GL JS", "content", "useScriptMapLibre", {}, null),
|
|
148
148
|
m("instagramEmbed", "Instagram Embed", "content", false, {}, null),
|
|
149
149
|
m("xEmbed", "X Embed", "content", false, {}, null),
|
|
150
150
|
m("blueskyEmbed", "Bluesky Embed", "content", false, {}, null),
|
|
@@ -648,9 +648,10 @@ async function registry(resolve) {
|
|
|
648
648
|
composableName: "useScriptMapLibre",
|
|
649
649
|
schema: MapLibreOptions,
|
|
650
650
|
label: "MapLibre GL JS",
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
651
|
+
// MapLibre GL JS v6 is ESM-only, so it loads from the `maplibre-gl`
|
|
652
|
+
// package rather than a CDN script tag.
|
|
653
|
+
src: false,
|
|
654
|
+
category: "content"
|
|
654
655
|
}),
|
|
655
656
|
def("blueskyEmbed", {
|
|
656
657
|
composableName: false,
|
|
@@ -75,8 +75,8 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<Script
|
|
|
75
75
|
"onUpdate:center"?: ((center: Leaflet.LatLng) => any) | undefined;
|
|
76
76
|
"onUpdate:zoom"?: ((zoom: number) => any) | undefined;
|
|
77
77
|
}>, {
|
|
78
|
-
injectStyles: boolean;
|
|
79
78
|
trigger: ElementScriptTrigger;
|
|
79
|
+
injectStyles: boolean;
|
|
80
80
|
width: number | string;
|
|
81
81
|
height: number | string;
|
|
82
82
|
zoom: number;
|
|
@@ -75,8 +75,8 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<Script
|
|
|
75
75
|
"onUpdate:center"?: ((center: Leaflet.LatLng) => any) | undefined;
|
|
76
76
|
"onUpdate:zoom"?: ((zoom: number) => any) | undefined;
|
|
77
77
|
}>, {
|
|
78
|
-
injectStyles: boolean;
|
|
79
78
|
trigger: ElementScriptTrigger;
|
|
79
|
+
injectStyles: boolean;
|
|
80
80
|
width: number | string;
|
|
81
81
|
height: number | string;
|
|
82
82
|
zoom: number;
|
|
@@ -24,7 +24,7 @@ export interface ScriptMapLibreMapProps {
|
|
|
24
24
|
injectStyles?: boolean;
|
|
25
25
|
/** Custom MapLibre stylesheet URL. */
|
|
26
26
|
stylesheetUrl?: string;
|
|
27
|
-
/** Worker URL
|
|
27
|
+
/** Worker URL passed to `maplibregl.setWorkerUrl()`. */
|
|
28
28
|
workerUrl?: string;
|
|
29
29
|
/** Width reserved before the map loads. @default 640 */
|
|
30
30
|
width?: number | string;
|
|
@@ -76,37 +76,37 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<Script
|
|
|
76
76
|
error: (error: Error) => any;
|
|
77
77
|
ready: (payload: ScriptMapLibreMapExpose) => any;
|
|
78
78
|
click: (event: MapLibre.MapMouseEvent) => any;
|
|
79
|
-
move: (event: MapLibre.
|
|
80
|
-
zoom: (event: MapLibre.
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
move: (event: MapLibre.MapMovementEvent) => any;
|
|
80
|
+
zoom: (event: MapLibre.MapMovementEvent) => any;
|
|
81
|
+
rotate: (event: MapLibre.MapMovementEvent) => any;
|
|
82
|
+
zoomend: (event: MapLibre.MapMovementEvent) => any;
|
|
83
|
+
moveend: (event: MapLibre.MapMovementEvent) => any;
|
|
83
84
|
"update:center": (center: MapLibre.LngLat) => any;
|
|
84
85
|
"update:zoom": (zoom: number) => any;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
pitchend: (event: MapLibre.MapLibreEvent<MouseEvent | TouchEvent | undefined>) => any;
|
|
86
|
+
rotateend: (event: MapLibre.MapMovementEvent) => any;
|
|
87
|
+
pitch: (event: MapLibre.MapMovementEvent) => any;
|
|
88
|
+
pitchend: (event: MapLibre.MapMovementEvent) => any;
|
|
89
89
|
"update:bearing": (bearing: number) => any;
|
|
90
90
|
"update:pitch": (pitch: number) => any;
|
|
91
91
|
}, string, import("vue").PublicProps, Readonly<ScriptMapLibreMapProps> & Readonly<{
|
|
92
92
|
onError?: ((error: Error) => any) | undefined;
|
|
93
93
|
onReady?: ((payload: ScriptMapLibreMapExpose) => any) | undefined;
|
|
94
94
|
onClick?: ((event: MapLibre.MapMouseEvent) => any) | undefined;
|
|
95
|
-
onMove?: ((event: MapLibre.
|
|
96
|
-
onZoom?: ((event: MapLibre.
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
onMove?: ((event: MapLibre.MapMovementEvent) => any) | undefined;
|
|
96
|
+
onZoom?: ((event: MapLibre.MapMovementEvent) => any) | undefined;
|
|
97
|
+
onRotate?: ((event: MapLibre.MapMovementEvent) => any) | undefined;
|
|
98
|
+
onZoomend?: ((event: MapLibre.MapMovementEvent) => any) | undefined;
|
|
99
|
+
onMoveend?: ((event: MapLibre.MapMovementEvent) => any) | undefined;
|
|
99
100
|
"onUpdate:center"?: ((center: MapLibre.LngLat) => any) | undefined;
|
|
100
101
|
"onUpdate:zoom"?: ((zoom: number) => any) | undefined;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
onPitchend?: ((event: MapLibre.MapLibreEvent<MouseEvent | TouchEvent | undefined>) => any) | undefined;
|
|
102
|
+
onRotateend?: ((event: MapLibre.MapMovementEvent) => any) | undefined;
|
|
103
|
+
onPitch?: ((event: MapLibre.MapMovementEvent) => any) | undefined;
|
|
104
|
+
onPitchend?: ((event: MapLibre.MapMovementEvent) => any) | undefined;
|
|
105
105
|
"onUpdate:bearing"?: ((bearing: number) => any) | undefined;
|
|
106
106
|
"onUpdate:pitch"?: ((pitch: number) => any) | undefined;
|
|
107
107
|
}>, {
|
|
108
|
-
injectStyles: boolean;
|
|
109
108
|
trigger: ElementScriptTrigger;
|
|
109
|
+
injectStyles: boolean;
|
|
110
110
|
width: number | string;
|
|
111
111
|
height: number | string;
|
|
112
112
|
zoom: number;
|
|
@@ -24,7 +24,7 @@ export interface ScriptMapLibreMapProps {
|
|
|
24
24
|
injectStyles?: boolean;
|
|
25
25
|
/** Custom MapLibre stylesheet URL. */
|
|
26
26
|
stylesheetUrl?: string;
|
|
27
|
-
/** Worker URL
|
|
27
|
+
/** Worker URL passed to `maplibregl.setWorkerUrl()`. */
|
|
28
28
|
workerUrl?: string;
|
|
29
29
|
/** Width reserved before the map loads. @default 640 */
|
|
30
30
|
width?: number | string;
|
|
@@ -76,37 +76,37 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<Script
|
|
|
76
76
|
error: (error: Error) => any;
|
|
77
77
|
ready: (payload: ScriptMapLibreMapExpose) => any;
|
|
78
78
|
click: (event: MapLibre.MapMouseEvent) => any;
|
|
79
|
-
move: (event: MapLibre.
|
|
80
|
-
zoom: (event: MapLibre.
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
move: (event: MapLibre.MapMovementEvent) => any;
|
|
80
|
+
zoom: (event: MapLibre.MapMovementEvent) => any;
|
|
81
|
+
rotate: (event: MapLibre.MapMovementEvent) => any;
|
|
82
|
+
zoomend: (event: MapLibre.MapMovementEvent) => any;
|
|
83
|
+
moveend: (event: MapLibre.MapMovementEvent) => any;
|
|
83
84
|
"update:center": (center: MapLibre.LngLat) => any;
|
|
84
85
|
"update:zoom": (zoom: number) => any;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
pitchend: (event: MapLibre.MapLibreEvent<MouseEvent | TouchEvent | undefined>) => any;
|
|
86
|
+
rotateend: (event: MapLibre.MapMovementEvent) => any;
|
|
87
|
+
pitch: (event: MapLibre.MapMovementEvent) => any;
|
|
88
|
+
pitchend: (event: MapLibre.MapMovementEvent) => any;
|
|
89
89
|
"update:bearing": (bearing: number) => any;
|
|
90
90
|
"update:pitch": (pitch: number) => any;
|
|
91
91
|
}, string, import("vue").PublicProps, Readonly<ScriptMapLibreMapProps> & Readonly<{
|
|
92
92
|
onError?: ((error: Error) => any) | undefined;
|
|
93
93
|
onReady?: ((payload: ScriptMapLibreMapExpose) => any) | undefined;
|
|
94
94
|
onClick?: ((event: MapLibre.MapMouseEvent) => any) | undefined;
|
|
95
|
-
onMove?: ((event: MapLibre.
|
|
96
|
-
onZoom?: ((event: MapLibre.
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
onMove?: ((event: MapLibre.MapMovementEvent) => any) | undefined;
|
|
96
|
+
onZoom?: ((event: MapLibre.MapMovementEvent) => any) | undefined;
|
|
97
|
+
onRotate?: ((event: MapLibre.MapMovementEvent) => any) | undefined;
|
|
98
|
+
onZoomend?: ((event: MapLibre.MapMovementEvent) => any) | undefined;
|
|
99
|
+
onMoveend?: ((event: MapLibre.MapMovementEvent) => any) | undefined;
|
|
99
100
|
"onUpdate:center"?: ((center: MapLibre.LngLat) => any) | undefined;
|
|
100
101
|
"onUpdate:zoom"?: ((zoom: number) => any) | undefined;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
onPitchend?: ((event: MapLibre.MapLibreEvent<MouseEvent | TouchEvent | undefined>) => any) | undefined;
|
|
102
|
+
onRotateend?: ((event: MapLibre.MapMovementEvent) => any) | undefined;
|
|
103
|
+
onPitch?: ((event: MapLibre.MapMovementEvent) => any) | undefined;
|
|
104
|
+
onPitchend?: ((event: MapLibre.MapMovementEvent) => any) | undefined;
|
|
105
105
|
"onUpdate:bearing"?: ((bearing: number) => any) | undefined;
|
|
106
106
|
"onUpdate:pitch"?: ((pitch: number) => any) | undefined;
|
|
107
107
|
}>, {
|
|
108
|
-
injectStyles: boolean;
|
|
109
108
|
trigger: ElementScriptTrigger;
|
|
109
|
+
injectStyles: boolean;
|
|
110
110
|
width: number | string;
|
|
111
111
|
height: number | string;
|
|
112
112
|
zoom: number;
|
|
@@ -11,7 +11,7 @@ const props = defineProps({
|
|
|
11
11
|
const emit = defineEmits(["error", "ready"]);
|
|
12
12
|
defineSlots();
|
|
13
13
|
const attrId = `_carbonads_js`;
|
|
14
|
-
const carbonadsEl = ref(
|
|
14
|
+
const carbonadsEl = ref(null);
|
|
15
15
|
const status = ref("awaitingLoad");
|
|
16
16
|
let scriptEl;
|
|
17
17
|
function loadCarbon() {
|
|
@@ -39,6 +39,7 @@ function loadCarbon() {
|
|
|
39
39
|
emit("ready", script);
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
|
+
document.getElementById(attrId)?.remove();
|
|
42
43
|
carbonadsEl.value.appendChild(script);
|
|
43
44
|
}
|
|
44
45
|
const trigger = useScriptTriggerElement({ trigger: props.trigger, el: carbonadsEl });
|
|
@@ -61,7 +62,7 @@ onBeforeUnmount(() => {
|
|
|
61
62
|
if (scriptEl) {
|
|
62
63
|
scriptEl.onload = null;
|
|
63
64
|
scriptEl.onerror = null;
|
|
64
|
-
|
|
65
|
+
document.head.appendChild(scriptEl);
|
|
65
66
|
scriptEl = void 0;
|
|
66
67
|
}
|
|
67
68
|
});
|
|
@@ -64,8 +64,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
|
64
64
|
onError?: ((error: unknown) => any) | undefined;
|
|
65
65
|
onReady?: ((instance: SdkInstance<Components[]>) => any) | undefined;
|
|
66
66
|
}>, {
|
|
67
|
-
clientId: string;
|
|
68
67
|
trigger: ElementScriptTrigger;
|
|
68
|
+
clientId: string;
|
|
69
69
|
components: Components[];
|
|
70
70
|
paypalScriptOptions: Partial<PayPalInput>;
|
|
71
71
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -64,8 +64,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
|
64
64
|
onError?: ((error: unknown) => any) | undefined;
|
|
65
65
|
onReady?: ((instance: SdkInstance<Components[]>) => any) | undefined;
|
|
66
66
|
}>, {
|
|
67
|
-
clientId: string;
|
|
68
67
|
trigger: ElementScriptTrigger;
|
|
68
|
+
clientId: string;
|
|
69
69
|
components: Components[];
|
|
70
70
|
paypalScriptOptions: Partial<PayPalInput>;
|
|
71
71
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -62,8 +62,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
|
62
62
|
onError?: ((error: unknown) => any) | undefined;
|
|
63
63
|
onReady?: ((session: PayPalMessagesSession) => any) | undefined;
|
|
64
64
|
}>, {
|
|
65
|
-
clientId: string;
|
|
66
65
|
trigger: ElementScriptTrigger;
|
|
66
|
+
clientId: string;
|
|
67
67
|
paypalScriptOptions: Partial<PayPalInput>;
|
|
68
68
|
messagesOptions: PayPalMessagesOptions;
|
|
69
69
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -62,8 +62,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
|
62
62
|
onError?: ((error: unknown) => any) | undefined;
|
|
63
63
|
onReady?: ((session: PayPalMessagesSession) => any) | undefined;
|
|
64
64
|
}>, {
|
|
65
|
-
clientId: string;
|
|
66
65
|
trigger: ElementScriptTrigger;
|
|
66
|
+
clientId: string;
|
|
67
67
|
paypalScriptOptions: Partial<PayPalInput>;
|
|
68
68
|
messagesOptions: PayPalMessagesOptions;
|
|
69
69
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,7 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const MAPLIBRE_STYLESHEET_INTEGRITY = "sha384-uTttxo/aOKbdE5RlD/SPzSDoDmNvGlUYPjONi2MN/b7c9HPSvW07OIuyP7uL6jxK";
|
|
3
|
-
export declare function configureMapLibreWorker(maplibre: {
|
|
1
|
+
interface MapLibreWorkerApi {
|
|
4
2
|
setWorkerUrl: (value: string) => void;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Points MapLibre at its worker.
|
|
6
|
+
*
|
|
7
|
+
* MapLibre v6 resolves the worker from `import.meta.url`, which does not
|
|
8
|
+
* survive bundling, so the URL has to be set explicitly. `?worker&url` is
|
|
9
|
+
* required over plain `?url`: the worker imports its sibling
|
|
10
|
+
* `maplibre-gl-shared.mjs`.
|
|
11
|
+
*
|
|
12
|
+
* @see https://maplibre.org/maplibre-gl-js/docs/#installation
|
|
13
|
+
*/
|
|
14
|
+
export declare function configureMapLibreWorker(maplibre: MapLibreWorkerApi | undefined, workerUrl?: string): Promise<void>;
|
|
15
|
+
/** Injects a custom MapLibre control and marker stylesheet once. */
|
|
16
|
+
export declare function ensureMapLibreStyles(stylesheetUrl: string): void;
|
|
17
|
+
export {};
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
export const MAPLIBRE_STYLESHEET_URL = "https://unpkg.com/maplibre-gl@5.24.0/dist/maplibre-gl.css";
|
|
2
|
-
export const MAPLIBRE_STYLESHEET_INTEGRITY = "sha384-uTttxo/aOKbdE5RlD/SPzSDoDmNvGlUYPjONi2MN/b7c9HPSvW07OIuyP7uL6jxK";
|
|
3
1
|
const MAPLIBRE_STYLE_ID = "nuxt-scripts-maplibre-styles";
|
|
4
|
-
export function configureMapLibreWorker(maplibre, workerUrl) {
|
|
5
|
-
if (maplibre
|
|
2
|
+
export async function configureMapLibreWorker(maplibre, workerUrl) {
|
|
3
|
+
if (!maplibre)
|
|
4
|
+
return;
|
|
5
|
+
if (workerUrl) {
|
|
6
6
|
maplibre.setWorkerUrl(workerUrl);
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
const { default: bundledWorkerUrl } = await import("maplibre-gl/dist/maplibre-gl-worker.mjs?worker&url");
|
|
10
|
+
maplibre.setWorkerUrl(bundledWorkerUrl);
|
|
7
11
|
}
|
|
8
|
-
export function ensureMapLibreStyles(stylesheetUrl
|
|
12
|
+
export function ensureMapLibreStyles(stylesheetUrl) {
|
|
9
13
|
if (typeof document === "undefined")
|
|
10
14
|
return;
|
|
11
15
|
const link = document.createElement("link");
|
|
@@ -17,9 +21,5 @@ export function ensureMapLibreStyles(stylesheetUrl = MAPLIBRE_STYLESHEET_URL) {
|
|
|
17
21
|
const injectedStylesheets = document.querySelectorAll("[data-nuxt-scripts-maplibre]");
|
|
18
22
|
link.id = injectedStylesheets.length ? `${MAPLIBRE_STYLE_ID}-${injectedStylesheets.length + 1}` : MAPLIBRE_STYLE_ID;
|
|
19
23
|
link.dataset.nuxtScriptsMaplibre = "1";
|
|
20
|
-
if (stylesheetUrl === MAPLIBRE_STYLESHEET_URL) {
|
|
21
|
-
link.integrity = MAPLIBRE_STYLESHEET_INTEGRITY;
|
|
22
|
-
link.crossOrigin = "anonymous";
|
|
23
|
-
}
|
|
24
24
|
document.head.append(link);
|
|
25
25
|
}
|
|
@@ -1,13 +1,36 @@
|
|
|
1
|
-
import { safeParse, strictObject } from "valibot";
|
|
2
1
|
import { logger } from "../logger.js";
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
const CONSENT_CATEGORIES = [
|
|
3
|
+
"ad_storage",
|
|
4
|
+
"ad_user_data",
|
|
5
|
+
"ad_personalization",
|
|
6
|
+
"analytics_storage",
|
|
7
|
+
"functionality_storage",
|
|
8
|
+
"personalization_storage",
|
|
9
|
+
"security_storage"
|
|
10
|
+
];
|
|
11
|
+
const CONSENT_CATEGORY_KEYS = new Set(CONSENT_CATEGORIES);
|
|
12
|
+
function describeConsentIssue(key, value) {
|
|
13
|
+
if (CONSENT_CATEGORY_KEYS.has(key)) {
|
|
14
|
+
return value === "granted" || value === "denied" ? null : `"${key}" must be "granted" or "denied", received ${JSON.stringify(value)}`;
|
|
15
|
+
}
|
|
16
|
+
if (key === "wait_for_update") {
|
|
17
|
+
return typeof value === "number" && Number.isFinite(value) ? null : `"wait_for_update" must be a number, received ${JSON.stringify(value)}`;
|
|
18
|
+
}
|
|
19
|
+
if (key === "region") {
|
|
20
|
+
return Array.isArray(value) && value.every((entry) => typeof entry === "string") ? null : `"region" must be an array of strings, received ${JSON.stringify(value)}`;
|
|
21
|
+
}
|
|
22
|
+
return `unknown key "${key}"`;
|
|
23
|
+
}
|
|
5
24
|
export function validateConsentState(log, state, source) {
|
|
6
|
-
|
|
7
|
-
|
|
25
|
+
if (state === null || typeof state !== "object") {
|
|
26
|
+
log.warn(`${source}: consent state must be an object, received ${JSON.stringify(state)}`);
|
|
8
27
|
return;
|
|
9
|
-
|
|
10
|
-
|
|
28
|
+
}
|
|
29
|
+
for (const key in state) {
|
|
30
|
+
const issue = describeConsentIssue(key, state[key]);
|
|
31
|
+
if (issue)
|
|
32
|
+
log.warn(`${source}: ${issue}`);
|
|
33
|
+
}
|
|
11
34
|
}
|
|
12
35
|
export function attachGcmConsent(instance, contract, registryKey) {
|
|
13
36
|
if (instance.consent)
|
|
@@ -7,7 +7,13 @@ export interface MapLibreApi {
|
|
|
7
7
|
maplibregl: typeof MapLibre;
|
|
8
8
|
}
|
|
9
9
|
declare global {
|
|
10
|
-
interface Window
|
|
10
|
+
interface Window {
|
|
11
|
+
maplibregl?: typeof MapLibre;
|
|
11
12
|
}
|
|
12
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* MapLibre GL JS v6 is an ESM-only distribution. It has no UMD build, and its
|
|
16
|
+
* worker resolves against `import.meta.url`, so it is loaded from the
|
|
17
|
+
* `maplibre-gl` package instead of a CDN script tag.
|
|
18
|
+
*/
|
|
13
19
|
export declare function useScriptMapLibre<T extends MapLibreApi>(_options?: MapLibreInput): import("#nuxt-scripts/types").UseScriptContext<T>;
|
|
@@ -1,28 +1,36 @@
|
|
|
1
|
-
import { configureMapLibreWorker, ensureMapLibreStyles
|
|
1
|
+
import { configureMapLibreWorker, ensureMapLibreStyles } from "../maplibre-styles.js";
|
|
2
2
|
import { useRegistryScript } from "../utils.js";
|
|
3
3
|
import { MapLibreOptions } from "./schemas.js";
|
|
4
4
|
export { MapLibreOptions };
|
|
5
5
|
export function useScriptMapLibre(_options) {
|
|
6
|
-
return useRegistryScript("maplibre", (options
|
|
6
|
+
return useRegistryScript("maplibre", (options) => {
|
|
7
7
|
const injectStyles = options?.injectStyles !== false;
|
|
8
|
-
const stylesheetUrl = options?.stylesheetUrl
|
|
9
|
-
const usesDefaultSource = !context.scriptInput?.src;
|
|
8
|
+
const stylesheetUrl = options?.stylesheetUrl;
|
|
10
9
|
return {
|
|
11
|
-
|
|
12
|
-
src: "https://unpkg.com/maplibre-gl@5.24.0/dist/maplibre-gl.js",
|
|
13
|
-
...usesDefaultSource ? {
|
|
14
|
-
integrity: "sha384-5+cfbwT0iiub6VsQAdn6yz16nr6sDiQoHx6tm4O8OVYXHYOxcffFmCJBL0dgdvGp",
|
|
15
|
-
crossorigin: "anonymous"
|
|
16
|
-
} : {}
|
|
17
|
-
},
|
|
18
|
-
clientInit: injectStyles ? () => ensureMapLibreStyles(stylesheetUrl) : void 0,
|
|
10
|
+
scriptMode: "npm",
|
|
19
11
|
schema: import.meta.dev ? MapLibreOptions : void 0,
|
|
20
12
|
scriptOptions: {
|
|
21
13
|
use() {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
return import.meta.client && window.maplibregl ? { maplibregl: window.maplibregl } : void 0;
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
clientInit: import.meta.server ? void 0 : async (ctx) => {
|
|
18
|
+
const throwIfAborted = () => {
|
|
19
|
+
if (ctx?.signal.aborted)
|
|
20
|
+
throw ctx.signal.reason || new Error("Loading MapLibre was aborted");
|
|
21
|
+
};
|
|
22
|
+
throwIfAborted();
|
|
23
|
+
if (injectStyles) {
|
|
24
|
+
if (stylesheetUrl)
|
|
25
|
+
ensureMapLibreStyles(stylesheetUrl);
|
|
26
|
+
else
|
|
27
|
+
await import("maplibre-gl/dist/maplibre-gl.css");
|
|
25
28
|
}
|
|
29
|
+
const maplibregl = window.maplibregl || await import("maplibre-gl");
|
|
30
|
+
throwIfAborted();
|
|
31
|
+
await configureMapLibreWorker(maplibregl, options?.workerUrl);
|
|
32
|
+
window.maplibregl = maplibregl;
|
|
33
|
+
return { maplibregl };
|
|
26
34
|
}
|
|
27
35
|
};
|
|
28
36
|
}, _options);
|