@nuxt/scripts 0.11.4 → 0.11.6

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 (50) hide show
  1. package/dist/client/200.html +9 -9
  2. package/dist/client/404.html +9 -9
  3. package/dist/client/_nuxt/{Bo1SWr6k.js → C347yIJI.js} +1 -1
  4. package/dist/client/_nuxt/DhL_UpCd.js +1 -0
  5. package/dist/client/_nuxt/Di440A2l.js +1 -0
  6. package/dist/client/_nuxt/V79VpDdr.js +21 -0
  7. package/dist/client/_nuxt/builds/latest.json +1 -1
  8. package/dist/client/_nuxt/builds/meta/3e09fd1b-e587-4ed5-a851-8fd373eda48a.json +1 -0
  9. package/dist/client/_nuxt/{entry.CJckMUzn.css → entry.B4DN0kwM.css} +1 -1
  10. package/dist/client/_nuxt/error-404.BtCtaqmq.css +1 -0
  11. package/dist/client/_nuxt/error-500.D9fi60uT.css +1 -0
  12. package/dist/client/index.html +9 -9
  13. package/dist/module.json +3 -3
  14. package/dist/registry.mjs +18 -0
  15. package/dist/runtime/components/ScriptAriaLoadingIndicator.vue.d.ts +2 -0
  16. package/dist/runtime/components/ScriptCarbonAds.vue +41 -57
  17. package/dist/runtime/components/ScriptCarbonAds.vue.d.ts +49 -0
  18. package/dist/runtime/components/ScriptCrisp.vue +43 -63
  19. package/dist/runtime/components/ScriptCrisp.vue.d.ts +65 -0
  20. package/dist/runtime/components/ScriptGoogleAdsense.vue +37 -60
  21. package/dist/runtime/components/ScriptGoogleAdsense.vue.d.ts +59 -0
  22. package/dist/runtime/components/ScriptGoogleMaps.vue +220 -365
  23. package/dist/runtime/components/ScriptGoogleMaps.vue.d.ts +215 -0
  24. package/dist/runtime/components/ScriptIntercom.vue +48 -67
  25. package/dist/runtime/components/ScriptIntercom.vue.d.ts +70 -0
  26. package/dist/runtime/components/ScriptLemonSqueezy.vue +26 -37
  27. package/dist/runtime/components/ScriptLemonSqueezy.vue.d.ts +41 -0
  28. package/dist/runtime/components/ScriptLoadingIndicator.vue +8 -13
  29. package/dist/runtime/components/ScriptLoadingIndicator.vue.d.ts +9 -0
  30. package/dist/runtime/components/ScriptStripePricingTable.vue +41 -53
  31. package/dist/runtime/components/ScriptStripePricingTable.vue.d.ts +56 -0
  32. package/dist/runtime/components/ScriptVimeoPlayer.vue +121 -218
  33. package/dist/runtime/components/ScriptVimeoPlayer.vue.d.ts +233 -0
  34. package/dist/runtime/components/ScriptYouTubePlayer.vue +105 -163
  35. package/dist/runtime/components/ScriptYouTubePlayer.vue.d.ts +133 -0
  36. package/dist/runtime/registry/clarity.d.ts +1 -1
  37. package/dist/runtime/registry/clarity.js +7 -1
  38. package/dist/runtime/registry/snapchat-pixel.js +1 -1
  39. package/dist/types.d.mts +2 -2
  40. package/package.json +39 -34
  41. package/dist/client/_nuxt/BojlM8av.js +0 -21
  42. package/dist/client/_nuxt/BwFnCI0m.js +0 -1
  43. package/dist/client/_nuxt/builds/meta/d0cfdf7f-f013-4561-b983-7ab31692811a.json +0 -1
  44. package/dist/client/_nuxt/error-404.BiTeRF3j.css +0 -1
  45. package/dist/client/_nuxt/error-500.Be1AE5oK.css +0 -1
  46. package/dist/client/_nuxt/yRslIvSb.js +0 -1
  47. package/dist/module.cjs +0 -5
  48. package/dist/module.d.ts +0 -60
  49. package/dist/registry.d.ts +0 -6
  50. package/dist/types.d.ts +0 -7
@@ -0,0 +1,133 @@
1
+ import type { HTMLAttributes, ImgHTMLAttributes, Ref } from 'vue';
2
+ import type { ElementScriptTrigger } from '../types.js';
3
+ import ScriptAriaLoadingIndicator from './ScriptAriaLoadingIndicator.vue.js';
4
+ export type YoutubeThumbnailSize = '1' | '2' | '3' | 'default' | 'mq1' | 'mq2' | 'mq3' | 'mqdefault' | '0' | 'hq1' | 'hq2' | 'hq3' | 'hqdefault' | 'sd1' | 'sd2' | 'sd3' | 'sddefault' | 'hq720' | 'maxresdefault';
5
+ type __VLS_Props = {
6
+ placeholderAttrs?: ImgHTMLAttributes;
7
+ rootAttrs?: HTMLAttributes;
8
+ aboveTheFold?: boolean;
9
+ trigger?: ElementScriptTrigger;
10
+ videoId: string;
11
+ playerVars?: YT.PlayerVars;
12
+ width?: number;
13
+ height?: number;
14
+ /**
15
+ * Whether to use youtube-nocookie.com for embedding.
16
+ *
17
+ * @default false
18
+ */
19
+ cookies?: boolean;
20
+ playerOptions?: YT.PlayerOptions;
21
+ thumbnailSize?: YoutubeThumbnailSize;
22
+ webp?: boolean;
23
+ };
24
+ declare const rootEl: Ref<any, any>;
25
+ declare const youtubeEl: Ref<any, any>;
26
+ declare const ready: Ref<boolean, boolean>;
27
+ declare const status: Ref<import("@unhead/vue").UseScriptStatus, import("@unhead/vue").UseScriptStatus>;
28
+ declare const rootAttrs: import("vue").ComputedRef<HTMLAttributes>;
29
+ declare const placeholder: import("vue").ComputedRef<string>;
30
+ declare const placeholderAttrs: import("vue").ComputedRef<Omit<ImgHTMLAttributes, "style" | "src" | "loading" | "onLoad" | "alt"> & Omit<{
31
+ src: string;
32
+ alt: string;
33
+ loading: "eager" | "lazy";
34
+ style: {
35
+ width: string;
36
+ objectFit: "contain";
37
+ height: string;
38
+ };
39
+ onLoad(payload: Event): void;
40
+ }, "style" | "src" | "loading" | "onLoad" | "alt"> & {
41
+ style: string | false | import("vue").StyleValue[] | {
42
+ width: string;
43
+ objectFit: "contain";
44
+ height: string;
45
+ } | (Omit<import("vue").CSSProperties, "width" | "height" | "objectFit"> & Omit<{
46
+ width: string;
47
+ objectFit: "contain";
48
+ height: string;
49
+ }, "width" | "height" | "objectFit"> & {
50
+ width: string | number | (string & {});
51
+ height: string | number | (string & {});
52
+ objectFit: "fill" | "none" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "contain" | "cover" | "scale-down";
53
+ });
54
+ src: string;
55
+ loading: "eager" | "lazy";
56
+ onLoad: ((payload: Event) => void) | ((payload: Event) => void);
57
+ alt: string;
58
+ }>;
59
+ declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
60
+ declare var __VLS_1: {
61
+ placeholder: any;
62
+ }, __VLS_3: {}, __VLS_8: {}, __VLS_10: {}, __VLS_12: {};
63
+ type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
64
+ placeholder?: (props: typeof __VLS_1) => any;
65
+ } & {
66
+ loading?: (props: typeof __VLS_3) => any;
67
+ } & {
68
+ awaitingLoad?: (props: typeof __VLS_8) => any;
69
+ } & {
70
+ error?: (props: typeof __VLS_10) => any;
71
+ } & {
72
+ default?: (props: typeof __VLS_12) => any;
73
+ }>;
74
+ declare const __VLS_self: import("vue").DefineComponent<__VLS_Props, {
75
+ ScriptAriaLoadingIndicator: typeof ScriptAriaLoadingIndicator;
76
+ rootEl: typeof rootEl;
77
+ youtubeEl: typeof youtubeEl;
78
+ ready: typeof ready;
79
+ status: typeof status;
80
+ rootAttrs: typeof rootAttrs;
81
+ placeholder: typeof placeholder;
82
+ placeholderAttrs: typeof placeholderAttrs;
83
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
84
+ error: (e: YT.OnErrorEvent, target: YT.Player) => any;
85
+ ready: (e: YT.PlayerEvent) => any;
86
+ "state-change": (e: YT.OnStateChangeEvent, target: YT.Player) => any;
87
+ "playback-quality-change": (e: YT.OnPlaybackQualityChangeEvent, target: YT.Player) => any;
88
+ "playback-rate-change": (e: YT.OnPlaybackRateChangeEvent, target: YT.Player) => any;
89
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
90
+ onError?: ((e: YT.OnErrorEvent, target: YT.Player) => any) | undefined;
91
+ onReady?: ((e: YT.PlayerEvent) => any) | undefined;
92
+ "onState-change"?: ((e: YT.OnStateChangeEvent, target: YT.Player) => any) | undefined;
93
+ "onPlayback-quality-change"?: ((e: YT.OnPlaybackQualityChangeEvent, target: YT.Player) => any) | undefined;
94
+ "onPlayback-rate-change"?: ((e: YT.OnPlaybackRateChangeEvent, target: YT.Player) => any) | undefined;
95
+ }>, {
96
+ trigger: ElementScriptTrigger;
97
+ width: number;
98
+ height: number;
99
+ playerVars: YT.PlayerVars;
100
+ cookies: boolean;
101
+ thumbnailSize: YoutubeThumbnailSize;
102
+ webp: boolean;
103
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
104
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
105
+ player: Ref<YT.Player | undefined, YT.Player | undefined>;
106
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
107
+ error: (e: YT.OnErrorEvent, target: YT.Player) => any;
108
+ ready: (e: YT.PlayerEvent) => any;
109
+ "state-change": (e: YT.OnStateChangeEvent, target: YT.Player) => any;
110
+ "playback-quality-change": (e: YT.OnPlaybackQualityChangeEvent, target: YT.Player) => any;
111
+ "playback-rate-change": (e: YT.OnPlaybackRateChangeEvent, target: YT.Player) => any;
112
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
113
+ onError?: ((e: YT.OnErrorEvent, target: YT.Player) => any) | undefined;
114
+ onReady?: ((e: YT.PlayerEvent) => any) | undefined;
115
+ "onState-change"?: ((e: YT.OnStateChangeEvent, target: YT.Player) => any) | undefined;
116
+ "onPlayback-quality-change"?: ((e: YT.OnPlaybackQualityChangeEvent, target: YT.Player) => any) | undefined;
117
+ "onPlayback-rate-change"?: ((e: YT.OnPlaybackRateChangeEvent, target: YT.Player) => any) | undefined;
118
+ }>, {
119
+ trigger: ElementScriptTrigger;
120
+ width: number;
121
+ height: number;
122
+ playerVars: YT.PlayerVars;
123
+ cookies: boolean;
124
+ thumbnailSize: YoutubeThumbnailSize;
125
+ webp: boolean;
126
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
127
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
128
+ export default _default;
129
+ type __VLS_WithSlots<T, S> = T & {
130
+ new (): {
131
+ $slots: S;
132
+ };
133
+ };
@@ -11,7 +11,7 @@ type ClarityFunctions = ((fn: 'start', options: {
11
11
  session: string;
12
12
  page: string;
13
13
  userHint: string;
14
- }>) & ((fn: 'consent') => void) & ((fn: 'set', key: any, value: any) => void) & ((fn: 'event', value: any) => void) & ((fn: 'upgrade', upgradeReason: any) => void) & ((fn: string, ...args: any[]) => void);
14
+ }>) & ((fn: 'consent', enabled?: boolean) => void) & ((fn: 'set', key: any, value: any) => void) & ((fn: 'event', value: any) => void) & ((fn: 'upgrade', upgradeReason: any) => void) & ((fn: string, ...args: any[]) => void);
15
15
  export interface ClarityApi {
16
16
  clarity: ClarityFunctions & {
17
17
  q: any[];
@@ -16,7 +16,13 @@ export function useScriptClarity(_options) {
16
16
  schema: import.meta.dev ? ClarityOptions : void 0,
17
17
  scriptOptions: {
18
18
  use() {
19
- return { clarity: window.clarity };
19
+ return {
20
+ // @ts-expect-error untyped
21
+ clarity: Object.assign(function(...params) {
22
+ const clarity = window.clarity;
23
+ return clarity.apply(this, params);
24
+ }, window.clarity)
25
+ };
20
26
  }
21
27
  },
22
28
  clientInit: import.meta.server ? void 0 : () => {
@@ -17,7 +17,7 @@ export const InitObjectPropertiesSchema = object({
17
17
  export const SnapTrPixelOptions = object({
18
18
  id: string(),
19
19
  trackPageView: optional(boolean()),
20
- ...InitObjectPropertiesSchema.entries
20
+ ...InitObjectPropertiesSchema?.entries || {}
21
21
  });
22
22
  export function useScriptSnapchatPixel(_options) {
23
23
  return useRegistryScript("snapchatPixel", (options) => ({
package/dist/types.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import type { ModuleHooks } from './module.js'
1
+ import type { ModuleHooks } from './module.mjs'
2
2
 
3
3
  declare module '@nuxt/schema' {
4
4
  interface NuxtHooks extends ModuleHooks {}
5
5
  }
6
6
 
7
- export { type ModuleHooks, type ModuleOptions, default } from './module.js'
7
+ export { type ModuleHooks, type ModuleOptions, default } from './module.mjs'
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nuxt/scripts",
3
3
  "type": "module",
4
- "version": "0.11.4",
4
+ "version": "0.11.6",
5
5
  "description": "Load third-party scripts with better performance, privacy and DX in Nuxt Apps.",
6
6
  "author": {
7
7
  "website": "https://harlanzw.com",
@@ -19,20 +19,25 @@
19
19
  "sideEffects": false,
20
20
  "exports": {
21
21
  ".": {
22
- "types": "./dist/types.d.ts",
23
- "import": "./dist/module.mjs",
24
- "require": "./dist/module.cjs"
22
+ "types": "./dist/types.d.mts",
23
+ "import": "./dist/module.mjs"
25
24
  },
26
- "./registry": {
27
- "types": "./dist/registry.d.ts",
28
- "import": "./dist/registry.mjs"
29
- }
25
+ "./registry": "./dist/registry.mjs"
30
26
  },
31
- "main": "./dist/module.cjs",
32
- "types": "./dist/types.d.ts",
27
+ "main": "./dist/module.mjs",
33
28
  "files": [
34
29
  "dist"
35
30
  ],
31
+ "typesVersions": {
32
+ "*": {
33
+ ".": [
34
+ "./dist/types.d.mts"
35
+ ],
36
+ "registry": [
37
+ "./dist/registry.d.mts"
38
+ ]
39
+ }
40
+ },
36
41
  "build": {
37
42
  "externals": [
38
43
  "@unhead/vue",
@@ -49,12 +54,12 @@
49
54
  ]
50
55
  },
51
56
  "peerDependencies": {
52
- "@stripe/stripe-js": "^5.10.0",
57
+ "@stripe/stripe-js": "^7.0.0",
53
58
  "@types/google.maps": "^3.58.1",
54
59
  "@types/vimeo__player": "^2.18.3",
55
60
  "@types/youtube": "^0.1.0",
56
- "@unhead/vue": "^2.0.0-rc.8",
57
- "nuxt": "^3.16.0"
61
+ "@unhead/vue": "^2.0.3",
62
+ "nuxt": "^3.16.2"
58
63
  },
59
64
  "peerDependenciesMeta": {
60
65
  "@stripe/stripe-js": {
@@ -71,8 +76,8 @@
71
76
  }
72
77
  },
73
78
  "dependencies": {
74
- "@nuxt/kit": "^3.16.1",
75
- "@vueuse/core": "^13.0.0",
79
+ "@nuxt/kit": "^3.16.2",
80
+ "@vueuse/core": "^13.1.0",
76
81
  "consola": "^3.4.2",
77
82
  "defu": "^6.1.4",
78
83
  "h3": "^1.15.1",
@@ -82,44 +87,44 @@
82
87
  "pathe": "^2.0.3",
83
88
  "pkg-types": "^2.1.0",
84
89
  "sirv": "^3.0.1",
85
- "std-env": "^3.8.1",
86
- "ufo": "^1.5.4",
87
- "unplugin": "^2.2.2",
90
+ "std-env": "^3.9.0",
91
+ "ufo": "^1.6.1",
92
+ "unplugin": "^2.3.2",
88
93
  "unstorage": "^1.15.0",
89
94
  "valibot": "^1.0.0"
90
95
  },
91
96
  "devDependencies": {
92
- "@nuxt/devtools-kit": "^2.3.1",
93
- "@nuxt/devtools-ui-kit": "^2.3.1",
94
- "@nuxt/eslint-config": "^1.2.0",
95
- "@nuxt/module-builder": "^0.8.4",
97
+ "@nuxt/devtools-kit": "^2.4.0",
98
+ "@nuxt/devtools-ui-kit": "^2.4.0",
99
+ "@nuxt/eslint-config": "^1.3.0",
100
+ "@nuxt/module-builder": "^1.0.1",
96
101
  "@nuxt/test-utils": "3.17.2",
97
- "@types/semver": "^7.5.8",
98
- "@typescript-eslint/typescript-estree": "^8.28.0",
102
+ "@types/semver": "^7.7.0",
103
+ "@typescript-eslint/typescript-estree": "^8.30.1",
99
104
  "acorn-loose": "^8.4.0",
100
105
  "bumpp": "^10.1.0",
101
106
  "changelogen": "^0.6.1",
102
- "eslint": "9.23.0",
103
- "eslint-plugin-n": "^17.16.2",
107
+ "eslint": "9.24.0",
108
+ "eslint-plugin-n": "^17.17.0",
104
109
  "happy-dom": "^17.4.4",
105
110
  "knitwork": "^1.2.0",
106
- "nuxt": "^3.16.1",
111
+ "nuxt": "^3.16.2",
107
112
  "playwright-core": "^1.51.1",
108
113
  "shiki": "2.5.0",
109
114
  "typescript": "5.8.2",
110
- "vitest": "^3.0.9",
115
+ "vitest": "^3.1.1",
111
116
  "vue": "^3.5.13",
112
117
  "vue-router": "^4.5.0",
113
118
  "vue-tsc": "^2.2.8",
114
- "@nuxt/scripts": "0.11.4"
119
+ "@nuxt/scripts": "0.11.6"
115
120
  },
116
121
  "resolutions": {
117
122
  "@nuxt/schema": "catalog:",
118
123
  "@nuxt/scripts": "workspace:*",
119
- "@unhead/vue": "2.0.1",
120
- "unhead": "2.0.1",
121
- "nuxt": "catalog:",
122
- "typescript": "5.8.2",
124
+ "@unhead/vue": "^2.0.5",
125
+ "nuxt": "^3.16.2",
126
+ "typescript": "^5.8.3",
127
+ "unhead": "^2.0.5",
123
128
  "vue": "^3.5.13",
124
129
  "vue-router": "^4.5.0"
125
130
  },
@@ -132,7 +137,7 @@
132
137
  "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
133
138
  "typecheck": "vue-tsc --noEmit",
134
139
  "bump": "bumpp package.json --commit --push --tag",
135
- "release": "pnpm build && pnpm bump && pnpm publish --tag latest -r --no-git-checks",
140
+ "release": "pnpm build && bumpp -x \"npx changelogen --output=CHANGELOG.log\" && pnpm publish",
136
141
  "lint": "eslint .",
137
142
  "lint:fix": "eslint . --fix",
138
143
  "test": "pnpm dev:prepare && vitest --run --exclude **/__runtime__ && pnpm test:runtime",