@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
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import type { HTMLAttributes, ImgHTMLAttributes, Ref, ReservedProps } from 'vue';
|
|
2
|
+
import type { ElementScriptTrigger } from '../types.js';
|
|
3
|
+
import ScriptAriaLoadingIndicator from './ScriptAriaLoadingIndicator.vue.js';
|
|
4
|
+
interface PlaceholderOptions {
|
|
5
|
+
width?: string | number;
|
|
6
|
+
height?: string | number;
|
|
7
|
+
center?: string;
|
|
8
|
+
zoom?: number;
|
|
9
|
+
size?: string;
|
|
10
|
+
scale?: number;
|
|
11
|
+
format?: 'png' | 'jpg' | 'gif' | 'png8' | 'png32' | 'jpg-baseline';
|
|
12
|
+
maptype?: 'roadmap' | 'satellite' | 'terrain' | 'hybrid';
|
|
13
|
+
language?: string;
|
|
14
|
+
region?: string;
|
|
15
|
+
markers?: string;
|
|
16
|
+
path?: string;
|
|
17
|
+
visible?: string;
|
|
18
|
+
style?: string;
|
|
19
|
+
map_id?: string;
|
|
20
|
+
key?: string;
|
|
21
|
+
signature?: string;
|
|
22
|
+
}
|
|
23
|
+
type __VLS_Props = {
|
|
24
|
+
/**
|
|
25
|
+
* Defines the trigger event to load the script.
|
|
26
|
+
*/
|
|
27
|
+
trigger?: ElementScriptTrigger;
|
|
28
|
+
/**
|
|
29
|
+
* Is Google Maps being rendered above the fold?
|
|
30
|
+
* This will load the placeholder image with higher priority.
|
|
31
|
+
*/
|
|
32
|
+
aboveTheFold?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Defines the Google Maps API key. Must have access to the Static Maps API as well.
|
|
35
|
+
*/
|
|
36
|
+
apiKey?: string;
|
|
37
|
+
/**
|
|
38
|
+
* A latitude / longitude of where to focus the map.
|
|
39
|
+
*/
|
|
40
|
+
center?: google.maps.LatLng | google.maps.LatLngLiteral | `${string},${string}`;
|
|
41
|
+
/**
|
|
42
|
+
* Should a marker be displayed on the map where the centre is.
|
|
43
|
+
*/
|
|
44
|
+
centerMarker?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Options for the map.
|
|
47
|
+
*/
|
|
48
|
+
mapOptions?: google.maps.MapOptions;
|
|
49
|
+
/**
|
|
50
|
+
* Defines the region of the map.
|
|
51
|
+
*/
|
|
52
|
+
region?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Defines the language of the map
|
|
55
|
+
*/
|
|
56
|
+
language?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Defines the version of google maps js API
|
|
59
|
+
*/
|
|
60
|
+
version?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Defines the width of the map.
|
|
63
|
+
*/
|
|
64
|
+
width?: number | string;
|
|
65
|
+
/**
|
|
66
|
+
* Defines the height of the map
|
|
67
|
+
*/
|
|
68
|
+
height?: number | string;
|
|
69
|
+
/**
|
|
70
|
+
* Customize the placeholder image attributes.
|
|
71
|
+
*
|
|
72
|
+
* @see https://developers.google.com/maps/documentation/maps-static/start.
|
|
73
|
+
*/
|
|
74
|
+
placeholderOptions?: PlaceholderOptions;
|
|
75
|
+
/**
|
|
76
|
+
* Customize the placeholder image attributes.
|
|
77
|
+
*/
|
|
78
|
+
placeholderAttrs?: ImgHTMLAttributes & ReservedProps & Record<string, unknown>;
|
|
79
|
+
/**
|
|
80
|
+
* Customize the root element attributes.
|
|
81
|
+
*/
|
|
82
|
+
rootAttrs?: HTMLAttributes & ReservedProps & Record<string, unknown>;
|
|
83
|
+
/**
|
|
84
|
+
* Extra Markers to add to the map.
|
|
85
|
+
*/
|
|
86
|
+
markers?: (`${string},${string}` | google.maps.marker.AdvancedMarkerElementOptions)[];
|
|
87
|
+
};
|
|
88
|
+
declare const rootEl: Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
|
89
|
+
declare const mapEl: Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
|
90
|
+
declare const status: Ref<import("@unhead/vue").UseScriptStatus, import("@unhead/vue").UseScriptStatus>;
|
|
91
|
+
declare const ready: Ref<boolean, boolean>;
|
|
92
|
+
declare function createAdvancedMapMarker(_options?: google.maps.marker.AdvancedMarkerElementOptions | `${string},${string}`): Promise<google.maps.marker.AdvancedMarkerElement | undefined>;
|
|
93
|
+
declare function resolveQueryToLatLang(query: string): Promise<google.maps.LatLng | undefined>;
|
|
94
|
+
declare function importLibrary(key: 'marker'): Promise<google.maps.MarkerLibrary>;
|
|
95
|
+
declare function importLibrary(key: 'places'): Promise<google.maps.PlacesLibrary>;
|
|
96
|
+
declare function importLibrary(key: 'geometry'): Promise<google.maps.GeometryLibrary>;
|
|
97
|
+
declare function importLibrary(key: 'drawing'): Promise<google.maps.DrawingLibrary>;
|
|
98
|
+
declare function importLibrary(key: 'visualization'): Promise<google.maps.VisualizationLibrary>;
|
|
99
|
+
declare function importLibrary(key: string): Promise<any>;
|
|
100
|
+
declare const placeholder: import("vue").ComputedRef<string>;
|
|
101
|
+
declare const placeholderAttrs: import("vue").ComputedRef<Omit<ImgHTMLAttributes & ReservedProps & Record<string, unknown>, "style" | "src" | "loading" | "alt"> & Omit<{
|
|
102
|
+
src: string;
|
|
103
|
+
alt: string;
|
|
104
|
+
loading: "eager" | "lazy";
|
|
105
|
+
style: {
|
|
106
|
+
cursor: "pointer";
|
|
107
|
+
width: string;
|
|
108
|
+
objectFit: "cover";
|
|
109
|
+
height: string;
|
|
110
|
+
};
|
|
111
|
+
}, "style" | "src" | "loading" | "alt"> & {
|
|
112
|
+
style: string | false | import("vue").StyleValue[] | {
|
|
113
|
+
cursor: "pointer";
|
|
114
|
+
width: string;
|
|
115
|
+
objectFit: "cover";
|
|
116
|
+
height: string;
|
|
117
|
+
} | (Omit<import("vue").CSSProperties, "width" | "height" | "cursor" | "objectFit"> & Omit<{
|
|
118
|
+
cursor: "pointer";
|
|
119
|
+
width: string;
|
|
120
|
+
objectFit: "cover";
|
|
121
|
+
height: string;
|
|
122
|
+
}, "width" | "height" | "cursor" | "objectFit"> & {
|
|
123
|
+
width: string | number | (string & {});
|
|
124
|
+
height: string | number | (string & {});
|
|
125
|
+
cursor: "alias" | "default" | "auto" | "help" | "copy" | "progress" | "none" | "text" | (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-grab" | "-webkit-grab" | "all-scroll" | "cell" | "col-resize" | "context-menu" | "crosshair" | "e-resize" | "ew-resize" | "grab" | "grabbing" | "move" | "n-resize" | "ne-resize" | "nesw-resize" | "no-drop" | "not-allowed" | "ns-resize" | "nw-resize" | "nwse-resize" | "pointer" | "row-resize" | "s-resize" | "se-resize" | "sw-resize" | "vertical-text" | "w-resize" | "wait" | "zoom-in" | "zoom-out";
|
|
126
|
+
objectFit: "fill" | "none" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "contain" | "cover" | "scale-down";
|
|
127
|
+
});
|
|
128
|
+
src: string;
|
|
129
|
+
loading: "eager" | "lazy";
|
|
130
|
+
alt: string;
|
|
131
|
+
}>;
|
|
132
|
+
declare const rootAttrs: import("vue").ComputedRef<HTMLAttributes>;
|
|
133
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
134
|
+
declare var __VLS_1: {
|
|
135
|
+
placeholder: any;
|
|
136
|
+
}, __VLS_3: {}, __VLS_8: {}, __VLS_10: {}, __VLS_12: {};
|
|
137
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
138
|
+
placeholder?: (props: typeof __VLS_1) => any;
|
|
139
|
+
} & {
|
|
140
|
+
loading?: (props: typeof __VLS_3) => any;
|
|
141
|
+
} & {
|
|
142
|
+
awaitingLoad?: (props: typeof __VLS_8) => any;
|
|
143
|
+
} & {
|
|
144
|
+
error?: (props: typeof __VLS_10) => any;
|
|
145
|
+
} & {
|
|
146
|
+
default?: (props: typeof __VLS_12) => any;
|
|
147
|
+
}>;
|
|
148
|
+
declare const __VLS_self: import("vue").DefineComponent<__VLS_Props, {
|
|
149
|
+
ScriptAriaLoadingIndicator: typeof ScriptAriaLoadingIndicator;
|
|
150
|
+
rootEl: typeof rootEl;
|
|
151
|
+
mapEl: typeof mapEl;
|
|
152
|
+
status: typeof status;
|
|
153
|
+
ready: typeof ready;
|
|
154
|
+
placeholder: typeof placeholder;
|
|
155
|
+
placeholderAttrs: typeof placeholderAttrs;
|
|
156
|
+
rootAttrs: typeof rootAttrs;
|
|
157
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
158
|
+
error: () => any;
|
|
159
|
+
ready: (e: {
|
|
160
|
+
readonly googleMaps: Ref<typeof google.maps | undefined, typeof google.maps | undefined>;
|
|
161
|
+
readonly map: Ref<google.maps.Map | undefined, google.maps.Map | undefined>;
|
|
162
|
+
readonly createAdvancedMapMarker: typeof createAdvancedMapMarker;
|
|
163
|
+
readonly resolveQueryToLatLang: typeof resolveQueryToLatLang;
|
|
164
|
+
readonly importLibrary: typeof importLibrary;
|
|
165
|
+
}) => any;
|
|
166
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
167
|
+
onError?: (() => any) | undefined;
|
|
168
|
+
onReady?: ((e: {
|
|
169
|
+
readonly googleMaps: Ref<typeof google.maps | undefined, typeof google.maps | undefined>;
|
|
170
|
+
readonly map: Ref<google.maps.Map | undefined, google.maps.Map | undefined>;
|
|
171
|
+
readonly createAdvancedMapMarker: typeof createAdvancedMapMarker;
|
|
172
|
+
readonly resolveQueryToLatLang: typeof resolveQueryToLatLang;
|
|
173
|
+
readonly importLibrary: typeof importLibrary;
|
|
174
|
+
}) => any) | undefined;
|
|
175
|
+
}>, {
|
|
176
|
+
trigger: ElementScriptTrigger;
|
|
177
|
+
width: number | string;
|
|
178
|
+
height: number | string;
|
|
179
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
180
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
|
|
181
|
+
googleMaps: Ref<typeof google.maps | undefined, typeof google.maps | undefined>;
|
|
182
|
+
map: Ref<google.maps.Map | undefined, google.maps.Map | undefined>;
|
|
183
|
+
createAdvancedMapMarker: typeof createAdvancedMapMarker;
|
|
184
|
+
resolveQueryToLatLang: typeof resolveQueryToLatLang;
|
|
185
|
+
importLibrary: typeof importLibrary;
|
|
186
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
187
|
+
error: () => any;
|
|
188
|
+
ready: (e: {
|
|
189
|
+
readonly googleMaps: Ref<typeof google.maps | undefined, typeof google.maps | undefined>;
|
|
190
|
+
readonly map: Ref<google.maps.Map | undefined, google.maps.Map | undefined>;
|
|
191
|
+
readonly createAdvancedMapMarker: typeof createAdvancedMapMarker;
|
|
192
|
+
readonly resolveQueryToLatLang: typeof resolveQueryToLatLang;
|
|
193
|
+
readonly importLibrary: typeof importLibrary;
|
|
194
|
+
}) => any;
|
|
195
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
196
|
+
onError?: (() => any) | undefined;
|
|
197
|
+
onReady?: ((e: {
|
|
198
|
+
readonly googleMaps: Ref<typeof google.maps | undefined, typeof google.maps | undefined>;
|
|
199
|
+
readonly map: Ref<google.maps.Map | undefined, google.maps.Map | undefined>;
|
|
200
|
+
readonly createAdvancedMapMarker: typeof createAdvancedMapMarker;
|
|
201
|
+
readonly resolveQueryToLatLang: typeof resolveQueryToLatLang;
|
|
202
|
+
readonly importLibrary: typeof importLibrary;
|
|
203
|
+
}) => any) | undefined;
|
|
204
|
+
}>, {
|
|
205
|
+
trigger: ElementScriptTrigger;
|
|
206
|
+
width: number | string;
|
|
207
|
+
height: number | string;
|
|
208
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
209
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
210
|
+
export default _default;
|
|
211
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
212
|
+
new (): {
|
|
213
|
+
$slots: S;
|
|
214
|
+
};
|
|
215
|
+
};
|
|
@@ -1,37 +1,22 @@
|
|
|
1
|
-
<script setup
|
|
2
|
-
import { ref, onMounted, watch, onBeforeUnmount, computed } from
|
|
3
|
-
import { useScriptIntercom } from
|
|
4
|
-
import { useScriptTriggerElement } from
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
trigger?: ElementScriptTrigger
|
|
21
|
-
}>(), {
|
|
22
|
-
trigger: 'click',
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
const emits = defineEmits<{
|
|
26
|
-
// our emit
|
|
27
|
-
ready: [e: ReturnType<typeof useScriptIntercom>]
|
|
28
|
-
error: []
|
|
29
|
-
}>()
|
|
30
|
-
|
|
31
|
-
const rootEl = ref(null)
|
|
32
|
-
const trigger = useScriptTriggerElement({ trigger: props.trigger, el: rootEl })
|
|
33
|
-
|
|
34
|
-
const isReady = ref(false)
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref, onMounted, watch, onBeforeUnmount, computed } from "vue";
|
|
3
|
+
import { useScriptIntercom } from "../registry/intercom";
|
|
4
|
+
import { useScriptTriggerElement } from "../composables/useScriptTriggerElement";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
appId: { type: String, required: true },
|
|
7
|
+
apiBase: { type: String, required: false },
|
|
8
|
+
name: { type: String, required: false },
|
|
9
|
+
email: { type: String, required: false },
|
|
10
|
+
userId: { type: String, required: false },
|
|
11
|
+
alignment: { type: String, required: false },
|
|
12
|
+
horizontalPadding: { type: Number, required: false },
|
|
13
|
+
verticalPadding: { type: Number, required: false },
|
|
14
|
+
trigger: { type: [String, Array, Boolean], required: false, default: "click" }
|
|
15
|
+
});
|
|
16
|
+
const emits = defineEmits(["ready", "error"]);
|
|
17
|
+
const rootEl = ref(null);
|
|
18
|
+
const trigger = useScriptTriggerElement({ trigger: props.trigger, el: rootEl });
|
|
19
|
+
const isReady = ref(false);
|
|
35
20
|
const intercom = useScriptIntercom({
|
|
36
21
|
app_id: props.appId,
|
|
37
22
|
// @ts-expect-error untyped
|
|
@@ -43,51 +28,47 @@ const intercom = useScriptIntercom({
|
|
|
43
28
|
horizontal_padding: props.horizontalPadding,
|
|
44
29
|
vertical_padding: props.verticalPadding,
|
|
45
30
|
scriptOptions: {
|
|
46
|
-
trigger
|
|
47
|
-
}
|
|
48
|
-
})
|
|
49
|
-
const { status, onLoaded } = intercom
|
|
50
|
-
if (props.trigger ===
|
|
31
|
+
trigger
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const { status, onLoaded } = intercom;
|
|
35
|
+
if (props.trigger === "click") {
|
|
51
36
|
onLoaded((instance) => {
|
|
52
|
-
instance.Intercom(
|
|
53
|
-
})
|
|
37
|
+
instance.Intercom("show");
|
|
38
|
+
});
|
|
54
39
|
}
|
|
55
|
-
|
|
56
40
|
defineExpose({
|
|
57
|
-
intercom
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
let observer: MutationObserver
|
|
41
|
+
intercom
|
|
42
|
+
});
|
|
43
|
+
let observer;
|
|
61
44
|
onMounted(() => {
|
|
62
|
-
watch(status, (
|
|
63
|
-
if (
|
|
45
|
+
watch(status, (status2) => {
|
|
46
|
+
if (status2 === "loading") {
|
|
64
47
|
observer = new MutationObserver(() => {
|
|
65
|
-
if (document.getElementById(
|
|
66
|
-
isReady.value = true
|
|
67
|
-
emits(
|
|
68
|
-
observer.disconnect()
|
|
48
|
+
if (document.getElementById("intercom-frame")) {
|
|
49
|
+
isReady.value = true;
|
|
50
|
+
emits("ready", intercom);
|
|
51
|
+
observer.disconnect();
|
|
69
52
|
}
|
|
70
|
-
})
|
|
71
|
-
observer.observe(document.body, { childList: true, subtree: true })
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
})
|
|
53
|
+
});
|
|
54
|
+
observer.observe(document.body, { childList: true, subtree: true });
|
|
55
|
+
} else if (status2 === "error")
|
|
56
|
+
emits("error");
|
|
57
|
+
});
|
|
58
|
+
});
|
|
77
59
|
onBeforeUnmount(() => {
|
|
78
|
-
observer?.disconnect()
|
|
79
|
-
})
|
|
80
|
-
|
|
60
|
+
observer?.disconnect();
|
|
61
|
+
});
|
|
81
62
|
const rootAttrs = computed(() => {
|
|
82
63
|
return {
|
|
83
64
|
style: {
|
|
84
|
-
display: isReady.value ?
|
|
65
|
+
display: isReady.value ? "none" : "block",
|
|
85
66
|
bottom: `${props.verticalPadding || 20}px`,
|
|
86
|
-
[props.alignment ||
|
|
67
|
+
[props.alignment || "right"]: `${props.horizontalPadding || 20}px`
|
|
87
68
|
},
|
|
88
|
-
...
|
|
89
|
-
}
|
|
90
|
-
})
|
|
69
|
+
...trigger instanceof Promise ? trigger.ssrAttrs || {} : {}
|
|
70
|
+
};
|
|
71
|
+
});
|
|
91
72
|
</script>
|
|
92
73
|
|
|
93
74
|
<template>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { ElementScriptTrigger } from '#nuxt-scripts/types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
appId: string;
|
|
4
|
+
apiBase?: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
email?: string;
|
|
7
|
+
userId?: string;
|
|
8
|
+
alignment?: 'left' | 'right';
|
|
9
|
+
horizontalPadding?: number;
|
|
10
|
+
verticalPadding?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Defines the trigger event to load the script.
|
|
13
|
+
*/
|
|
14
|
+
trigger?: ElementScriptTrigger;
|
|
15
|
+
};
|
|
16
|
+
declare const rootEl: import("vue").Ref<null, null>;
|
|
17
|
+
declare const isReady: import("vue").Ref<boolean, boolean>;
|
|
18
|
+
declare const status: import("vue").Ref<import("@unhead/vue").UseScriptStatus, import("@unhead/vue").UseScriptStatus>;
|
|
19
|
+
declare const rootAttrs: import("vue").ComputedRef<{
|
|
20
|
+
style: {
|
|
21
|
+
[x: string]: string;
|
|
22
|
+
display: string;
|
|
23
|
+
bottom: string;
|
|
24
|
+
};
|
|
25
|
+
}>;
|
|
26
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
27
|
+
declare var __VLS_1: {
|
|
28
|
+
ready: any;
|
|
29
|
+
}, __VLS_3: {}, __VLS_5: {}, __VLS_7: {};
|
|
30
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
31
|
+
default?: (props: typeof __VLS_1) => any;
|
|
32
|
+
} & {
|
|
33
|
+
awaitingLoad?: (props: typeof __VLS_3) => any;
|
|
34
|
+
} & {
|
|
35
|
+
loading?: (props: typeof __VLS_5) => any;
|
|
36
|
+
} & {
|
|
37
|
+
error?: (props: typeof __VLS_7) => any;
|
|
38
|
+
}>;
|
|
39
|
+
declare const __VLS_self: import("vue").DefineComponent<__VLS_Props, {
|
|
40
|
+
rootEl: typeof rootEl;
|
|
41
|
+
isReady: typeof isReady;
|
|
42
|
+
status: typeof status;
|
|
43
|
+
rootAttrs: typeof rootAttrs;
|
|
44
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
45
|
+
error: () => any;
|
|
46
|
+
ready: (e: import("#nuxt-scripts/types").UseScriptContext<import("../registry/intercom.js").IntercomApi>) => any;
|
|
47
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
48
|
+
onError?: (() => any) | undefined;
|
|
49
|
+
onReady?: ((e: import("#nuxt-scripts/types").UseScriptContext<import("../registry/intercom.js").IntercomApi>) => any) | undefined;
|
|
50
|
+
}>, {
|
|
51
|
+
trigger: ElementScriptTrigger;
|
|
52
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
53
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
|
|
54
|
+
intercom: import("#nuxt-scripts/types").UseScriptContext<import("../registry/intercom.js").IntercomApi>;
|
|
55
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
56
|
+
error: () => any;
|
|
57
|
+
ready: (e: import("#nuxt-scripts/types").UseScriptContext<import("../registry/intercom.js").IntercomApi>) => any;
|
|
58
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
59
|
+
onError?: (() => any) | undefined;
|
|
60
|
+
onReady?: ((e: import("#nuxt-scripts/types").UseScriptContext<import("../registry/intercom.js").IntercomApi>) => any) | undefined;
|
|
61
|
+
}>, {
|
|
62
|
+
trigger: ElementScriptTrigger;
|
|
63
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
64
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
65
|
+
export default _default;
|
|
66
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
67
|
+
new (): {
|
|
68
|
+
$slots: S;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
@@ -1,48 +1,37 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import { computed, onMounted, ref } from
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
trigger: 'visible',
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
const emits = defineEmits<{
|
|
15
|
-
ready: [ReturnType<typeof useScriptLemonSqueezy>]
|
|
16
|
-
lemonSqueezyEvent: [LemonSqueezyEventPayload]
|
|
17
|
-
}>()
|
|
18
|
-
|
|
19
|
-
const rootEl = ref<HTMLElement | null>(null)
|
|
20
|
-
const trigger = useScriptTriggerElement({ trigger: props.trigger, el: rootEl })
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, onMounted, ref } from "vue";
|
|
3
|
+
import { useScriptTriggerElement } from "../composables/useScriptTriggerElement";
|
|
4
|
+
import { useScriptLemonSqueezy } from "../registry/lemon-squeezy";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
trigger: { type: [String, Array, Boolean], required: false, default: "visible" }
|
|
7
|
+
});
|
|
8
|
+
const emits = defineEmits(["ready", "lemonSqueezyEvent"]);
|
|
9
|
+
const rootEl = ref(null);
|
|
10
|
+
const trigger = useScriptTriggerElement({ trigger: props.trigger, el: rootEl });
|
|
21
11
|
const instance = useScriptLemonSqueezy({
|
|
22
12
|
scriptOptions: {
|
|
23
|
-
trigger
|
|
24
|
-
}
|
|
25
|
-
})
|
|
13
|
+
trigger
|
|
14
|
+
}
|
|
15
|
+
});
|
|
26
16
|
onMounted(() => {
|
|
27
|
-
rootEl.value?.querySelectorAll(
|
|
28
|
-
a.classList.add(
|
|
29
|
-
})
|
|
17
|
+
rootEl.value?.querySelectorAll("a[href]").forEach((a) => {
|
|
18
|
+
a.classList.add("lemonsqueezy-button");
|
|
19
|
+
});
|
|
30
20
|
instance.onLoaded(({ Setup, Refresh }) => {
|
|
31
21
|
Setup({
|
|
32
22
|
eventHandler(event) {
|
|
33
|
-
emits(
|
|
34
|
-
}
|
|
35
|
-
})
|
|
36
|
-
Refresh()
|
|
37
|
-
emits(
|
|
38
|
-
})
|
|
39
|
-
})
|
|
40
|
-
|
|
23
|
+
emits("lemonSqueezyEvent", event);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
Refresh();
|
|
27
|
+
emits("ready", instance);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
41
30
|
const rootAttrs = computed(() => {
|
|
42
31
|
return {
|
|
43
|
-
...
|
|
44
|
-
}
|
|
45
|
-
})
|
|
32
|
+
...trigger instanceof Promise ? trigger.ssrAttrs || {} : {}
|
|
33
|
+
};
|
|
34
|
+
});
|
|
46
35
|
</script>
|
|
47
36
|
|
|
48
37
|
<template>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ElementScriptTrigger } from '../types.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
trigger?: ElementScriptTrigger;
|
|
4
|
+
};
|
|
5
|
+
declare const rootEl: import("vue").Ref<HTMLElement | null, HTMLElement | null>;
|
|
6
|
+
declare const rootAttrs: import("vue").ComputedRef<{
|
|
7
|
+
[x: string]: string;
|
|
8
|
+
}>;
|
|
9
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
10
|
+
declare var __VLS_1: {};
|
|
11
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
12
|
+
default?: (props: typeof __VLS_1) => any;
|
|
13
|
+
}>;
|
|
14
|
+
declare const __VLS_self: import("vue").DefineComponent<__VLS_Props, {
|
|
15
|
+
rootEl: typeof rootEl;
|
|
16
|
+
rootAttrs: typeof rootAttrs;
|
|
17
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
|
+
ready: (args_0: import("../types.js").UseScriptContext<import("../registry/lemon-squeezy.js").LemonSqueezyApi>) => any;
|
|
19
|
+
lemonSqueezyEvent: (args_0: never) => any;
|
|
20
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
21
|
+
onReady?: ((args_0: import("../types.js").UseScriptContext<import("../registry/lemon-squeezy.js").LemonSqueezyApi>) => any) | undefined;
|
|
22
|
+
onLemonSqueezyEvent?: ((args_0: never) => any) | undefined;
|
|
23
|
+
}>, {
|
|
24
|
+
trigger: ElementScriptTrigger;
|
|
25
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
27
|
+
ready: (args_0: import("../types.js").UseScriptContext<import("../registry/lemon-squeezy.js").LemonSqueezyApi>) => any;
|
|
28
|
+
lemonSqueezyEvent: (args_0: never) => any;
|
|
29
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
30
|
+
onReady?: ((args_0: import("../types.js").UseScriptContext<import("../registry/lemon-squeezy.js").LemonSqueezyApi>) => any) | undefined;
|
|
31
|
+
onLemonSqueezyEvent?: ((args_0: never) => any) | undefined;
|
|
32
|
+
}>, {
|
|
33
|
+
trigger: ElementScriptTrigger;
|
|
34
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
36
|
+
export default _default;
|
|
37
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
38
|
+
new (): {
|
|
39
|
+
$slots: S;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
<script setup
|
|
2
|
-
import { computed } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}>(), {
|
|
8
|
-
color: 'currentColor',
|
|
9
|
-
size: 30,
|
|
10
|
-
})
|
|
11
|
-
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
color: { type: String, required: false, default: "currentColor" },
|
|
5
|
+
size: { type: Number, required: false, default: 30 }
|
|
6
|
+
});
|
|
12
7
|
const styles = computed(() => ({
|
|
13
8
|
width: `${props.size}px`,
|
|
14
|
-
height: `${props.size}px
|
|
15
|
-
}))
|
|
9
|
+
height: `${props.size}px`
|
|
10
|
+
}));
|
|
16
11
|
</script>
|
|
17
12
|
|
|
18
13
|
<template>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
color?: string;
|
|
3
|
+
size?: number;
|
|
4
|
+
};
|
|
5
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
6
|
+
color: string;
|
|
7
|
+
size: number;
|
|
8
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
export default _default;
|