@nuxt/scripts 0.6.4 → 0.6.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/README.md +73 -73
- package/dist/client/200.html +9 -9
- package/dist/client/404.html +9 -9
- package/dist/client/_nuxt/{DX8FDaDx.js → BKIFFtfV.js} +1 -1
- package/dist/client/_nuxt/{DUCgB8kF.js → BKJqCZ0j.js} +1 -1
- package/dist/client/_nuxt/DcF05ETD.js +31 -0
- package/dist/client/_nuxt/aQeyjCqJ.js +1 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/3dcaf2bf-82f1-460f-80a6-1412196a7a77.json +1 -0
- package/dist/client/_nuxt/entry.FVeyw1Qn.css +1 -0
- package/dist/client/_nuxt/error-404.B7Lh29wY.css +1 -0
- package/dist/client/_nuxt/error-500.B_VIyt60.css +1 -0
- package/dist/client/index.html +9 -9
- package/dist/module.d.mts +2 -10
- package/dist/module.d.ts +2 -10
- package/dist/module.json +1 -1
- package/dist/module.mjs +3 -0
- package/dist/registry.mjs +2 -2
- package/dist/runtime/components/ScriptCarbonAds.vue +71 -71
- package/dist/runtime/components/ScriptCrisp.vue +84 -84
- package/dist/runtime/components/ScriptGoogleAdsense.vue +69 -69
- package/dist/runtime/components/ScriptGoogleMaps.vue +267 -265
- package/dist/runtime/components/ScriptIntercom.vue +93 -93
- package/dist/runtime/components/ScriptLemonSqueezy.vue +45 -45
- package/dist/runtime/components/ScriptLoadingIndicator.vue +22 -22
- package/dist/runtime/components/ScriptStripePricingTable.vue +68 -68
- package/dist/runtime/components/ScriptVimeoPlayer.vue +258 -256
- package/dist/runtime/components/ScriptYouTubePlayer.vue +171 -170
- package/dist/runtime/composables/useScript.js +2 -2
- package/dist/runtime/composables/useScriptEventPage.d.ts +4 -1
- package/dist/runtime/composables/useScriptEventPage.js +6 -5
- package/dist/runtime/registry/clarity.js +1 -1
- package/dist/runtime/registry/cloudflare-web-analytics.js +1 -1
- package/dist/runtime/registry/crisp.js +1 -1
- package/dist/runtime/registry/fathom-analytics.js +1 -1
- package/dist/runtime/registry/google-adsense.js +1 -1
- package/dist/runtime/registry/google-analytics.d.ts +13 -7
- package/dist/runtime/registry/google-analytics.js +25 -13
- package/dist/runtime/registry/google-maps.js +1 -1
- package/dist/runtime/registry/google-tag-manager.d.ts +16 -6
- package/dist/runtime/registry/google-tag-manager.js +16 -10
- package/dist/runtime/registry/hotjar.js +1 -1
- package/dist/runtime/registry/intercom.js +1 -1
- package/dist/runtime/registry/lemon-squeezy.js +1 -1
- package/dist/runtime/registry/matomo-analytics.js +7 -3
- package/dist/runtime/registry/meta-pixel.d.ts +1 -0
- package/dist/runtime/registry/meta-pixel.js +6 -2
- package/dist/runtime/registry/npm.js +1 -1
- package/dist/runtime/registry/plausible-analytics.js +1 -1
- package/dist/runtime/registry/segment.d.ts +1 -2
- package/dist/runtime/registry/segment.js +1 -1
- package/dist/runtime/registry/stripe.js +1 -1
- package/dist/runtime/registry/vimeo-player.js +1 -1
- package/dist/runtime/registry/x-pixel.js +7 -3
- package/dist/runtime/registry/youtube-player.js +1 -1
- package/dist/runtime/types.d.ts +20 -4
- package/dist/runtime/types.js +1 -1
- package/dist/runtime/utils.d.ts +1 -1
- package/dist/runtime/utils.js +16 -4
- package/package.json +30 -32
- package/dist/client/_nuxt/B8kiEHWd.js +0 -31
- package/dist/client/_nuxt/CE8XWCBP.js +0 -1
- package/dist/client/_nuxt/builds/meta/a56fe5f5-907d-4907-9967-836d6a0f3850.json +0 -1
- package/dist/client/_nuxt/entry.DvGwvmL9.css +0 -1
- package/dist/client/_nuxt/error-404.-RjlvToe.css +0 -1
- package/dist/client/_nuxt/error-500.Bz7LXgZy.css +0 -1
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { useScriptTriggerElement } from '../composables/useScriptTriggerElement'
|
|
3
|
-
import { useScriptGoogleAdsense } from '../registry/google-adsense'
|
|
4
|
-
import { callOnce, onMounted, ref, watch } from '#imports'
|
|
5
|
-
import type { ElementScriptTrigger } from '#nuxt-scripts'
|
|
6
|
-
|
|
7
|
-
const props = withDefaults(defineProps<{
|
|
8
|
-
dataAdClient: string
|
|
9
|
-
dataAdSlot: string
|
|
10
|
-
dataAdFormat?: 'auto'
|
|
11
|
-
dataFullWidthResponsive?: boolean
|
|
12
|
-
/**
|
|
13
|
-
* Defines the trigger event to load the script.
|
|
14
|
-
*/
|
|
15
|
-
trigger?: ElementScriptTrigger
|
|
16
|
-
}>(), {
|
|
17
|
-
dataAdFormat: 'auto',
|
|
18
|
-
dataFullWidthResponsive: true,
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
const emits = defineEmits<{
|
|
22
|
-
// our emit
|
|
23
|
-
ready: [e: ReturnType<typeof useScriptGoogleAdsense>]
|
|
24
|
-
error: []
|
|
25
|
-
}>()
|
|
26
|
-
|
|
27
|
-
const rootEl = ref(null)
|
|
28
|
-
const trigger = useScriptTriggerElement({ trigger: props.trigger, el: rootEl })
|
|
29
|
-
|
|
30
|
-
const instance = useScriptGoogleAdsense({
|
|
31
|
-
client: props.dataAdClient,
|
|
32
|
-
scriptOptions: {
|
|
33
|
-
trigger,
|
|
34
|
-
},
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
const { $script } = instance
|
|
38
|
-
|
|
39
|
-
onMounted(() => {
|
|
40
|
-
callOnce(() => {
|
|
41
|
-
(window.adsbygoogle = window.adsbygoogle || []).push({})
|
|
42
|
-
})
|
|
43
|
-
watch(instance.$script.status, () => {
|
|
44
|
-
if (instance.$script.status.value === 'loaded') {
|
|
45
|
-
emits('ready', instance)
|
|
46
|
-
}
|
|
47
|
-
else if (instance.$script.status.value === 'error') {
|
|
48
|
-
emits('error')
|
|
49
|
-
}
|
|
50
|
-
})
|
|
51
|
-
})
|
|
52
|
-
</script>
|
|
53
|
-
|
|
54
|
-
<template>
|
|
55
|
-
<ins
|
|
56
|
-
ref="rootEl"
|
|
57
|
-
class="adsbygoogle"
|
|
58
|
-
style="display: block;"
|
|
59
|
-
:data-ad-client="dataAdClient"
|
|
60
|
-
:data-ad-slot="dataAdSlot"
|
|
61
|
-
:data-ad-format="dataAdFormat"
|
|
62
|
-
:data-full-width-responsive="dataFullWidthResponsive"
|
|
63
|
-
v-bind="{ ...$attrs }"
|
|
64
|
-
>
|
|
65
|
-
<slot v-if="$script.status.value === 'awaitingLoad'" name="awaitingLoad" />
|
|
66
|
-
<slot v-else-if="$script.status.value === 'loading'" name="loading" />
|
|
67
|
-
<slot v-else-if="$script.status.value === 'error'" name="error" />
|
|
68
|
-
</ins>
|
|
69
|
-
</template>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useScriptTriggerElement } from '../composables/useScriptTriggerElement'
|
|
3
|
+
import { useScriptGoogleAdsense } from '../registry/google-adsense'
|
|
4
|
+
import { callOnce, onMounted, ref, watch } from '#imports'
|
|
5
|
+
import type { ElementScriptTrigger } from '#nuxt-scripts'
|
|
6
|
+
|
|
7
|
+
const props = withDefaults(defineProps<{
|
|
8
|
+
dataAdClient: string
|
|
9
|
+
dataAdSlot: string
|
|
10
|
+
dataAdFormat?: 'auto'
|
|
11
|
+
dataFullWidthResponsive?: boolean
|
|
12
|
+
/**
|
|
13
|
+
* Defines the trigger event to load the script.
|
|
14
|
+
*/
|
|
15
|
+
trigger?: ElementScriptTrigger
|
|
16
|
+
}>(), {
|
|
17
|
+
dataAdFormat: 'auto',
|
|
18
|
+
dataFullWidthResponsive: true,
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
const emits = defineEmits<{
|
|
22
|
+
// our emit
|
|
23
|
+
ready: [e: ReturnType<typeof useScriptGoogleAdsense>]
|
|
24
|
+
error: []
|
|
25
|
+
}>()
|
|
26
|
+
|
|
27
|
+
const rootEl = ref(null)
|
|
28
|
+
const trigger = useScriptTriggerElement({ trigger: props.trigger, el: rootEl })
|
|
29
|
+
|
|
30
|
+
const instance = useScriptGoogleAdsense({
|
|
31
|
+
client: props.dataAdClient,
|
|
32
|
+
scriptOptions: {
|
|
33
|
+
trigger,
|
|
34
|
+
},
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
const { $script } = instance
|
|
38
|
+
|
|
39
|
+
onMounted(() => {
|
|
40
|
+
callOnce(() => {
|
|
41
|
+
(window.adsbygoogle = window.adsbygoogle || []).push({})
|
|
42
|
+
})
|
|
43
|
+
watch(instance.$script.status, () => {
|
|
44
|
+
if (instance.$script.status.value === 'loaded') {
|
|
45
|
+
emits('ready', instance)
|
|
46
|
+
}
|
|
47
|
+
else if (instance.$script.status.value === 'error') {
|
|
48
|
+
emits('error')
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
})
|
|
52
|
+
</script>
|
|
53
|
+
|
|
54
|
+
<template>
|
|
55
|
+
<ins
|
|
56
|
+
ref="rootEl"
|
|
57
|
+
class="adsbygoogle"
|
|
58
|
+
style="display: block;"
|
|
59
|
+
:data-ad-client="dataAdClient"
|
|
60
|
+
:data-ad-slot="dataAdSlot"
|
|
61
|
+
:data-ad-format="dataAdFormat"
|
|
62
|
+
:data-full-width-responsive="dataFullWidthResponsive"
|
|
63
|
+
v-bind="{ ...$attrs }"
|
|
64
|
+
>
|
|
65
|
+
<slot v-if="$script.status.value === 'awaitingLoad'" name="awaitingLoad" />
|
|
66
|
+
<slot v-else-if="$script.status.value === 'loading'" name="loading" />
|
|
67
|
+
<slot v-else-if="$script.status.value === 'error'" name="error" />
|
|
68
|
+
</ins>
|
|
69
|
+
</template>
|