@nuxt/scripts 0.1.2 → 0.1.4

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.
Files changed (39) hide show
  1. package/README.md +25 -24
  2. package/dist/client/200.html +5 -5
  3. package/dist/client/404.html +5 -5
  4. package/dist/client/_nuxt/{aHjvVTmd.js → B3yRAOXz.js} +1 -1
  5. package/dist/client/_nuxt/{CnKaz707.js → BqAhYH0E.js} +10 -10
  6. package/dist/client/_nuxt/{39p2CQxv.js → C2uur0MR.js} +1 -1
  7. package/dist/client/_nuxt/{DkzLeoVe.js → CO8u40Ut.js} +1 -1
  8. package/dist/client/_nuxt/builds/latest.json +1 -1
  9. package/dist/client/_nuxt/builds/meta/4e9eefe2-f4a5-46ff-889b-aa701f38d2cd.json +1 -0
  10. package/dist/client/index.html +5 -5
  11. package/dist/module.d.mts +4 -0
  12. package/dist/module.d.ts +4 -0
  13. package/dist/module.json +1 -1
  14. package/dist/module.mjs +4 -1
  15. package/dist/runtime/composables/useScript.d.ts +2 -4
  16. package/dist/runtime/composables/useScript.mjs +5 -1
  17. package/dist/runtime/registry/cloudflare-turnstile.d.ts +1 -0
  18. package/dist/runtime/registry/cloudflare-turnstile.mjs +3 -0
  19. package/dist/runtime/registry/cloudflare-web-analytics.d.ts +34 -0
  20. package/dist/runtime/registry/cloudflare-web-analytics.mjs +37 -0
  21. package/dist/runtime/registry/confetti.d.ts +14 -0
  22. package/dist/runtime/registry/confetti.mjs +12 -0
  23. package/dist/runtime/registry/facebook-pixel.d.ts +42 -0
  24. package/dist/runtime/registry/facebook-pixel.mjs +37 -0
  25. package/dist/runtime/registry/fathom-analytics.d.ts +33 -0
  26. package/dist/runtime/registry/fathom-analytics.mjs +28 -0
  27. package/dist/runtime/registry/google-analytics.d.ts +1 -0
  28. package/dist/runtime/registry/google-analytics.mjs +3 -0
  29. package/dist/runtime/registry/google-tag-manager.d.ts +1 -0
  30. package/dist/runtime/registry/google-tag-manager.mjs +3 -0
  31. package/dist/runtime/registry/hotjar.d.ts +24 -0
  32. package/dist/runtime/registry/hotjar.mjs +32 -0
  33. package/dist/runtime/registry/intercom.d.ts +31 -0
  34. package/dist/runtime/registry/intercom.mjs +34 -0
  35. package/dist/runtime/registry/segment.d.ts +25 -0
  36. package/dist/runtime/registry/segment.mjs +44 -0
  37. package/dist/runtime/types.d.ts +4 -0
  38. package/package.json +10 -8
  39. package/dist/client/_nuxt/builds/meta/1725e43b-622c-4c05-887b-4ab192ea5225.json +0 -1
package/README.md CHANGED
@@ -12,7 +12,7 @@ Better Privacy, Performance, and DX for Third-Party Scripts in Nuxt Apps.
12
12
 
13
13
  ## Features
14
14
 
15
- - 🪨 [useScript](https://unhead.unjs.io/usage/composables/use-script): Proxy API, fully typed, single instance & more!
15
+ - 🪨 [useScript](https://unhead.unjs.io/usage/composables/use-script)
16
16
  - 🦥 Improve your site performance with better script loading strategies
17
17
  - 🎃 Powerful proxy API for SSR handling, lazy loading, and error handling
18
18
  - (TODO) Registry for third-party scripts in Nuxt
@@ -59,32 +59,33 @@ addConfetti({ emojis: ['🌈', '⚡️', '💥', '✨', '💫', '🌸'] })
59
59
 
60
60
  ### Using The Registry (TODO)
61
61
 
62
- The registry is a collection of compatible Nuxt Modules that integrate with Nuxt Scripts and one-off composables provided
63
- by the module.
62
+ The registry is a collection of composables and Nuxt Modules that directly integrate with Nuxt Scripts.
64
63
 
65
- To use a script from the registry, simply use the composable or register them globally using the key. Consult the
64
+ To use a script from the registry, simply use the composable. Consult the
66
65
  below table for the available scripts.
67
66
 
68
- | Key | Description | Composable | Source |
69
- | --- | --- | --- |
70
- | `google-analytics` | Google Analytics | `useGoogleAnalytics` | Nuxt Third Party Capital |
71
- | `google-tag-manager` | Google Tag Manager | `useGoogleTagManager` | Nuxt Third Party Capital |
72
- | `hotjar` | Hotjar | `useHotjar` | Nuxt Third Party Capital |
73
- | `cloudflare-turnstile` | CloudFlare Turnstile | `useCloudflareTurnstile` | Nuxt Cloudflare Turnstile |
74
- | `intercom` | Intercom | `useIntercom` | Nuxt Scripts |
75
- | `facebook-pixel` | Facebook Pixel | `useFacebookPixel` |
76
- | `twitter-pixel` | Twitter Pixel | `useTwitterPixel` |
77
- | `linkedin-insight-tag` | LinkedIn Insight Tag | `useLinkedInInsightTag` |
78
- | `pinterest-tag` | Pinterest Tag | `usePinterestTag` |
79
- | `google-ads-conversion-tracking` | Google Ads Conversion Tracking | `useGoogleAdsConversionTracking` |
80
- | `google-ads-remarketing` | Google Ads Remarketing | `useGoogleAdsRemarketing` |
81
- | `segment` | Segment | `useSegment` |
82
- | `fathom-analytics` | Fathom Analytics | `useFathomAnalytics` |
83
- | `plausible-analytics` | Plausible Analytics | `usePlausibleAnalytics` |
84
- | `simple-analytics` | Simple Analytics | `useSimpleAnalytics` |
85
- | `umami-analytics` | Umami Analytics | `useUmamiAnalytics` |
86
- | `cloudflare-web-analytics` | Cloudflare Web Analytics | `useCloudflareWebAnalytics` |
87
- | `matomo` | Matomo | `useMatomo` |
67
+ | Key | Description | Composable | Source |
68
+ |----------| | --- | --- |
69
+ | `cloudflare-web-analytics` | Cloudflare Web Analytics | `useScriptCloudflareWebAnalytics` | Core |
70
+ | `confetti` | [JS Confetti](https://github.com/loonywizard/js-confetti) | `useScriptCloudflareAnalytics` | Core |
71
+ | `facebook-pixel` | Facebook Pixel | `useScriptFacebookPixel` | Core |
72
+ | `fathom-analytics` | Fathom Analytics | `useScriptFathomAnalytics` | Core |
73
+ | `hotjar` | Hotjar | `useScriptHotjar` | Core |
74
+ | `intercom` | Intercom | `useScriptIntercom` | Core |
75
+ | `segment` | Segment | `useScriptSegment` | Core |
76
+ | `google-analytics` | Google Analytics | `useGoogleAnalytics` | [Nuxt Third Party Capital](https://github.com/nuxt/third-party-capital) |
77
+ | `google-tag-manager` | Google Tag Manager | `useGoogleTagManager` | [Nuxt Third Party Capital](https://github.com/nuxt/third-party-capital) |
78
+ | `cloudflare-turnstile` | CloudFlare Turnstile | `useCloudflareTurnstile` | [Nuxt Cloudflare Turnstile](https://github.com/nuxt-modules/turnstile) |
79
+
80
+ TODO | `twitter-pixel` | Twitter Pixel | `useTwitterPixel` |
81
+ TODO | `pinterest-tag` | Pinterest Tag | `usePinterestTag` |
82
+ TODO | `google-ads-conversion-tracking` | Google Ads Conversion Tracking | `useGoogleAdsConversionTracking` |
83
+ TODO | `google-ads-remarketing` | Google Ads Remarketing | `useGoogleAdsRemarketing` |
84
+ TODO | `plausible-analytics` | Plausible Analytics | `usePlausibleAnalytics` |
85
+ TODO | `simple-analytics` | Simple Analytics | `useSimpleAnalytics` |
86
+ TODO | `umami-analytics` | Umami Analytics | `useUmamiAnalytics` |
87
+ TODO | `cloudflare-web-analytics` | Cloudflare Web Analytics | `useCloudflareWebAnalytics` |
88
+ TODO | `matomo` | Matomo | `useMatomo` |
88
89
 
89
90
  ### Loading Scripts Globally
90
91
 
@@ -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/CnKaz707.js">
4
+ <link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BqAhYH0E.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">
@@ -229,10 +229,10 @@
229
229
  <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DggdVF2v.js">
230
230
  <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/A1WiD9SJ.js">
231
231
  <link rel="prefetch" as="style" href="/__nuxt-scripts/_nuxt/error-404.ORekjfyJ.css">
232
- <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DkzLeoVe.js">
233
- <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/aHjvVTmd.js">
232
+ <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/CO8u40Ut.js">
233
+ <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/B3yRAOXz.js">
234
234
  <link rel="prefetch" as="style" href="/__nuxt-scripts/_nuxt/error-500.BIuFL0tW.css">
235
- <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/39p2CQxv.js">
236
- <script type="module" src="/__nuxt-scripts/_nuxt/CnKaz707.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"}})();
235
+ <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/C2uur0MR.js">
236
+ <script type="module" src="/__nuxt-scripts/_nuxt/BqAhYH0E.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"}})();
237
237
  </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>
238
238
  <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-scripts",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
@@ -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/CnKaz707.js">
4
+ <link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BqAhYH0E.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">
@@ -229,10 +229,10 @@
229
229
  <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DggdVF2v.js">
230
230
  <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/A1WiD9SJ.js">
231
231
  <link rel="prefetch" as="style" href="/__nuxt-scripts/_nuxt/error-404.ORekjfyJ.css">
232
- <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DkzLeoVe.js">
233
- <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/aHjvVTmd.js">
232
+ <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/CO8u40Ut.js">
233
+ <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/B3yRAOXz.js">
234
234
  <link rel="prefetch" as="style" href="/__nuxt-scripts/_nuxt/error-500.BIuFL0tW.css">
235
- <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/39p2CQxv.js">
236
- <script type="module" src="/__nuxt-scripts/_nuxt/CnKaz707.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"}})();
235
+ <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/C2uur0MR.js">
236
+ <script type="module" src="/__nuxt-scripts/_nuxt/BqAhYH0E.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"}})();
237
237
  </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>
238
238
  <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-scripts",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
@@ -1 +1 @@
1
- import{i as u,r as c,f,g as v,h as d,j as l,k as i,l as h,m as p}from"./CnKaz707.js";function g(t,a={}){const e=a.head||u();if(e)return e.ssr?e.push(t,a):m(e,t,a)}function m(t,a,e={}){const s=c(!1),n=c({});f(()=>{n.value=s.value?{}:h(a)});const r=t.push(n.value,e);return v(n,o=>{r.patch(o)}),p()&&(d(()=>{r.dispose()}),l(()=>{s.value=!0}),i(()=>{s.value=!1})),r}const I=(t,a)=>{const e=t.__vccOpts||t;for(const[s,n]of a)e[s]=n;return e};export{I as _,g as u};
1
+ import{i as u,r as c,f,g as v,h as d,j as l,k as i,l as h,m as p}from"./BqAhYH0E.js";function g(t,a={}){const e=a.head||u();if(e)return e.ssr?e.push(t,a):m(e,t,a)}function m(t,a,e={}){const s=c(!1),n=c({});f(()=>{n.value=s.value?{}:h(a)});const r=t.push(n.value,e);return v(n,o=>{r.patch(o)}),p()&&(d(()=>{r.dispose()}),l(()=>{s.value=!0}),i(()=>{s.value=!1})),r}const I=(t,a)=>{const e=t.__vccOpts||t;for(const[s,n]of a)e[s]=n;return e};export{I as _,g as u};