@nuxt/scripts 0.12.2 → 0.13.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 (44) hide show
  1. package/README.md +1 -1
  2. package/dist/client/200.html +1 -1
  3. package/dist/client/404.html +1 -1
  4. package/dist/client/_nuxt/{DlfHMoPT.js → BPQ3VLAy.js} +1 -1
  5. package/dist/client/_nuxt/BzljQ-rd.js +162 -0
  6. package/dist/client/_nuxt/DK362SOH.js +1 -0
  7. package/dist/client/_nuxt/PHLQDN5L.js +1 -0
  8. package/dist/client/_nuxt/builds/latest.json +1 -1
  9. package/dist/client/_nuxt/builds/meta/9e8815f0-bd29-4c63-bc27-648fe5a7bddb.json +1 -0
  10. package/dist/client/_nuxt/{entry.Bb8Z00UZ.css → entry.BjfcJo5q.css} +1 -1
  11. package/dist/client/_nuxt/error-404.ZuyiY1vu.css +1 -0
  12. package/dist/client/_nuxt/error-500.BfVWfWcz.css +1 -0
  13. package/dist/client/_nuxt/xoNbWVYj.js +1 -0
  14. package/dist/client/index.html +1 -1
  15. package/dist/module.json +1 -1
  16. package/dist/module.mjs +29 -4
  17. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.d.vue.ts +223 -0
  18. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue +1 -1
  19. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue.d.ts +223 -0
  20. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.d.vue.ts +2 -2
  21. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.vue +1 -1
  22. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.vue.d.ts +2 -2
  23. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.d.vue.ts +2 -2
  24. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.vue +1 -1
  25. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.vue.d.ts +2 -2
  26. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.d.vue.ts +3 -3
  27. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.vue +3 -3
  28. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.vue.d.ts +3 -3
  29. package/dist/runtime/components/ScriptVimeoPlayer.d.vue.ts +4 -4
  30. package/dist/runtime/components/ScriptVimeoPlayer.vue.d.ts +4 -4
  31. package/dist/runtime/components/ScriptYouTubePlayer.d.vue.ts +4 -4
  32. package/dist/runtime/components/ScriptYouTubePlayer.vue.d.ts +4 -4
  33. package/dist/runtime/composables/useScript.js +7 -0
  34. package/dist/runtime/registry/plausible-analytics.d.ts +81 -7
  35. package/dist/runtime/registry/plausible-analytics.js +64 -11
  36. package/dist/runtime/registry/x-pixel.js +1 -1
  37. package/package.json +28 -25
  38. package/dist/client/_nuxt/C09X5LNe.js +0 -1
  39. package/dist/client/_nuxt/CDuymAca.js +0 -1
  40. package/dist/client/_nuxt/CGGF_5bm.js +0 -179
  41. package/dist/client/_nuxt/Z5EPizOU.js +0 -1
  42. package/dist/client/_nuxt/builds/meta/e404bf6c-6cc5-4a5a-bd29-546b71b82a4b.json +0 -1
  43. package/dist/client/_nuxt/error-404.c-5_FvQE.css +0 -1
  44. package/dist/client/_nuxt/error-500.Dgf4btmt.css +0 -1
@@ -0,0 +1,223 @@
1
+ export interface PlaceholderOptions {
2
+ width?: string | number;
3
+ height?: string | number;
4
+ center?: string;
5
+ zoom?: number;
6
+ size?: string;
7
+ scale?: number;
8
+ format?: 'png' | 'jpg' | 'gif' | 'png8' | 'png32' | 'jpg-baseline';
9
+ maptype?: 'roadmap' | 'satellite' | 'terrain' | 'hybrid';
10
+ language?: string;
11
+ region?: string;
12
+ markers?: string;
13
+ path?: string;
14
+ visible?: string;
15
+ style?: string;
16
+ map_id?: string;
17
+ key?: string;
18
+ signature?: string;
19
+ }
20
+ import type { HTMLAttributes, ImgHTMLAttributes, InjectionKey, Ref, ReservedProps, ShallowRef } from 'vue';
21
+ import type { ElementScriptTrigger } from '#nuxt-scripts/types';
22
+ export declare const MAP_INJECTION_KEY: InjectionKey<{
23
+ map: ShallowRef<google.maps.Map | undefined>;
24
+ mapsApi: Ref<typeof google.maps | undefined>;
25
+ }>;
26
+ declare const _default: typeof __VLS_export;
27
+ export default _default;
28
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
29
+ /**
30
+ * Defines the trigger event to load the script.
31
+ */
32
+ trigger?: ElementScriptTrigger;
33
+ /**
34
+ * Is Google Maps being rendered above the fold?
35
+ * This will load the placeholder image with higher priority.
36
+ */
37
+ aboveTheFold?: boolean;
38
+ /**
39
+ * Defines the Google Maps API key. Must have access to the Static Maps API as well.
40
+ */
41
+ apiKey?: string;
42
+ /**
43
+ * A latitude / longitude of where to focus the map.
44
+ */
45
+ center?: google.maps.LatLng | google.maps.LatLngLiteral | `${string},${string}`;
46
+ /**
47
+ * Should a marker be displayed on the map where the centre is.
48
+ */
49
+ centerMarker?: boolean;
50
+ /**
51
+ * Options for the map.
52
+ */
53
+ mapOptions?: google.maps.MapOptions;
54
+ /**
55
+ * Defines the region of the map.
56
+ */
57
+ region?: string;
58
+ /**
59
+ * Defines the language of the map
60
+ */
61
+ language?: string;
62
+ /**
63
+ * Defines the version of google maps js API
64
+ */
65
+ version?: string;
66
+ /**
67
+ * Defines the width of the map.
68
+ */
69
+ width?: number | string;
70
+ /**
71
+ * Defines the height of the map
72
+ */
73
+ height?: number | string;
74
+ /**
75
+ * Customize the placeholder image attributes.
76
+ *
77
+ * @see https://developers.google.com/maps/documentation/maps-static/start.
78
+ */
79
+ placeholderOptions?: PlaceholderOptions;
80
+ /**
81
+ * Customize the placeholder image attributes.
82
+ */
83
+ placeholderAttrs?: ImgHTMLAttributes & ReservedProps & Record<string, unknown>;
84
+ /**
85
+ * Customize the root element attributes.
86
+ */
87
+ rootAttrs?: HTMLAttributes & ReservedProps & Record<string, unknown>;
88
+ /**
89
+ * Extra Markers to add to the map.
90
+ */
91
+ markers?: (`${string},${string}` | google.maps.marker.AdvancedMarkerElementOptions)[];
92
+ }, {
93
+ readonly googleMaps: Ref<typeof google.maps | undefined, typeof google.maps | undefined>;
94
+ readonly map: ShallowRef<google.maps.Map | undefined>;
95
+ readonly createAdvancedMapMarker: (_options?: google.maps.marker.AdvancedMarkerElementOptions | `${string},${string}`) => Promise<google.maps.marker.AdvancedMarkerElement | undefined>;
96
+ readonly resolveQueryToLatLang: (query: string) => Promise<google.maps.LatLng | undefined>;
97
+ readonly importLibrary: {
98
+ (key: "marker"): Promise<google.maps.MarkerLibrary>;
99
+ (key: "places"): Promise<google.maps.PlacesLibrary>;
100
+ (key: "geometry"): Promise<google.maps.GeometryLibrary>;
101
+ (key: "drawing"): Promise<google.maps.DrawingLibrary>;
102
+ (key: "visualization"): Promise<google.maps.VisualizationLibrary>;
103
+ (key: string): Promise<any>;
104
+ };
105
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
106
+ error: () => any;
107
+ ready: (e: {
108
+ readonly googleMaps: Ref<typeof google.maps | undefined, typeof google.maps | undefined>;
109
+ readonly map: ShallowRef<google.maps.Map | undefined>;
110
+ readonly createAdvancedMapMarker: (_options?: google.maps.marker.AdvancedMarkerElementOptions | `${string},${string}`) => Promise<google.maps.marker.AdvancedMarkerElement | undefined>;
111
+ readonly resolveQueryToLatLang: (query: string) => Promise<google.maps.LatLng | undefined>;
112
+ readonly importLibrary: {
113
+ (key: "marker"): Promise<google.maps.MarkerLibrary>;
114
+ (key: "places"): Promise<google.maps.PlacesLibrary>;
115
+ (key: "geometry"): Promise<google.maps.GeometryLibrary>;
116
+ (key: "drawing"): Promise<google.maps.DrawingLibrary>;
117
+ (key: "visualization"): Promise<google.maps.VisualizationLibrary>;
118
+ (key: string): Promise<any>;
119
+ };
120
+ }) => any;
121
+ }, string, import("vue").PublicProps, Readonly<{
122
+ /**
123
+ * Defines the trigger event to load the script.
124
+ */
125
+ trigger?: ElementScriptTrigger;
126
+ /**
127
+ * Is Google Maps being rendered above the fold?
128
+ * This will load the placeholder image with higher priority.
129
+ */
130
+ aboveTheFold?: boolean;
131
+ /**
132
+ * Defines the Google Maps API key. Must have access to the Static Maps API as well.
133
+ */
134
+ apiKey?: string;
135
+ /**
136
+ * A latitude / longitude of where to focus the map.
137
+ */
138
+ center?: google.maps.LatLng | google.maps.LatLngLiteral | `${string},${string}`;
139
+ /**
140
+ * Should a marker be displayed on the map where the centre is.
141
+ */
142
+ centerMarker?: boolean;
143
+ /**
144
+ * Options for the map.
145
+ */
146
+ mapOptions?: google.maps.MapOptions;
147
+ /**
148
+ * Defines the region of the map.
149
+ */
150
+ region?: string;
151
+ /**
152
+ * Defines the language of the map
153
+ */
154
+ language?: string;
155
+ /**
156
+ * Defines the version of google maps js API
157
+ */
158
+ version?: string;
159
+ /**
160
+ * Defines the width of the map.
161
+ */
162
+ width?: number | string;
163
+ /**
164
+ * Defines the height of the map
165
+ */
166
+ height?: number | string;
167
+ /**
168
+ * Customize the placeholder image attributes.
169
+ *
170
+ * @see https://developers.google.com/maps/documentation/maps-static/start.
171
+ */
172
+ placeholderOptions?: PlaceholderOptions;
173
+ /**
174
+ * Customize the placeholder image attributes.
175
+ */
176
+ placeholderAttrs?: ImgHTMLAttributes & ReservedProps & Record<string, unknown>;
177
+ /**
178
+ * Customize the root element attributes.
179
+ */
180
+ rootAttrs?: HTMLAttributes & ReservedProps & Record<string, unknown>;
181
+ /**
182
+ * Extra Markers to add to the map.
183
+ */
184
+ markers?: (`${string},${string}` | google.maps.marker.AdvancedMarkerElementOptions)[];
185
+ }> & Readonly<{
186
+ onError?: (() => any) | undefined;
187
+ onReady?: ((e: {
188
+ readonly googleMaps: Ref<typeof google.maps | undefined, typeof google.maps | undefined>;
189
+ readonly map: ShallowRef<google.maps.Map | undefined>;
190
+ readonly createAdvancedMapMarker: (_options?: google.maps.marker.AdvancedMarkerElementOptions | `${string},${string}`) => Promise<google.maps.marker.AdvancedMarkerElement | undefined>;
191
+ readonly resolveQueryToLatLang: (query: string) => Promise<google.maps.LatLng | undefined>;
192
+ readonly importLibrary: {
193
+ (key: "marker"): Promise<google.maps.MarkerLibrary>;
194
+ (key: "places"): Promise<google.maps.PlacesLibrary>;
195
+ (key: "geometry"): Promise<google.maps.GeometryLibrary>;
196
+ (key: "drawing"): Promise<google.maps.DrawingLibrary>;
197
+ (key: "visualization"): Promise<google.maps.VisualizationLibrary>;
198
+ (key: string): Promise<any>;
199
+ };
200
+ }) => any) | undefined;
201
+ }>, {
202
+ trigger: ElementScriptTrigger;
203
+ centerMarker: boolean;
204
+ width: number | string;
205
+ height: number | string;
206
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
207
+ placeholder?: (props: {
208
+ placeholder: any;
209
+ }) => any;
210
+ } & {
211
+ loading?: (props: {}) => any;
212
+ } & {
213
+ awaitingLoad?: (props: {}) => any;
214
+ } & {
215
+ error?: (props: {}) => any;
216
+ } & {
217
+ default?: (props: {}) => any;
218
+ }>;
219
+ type __VLS_WithSlots<T, S> = T & {
220
+ new (): {
221
+ $slots: S;
222
+ };
223
+ };
@@ -2,6 +2,8 @@ import type { InjectionKey, ShallowRef } from 'vue';
2
2
  export declare const ADVANCED_MARKER_ELEMENT_INJECTION_KEY: InjectionKey<{
3
3
  advancedMarkerElement: ShallowRef<google.maps.marker.AdvancedMarkerElement | undefined>;
4
4
  }>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
5
7
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
6
8
  options?: Omit<google.maps.marker.AdvancedMarkerElementOptions, "map">;
7
9
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
@@ -53,8 +55,6 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
53
55
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
54
56
  default?: (props: {}) => any;
55
57
  }>;
56
- declare const _default: typeof __VLS_export;
57
- export default _default;
58
58
  type __VLS_WithSlots<T, S> = T & {
59
59
  new (): {
60
60
  $slots: S;
@@ -7,7 +7,7 @@ import { inject, onUnmounted, provide, shallowRef } from "vue";
7
7
  import { whenever } from "@vueuse/core";
8
8
  import { MAP_INJECTION_KEY } from "./ScriptGoogleMaps.vue";
9
9
  import { MARKER_CLUSTERER_INJECTION_KEY } from "./ScriptGoogleMapsMarkerClusterer.vue";
10
- export const ADVANCED_MARKER_ELEMENT_INJECTION_KEY = Symbol("marker");
10
+ export const ADVANCED_MARKER_ELEMENT_INJECTION_KEY = /* @__PURE__ */ Symbol("marker");
11
11
  </script>
12
12
 
13
13
  <script setup>
@@ -2,6 +2,8 @@ import type { InjectionKey, ShallowRef } from 'vue';
2
2
  export declare const ADVANCED_MARKER_ELEMENT_INJECTION_KEY: InjectionKey<{
3
3
  advancedMarkerElement: ShallowRef<google.maps.marker.AdvancedMarkerElement | undefined>;
4
4
  }>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
5
7
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
6
8
  options?: Omit<google.maps.marker.AdvancedMarkerElementOptions, "map">;
7
9
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
@@ -53,8 +55,6 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
53
55
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
54
56
  default?: (props: {}) => any;
55
57
  }>;
56
- declare const _default: typeof __VLS_export;
57
- export default _default;
58
58
  type __VLS_WithSlots<T, S> = T & {
59
59
  new (): {
60
60
  $slots: S;
@@ -2,6 +2,8 @@ import type { InjectionKey, ShallowRef } from 'vue';
2
2
  export declare const MARKER_INJECTION_KEY: InjectionKey<{
3
3
  marker: ShallowRef<google.maps.Marker | undefined>;
4
4
  }>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
5
7
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
6
8
  options?: Omit<google.maps.MarkerOptions, "map">;
7
9
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
@@ -53,8 +55,6 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
53
55
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
54
56
  default?: (props: {}) => any;
55
57
  }>;
56
- declare const _default: typeof __VLS_export;
57
- export default _default;
58
58
  type __VLS_WithSlots<T, S> = T & {
59
59
  new (): {
60
60
  $slots: S;
@@ -7,7 +7,7 @@ import { inject, onUnmounted, provide, shallowRef } from "vue";
7
7
  import { whenever } from "@vueuse/core";
8
8
  import { MAP_INJECTION_KEY } from "./ScriptGoogleMaps.vue";
9
9
  import { MARKER_CLUSTERER_INJECTION_KEY } from "./ScriptGoogleMapsMarkerClusterer.vue";
10
- export const MARKER_INJECTION_KEY = Symbol("marker");
10
+ export const MARKER_INJECTION_KEY = /* @__PURE__ */ Symbol("marker");
11
11
  </script>
12
12
 
13
13
  <script setup>
@@ -2,6 +2,8 @@ import type { InjectionKey, ShallowRef } from 'vue';
2
2
  export declare const MARKER_INJECTION_KEY: InjectionKey<{
3
3
  marker: ShallowRef<google.maps.Marker | undefined>;
4
4
  }>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
5
7
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
6
8
  options?: Omit<google.maps.MarkerOptions, "map">;
7
9
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
@@ -53,8 +55,6 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
53
55
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
54
56
  default?: (props: {}) => any;
55
57
  }>;
56
- declare const _default: typeof __VLS_export;
57
- export default _default;
58
58
  type __VLS_WithSlots<T, S> = T & {
59
59
  new (): {
60
60
  $slots: S;
@@ -1,9 +1,11 @@
1
- import { MarkerClusterer, type MarkerClustererOptions } from '@googlemaps/markerclusterer';
1
+ import type { MarkerClusterer, MarkerClustererOptions } from '@googlemaps/markerclusterer';
2
2
  import { type InjectionKey, type ShallowRef } from 'vue';
3
3
  export declare const MARKER_CLUSTERER_INJECTION_KEY: InjectionKey<{
4
4
  markerClusterer: ShallowRef<MarkerClusterer | undefined>;
5
5
  requestRerender: () => void;
6
6
  }>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
7
9
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
8
10
  options?: Omit<MarkerClustererOptions, "map">;
9
11
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
@@ -19,8 +21,6 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
19
21
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
20
22
  default?: (props: {}) => any;
21
23
  }>;
22
- declare const _default: typeof __VLS_export;
23
- export default _default;
24
24
  type __VLS_WithSlots<T, S> = T & {
25
25
  new (): {
26
26
  $slots: S;
@@ -3,11 +3,10 @@
3
3
  </template>
4
4
 
5
5
  <script>
6
- import { MarkerClusterer } from "@googlemaps/markerclusterer";
7
6
  import { inject, onUnmounted, provide, shallowRef } from "vue";
8
7
  import { whenever } from "@vueuse/core";
9
8
  import { MAP_INJECTION_KEY } from "./ScriptGoogleMaps.vue";
10
- export const MARKER_CLUSTERER_INJECTION_KEY = Symbol("marker-clusterer");
9
+ export const MARKER_CLUSTERER_INJECTION_KEY = /* @__PURE__ */ Symbol("marker-clusterer");
11
10
  </script>
12
11
 
13
12
  <script setup>
@@ -22,7 +21,8 @@ const markerClustererEvents = [
22
21
  const emit = defineEmits([]);
23
22
  const mapContext = inject(MAP_INJECTION_KEY, void 0);
24
23
  const markerClusterer = shallowRef(void 0);
25
- whenever(() => mapContext?.map.value, (map) => {
24
+ whenever(() => mapContext?.map.value, async (map) => {
25
+ const { MarkerClusterer } = await import("@googlemaps/markerclusterer");
26
26
  markerClusterer.value = new MarkerClusterer({
27
27
  map,
28
28
  ...props.options
@@ -1,9 +1,11 @@
1
- import { MarkerClusterer, type MarkerClustererOptions } from '@googlemaps/markerclusterer';
1
+ import type { MarkerClusterer, MarkerClustererOptions } from '@googlemaps/markerclusterer';
2
2
  import { type InjectionKey, type ShallowRef } from 'vue';
3
3
  export declare const MARKER_CLUSTERER_INJECTION_KEY: InjectionKey<{
4
4
  markerClusterer: ShallowRef<MarkerClusterer | undefined>;
5
5
  requestRerender: () => void;
6
6
  }>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
7
9
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
8
10
  options?: Omit<MarkerClustererOptions, "map">;
9
11
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
@@ -19,8 +21,6 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
19
21
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
20
22
  default?: (props: {}) => any;
21
23
  }>;
22
- declare const _default: typeof __VLS_export;
23
- export default _default;
24
24
  type __VLS_WithSlots<T, S> = T & {
25
25
  new (): {
26
26
  $slots: S;
@@ -37,17 +37,17 @@ type __VLS_Props = {
37
37
  id?: number | undefined;
38
38
  url?: string | undefined;
39
39
  };
40
- declare var __VLS_1: any, __VLS_3: {}, __VLS_9: {}, __VLS_11: {}, __VLS_13: {};
40
+ declare var __VLS_1: any, __VLS_3: {}, __VLS_10: {}, __VLS_12: {}, __VLS_14: {};
41
41
  type __VLS_Slots = {} & {
42
42
  placeholder?: (props: typeof __VLS_1) => any;
43
43
  } & {
44
44
  loading?: (props: typeof __VLS_3) => any;
45
45
  } & {
46
- awaitingLoad?: (props: typeof __VLS_9) => any;
46
+ awaitingLoad?: (props: typeof __VLS_10) => any;
47
47
  } & {
48
- error?: (props: typeof __VLS_11) => any;
48
+ error?: (props: typeof __VLS_12) => any;
49
49
  } & {
50
- default?: (props: typeof __VLS_13) => any;
50
+ default?: (props: typeof __VLS_14) => any;
51
51
  };
52
52
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
53
53
  play: () => Promise<void> | undefined;
@@ -37,17 +37,17 @@ type __VLS_Props = {
37
37
  id?: number | undefined;
38
38
  url?: string | undefined;
39
39
  };
40
- declare var __VLS_1: any, __VLS_3: {}, __VLS_9: {}, __VLS_11: {}, __VLS_13: {};
40
+ declare var __VLS_1: any, __VLS_3: {}, __VLS_10: {}, __VLS_12: {}, __VLS_14: {};
41
41
  type __VLS_Slots = {} & {
42
42
  placeholder?: (props: typeof __VLS_1) => any;
43
43
  } & {
44
44
  loading?: (props: typeof __VLS_3) => any;
45
45
  } & {
46
- awaitingLoad?: (props: typeof __VLS_9) => any;
46
+ awaitingLoad?: (props: typeof __VLS_10) => any;
47
47
  } & {
48
- error?: (props: typeof __VLS_11) => any;
48
+ error?: (props: typeof __VLS_12) => any;
49
49
  } & {
50
- default?: (props: typeof __VLS_13) => any;
50
+ default?: (props: typeof __VLS_14) => any;
51
51
  };
52
52
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
53
53
  play: () => Promise<void> | undefined;
@@ -22,17 +22,17 @@ type __VLS_Props = {
22
22
  };
23
23
  declare var __VLS_1: {
24
24
  placeholder: any;
25
- }, __VLS_3: {}, __VLS_9: {}, __VLS_11: {}, __VLS_13: {};
25
+ }, __VLS_3: {}, __VLS_10: {}, __VLS_12: {}, __VLS_14: {};
26
26
  type __VLS_Slots = {} & {
27
27
  placeholder?: (props: typeof __VLS_1) => any;
28
28
  } & {
29
29
  loading?: (props: typeof __VLS_3) => any;
30
30
  } & {
31
- awaitingLoad?: (props: typeof __VLS_9) => any;
31
+ awaitingLoad?: (props: typeof __VLS_10) => any;
32
32
  } & {
33
- error?: (props: typeof __VLS_11) => any;
33
+ error?: (props: typeof __VLS_12) => any;
34
34
  } & {
35
- default?: (props: typeof __VLS_13) => any;
35
+ default?: (props: typeof __VLS_14) => any;
36
36
  };
37
37
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
38
38
  player: Ref<YT.Player | undefined, YT.Player | undefined>;
@@ -22,17 +22,17 @@ type __VLS_Props = {
22
22
  };
23
23
  declare var __VLS_1: {
24
24
  placeholder: any;
25
- }, __VLS_3: {}, __VLS_9: {}, __VLS_11: {}, __VLS_13: {};
25
+ }, __VLS_3: {}, __VLS_10: {}, __VLS_12: {}, __VLS_14: {};
26
26
  type __VLS_Slots = {} & {
27
27
  placeholder?: (props: typeof __VLS_1) => any;
28
28
  } & {
29
29
  loading?: (props: typeof __VLS_3) => any;
30
30
  } & {
31
- awaitingLoad?: (props: typeof __VLS_9) => any;
31
+ awaitingLoad?: (props: typeof __VLS_10) => any;
32
32
  } & {
33
- error?: (props: typeof __VLS_11) => any;
33
+ error?: (props: typeof __VLS_12) => any;
34
34
  } & {
35
- default?: (props: typeof __VLS_13) => any;
35
+ default?: (props: typeof __VLS_14) => any;
36
36
  };
37
37
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
38
38
  player: Ref<YT.Player | undefined, YT.Player | undefined>;
@@ -3,6 +3,7 @@ import { useScript as _useScript } from "@unhead/vue/scripts";
3
3
  import { reactive } from "vue";
4
4
  import { onNuxtReady, useNuxtApp, useRuntimeConfig, injectHead } from "nuxt/app";
5
5
  import { logger } from "../logger.js";
6
+ import { resolveTrigger } from "#build/nuxt-scripts-trigger-resolver";
6
7
  function useNuxtScriptRuntimeConfig() {
7
8
  return useRuntimeConfig().public["nuxt-scripts"];
8
9
  }
@@ -16,6 +17,12 @@ export function useScript(input, options) {
16
17
  console.warn("[Nuxt Scripts] Bundling is not supported for dynamic script sources. Static URLs are required for bundling.");
17
18
  options.bundle = false;
18
19
  }
20
+ if (options.trigger && typeof options.trigger === "object" && !("then" in options.trigger)) {
21
+ const resolved = resolveTrigger(options.trigger);
22
+ if (resolved) {
23
+ options.trigger = resolved;
24
+ }
25
+ }
19
26
  const id = String(resolveScriptKey(input));
20
27
  const nuxtApp = useNuxtApp();
21
28
  options.head = options.head || injectHead();
@@ -1,17 +1,91 @@
1
1
  import type { RegistryScriptInput } from '#nuxt-scripts/types';
2
- export declare const PlausibleAnalyticsOptions: import("valibot").ObjectSchema<{
3
- readonly domain: import("valibot").StringSchema<undefined>;
2
+ declare const PlausibleAnalyticsOptionsSchema: import("valibot").ObjectSchema<{
3
+ readonly scriptId: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
4
+ readonly domain: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
4
5
  readonly extension: import("valibot").OptionalSchema<import("valibot").UnionSchema<[import("valibot").UnionSchema<(import("valibot").LiteralSchema<"hash", undefined> | import("valibot").LiteralSchema<"outbound-links", undefined> | import("valibot").LiteralSchema<"file-downloads", undefined> | import("valibot").LiteralSchema<"tagged-events", undefined> | import("valibot").LiteralSchema<"revenue", undefined> | import("valibot").LiteralSchema<"pageview-props", undefined> | import("valibot").LiteralSchema<"compat", undefined> | import("valibot").LiteralSchema<"local", undefined> | import("valibot").LiteralSchema<"manual", undefined>)[], undefined>, import("valibot").ArraySchema<import("valibot").UnionSchema<(import("valibot").LiteralSchema<"hash", undefined> | import("valibot").LiteralSchema<"outbound-links", undefined> | import("valibot").LiteralSchema<"file-downloads", undefined> | import("valibot").LiteralSchema<"tagged-events", undefined> | import("valibot").LiteralSchema<"revenue", undefined> | import("valibot").LiteralSchema<"pageview-props", undefined> | import("valibot").LiteralSchema<"compat", undefined> | import("valibot").LiteralSchema<"local", undefined> | import("valibot").LiteralSchema<"manual", undefined>)[], undefined>, undefined>], undefined>, undefined>;
6
+ readonly customProperties: import("valibot").OptionalSchema<import("valibot").RecordSchema<import("valibot").StringSchema<undefined>, import("valibot").AnySchema, undefined>, undefined>;
7
+ readonly endpoint: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
8
+ readonly fileDownloads: import("valibot").OptionalSchema<import("valibot").ObjectSchema<{
9
+ readonly fileExtensions: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").StringSchema<undefined>, undefined>, undefined>;
10
+ }, undefined>, undefined>;
11
+ readonly hashBasedRouting: import("valibot").OptionalSchema<import("valibot").BooleanSchema<undefined>, undefined>;
12
+ readonly autoCapturePageviews: import("valibot").OptionalSchema<import("valibot").BooleanSchema<undefined>, undefined>;
13
+ readonly captureOnLocalhost: import("valibot").OptionalSchema<import("valibot").BooleanSchema<undefined>, undefined>;
14
+ readonly trackForms: import("valibot").OptionalSchema<import("valibot").BooleanSchema<undefined>, undefined>;
5
15
  }, undefined>;
6
- export type PlausibleAnalyticsInput = RegistryScriptInput<typeof PlausibleAnalyticsOptions, false>;
7
- export interface PlausibleAnalyticsApi {
8
- plausible: ((event: '404', options: Record<string, any>) => void) & ((event: 'event', options: Record<string, any>) => void) & ((...params: any[]) => void) & {
9
- q: any[];
16
+ /**
17
+ * Plausible Analytics options
18
+ * @see https://plausible.io/docs/script-extensions
19
+ */
20
+ export interface PlausibleAnalyticsOptions {
21
+ /**
22
+ * Unique script ID for your site (recommended - new format as of October 2025)
23
+ * Get this from your Plausible dashboard under Site Installation
24
+ *
25
+ * Extract it from your Plausible script URL:
26
+ * ```
27
+ * <script src="https://plausible.io/js/pa-gYyxvZhkMzdzXBAtSeSNz.js"></script>
28
+ * ^^^^^^^^^^^^^^^^^^^^^^^^^^
29
+ * scriptId: 'gYyxvZhkMzdzXBAtSeSNz'
30
+ * ```
31
+ * @example 'gYyxvZhkMzdzXBAtSeSNz'
32
+ */
33
+ scriptId?: string;
34
+ /**
35
+ * Your site domain
36
+ * @deprecated Use `scriptId` instead (new October 2025 format)
37
+ * @example 'example.com'
38
+ */
39
+ domain?: string;
40
+ /**
41
+ * Script extensions for additional features
42
+ * @deprecated Use init options like `hashBasedRouting`, `captureOnLocalhost`, etc. instead (new October 2025 format)
43
+ */
44
+ extension?: 'hash' | 'outbound-links' | 'file-downloads' | 'tagged-events' | 'revenue' | 'pageview-props' | 'compat' | 'local' | 'manual' | Array<'hash' | 'outbound-links' | 'file-downloads' | 'tagged-events' | 'revenue' | 'pageview-props' | 'compat' | 'local' | 'manual'>;
45
+ /** Custom properties to track with every pageview */
46
+ customProperties?: Record<string, any>;
47
+ /** Custom tracking endpoint URL */
48
+ endpoint?: string;
49
+ /** Configure file download tracking */
50
+ fileDownloads?: {
51
+ /** File extensions to track (default: pdf, xlsx, docx, txt, rtf, csv, exe, key, pps, ppt, pptx, 7z, pkg, rar, gz, zip, avi, mov, mp4, mpeg, wmv, midi, mp3, wav, wma, dmg) */
52
+ fileExtensions?: string[];
53
+ };
54
+ /** Enable hash-based routing for single-page apps */
55
+ hashBasedRouting?: boolean;
56
+ /** Set to false to manually trigger pageviews */
57
+ autoCapturePageviews?: boolean;
58
+ /** Enable tracking on localhost */
59
+ captureOnLocalhost?: boolean;
60
+ /** Enable form submission tracking */
61
+ trackForms?: boolean;
62
+ }
63
+ export type PlausibleAnalyticsInput = RegistryScriptInput<typeof PlausibleAnalyticsOptionsSchema, false>;
64
+ /**
65
+ * Init options for plausible.init() (October 2025 format)
66
+ * @see https://plausible.io/docs/script-extensions
67
+ */
68
+ export interface PlausibleInitOptions {
69
+ customProperties?: Record<string, any>;
70
+ endpoint?: string;
71
+ fileDownloads?: {
72
+ fileExtensions?: string[];
10
73
  };
74
+ hashBasedRouting?: boolean;
75
+ autoCapturePageviews?: boolean;
76
+ captureOnLocalhost?: boolean;
77
+ }
78
+ export type PlausibleFunction = ((event: '404', options: Record<string, any>) => void) & ((event: 'event', options: Record<string, any>) => void) & ((...params: any[]) => void) & {
79
+ q: any[];
80
+ init: (options: PlausibleInitOptions) => void;
81
+ };
82
+ export interface PlausibleAnalyticsApi {
83
+ plausible: PlausibleFunction;
11
84
  }
12
85
  declare global {
13
86
  interface Window {
14
- plausible: PlausibleAnalyticsApi;
87
+ plausible: PlausibleFunction;
15
88
  }
16
89
  }
17
90
  export declare function useScriptPlausibleAnalytics<T extends PlausibleAnalyticsApi>(_options?: PlausibleAnalyticsInput): import("#nuxt-scripts/types").UseScriptContext<T>;
91
+ export {};