@nuxt/scripts 0.11.6 → 0.11.7

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 (33) hide show
  1. package/README.md +1 -1
  2. package/dist/client/200.html +9 -9
  3. package/dist/client/404.html +9 -9
  4. package/dist/client/_nuxt/{DhL_UpCd.js → D3ZVEC_8.js} +1 -1
  5. package/dist/client/_nuxt/DmiqYg4r.js +21 -0
  6. package/dist/client/_nuxt/{Di440A2l.js → _5UZfQdF.js} +1 -1
  7. package/dist/client/_nuxt/builds/latest.json +1 -1
  8. package/dist/client/_nuxt/builds/meta/93bac187-07c5-4a76-83a2-cefcf05c0b88.json +1 -0
  9. package/dist/client/_nuxt/error-404.CpID9NZX.css +1 -0
  10. package/dist/client/_nuxt/error-500.BzWA0Bp3.css +1 -0
  11. package/dist/client/_nuxt/{C347yIJI.js → z8Iwlb2L.js} +1 -1
  12. package/dist/client/index.html +9 -9
  13. package/dist/module.json +1 -1
  14. package/dist/registry.mjs +9 -0
  15. package/dist/runtime/components/ScriptCarbonAds.vue.d.ts +2 -19
  16. package/dist/runtime/components/ScriptCrisp.vue.d.ts +2 -23
  17. package/dist/runtime/components/ScriptGoogleAdsense.vue.d.ts +2 -24
  18. package/dist/runtime/components/ScriptGoogleMaps.vue +1 -1
  19. package/dist/runtime/components/ScriptGoogleMaps.vue.d.ts +2 -73
  20. package/dist/runtime/components/ScriptIntercom.vue.d.ts +2 -27
  21. package/dist/runtime/components/ScriptLemonSqueezy.vue.d.ts +2 -19
  22. package/dist/runtime/components/ScriptStripePricingTable.vue.d.ts +2 -23
  23. package/dist/runtime/components/ScriptVimeoPlayer.vue.d.ts +2 -108
  24. package/dist/runtime/components/ScriptYouTubePlayer.vue.d.ts +2 -69
  25. package/dist/runtime/registry/rybbit-analytics.d.ts +20 -0
  26. package/dist/runtime/registry/rybbit-analytics.js +32 -0
  27. package/dist/runtime/types.d.ts +2 -0
  28. package/package.json +31 -31
  29. package/dist/client/_nuxt/V79VpDdr.js +0 -21
  30. package/dist/client/_nuxt/builds/meta/3e09fd1b-e587-4ed5-a851-8fd373eda48a.json +0 -1
  31. package/dist/client/_nuxt/error-404.BtCtaqmq.css +0 -1
  32. package/dist/client/_nuxt/error-500.D9fi60uT.css +0 -1
  33. /package/dist/client/_nuxt/{entry.B4DN0kwM.css → entry.DExDtQtx.css} +0 -0
@@ -1,6 +1,5 @@
1
1
  import type { HTMLAttributes, ImgHTMLAttributes, Ref } from 'vue';
2
2
  import type { ElementScriptTrigger } from '../types.js';
3
- import ScriptAriaLoadingIndicator from './ScriptAriaLoadingIndicator.vue.js';
4
3
  export type YoutubeThumbnailSize = '1' | '2' | '3' | 'default' | 'mq1' | 'mq2' | 'mq3' | 'mqdefault' | '0' | 'hq1' | 'hq2' | 'hq3' | 'hqdefault' | 'sd1' | 'sd2' | 'sd3' | 'sddefault' | 'hq720' | 'maxresdefault';
5
4
  type __VLS_Props = {
6
5
  placeholderAttrs?: ImgHTMLAttributes;
@@ -21,46 +20,10 @@ type __VLS_Props = {
21
20
  thumbnailSize?: YoutubeThumbnailSize;
22
21
  webp?: boolean;
23
22
  };
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
23
  declare var __VLS_1: {
61
24
  placeholder: any;
62
25
  }, __VLS_3: {}, __VLS_8: {}, __VLS_10: {}, __VLS_12: {};
63
- type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
26
+ type __VLS_Slots = {} & {
64
27
  placeholder?: (props: typeof __VLS_1) => any;
65
28
  } & {
66
29
  loading?: (props: typeof __VLS_3) => any;
@@ -70,37 +33,7 @@ type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$
70
33
  error?: (props: typeof __VLS_10) => any;
71
34
  } & {
72
35
  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>;
36
+ };
104
37
  declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
105
38
  player: Ref<YT.Player | undefined, YT.Player | undefined>;
106
39
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -0,0 +1,20 @@
1
+ import type { RegistryScriptInput } from '#nuxt-scripts/types';
2
+ export declare const RybbitAnalyticsOptions: import("valibot").ObjectSchema<{
3
+ readonly siteId: import("valibot").StringSchema<undefined>;
4
+ readonly trackSpa: import("valibot").OptionalSchema<import("valibot").BooleanSchema<undefined>, undefined>;
5
+ readonly trackQuery: import("valibot").OptionalSchema<import("valibot").BooleanSchema<undefined>, undefined>;
6
+ readonly skipPatterns: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").StringSchema<undefined>, undefined>, undefined>;
7
+ readonly maskPatterns: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").StringSchema<undefined>, undefined>, undefined>;
8
+ readonly debounce: import("valibot").OptionalSchema<import("valibot").NumberSchema<undefined>, undefined>;
9
+ }, undefined>;
10
+ export type RybbitAnalyticsInput = RegistryScriptInput<typeof RybbitAnalyticsOptions, false>;
11
+ export interface RybbitAnalyticsApi {
12
+ pageview: () => void;
13
+ event: (eventName: string, properties?: Record<string, any>) => void;
14
+ }
15
+ declare global {
16
+ interface Window {
17
+ rybbit: RybbitAnalyticsApi;
18
+ }
19
+ }
20
+ export declare function useScriptRybbitAnalytics<T extends RybbitAnalyticsApi>(_options?: RybbitAnalyticsInput): import("#nuxt-scripts/types").UseScriptContext<T>;
@@ -0,0 +1,32 @@
1
+ import { useRegistryScript } from "../utils.js";
2
+ import { array, boolean, number, object, optional, string } from "#nuxt-scripts-validator";
3
+ export const RybbitAnalyticsOptions = object({
4
+ siteId: string(),
5
+ // required
6
+ trackSpa: optional(boolean()),
7
+ trackQuery: optional(boolean()),
8
+ skipPatterns: optional(array(string())),
9
+ maskPatterns: optional(array(string())),
10
+ debounce: optional(number())
11
+ });
12
+ export function useScriptRybbitAnalytics(_options) {
13
+ return useRegistryScript("rybbitAnalytics", (options) => {
14
+ return {
15
+ scriptInput: {
16
+ "src": "https://app.rybbit.io/api/script.js",
17
+ "data-site-id": options?.siteId,
18
+ "data-track-spa": options?.trackSpa,
19
+ "data-track-query": options?.trackQuery,
20
+ "data-skip-patterns": options?.skipPatterns ? JSON.stringify(options.skipPatterns) : void 0,
21
+ "data-mask-patterns": options?.maskPatterns ? JSON.stringify(options.maskPatterns) : void 0,
22
+ "data-debounce": options?.debounce ? options.debounce.toString() : void 0
23
+ },
24
+ schema: import.meta.dev ? RybbitAnalyticsOptions : void 0,
25
+ scriptOptions: {
26
+ use() {
27
+ return { rybbit: window.rybbit };
28
+ }
29
+ }
30
+ };
31
+ }, _options);
32
+ }
@@ -25,6 +25,7 @@ import type { CrispInput } from './registry/crisp.js';
25
25
  import type { GoogleAnalyticsInput } from './registry/google-analytics.js';
26
26
  import type { GoogleTagManagerInput } from './registry/google-tag-manager.js';
27
27
  import type { UmamiAnalyticsInput } from './registry/umami-analytics.js';
28
+ import type { RybbitAnalyticsInput } from './registry/rybbit-analytics.js';
28
29
  export type WarmupStrategy = false | 'preload' | 'preconnect' | 'dns-prefetch';
29
30
  export type UseScriptContext<T extends Record<symbol | string, any>> = VueScriptInstance<T>;
30
31
  export type NuxtUseScriptOptions<T extends Record<symbol | string, any> = {}> = Omit<UseScriptOptions<T>, 'trigger'> & {
@@ -128,6 +129,7 @@ export interface ScriptRegistry {
128
129
  hotjar?: HotjarInput;
129
130
  intercom?: IntercomInput;
130
131
  matomoAnalytics?: MatomoAnalyticsInput;
132
+ rybbitAnalytics?: RybbitAnalyticsInput;
131
133
  segment?: SegmentInput;
132
134
  stripe?: StripeInput;
133
135
  xPixel?: XPixelInput;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nuxt/scripts",
3
3
  "type": "module",
4
- "version": "0.11.6",
4
+ "version": "0.11.7",
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",
@@ -76,11 +76,11 @@
76
76
  }
77
77
  },
78
78
  "dependencies": {
79
- "@nuxt/kit": "^3.16.2",
80
- "@vueuse/core": "^13.1.0",
79
+ "@nuxt/kit": "^3.17.3",
80
+ "@vueuse/core": "^13.2.0",
81
81
  "consola": "^3.4.2",
82
82
  "defu": "^6.1.4",
83
- "h3": "^1.15.1",
83
+ "h3": "^1.15.3",
84
84
  "magic-string": "^0.30.17",
85
85
  "ofetch": "^1.4.1",
86
86
  "ohash": "^2.0.11",
@@ -89,44 +89,44 @@
89
89
  "sirv": "^3.0.1",
90
90
  "std-env": "^3.9.0",
91
91
  "ufo": "^1.6.1",
92
- "unplugin": "^2.3.2",
93
- "unstorage": "^1.15.0",
94
- "valibot": "^1.0.0"
92
+ "unplugin": "^2.3.4",
93
+ "unstorage": "^1.16.0",
94
+ "valibot": "^1.1.0"
95
95
  },
96
96
  "devDependencies": {
97
- "@nuxt/devtools-kit": "^2.4.0",
98
- "@nuxt/devtools-ui-kit": "^2.4.0",
99
- "@nuxt/eslint-config": "^1.3.0",
97
+ "@nuxt/devtools-kit": "^2.4.1",
98
+ "@nuxt/devtools-ui-kit": "^2.4.1",
99
+ "@nuxt/eslint-config": "^1.4.0",
100
100
  "@nuxt/module-builder": "^1.0.1",
101
- "@nuxt/test-utils": "3.17.2",
101
+ "@nuxt/test-utils": "3.19.0",
102
102
  "@types/semver": "^7.7.0",
103
- "@typescript-eslint/typescript-estree": "^8.30.1",
104
- "acorn-loose": "^8.4.0",
105
- "bumpp": "^10.1.0",
103
+ "@typescript-eslint/typescript-estree": "^8.32.1",
104
+ "acorn-loose": "^8.5.0",
105
+ "bumpp": "^10.1.1",
106
106
  "changelogen": "^0.6.1",
107
- "eslint": "9.24.0",
108
- "eslint-plugin-n": "^17.17.0",
109
- "happy-dom": "^17.4.4",
107
+ "eslint": "9.27.0",
108
+ "eslint-plugin-n": "^17.18.0",
109
+ "happy-dom": "^17.4.7",
110
110
  "knitwork": "^1.2.0",
111
- "nuxt": "^3.16.2",
112
- "playwright-core": "^1.51.1",
113
- "shiki": "2.5.0",
111
+ "nuxt": "^3.17.3",
112
+ "playwright-core": "^1.52.0",
113
+ "shiki": "3.4.2",
114
114
  "typescript": "5.8.2",
115
- "vitest": "^3.1.1",
116
- "vue": "^3.5.13",
117
- "vue-router": "^4.5.0",
118
- "vue-tsc": "^2.2.8",
119
- "@nuxt/scripts": "0.11.6"
115
+ "vitest": "^3.1.3",
116
+ "vue": "^3.5.14",
117
+ "vue-router": "^4.5.1",
118
+ "vue-tsc": "^2.2.10",
119
+ "@nuxt/scripts": "0.11.7"
120
120
  },
121
121
  "resolutions": {
122
122
  "@nuxt/schema": "catalog:",
123
123
  "@nuxt/scripts": "workspace:*",
124
- "@unhead/vue": "^2.0.5",
125
- "nuxt": "^3.16.2",
124
+ "@unhead/vue": "^2.0.8",
125
+ "nuxt": "^3.17.3",
126
126
  "typescript": "^5.8.3",
127
- "unhead": "^2.0.5",
128
- "vue": "^3.5.13",
129
- "vue-router": "^4.5.0"
127
+ "unhead": "^2.0.8",
128
+ "vue": "^3.5.14",
129
+ "vue-router": "^4.5.1"
130
130
  },
131
131
  "scripts": {
132
132
  "build": "pnpm dev:prepare && pnpm prepack",
@@ -137,7 +137,7 @@
137
137
  "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
138
138
  "typecheck": "vue-tsc --noEmit",
139
139
  "bump": "bumpp package.json --commit --push --tag",
140
- "release": "pnpm build && bumpp -x \"npx changelogen --output=CHANGELOG.log\" && pnpm publish",
140
+ "release": "pnpm build && bumpp -x \"npx changelogen --output=CHANGELOG.md\" && pnpm publish",
141
141
  "lint": "eslint .",
142
142
  "lint:fix": "eslint . --fix",
143
143
  "test": "pnpm dev:prepare && vitest --run --exclude **/__runtime__ && pnpm test:runtime",