@nuxt/scripts 0.11.5 → 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 -366
  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/0bd5f801-ad22-4b04-821c-25f180195d78.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
@@ -1,76 +1,53 @@
1
- <script setup lang="ts">
2
- import { computed, onMounted, ref, watch } from 'vue'
3
- import { callOnce } from 'nuxt/app'
4
- import { useScriptTriggerElement } from '../composables/useScriptTriggerElement'
5
- import { useScriptGoogleAdsense } from '../registry/google-adsense'
6
- import { scriptRuntimeConfig } from '../utils'
7
- import type { ElementScriptTrigger } from '#nuxt-scripts/types'
8
-
9
- const props = withDefaults(defineProps<{
10
- dataAdClient: string
11
- dataAdSlot: string
12
- dataAdFormat?: 'auto' | 'rectangle' | 'vertical' | 'horizontal' | 'fluid' | 'autorelaxed'
13
- dataAdLayout?: 'in-article' | 'in-feed' | 'fixed'
14
- dataFullWidthResponsive?: boolean
15
- /**
16
- * Defines the trigger event to load the script.
17
- */
18
- trigger?: ElementScriptTrigger
19
- }>(), {
20
- dataFullWidthResponsive: true,
21
- dataAdFormat: undefined, // Preserve previous behavior
22
- })
23
-
24
- const emits = defineEmits<{
25
- // our emit
26
- ready: [e: ReturnType<typeof useScriptGoogleAdsense>]
27
- error: []
28
- }>()
29
-
30
- const rootEl = ref(null)
31
- const trigger = useScriptTriggerElement({ trigger: props.trigger, el: rootEl })
32
-
33
- const scriptConfig = scriptRuntimeConfig('googleAdsense')
1
+ <script setup>
2
+ import { computed, onMounted, ref, watch } from "vue";
3
+ import { callOnce } from "nuxt/app";
4
+ import { useScriptTriggerElement } from "../composables/useScriptTriggerElement";
5
+ import { useScriptGoogleAdsense } from "../registry/google-adsense";
6
+ import { scriptRuntimeConfig } from "../utils";
7
+ const props = defineProps({
8
+ dataAdClient: { type: String, required: true },
9
+ dataAdSlot: { type: String, required: true },
10
+ dataAdFormat: { type: String, required: false, default: void 0 },
11
+ dataAdLayout: { type: String, required: false },
12
+ dataFullWidthResponsive: { type: Boolean, required: false, default: true },
13
+ trigger: { type: [String, Array, Boolean], required: false }
14
+ });
15
+ const emits = defineEmits(["ready", "error"]);
16
+ const rootEl = ref(null);
17
+ const trigger = useScriptTriggerElement({ trigger: props.trigger, el: rootEl });
18
+ const scriptConfig = scriptRuntimeConfig("googleAdsense");
34
19
  const addClient = computed(() => {
35
- return props.dataAdClient || scriptConfig?.client
36
- })
37
-
20
+ return props.dataAdClient || scriptConfig?.client;
21
+ });
38
22
  const instance = useScriptGoogleAdsense({
39
23
  client: addClient.value,
40
24
  scriptOptions: {
41
- trigger,
42
- },
43
- })
44
-
45
- const { status } = instance
46
-
25
+ trigger
26
+ }
27
+ });
28
+ const { status } = instance;
47
29
  function pushAdSlot() {
48
- (window.adsbygoogle = window.adsbygoogle || []).push({})
30
+ (window.adsbygoogle = window.adsbygoogle || []).push({});
49
31
  }
50
-
51
32
  onMounted(() => {
52
33
  if (import.meta.dev) {
53
- callOnce(() => pushAdSlot())
34
+ callOnce(() => pushAdSlot());
35
+ } else {
36
+ pushAdSlot();
54
37
  }
55
- else {
56
- pushAdSlot()
57
- }
58
-
59
38
  watch(status, (val) => {
60
- if (val === 'loaded') {
61
- emits('ready', instance)
39
+ if (val === "loaded") {
40
+ emits("ready", instance);
41
+ } else if (val === "error") {
42
+ emits("error");
62
43
  }
63
- else if (val === 'error') {
64
- emits('error')
65
- }
66
- })
67
- })
68
-
44
+ });
45
+ });
69
46
  const rootAttrs = computed(() => {
70
47
  return {
71
- ...(trigger instanceof Promise ? trigger.ssrAttrs || {} : {}),
72
- }
73
- })
48
+ ...trigger instanceof Promise ? trigger.ssrAttrs || {} : {}
49
+ };
50
+ });
74
51
  </script>
75
52
 
76
53
  <template>
@@ -0,0 +1,59 @@
1
+ import type { ElementScriptTrigger } from '#nuxt-scripts/types';
2
+ type __VLS_Props = {
3
+ dataAdClient: string;
4
+ dataAdSlot: string;
5
+ dataAdFormat?: 'auto' | 'rectangle' | 'vertical' | 'horizontal' | 'fluid' | 'autorelaxed';
6
+ dataAdLayout?: 'in-article' | 'in-feed' | 'fixed';
7
+ dataFullWidthResponsive?: boolean;
8
+ /**
9
+ * Defines the trigger event to load the script.
10
+ */
11
+ trigger?: ElementScriptTrigger;
12
+ };
13
+ declare const rootEl: import("vue").Ref<null, null>;
14
+ declare const addClient: import("vue").ComputedRef<string | undefined>;
15
+ declare const status: import("vue").Ref<import("@unhead/vue").UseScriptStatus, import("@unhead/vue").UseScriptStatus>;
16
+ declare const rootAttrs: import("vue").ComputedRef<{
17
+ [x: string]: string;
18
+ }>;
19
+ declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
20
+ declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {};
21
+ type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
22
+ awaitingLoad?: (props: typeof __VLS_1) => any;
23
+ } & {
24
+ loading?: (props: typeof __VLS_3) => any;
25
+ } & {
26
+ error?: (props: typeof __VLS_5) => any;
27
+ }>;
28
+ declare const __VLS_self: import("vue").DefineComponent<__VLS_Props, {
29
+ rootEl: typeof rootEl;
30
+ addClient: typeof addClient;
31
+ status: typeof status;
32
+ rootAttrs: typeof rootAttrs;
33
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
34
+ error: () => any;
35
+ ready: (e: import("#nuxt-scripts/types").UseScriptContext<import("../registry/google-adsense.js").GoogleAdsenseApi>) => any;
36
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
37
+ onError?: (() => any) | undefined;
38
+ onReady?: ((e: import("#nuxt-scripts/types").UseScriptContext<import("../registry/google-adsense.js").GoogleAdsenseApi>) => any) | undefined;
39
+ }>, {
40
+ dataAdFormat: "auto" | "rectangle" | "vertical" | "horizontal" | "fluid" | "autorelaxed";
41
+ dataFullWidthResponsive: boolean;
42
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
43
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
44
+ error: () => any;
45
+ ready: (e: import("#nuxt-scripts/types").UseScriptContext<import("../registry/google-adsense.js").GoogleAdsenseApi>) => any;
46
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
47
+ onError?: (() => any) | undefined;
48
+ onReady?: ((e: import("#nuxt-scripts/types").UseScriptContext<import("../registry/google-adsense.js").GoogleAdsenseApi>) => any) | undefined;
49
+ }>, {
50
+ dataAdFormat: "auto" | "rectangle" | "vertical" | "horizontal" | "fluid" | "autorelaxed";
51
+ dataFullWidthResponsive: boolean;
52
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
53
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
54
+ export default _default;
55
+ type __VLS_WithSlots<T, S> = T & {
56
+ new (): {
57
+ $slots: S;
58
+ };
59
+ };