@nuxt/scripts 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -10
- package/dist/client/200.html +5 -5
- package/dist/client/404.html +5 -5
- package/dist/client/_nuxt/{DIt5FBMJ.js → B7d4VNNH.js} +1 -1
- package/dist/client/_nuxt/{DOakR0z3.js → BDe6zcU4.js} +1 -1
- package/dist/client/_nuxt/D2zRUjPH.js +31 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/02cf2bf1-41db-47f3-b8a9-6ba85bdcc620.json +1 -0
- package/dist/client/_nuxt/{CovTDKFE.js → oLueGnAd.js} +1 -1
- package/dist/client/index.html +5 -5
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -0
- package/dist/runtime/components/GoogleMaps.vue +1 -1
- package/dist/runtime/components/StripePricingTableEmbed.vue +1 -1
- package/dist/runtime/components/VimeoEmbed.vue +1 -1
- package/dist/runtime/components/YouTubeEmbed.vue +1 -1
- package/dist/runtime/composables/useConsentScriptTrigger.d.ts +13 -0
- package/dist/runtime/composables/{createConsentScriptTrigger.mjs → useConsentScriptTrigger.mjs} +11 -3
- package/dist/runtime/composables/useElementScriptTrigger.d.ts +15 -1
- package/dist/runtime/composables/useElementScriptTrigger.mjs +4 -2
- package/dist/runtime/composables/useScript.d.ts +1 -1
- package/dist/runtime/registry/cloudflare-web-analytics.d.ts +2 -17
- package/dist/runtime/registry/cloudflare-web-analytics.mjs +1 -1
- package/dist/runtime/registry/facebook-pixel.d.ts +2 -6
- package/dist/runtime/registry/facebook-pixel.mjs +2 -2
- package/dist/runtime/registry/fathom-analytics.d.ts +2 -29
- package/dist/runtime/registry/fathom-analytics.mjs +1 -1
- package/dist/runtime/registry/google-analytics.d.ts +2 -6
- package/dist/runtime/registry/google-analytics.mjs +2 -2
- package/dist/runtime/registry/google-maps.d.ts +10 -12
- package/dist/runtime/registry/google-maps.mjs +2 -2
- package/dist/runtime/registry/google-tag-manager.d.ts +2 -6
- package/dist/runtime/registry/google-tag-manager.mjs +2 -2
- package/dist/runtime/registry/hotjar.d.ts +2 -8
- package/dist/runtime/registry/hotjar.mjs +2 -2
- package/dist/runtime/registry/intercom.d.ts +3 -21
- package/dist/runtime/registry/intercom.mjs +2 -2
- package/dist/runtime/registry/lemon-squeezy.d.ts +2 -2
- package/dist/runtime/registry/lemon-squeezy.mjs +2 -2
- package/dist/runtime/registry/matomo-analytics.d.ts +2 -12
- package/dist/runtime/registry/matomo-analytics.mjs +2 -2
- package/dist/runtime/registry/npm.d.ts +2 -12
- package/dist/runtime/registry/npm.mjs +1 -1
- package/dist/runtime/registry/plausible-analytics.d.ts +2 -8
- package/dist/runtime/registry/plausible-analytics.mjs +2 -2
- package/dist/runtime/registry/segment.d.ts +2 -8
- package/dist/runtime/registry/segment.mjs +2 -2
- package/dist/runtime/registry/stripe.d.ts +4 -8
- package/dist/runtime/registry/stripe.mjs +2 -2
- package/dist/runtime/registry/vimeo-player.d.ts +2 -2
- package/dist/runtime/registry/vimeo-player.mjs +2 -2
- package/dist/runtime/registry/x-pixel.d.ts +2 -8
- package/dist/runtime/registry/x-pixel.mjs +2 -2
- package/dist/runtime/registry/youtube-iframe.d.ts +3 -3
- package/dist/runtime/registry/youtube-iframe.mjs +2 -2
- package/dist/runtime/types.d.ts +2 -2
- package/dist/runtime/utils.d.ts +1 -4
- package/dist/runtime/utils.mjs +4 -8
- package/dist/runtime/validation/mock.d.ts +36 -0
- package/dist/runtime/validation/mock.mjs +13 -0
- package/dist/runtime/validation/valibot.d.ts +1 -0
- package/dist/runtime/validation/valibot.mjs +1 -0
- package/package.json +1 -1
- package/dist/client/_nuxt/8T3kBMJO.js +0 -31
- package/dist/client/_nuxt/builds/meta/ccc94de9-89fa-400b-88f2-8fc2599e191f.json +0 -1
- package/dist/runtime/composables/createConsentScriptTrigger.d.ts +0 -6
package/README.md
CHANGED
|
@@ -10,16 +10,19 @@
|
|
|
10
10
|
|
|
11
11
|
Better Privacy, Performance, and DX for Third-Party Scripts in Nuxt Apps.
|
|
12
12
|
|
|
13
|
-
- [👾 Playground](https://stackblitz.com/
|
|
13
|
+
- [👾 Playground](https://stackblitz.com/edit/nuxt-starter-pkwfkx?file=pages%2Findex.vue)
|
|
14
|
+
|
|
15
|
+
> [!IMPORTANT]
|
|
16
|
+
> Nuxt Scripts is in public preview and is not yet officially announced. Use with caution as some APIs may change.
|
|
14
17
|
|
|
15
18
|
## Features
|
|
16
19
|
|
|
17
|
-
- 🪨
|
|
20
|
+
- 🪨 Built on top of [Unhead](https://unhead.unjs.io/usage/composables/use-script)
|
|
18
21
|
- 🎁 20+ third-party scripts integrations with fine-grained performance optimizations
|
|
19
|
-
-
|
|
20
|
-
- 🕵️ Privacy
|
|
21
|
-
- 🪵 DevTools
|
|
22
|
-
- 🚀 0
|
|
22
|
+
- 🏎️ Performance: Self hosting, advanced script loading triggers, best-practice defaults.
|
|
23
|
+
- 🕵️ Privacy: Defaults to protect end users identity, script consent management APIs.
|
|
24
|
+
- 🪵 DevTools: View your script with their status and see function logs
|
|
25
|
+
- 🚀 0 dependencies, ~2kb minimal runtime
|
|
23
26
|
|
|
24
27
|
## Background
|
|
25
28
|
|
|
@@ -37,11 +40,17 @@ To get started, simply run:
|
|
|
37
40
|
npx nuxi@latest module add @nuxt/scripts
|
|
38
41
|
```
|
|
39
42
|
|
|
40
|
-
|
|
43
|
+
That's it! The Nuxt Scripts module should be downloaded and added to your Nuxt Config `modules`.
|
|
44
|
+
|
|
45
|
+
## Next Steps
|
|
46
|
+
|
|
47
|
+
Need some inspiration to start using Nuxt Scripts? Try out the following:
|
|
41
48
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
49
|
+
1. 🎉 Make it rain emojis with the [Confetti Tutorial](https://scripts.nuxt.com/docs/getting-started/confetti-tutorial).
|
|
50
|
+
2. 📚 Learn about how the [Script Loading](https://scripts.nuxt.com/docs/guides/script-loading) works.
|
|
51
|
+
3. 🔍 Explore the [Script Registry](https://scripts.nuxt.com/scripts) for popular pre-configured third-party scripts.
|
|
52
|
+
3. 🚀 Load other scripts with [useScript](https://unhead.unjs.io/usage/composables/use-script) or [Global Scripts](https://scripts.nuxt.com/docs/guides/globals).
|
|
53
|
+
4. 🔨 Fine-tune your performance and privacy with [Bundling](https://scripts.nuxt.com/docs/guides/bundling) and [Consent Management](https://scripts.nuxt.com/docs/guides/consent).
|
|
45
54
|
|
|
46
55
|
## License
|
|
47
56
|
|
package/dist/client/200.html
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!DOCTYPE html><html><head><meta charset="utf-8">
|
|
2
2
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
3
3
|
<link rel="stylesheet" href="/__nuxt-scripts/_nuxt/entry.D91GVkD7.css">
|
|
4
|
-
<link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/
|
|
4
|
+
<link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/D2zRUjPH.js">
|
|
5
5
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DXFkqnOI.js">
|
|
6
6
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/D6NljDpC.js">
|
|
7
7
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/CowR2XfX.js">
|
|
@@ -239,10 +239,10 @@
|
|
|
239
239
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/V_y36BGi.js">
|
|
240
240
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BGq4KZyx.js">
|
|
241
241
|
<link rel="prefetch" as="style" href="/__nuxt-scripts/_nuxt/error-404.BRldFSII.css">
|
|
242
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/
|
|
243
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/
|
|
242
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/B7d4VNNH.js">
|
|
243
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/oLueGnAd.js">
|
|
244
244
|
<link rel="prefetch" as="style" href="/__nuxt-scripts/_nuxt/error-500.D8yw_IbC.css">
|
|
245
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/
|
|
246
|
-
<script type="module" src="/__nuxt-scripts/_nuxt/
|
|
245
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BDe6zcU4.js">
|
|
246
|
+
<script type="module" src="/__nuxt-scripts/_nuxt/D2zRUjPH.js" crossorigin></script><script>"use strict";(()=>{const a=window,e=document.documentElement,c=window.localStorage,d=["dark","light"],n=c&&c.getItem&&c.getItem("nuxt-color-mode")||"system";let l=n==="system"?f():n;const i=e.getAttribute("data-color-mode-forced");i&&(l=i),r(l),a["__NUXT_COLOR_MODE__"]={preference:n,value:l,getColorScheme:f,addColorScheme:r,removeColorScheme:u};function r(o){const t=""+o+"",s="";e.classList?e.classList.add(t):e.className+=" "+t,s&&e.setAttribute("data-"+s,o)}function u(o){const t=""+o+"",s="";e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp(t,"g"),""),s&&e.removeAttribute("data-"+s)}function m(o){return a.matchMedia("(prefers-color-scheme"+o+")")}function f(){if(a.matchMedia&&m("").media!=="not all"){for(const o of d)if(m(":"+o).matches)return o}return"light"}})();
|
|
247
247
|
</script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"_errors":1,"serverRendered":2,"data":3,"state":4,"once":5},{},false,{},{},["Set"]]</script>
|
|
248
248
|
<script>window.__NUXT__={};window.__NUXT__.config={public:{"nuxt-scripts":{defaultScriptOptions:{trigger:"onNuxtReady"}}},app:{baseURL:"/__nuxt-scripts",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/client/404.html
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!DOCTYPE html><html><head><meta charset="utf-8">
|
|
2
2
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
3
3
|
<link rel="stylesheet" href="/__nuxt-scripts/_nuxt/entry.D91GVkD7.css">
|
|
4
|
-
<link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/
|
|
4
|
+
<link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/D2zRUjPH.js">
|
|
5
5
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DXFkqnOI.js">
|
|
6
6
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/D6NljDpC.js">
|
|
7
7
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/CowR2XfX.js">
|
|
@@ -239,10 +239,10 @@
|
|
|
239
239
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/V_y36BGi.js">
|
|
240
240
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BGq4KZyx.js">
|
|
241
241
|
<link rel="prefetch" as="style" href="/__nuxt-scripts/_nuxt/error-404.BRldFSII.css">
|
|
242
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/
|
|
243
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/
|
|
242
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/B7d4VNNH.js">
|
|
243
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/oLueGnAd.js">
|
|
244
244
|
<link rel="prefetch" as="style" href="/__nuxt-scripts/_nuxt/error-500.D8yw_IbC.css">
|
|
245
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/
|
|
246
|
-
<script type="module" src="/__nuxt-scripts/_nuxt/
|
|
245
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BDe6zcU4.js">
|
|
246
|
+
<script type="module" src="/__nuxt-scripts/_nuxt/D2zRUjPH.js" crossorigin></script><script>"use strict";(()=>{const a=window,e=document.documentElement,c=window.localStorage,d=["dark","light"],n=c&&c.getItem&&c.getItem("nuxt-color-mode")||"system";let l=n==="system"?f():n;const i=e.getAttribute("data-color-mode-forced");i&&(l=i),r(l),a["__NUXT_COLOR_MODE__"]={preference:n,value:l,getColorScheme:f,addColorScheme:r,removeColorScheme:u};function r(o){const t=""+o+"",s="";e.classList?e.classList.add(t):e.className+=" "+t,s&&e.setAttribute("data-"+s,o)}function u(o){const t=""+o+"",s="";e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp(t,"g"),""),s&&e.removeAttribute("data-"+s)}function m(o){return a.matchMedia("(prefers-color-scheme"+o+")")}function f(){if(a.matchMedia&&m("").media!=="not all"){for(const o of d)if(m(":"+o).matches)return o}return"light"}})();
|
|
247
247
|
</script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"_errors":1,"serverRendered":2,"data":3,"state":4,"once":5},{},false,{},{},["Set"]]</script>
|
|
248
248
|
<script>window.__NUXT__={};window.__NUXT__.config={public:{"nuxt-scripts":{defaultScriptOptions:{trigger:"onNuxtReady"}}},app:{baseURL:"/__nuxt-scripts",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as a,c as s,a as e,t as o,b as i,w as u,d as c,_ as d,p as l,e as p}from"./
|
|
1
|
+
import{o as a,c as s,a as e,t as o,b as i,w as u,d as c,_ as d,p as l,e as p}from"./D2zRUjPH.js";import{_ as h,u as b}from"./oLueGnAd.js";const f=t=>(l("data-v-bd6e1038"),t=t(),p(),t),g={class:"font-sans antialiased bg-white dark:bg-black text-black dark:text-white grid min-h-screen place-content-center overflow-hidden"},x=f(()=>e("div",{class:"fixed left-0 right-0 spotlight z-10"},null,-1)),m={class:"max-w-520px text-center z-20"},y=["textContent"],_=["textContent"],k={class:"w-full flex items-center justify-center"},w={__name:"error-404",props:{appName:{type:String,default:"Nuxt"},version:{type:String,default:""},statusCode:{type:Number,default:404},statusMessage:{type:String,default:"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(t){const n=t;return b({title:`${n.statusCode} - ${n.statusMessage} | ${n.appName}`,script:[],style:[{children:'*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:var(--un-default-border-color, #e5e7eb)}:before,:after{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;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;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}h1{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}h1,p{margin:0}*,:before,:after{--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 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(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: }'}]}),(z,S)=>{const r=d;return a(),s("div",g,[x,e("div",m,[e("h1",{class:"text-8xl sm:text-10xl font-medium mb-8",textContent:o(t.statusCode)},null,8,y),e("p",{class:"text-xl px-8 sm:px-0 sm:text-4xl font-light mb-16 leading-tight",textContent:o(t.description)},null,8,_),e("div",k,[i(r,{to:"/",class:"gradient-border text-md sm:text-xl py-2 px-4 sm:py-3 sm:px-6 cursor-pointer"},{default:u(()=>[c(o(t.backHome),1)]),_:1})])])])}}},N=h(w,[["__scopeId","data-v-bd6e1038"]]);export{N as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as o,u as a}from"./
|
|
1
|
+
import{_ as o,u as a}from"./oLueGnAd.js";import{o as s,c as i,a as e,t as r,p as u,e as l}from"./D2zRUjPH.js";const c=t=>(u("data-v-478fb72d"),t=t(),l(),t),d={class:"font-sans antialiased bg-white dark:bg-black text-black dark:text-white grid min-h-screen place-content-center overflow-hidden"},p=c(()=>e("div",{class:"fixed -bottom-1/2 left-0 right-0 h-1/2 spotlight"},null,-1)),h={class:"max-w-520px text-center"},b=["textContent"],g=["textContent"],f={__name:"error-500",props:{appName:{type:String,default:"Nuxt"},version:{type:String,default:""},statusCode:{type:Number,default:500},statusMessage:{type:String,default:"Server error"},description:{type:String,default:"This page is temporarily unavailable."}},setup(t){const n=t;return a({title:`${n.statusCode} - ${n.statusMessage} | ${n.appName}`,script:[],style:[{children:'*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:var(--un-default-border-color, #e5e7eb)}:before,:after{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;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;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}h1{font-size:inherit;font-weight:inherit}h1,p{margin:0}*,:before,:after{--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 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(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: }'}]}),(m,x)=>(s(),i("div",d,[p,e("div",h,[e("h1",{class:"text-8xl sm:text-10xl font-medium mb-8",textContent:r(t.statusCode)},null,8,b),e("p",{class:"text-xl px-8 sm:px-0 sm:text-4xl font-light mb-16 leading-tight",textContent:r(t.description)},null,8,g)])]))}},w=o(f,[["__scopeId","data-v-478fb72d"]]);export{w as default};
|