@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.
Files changed (66) hide show
  1. package/README.md +19 -10
  2. package/dist/client/200.html +5 -5
  3. package/dist/client/404.html +5 -5
  4. package/dist/client/_nuxt/{DIt5FBMJ.js → B7d4VNNH.js} +1 -1
  5. package/dist/client/_nuxt/{DOakR0z3.js → BDe6zcU4.js} +1 -1
  6. package/dist/client/_nuxt/D2zRUjPH.js +31 -0
  7. package/dist/client/_nuxt/builds/latest.json +1 -1
  8. package/dist/client/_nuxt/builds/meta/02cf2bf1-41db-47f3-b8a9-6ba85bdcc620.json +1 -0
  9. package/dist/client/_nuxt/{CovTDKFE.js → oLueGnAd.js} +1 -1
  10. package/dist/client/index.html +5 -5
  11. package/dist/module.json +1 -1
  12. package/dist/module.mjs +1 -0
  13. package/dist/runtime/components/GoogleMaps.vue +1 -1
  14. package/dist/runtime/components/StripePricingTableEmbed.vue +1 -1
  15. package/dist/runtime/components/VimeoEmbed.vue +1 -1
  16. package/dist/runtime/components/YouTubeEmbed.vue +1 -1
  17. package/dist/runtime/composables/useConsentScriptTrigger.d.ts +13 -0
  18. package/dist/runtime/composables/{createConsentScriptTrigger.mjs → useConsentScriptTrigger.mjs} +11 -3
  19. package/dist/runtime/composables/useElementScriptTrigger.d.ts +15 -1
  20. package/dist/runtime/composables/useElementScriptTrigger.mjs +4 -2
  21. package/dist/runtime/composables/useScript.d.ts +1 -1
  22. package/dist/runtime/registry/cloudflare-web-analytics.d.ts +2 -17
  23. package/dist/runtime/registry/cloudflare-web-analytics.mjs +1 -1
  24. package/dist/runtime/registry/facebook-pixel.d.ts +2 -6
  25. package/dist/runtime/registry/facebook-pixel.mjs +2 -2
  26. package/dist/runtime/registry/fathom-analytics.d.ts +2 -29
  27. package/dist/runtime/registry/fathom-analytics.mjs +1 -1
  28. package/dist/runtime/registry/google-analytics.d.ts +2 -6
  29. package/dist/runtime/registry/google-analytics.mjs +2 -2
  30. package/dist/runtime/registry/google-maps.d.ts +10 -12
  31. package/dist/runtime/registry/google-maps.mjs +2 -2
  32. package/dist/runtime/registry/google-tag-manager.d.ts +2 -6
  33. package/dist/runtime/registry/google-tag-manager.mjs +2 -2
  34. package/dist/runtime/registry/hotjar.d.ts +2 -8
  35. package/dist/runtime/registry/hotjar.mjs +2 -2
  36. package/dist/runtime/registry/intercom.d.ts +3 -21
  37. package/dist/runtime/registry/intercom.mjs +2 -2
  38. package/dist/runtime/registry/lemon-squeezy.d.ts +2 -2
  39. package/dist/runtime/registry/lemon-squeezy.mjs +2 -2
  40. package/dist/runtime/registry/matomo-analytics.d.ts +2 -12
  41. package/dist/runtime/registry/matomo-analytics.mjs +2 -2
  42. package/dist/runtime/registry/npm.d.ts +2 -12
  43. package/dist/runtime/registry/npm.mjs +1 -1
  44. package/dist/runtime/registry/plausible-analytics.d.ts +2 -8
  45. package/dist/runtime/registry/plausible-analytics.mjs +2 -2
  46. package/dist/runtime/registry/segment.d.ts +2 -8
  47. package/dist/runtime/registry/segment.mjs +2 -2
  48. package/dist/runtime/registry/stripe.d.ts +4 -8
  49. package/dist/runtime/registry/stripe.mjs +2 -2
  50. package/dist/runtime/registry/vimeo-player.d.ts +2 -2
  51. package/dist/runtime/registry/vimeo-player.mjs +2 -2
  52. package/dist/runtime/registry/x-pixel.d.ts +2 -8
  53. package/dist/runtime/registry/x-pixel.mjs +2 -2
  54. package/dist/runtime/registry/youtube-iframe.d.ts +3 -3
  55. package/dist/runtime/registry/youtube-iframe.mjs +2 -2
  56. package/dist/runtime/types.d.ts +2 -2
  57. package/dist/runtime/utils.d.ts +1 -4
  58. package/dist/runtime/utils.mjs +4 -8
  59. package/dist/runtime/validation/mock.d.ts +36 -0
  60. package/dist/runtime/validation/mock.mjs +13 -0
  61. package/dist/runtime/validation/valibot.d.ts +1 -0
  62. package/dist/runtime/validation/valibot.mjs +1 -0
  63. package/package.json +1 -1
  64. package/dist/client/_nuxt/8T3kBMJO.js +0 -31
  65. package/dist/client/_nuxt/builds/meta/ccc94de9-89fa-400b-88f2-8fc2599e191f.json +0 -1
  66. package/dist/runtime/composables/createConsentScriptTrigger.d.ts +0 -6
@@ -1 +1 @@
1
- {"id":"ccc94de9-89fa-400b-88f2-8fc2599e191f","timestamp":1714573376455}
1
+ {"id":"02cf2bf1-41db-47f3-b8a9-6ba85bdcc620","timestamp":1714630406165}
@@ -0,0 +1 @@
1
+ {"id":"02cf2bf1-41db-47f3-b8a9-6ba85bdcc620","timestamp":1714630406165,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
@@ -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"./8T3kBMJO.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"./D2zRUjPH.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,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/8T3kBMJO.js">
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/DIt5FBMJ.js">
243
- <link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/CovTDKFE.js">
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/DOakR0z3.js">
246
- <script type="module" src="/__nuxt-scripts/_nuxt/8T3kBMJO.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"}})();
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/module.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "nuxt": ">=3",
6
6
  "bridge": false
7
7
  },
8
- "version": "0.3.0",
8
+ "version": "0.3.1",
9
9
  "builder": {
10
10
  "@nuxt/module-builder": "0.6.0",
11
11
  "unbuild": "2.0.0"
package/dist/module.mjs CHANGED
@@ -370,6 +370,7 @@ const module = defineNuxtModule({
370
370
  logger.debug("The module is disabled, skipping setup.");
371
371
  return;
372
372
  }
373
+ nuxt.options.alias["#nuxt-scripts-validator"] = resolve(`./runtime/validation/${nuxt.options.dev ? "valibot" : "mock"}`);
373
374
  nuxt.options.alias["#nuxt-scripts"] = resolve("./runtime/types");
374
375
  nuxt.options.runtimeConfig["nuxt-scripts"] = { version };
375
376
  nuxt.options.runtimeConfig.public["nuxt-scripts"] = { defaultScriptOptions: config.defaultScriptOptions };
@@ -48,7 +48,7 @@ const elMap = ref<HTMLElement>()
48
48
  const { $script } = useScriptGoogleMaps({
49
49
  apiKey: props.apiKey,
50
50
  scriptOptions: {
51
- trigger: useElementScriptTrigger(props.trigger, elMap),
51
+ trigger: useElementScriptTrigger({ trigger: props.trigger, el: elMap }),
52
52
  },
53
53
  })
54
54
 
@@ -14,7 +14,7 @@ const props = defineProps<{
14
14
 
15
15
  const table = ref()
16
16
  useScript(`https://js.stripe.com/v3/pricing-table.js`, {
17
- trigger: useElementScriptTrigger(props.trigger, table),
17
+ trigger: useElementScriptTrigger({ trigger: props.trigger, el: table }),
18
18
  })
19
19
  </script>
20
20
 
@@ -104,7 +104,7 @@ const root = ref()
104
104
  const ready = ref(false)
105
105
  const { $script } = useScriptVimeoPlayer({
106
106
  scriptOptions: {
107
- trigger: useElementScriptTrigger(props.trigger, root.value),
107
+ trigger: useElementScriptTrigger({ trigger: props.trigger, el: root.value }),
108
108
  },
109
109
  })
110
110
 
@@ -37,7 +37,7 @@ const elYoutube = ref()
37
37
  const ready = ref(false)
38
38
  const { $script } = useScriptYouTubeIframe({
39
39
  scriptOptions: {
40
- trigger: useElementScriptTrigger(props.trigger, elYoutube.value),
40
+ trigger: useElementScriptTrigger({ trigger: props.trigger, el: elYoutube.value }),
41
41
  },
42
42
  })
43
43
 
@@ -0,0 +1,13 @@
1
+ import type { ConsentScriptTriggerOptions } from '../types';
2
+ interface UseConsentScriptTriggerApi extends Promise<void> {
3
+ /**
4
+ * A function that can be called to accept the consent and load the script.
5
+ */
6
+ accept: () => void;
7
+ }
8
+ /**
9
+ * Load a script once consent has been provided either through a resolvable `consent` or calling the `accept` method.
10
+ * @param options
11
+ */
12
+ export declare function useConsentScriptTrigger(options?: ConsentScriptTriggerOptions): UseConsentScriptTriggerApi;
13
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { isRef, onNuxtReady, ref, requestIdleCallback, toValue, tryUseNuxtApp, watch } from "#imports";
2
- export function createConsentScriptTrigger(options) {
2
+ export function useConsentScriptTrigger(options) {
3
3
  if (import.meta.server)
4
4
  return new Promise(() => {
5
5
  });
@@ -9,8 +9,16 @@ export function createConsentScriptTrigger(options) {
9
9
  watch(consented, (ready) => {
10
10
  if (ready) {
11
11
  const runner = nuxtApp?.runWithContext || ((cb) => cb());
12
- const idleTimeout = options?.loadOnNuxtReady ? nuxtApp ? onNuxtReady : requestIdleCallback : (cb) => cb();
13
- runner(() => idleTimeout(resolve));
12
+ if (options?.postConsentTrigger instanceof Promise) {
13
+ options.postConsentTrigger.then(() => runner(resolve));
14
+ return;
15
+ }
16
+ if (options?.postConsentTrigger === "onNuxtReady") {
17
+ const idleTimeout = options?.postConsentTrigger ? nuxtApp ? onNuxtReady : requestIdleCallback : (cb) => cb();
18
+ runner(() => idleTimeout(resolve));
19
+ return;
20
+ }
21
+ runner(resolve);
14
22
  }
15
23
  });
16
24
  if (options?.consent) {
@@ -1,3 +1,17 @@
1
1
  import type { Ref } from 'vue';
2
2
  export type ElementScriptTrigger = 'visible' | 'mouseover' | false;
3
- export declare function useElementScriptTrigger(trigger: ElementScriptTrigger | undefined, el?: HTMLElement | Ref<HTMLElement | undefined> | null): Promise<void>;
3
+ export interface ElementScriptTriggerOptions {
4
+ /**
5
+ * The event to trigger the script load.
6
+ */
7
+ trigger?: ElementScriptTrigger | undefined;
8
+ /**
9
+ * The element to watch for the trigger event.
10
+ * @default document.body
11
+ */
12
+ el?: HTMLElement | Ref<HTMLElement | undefined> | null;
13
+ }
14
+ /**
15
+ * Create a trigger for an element to load a script based on specific element events.
16
+ */
17
+ export declare function useElementScriptTrigger(options: ElementScriptTriggerOptions): Promise<void>;
@@ -1,9 +1,11 @@
1
1
  import { useElementHover, useElementVisibility, watchOnce } from "@vueuse/core";
2
2
  import { ref } from "vue";
3
- export function useElementScriptTrigger(trigger, el) {
3
+ export function useElementScriptTrigger(options) {
4
+ const { el, trigger } = options;
4
5
  if (import.meta.server || !el)
5
6
  return new Promise(() => {
6
7
  });
7
- const activeRef = trigger ? trigger === "mouseover" ? useElementHover(el) : useElementVisibility(el) : ref(false);
8
+ const $el = typeof el !== "undefined" ? el : document.body;
9
+ const activeRef = trigger ? trigger === "mouseover" ? useElementHover($el) : useElementVisibility($el) : ref(false);
8
10
  return trigger ? new Promise((resolve) => watchOnce([activeRef], () => resolve())) : Promise.resolve();
9
11
  }
@@ -1,5 +1,5 @@
1
1
  import { type UseScriptInput, type VueScriptInstance } from '@unhead/vue';
2
2
  import type { NuxtUseScriptOptions } from '#nuxt-scripts';
3
3
  export declare function useScript<T extends Record<string | symbol, any>>(input: UseScriptInput, options?: NuxtUseScriptOptions): T & {
4
- $script: VueScriptInstance<T> & Promise<T>;
4
+ $script: Promise<T> & VueScriptInstance<T>;
5
5
  };
@@ -16,23 +16,8 @@ declare global {
16
16
  interface Window extends CloudflareWebAnalyticsApi {
17
17
  }
18
18
  }
19
- export declare const CloudflareWebAnalyticsOptions: import("valibot").ObjectSchema<{
20
- /**
21
- * The Cloudflare Web Analytics token.
22
- */
23
- token: import("valibot").StringSchema<string>;
24
- /**
25
- * Cloudflare Web Analytics enables measuring SPAs automatically by overriding the History API’s pushState function
26
- * and listening to the onpopstate. Hash-based router is not supported.
27
- *
28
- * @default true
29
- */
30
- spa: import("valibot").OptionalSchema<import("valibot").BooleanSchema<boolean>, undefined, boolean | undefined>;
31
- }, undefined, {
32
- token: string;
33
- spa?: boolean | undefined;
34
- }>;
19
+ export declare const CloudflareWebAnalyticsOptions: any;
35
20
  export type CloudflareWebAnalyticsInput = RegistryScriptInput<typeof CloudflareWebAnalyticsOptions>;
36
21
  export declare function useScriptCloudflareWebAnalytics<T extends CloudflareWebAnalyticsApi>(_options?: CloudflareWebAnalyticsInput): T & {
37
- $script: import("@unhead/vue").VueScriptInstance<T> & Promise<T>;
22
+ $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
38
23
  };
@@ -1,6 +1,6 @@
1
- import { boolean, minLength, object, optional, string } from "valibot";
2
1
  import { defu } from "defu";
3
2
  import { registryScript } from "../utils.mjs";
3
+ import { boolean, minLength, object, optional, string } from "#nuxt-scripts-validator";
4
4
  export const CloudflareWebAnalyticsOptions = object({
5
5
  /**
6
6
  * The Cloudflare Web Analytics token.
@@ -32,13 +32,9 @@ declare global {
32
32
  interface Window extends FacebookPixelApi {
33
33
  }
34
34
  }
35
- export declare const FacebookPixelOptions: import("valibot").ObjectSchema<{
36
- id: import("valibot").UnionSchema<(import("valibot").NumberSchema<number> | import("valibot").StringSchema<string>)[], string | number>;
37
- }, undefined, {
38
- id: string | number;
39
- }>;
35
+ export declare const FacebookPixelOptions: any;
40
36
  export type FacebookPixelInput = RegistryScriptInput<typeof FacebookPixelOptions>;
41
37
  export declare function useScriptFacebookPixel<T extends FacebookPixelApi>(_options?: FacebookPixelInput): T & {
42
- $script: import("@unhead/vue").VueScriptInstance<T> & Promise<T>;
38
+ $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
43
39
  };
44
40
  export {};
@@ -1,6 +1,6 @@
1
- import { number, object, string, union } from "valibot";
2
1
  import { registryScript } from "../utils.mjs";
3
2
  import { FacebookPixelScriptResolver } from "../../registry";
3
+ import { number, object, string, union } from "#nuxt-scripts-validator";
4
4
  export const FacebookPixelOptions = object({
5
5
  id: union([string(), number()])
6
6
  });
@@ -9,7 +9,7 @@ export function useScriptFacebookPixel(_options) {
9
9
  scriptInput: {
10
10
  src: FacebookPixelScriptResolver()
11
11
  },
12
- schema: FacebookPixelOptions,
12
+ schema: import.meta.dev ? FacebookPixelOptions : void 0,
13
13
  scriptOptions: {
14
14
  use() {
15
15
  return { fbq: window.fbq };
@@ -1,32 +1,5 @@
1
1
  import type { RegistryScriptInput } from '#nuxt-scripts';
2
- export declare const FathomAnalyticsOptions: import("valibot").ObjectSchema<{
3
- /**
4
- * The Fathom Analytics site ID.
5
- */
6
- site: import("valibot").StringSchema<string>;
7
- /**
8
- * The Fathom Analytics tracking mode.
9
- */
10
- spa: import("valibot").OptionalSchema<import("valibot").UnionSchema<(import("valibot").LiteralSchema<"hash", "hash"> | import("valibot").LiteralSchema<"auto", "auto"> | import("valibot").LiteralSchema<"history", "history">)[], "auto" | "hash" | "history">, undefined, "auto" | "hash" | "history" | undefined>;
11
- /**
12
- * Automatically track page views.
13
- */
14
- auto: import("valibot").OptionalSchema<import("valibot").BooleanSchema<boolean>, undefined, boolean | undefined>;
15
- /**
16
- * Enable canonical URL tracking.
17
- */
18
- canonical: import("valibot").OptionalSchema<import("valibot").BooleanSchema<boolean>, undefined, boolean | undefined>;
19
- /**
20
- * Honor Do Not Track requests.
21
- */
22
- honorDnt: import("valibot").OptionalSchema<import("valibot").BooleanSchema<boolean>, undefined, boolean | undefined>;
23
- }, undefined, {
24
- site: string;
25
- auto?: boolean | undefined;
26
- spa?: "auto" | "hash" | "history" | undefined;
27
- canonical?: boolean | undefined;
28
- honorDnt?: boolean | undefined;
29
- }>;
2
+ export declare const FathomAnalyticsOptions: any;
30
3
  export type FathomAnalyticsInput = RegistryScriptInput<typeof FathomAnalyticsOptions, false>;
31
4
  export interface FathomAnalyticsApi {
32
5
  beacon: (ctx: {
@@ -54,5 +27,5 @@ declare global {
54
27
  }
55
28
  }
56
29
  export declare function useScriptFathomAnalytics<T extends FathomAnalyticsApi>(_options?: FathomAnalyticsInput): T & {
57
- $script: import("@unhead/vue").VueScriptInstance<T> & Promise<T>;
30
+ $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
58
31
  };
@@ -1,5 +1,5 @@
1
- import { boolean, literal, object, optional, string, union } from "valibot";
2
1
  import { registryScript } from "../utils.mjs";
2
+ import { boolean, literal, object, optional, string, union } from "#nuxt-scripts-validator";
3
3
  export const FathomAnalyticsOptions = object({
4
4
  /**
5
5
  * The Fathom Analytics site ID.
@@ -1,10 +1,6 @@
1
1
  import type { GoogleAnalyticsApi } from 'third-party-capital';
2
2
  import type { RegistryScriptInput } from '#nuxt-scripts';
3
- declare const GoogleAnalyticsOptions: import("valibot").ObjectSchema<{
4
- id: import("valibot").StringSchema<string>;
5
- }, undefined, {
6
- id: string;
7
- }>;
3
+ declare const GoogleAnalyticsOptions: any;
8
4
  export type GoogleAnalyticsInput = RegistryScriptInput<typeof GoogleAnalyticsOptions>;
9
5
  declare global {
10
6
  interface Window extends GoogleAnalyticsApi {
@@ -16,6 +12,6 @@ declare global {
16
12
  * A 3P wrapper for Google Analytics that takes an options input to feed into third-party-capital({@link https://github.com/GoogleChromeLabs/third-party-capital}), which returns instructions for nuxt-scripts.
17
13
  */
18
14
  export declare function useScriptGoogleAnalytics<T extends GoogleAnalyticsApi>(_options?: GoogleAnalyticsInput): T & {
19
- $script: import("@unhead/vue").VueScriptInstance<T> & Promise<T>;
15
+ $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
20
16
  };
21
17
  export {};
@@ -1,6 +1,6 @@
1
- import { object, string } from "valibot";
2
1
  import { registryScript } from "../utils.mjs";
3
2
  import { GoogleAnalyticsScriptResolver } from "../../registry";
3
+ import { object, string } from "#nuxt-scripts-validator";
4
4
  const GoogleAnalyticsOptions = object({
5
5
  id: string()
6
6
  });
@@ -9,7 +9,7 @@ export function useScriptGoogleAnalytics(_options) {
9
9
  scriptInput: {
10
10
  src: GoogleAnalyticsScriptResolver(options)
11
11
  },
12
- schema: GoogleAnalyticsOptions,
12
+ schema: import.meta.dev ? GoogleAnalyticsOptions : void 0,
13
13
  scriptOptions: {
14
14
  use() {
15
15
  return { dataLayer: window.dataLayer, gtag: window.gtag };
@@ -1,17 +1,14 @@
1
- import type google from 'google.maps';
2
1
  import type { RegistryScriptInput } from '#nuxt-scripts';
3
- export declare const GoogleMapsOptions: import("valibot").ObjectSchema<{
4
- apiKey: import("valibot").StringSchema<string>;
5
- libraries: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").StringSchema<string>, string[]>, undefined, string[] | undefined>;
6
- v: import("valibot").OptionalSchema<import("valibot").UnionSchema<(import("valibot").LiteralSchema<"weekly", "weekly"> | import("valibot").LiteralSchema<"beta", "beta"> | import("valibot").LiteralSchema<"alpha", "alpha">)[], "weekly" | "beta" | "alpha">, undefined, "weekly" | "beta" | "alpha" | undefined>;
7
- }, undefined, {
8
- apiKey: string;
9
- libraries?: string[] | undefined;
10
- v?: "weekly" | "beta" | "alpha" | undefined;
11
- }>;
2
+ export declare const GoogleMapsOptions: any;
12
3
  export type GoogleMapsInput = RegistryScriptInput<typeof GoogleMapsOptions>;
4
+ declare namespace google.maps {
5
+ /**
6
+ * @internal
7
+ */
8
+ function __ib__(): void;
9
+ }
13
10
  export interface GoogleMapsApi {
14
- maps: google.maps;
11
+ maps: typeof google.maps;
15
12
  }
16
13
  declare global {
17
14
  interface Window {
@@ -19,5 +16,6 @@ declare global {
19
16
  }
20
17
  }
21
18
  export declare function useScriptGoogleMaps<T extends GoogleMapsApi>(_options?: GoogleMapsInput): T & {
22
- $script: import("@unhead/vue").VueScriptInstance<T> & Promise<T>;
19
+ $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
23
20
  };
21
+ export {};
@@ -1,6 +1,6 @@
1
- import { array, literal, object, optional, string, union } from "valibot";
2
1
  import { withQuery } from "ufo";
3
2
  import { registryScript } from "../utils.mjs";
3
+ import { array, literal, object, optional, string, union } from "#nuxt-scripts-validator";
4
4
  export const GoogleMapsOptions = object({
5
5
  apiKey: string(),
6
6
  libraries: optional(array(string())),
@@ -26,7 +26,7 @@ export function useScriptGoogleMaps(_options) {
26
26
  window.google.maps.__ib__ = resolve;
27
27
  });
28
28
  },
29
- schema: GoogleMapsOptions,
29
+ schema: import.meta.dev ? GoogleMapsOptions : void 0,
30
30
  scriptOptions: {
31
31
  use() {
32
32
  return {
@@ -1,10 +1,6 @@
1
1
  import type { GoogleTagManagerApi } from 'third-party-capital';
2
2
  import type { RegistryScriptInput } from '#nuxt-scripts';
3
- declare const GoogleTagManagerOptions: import("valibot").ObjectSchema<{
4
- id: import("valibot").StringSchema<string>;
5
- }, undefined, {
6
- id: string;
7
- }>;
3
+ declare const GoogleTagManagerOptions: any;
8
4
  export type GoogleTagManagerInput = RegistryScriptInput<typeof GoogleTagManagerOptions>;
9
5
  declare global {
10
6
  interface Window extends GoogleTagManagerApi {
@@ -16,6 +12,6 @@ declare global {
16
12
  * A 3P wrapper for Google Tag Manager that takes an options input to feed into third-party-capital({@link https://github.com/GoogleChromeLabs/third-party-capital}), which returns instructions for nuxt-scripts.
17
13
  */
18
14
  export declare function useScriptGoogleTagManager<T extends GoogleTagManagerApi>(options?: GoogleTagManagerInput): T & {
19
- $script: import("@unhead/vue").VueScriptInstance<T> & Promise<T>;
15
+ $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
20
16
  };
21
17
  export {};
@@ -1,6 +1,6 @@
1
- import { object, string } from "valibot";
2
1
  import { withQuery } from "ufo";
3
2
  import { registryScript } from "../utils.mjs";
3
+ import { object, string } from "#nuxt-scripts-validator";
4
4
  const GoogleTagManagerOptions = object({
5
5
  id: string()
6
6
  });
@@ -12,7 +12,7 @@ export function useScriptGoogleTagManager(options) {
12
12
  id: options2?.id
13
13
  })
14
14
  },
15
- schema: GoogleTagManagerOptions,
15
+ schema: import.meta.dev ? GoogleTagManagerOptions : void 0,
16
16
  scriptOptions: {
17
17
  use() {
18
18
  return { dataLayer: window.dataLayer, google_tag_manager: window.google_tag_manager };
@@ -12,14 +12,8 @@ declare global {
12
12
  };
13
13
  }
14
14
  }
15
- export declare const HotjarOptions: import("valibot").ObjectSchema<{
16
- id: import("valibot").NumberSchema<number>;
17
- sv: import("valibot").OptionalSchema<import("valibot").NumberSchema<number>, undefined, number | undefined>;
18
- }, undefined, {
19
- id: number;
20
- sv?: number | undefined;
21
- }>;
15
+ export declare const HotjarOptions: any;
22
16
  export type HotjarInput = RegistryScriptInput<typeof HotjarOptions>;
23
17
  export declare function useScriptHotjar<T extends HotjarApi>(_options?: HotjarInput): T & {
24
- $script: import("@unhead/vue").VueScriptInstance<T> & Promise<T>;
18
+ $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
25
19
  };
@@ -1,5 +1,5 @@
1
- import { number, object, optional } from "valibot";
2
1
  import { registryScript } from "../utils.mjs";
2
+ import { number, object, optional } from "#nuxt-scripts-validator";
3
3
  export const HotjarOptions = object({
4
4
  id: number(),
5
5
  sv: optional(number())
@@ -9,7 +9,7 @@ export function useScriptHotjar(_options) {
9
9
  scriptInput: {
10
10
  src: `https://static.hotjar.com/c/hotjar-${options?.id}.js?sv=${options?.sv}`
11
11
  },
12
- schema: HotjarOptions,
12
+ schema: import.meta.dev ? HotjarOptions : void 0,
13
13
  scriptOptions: {
14
14
  use() {
15
15
  return { hj: window.hj };
@@ -1,24 +1,6 @@
1
- import { type Input } from 'valibot';
1
+ import { type Input } from '#nuxt-scripts-validator';
2
2
  import type { RegistryScriptInput } from '#nuxt-scripts';
3
- export declare const IntercomOptions: import("valibot").ObjectSchema<{
4
- app_id: import("valibot").StringSchema<string>;
5
- api_base: import("valibot").OptionalSchema<import("valibot").UnionSchema<(import("valibot").LiteralSchema<"https://api-iam.intercom.io", "https://api-iam.intercom.io"> | import("valibot").LiteralSchema<"https://api-iam.eu.intercom.io", "https://api-iam.eu.intercom.io"> | import("valibot").LiteralSchema<"https://api-iam.au.intercom.io", "https://api-iam.au.intercom.io">)[], "https://api-iam.intercom.io" | "https://api-iam.eu.intercom.io" | "https://api-iam.au.intercom.io">, undefined, "https://api-iam.intercom.io" | "https://api-iam.eu.intercom.io" | "https://api-iam.au.intercom.io" | undefined>;
6
- name: import("valibot").OptionalSchema<import("valibot").StringSchema<string>, undefined, string | undefined>;
7
- email: import("valibot").OptionalSchema<import("valibot").StringSchema<string>, undefined, string | undefined>;
8
- user_id: import("valibot").OptionalSchema<import("valibot").StringSchema<string>, undefined, string | undefined>;
9
- alignment: import("valibot").OptionalSchema<import("valibot").UnionSchema<(import("valibot").LiteralSchema<"left", "left"> | import("valibot").LiteralSchema<"right", "right">)[], "left" | "right">, undefined, "left" | "right" | undefined>;
10
- horizontal_padding: import("valibot").OptionalSchema<import("valibot").NumberSchema<number>, undefined, number | undefined>;
11
- vertical_padding: import("valibot").OptionalSchema<import("valibot").NumberSchema<number>, undefined, number | undefined>;
12
- }, undefined, {
13
- app_id: string;
14
- api_base?: "https://api-iam.intercom.io" | "https://api-iam.eu.intercom.io" | "https://api-iam.au.intercom.io" | undefined;
15
- name?: string | undefined;
16
- email?: string | undefined;
17
- user_id?: string | undefined;
18
- alignment?: "left" | "right" | undefined;
19
- horizontal_padding?: number | undefined;
20
- vertical_padding?: number | undefined;
21
- }>;
3
+ export declare const IntercomOptions: any;
22
4
  export type IntercomInput = RegistryScriptInput<typeof IntercomOptions>;
23
5
  export interface IntercomApi {
24
6
  Intercom: ((event: 'boot', data?: Input<typeof IntercomOptions>) => void) & ((event: 'shutdown') => void) & ((event: 'update', options?: Input<typeof IntercomOptions>) => void) & ((event: 'hide') => void) & ((event: 'show') => void) & ((event: 'showSpace', spaceName: 'home' | 'messages' | 'help' | 'news' | 'tasks' | 'tickets' | string) => void) & ((event: 'showMessages') => void) & ((event: 'showNewMessage', content?: string) => void) & ((event: 'onHide', fn: () => void) => void) & ((event: 'onShow', fn: () => void) => void) & ((event: 'onUnreadCountChange', fn: () => void) => void) & ((event: 'trackEvent', eventName: string, metadata?: Record<string, any>) => void) & ((event: 'getVisitorId') => Promise<string>) & ((event: 'startTour', tourId: string | number) => void) & ((event: 'showArticle', articleId: string | number) => void) & ((event: 'showNews', newsItemId: string | number) => void) & ((event: 'startSurvey', surveyId: string | number) => void) & ((event: 'startChecklist', checklistId: string | number) => void) & ((event: 'showTicket', ticketId: string | number) => void) & ((event: 'showConversation', conversationId: string | number) => void) & ((event: 'onUserEmailSupplied', fn: () => void) => void) & ((event: string, ...params: any[]) => void);
@@ -29,5 +11,5 @@ declare global {
29
11
  }
30
12
  }
31
13
  export declare function useScriptIntercom<T extends IntercomApi>(_options?: IntercomInput): T & {
32
- $script: import("@unhead/vue").VueScriptInstance<T> & Promise<T>;
14
+ $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
33
15
  };
@@ -1,6 +1,6 @@
1
- import { literal, number, object, optional, string, union } from "valibot";
2
1
  import { joinURL } from "ufo";
3
2
  import { registryScript } from "../utils.mjs";
3
+ import { literal, number, object, optional, string, union } from "#nuxt-scripts-validator";
4
4
  export const IntercomOptions = object({
5
5
  app_id: string(),
6
6
  api_base: optional(union([literal("https://api-iam.intercom.io"), literal("https://api-iam.eu.intercom.io"), literal("https://api-iam.au.intercom.io")])),
@@ -22,7 +22,7 @@ export function useScriptIntercom(_options) {
22
22
  return acc;
23
23
  })
24
24
  },
25
- schema: IntercomOptions,
25
+ schema: import.meta.dev ? IntercomOptions : void 0,
26
26
  scriptOptions: {
27
27
  use() {
28
28
  return { Intercom: window.Intercom };
@@ -1,5 +1,5 @@
1
1
  import type { RegistryScriptInput } from '#nuxt-scripts';
2
- export declare const LemonSqueezyOptions: import("valibot").ObjectSchema<{}, undefined, {}>;
2
+ export declare const LemonSqueezyOptions: any;
3
3
  export type LemonSqueezyInput = RegistryScriptInput<typeof LemonSqueezyOptions>;
4
4
  export interface LemonSqueezyApi {
5
5
  /**
@@ -64,5 +64,5 @@ declare global {
64
64
  }
65
65
  }
66
66
  export declare function useScriptLemonSqueezy<T extends LemonSqueezyApi>(_options?: LemonSqueezyInput): T & {
67
- $script: import("@unhead/vue").VueScriptInstance<T> & Promise<T>;
67
+ $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
68
68
  };
@@ -1,5 +1,5 @@
1
- import { object } from "valibot";
2
1
  import { registryScript } from "../utils.mjs";
2
+ import { object } from "#nuxt-scripts-validator";
3
3
  export const LemonSqueezyOptions = object({});
4
4
  export function useScriptLemonSqueezy(_options) {
5
5
  return registryScript("lemonSqueezy", () => ({
@@ -8,7 +8,7 @@ export function useScriptLemonSqueezy(_options) {
8
8
  // @ts-expect-error untyped
9
9
  crossorigin: null
10
10
  },
11
- schema: LemonSqueezyOptions,
11
+ schema: import.meta.dev ? LemonSqueezyOptions : void 0,
12
12
  scriptOptions: {
13
13
  use() {
14
14
  if (typeof window.createLemonSqueezy === "undefined")
@@ -1,15 +1,5 @@
1
1
  import type { RegistryScriptInput } from '#nuxt-scripts';
2
- export declare const MatomoAnalyticsOptions: import("valibot").ObjectSchema<{
3
- matomoUrl: import("valibot").StringSchema<string>;
4
- siteId: import("valibot").StringSchema<string>;
5
- trackPageView: import("valibot").OptionalSchema<import("valibot").BooleanSchema<boolean>, undefined, boolean | undefined>;
6
- enableLinkTracking: import("valibot").OptionalSchema<import("valibot").BooleanSchema<boolean>, undefined, boolean | undefined>;
7
- }, undefined, {
8
- matomoUrl: string;
9
- siteId: string;
10
- trackPageView?: boolean | undefined;
11
- enableLinkTracking?: boolean | undefined;
12
- }>;
2
+ export declare const MatomoAnalyticsOptions: any;
13
3
  export type MatomoAnalyticsInput = RegistryScriptInput<typeof MatomoAnalyticsOptions, false>;
14
4
  interface MatomoAnalyticsApi {
15
5
  _paq: unknown[];
@@ -19,6 +9,6 @@ declare global {
19
9
  }
20
10
  }
21
11
  export declare function useScriptMatomoAnalytics<T extends MatomoAnalyticsApi>(_options?: MatomoAnalyticsInput): T & {
22
- $script: import("@unhead/vue").VueScriptInstance<T> & Promise<T>;
12
+ $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
23
13
  };
24
14
  export {};
@@ -1,5 +1,5 @@
1
- import { boolean, object, optional, string } from "valibot";
2
1
  import { registryScript } from "../utils.mjs";
2
+ import { boolean, object, optional, string } from "#nuxt-scripts-validator";
3
3
  export const MatomoAnalyticsOptions = object({
4
4
  matomoUrl: string(),
5
5
  // site is required
@@ -12,7 +12,7 @@ export function useScriptMatomoAnalytics(_options) {
12
12
  scriptInput: {
13
13
  src: `https://${options?.matomoUrl}/matomo.js`
14
14
  },
15
- schema: MatomoAnalyticsOptions,
15
+ schema: import.meta.dev ? MatomoAnalyticsOptions : void 0,
16
16
  scriptOptions: {
17
17
  use() {
18
18
  return { _paq: window._paq };
@@ -1,16 +1,6 @@
1
1
  import type { RegistryScriptInput } from '#nuxt-scripts';
2
- export declare const NpmOptions: import("valibot").ObjectSchema<{
3
- packageName: import("valibot").StringSchema<string>;
4
- file: import("valibot").OptionalSchema<import("valibot").StringSchema<string>, undefined, string | undefined>;
5
- version: import("valibot").OptionalSchema<import("valibot").StringSchema<string>, undefined, string | undefined>;
6
- type: import("valibot").OptionalSchema<import("valibot").StringSchema<string>, undefined, string | undefined>;
7
- }, undefined, {
8
- packageName: string;
9
- type?: string | undefined;
10
- file?: string | undefined;
11
- version?: string | undefined;
12
- }>;
2
+ export declare const NpmOptions: any;
13
3
  export type NpmInput = RegistryScriptInput<typeof NpmOptions>;
14
4
  export declare function useScriptNpm<T extends Record<string | symbol, any>>(_options: NpmInput): T & {
15
- $script: import("@unhead/vue").VueScriptInstance<T> & Promise<T>;
5
+ $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
16
6
  };