@nuxt/scripts 0.11.10 → 0.12.0

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 (115) hide show
  1. package/dist/client/200.html +1 -1
  2. package/dist/client/404.html +1 -1
  3. package/dist/client/_nuxt/C0XnD8hU.js +179 -0
  4. package/dist/client/_nuxt/CVO1_9PV.js +1 -0
  5. package/dist/client/_nuxt/Cp-IABpG.js +1 -0
  6. package/dist/client/_nuxt/D0r3Knsf.js +1 -0
  7. package/dist/client/_nuxt/DDcnVyjk.js +1 -0
  8. package/dist/client/_nuxt/DlfHMoPT.js +1 -0
  9. package/dist/client/_nuxt/DnkQskw_.js +1 -0
  10. package/dist/client/_nuxt/builds/latest.json +1 -1
  11. package/dist/client/_nuxt/builds/meta/639547f1-5b38-4078-9f06-0e97166e98d5.json +1 -0
  12. package/dist/client/_nuxt/entry.Bb8Z00UZ.css +1 -0
  13. package/dist/client/_nuxt/error-404.CImBk2QF.css +1 -0
  14. package/dist/client/_nuxt/error-500.BDZhF_NY.css +1 -0
  15. package/dist/client/_nuxt/n57rOy2v.js +1 -0
  16. package/dist/client/index.html +1 -1
  17. package/dist/module.d.mts +8 -2
  18. package/dist/module.json +3 -3
  19. package/dist/module.mjs +169 -42
  20. package/dist/registry.mjs +30 -0
  21. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.d.vue.ts +0 -0
  22. package/dist/runtime/components/{ScriptGoogleMaps.vue → GoogleMaps/ScriptGoogleMaps.vue} +17 -13
  23. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue.d.ts +0 -0
  24. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.d.vue.ts +61 -0
  25. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.vue +86 -0
  26. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.vue.d.ts +61 -0
  27. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsCircle.d.vue.ts +33 -0
  28. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsCircle.vue +62 -0
  29. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsCircle.vue.d.ts +33 -0
  30. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsHeatmapLayer.d.vue.ts +5 -0
  31. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsHeatmapLayer.vue +32 -0
  32. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsHeatmapLayer.vue.d.ts +5 -0
  33. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsInfoWindow.d.vue.ts +35 -0
  34. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsInfoWindow.vue +88 -0
  35. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsInfoWindow.vue.d.ts +35 -0
  36. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.d.vue.ts +61 -0
  37. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.vue +84 -0
  38. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.vue.d.ts +61 -0
  39. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.d.vue.ts +27 -0
  40. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.vue +56 -0
  41. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.vue.d.ts +27 -0
  42. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPinElement.d.vue.ts +5 -0
  43. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPinElement.vue +37 -0
  44. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPinElement.vue.d.ts +5 -0
  45. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolygon.d.vue.ts +29 -0
  46. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolygon.vue +60 -0
  47. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolygon.vue.d.ts +29 -0
  48. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolyline.d.vue.ts +29 -0
  49. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolyline.vue +60 -0
  50. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolyline.vue.d.ts +29 -0
  51. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsRectangle.d.vue.ts +31 -0
  52. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsRectangle.vue +61 -0
  53. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsRectangle.vue.d.ts +31 -0
  54. package/dist/runtime/components/ScriptAriaLoadingIndicator.d.vue.ts +2 -0
  55. package/dist/runtime/components/ScriptCarbonAds.d.vue.ts +32 -0
  56. package/dist/runtime/components/ScriptCrisp.d.vue.ts +44 -0
  57. package/dist/runtime/components/ScriptCrisp.vue.d.ts +3 -1
  58. package/dist/runtime/components/ScriptGoogleAdsense.d.vue.ts +37 -0
  59. package/dist/runtime/components/ScriptGoogleAdsense.vue.d.ts +4 -1
  60. package/dist/runtime/components/ScriptIntercom.d.vue.ts +45 -0
  61. package/dist/runtime/components/ScriptIntercom.vue.d.ts +3 -1
  62. package/dist/runtime/components/ScriptLemonSqueezy.d.vue.ts +24 -0
  63. package/dist/runtime/components/ScriptLemonSqueezy.vue.d.ts +3 -1
  64. package/dist/runtime/components/ScriptLoadingIndicator.d.vue.ts +9 -0
  65. package/dist/runtime/components/ScriptLoadingIndicator.vue.d.ts +4 -1
  66. package/dist/runtime/components/ScriptPayPalButtons.d.vue.ts +72 -0
  67. package/dist/runtime/components/ScriptPayPalButtons.vue +116 -0
  68. package/dist/runtime/components/ScriptPayPalButtons.vue.d.ts +72 -0
  69. package/dist/runtime/components/ScriptPayPalMarks.d.vue.ts +51 -0
  70. package/dist/runtime/components/ScriptPayPalMarks.vue +69 -0
  71. package/dist/runtime/components/ScriptPayPalMarks.vue.d.ts +51 -0
  72. package/dist/runtime/components/ScriptPayPalMessages.d.vue.ts +67 -0
  73. package/dist/runtime/components/ScriptPayPalMessages.vue +90 -0
  74. package/dist/runtime/components/ScriptPayPalMessages.vue.d.ts +67 -0
  75. package/dist/runtime/components/ScriptStripePricingTable.d.vue.ts +35 -0
  76. package/dist/runtime/components/ScriptStripePricingTable.vue +1 -1
  77. package/dist/runtime/components/ScriptStripePricingTable.vue.d.ts +3 -1
  78. package/dist/runtime/components/ScriptVimeoPlayer.d.vue.ts +127 -0
  79. package/dist/runtime/components/ScriptVimeoPlayer.vue.d.ts +5 -3
  80. package/dist/runtime/components/ScriptYouTubePlayer.d.vue.ts +66 -0
  81. package/dist/runtime/components/ScriptYouTubePlayer.vue.d.ts +9 -1
  82. package/dist/runtime/composables/useScript.js +35 -2
  83. package/dist/runtime/composables/useScriptEventPage.js +6 -2
  84. package/dist/runtime/composables/useScriptTriggerIdleTimeout.d.ts +10 -0
  85. package/dist/runtime/composables/useScriptTriggerIdleTimeout.js +22 -0
  86. package/dist/runtime/composables/useScriptTriggerInteraction.d.ts +15 -0
  87. package/dist/runtime/composables/useScriptTriggerInteraction.js +35 -0
  88. package/dist/runtime/logger.d.ts +1 -0
  89. package/dist/runtime/logger.js +6 -0
  90. package/dist/runtime/registry/databuddy-analytics.d.ts +77 -0
  91. package/dist/runtime/registry/databuddy-analytics.js +103 -0
  92. package/dist/runtime/registry/google-analytics.d.ts +1 -1
  93. package/dist/runtime/registry/google-analytics.js +5 -5
  94. package/dist/runtime/registry/google-tag-manager.js +3 -5
  95. package/dist/runtime/registry/matomo-analytics.d.ts +1 -0
  96. package/dist/runtime/registry/matomo-analytics.js +27 -4
  97. package/dist/runtime/registry/paypal.d.ts +34 -0
  98. package/dist/runtime/registry/paypal.js +86 -0
  99. package/dist/runtime/registry/reddit-pixel.d.ts +18 -0
  100. package/dist/runtime/registry/reddit-pixel.js +36 -0
  101. package/dist/runtime/registry/stripe.d.ts +2 -2
  102. package/dist/runtime/registry/stripe.js +1 -1
  103. package/dist/runtime/types.d.ts +18 -7
  104. package/dist/runtime/utils.d.ts +5 -2
  105. package/dist/runtime/utils.js +49 -19
  106. package/package.json +33 -26
  107. package/dist/client/_nuxt/C0osJU87.js +0 -1
  108. package/dist/client/_nuxt/DvGN_dxb.js +0 -1
  109. package/dist/client/_nuxt/DzYp5PzF.js +0 -21
  110. package/dist/client/_nuxt/builds/meta/55b6d2d9-3309-4bdb-b3a7-e1a28ac5a730.json +0 -1
  111. package/dist/client/_nuxt/entry.bAQEPFjX.css +0 -1
  112. package/dist/client/_nuxt/error-404.eZgLTnTW.css +0 -1
  113. package/dist/client/_nuxt/error-500.B1rSPQ5Q.css +0 -1
  114. package/dist/client/_nuxt/o0sZgK8d.js +0 -1
  115. package/dist/runtime/components/ScriptGoogleMaps.vue.d.ts +0 -140
@@ -0,0 +1,51 @@
1
+ import { type HTMLAttributes, type ReservedProps } from 'vue';
2
+ import type { PayPalMarksComponentOptions } from '@paypal/paypal-js';
3
+ import type { ElementScriptTrigger } from '#nuxt-scripts/types';
4
+ import type { PayPalInput } from '../registry/paypal.js';
5
+ type __VLS_Props = {
6
+ /**
7
+ * Customize the root element attributes.
8
+ */
9
+ rootAttrs?: HTMLAttributes & ReservedProps & Record<string, unknown>;
10
+ /**
11
+ * Defines the trigger event to load the script.
12
+ */
13
+ trigger?: ElementScriptTrigger;
14
+ /**
15
+ * The client id for the paypal script.
16
+ */
17
+ clientId?: string;
18
+ /**
19
+ * The options for the paypal marks.
20
+ */
21
+ marksOptions?: PayPalMarksComponentOptions;
22
+ /**
23
+ * The paypal script options.
24
+ */
25
+ paypalScriptOptions?: Partial<PayPalInput>;
26
+ };
27
+ declare var __VLS_1: {}, __VLS_3: {}, __VLS_10: {}, __VLS_12: {}, __VLS_14: {};
28
+ type __VLS_Slots = {} & {
29
+ placeholder?: (props: typeof __VLS_1) => any;
30
+ } & {
31
+ loading?: (props: typeof __VLS_3) => any;
32
+ } & {
33
+ awaitingLoad?: (props: typeof __VLS_10) => any;
34
+ } & {
35
+ error?: (props: typeof __VLS_12) => any;
36
+ } & {
37
+ default?: (props: typeof __VLS_14) => any;
38
+ };
39
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
40
+ trigger: ElementScriptTrigger;
41
+ clientId: string;
42
+ paypalScriptOptions: Partial<PayPalInput>;
43
+ marksOptions: PayPalMarksComponentOptions;
44
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
45
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
46
+ export default _default;
47
+ type __VLS_WithSlots<T, S> = T & {
48
+ new (): {
49
+ $slots: S;
50
+ };
51
+ };
@@ -0,0 +1,69 @@
1
+ <script setup>
2
+ import { computed, onMounted, ref, shallowRef, watch } from "vue";
3
+ import { defu } from "defu";
4
+ import { useScriptPayPal } from "../registry/paypal";
5
+ import { useScriptTriggerElement } from "../composables/useScriptTriggerElement";
6
+ import { onBeforeUnmount, resolveComponent } from "vue";
7
+ const el = ref(null);
8
+ const rootEl = ref(null);
9
+ const props = defineProps({
10
+ rootAttrs: { type: Object, required: false },
11
+ trigger: { type: [String, Array, Boolean], required: false, default: "visible" },
12
+ clientId: { type: String, required: false, default: "test" },
13
+ marksOptions: { type: Object, required: false, default: () => ({}) },
14
+ paypalScriptOptions: { type: Object, required: false, default: () => ({}) }
15
+ });
16
+ const ready = ref(false);
17
+ const { onLoaded, status } = useScriptPayPal({
18
+ clientId: props.clientId,
19
+ ...props.paypalScriptOptions
20
+ });
21
+ const marksInst = shallowRef();
22
+ onMounted(() => {
23
+ onLoaded(async ({ paypal }) => {
24
+ if (!el.value) return;
25
+ marksInst.value = paypal?.Marks?.(props.marksOptions);
26
+ await marksInst.value?.render(el.value);
27
+ ready.value = true;
28
+ watch(() => props.marksOptions, async (_options) => {
29
+ if (!el.value) return;
30
+ destroy();
31
+ marksInst.value = paypal?.Marks?.(_options);
32
+ await marksInst.value?.render(el.value);
33
+ });
34
+ });
35
+ });
36
+ function destroy() {
37
+ if (!el.value) return;
38
+ el.value?.replaceChildren();
39
+ }
40
+ onBeforeUnmount(() => {
41
+ destroy();
42
+ });
43
+ const ScriptLoadingIndicator = resolveComponent("ScriptLoadingIndicator");
44
+ const trigger = useScriptTriggerElement({ trigger: props.trigger, el: rootEl });
45
+ const rootAttrs = computed(() => {
46
+ return defu(props.rootAttrs, {
47
+ "aria-busy": status.value === "loading",
48
+ "aria-label": status.value === "awaitingLoad" ? "PayPal Script Placeholder" : status.value === "loading" ? "PayPal Marks Loading" : "PayPal Marks",
49
+ "aria-live": "polite",
50
+ "role": "application",
51
+ ...trigger instanceof Promise ? trigger.ssrAttrs || {} : {}
52
+ });
53
+ });
54
+ </script>
55
+
56
+ <template>
57
+ <div v-bind="rootAttrs" id="test">
58
+ <div v-show="ready" ref="el" />
59
+ <slot v-if="!ready" name="placeholder">
60
+ placeholder
61
+ </slot>
62
+ <slot v-if="status !== 'awaitingLoad' && !ready" name="loading">
63
+ <ScriptLoadingIndicator color="black" />
64
+ </slot>
65
+ <slot v-if="status === 'awaitingLoad'" name="awaitingLoad" />
66
+ <slot v-else-if="status === 'error'" name="error" />
67
+ <slot />
68
+ </div>
69
+ </template>
@@ -0,0 +1,51 @@
1
+ import { type HTMLAttributes, type ReservedProps } from 'vue';
2
+ import type { PayPalMarksComponentOptions } from '@paypal/paypal-js';
3
+ import type { ElementScriptTrigger } from '#nuxt-scripts/types';
4
+ import type { PayPalInput } from '../registry/paypal.js';
5
+ type __VLS_Props = {
6
+ /**
7
+ * Customize the root element attributes.
8
+ */
9
+ rootAttrs?: HTMLAttributes & ReservedProps & Record<string, unknown>;
10
+ /**
11
+ * Defines the trigger event to load the script.
12
+ */
13
+ trigger?: ElementScriptTrigger;
14
+ /**
15
+ * The client id for the paypal script.
16
+ */
17
+ clientId?: string;
18
+ /**
19
+ * The options for the paypal marks.
20
+ */
21
+ marksOptions?: PayPalMarksComponentOptions;
22
+ /**
23
+ * The paypal script options.
24
+ */
25
+ paypalScriptOptions?: Partial<PayPalInput>;
26
+ };
27
+ declare var __VLS_1: {}, __VLS_3: {}, __VLS_10: {}, __VLS_12: {}, __VLS_14: {};
28
+ type __VLS_Slots = {} & {
29
+ placeholder?: (props: typeof __VLS_1) => any;
30
+ } & {
31
+ loading?: (props: typeof __VLS_3) => any;
32
+ } & {
33
+ awaitingLoad?: (props: typeof __VLS_10) => any;
34
+ } & {
35
+ error?: (props: typeof __VLS_12) => any;
36
+ } & {
37
+ default?: (props: typeof __VLS_14) => any;
38
+ };
39
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
40
+ trigger: ElementScriptTrigger;
41
+ clientId: string;
42
+ paypalScriptOptions: Partial<PayPalInput>;
43
+ marksOptions: PayPalMarksComponentOptions;
44
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
45
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
46
+ export default _default;
47
+ type __VLS_WithSlots<T, S> = T & {
48
+ new (): {
49
+ $slots: S;
50
+ };
51
+ };
@@ -0,0 +1,67 @@
1
+ import { type HTMLAttributes, type ReservedProps } from 'vue';
2
+ import type { PayPalMessagesComponentOptions } from '@paypal/paypal-js';
3
+ import type { ElementScriptTrigger } from '#nuxt-scripts/types';
4
+ import type { PayPalInput } from '../registry/paypal.js';
5
+ type __VLS_Props = {
6
+ /**
7
+ * Customize the root element attributes.
8
+ */
9
+ rootAttrs?: HTMLAttributes & ReservedProps & Record<string, unknown>;
10
+ /**
11
+ * Defines the trigger event to load the script.
12
+ */
13
+ trigger?: ElementScriptTrigger;
14
+ /**
15
+ * The client id for the paypal script.
16
+ */
17
+ clientId?: string;
18
+ /**
19
+ * The options for the paypal buttons.
20
+ */
21
+ messagesOptions?: PayPalMessagesComponentOptions;
22
+ /**
23
+ * The merchant id for the paypal script.
24
+ */
25
+ merchantId?: string;
26
+ /**
27
+ * The partner attribution id for the paypal script.
28
+ */
29
+ partnerAttributionId?: string;
30
+ /**
31
+ * The options for the paypal scipt.
32
+ */
33
+ paypalScriptOptions?: Partial<PayPalInput>;
34
+ };
35
+ declare var __VLS_1: {}, __VLS_3: {}, __VLS_10: {}, __VLS_12: {}, __VLS_14: {};
36
+ type __VLS_Slots = {} & {
37
+ placeholder?: (props: typeof __VLS_1) => any;
38
+ } & {
39
+ loading?: (props: typeof __VLS_3) => any;
40
+ } & {
41
+ awaitingLoad?: (props: typeof __VLS_10) => any;
42
+ } & {
43
+ error?: (props: typeof __VLS_12) => any;
44
+ } & {
45
+ default?: (props: typeof __VLS_14) => any;
46
+ };
47
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
48
+ render: (data: Record<string, unknown>) => any;
49
+ apply: (data: Record<string, unknown>) => any;
50
+ clickMessages: (data: Record<string, unknown>) => any;
51
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
52
+ onRender?: ((data: Record<string, unknown>) => any) | undefined;
53
+ onApply?: ((data: Record<string, unknown>) => any) | undefined;
54
+ onClickMessages?: ((data: Record<string, unknown>) => any) | undefined;
55
+ }>, {
56
+ trigger: ElementScriptTrigger;
57
+ clientId: string;
58
+ paypalScriptOptions: Partial<PayPalInput>;
59
+ messagesOptions: PayPalMessagesComponentOptions;
60
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
61
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
62
+ export default _default;
63
+ type __VLS_WithSlots<T, S> = T & {
64
+ new (): {
65
+ $slots: S;
66
+ };
67
+ };
@@ -0,0 +1,90 @@
1
+ <script setup>
2
+ import { computed, onMounted, ref, shallowRef, watch } from "vue";
3
+ import { defu } from "defu";
4
+ import { useScriptPayPal } from "../registry/paypal";
5
+ import { useScriptTriggerElement } from "../composables/useScriptTriggerElement";
6
+ import { onBeforeUnmount, resolveComponent } from "vue";
7
+ const el = ref(null);
8
+ const rootEl = ref(null);
9
+ const props = defineProps({
10
+ rootAttrs: { type: Object, required: false },
11
+ trigger: { type: [String, Array, Boolean], required: false, default: "visible" },
12
+ clientId: { type: String, required: false, default: "test" },
13
+ messagesOptions: { type: Object, required: false, default: () => ({}) },
14
+ merchantId: { type: String, required: false },
15
+ partnerAttributionId: { type: String, required: false },
16
+ paypalScriptOptions: { type: Object, required: false, default: () => ({}) }
17
+ });
18
+ const ready = ref(false);
19
+ const { onLoaded, status } = useScriptPayPal({
20
+ clientId: props.clientId,
21
+ merchantId: props.merchantId,
22
+ partnerAttributionId: props.partnerAttributionId,
23
+ ...props.paypalScriptOptions
24
+ });
25
+ const emit = defineEmits(["apply", "clickMessages", "render"]);
26
+ const options = computed(() => {
27
+ const _options = {
28
+ onApply: (data) => {
29
+ emit("apply", data);
30
+ return props.messagesOptions?.onApply?.(data);
31
+ },
32
+ onClick: (data) => {
33
+ emit("clickMessages", data);
34
+ return props.messagesOptions?.onClick?.(data);
35
+ },
36
+ onRender: (data) => {
37
+ emit("render", data);
38
+ return props.messagesOptions?.onRender?.(data);
39
+ }
40
+ };
41
+ return defu(_options, props.messagesOptions);
42
+ });
43
+ const messageInst = shallowRef();
44
+ onMounted(() => {
45
+ onLoaded(async ({ paypal }) => {
46
+ if (!el.value) return;
47
+ messageInst.value = paypal?.Messages?.(options.value);
48
+ await messageInst.value?.render(el.value);
49
+ ready.value = true;
50
+ watch(() => options.value, async (_options) => {
51
+ if (!el.value) return;
52
+ messageInst.value = paypal?.Messages?.(_options);
53
+ await messageInst.value?.render(el.value);
54
+ });
55
+ });
56
+ });
57
+ function destroy() {
58
+ if (!el.value) return;
59
+ el.value?.replaceChildren();
60
+ }
61
+ onBeforeUnmount(() => {
62
+ destroy();
63
+ });
64
+ const ScriptLoadingIndicator = resolveComponent("ScriptLoadingIndicator");
65
+ const trigger = useScriptTriggerElement({ trigger: props.trigger, el: rootEl });
66
+ const rootAttrs = computed(() => {
67
+ return defu(props.rootAttrs, {
68
+ "aria-busy": status.value === "loading",
69
+ "aria-label": status.value === "awaitingLoad" ? "PayPal Script Placeholder" : status.value === "loading" ? "PayPal Buttons Loading" : "PayPal Buttons",
70
+ "aria-live": "polite",
71
+ "role": "application",
72
+ ...trigger instanceof Promise ? trigger.ssrAttrs || {} : {}
73
+ });
74
+ });
75
+ </script>
76
+
77
+ <template>
78
+ <div v-bind="rootAttrs" id="test">
79
+ <div v-show="ready" ref="el" />
80
+ <slot v-if="!ready" name="placeholder">
81
+ placeholder
82
+ </slot>
83
+ <slot v-if="status !== 'awaitingLoad' && !ready" name="loading">
84
+ <ScriptLoadingIndicator color="black" />
85
+ </slot>
86
+ <slot v-if="status === 'awaitingLoad'" name="awaitingLoad" />
87
+ <slot v-else-if="status === 'error'" name="error" />
88
+ <slot />
89
+ </div>
90
+ </template>
@@ -0,0 +1,67 @@
1
+ import { type HTMLAttributes, type ReservedProps } from 'vue';
2
+ import type { PayPalMessagesComponentOptions } from '@paypal/paypal-js';
3
+ import type { ElementScriptTrigger } from '#nuxt-scripts/types';
4
+ import type { PayPalInput } from '../registry/paypal.js';
5
+ type __VLS_Props = {
6
+ /**
7
+ * Customize the root element attributes.
8
+ */
9
+ rootAttrs?: HTMLAttributes & ReservedProps & Record<string, unknown>;
10
+ /**
11
+ * Defines the trigger event to load the script.
12
+ */
13
+ trigger?: ElementScriptTrigger;
14
+ /**
15
+ * The client id for the paypal script.
16
+ */
17
+ clientId?: string;
18
+ /**
19
+ * The options for the paypal buttons.
20
+ */
21
+ messagesOptions?: PayPalMessagesComponentOptions;
22
+ /**
23
+ * The merchant id for the paypal script.
24
+ */
25
+ merchantId?: string;
26
+ /**
27
+ * The partner attribution id for the paypal script.
28
+ */
29
+ partnerAttributionId?: string;
30
+ /**
31
+ * The options for the paypal scipt.
32
+ */
33
+ paypalScriptOptions?: Partial<PayPalInput>;
34
+ };
35
+ declare var __VLS_1: {}, __VLS_3: {}, __VLS_10: {}, __VLS_12: {}, __VLS_14: {};
36
+ type __VLS_Slots = {} & {
37
+ placeholder?: (props: typeof __VLS_1) => any;
38
+ } & {
39
+ loading?: (props: typeof __VLS_3) => any;
40
+ } & {
41
+ awaitingLoad?: (props: typeof __VLS_10) => any;
42
+ } & {
43
+ error?: (props: typeof __VLS_12) => any;
44
+ } & {
45
+ default?: (props: typeof __VLS_14) => any;
46
+ };
47
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
48
+ render: (data: Record<string, unknown>) => any;
49
+ apply: (data: Record<string, unknown>) => any;
50
+ clickMessages: (data: Record<string, unknown>) => any;
51
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
52
+ onRender?: ((data: Record<string, unknown>) => any) | undefined;
53
+ onApply?: ((data: Record<string, unknown>) => any) | undefined;
54
+ onClickMessages?: ((data: Record<string, unknown>) => any) | undefined;
55
+ }>, {
56
+ trigger: ElementScriptTrigger;
57
+ clientId: string;
58
+ paypalScriptOptions: Partial<PayPalInput>;
59
+ messagesOptions: PayPalMessagesComponentOptions;
60
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
61
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
62
+ export default _default;
63
+ type __VLS_WithSlots<T, S> = T & {
64
+ new (): {
65
+ $slots: S;
66
+ };
67
+ };
@@ -0,0 +1,35 @@
1
+ import type { ElementScriptTrigger } from '../types.js';
2
+ type __VLS_Props = {
3
+ trigger?: ElementScriptTrigger;
4
+ publishableKey: string;
5
+ pricingTableId: string;
6
+ clientReferenceId?: string;
7
+ customerEmail?: string;
8
+ customerSessionClientSecret?: string;
9
+ };
10
+ declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {}, __VLS_7: {};
11
+ type __VLS_Slots = {} & {
12
+ loading?: (props: typeof __VLS_1) => any;
13
+ } & {
14
+ awaitingLoad?: (props: typeof __VLS_3) => any;
15
+ } & {
16
+ error?: (props: typeof __VLS_5) => any;
17
+ } & {
18
+ default?: (props: typeof __VLS_7) => any;
19
+ };
20
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
21
+ error: () => any;
22
+ ready: (args_0: import("../types.js").UseScriptContext<Record<string | symbol, any>>) => any;
23
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
24
+ onError?: (() => any) | undefined;
25
+ onReady?: ((args_0: import("../types.js").UseScriptContext<Record<string | symbol, any>>) => any) | undefined;
26
+ }>, {
27
+ trigger: ElementScriptTrigger;
28
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
29
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
30
+ export default _default;
31
+ type __VLS_WithSlots<T, S> = T & {
32
+ new (): {
33
+ $slots: S;
34
+ };
35
+ };
@@ -1,7 +1,7 @@
1
1
  <script setup>
2
2
  import { ref, computed, onBeforeUnmount, onMounted, watch } from "vue";
3
3
  import { useScriptTriggerElement } from "../composables/useScriptTriggerElement";
4
- import { useScript } from "#imports";
4
+ import { useScript } from "../composables/useScript";
5
5
  const props = defineProps({
6
6
  trigger: { type: [String, Array, Boolean], required: false, default: "visible" },
7
7
  publishableKey: { type: String, required: true },
@@ -23,7 +23,9 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}
23
23
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
24
24
  onError?: (() => any) | undefined;
25
25
  onReady?: ((args_0: import("../types.js").UseScriptContext<Record<string | symbol, any>>) => any) | undefined;
26
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
26
+ }>, {
27
+ trigger: ElementScriptTrigger;
28
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
29
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
28
30
  export default _default;
29
31
  type __VLS_WithSlots<T, S> = T & {
@@ -0,0 +1,127 @@
1
+ import type { HTMLAttributes, ImgHTMLAttributes } from 'vue';
2
+ import type { ElementScriptTrigger } from '../types.js';
3
+ interface VimeoOptions {
4
+ id?: number | undefined;
5
+ url?: string | undefined;
6
+ autopause?: boolean | undefined;
7
+ autoplay?: boolean | undefined;
8
+ background?: boolean | undefined;
9
+ byline?: boolean | undefined;
10
+ color?: string | undefined;
11
+ controls?: boolean | undefined;
12
+ dnt?: boolean | undefined;
13
+ height?: number | undefined;
14
+ interactive_params?: string | undefined;
15
+ keyboard?: boolean | undefined;
16
+ loop?: boolean | undefined;
17
+ maxheight?: number | undefined;
18
+ maxwidth?: number | undefined;
19
+ muted?: boolean | undefined;
20
+ pip?: boolean | undefined;
21
+ playsinline?: boolean | undefined;
22
+ portrait?: boolean | undefined;
23
+ responsive?: boolean | undefined;
24
+ speed?: boolean | undefined;
25
+ quality?: Vimeo.VimeoVideoQuality | undefined;
26
+ texttrack?: string | undefined;
27
+ title?: boolean | undefined;
28
+ transparent?: boolean | undefined;
29
+ width?: number | undefined;
30
+ }
31
+ type __VLS_Props = {
32
+ trigger?: ElementScriptTrigger;
33
+ placeholderAttrs?: ImgHTMLAttributes;
34
+ rootAttrs?: HTMLAttributes;
35
+ aboveTheFold?: boolean;
36
+ vimeoOptions?: VimeoOptions;
37
+ id?: number | undefined;
38
+ url?: string | undefined;
39
+ };
40
+ declare var __VLS_1: any, __VLS_3: {}, __VLS_9: {}, __VLS_11: {}, __VLS_13: {};
41
+ type __VLS_Slots = {} & {
42
+ placeholder?: (props: typeof __VLS_1) => any;
43
+ } & {
44
+ loading?: (props: typeof __VLS_3) => any;
45
+ } & {
46
+ awaitingLoad?: (props: typeof __VLS_9) => any;
47
+ } & {
48
+ error?: (props: typeof __VLS_11) => any;
49
+ } & {
50
+ default?: (props: typeof __VLS_13) => any;
51
+ };
52
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
53
+ play: () => Promise<void> | undefined;
54
+ pause: () => Promise<void> | undefined;
55
+ getDuration: () => Promise<number> | undefined;
56
+ getCurrentTime: () => Promise<number> | undefined;
57
+ setCurrentTime: (time: number) => Promise<number> | undefined;
58
+ getVolume: () => Promise<number> | undefined;
59
+ setVolume: (volume: number) => Promise<number> | undefined;
60
+ getPaused: () => Promise<boolean> | undefined;
61
+ getEnded: () => Promise<boolean> | undefined;
62
+ getLoop: () => Promise<boolean> | undefined;
63
+ setLoop: (loop: boolean) => Promise<boolean> | undefined;
64
+ getPlaybackRate: () => Promise<number> | undefined;
65
+ setPlaybackRate: (rate: number) => Promise<number> | undefined;
66
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
67
+ error: (event: import("@vimeo/player").Error, player: Vimeo.Player) => any;
68
+ loaded: (event: import("@vimeo/player").LoadedEvent, player: Vimeo.Player) => any;
69
+ cuechange: (event: import("@vimeo/player").CueChangeEvent, player: Vimeo.Player) => any;
70
+ durationchange: (event: import("@vimeo/player").DurationChangeEvent, player: Vimeo.Player) => any;
71
+ ended: (event: import("@vimeo/player").TimeEvent, player: Vimeo.Player) => any;
72
+ pause: (event: import("@vimeo/player").TimeEvent, player: Vimeo.Player) => any;
73
+ play: (event: import("@vimeo/player").TimeEvent, player: Vimeo.Player) => any;
74
+ playing: (event: import("@vimeo/player").TimeEvent, player: Vimeo.Player) => any;
75
+ progress: (event: import("@vimeo/player").TimeEvent, player: Vimeo.Player) => any;
76
+ resize: (event: import("@vimeo/player").ResizeEvent, player: Vimeo.Player) => any;
77
+ seeked: (event: import("@vimeo/player").TimeEvent, player: Vimeo.Player) => any;
78
+ seeking: (event: import("@vimeo/player").TimeEvent, player: Vimeo.Player) => any;
79
+ timeupdate: (event: import("@vimeo/player").TimeEvent, player: Vimeo.Player) => any;
80
+ volumechange: (event: import("@vimeo/player").VolumeChangeEvent, player: Vimeo.Player) => any;
81
+ fullscreenchange: (event: import("@vimeo/player").FullScreenChangeEvent, player: Vimeo.Player) => any;
82
+ texttrackchange: (event: import("@vimeo/player").TextTrackChangeEvent, player: Vimeo.Player) => any;
83
+ chapterchange: (event: import("@vimeo/player").VimeoChapter, player: Vimeo.Player) => any;
84
+ cuepoint: (event: import("@vimeo/player").CuePointEvent, player: Vimeo.Player) => any;
85
+ playbackratechange: (event: import("@vimeo/player").PlaybackRateEvent, player: Vimeo.Player) => any;
86
+ bufferstart: (event: never, player: Vimeo.Player) => any;
87
+ bufferend: (event: never, player: Vimeo.Player) => any;
88
+ qualitychange: (event: import("@vimeo/player").QualityChangeEvent, player: Vimeo.Player) => any;
89
+ camerachange: (event: import("@vimeo/player").VimeoCameraProps, player: Vimeo.Player) => any;
90
+ enterpictureinpicture: (event: never, player: Vimeo.Player) => any;
91
+ leavepictureinpicture: (event: never, player: Vimeo.Player) => any;
92
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
93
+ onError?: ((event: import("@vimeo/player").Error, player: Vimeo.Player) => any) | undefined;
94
+ onLoaded?: ((event: import("@vimeo/player").LoadedEvent, player: Vimeo.Player) => any) | undefined;
95
+ onCuechange?: ((event: import("@vimeo/player").CueChangeEvent, player: Vimeo.Player) => any) | undefined;
96
+ onDurationchange?: ((event: import("@vimeo/player").DurationChangeEvent, player: Vimeo.Player) => any) | undefined;
97
+ onEnded?: ((event: import("@vimeo/player").TimeEvent, player: Vimeo.Player) => any) | undefined;
98
+ onPause?: ((event: import("@vimeo/player").TimeEvent, player: Vimeo.Player) => any) | undefined;
99
+ onPlay?: ((event: import("@vimeo/player").TimeEvent, player: Vimeo.Player) => any) | undefined;
100
+ onPlaying?: ((event: import("@vimeo/player").TimeEvent, player: Vimeo.Player) => any) | undefined;
101
+ onProgress?: ((event: import("@vimeo/player").TimeEvent, player: Vimeo.Player) => any) | undefined;
102
+ onResize?: ((event: import("@vimeo/player").ResizeEvent, player: Vimeo.Player) => any) | undefined;
103
+ onSeeked?: ((event: import("@vimeo/player").TimeEvent, player: Vimeo.Player) => any) | undefined;
104
+ onSeeking?: ((event: import("@vimeo/player").TimeEvent, player: Vimeo.Player) => any) | undefined;
105
+ onTimeupdate?: ((event: import("@vimeo/player").TimeEvent, player: Vimeo.Player) => any) | undefined;
106
+ onVolumechange?: ((event: import("@vimeo/player").VolumeChangeEvent, player: Vimeo.Player) => any) | undefined;
107
+ onFullscreenchange?: ((event: import("@vimeo/player").FullScreenChangeEvent, player: Vimeo.Player) => any) | undefined;
108
+ onTexttrackchange?: ((event: import("@vimeo/player").TextTrackChangeEvent, player: Vimeo.Player) => any) | undefined;
109
+ onChapterchange?: ((event: import("@vimeo/player").VimeoChapter, player: Vimeo.Player) => any) | undefined;
110
+ onCuepoint?: ((event: import("@vimeo/player").CuePointEvent, player: Vimeo.Player) => any) | undefined;
111
+ onPlaybackratechange?: ((event: import("@vimeo/player").PlaybackRateEvent, player: Vimeo.Player) => any) | undefined;
112
+ onBufferstart?: ((event: never, player: Vimeo.Player) => any) | undefined;
113
+ onBufferend?: ((event: never, player: Vimeo.Player) => any) | undefined;
114
+ onQualitychange?: ((event: import("@vimeo/player").QualityChangeEvent, player: Vimeo.Player) => any) | undefined;
115
+ onCamerachange?: ((event: import("@vimeo/player").VimeoCameraProps, player: Vimeo.Player) => any) | undefined;
116
+ onEnterpictureinpicture?: ((event: never, player: Vimeo.Player) => any) | undefined;
117
+ onLeavepictureinpicture?: ((event: never, player: Vimeo.Player) => any) | undefined;
118
+ }>, {
119
+ trigger: ElementScriptTrigger;
120
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
121
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
122
+ export default _default;
123
+ type __VLS_WithSlots<T, S> = T & {
124
+ new (): {
125
+ $slots: S;
126
+ };
127
+ };
@@ -64,8 +64,8 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
64
64
  getPlaybackRate: () => Promise<number> | undefined;
65
65
  setPlaybackRate: (rate: number) => Promise<number> | undefined;
66
66
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
67
- loaded: (event: import("@vimeo/player").LoadedEvent, player: Vimeo.Player) => any;
68
67
  error: (event: import("@vimeo/player").Error, player: Vimeo.Player) => any;
68
+ loaded: (event: import("@vimeo/player").LoadedEvent, player: Vimeo.Player) => any;
69
69
  cuechange: (event: import("@vimeo/player").CueChangeEvent, player: Vimeo.Player) => any;
70
70
  durationchange: (event: import("@vimeo/player").DurationChangeEvent, player: Vimeo.Player) => any;
71
71
  ended: (event: import("@vimeo/player").TimeEvent, player: Vimeo.Player) => any;
@@ -90,8 +90,8 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
90
90
  enterpictureinpicture: (event: never, player: Vimeo.Player) => any;
91
91
  leavepictureinpicture: (event: never, player: Vimeo.Player) => any;
92
92
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
93
- onLoaded?: ((event: import("@vimeo/player").LoadedEvent, player: Vimeo.Player) => any) | undefined;
94
93
  onError?: ((event: import("@vimeo/player").Error, player: Vimeo.Player) => any) | undefined;
94
+ onLoaded?: ((event: import("@vimeo/player").LoadedEvent, player: Vimeo.Player) => any) | undefined;
95
95
  onCuechange?: ((event: import("@vimeo/player").CueChangeEvent, player: Vimeo.Player) => any) | undefined;
96
96
  onDurationchange?: ((event: import("@vimeo/player").DurationChangeEvent, player: Vimeo.Player) => any) | undefined;
97
97
  onEnded?: ((event: import("@vimeo/player").TimeEvent, player: Vimeo.Player) => any) | undefined;
@@ -115,7 +115,9 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
115
115
  onCamerachange?: ((event: import("@vimeo/player").VimeoCameraProps, player: Vimeo.Player) => any) | undefined;
116
116
  onEnterpictureinpicture?: ((event: never, player: Vimeo.Player) => any) | undefined;
117
117
  onLeavepictureinpicture?: ((event: never, player: Vimeo.Player) => any) | undefined;
118
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
118
+ }>, {
119
+ trigger: ElementScriptTrigger;
120
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
119
121
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
120
122
  export default _default;
121
123
  type __VLS_WithSlots<T, S> = T & {