@nuxt/scripts 0.11.5 → 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 (54) 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/D3ZVEC_8.js +1 -0
  5. package/dist/client/_nuxt/DmiqYg4r.js +21 -0
  6. package/dist/client/_nuxt/_5UZfQdF.js +1 -0
  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/{entry.CJckMUzn.css → entry.DExDtQtx.css} +1 -1
  10. package/dist/client/_nuxt/error-404.CpID9NZX.css +1 -0
  11. package/dist/client/_nuxt/error-500.BzWA0Bp3.css +1 -0
  12. package/dist/client/_nuxt/{Bo1SWr6k.js → z8Iwlb2L.js} +1 -1
  13. package/dist/client/index.html +9 -9
  14. package/dist/module.json +3 -3
  15. package/dist/registry.mjs +27 -0
  16. package/dist/runtime/components/ScriptAriaLoadingIndicator.vue.d.ts +2 -0
  17. package/dist/runtime/components/ScriptCarbonAds.vue +41 -57
  18. package/dist/runtime/components/ScriptCarbonAds.vue.d.ts +32 -0
  19. package/dist/runtime/components/ScriptCrisp.vue +43 -63
  20. package/dist/runtime/components/ScriptCrisp.vue.d.ts +44 -0
  21. package/dist/runtime/components/ScriptGoogleAdsense.vue +37 -60
  22. package/dist/runtime/components/ScriptGoogleAdsense.vue.d.ts +37 -0
  23. package/dist/runtime/components/ScriptGoogleMaps.vue +220 -366
  24. package/dist/runtime/components/ScriptGoogleMaps.vue.d.ts +144 -0
  25. package/dist/runtime/components/ScriptIntercom.vue +48 -67
  26. package/dist/runtime/components/ScriptIntercom.vue.d.ts +45 -0
  27. package/dist/runtime/components/ScriptLemonSqueezy.vue +26 -37
  28. package/dist/runtime/components/ScriptLemonSqueezy.vue.d.ts +24 -0
  29. package/dist/runtime/components/ScriptLoadingIndicator.vue +8 -13
  30. package/dist/runtime/components/ScriptLoadingIndicator.vue.d.ts +9 -0
  31. package/dist/runtime/components/ScriptStripePricingTable.vue +41 -53
  32. package/dist/runtime/components/ScriptStripePricingTable.vue.d.ts +35 -0
  33. package/dist/runtime/components/ScriptVimeoPlayer.vue +121 -218
  34. package/dist/runtime/components/ScriptVimeoPlayer.vue.d.ts +127 -0
  35. package/dist/runtime/components/ScriptYouTubePlayer.vue +105 -163
  36. package/dist/runtime/components/ScriptYouTubePlayer.vue.d.ts +66 -0
  37. package/dist/runtime/registry/clarity.d.ts +1 -1
  38. package/dist/runtime/registry/clarity.js +7 -1
  39. package/dist/runtime/registry/rybbit-analytics.d.ts +20 -0
  40. package/dist/runtime/registry/rybbit-analytics.js +32 -0
  41. package/dist/runtime/registry/snapchat-pixel.js +1 -1
  42. package/dist/runtime/types.d.ts +2 -0
  43. package/dist/types.d.mts +2 -2
  44. package/package.json +53 -48
  45. package/dist/client/_nuxt/BojlM8av.js +0 -21
  46. package/dist/client/_nuxt/BwFnCI0m.js +0 -1
  47. package/dist/client/_nuxt/builds/meta/0bd5f801-ad22-4b04-821c-25f180195d78.json +0 -1
  48. package/dist/client/_nuxt/error-404.BiTeRF3j.css +0 -1
  49. package/dist/client/_nuxt/error-500.Be1AE5oK.css +0 -1
  50. package/dist/client/_nuxt/yRslIvSb.js +0 -1
  51. package/dist/module.cjs +0 -5
  52. package/dist/module.d.ts +0 -60
  53. package/dist/registry.d.ts +0 -6
  54. package/dist/types.d.ts +0 -7
@@ -1,202 +1,144 @@
1
- <script setup lang="ts">
2
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
3
- // @ts-nocheck
4
-
5
- /// <reference types="youtube" />
6
- import { computed, onMounted, ref, watch } from 'vue'
7
- import type { HTMLAttributes, ImgHTMLAttributes, Ref } from 'vue'
8
- import { defu } from 'defu'
9
- import { useHead } from 'nuxt/app'
10
- import type { ElementScriptTrigger } from '../types'
11
- import { useScriptTriggerElement } from '../composables/useScriptTriggerElement'
12
- import { useScriptYouTubePlayer } from '../registry/youtube-player'
13
- import ScriptAriaLoadingIndicator from './ScriptAriaLoadingIndicator.vue'
14
-
15
- export type YoutubeThumbnailSize =
16
- // 120x90
17
- '1' | '2' | '3' | 'default' |
18
- // 320x180
19
- 'mq1' | 'mq2' | 'mq3' | 'mqdefault' |
20
- // 480x360
21
- '0' | 'hq1' | 'hq2' | 'hq3' | 'hqdefault' |
22
- // 640x480
23
- 'sd1' | 'sd2' | 'sd3' | 'sddefault' |
24
- // 1280x720
25
- 'hq720' |
26
- // 1920x1080
27
- 'maxresdefault'
28
-
29
- const props = withDefaults(defineProps<{
30
- placeholderAttrs?: ImgHTMLAttributes
31
- rootAttrs?: HTMLAttributes
32
- aboveTheFold?: boolean
33
- trigger?: ElementScriptTrigger
34
- videoId: string
35
- playerVars?: YT.PlayerVars
36
- width?: number
37
- height?: number
38
- /**
39
- * Whether to use youtube-nocookie.com for embedding.
40
- *
41
- * @default false
42
- */
43
- cookies?: boolean
44
- playerOptions?: YT.PlayerOptions
45
- thumbnailSize?: YoutubeThumbnailSize
46
- webp?: boolean
47
- }>(), {
48
- cookies: false,
49
- trigger: 'mousedown',
50
- thumbnailSize: 'hq720',
51
- webp: true,
52
- // @ts-expect-error untyped
53
- playerVars: { autoplay: 0, playsinline: 1 },
54
- width: 640,
55
- height: 360,
56
- })
57
-
58
- const emits = defineEmits<{
59
- 'ready': [e: YT.PlayerEvent]
60
- 'state-change': [e: YT.OnStateChangeEvent, target: YT.Player]
61
- 'playback-quality-change': [e: YT.OnPlaybackQualityChangeEvent, target: YT.Player]
62
- 'playback-rate-change': [e: YT.OnPlaybackRateChangeEvent, target: YT.Player]
63
- 'error': [e: YT.OnErrorEvent, target: YT.Player]
64
- }>()
65
- const events: (keyof YT.Events)[] = [
66
- 'onReady',
67
- 'onStateChange',
68
- 'onPlaybackQualityChange',
69
- 'onPlaybackRateChange',
70
- 'onError',
71
- 'onApiChange',
72
- ]
73
- const rootEl = ref()
74
- const youtubeEl = ref()
75
- const ready = ref(false)
76
- const trigger = useScriptTriggerElement({ trigger: props.trigger, el: rootEl })
1
+ <script setup>
2
+ import { computed, onMounted, ref, watch } from "vue";
3
+ import { defu } from "defu";
4
+ import { useHead } from "nuxt/app";
5
+ import { useScriptTriggerElement } from "../composables/useScriptTriggerElement";
6
+ import { useScriptYouTubePlayer } from "../registry/youtube-player";
7
+ import ScriptAriaLoadingIndicator from "./ScriptAriaLoadingIndicator.vue";
8
+ const props = defineProps({
9
+ placeholderAttrs: { type: Object, required: false },
10
+ rootAttrs: { type: Object, required: false },
11
+ aboveTheFold: { type: Boolean, required: false },
12
+ trigger: { type: [String, Array, Boolean], required: false, default: "mousedown" },
13
+ videoId: { type: String, required: true },
14
+ playerVars: { type: null, required: false, default: { autoplay: 0, playsinline: 1 } },
15
+ width: { type: Number, required: false, default: 640 },
16
+ height: { type: Number, required: false, default: 360 },
17
+ cookies: { type: Boolean, required: false, default: false },
18
+ playerOptions: { type: null, required: false },
19
+ thumbnailSize: { type: String, required: false, default: "hq720" },
20
+ webp: { type: Boolean, required: false, default: true }
21
+ });
22
+ const emits = defineEmits(["ready", "state-change", "playback-quality-change", "playback-rate-change", "error"]);
23
+ const events = [
24
+ "onReady",
25
+ "onStateChange",
26
+ "onPlaybackQualityChange",
27
+ "onPlaybackRateChange",
28
+ "onError",
29
+ "onApiChange"
30
+ ];
31
+ const rootEl = ref();
32
+ const youtubeEl = ref();
33
+ const ready = ref(false);
34
+ const trigger = useScriptTriggerElement({ trigger: props.trigger, el: rootEl });
77
35
  const script = useScriptYouTubePlayer({
78
36
  scriptOptions: {
79
- trigger,
80
- },
81
- })
82
- const { onLoaded, status } = script
83
-
84
- const player: Ref<YT.Player | undefined> = ref()
85
- let clickTriggered = false
86
- if (props.trigger === 'mousedown' && trigger instanceof Promise) {
37
+ trigger
38
+ }
39
+ });
40
+ const { onLoaded, status } = script;
41
+ const player = ref();
42
+ let clickTriggered = false;
43
+ if (props.trigger === "mousedown" && trigger instanceof Promise) {
87
44
  trigger.then((triggered) => {
88
45
  if (triggered) {
89
- clickTriggered = true
46
+ clickTriggered = true;
90
47
  }
91
- })
48
+ });
92
49
  }
93
50
  onMounted(() => {
94
51
  onLoaded(async (instance) => {
95
- const YouTube = instance.YT instanceof Promise ? await instance.YT : instance.YT
96
- await new Promise<void>((resolve) => {
97
- if (typeof YT.Player === 'undefined')
98
- YouTube.ready(resolve)
52
+ const YouTube = instance.YT instanceof Promise ? await instance.YT : instance.YT;
53
+ await new Promise((resolve) => {
54
+ if (typeof YT.Player === "undefined")
55
+ YouTube.ready(resolve);
99
56
  else
100
- resolve()
101
- })
57
+ resolve();
58
+ });
102
59
  player.value = new YT.Player(youtubeEl.value, {
103
- host: !props.cookies ? 'https://www.youtube-nocookie.com' : 'https://www.youtube.com',
60
+ host: !props.cookies ? "https://www.youtube-nocookie.com" : "https://www.youtube.com",
104
61
  ...props,
105
62
  ...props.playerOptions,
106
- events: Object.fromEntries(events.map(event => [event, (e: any) => {
107
- const emitEventName = event.replace(/([A-Z])/g, '-$1').replace('on-', '').toLowerCase()
108
- // @ts-expect-error untyped
109
- emits(emitEventName, e)
110
- if (event === 'onReady') {
111
- ready.value = true
63
+ events: Object.fromEntries(events.map((event) => [event, (e) => {
64
+ const emitEventName = event.replace(/([A-Z])/g, "-$1").replace("on-", "").toLowerCase();
65
+ emits(emitEventName, e);
66
+ if (event === "onReady") {
67
+ ready.value = true;
112
68
  if (clickTriggered) {
113
- player.value?.playVideo()
114
- clickTriggered = false
69
+ player.value?.playVideo();
70
+ clickTriggered = false;
115
71
  }
116
72
  watch(() => props.videoId, () => {
117
- player.value?.loadVideoById(props.videoId)
118
- })
73
+ player.value?.loadVideoById(props.videoId);
74
+ });
119
75
  }
120
- }])),
121
- })
122
- })
123
- watch(status, (status) => {
124
- if (status === 'error') {
125
- // @ts-expect-error untyped
126
- emits('error')
76
+ }]))
77
+ });
78
+ });
79
+ watch(status, (status2) => {
80
+ if (status2 === "error") {
81
+ emits("error");
127
82
  }
128
- })
129
- })
130
-
83
+ });
84
+ });
131
85
  defineExpose({
132
- player,
133
- })
134
-
86
+ player
87
+ });
135
88
  const rootAttrs = computed(() => {
136
89
  return defu(props.rootAttrs, {
137
- 'aria-busy': status.value === 'loading',
138
- 'aria-label': status.value === 'awaitingLoad'
139
- ? 'YouTube Player - Placeholder'
140
- : status.value === 'loading'
141
- ? 'YouTube Player - Loading'
142
- : 'YouTube Player - Loaded',
143
- 'aria-live': 'polite',
144
- 'role': 'application',
145
- 'style': {
146
- cursor: 'pointer',
147
- position: 'relative',
148
- backgroundColor: 'black',
149
- width: '100%',
150
- aspectRatio: `${props.width}/${props.height}`,
90
+ "aria-busy": status.value === "loading",
91
+ "aria-label": status.value === "awaitingLoad" ? "YouTube Player - Placeholder" : status.value === "loading" ? "YouTube Player - Loading" : "YouTube Player - Loaded",
92
+ "aria-live": "polite",
93
+ "role": "application",
94
+ "style": {
95
+ cursor: "pointer",
96
+ position: "relative",
97
+ backgroundColor: "black",
98
+ width: "100%",
99
+ aspectRatio: `${props.width}/${props.height}`
151
100
  },
152
- ...(trigger instanceof Promise ? trigger.ssrAttrs || {} : {}),
153
- }) as HTMLAttributes
154
- })
155
-
156
- const fallbackPlaceHolder = computed(() => `https://i.ytimg.com/vi/${props.videoId}/hqdefault.jpg`)
157
- const placeholder = computed(() => `https://i.ytimg.com/${props.webp ? 'vi_webp' : 'vi'}/${props.videoId}/${props.thumbnailSize}.${props.webp ? 'webp' : 'jpg'}`)
158
- const isFallbackPlaceHolder = ref(false)
159
-
101
+ ...trigger instanceof Promise ? trigger.ssrAttrs || {} : {}
102
+ });
103
+ });
104
+ const fallbackPlaceHolder = computed(() => `https://i.ytimg.com/vi/${props.videoId}/hqdefault.jpg`);
105
+ const placeholder = computed(() => `https://i.ytimg.com/${props.webp ? "vi_webp" : "vi"}/${props.videoId}/${props.thumbnailSize}.${props.webp ? "webp" : "jpg"}`);
106
+ const isFallbackPlaceHolder = ref(false);
160
107
  if (import.meta.server) {
161
- // dns-prefetch https://i.vimeocdn.com
162
108
  useHead({
163
109
  link: [
164
110
  {
165
111
  key: `nuxt-script-youtube-img`,
166
- rel: props.aboveTheFold ? 'preconnect' : 'dns-prefetch',
167
- href: 'https://i.ytimg.com',
112
+ rel: props.aboveTheFold ? "preconnect" : "dns-prefetch",
113
+ href: "https://i.ytimg.com"
168
114
  },
169
- props.aboveTheFold
170
- // we can preload the placeholder image
171
- ? {
172
- key: `nuxt-script-youtube-img`,
173
- rel: 'preload',
174
- as: 'image',
175
- href: placeholder.value,
176
- }
177
- : {},
178
- ],
179
- })
115
+ props.aboveTheFold ? {
116
+ key: `nuxt-script-youtube-img`,
117
+ rel: "preload",
118
+ as: "image",
119
+ href: placeholder.value
120
+ } : {}
121
+ ]
122
+ });
180
123
  }
181
-
182
124
  const placeholderAttrs = computed(() => {
183
125
  return defu(props.placeholderAttrs, {
184
126
  src: isFallbackPlaceHolder.value ? fallbackPlaceHolder.value : placeholder.value,
185
- alt: '',
186
- loading: props.aboveTheFold ? 'eager' : 'lazy',
127
+ alt: "",
128
+ loading: props.aboveTheFold ? "eager" : "lazy",
187
129
  style: {
188
- width: '100%',
189
- objectFit: 'contain',
190
- height: '100%',
130
+ width: "100%",
131
+ objectFit: "contain",
132
+ height: "100%"
191
133
  },
192
134
  onLoad(payload) {
193
- const img = payload.target as HTMLImageElement
135
+ const img = payload.target;
194
136
  if (img.naturalWidth === 120 && img.naturalHeight === 90) {
195
- isFallbackPlaceHolder.value = true
137
+ isFallbackPlaceHolder.value = true;
196
138
  }
197
- },
198
- } satisfies ImgHTMLAttributes)
199
- })
139
+ }
140
+ });
141
+ });
200
142
  </script>
201
143
 
202
144
  <template>
@@ -0,0 +1,66 @@
1
+ import type { HTMLAttributes, ImgHTMLAttributes, Ref } from 'vue';
2
+ import type { ElementScriptTrigger } from '../types.js';
3
+ export type YoutubeThumbnailSize = '1' | '2' | '3' | 'default' | 'mq1' | 'mq2' | 'mq3' | 'mqdefault' | '0' | 'hq1' | 'hq2' | 'hq3' | 'hqdefault' | 'sd1' | 'sd2' | 'sd3' | 'sddefault' | 'hq720' | 'maxresdefault';
4
+ type __VLS_Props = {
5
+ placeholderAttrs?: ImgHTMLAttributes;
6
+ rootAttrs?: HTMLAttributes;
7
+ aboveTheFold?: boolean;
8
+ trigger?: ElementScriptTrigger;
9
+ videoId: string;
10
+ playerVars?: YT.PlayerVars;
11
+ width?: number;
12
+ height?: number;
13
+ /**
14
+ * Whether to use youtube-nocookie.com for embedding.
15
+ *
16
+ * @default false
17
+ */
18
+ cookies?: boolean;
19
+ playerOptions?: YT.PlayerOptions;
20
+ thumbnailSize?: YoutubeThumbnailSize;
21
+ webp?: boolean;
22
+ };
23
+ declare var __VLS_1: {
24
+ placeholder: any;
25
+ }, __VLS_3: {}, __VLS_8: {}, __VLS_10: {}, __VLS_12: {};
26
+ type __VLS_Slots = {} & {
27
+ placeholder?: (props: typeof __VLS_1) => any;
28
+ } & {
29
+ loading?: (props: typeof __VLS_3) => any;
30
+ } & {
31
+ awaitingLoad?: (props: typeof __VLS_8) => any;
32
+ } & {
33
+ error?: (props: typeof __VLS_10) => any;
34
+ } & {
35
+ default?: (props: typeof __VLS_12) => any;
36
+ };
37
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
38
+ player: Ref<YT.Player | undefined, YT.Player | undefined>;
39
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
40
+ error: (e: YT.OnErrorEvent, target: YT.Player) => any;
41
+ ready: (e: YT.PlayerEvent) => any;
42
+ "state-change": (e: YT.OnStateChangeEvent, target: YT.Player) => any;
43
+ "playback-quality-change": (e: YT.OnPlaybackQualityChangeEvent, target: YT.Player) => any;
44
+ "playback-rate-change": (e: YT.OnPlaybackRateChangeEvent, target: YT.Player) => any;
45
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
46
+ onError?: ((e: YT.OnErrorEvent, target: YT.Player) => any) | undefined;
47
+ onReady?: ((e: YT.PlayerEvent) => any) | undefined;
48
+ "onState-change"?: ((e: YT.OnStateChangeEvent, target: YT.Player) => any) | undefined;
49
+ "onPlayback-quality-change"?: ((e: YT.OnPlaybackQualityChangeEvent, target: YT.Player) => any) | undefined;
50
+ "onPlayback-rate-change"?: ((e: YT.OnPlaybackRateChangeEvent, target: YT.Player) => any) | undefined;
51
+ }>, {
52
+ trigger: ElementScriptTrigger;
53
+ width: number;
54
+ height: number;
55
+ playerVars: YT.PlayerVars;
56
+ cookies: boolean;
57
+ thumbnailSize: YoutubeThumbnailSize;
58
+ webp: boolean;
59
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
60
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
61
+ export default _default;
62
+ type __VLS_WithSlots<T, S> = T & {
63
+ new (): {
64
+ $slots: S;
65
+ };
66
+ };
@@ -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 : () => {
@@ -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
+ }
@@ -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) => ({
@@ -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/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.5",
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",
@@ -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,57 +76,57 @@
71
76
  }
72
77
  },
73
78
  "dependencies": {
74
- "@nuxt/kit": "^3.16.1",
75
- "@vueuse/core": "^13.0.0",
79
+ "@nuxt/kit": "^3.17.3",
80
+ "@vueuse/core": "^13.2.0",
76
81
  "consola": "^3.4.2",
77
82
  "defu": "^6.1.4",
78
- "h3": "^1.15.1",
83
+ "h3": "^1.15.3",
79
84
  "magic-string": "^0.30.17",
80
85
  "ofetch": "^1.4.1",
81
86
  "ohash": "^2.0.11",
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",
88
- "unstorage": "^1.15.0",
89
- "valibot": "^1.0.0"
90
+ "std-env": "^3.9.0",
91
+ "ufo": "^1.6.1",
92
+ "unplugin": "^2.3.4",
93
+ "unstorage": "^1.16.0",
94
+ "valibot": "^1.1.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",
96
- "@nuxt/test-utils": "3.17.2",
97
- "@types/semver": "^7.5.8",
98
- "@typescript-eslint/typescript-estree": "^8.28.0",
99
- "acorn-loose": "^8.4.0",
100
- "bumpp": "^10.1.0",
97
+ "@nuxt/devtools-kit": "^2.4.1",
98
+ "@nuxt/devtools-ui-kit": "^2.4.1",
99
+ "@nuxt/eslint-config": "^1.4.0",
100
+ "@nuxt/module-builder": "^1.0.1",
101
+ "@nuxt/test-utils": "3.19.0",
102
+ "@types/semver": "^7.7.0",
103
+ "@typescript-eslint/typescript-estree": "^8.32.1",
104
+ "acorn-loose": "^8.5.0",
105
+ "bumpp": "^10.1.1",
101
106
  "changelogen": "^0.6.1",
102
- "eslint": "9.23.0",
103
- "eslint-plugin-n": "^17.16.2",
104
- "happy-dom": "^17.4.4",
107
+ "eslint": "9.27.0",
108
+ "eslint-plugin-n": "^17.18.0",
109
+ "happy-dom": "^17.4.7",
105
110
  "knitwork": "^1.2.0",
106
- "nuxt": "^3.16.1",
107
- "playwright-core": "^1.51.1",
108
- "shiki": "2.5.0",
111
+ "nuxt": "^3.17.3",
112
+ "playwright-core": "^1.52.0",
113
+ "shiki": "3.4.2",
109
114
  "typescript": "5.8.2",
110
- "vitest": "^3.0.9",
111
- "vue": "^3.5.13",
112
- "vue-router": "^4.5.0",
113
- "vue-tsc": "^2.2.8",
114
- "@nuxt/scripts": "0.11.5"
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"
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",
123
- "vue": "^3.5.13",
124
- "vue-router": "^4.5.0"
124
+ "@unhead/vue": "^2.0.8",
125
+ "nuxt": "^3.17.3",
126
+ "typescript": "^5.8.3",
127
+ "unhead": "^2.0.8",
128
+ "vue": "^3.5.14",
129
+ "vue-router": "^4.5.1"
125
130
  },
126
131
  "scripts": {
127
132
  "build": "pnpm dev:prepare && pnpm prepack",
@@ -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.md\" && 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",