@nuxt/scripts 2.0.0-beta.6 → 2.0.0-beta.7

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 (55) hide show
  1. package/dist/devtools-client/200.html +1 -1
  2. package/dist/devtools-client/404.html +1 -1
  3. package/dist/devtools-client/_nuxt/{CP6K2Qm6.js → BI6wdYky.js} +1 -1
  4. package/dist/devtools-client/_nuxt/{Bagqfgzu.js → BQKaRBnk.js} +3 -3
  5. package/dist/devtools-client/_nuxt/{CWci3Eb_.js → BckE5qrE.js} +1 -1
  6. package/dist/devtools-client/_nuxt/{D_hceTm9.js → Cs0md1ml.js} +1 -1
  7. package/dist/devtools-client/_nuxt/{DZ6h2v9A.js → DN3hUMR_.js} +1 -1
  8. package/dist/devtools-client/_nuxt/{DXDqMNFL.js → DXEYGql4.js} +1 -1
  9. package/dist/devtools-client/_nuxt/{utTTwIIR.js → Divy0_cA.js} +3 -3
  10. package/dist/devtools-client/_nuxt/builds/latest.json +1 -1
  11. package/dist/devtools-client/_nuxt/builds/meta/7f4505e1-4a64-4e0a-b3dd-aa394b0cd7f2.json +1 -0
  12. package/dist/devtools-client/_nuxt/{entry.CuI_2OaG.css → entry.-RqqMwHr.css} +1 -1
  13. package/dist/devtools-client/_nuxt/error-404.BJ1JSMYb.css +1 -0
  14. package/dist/devtools-client/_nuxt/error-500.BBf0uW5X.css +1 -0
  15. package/dist/devtools-client/docs/index.html +1 -1
  16. package/dist/devtools-client/first-party/index.html +1 -1
  17. package/dist/devtools-client/index.html +1 -1
  18. package/dist/devtools-client/registry/index.html +1 -1
  19. package/dist/module.d.mts +1 -0
  20. package/dist/module.d.ts +1 -0
  21. package/dist/module.json +1 -1
  22. package/dist/module.mjs +4 -1
  23. package/dist/registry.mjs +24 -1
  24. package/dist/runtime/components/Leaflet/ScriptLeafletMap.d.vue.ts +5 -5
  25. package/dist/runtime/components/Leaflet/ScriptLeafletMap.vue.d.ts +5 -5
  26. package/dist/runtime/components/MapLibre/ScriptMapLibreGeoJson.d.vue.ts +14 -35
  27. package/dist/runtime/components/MapLibre/ScriptMapLibreGeoJson.vue +194 -12
  28. package/dist/runtime/components/MapLibre/ScriptMapLibreGeoJson.vue.d.ts +14 -35
  29. package/dist/runtime/components/MapLibre/ScriptMapLibreMap.d.vue.ts +22 -86
  30. package/dist/runtime/components/MapLibre/ScriptMapLibreMap.vue +13 -2
  31. package/dist/runtime/components/MapLibre/ScriptMapLibreMap.vue.d.ts +22 -86
  32. package/dist/runtime/components/MapLibre/ScriptMapLibreMarker.d.vue.ts +3 -12
  33. package/dist/runtime/components/MapLibre/ScriptMapLibreMarker.vue.d.ts +3 -12
  34. package/dist/runtime/components/MapLibre/ScriptMapLibreNavigationControl.d.vue.ts +3 -8
  35. package/dist/runtime/components/MapLibre/ScriptMapLibreNavigationControl.vue.d.ts +3 -8
  36. package/dist/runtime/components/MapLibre/ScriptMapLibrePopup.d.vue.ts +3 -10
  37. package/dist/runtime/components/MapLibre/ScriptMapLibrePopup.vue.d.ts +3 -10
  38. package/dist/runtime/components/MapLibre/types.d.ts +186 -0
  39. package/dist/runtime/components/MapLibre/types.js +0 -0
  40. package/dist/runtime/components/MapLibre/useMapLibreResource.d.ts +8 -1
  41. package/dist/runtime/components/MapLibre/useMapLibreResource.js +9 -2
  42. package/dist/runtime/registry/pulse-analytics.d.ts +32 -0
  43. package/dist/runtime/registry/pulse-analytics.js +80 -0
  44. package/dist/runtime/registry/schemas.d.ts +42 -0
  45. package/dist/runtime/registry/schemas.js +42 -0
  46. package/dist/runtime/registry/tawk-to.d.ts +126 -0
  47. package/dist/runtime/registry/tawk-to.js +147 -0
  48. package/dist/runtime/types.d.ts +6 -1
  49. package/dist/stats.mjs +81 -0
  50. package/dist/types-source.mjs +157 -4
  51. package/dist/types.d.mts +2 -0
  52. package/package.json +10 -10
  53. package/dist/devtools-client/_nuxt/builds/meta/8bf6d5ed-9af4-4b18-be50-90e3f19066d5.json +0 -1
  54. package/dist/devtools-client/_nuxt/error-404.Bn3cR6N7.css +0 -1
  55. 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
+ }
@@ -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 { ScriptMapLibreGeoJsonEmits, ScriptMapLibreGeoJsonLayer, ScriptMapLibreGeoJsonProps, ScriptMapLibreGeoJsonResource, ScriptMapLibreMapEmits, ScriptMapLibreMapExpose, ScriptMapLibreMapProps, ScriptMapLibreMapSlots, ScriptMapLibreMarkerEmits, ScriptMapLibreMarkerProps, ScriptMapLibreNavigationControlProps, ScriptMapLibrePopupEmits, ScriptMapLibrePopupProps, } 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,
@@ -841,7 +841,12 @@ const types = {
841
841
  {
842
842
  name: "ScriptMapLibreGeoJsonProps",
843
843
  kind: "interface",
844
- code: "interface ScriptMapLibreGeoJsonProps {\n /** MapLibre source ID. Changing it rebuilds the owned source and layers. */\n sourceId: string\n /** Inline GeoJSON data or a URL returning GeoJSON. */\n data: GeoJSON | string\n /** GeoJSON source options. `type` and `data` are supplied by the component. */\n sourceOptions?: Omit<MapLibreGl.GeoJSONSourceSpecification, 'type' | 'data'>\n /** Style layers backed by this source. */\n layers: ScriptMapLibreGeoJsonLayer[]\n /** Existing layer ID before which the layers are inserted. */\n beforeId?: string\n}"
844
+ code: "interface ScriptMapLibreGeoJsonProps {\n /** MapLibre source ID. Changing it rebuilds the owned source and layers. */\n sourceId: string\n /** Inline GeoJSON data or a URL returning GeoJSON. */\n data: GeoJSON | string\n /** GeoJSON source options. `type` and `data` are supplied by the component. */\n sourceOptions?: Omit<MapLibre.GeoJSONSourceSpecification, 'type' | 'data'>\n /**\n * Style layers backed by this source.\n * A paint, layout or filter change updates the layers in place.\n * Any other change rebuilds the source and the layers.\n */\n layers: ScriptMapLibreGeoJsonLayer[]\n /** Existing layer ID before which the layers are inserted. */\n beforeId?: string\n /** CSS cursor applied while the pointer is over one of these layers. */\n cursor?: string\n}"
845
+ },
846
+ {
847
+ name: "ScriptMapLibreGeoJsonEvents",
848
+ kind: "interface",
849
+ code: "interface ScriptMapLibreGeoJsonEvents {\n error: Error\n click: MapLibre.MapLayerMouseEvent\n mouseenter: MapLibre.MapLayerMouseEvent\n mouseleave: MapLibre.MapLayerMouseEvent\n}"
845
850
  },
846
851
  {
847
852
  name: "ScriptMapLibreMapProps",
@@ -851,7 +856,7 @@ const types = {
851
856
  {
852
857
  name: "ScriptMapLibreMapEvents",
853
858
  kind: "interface",
854
- code: "interface ScriptMapLibreMapEvents {\n ready: ScriptMapLibreMapExpose\n error: Error\n click: MapLibre.MapEventType['click']\n move: MapLibre.MapEventType['move']\n moveend: MapLibre.MapEventType['moveend']\n zoom: MapLibre.MapEventType['zoom']\n zoomend: MapLibre.MapEventType['zoomend']\n rotate: MapLibre.MapEventType['rotate']\n rotateend: MapLibre.MapEventType['rotateend']\n pitch: MapLibre.MapEventType['pitch']\n pitchend: MapLibre.MapEventType['pitchend']\n update:center: MapLibre.LngLat\n update:zoom: number\n update:bearing: number\n update:pitch: number\n}"
859
+ code: "interface ScriptMapLibreMapEvents {\n ready: ScriptMapLibreMapExpose\n error: Error\n load: MapLibre.MapEventType['load']\n styleload: MapLibre.MapEventType['style.load']\n click: MapLibre.MapEventType['click']\n move: MapLibre.MapEventType['move']\n moveend: MapLibre.MapEventType['moveend']\n zoom: MapLibre.MapEventType['zoom']\n zoomend: MapLibre.MapEventType['zoomend']\n rotate: MapLibre.MapEventType['rotate']\n rotateend: MapLibre.MapEventType['rotateend']\n pitch: MapLibre.MapEventType['pitch']\n pitchend: MapLibre.MapEventType['pitchend']\n update:center: MapLibre.LngLat\n update:zoom: number\n update:bearing: number\n update:pitch: number\n}"
855
860
  },
856
861
  {
857
862
  name: "ScriptMapLibreMapSlots",
@@ -1063,6 +1068,23 @@ const types = {
1063
1068
  code: "export interface PostHogConsent {\n /** Call `posthog.opt_in_capturing()`. */\n optIn: () => void\n /** Call `posthog.opt_out_capturing()`. For boot-time opt-out, use `defaultConsent: 'opt-out'` instead. */\n optOut: () => void\n}"
1064
1069
  }
1065
1070
  ],
1071
+ "pulse-analytics": [
1072
+ {
1073
+ name: "PulseAnalyticsOptions",
1074
+ kind: "const",
1075
+ code: "export const PulseAnalyticsOptions = object({\n /**\n * The site domain as registered in Pulse.\n * @see https://docs.ciphera.net/pulse/script-installation\n */\n domain: string(),\n /**\n * The API origin the tracker posts events to. Only needed for a self-hosted\n * or reverse-proxied Pulse API.\n * @default 'https://pulse-api.ciphera.net'\n */\n apiUrl: optional(string()),\n /**\n * Record scroll depth.\n * @default true\n */\n trackScroll: optional(boolean()),\n /**\n * Record outbound link clicks as `outbound_link` events.\n * @default true\n */\n trackOutbound: optional(boolean()),\n /**\n * Record file download clicks as `file_download` events.\n * @default true\n */\n trackDownloads: optional(boolean()),\n})"
1076
+ },
1077
+ {
1078
+ name: "PulseAnalyticsApi",
1079
+ kind: "interface",
1080
+ code: "export interface PulseAnalyticsApi {\n /**\n * Records a custom event.\n * @param name Event name: letters, numbers and underscores, up to 64 characters.\n * Trimmed and lowercased before storage.\n * @param props Optional properties. Values must be strings; a number or boolean\n * rejects the whole event.\n * @param revenue Optional monetary value, zero or greater.\n * @see https://docs.ciphera.net/pulse/custom-events\n */\n track: (name: string, props?: Record<string, string>, revenue?: number) => void\n /**\n * The current pathname as Pulse records it: trailing slash stripped, root kept\n * as `/`. Returns `null` until the tracker has loaded.\n */\n cleanPath: () => string | null\n}"
1081
+ },
1082
+ {
1083
+ name: "PulseQueueState",
1084
+ kind: "interface",
1085
+ code: "interface PulseQueueState {\n queue: Array<Parameters<PulseAnalyticsApi['track']>>\n flushed: boolean\n /** The tracker ran but declined to record: nothing will ever consume the queue. */\n declined: boolean\n}"
1086
+ }
1087
+ ],
1066
1088
  "reddit-pixel": [
1067
1089
  {
1068
1090
  name: "StandardEvents",
@@ -1215,6 +1237,48 @@ const types = {
1215
1237
  code: "interface ScriptStripePricingTableSlots {\n default?: () => any\n loading?: () => any\n awaitingLoad?: () => any\n error?: () => any\n}"
1216
1238
  }
1217
1239
  ],
1240
+ "tawk-to": [
1241
+ {
1242
+ name: "TawkToOptions",
1243
+ kind: "const",
1244
+ code: "export const TawkToOptions = object({\n /**\n * Your Tawk.to property ID: the first path segment of the widget embed URL\n * `https://embed.tawk.to/<propertyId>/<widgetId>`.\n * @see https://dashboard.tawk.to/\n */\n propertyId: pipe(string(), minLength(1)),\n /**\n * Your Tawk.to widget ID: the second path segment of the widget embed URL\n * `https://embed.tawk.to/<propertyId>/<widgetId>`.\n * @see https://dashboard.tawk.to/\n */\n widgetId: pipe(string(), minLength(1)),\n})"
1245
+ },
1246
+ {
1247
+ name: "TawkToStatus",
1248
+ kind: "type",
1249
+ code: "export type TawkToStatus = 'online' | 'away' | 'offline'"
1250
+ },
1251
+ {
1252
+ name: "TawkToWindowType",
1253
+ kind: "type",
1254
+ code: "export type TawkToWindowType = 'inline' | 'embed'"
1255
+ },
1256
+ {
1257
+ name: "TawkToWidgetPosition",
1258
+ kind: "type",
1259
+ code: "export type TawkToWidgetPosition = 'br' | 'bl' | 'cr' | 'cl' | 'tr' | 'tl'"
1260
+ },
1261
+ {
1262
+ name: "TawkToVisitor",
1263
+ kind: "interface",
1264
+ code: "export interface TawkToVisitor {\n name?: string\n email?: string\n /** Visitor phone number in E.164 format (e.g. `+15551234567`). */\n phone?: string\n /** HMAC-SHA256 signature for Tawk's Secure Mode, generated server-side by the consumer. */\n hash?: string\n}"
1265
+ },
1266
+ {
1267
+ name: "TawkToApi",
1268
+ kind: "interface",
1269
+ code: "export interface TawkToApi {\n /** Starts the chat. Pass `{ showWidget: true }` to also show the widget. */\n start: (options?: { showWidget?: boolean }) => void\n shutdown: () => void\n maximize: () => void\n minimize: () => void\n toggle: () => void\n popup: () => void\n showWidget: () => void\n hideWidget: () => void\n toggleVisibility: () => void\n endChat: () => void\n\n getWindowType: () => TawkToWindowType\n getStatus: () => TawkToStatus\n isChatMaximized: () => boolean\n isChatMinimized: () => boolean\n isChatHidden: () => boolean\n isChatOngoing: () => boolean\n isVisitorEngaged: () => boolean\n /** Set by Tawk once the widget has finished loading. The embed writes a boolean (`!0`), not a number. */\n onLoaded?: boolean\n /** Set by Tawk before the widget begins loading. */\n onBeforeLoaded?: boolean\n widgetPosition: () => TawkToWidgetPosition\n\n visitor?: TawkToVisitor\n setAttributes: (attributes: Record<string, string>, callback?: (error: Error | null) => void) => void\n addEvent: (event: string, metadata?: Record<string, unknown>, callback?: (error: Error | null) => void) => void\n addTags: (tags: string[], callback?: (error: Error | null) => void) => void\n removeTags: (tags: string[], callback?: (error: Error | null) => void) => void\n switchWidget: (data: { propertyId: string, widgetId: string }, callback?: (error: Error | null) => void) => void\n}"
1270
+ },
1271
+ {
1272
+ name: "TawkToProxyApi",
1273
+ kind: "type",
1274
+ code: "export type TawkToProxyApi = Omit<TawkToApi, 'getWindowType' | 'getStatus' | 'isChatMaximized' | 'isChatMinimized' | 'isChatHidden' | 'isChatOngoing' | 'isVisitorEngaged' | 'widgetPosition' | 'visitor' | 'onLoaded' | 'onBeforeLoaded'>"
1275
+ },
1276
+ {
1277
+ name: "TawkToEvents",
1278
+ kind: "interface",
1279
+ code: "export interface TawkToEvents {\n isHidden: Readonly<Ref<boolean>>\n isMinimized: Readonly<Ref<boolean>>\n isMaximized: Readonly<Ref<boolean>>\n /** The operator status Tawk reports (`getStatus()`) — not to be confused with `status`, the script's own load state. */\n chatStatus: Readonly<Ref<TawkToStatus>>\n unreadCount: Readonly<Ref<number>>\n\n // Getters, called directly against `window.Tawk_API` (see `TawkToProxyApi`'s\n // doc comment for why `proxy` can't carry these). `undefined` before the\n // widget has loaded; the four `isXxx` booleans default to `false` instead\n // since a definite \"no\" is a safe, honest answer before load.\n getWindowType: () => TawkToWindowType | undefined\n getStatus: () => TawkToStatus | undefined\n isChatMaximized: () => boolean\n isChatMinimized: () => boolean\n isChatHidden: () => boolean\n isChatOngoing: () => boolean\n isVisitorEngaged: () => boolean\n widgetPosition: () => TawkToWidgetPosition | undefined\n\n /**\n * Sets `Tawk_API.visitor` directly - assigning through `proxy.visitor` is a no-op\n * (no `set` trap). Pre-insertion only: Tawk honors `Tawk_API.visitor` until the\n * embed script is requested, so a call after that warns and does nothing - use\n * `window.Tawk_API.setAttributes()` for post-load identity changes.\n */\n setVisitor: (data: TawkToVisitor) => void\n\n onLoad: (cb: () => void) => () => void\n onBeforeLoad: (cb: () => void) => () => void\n onStatusChange: (cb: (status: TawkToStatus) => void) => () => void\n onChatMaximized: (cb: () => void) => () => void\n onChatMinimized: (cb: () => void) => () => void\n onChatHidden: (cb: () => void) => () => void\n onChatStarted: (cb: () => void) => () => void\n onChatEnded: (cb: () => void) => () => void\n onPrechatSubmit: (cb: (data: Record<string, unknown>) => void) => () => void\n onOfflineSubmit: (cb: (data: Record<string, unknown>) => void) => () => void\n onChatMessageVisitor: (cb: (message: string) => void) => () => void\n onChatMessageAgent: (cb: (message: string) => void) => () => void\n onChatMessageSystem: (cb: (message: string) => void) => () => void\n onAgentJoinChat: (cb: (data: Record<string, unknown>) => void) => () => void\n onAgentLeaveChat: (cb: (data: Record<string, unknown>) => void) => () => void\n onChatSatisfaction: (cb: (satisfaction: number) => void) => () => void\n onVisitorNameChanged: (cb: (visitorName: string) => void) => () => void\n onFileUpload: (cb: (link: string) => void) => () => void\n onTagsUpdated: (cb: (data: Record<string, unknown>) => void) => () => void\n onUnreadCountChanged: (cb: (count: number) => void) => () => void\n}"
1280
+ }
1281
+ ],
1218
1282
  "tiktok-pixel": [
1219
1283
  {
1220
1284
  name: "StandardEvents",
@@ -2375,6 +2439,42 @@ const schemaFields = {
2375
2439
  description: "Your Reddit Pixel advertiser ID."
2376
2440
  }
2377
2441
  ],
2442
+ PulseAnalyticsOptions: [
2443
+ {
2444
+ name: "domain",
2445
+ type: "string",
2446
+ required: true,
2447
+ description: "The site domain as registered in Pulse."
2448
+ },
2449
+ {
2450
+ name: "apiUrl",
2451
+ type: "string",
2452
+ required: false,
2453
+ description: "The API origin the tracker posts events to. Only needed for a self-hosted or reverse-proxied Pulse API.",
2454
+ defaultValue: "'https://pulse-api.ciphera.net'"
2455
+ },
2456
+ {
2457
+ name: "trackScroll",
2458
+ type: "boolean",
2459
+ required: false,
2460
+ description: "Record scroll depth.",
2461
+ defaultValue: "true"
2462
+ },
2463
+ {
2464
+ name: "trackOutbound",
2465
+ type: "boolean",
2466
+ required: false,
2467
+ description: "Record outbound link clicks as `outbound_link` events.",
2468
+ defaultValue: "true"
2469
+ },
2470
+ {
2471
+ name: "trackDownloads",
2472
+ type: "boolean",
2473
+ required: false,
2474
+ description: "Record file download clicks as `file_download` events.",
2475
+ defaultValue: "true"
2476
+ }
2477
+ ],
2378
2478
  RybbitAnalyticsOptions: [
2379
2479
  {
2380
2480
  name: "siteId",
@@ -2772,6 +2872,20 @@ const schemaFields = {
2772
2872
  defaultValue: "'basil'"
2773
2873
  }
2774
2874
  ],
2875
+ TawkToOptions: [
2876
+ {
2877
+ name: "propertyId",
2878
+ type: "string",
2879
+ required: true,
2880
+ description: "Your Tawk.to property ID: the first path segment of the widget embed URL `https://embed.tawk.to/<propertyId>/<widgetId>`."
2881
+ },
2882
+ {
2883
+ name: "widgetId",
2884
+ type: "string",
2885
+ required: true,
2886
+ description: "Your Tawk.to widget ID: the second path segment of the widget embed URL `https://embed.tawk.to/<propertyId>/<widgetId>`."
2887
+ }
2888
+ ],
2775
2889
  TikTokPixelOptions: [
2776
2890
  {
2777
2891
  name: "id",
@@ -4063,18 +4177,47 @@ const schemaFields = {
4063
4177
  },
4064
4178
  {
4065
4179
  name: "sourceOptions",
4066
- type: "Omit<MapLibreGl.GeoJSONSourceSpecification, 'type' | 'data'>",
4180
+ type: "Omit<MapLibre.GeoJSONSourceSpecification, 'type' | 'data'>",
4067
4181
  required: false
4068
4182
  },
4069
4183
  {
4070
4184
  name: "layers",
4071
4185
  type: "ScriptMapLibreGeoJsonLayer[]",
4072
- required: true
4186
+ required: true,
4187
+ description: "Style layers backed by this source. A paint, layout or filter change updates the layers in place. Any other change rebuilds the source and the layers."
4073
4188
  },
4074
4189
  {
4075
4190
  name: "beforeId",
4076
4191
  type: "string",
4077
4192
  required: false
4193
+ },
4194
+ {
4195
+ name: "cursor",
4196
+ type: "string",
4197
+ required: false
4198
+ }
4199
+ ],
4200
+ ScriptMapLibreGeoJsonEvents: [
4201
+ {
4202
+ name: "error",
4203
+ type: "Error",
4204
+ required: false,
4205
+ description: "The component could not apply a source or layer. A failed rebuild removes the component's own source and layers. A failed paint, layout or filter update leaves them on the map."
4206
+ },
4207
+ {
4208
+ name: "click",
4209
+ type: "MapLibre.MapLayerMouseEvent",
4210
+ required: false
4211
+ },
4212
+ {
4213
+ name: "mouseenter",
4214
+ type: "MapLibre.MapLayerMouseEvent",
4215
+ required: false
4216
+ },
4217
+ {
4218
+ name: "mouseleave",
4219
+ type: "MapLibre.MapLayerMouseEvent",
4220
+ required: false
4078
4221
  }
4079
4222
  ],
4080
4223
  ScriptMapLibreMapProps: [
@@ -4167,6 +4310,16 @@ const schemaFields = {
4167
4310
  type: "Error",
4168
4311
  required: false
4169
4312
  },
4313
+ {
4314
+ name: "load",
4315
+ type: "MapLibre.MapEventType['load']",
4316
+ required: false
4317
+ },
4318
+ {
4319
+ name: "styleload",
4320
+ type: "MapLibre.MapEventType['style.load']",
4321
+ required: false
4322
+ },
4170
4323
  {
4171
4324
  name: "click",
4172
4325
  type: "MapLibre.MapEventType['click']",