@nuxt/scripts 2.0.0-beta.6 → 2.0.0-beta.8
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/devtools-client/200.html +1 -1
- package/dist/devtools-client/404.html +1 -1
- package/dist/devtools-client/_nuxt/{Bagqfgzu.js → BBRrg_AT.js} +3 -3
- package/dist/devtools-client/_nuxt/{CP6K2Qm6.js → BI6wdYky.js} +1 -1
- package/dist/devtools-client/_nuxt/{CWci3Eb_.js → BckE5qrE.js} +1 -1
- package/dist/devtools-client/_nuxt/{D_hceTm9.js → Cs0md1ml.js} +1 -1
- package/dist/devtools-client/_nuxt/{DZ6h2v9A.js → DN3hUMR_.js} +1 -1
- package/dist/devtools-client/_nuxt/{DXDqMNFL.js → DXEYGql4.js} +1 -1
- package/dist/devtools-client/_nuxt/{utTTwIIR.js → Divy0_cA.js} +3 -3
- package/dist/devtools-client/_nuxt/builds/latest.json +1 -1
- package/dist/devtools-client/_nuxt/builds/meta/afe20d38-a0b8-4d9f-be82-37b90ecac717.json +1 -0
- package/dist/devtools-client/_nuxt/error-404.BJ1JSMYb.css +1 -0
- package/dist/devtools-client/_nuxt/error-500.BBf0uW5X.css +1 -0
- package/dist/devtools-client/docs/index.html +1 -1
- package/dist/devtools-client/first-party/index.html +1 -1
- package/dist/devtools-client/index.html +1 -1
- package/dist/devtools-client/registry/index.html +1 -1
- package/dist/module.d.mts +1 -0
- package/dist/module.d.ts +1 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +4 -1
- package/dist/registry.mjs +24 -1
- package/dist/runtime/components/Leaflet/ScriptLeafletMap.d.vue.ts +5 -5
- package/dist/runtime/components/Leaflet/ScriptLeafletMap.vue.d.ts +5 -5
- package/dist/runtime/components/MapLibre/ScriptMapLibreAttributionControl.d.vue.ts +7 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreAttributionControl.vue +42 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreAttributionControl.vue.d.ts +7 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreFullscreenControl.d.vue.ts +13 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreFullscreenControl.vue +27 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreFullscreenControl.vue.d.ts +13 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreGeoJson.d.vue.ts +26 -35
- package/dist/runtime/components/MapLibre/ScriptMapLibreGeoJson.vue +233 -15
- package/dist/runtime/components/MapLibre/ScriptMapLibreGeoJson.vue.d.ts +26 -35
- package/dist/runtime/components/MapLibre/ScriptMapLibreGeolocateControl.d.vue.ts +25 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreGeolocateControl.vue +49 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreGeolocateControl.vue.d.ts +25 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreMap.d.vue.ts +22 -86
- package/dist/runtime/components/MapLibre/ScriptMapLibreMap.vue +23 -2
- package/dist/runtime/components/MapLibre/ScriptMapLibreMap.vue.d.ts +22 -86
- package/dist/runtime/components/MapLibre/ScriptMapLibreMarker.d.vue.ts +3 -12
- package/dist/runtime/components/MapLibre/ScriptMapLibreMarker.vue.d.ts +3 -12
- package/dist/runtime/components/MapLibre/ScriptMapLibreNavigationControl.d.vue.ts +3 -8
- package/dist/runtime/components/MapLibre/ScriptMapLibreNavigationControl.vue +1 -4
- package/dist/runtime/components/MapLibre/ScriptMapLibreNavigationControl.vue.d.ts +3 -8
- package/dist/runtime/components/MapLibre/ScriptMapLibrePopup.d.vue.ts +3 -10
- package/dist/runtime/components/MapLibre/ScriptMapLibrePopup.vue.d.ts +3 -10
- package/dist/runtime/components/MapLibre/ScriptMapLibreScaleControl.d.vue.ts +7 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreScaleControl.vue +25 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreScaleControl.vue.d.ts +7 -0
- package/dist/runtime/components/MapLibre/types.d.ts +275 -0
- package/dist/runtime/components/MapLibre/types.js +0 -0
- package/dist/runtime/components/MapLibre/useMapLibreResource.d.ts +8 -1
- package/dist/runtime/components/MapLibre/useMapLibreResource.js +9 -2
- package/dist/runtime/registry/pulse-analytics.d.ts +32 -0
- package/dist/runtime/registry/pulse-analytics.js +80 -0
- package/dist/runtime/registry/schemas.d.ts +42 -0
- package/dist/runtime/registry/schemas.js +42 -0
- package/dist/runtime/registry/tawk-to.d.ts +126 -0
- package/dist/runtime/registry/tawk-to.js +147 -0
- package/dist/runtime/types.d.ts +6 -1
- package/dist/stats.mjs +81 -0
- package/dist/types-source.mjs +312 -4
- package/dist/types.d.mts +2 -0
- package/package.json +10 -10
- package/dist/devtools-client/_nuxt/builds/meta/8bf6d5ed-9af4-4b18-be50-90e3f19066d5.json +0 -1
- package/dist/devtools-client/_nuxt/error-404.Bn3cR6N7.css +0 -1
- package/dist/devtools-client/_nuxt/error-500.ClHmgt9z.css +0 -1
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
import type { RegistryScriptInput, UseScriptContext } from '#nuxt-scripts/types';
|
|
3
|
+
import { TawkToOptions } from './schemas.js';
|
|
4
|
+
export { TawkToOptions };
|
|
5
|
+
export type TawkToInput = RegistryScriptInput<typeof TawkToOptions, false, false>;
|
|
6
|
+
export type TawkToStatus = 'online' | 'away' | 'offline';
|
|
7
|
+
export type TawkToWindowType = 'inline' | 'embed';
|
|
8
|
+
export type TawkToWidgetPosition = 'br' | 'bl' | 'cr' | 'cl' | 'tr' | 'tl';
|
|
9
|
+
export interface TawkToVisitor {
|
|
10
|
+
name?: string;
|
|
11
|
+
email?: string;
|
|
12
|
+
/** Visitor phone number in E.164 format (e.g. `+15551234567`). */
|
|
13
|
+
phone?: string;
|
|
14
|
+
/** HMAC-SHA256 signature for Tawk's Secure Mode, generated server-side by the consumer. */
|
|
15
|
+
hash?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The `window.Tawk_API` surface, as exposed through `proxy`. `proxy` is
|
|
19
|
+
* fire-and-forget: unhead's script proxy queues/replays calls but always
|
|
20
|
+
* discards their return value, even once the script is fully loaded (and it
|
|
21
|
+
* has no `set` trap, so plain property assignment through it goes nowhere).
|
|
22
|
+
* That means only void-returning actions belong here - real getters and the
|
|
23
|
+
* `visitor` setter live on `useScriptTawkTo()`'s own return value instead
|
|
24
|
+
* (see `TawkToEvents`), backed directly by `window.Tawk_API`.
|
|
25
|
+
* @see https://developer.tawk.to/jsapi/
|
|
26
|
+
*/
|
|
27
|
+
export interface TawkToApi {
|
|
28
|
+
/** Starts the chat. Pass `{ showWidget: true }` to also show the widget. */
|
|
29
|
+
start: (options?: {
|
|
30
|
+
showWidget?: boolean;
|
|
31
|
+
}) => void;
|
|
32
|
+
shutdown: () => void;
|
|
33
|
+
maximize: () => void;
|
|
34
|
+
minimize: () => void;
|
|
35
|
+
toggle: () => void;
|
|
36
|
+
popup: () => void;
|
|
37
|
+
showWidget: () => void;
|
|
38
|
+
hideWidget: () => void;
|
|
39
|
+
toggleVisibility: () => void;
|
|
40
|
+
endChat: () => void;
|
|
41
|
+
getWindowType: () => TawkToWindowType;
|
|
42
|
+
getStatus: () => TawkToStatus;
|
|
43
|
+
isChatMaximized: () => boolean;
|
|
44
|
+
isChatMinimized: () => boolean;
|
|
45
|
+
isChatHidden: () => boolean;
|
|
46
|
+
isChatOngoing: () => boolean;
|
|
47
|
+
isVisitorEngaged: () => boolean;
|
|
48
|
+
/** Set by Tawk once the widget has finished loading. The embed writes a boolean (`!0`), not a number. */
|
|
49
|
+
onLoaded?: boolean;
|
|
50
|
+
/** Set by Tawk before the widget begins loading. */
|
|
51
|
+
onBeforeLoaded?: boolean;
|
|
52
|
+
widgetPosition: () => TawkToWidgetPosition;
|
|
53
|
+
visitor?: TawkToVisitor;
|
|
54
|
+
setAttributes: (attributes: Record<string, string>, callback?: (error: Error | null) => void) => void;
|
|
55
|
+
addEvent: (event: string, metadata?: Record<string, unknown>, callback?: (error: Error | null) => void) => void;
|
|
56
|
+
addTags: (tags: string[], callback?: (error: Error | null) => void) => void;
|
|
57
|
+
removeTags: (tags: string[], callback?: (error: Error | null) => void) => void;
|
|
58
|
+
switchWidget: (data: {
|
|
59
|
+
propertyId: string;
|
|
60
|
+
widgetId: string;
|
|
61
|
+
}, callback?: (error: Error | null) => void) => void;
|
|
62
|
+
}
|
|
63
|
+
declare global {
|
|
64
|
+
interface Window {
|
|
65
|
+
Tawk_API?: TawkToApi;
|
|
66
|
+
Tawk_LoadStart?: Date;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* The subset of `TawkToApi` that `proxy` actually exposes: the getters, the
|
|
71
|
+
* `visitor` setter and the `onLoaded`/`onBeforeLoaded` flags are omitted since
|
|
72
|
+
* none of them work through the fire-and-forget proxy (see `TawkToApi`'s doc
|
|
73
|
+
* comment). They're still real members of the underlying `window.Tawk_API`
|
|
74
|
+
* object, just not reachable via `proxy`.
|
|
75
|
+
*/
|
|
76
|
+
export type TawkToProxyApi = Omit<TawkToApi, 'getWindowType' | 'getStatus' | 'isChatMaximized' | 'isChatMinimized' | 'isChatHidden' | 'isChatOngoing' | 'isVisitorEngaged' | 'widgetPosition' | 'visitor' | 'onLoaded' | 'onBeforeLoaded'>;
|
|
77
|
+
/**
|
|
78
|
+
* Reactive state and typed event listeners bridged from the `window`
|
|
79
|
+
* `CustomEvent`s Tawk's embed script dispatches (`tawkLoad`, `tawkStatusChange`, etc).
|
|
80
|
+
* These aren't part of the documented `Tawk_API.onXxx = fn` callback-property API -
|
|
81
|
+
* they're a separate, verified-in-the-browser signal the embed script also fires.
|
|
82
|
+
*/
|
|
83
|
+
export interface TawkToEvents {
|
|
84
|
+
isHidden: Readonly<Ref<boolean>>;
|
|
85
|
+
isMinimized: Readonly<Ref<boolean>>;
|
|
86
|
+
isMaximized: Readonly<Ref<boolean>>;
|
|
87
|
+
/** The operator status Tawk reports (`getStatus()`) — not to be confused with `status`, the script's own load state. */
|
|
88
|
+
chatStatus: Readonly<Ref<TawkToStatus>>;
|
|
89
|
+
unreadCount: Readonly<Ref<number>>;
|
|
90
|
+
getWindowType: () => TawkToWindowType | undefined;
|
|
91
|
+
getStatus: () => TawkToStatus | undefined;
|
|
92
|
+
isChatMaximized: () => boolean;
|
|
93
|
+
isChatMinimized: () => boolean;
|
|
94
|
+
isChatHidden: () => boolean;
|
|
95
|
+
isChatOngoing: () => boolean;
|
|
96
|
+
isVisitorEngaged: () => boolean;
|
|
97
|
+
widgetPosition: () => TawkToWidgetPosition | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* Sets `Tawk_API.visitor` directly - assigning through `proxy.visitor` is a no-op
|
|
100
|
+
* (no `set` trap). Pre-insertion only: Tawk honors `Tawk_API.visitor` until the
|
|
101
|
+
* embed script is requested, so a call after that warns and does nothing - use
|
|
102
|
+
* `window.Tawk_API.setAttributes()` for post-load identity changes.
|
|
103
|
+
*/
|
|
104
|
+
setVisitor: (data: TawkToVisitor) => void;
|
|
105
|
+
onLoad: (cb: () => void) => () => void;
|
|
106
|
+
onBeforeLoad: (cb: () => void) => () => void;
|
|
107
|
+
onStatusChange: (cb: (status: TawkToStatus) => void) => () => void;
|
|
108
|
+
onChatMaximized: (cb: () => void) => () => void;
|
|
109
|
+
onChatMinimized: (cb: () => void) => () => void;
|
|
110
|
+
onChatHidden: (cb: () => void) => () => void;
|
|
111
|
+
onChatStarted: (cb: () => void) => () => void;
|
|
112
|
+
onChatEnded: (cb: () => void) => () => void;
|
|
113
|
+
onPrechatSubmit: (cb: (data: Record<string, unknown>) => void) => () => void;
|
|
114
|
+
onOfflineSubmit: (cb: (data: Record<string, unknown>) => void) => () => void;
|
|
115
|
+
onChatMessageVisitor: (cb: (message: string) => void) => () => void;
|
|
116
|
+
onChatMessageAgent: (cb: (message: string) => void) => () => void;
|
|
117
|
+
onChatMessageSystem: (cb: (message: string) => void) => () => void;
|
|
118
|
+
onAgentJoinChat: (cb: (data: Record<string, unknown>) => void) => () => void;
|
|
119
|
+
onAgentLeaveChat: (cb: (data: Record<string, unknown>) => void) => () => void;
|
|
120
|
+
onChatSatisfaction: (cb: (satisfaction: number) => void) => () => void;
|
|
121
|
+
onVisitorNameChanged: (cb: (visitorName: string) => void) => () => void;
|
|
122
|
+
onFileUpload: (cb: (link: string) => void) => () => void;
|
|
123
|
+
onTagsUpdated: (cb: (data: Record<string, unknown>) => void) => () => void;
|
|
124
|
+
onUnreadCountChanged: (cb: (count: number) => void) => () => void;
|
|
125
|
+
}
|
|
126
|
+
export declare function useScriptTawkTo<T extends TawkToProxyApi>(_options?: TawkToInput): UseScriptContext<T> & TawkToEvents;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { joinURL } from "ufo";
|
|
2
|
+
import { ref } from "vue";
|
|
3
|
+
import { useRegistryScript } from "../utils.js";
|
|
4
|
+
import { TawkToOptions } from "./schemas.js";
|
|
5
|
+
export { TawkToOptions };
|
|
6
|
+
const isHidden = ref(false);
|
|
7
|
+
const isMinimized = ref(false);
|
|
8
|
+
const isMaximized = ref(false);
|
|
9
|
+
const chatStatus = ref("offline");
|
|
10
|
+
const unreadCount = ref(0);
|
|
11
|
+
function listen(event, cb) {
|
|
12
|
+
if (import.meta.server)
|
|
13
|
+
return () => {
|
|
14
|
+
};
|
|
15
|
+
const handler = (e) => cb(e.detail);
|
|
16
|
+
window.addEventListener(event, handler);
|
|
17
|
+
return () => window.removeEventListener(event, handler);
|
|
18
|
+
}
|
|
19
|
+
let stateBridged = false;
|
|
20
|
+
function ensureStateBridge() {
|
|
21
|
+
if (stateBridged)
|
|
22
|
+
return;
|
|
23
|
+
stateBridged = true;
|
|
24
|
+
listen("tawkLoad", () => {
|
|
25
|
+
isHidden.value = !!window.Tawk_API?.isChatHidden?.();
|
|
26
|
+
isMinimized.value = !!window.Tawk_API?.isChatMinimized?.();
|
|
27
|
+
isMaximized.value = !!window.Tawk_API?.isChatMaximized?.();
|
|
28
|
+
chatStatus.value = window.Tawk_API?.getStatus?.() ?? "offline";
|
|
29
|
+
});
|
|
30
|
+
listen("tawkStatusChange", (detail) => {
|
|
31
|
+
chatStatus.value = detail;
|
|
32
|
+
});
|
|
33
|
+
listen("tawkChatHidden", () => {
|
|
34
|
+
isHidden.value = true;
|
|
35
|
+
});
|
|
36
|
+
listen("tawkChatMinimized", () => {
|
|
37
|
+
isMinimized.value = true;
|
|
38
|
+
isMaximized.value = false;
|
|
39
|
+
});
|
|
40
|
+
listen("tawkChatMaximized", () => {
|
|
41
|
+
isMaximized.value = true;
|
|
42
|
+
isMinimized.value = false;
|
|
43
|
+
});
|
|
44
|
+
listen("tawkUnreadCountChanged", (detail) => {
|
|
45
|
+
unreadCount.value = detail;
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function resyncHiddenState() {
|
|
49
|
+
if (import.meta.server)
|
|
50
|
+
return;
|
|
51
|
+
isHidden.value = !!window.Tawk_API?.isChatHidden?.();
|
|
52
|
+
}
|
|
53
|
+
const visibilityCommands = /* @__PURE__ */ new Set(["hideWidget", "showWidget", "toggleVisibility"]);
|
|
54
|
+
const TAWK_PROXY_DECORATED = Symbol("nuxt-scripts.tawk-proxy-decorated");
|
|
55
|
+
export function useScriptTawkTo(_options) {
|
|
56
|
+
const instance = useRegistryScript("tawkTo", (options) => ({
|
|
57
|
+
scriptInput: {
|
|
58
|
+
src: joinURL("https://embed.tawk.to", options.propertyId, options.widgetId),
|
|
59
|
+
async: true,
|
|
60
|
+
crossorigin: "anonymous"
|
|
61
|
+
},
|
|
62
|
+
schema: import.meta.dev ? TawkToOptions : void 0,
|
|
63
|
+
scriptOptions: {
|
|
64
|
+
resolve({ waitFor }) {
|
|
65
|
+
if (window.Tawk_API?.onLoaded)
|
|
66
|
+
return window.Tawk_API;
|
|
67
|
+
return waitFor((resolve, reject) => {
|
|
68
|
+
const stop = listen("tawkLoad", () => {
|
|
69
|
+
stop();
|
|
70
|
+
if (window.Tawk_API)
|
|
71
|
+
resolve(window.Tawk_API);
|
|
72
|
+
else
|
|
73
|
+
reject(new Error("[nuxt-scripts] Tawk.to reported ready without exposing window.Tawk_API"));
|
|
74
|
+
});
|
|
75
|
+
return stop;
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
clientInit: import.meta.server ? void 0 : () => {
|
|
80
|
+
window.Tawk_API = window.Tawk_API || {};
|
|
81
|
+
window.Tawk_LoadStart = /* @__PURE__ */ new Date();
|
|
82
|
+
}
|
|
83
|
+
}), _options);
|
|
84
|
+
if (!import.meta.server) {
|
|
85
|
+
ensureStateBridge();
|
|
86
|
+
const shared = instance.script || instance;
|
|
87
|
+
if (shared.proxy && !shared[TAWK_PROXY_DECORATED]) {
|
|
88
|
+
shared.proxy = new Proxy(shared.proxy, {
|
|
89
|
+
get(target, prop, receiver) {
|
|
90
|
+
const value = Reflect.get(target, prop, receiver);
|
|
91
|
+
if (!(typeof prop === "string" && visibilityCommands.has(prop)) || typeof value !== "function")
|
|
92
|
+
return value;
|
|
93
|
+
return (...args) => {
|
|
94
|
+
;
|
|
95
|
+
value(...args);
|
|
96
|
+
resyncHiddenState();
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
Object.defineProperty(shared, TAWK_PROXY_DECORATED, { value: true });
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
instance.isHidden = isHidden;
|
|
104
|
+
instance.isMinimized = isMinimized;
|
|
105
|
+
instance.isMaximized = isMaximized;
|
|
106
|
+
instance.chatStatus = chatStatus;
|
|
107
|
+
instance.unreadCount = unreadCount;
|
|
108
|
+
instance.onLoad = (cb) => listen("tawkLoad", cb);
|
|
109
|
+
instance.onBeforeLoad = (cb) => listen("tawkBeforeLoad", cb);
|
|
110
|
+
instance.onStatusChange = (cb) => listen("tawkStatusChange", cb);
|
|
111
|
+
instance.onChatMaximized = (cb) => listen("tawkChatMaximized", cb);
|
|
112
|
+
instance.onChatMinimized = (cb) => listen("tawkChatMinimized", cb);
|
|
113
|
+
instance.onChatHidden = (cb) => listen("tawkChatHidden", cb);
|
|
114
|
+
instance.onChatStarted = (cb) => listen("tawkChatStarted", cb);
|
|
115
|
+
instance.onChatEnded = (cb) => listen("tawkChatEnded", cb);
|
|
116
|
+
instance.onPrechatSubmit = (cb) => listen("tawkPrechatSubmit", cb);
|
|
117
|
+
instance.onOfflineSubmit = (cb) => listen("tawkOfflineSubmit", cb);
|
|
118
|
+
instance.onChatMessageVisitor = (cb) => listen("tawkChatMessageVisitor", cb);
|
|
119
|
+
instance.onChatMessageAgent = (cb) => listen("tawkChatMessageAgent", cb);
|
|
120
|
+
instance.onChatMessageSystem = (cb) => listen("tawkChatMessageSystem", cb);
|
|
121
|
+
instance.onAgentJoinChat = (cb) => listen("tawkAgentJoinChat", cb);
|
|
122
|
+
instance.onAgentLeaveChat = (cb) => listen("tawkAgentLeaveChat", cb);
|
|
123
|
+
instance.onChatSatisfaction = (cb) => listen("tawkChatSatisfaction", cb);
|
|
124
|
+
instance.onVisitorNameChanged = (cb) => listen("tawkVisitorNameChanged", cb);
|
|
125
|
+
instance.onFileUpload = (cb) => listen("tawkFileUpload", cb);
|
|
126
|
+
instance.onTagsUpdated = (cb) => listen("tawkTagsUpdated", cb);
|
|
127
|
+
instance.onUnreadCountChanged = (cb) => listen("tawkUnreadCountChanged", cb);
|
|
128
|
+
instance.getWindowType = () => import.meta.server ? void 0 : window.Tawk_API?.getWindowType?.();
|
|
129
|
+
instance.getStatus = () => import.meta.server ? void 0 : window.Tawk_API?.getStatus?.();
|
|
130
|
+
instance.isChatMaximized = () => !import.meta.server && !!window.Tawk_API?.isChatMaximized?.();
|
|
131
|
+
instance.isChatMinimized = () => !import.meta.server && !!window.Tawk_API?.isChatMinimized?.();
|
|
132
|
+
instance.isChatHidden = () => !import.meta.server && !!window.Tawk_API?.isChatHidden?.();
|
|
133
|
+
instance.isChatOngoing = () => !import.meta.server && !!window.Tawk_API?.isChatOngoing?.();
|
|
134
|
+
instance.isVisitorEngaged = () => !import.meta.server && !!window.Tawk_API?.isVisitorEngaged?.();
|
|
135
|
+
instance.widgetPosition = () => import.meta.server ? void 0 : window.Tawk_API?.widgetPosition?.();
|
|
136
|
+
instance.setVisitor = (data) => {
|
|
137
|
+
if (import.meta.server)
|
|
138
|
+
return;
|
|
139
|
+
window.Tawk_API = window.Tawk_API || {};
|
|
140
|
+
if (instance.status.value !== "awaitingLoad" || window.Tawk_API.onLoaded) {
|
|
141
|
+
console.warn("[nuxt-scripts] Tawk.to: setVisitor() only works before the widget script is inserted. Tawk drops visitor data written after that - set it before the widget loads, or use window.Tawk_API.setAttributes({ name, email, phone, hash }) afterwards.");
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
window.Tawk_API.visitor = data;
|
|
145
|
+
};
|
|
146
|
+
return instance;
|
|
147
|
+
}
|
package/dist/runtime/types.d.ts
CHANGED
|
@@ -34,12 +34,14 @@ import type { NpmInput } from './registry/npm.js';
|
|
|
34
34
|
import type { PayPalInput } from './registry/paypal.js';
|
|
35
35
|
import type { PlausibleAnalyticsInput } from './registry/plausible-analytics.js';
|
|
36
36
|
import type { PostHogInput } from './registry/posthog.js';
|
|
37
|
+
import type { PulseAnalyticsInput } from './registry/pulse-analytics.js';
|
|
37
38
|
import type { RedditPixelInput } from './registry/reddit-pixel.js';
|
|
38
39
|
import type { RybbitAnalyticsInput } from './registry/rybbit-analytics.js';
|
|
39
40
|
import type { SegmentInput } from './registry/segment.js';
|
|
40
41
|
import type { SnapTrPixelInput } from './registry/snapchat-pixel.js';
|
|
41
42
|
import type { SpeedCurveInput } from './registry/speedcurve.js';
|
|
42
43
|
import type { StripeInput } from './registry/stripe.js';
|
|
44
|
+
import type { TawkToInput } from './registry/tawk-to.js';
|
|
43
45
|
import type { TikTokPixelInput } from './registry/tiktok-pixel.js';
|
|
44
46
|
import type { UmamiAnalyticsInput } from './registry/umami-analytics.js';
|
|
45
47
|
import type { UsercentricsInput } from './registry/usercentrics.js';
|
|
@@ -51,6 +53,7 @@ import type { YouTubePlayerInput } from './registry/youtube-player.js';
|
|
|
51
53
|
import type { ProxyPrivacyInput } from './server/utils/privacy.js';
|
|
52
54
|
export type { Cluster, ClusterStats, MarkerClustererContext, MarkerClustererInstance, MarkerClustererOptions } from './components/GoogleMaps/types.js';
|
|
53
55
|
export { MARKER_CLUSTERER_INJECTION_KEY } from './components/GoogleMaps/types.js';
|
|
56
|
+
export type { ScriptMapLibreAttributionControlProps, ScriptMapLibreFullscreenControlEmits, ScriptMapLibreFullscreenControlProps, ScriptMapLibreGeoJsonEmits, ScriptMapLibreGeoJsonLayer, ScriptMapLibreGeoJsonProps, ScriptMapLibreGeoJsonResource, ScriptMapLibreGeolocateControlEmits, ScriptMapLibreGeolocateControlProps, ScriptMapLibreMapEmits, ScriptMapLibreMapExpose, ScriptMapLibreMapProps, ScriptMapLibreMapSlots, ScriptMapLibreMarkerEmits, ScriptMapLibreMarkerProps, ScriptMapLibreNavigationControlProps, ScriptMapLibrePopupEmits, ScriptMapLibrePopupProps, ScriptMapLibreScaleControlProps, } from './components/MapLibre/types.js';
|
|
54
57
|
export type WarmupStrategy = false | 'preload' | 'preconnect' | 'dns-prefetch';
|
|
55
58
|
/**
|
|
56
59
|
* GCMv2 consent category value.
|
|
@@ -265,6 +268,7 @@ export interface ScriptRegistry {
|
|
|
265
268
|
linkedinInsight?: LinkedInInsightInput;
|
|
266
269
|
paypal?: PayPalInput;
|
|
267
270
|
posthog?: PostHogInput;
|
|
271
|
+
pulseAnalytics?: PulseAnalyticsInput;
|
|
268
272
|
matomoAnalytics?: MatomoAnalyticsInput;
|
|
269
273
|
mixpanelAnalytics?: MixpanelAnalyticsInput;
|
|
270
274
|
rybbitAnalytics?: RybbitAnalyticsInput;
|
|
@@ -272,6 +276,7 @@ export interface ScriptRegistry {
|
|
|
272
276
|
segment?: SegmentInput;
|
|
273
277
|
speedcurve?: SpeedCurveInput;
|
|
274
278
|
stripe?: StripeInput;
|
|
279
|
+
tawkTo?: TawkToInput;
|
|
275
280
|
tiktokPixel?: TikTokPixelInput;
|
|
276
281
|
xEmbed?: XEmbedInput;
|
|
277
282
|
xPixel?: XPixelInput;
|
|
@@ -289,7 +294,7 @@ export interface ScriptRegistry {
|
|
|
289
294
|
* Built-in registry script keys — not affected by module augmentation.
|
|
290
295
|
* Use this to type-check records that must enumerate all built-in scripts (logos, meta, etc.).
|
|
291
296
|
*/
|
|
292
|
-
export type BuiltInRegistryScriptKey = 'ahrefsAnalytics' | 'bingUet' | 'blueskyEmbed' | 'calendly' | 'carbonAds' | 'crisp' | 'clarity' | 'cloudflareWebAnalytics' | 'databuddyAnalytics' | 'deskcrew' | 'metaPixel' | 'fathomAnalytics' | 'instagramEmbed' | 'plausibleAnalytics' | 'googleAdsense' | 'googleAnalytics' | 'googleMaps' | 'leaflet' | 'maplibre' | 'googleRecaptcha' | 'googleSignIn' | 'lemonSqueezy' | 'googleTagManager' | 'hotjar' | 'intercom' | 'linkedinInsight' | 'paypal' | 'posthog' | 'matomoAnalytics' | 'mixpanelAnalytics' | 'rybbitAnalytics' | 'redditPixel' | 'segment' | 'stripe' | 'tiktokPixel' | 'xEmbed' | 'xPixel' | 'snapchatPixel' | 'speedcurve' | 'youtubePlayer' | 'vercelAnalytics' | 'vimeoPlayer' | 'umamiAnalytics' | 'usercentrics' | 'gravatar' | 'npm';
|
|
297
|
+
export type BuiltInRegistryScriptKey = 'ahrefsAnalytics' | 'bingUet' | 'blueskyEmbed' | 'calendly' | 'carbonAds' | 'crisp' | 'clarity' | 'cloudflareWebAnalytics' | 'databuddyAnalytics' | 'deskcrew' | 'metaPixel' | 'fathomAnalytics' | 'instagramEmbed' | 'plausibleAnalytics' | 'googleAdsense' | 'googleAnalytics' | 'googleMaps' | 'leaflet' | 'maplibre' | 'googleRecaptcha' | 'googleSignIn' | 'lemonSqueezy' | 'googleTagManager' | 'hotjar' | 'intercom' | 'linkedinInsight' | 'paypal' | 'posthog' | 'pulseAnalytics' | 'matomoAnalytics' | 'mixpanelAnalytics' | 'rybbitAnalytics' | 'redditPixel' | 'segment' | 'stripe' | 'tawkTo' | 'tiktokPixel' | 'xEmbed' | 'xPixel' | 'snapchatPixel' | 'speedcurve' | 'youtubePlayer' | 'vercelAnalytics' | 'vimeoPlayer' | 'umamiAnalytics' | 'usercentrics' | 'gravatar' | 'npm';
|
|
293
298
|
/**
|
|
294
299
|
* Union of all explicit registry script keys (excludes npm pattern).
|
|
295
300
|
* Includes both built-in and augmented keys.
|
package/dist/stats.mjs
CHANGED
|
@@ -34,6 +34,10 @@ const scriptMeta = {
|
|
|
34
34
|
urls: ["https://app.rybbit.io/api/script.js"],
|
|
35
35
|
trackedData: ["page-views", "events"]
|
|
36
36
|
},
|
|
37
|
+
pulseAnalytics: {
|
|
38
|
+
urls: ["https://js.ciphera.net/script.js"],
|
|
39
|
+
trackedData: ["page-views", "events", "conversions", "scrolls"]
|
|
40
|
+
},
|
|
37
41
|
databuddyAnalytics: {
|
|
38
42
|
urls: ["https://cdn.databuddy.cc/databuddy.js"],
|
|
39
43
|
trackedData: ["page-views", "events"]
|
|
@@ -129,6 +133,11 @@ const scriptMeta = {
|
|
|
129
133
|
trackedData: ["user-identity", "events", "errors"],
|
|
130
134
|
testId: "pub_deskcrewdemo"
|
|
131
135
|
},
|
|
136
|
+
tawkTo: {
|
|
137
|
+
urls: ["https://embed.tawk.to/68496650ddf9cd19094b4530/1itfbfagd"],
|
|
138
|
+
trackedData: ["user-identity", "events"],
|
|
139
|
+
testId: "68496650ddf9cd19094b4530"
|
|
140
|
+
},
|
|
132
141
|
crisp: {
|
|
133
142
|
urls: ["https://client.crisp.chat/l.js"],
|
|
134
143
|
trackedData: ["user-identity", "events"],
|
|
@@ -691,6 +700,77 @@ const rybbitAnalytics = {
|
|
|
691
700
|
}
|
|
692
701
|
]
|
|
693
702
|
};
|
|
703
|
+
const pulseAnalytics = {
|
|
704
|
+
totalTransferKb: 3.5,
|
|
705
|
+
totalDecodedKb: 6.4,
|
|
706
|
+
loadTimeMs: 510,
|
|
707
|
+
collectsWebVitals: false,
|
|
708
|
+
apis: {
|
|
709
|
+
cookies: false,
|
|
710
|
+
localStorage: true,
|
|
711
|
+
sessionStorage: true,
|
|
712
|
+
indexedDB: false,
|
|
713
|
+
canvas: false,
|
|
714
|
+
webgl: false,
|
|
715
|
+
audioContext: false,
|
|
716
|
+
userAgent: false,
|
|
717
|
+
doNotTrack: true,
|
|
718
|
+
hardwareConcurrency: false,
|
|
719
|
+
deviceMemory: false,
|
|
720
|
+
plugins: true,
|
|
721
|
+
languages: true,
|
|
722
|
+
screen: true,
|
|
723
|
+
timezone: false,
|
|
724
|
+
platform: true,
|
|
725
|
+
vendor: false,
|
|
726
|
+
connection: false,
|
|
727
|
+
maxTouchPoints: true,
|
|
728
|
+
devicePixelRatio: false,
|
|
729
|
+
mediaDevices: false,
|
|
730
|
+
getBattery: false,
|
|
731
|
+
referrer: true,
|
|
732
|
+
windowName: false,
|
|
733
|
+
rtcPeerConnection: false,
|
|
734
|
+
geolocation: false,
|
|
735
|
+
serviceWorker: false,
|
|
736
|
+
cacheApi: false,
|
|
737
|
+
sendBeacon: true,
|
|
738
|
+
fetch: true,
|
|
739
|
+
xhr: false,
|
|
740
|
+
websocket: false,
|
|
741
|
+
mutationObserver: true,
|
|
742
|
+
performanceObserver: false,
|
|
743
|
+
intersectionObserver: false
|
|
744
|
+
},
|
|
745
|
+
cookies: [
|
|
746
|
+
],
|
|
747
|
+
network: {
|
|
748
|
+
requestCount: 1,
|
|
749
|
+
domains: [
|
|
750
|
+
"js.ciphera.net"
|
|
751
|
+
],
|
|
752
|
+
outboundBytes: 0,
|
|
753
|
+
inboundBytes: 3586,
|
|
754
|
+
injectedElements: [
|
|
755
|
+
]
|
|
756
|
+
},
|
|
757
|
+
performance: {
|
|
758
|
+
taskDurationMs: 31,
|
|
759
|
+
scriptDurationMs: 0,
|
|
760
|
+
heapDeltaKb: 726
|
|
761
|
+
},
|
|
762
|
+
scripts: [
|
|
763
|
+
{
|
|
764
|
+
url: "https://js.ciphera.net/script.js",
|
|
765
|
+
transferKb: 3.5,
|
|
766
|
+
decodedKb: 6.4,
|
|
767
|
+
encoding: "zstd",
|
|
768
|
+
durationMs: 510,
|
|
769
|
+
initiatorType: "script",
|
|
770
|
+
protocol: "unknown"
|
|
771
|
+
}
|
|
772
|
+
]
|
|
773
|
+
};
|
|
694
774
|
const databuddyAnalytics = {
|
|
695
775
|
totalTransferKb: 10.8,
|
|
696
776
|
totalDecodedKb: 29.4,
|
|
@@ -3500,6 +3580,7 @@ const scriptSizes = {
|
|
|
3500
3580
|
fathomAnalytics: fathomAnalytics,
|
|
3501
3581
|
matomoAnalytics: matomoAnalytics,
|
|
3502
3582
|
rybbitAnalytics: rybbitAnalytics,
|
|
3583
|
+
pulseAnalytics: pulseAnalytics,
|
|
3503
3584
|
databuddyAnalytics: databuddyAnalytics,
|
|
3504
3585
|
mixpanelAnalytics: mixpanelAnalytics,
|
|
3505
3586
|
segment: segment,
|