@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.
- package/dist/client/200.html +9 -9
- package/dist/client/404.html +9 -9
- package/dist/client/_nuxt/{Bo1SWr6k.js → C347yIJI.js} +1 -1
- package/dist/client/_nuxt/DhL_UpCd.js +1 -0
- package/dist/client/_nuxt/Di440A2l.js +1 -0
- package/dist/client/_nuxt/V79VpDdr.js +21 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/3e09fd1b-e587-4ed5-a851-8fd373eda48a.json +1 -0
- package/dist/client/_nuxt/{entry.CJckMUzn.css → entry.B4DN0kwM.css} +1 -1
- package/dist/client/_nuxt/error-404.BtCtaqmq.css +1 -0
- package/dist/client/_nuxt/error-500.D9fi60uT.css +1 -0
- package/dist/client/index.html +9 -9
- package/dist/module.json +3 -3
- package/dist/registry.mjs +18 -0
- package/dist/runtime/components/ScriptAriaLoadingIndicator.vue.d.ts +2 -0
- package/dist/runtime/components/ScriptCarbonAds.vue +41 -57
- package/dist/runtime/components/ScriptCarbonAds.vue.d.ts +49 -0
- package/dist/runtime/components/ScriptCrisp.vue +43 -63
- package/dist/runtime/components/ScriptCrisp.vue.d.ts +65 -0
- package/dist/runtime/components/ScriptGoogleAdsense.vue +37 -60
- package/dist/runtime/components/ScriptGoogleAdsense.vue.d.ts +59 -0
- package/dist/runtime/components/ScriptGoogleMaps.vue +220 -365
- package/dist/runtime/components/ScriptGoogleMaps.vue.d.ts +215 -0
- package/dist/runtime/components/ScriptIntercom.vue +48 -67
- package/dist/runtime/components/ScriptIntercom.vue.d.ts +70 -0
- package/dist/runtime/components/ScriptLemonSqueezy.vue +26 -37
- package/dist/runtime/components/ScriptLemonSqueezy.vue.d.ts +41 -0
- package/dist/runtime/components/ScriptLoadingIndicator.vue +8 -13
- package/dist/runtime/components/ScriptLoadingIndicator.vue.d.ts +9 -0
- package/dist/runtime/components/ScriptStripePricingTable.vue +41 -53
- package/dist/runtime/components/ScriptStripePricingTable.vue.d.ts +56 -0
- package/dist/runtime/components/ScriptVimeoPlayer.vue +121 -218
- package/dist/runtime/components/ScriptVimeoPlayer.vue.d.ts +233 -0
- package/dist/runtime/components/ScriptYouTubePlayer.vue +105 -163
- package/dist/runtime/components/ScriptYouTubePlayer.vue.d.ts +133 -0
- package/dist/runtime/registry/clarity.d.ts +1 -1
- package/dist/runtime/registry/clarity.js +7 -1
- package/dist/runtime/registry/snapchat-pixel.js +1 -1
- package/dist/types.d.mts +2 -2
- package/package.json +39 -34
- package/dist/client/_nuxt/BojlM8av.js +0 -21
- package/dist/client/_nuxt/BwFnCI0m.js +0 -1
- package/dist/client/_nuxt/builds/meta/d0cfdf7f-f013-4561-b983-7ab31692811a.json +0 -1
- package/dist/client/_nuxt/error-404.BiTeRF3j.css +0 -1
- package/dist/client/_nuxt/error-500.Be1AE5oK.css +0 -1
- package/dist/client/_nuxt/yRslIvSb.js +0 -1
- package/dist/module.cjs +0 -5
- package/dist/module.d.ts +0 -60
- package/dist/registry.d.ts +0 -6
- package/dist/types.d.ts +0 -7
|
@@ -1,76 +1,53 @@
|
|
|
1
|
-
<script setup
|
|
2
|
-
import { computed, onMounted, ref, watch } from
|
|
3
|
-
import { callOnce } from
|
|
4
|
-
import { useScriptTriggerElement } from
|
|
5
|
-
import { useScriptGoogleAdsense } from
|
|
6
|
-
import { scriptRuntimeConfig } from
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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 ===
|
|
61
|
-
emits(
|
|
39
|
+
if (val === "loaded") {
|
|
40
|
+
emits("ready", instance);
|
|
41
|
+
} else if (val === "error") {
|
|
42
|
+
emits("error");
|
|
62
43
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
})
|
|
67
|
-
})
|
|
68
|
-
|
|
44
|
+
});
|
|
45
|
+
});
|
|
69
46
|
const rootAttrs = computed(() => {
|
|
70
47
|
return {
|
|
71
|
-
...
|
|
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
|
+
};
|