@nuxt/scripts 0.2.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 (138) hide show
  1. package/README.md +19 -10
  2. package/dist/client/200.html +58 -49
  3. package/dist/client/404.html +58 -49
  4. package/dist/client/_nuxt/B5NHDIr7.js +353 -0
  5. package/dist/client/_nuxt/{Bz4xi2rU.js → B6ZnTe72.js} +1 -1
  6. package/dist/client/_nuxt/{B6nY7VDA.js → B6bHXiXE.js} +1 -1
  7. package/dist/client/_nuxt/{DX0ZGhB-.js → B7d4VNNH.js} +1 -1
  8. package/dist/client/_nuxt/BAMIS8DD.js +1 -0
  9. package/dist/client/_nuxt/{DG73IEBO.js → BDe6zcU4.js} +1 -1
  10. package/dist/client/_nuxt/{DaCkt_J7.js → BGq4KZyx.js} +1 -1
  11. package/dist/client/_nuxt/BVGdgKAv.js +1 -0
  12. package/dist/client/_nuxt/{wORFcijT.js → BXR915QZ.js} +1 -1
  13. package/dist/client/_nuxt/{DCj4DH6i.js → BYdKNJ10.js} +1 -1
  14. package/dist/client/_nuxt/BZfs-ost.js +1 -0
  15. package/dist/client/_nuxt/{DCdPDLy4.js → BacI6-DX.js} +1 -1
  16. package/dist/client/_nuxt/{DCk2z-Tu.js → BdfWgkoX.js} +1 -1
  17. package/dist/client/_nuxt/BscxmKrE.js +8 -0
  18. package/dist/client/_nuxt/C3qJFuQy.js +3 -0
  19. package/dist/client/_nuxt/C6XIsc4F.js +1 -0
  20. package/dist/client/_nuxt/C9UBdavN.js +1 -0
  21. package/dist/client/_nuxt/CA9nliXM.js +1 -0
  22. package/dist/client/_nuxt/{3Yx8WcR-.js → CDJL3WWm.js} +1 -1
  23. package/dist/client/_nuxt/{BsfQk1vf.js → CEfge3mM.js} +1 -1
  24. package/dist/client/_nuxt/{CQTpvb7m.js → CHCTrc3a.js} +1 -1
  25. package/dist/client/_nuxt/{DZ3fVoEH.js → CSPeAESR.js} +1 -1
  26. package/dist/client/_nuxt/CX2EUjC8.js +301 -0
  27. package/dist/client/_nuxt/{DCAtC51B.js → CarfVElc.js} +1 -1
  28. package/dist/client/_nuxt/{BgBwMnrY.js → CcYwH0AH.js} +1 -1
  29. package/dist/client/_nuxt/Cgl53LJQ.js +1 -0
  30. package/dist/client/_nuxt/{RgJsN3zu.js → ChMCFiS0.js} +1 -1
  31. package/dist/client/_nuxt/{DfUNg_8t.js → CqYeW6XZ.js} +1 -1
  32. package/dist/client/_nuxt/{CL7Ixq1B.js → CrgTADc5.js} +1 -1
  33. package/dist/client/_nuxt/CuJfdYLG.js +1 -0
  34. package/dist/client/_nuxt/D2zRUjPH.js +31 -0
  35. package/dist/client/_nuxt/D71BffLY.js +1 -0
  36. package/dist/client/_nuxt/{Bd7iooY8.js → DGDuLtS6.js} +1 -1
  37. package/dist/client/_nuxt/{j8KhMG0x.js → DGxQkqYo.js} +1 -1
  38. package/dist/client/_nuxt/{CUVblut_.js → DR5YgmI2.js} +1 -1
  39. package/dist/client/_nuxt/DS9ZWoKD.js +1 -0
  40. package/dist/client/_nuxt/{D-pQtGOP.js → DVLwECkk.js} +1 -1
  41. package/dist/client/_nuxt/DZLoTQm4.js +1 -0
  42. package/dist/client/_nuxt/{ZQC2c-5V.js → D_T9yQUo.js} +3 -3
  43. package/dist/client/_nuxt/Db2-y2xY.js +1 -0
  44. package/dist/client/_nuxt/{CRWwmX0L.js → Di3qjVs2.js} +1 -1
  45. package/dist/client/_nuxt/{DXpYegZJ.js → Djqq6n-7.js} +1 -1
  46. package/dist/client/_nuxt/Dkb1Nx48.js +1 -0
  47. package/dist/client/_nuxt/{BBv1LFm6.js → DtT2Dbx_.js} +1 -1
  48. package/dist/client/_nuxt/{DywwDckn.js → Du6_OKDb.js} +1 -1
  49. package/dist/client/_nuxt/{IHMnEr_d.js → G-Jz5hiA.js} +1 -1
  50. package/dist/client/_nuxt/HrnDn_2Q.js +1 -0
  51. package/dist/client/_nuxt/{CPHkTjfH.js → JgH_6NEN.js} +1 -1
  52. package/dist/client/_nuxt/Ksn5IXup.js +1 -0
  53. package/dist/client/_nuxt/{wPLeKH6q.js → Lpdzc9s2.js} +1 -1
  54. package/dist/client/_nuxt/{CQ1WWl9n.js → V_y36BGi.js} +1 -1
  55. package/dist/client/_nuxt/{BILqrcpa.js → YdT6Gj0u.js} +1 -1
  56. package/dist/client/_nuxt/alpzPJ78.js +1 -0
  57. package/dist/client/_nuxt/builds/latest.json +1 -1
  58. package/dist/client/_nuxt/builds/meta/02cf2bf1-41db-47f3-b8a9-6ba85bdcc620.json +1 -0
  59. package/dist/client/_nuxt/{Bdb36Id5.js → dIHJ9UdL.js} +1 -1
  60. package/dist/client/_nuxt/o5b8QYQO.js +3 -0
  61. package/dist/client/_nuxt/{D6KmUh4-.js → oLueGnAd.js} +1 -1
  62. package/dist/client/_nuxt/{doGI2cFk.js → wKgfcFVx.js} +1 -1
  63. package/dist/client/index.html +58 -49
  64. package/dist/module.json +1 -1
  65. package/dist/module.mjs +8 -220
  66. package/dist/registry.d.mts +13 -0
  67. package/dist/registry.d.ts +13 -0
  68. package/dist/registry.mjs +214 -0
  69. package/dist/runtime/components/GoogleMaps.vue +1 -1
  70. package/dist/runtime/components/StripePricingTableEmbed.vue +1 -1
  71. package/dist/runtime/components/VimeoEmbed.vue +1 -1
  72. package/dist/runtime/components/YouTubeEmbed.vue +1 -1
  73. package/dist/runtime/composables/useAnalyticsPageEvent.d.ts +4 -1
  74. package/dist/runtime/composables/useConsentScriptTrigger.d.ts +13 -0
  75. package/dist/runtime/composables/{createScriptConsentTrigger.mjs → useConsentScriptTrigger.mjs} +11 -3
  76. package/dist/runtime/composables/useElementScriptTrigger.d.ts +15 -1
  77. package/dist/runtime/composables/useElementScriptTrigger.mjs +5 -3
  78. package/dist/runtime/composables/useScript.d.ts +2 -2
  79. package/dist/runtime/composables/useScript.mjs +1 -1
  80. package/dist/runtime/registry/cloudflare-web-analytics.d.ts +4 -17
  81. package/dist/runtime/registry/cloudflare-web-analytics.mjs +1 -1
  82. package/dist/runtime/registry/facebook-pixel.d.ts +4 -6
  83. package/dist/runtime/registry/facebook-pixel.mjs +2 -2
  84. package/dist/runtime/registry/fathom-analytics.d.ts +4 -14
  85. package/dist/runtime/registry/fathom-analytics.mjs +17 -3
  86. package/dist/runtime/registry/google-analytics.d.ts +4 -6
  87. package/dist/runtime/registry/google-analytics.mjs +2 -2
  88. package/dist/runtime/registry/google-maps.d.ts +12 -12
  89. package/dist/runtime/registry/google-maps.mjs +2 -2
  90. package/dist/runtime/registry/google-tag-manager.d.ts +4 -6
  91. package/dist/runtime/registry/google-tag-manager.mjs +2 -2
  92. package/dist/runtime/registry/hotjar.d.ts +4 -8
  93. package/dist/runtime/registry/hotjar.mjs +2 -2
  94. package/dist/runtime/registry/intercom.d.ts +5 -21
  95. package/dist/runtime/registry/intercom.mjs +2 -2
  96. package/dist/runtime/registry/lemon-squeezy.d.ts +4 -2
  97. package/dist/runtime/registry/lemon-squeezy.mjs +2 -2
  98. package/dist/runtime/registry/matomo-analytics.d.ts +4 -12
  99. package/dist/runtime/registry/matomo-analytics.mjs +2 -2
  100. package/dist/runtime/registry/npm.d.ts +4 -12
  101. package/dist/runtime/registry/npm.mjs +4 -4
  102. package/dist/runtime/registry/plausible-analytics.d.ts +4 -8
  103. package/dist/runtime/registry/plausible-analytics.mjs +2 -2
  104. package/dist/runtime/registry/segment.d.ts +4 -8
  105. package/dist/runtime/registry/segment.mjs +2 -2
  106. package/dist/runtime/registry/stripe.d.ts +6 -8
  107. package/dist/runtime/registry/stripe.mjs +2 -2
  108. package/dist/runtime/registry/vimeo-player.d.ts +4 -2
  109. package/dist/runtime/registry/vimeo-player.mjs +2 -2
  110. package/dist/runtime/registry/x-pixel.d.ts +4 -8
  111. package/dist/runtime/registry/x-pixel.mjs +2 -2
  112. package/dist/runtime/registry/youtube-iframe.d.ts +5 -3
  113. package/dist/runtime/registry/youtube-iframe.mjs +2 -2
  114. package/dist/runtime/types.d.ts +10 -12
  115. package/dist/runtime/utils.d.ts +3 -2
  116. package/dist/runtime/utils.mjs +5 -9
  117. package/dist/runtime/validation/mock.d.ts +36 -0
  118. package/dist/runtime/validation/mock.mjs +13 -0
  119. package/dist/runtime/validation/valibot.d.ts +1 -0
  120. package/dist/runtime/validation/valibot.mjs +1 -0
  121. package/package.json +16 -12
  122. package/dist/client/_nuxt/-hLHpAOl.js +0 -1
  123. package/dist/client/_nuxt/BIMuYTWL.js +0 -3
  124. package/dist/client/_nuxt/BLO8rZtj.js +0 -31
  125. package/dist/client/_nuxt/BSyl5yf0.js +0 -1
  126. package/dist/client/_nuxt/BswfO-CF.js +0 -1
  127. package/dist/client/_nuxt/CGQbO34C.js +0 -1
  128. package/dist/client/_nuxt/D4LhxNOI.js +0 -1
  129. package/dist/client/_nuxt/D4k753MY.js +0 -1
  130. package/dist/client/_nuxt/DnhXxWz-.js +0 -1
  131. package/dist/client/_nuxt/DzPyIVdT.js +0 -9
  132. package/dist/client/_nuxt/TQ9oWRfF.js +0 -1
  133. package/dist/client/_nuxt/WoBtJUue.js +0 -1
  134. package/dist/client/_nuxt/bmJ2objS.js +0 -1
  135. package/dist/client/_nuxt/builds/meta/69e9f83a-05c7-439f-bf82-0c2d6d83b961.json +0 -1
  136. package/dist/runtime/composables/createScriptConsentTrigger.d.ts +0 -6
  137. package/dist/runtime/registry/confetti.d.ts +0 -23
  138. package/dist/runtime/registry/confetti.mjs +0 -18
@@ -1,21 +1,21 @@
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 {
18
15
  google: typeof google;
19
16
  }
20
17
  }
21
- export declare function useScriptGoogleMaps<T extends GoogleMapsApi>(_options?: GoogleMapsInput): any;
18
+ export declare function useScriptGoogleMaps<T extends GoogleMapsApi>(_options?: GoogleMapsInput): T & {
19
+ $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
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 {
@@ -15,5 +11,7 @@ declare global {
15
11
  *
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
- export declare function useScriptGoogleTagManager<T extends GoogleTagManagerApi>(options?: GoogleTagManagerInput): any;
14
+ export declare function useScriptGoogleTagManager<T extends GoogleTagManagerApi>(options?: GoogleTagManagerInput): T & {
15
+ $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
16
+ };
19
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,12 +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
- export declare function useScriptHotjar<T extends HotjarApi>(_options?: HotjarInput): any;
17
+ export declare function useScriptHotjar<T extends HotjarApi>(_options?: HotjarInput): T & {
18
+ $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
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);
@@ -28,4 +10,6 @@ declare global {
28
10
  intercomSettings?: IntercomInput;
29
11
  }
30
12
  }
31
- export declare function useScriptIntercom<T extends IntercomApi>(_options?: IntercomInput): any;
13
+ export declare function useScriptIntercom<T extends IntercomApi>(_options?: IntercomInput): T & {
14
+ $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
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
  /**
@@ -63,4 +63,6 @@ declare global {
63
63
  LemonSqueezy: LemonSqueezyApi;
64
64
  }
65
65
  }
66
- export declare function useScriptLemonSqueezy<T extends LemonSqueezyApi>(_options?: LemonSqueezyInput): any;
66
+ export declare function useScriptLemonSqueezy<T extends LemonSqueezyApi>(_options?: LemonSqueezyInput): T & {
67
+ $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
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[];
@@ -18,5 +8,7 @@ declare global {
18
8
  interface Window extends MatomoAnalyticsApi {
19
9
  }
20
10
  }
21
- export declare function useScriptMatomoAnalytics<T extends MatomoAnalyticsApi>(_options?: MatomoAnalyticsInput): any;
11
+ export declare function useScriptMatomoAnalytics<T extends MatomoAnalyticsApi>(_options?: MatomoAnalyticsInput): T & {
12
+ $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
13
+ };
22
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,14 +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
- export declare function useScriptNpm<T extends Record<string | symbol, any>>(key: string, _options: NpmInput): any;
4
+ export declare function useScriptNpm<T extends Record<string | symbol, any>>(_options: NpmInput): T & {
5
+ $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
6
+ };
@@ -1,17 +1,17 @@
1
- import { object, optional, string } from "valibot";
2
1
  import { withBase } from "ufo";
3
2
  import { registryScript } from "../utils.mjs";
3
+ import { object, optional, string } from "#nuxt-scripts-validator";
4
4
  export const NpmOptions = object({
5
5
  packageName: string(),
6
6
  file: optional(string()),
7
7
  version: optional(string()),
8
8
  type: optional(string())
9
9
  });
10
- export function useScriptNpm(key, _options) {
11
- return registryScript(`${key}-npm`, (options) => ({
10
+ export function useScriptNpm(_options) {
11
+ return registryScript(`${_options.packageName}-npm`, (options) => ({
12
12
  scriptInput: {
13
13
  src: withBase(options.file || "", `https://unpkg.com/${options?.packageName}@${options.version || "latest"}`)
14
14
  },
15
- schema: NpmOptions
15
+ schema: import.meta.dev ? NpmOptions : void 0
16
16
  }), _options);
17
17
  }
@@ -1,11 +1,5 @@
1
1
  import type { RegistryScriptInput } from '#nuxt-scripts';
2
- export declare const PlausibleAnalyticsOptions: import("valibot").ObjectSchema<{
3
- domain: import("valibot").StringSchema<string>;
4
- extension: import("valibot").OptionalSchema<import("valibot").UnionSchema<(import("valibot").UnionSchema<(import("valibot").LiteralSchema<"hash", "hash"> | import("valibot").LiteralSchema<"outbound-links", "outbound-links"> | import("valibot").LiteralSchema<"file-downloads", "file-downloads"> | import("valibot").LiteralSchema<"tagged-events", "tagged-events"> | import("valibot").LiteralSchema<"revenue", "revenue"> | import("valibot").LiteralSchema<"pageview-props", "pageview-props"> | import("valibot").LiteralSchema<"compat", "compat"> | import("valibot").LiteralSchema<"local", "local"> | import("valibot").LiteralSchema<"manual", "manual">)[], "manual" | "hash" | "outbound-links" | "file-downloads" | "tagged-events" | "revenue" | "pageview-props" | "compat" | "local"> | import("valibot").ArraySchema<import("valibot").UnionSchema<(import("valibot").LiteralSchema<"hash", "hash"> | import("valibot").LiteralSchema<"outbound-links", "outbound-links"> | import("valibot").LiteralSchema<"file-downloads", "file-downloads"> | import("valibot").LiteralSchema<"tagged-events", "tagged-events"> | import("valibot").LiteralSchema<"revenue", "revenue"> | import("valibot").LiteralSchema<"pageview-props", "pageview-props"> | import("valibot").LiteralSchema<"compat", "compat"> | import("valibot").LiteralSchema<"local", "local"> | import("valibot").LiteralSchema<"manual", "manual">)[], "manual" | "hash" | "outbound-links" | "file-downloads" | "tagged-events" | "revenue" | "pageview-props" | "compat" | "local">, ("manual" | "hash" | "outbound-links" | "file-downloads" | "tagged-events" | "revenue" | "pageview-props" | "compat" | "local")[]>)[], "manual" | "hash" | "outbound-links" | "file-downloads" | "tagged-events" | "revenue" | "pageview-props" | "compat" | "local" | ("manual" | "hash" | "outbound-links" | "file-downloads" | "tagged-events" | "revenue" | "pageview-props" | "compat" | "local")[]>, undefined, "manual" | "hash" | "outbound-links" | "file-downloads" | "tagged-events" | "revenue" | "pageview-props" | "compat" | "local" | ("manual" | "hash" | "outbound-links" | "file-downloads" | "tagged-events" | "revenue" | "pageview-props" | "compat" | "local")[] | undefined>;
5
- }, undefined, {
6
- domain: string;
7
- extension?: "manual" | "hash" | "outbound-links" | "file-downloads" | "tagged-events" | "revenue" | "pageview-props" | "compat" | "local" | ("manual" | "hash" | "outbound-links" | "file-downloads" | "tagged-events" | "revenue" | "pageview-props" | "compat" | "local")[] | undefined;
8
- }>;
2
+ export declare const PlausibleAnalyticsOptions: any;
9
3
  export type PlausibleAnalyticsInput = RegistryScriptInput<typeof PlausibleAnalyticsOptions, false>;
10
4
  export interface PlausibleAnalyticsApi {
11
5
  plausible: ((event: '404', options: Record<string, any>) => void) & ((event: 'event', options: Record<string, any>) => void) & ((...params: any[]) => void) & {
@@ -17,4 +11,6 @@ declare global {
17
11
  plausible: PlausibleAnalyticsApi;
18
12
  }
19
13
  }
20
- export declare function useScriptPlausibleAnalytics<T extends PlausibleAnalyticsApi>(_options?: PlausibleAnalyticsInput): any;
14
+ export declare function useScriptPlausibleAnalytics<T extends PlausibleAnalyticsApi>(_options?: PlausibleAnalyticsInput): T & {
15
+ $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
16
+ };
@@ -1,6 +1,6 @@
1
- import { array, literal, object, optional, string, union } from "valibot";
2
1
  import { registryScript } from "../utils.mjs";
3
2
  import { PlausibleAnalyticsScriptResolver } from "../../registry";
3
+ import { array, literal, object, optional, string, union } from "#nuxt-scripts-validator";
4
4
  const extensions = [
5
5
  literal("hash"),
6
6
  literal("outbound-links"),
@@ -24,7 +24,7 @@ export function useScriptPlausibleAnalytics(_options) {
24
24
  "src": PlausibleAnalyticsScriptResolver(options),
25
25
  "data-domain": options?.domain
26
26
  },
27
- schema: PlausibleAnalyticsOptions,
27
+ schema: import.meta.dev ? PlausibleAnalyticsOptions : void 0,
28
28
  scriptOptions: {
29
29
  use() {
30
30
  return { plausible: window.plausible };
@@ -1,11 +1,5 @@
1
1
  import type { RegistryScriptInput } from '#nuxt-scripts';
2
- export declare const SegmentOptions: import("valibot").ObjectSchema<{
3
- writeKey: import("valibot").StringSchema<string>;
4
- analyticsKey: import("valibot").OptionalSchema<import("valibot").StringSchema<string>, undefined, string | undefined>;
5
- }, undefined, {
6
- writeKey: string;
7
- analyticsKey?: string | undefined;
8
- }>;
2
+ export declare const SegmentOptions: any;
9
3
  export type SegmentInput = RegistryScriptInput<typeof SegmentOptions>;
10
4
  export interface SegmentApi {
11
5
  analytics: {
@@ -21,4 +15,6 @@ declare global {
21
15
  interface Window extends SegmentApi {
22
16
  }
23
17
  }
24
- export declare function useScriptSegment<T extends SegmentApi>(_options?: SegmentInput): any;
18
+ export declare function useScriptSegment<T extends SegmentApi>(_options?: SegmentInput): T & {
19
+ $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
20
+ };
@@ -1,6 +1,6 @@
1
- import { object, optional, string } from "valibot";
2
1
  import { registryScript } from "../utils.mjs";
3
2
  import { SegmentScriptResolver } from "../../registry";
3
+ import { object, optional, string } from "#nuxt-scripts-validator";
4
4
  export const SegmentOptions = object({
5
5
  writeKey: string(),
6
6
  analyticsKey: optional(string())
@@ -13,7 +13,7 @@ export function useScriptSegment(_options) {
13
13
  "data-global-segment-analytics-key": analyticsKey,
14
14
  "src": SegmentScriptResolver(options)
15
15
  },
16
- schema: SegmentOptions,
16
+ schema: import.meta.dev ? SegmentOptions : void 0,
17
17
  scriptOptions: {
18
18
  use() {
19
19
  return { analytics: window[analyticsKey] };
@@ -1,16 +1,14 @@
1
- import type { Stripe } from '@types/stripe-v3';
1
+ /// <reference types="stripe-v3" />
2
2
  import type { RegistryScriptInput } from '#nuxt-scripts';
3
- export declare const StripeOptions: import("valibot").ObjectSchema<{
4
- advancedFraudSignals: import("valibot").OptionalSchema<import("valibot").BooleanSchema<boolean>, undefined, boolean | undefined>;
5
- }, undefined, {
6
- advancedFraudSignals?: boolean | undefined;
7
- }>;
3
+ export declare const StripeOptions: any;
8
4
  export type StripeInput = RegistryScriptInput<typeof StripeOptions, false>;
9
5
  export interface StripeApi {
10
- Stripe: Stripe;
6
+ Stripe: stripe.StripeStatic;
11
7
  }
12
8
  declare global {
13
9
  interface Window extends StripeApi {
14
10
  }
15
11
  }
16
- export declare function useScriptStripe<T extends StripeApi>(_options?: StripeInput): any;
12
+ export declare function useScriptStripe<T extends StripeApi>(_options?: StripeInput): T & {
13
+ $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
14
+ };
@@ -1,6 +1,6 @@
1
- import { boolean, object, optional } from "valibot";
2
1
  import { withQuery } from "ufo";
3
2
  import { registryScript } from "../utils.mjs";
3
+ import { boolean, object, optional } from "#nuxt-scripts-validator";
4
4
  export const StripeOptions = object({
5
5
  advancedFraudSignals: optional(boolean())
6
6
  });
@@ -17,7 +17,7 @@ export function useScriptStripe(_options) {
17
17
  // @ts-expect-error TODO add types
18
18
  referrerpolicy: null
19
19
  },
20
- schema: StripeOptions,
20
+ schema: import.meta.dev ? StripeOptions : void 0,
21
21
  scriptOptions: {
22
22
  use() {
23
23
  return { Stripe: window.Stripe };
@@ -3,11 +3,13 @@ import type { RegistryScriptInput } from '#nuxt-scripts';
3
3
  export interface VimeoPlayerApi {
4
4
  Player: VimeoPlayer;
5
5
  }
6
- export declare const VimeoPlayerOptions: import("valibot").ObjectSchema<{}, undefined, {}>;
6
+ export declare const VimeoPlayerOptions: any;
7
7
  export type VimeoPlayerInput = RegistryScriptInput<typeof VimeoPlayerOptions>;
8
8
  declare global {
9
9
  interface Window {
10
10
  Vimeo: VimeoPlayerApi;
11
11
  }
12
12
  }
13
- export declare function useScriptVimeoPlayer<T extends VimeoPlayerApi>(_options?: VimeoPlayerInput): any;
13
+ export declare function useScriptVimeoPlayer<T extends VimeoPlayerApi>(_options?: VimeoPlayerInput): T & {
14
+ $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
15
+ };
@@ -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
  import { useHead } from "#imports";
4
4
  export const VimeoPlayerOptions = object({});
5
5
  export function useScriptVimeoPlayer(_options) {
@@ -7,7 +7,7 @@ export function useScriptVimeoPlayer(_options) {
7
7
  scriptInput: {
8
8
  src: "https://player.vimeo.com/api/player.js"
9
9
  },
10
- schema: VimeoPlayerOptions,
10
+ schema: import.meta.dev ? VimeoPlayerOptions : void 0,
11
11
  scriptOptions: {
12
12
  use() {
13
13
  let Player;
@@ -27,13 +27,9 @@ declare global {
27
27
  interface Window extends XPixelApi {
28
28
  }
29
29
  }
30
- export declare const XPixelOptions: import("valibot").ObjectSchema<{
31
- id: import("valibot").StringSchema<string>;
32
- version: import("valibot").OptionalSchema<import("valibot").StringSchema<string>, undefined, string | undefined>;
33
- }, undefined, {
34
- id: string;
35
- version?: string | undefined;
36
- }>;
30
+ export declare const XPixelOptions: any;
37
31
  export type XPixelInput = RegistryScriptInput<typeof XPixelOptions>;
38
- export declare function useScriptXPixel<T extends XPixelApi>(_options?: XPixelInput): any;
32
+ export declare function useScriptXPixel<T extends XPixelApi>(_options?: XPixelInput): T & {
33
+ $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
34
+ };
39
35
  export {};
@@ -1,5 +1,5 @@
1
- import { object, optional, string } from "valibot";
2
1
  import { registryScript } from "../utils.mjs";
2
+ import { object, optional, string } from "#nuxt-scripts-validator";
3
3
  export const XPixelOptions = object({
4
4
  id: string(),
5
5
  version: optional(string())
@@ -9,7 +9,7 @@ export function useScriptXPixel(_options) {
9
9
  scriptInput: {
10
10
  src: "https://static.ads-twitter.com/uwt.js"
11
11
  },
12
- schema: XPixelOptions,
12
+ schema: import.meta.dev ? XPixelOptions : void 0,
13
13
  scriptOptions: {
14
14
  use() {
15
15
  return { twq: window.twq };
@@ -1,4 +1,4 @@
1
- import type YT from '@types/youtube';
1
+ /// <reference types="youtube" />
2
2
  import type { RegistryScriptInput } from '#nuxt-scripts';
3
3
  export interface YouTubeIframeApi {
4
4
  YT: typeof YT;
@@ -8,6 +8,8 @@ declare global {
8
8
  onYouTubeIframeAPIReady: () => void;
9
9
  }
10
10
  }
11
- export declare const YouTubeIframeOptions: import("valibot").ObjectSchema<{}, undefined, {}>;
11
+ export declare const YouTubeIframeOptions: any;
12
12
  export type YouTubeIFrameInput = RegistryScriptInput<typeof YouTubeIframeOptions>;
13
- export declare function useScriptYouTubeIframe<T extends YouTubeIframeApi>(_options: YouTubeIFrameInput): any;
13
+ export declare function useScriptYouTubeIframe<T extends YouTubeIframeApi>(_options: YouTubeIFrameInput): T & {
14
+ $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
15
+ };
@@ -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
  import { useHead } from "#imports";
4
4
  export const YouTubeIframeOptions = object({
5
5
  // no options afaik
@@ -13,7 +13,7 @@ export function useScriptYouTubeIframe(_options) {
13
13
  // @ts-expect-error TODO add types
14
14
  crossorigin: null
15
15
  },
16
- schema: YouTubeIframeOptions,
16
+ schema: import.meta.dev ? YouTubeIframeOptions : void 0,
17
17
  scriptOptions: {
18
18
  use() {
19
19
  return {
@@ -9,14 +9,13 @@ import type { FacebookPixelInput } from './registry/facebook-pixel';
9
9
  import type { FathomAnalyticsInput } from './registry/fathom-analytics';
10
10
  import type { HotjarInput } from './registry/hotjar';
11
11
  import type { IntercomInput } from './registry/intercom';
12
- import type { ConfettiInput } from './registry/confetti';
13
- import type { GoogleAnalyticsInput } from '~/src/runtime/registry/google-analytics';
14
- import type { GoogleMapsInput } from '~/src/runtime/registry/google-maps';
15
- import type { GoogleTagManagerInput } from '~/src/runtime/registry/google-tag-manager';
16
- import type { MatomoAnalyticsInput } from '~/src/runtime/registry/matomo-analytics';
17
- import type { StripeInput } from '~/src/runtime/registry/stripe';
18
- import type { VimeoInput } from '~/src/runtime/registry/vimeo';
19
- import type { XPixelInput } from '~/src/runtime/registry/x-pixel';
12
+ import type { GoogleAnalyticsInput } from './registry/google-analytics';
13
+ import type { GoogleMapsInput } from './registry/google-maps';
14
+ import type { GoogleTagManagerInput } from './registry/google-tag-manager';
15
+ import type { MatomoAnalyticsInput } from './registry/matomo-analytics';
16
+ import type { StripeInput } from './registry/stripe';
17
+ import type { VimeoPlayerInput } from './registry/vimeo-player';
18
+ import type { XPixelInput } from './registry/x-pixel';
20
19
  export type NuxtUseScriptOptions<T = any> = Omit<UseScriptOptions<T>, 'trigger'> & {
21
20
  /**
22
21
  * The trigger to load the script:
@@ -40,7 +39,7 @@ export interface TrackedPage {
40
39
  title?: string;
41
40
  path: string;
42
41
  }
43
- export interface ConsentPromiseOptions {
42
+ export interface ConsentScriptTriggerOptions {
44
43
  /**
45
44
  * An optional reactive (or promise) reference to the consent state. You can use this to accept the consent for scripts
46
45
  * instead of using the accept() method.
@@ -50,7 +49,7 @@ export interface ConsentPromiseOptions {
50
49
  * Should the script be loaded on the `requestIdleCallback` callback. This is useful for non-essential scripts that
51
50
  * have already been consented to be loaded.
52
51
  */
53
- loadOnNuxtReady?: boolean;
52
+ postConsentTrigger?: NuxtUseScriptOptions['trigger'];
54
53
  }
55
54
  export interface NuxtAppScript {
56
55
  key: string;
@@ -68,7 +67,6 @@ export interface NuxtAppScript {
68
67
  export type ScriptRegistryEntry<T> = true | T | [T, NuxtUseScriptOptions<T>];
69
68
  export interface ScriptRegistry {
70
69
  cloudflareWebAnalytics?: ScriptRegistryEntry<CloudflareWebAnalyticsInput>;
71
- confetti?: ScriptRegistryEntry<ConfettiInput>;
72
70
  facebookPixel?: ScriptRegistryEntry<FacebookPixelInput>;
73
71
  fathomAnalytics?: ScriptRegistryEntry<FathomAnalyticsInput>;
74
72
  googleAnalytics?: ScriptRegistryEntry<GoogleAnalyticsInput>;
@@ -79,7 +77,7 @@ export interface ScriptRegistry {
79
77
  matomoAnalytics?: ScriptRegistryEntry<MatomoAnalyticsInput>;
80
78
  segment?: ScriptRegistryEntry<SegmentInput>;
81
79
  stripe?: ScriptRegistryEntry<StripeInput>;
82
- vimeo?: ScriptRegistryEntry<VimeoInput>;
80
+ vimeo?: ScriptRegistryEntry<VimeoPlayerInput>;
83
81
  xPixel?: ScriptRegistryEntry<XPixelInput>;
84
82
  }
85
83
  export type RegistryScriptInput<T extends ObjectSchema<any>, Bundelable extends boolean = true> = Input<T> & {
@@ -1,12 +1,13 @@
1
1
  import type { Input, ObjectSchema } from 'valibot';
2
2
  import type { UseScriptInput } from '@unhead/vue';
3
3
  import type { NuxtUseScriptOptions, RegistryScriptInput } from '#nuxt-scripts';
4
- export declare function mockFallbackScript(name: string, module: string): any;
5
4
  type OptionsFn<O extends ObjectSchema<any>> = (options: Input<O>) => ({
6
5
  scriptInput?: UseScriptInput;
7
6
  scriptOptions?: NuxtUseScriptOptions;
8
7
  schema?: O;
9
8
  clientInit?: () => void;
10
9
  });
11
- export declare function registryScript<T extends Record<string | symbol, any>, O extends ObjectSchema<any>>(key: string, optionsFn: OptionsFn<O>, _userOptions?: RegistryScriptInput<O>): any;
10
+ export declare function registryScript<T extends Record<string | symbol, any>, O extends ObjectSchema<any>>(key: string, optionsFn: OptionsFn<O>, _userOptions?: RegistryScriptInput<O>): T & {
11
+ $script: Promise<T> & import("@unhead/vue").VueScriptInstance<T>;
12
+ };
12
13
  export {};