@devalon.dev/credits 1.0.0 → 1.0.2
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/LICENSE +21 -0
- package/README.md +26 -2
- package/dist/chunk-IJASKDEW.mjs +1 -0
- package/dist/chunk-PYZQVHOF.mjs +16 -0
- package/dist/chunk-RZ4S6JFB.mjs +11 -0
- package/dist/core/backlink.d.ts +21 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/next/index.d.ts +4 -0
- package/dist/next/index.js +9 -9
- package/dist/next/index.mjs +1 -1
- package/dist/next/source.d.ts +12 -0
- package/dist/react/index.d.ts +2 -1
- package/dist/react/index.js +19 -19
- package/dist/react/index.mjs +1 -1
- package/dist/signals/component.d.ts +16 -0
- package/dist/signals/config.d.ts +9 -0
- package/dist/signals/detect.d.ts +24 -0
- package/dist/signals/event.d.ts +13 -0
- package/dist/signals/index.d.ts +7 -0
- package/dist/signals/index.js +17 -0
- package/dist/signals/index.mjs +17 -0
- package/dist/signals/meta/index.d.ts +3 -0
- package/dist/signals/meta/pixel.d.ts +18 -0
- package/dist/signals/meta/types.d.ts +21 -0
- package/dist/signals/signal.d.ts +9 -0
- package/dist/signals/types.d.ts +26 -0
- package/dist/vite/index.js +23 -23
- package/dist/vite/index.mjs +4 -4
- package/dist/vite/plugin.d.ts +1 -1
- package/docs/nextjs/05-performance-checklist.md +1 -1
- package/docs/nextjs/06-backlink-component.md +50 -27
- package/docs/react/02-csr-vite.md +6 -0
- package/docs/react/03-i18n.md +8 -8
- package/docs/react/05-backlink-component.md +15 -10
- package/docs/react/08-validator.md +1 -1
- package/docs/signals/01-meta-pixel.md +203 -0
- package/package.json +11 -4
- package/scripts/backlink.test.mjs +178 -0
- package/scripts/signals.test.mjs +459 -0
- package/dist/chunk-QU6SEFG7.mjs +0 -16
- package/dist/chunk-YF7SVQTC.mjs +0 -11
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** Minimal shape of the global installed by the canonical Pixel bootstrap. */
|
|
2
|
+
export interface devalon_meta_fbq {
|
|
3
|
+
(...args: unknown[]): void;
|
|
4
|
+
callMethod?: (...args: unknown[]) => void;
|
|
5
|
+
queue?: unknown[][];
|
|
6
|
+
loaded?: boolean;
|
|
7
|
+
version?: string;
|
|
8
|
+
}
|
|
9
|
+
export type devalon_pixel_status = "sent" | "blocked" | "missing";
|
|
10
|
+
export type devalon_pixel_reason = "fbq_missing" | "fbevents_not_loaded";
|
|
11
|
+
export interface devalon_pixel_state {
|
|
12
|
+
status: devalon_pixel_status;
|
|
13
|
+
reason?: devalon_pixel_reason | undefined;
|
|
14
|
+
}
|
|
15
|
+
export declare function meta_fbq(): devalon_meta_fbq | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* The inline snippet creates a stub with `queue`, but only the real
|
|
18
|
+
* `fbevents.js` library defines `callMethod`. A stub without it means the
|
|
19
|
+
* script was blocked (ad blocker, CSP, network failure).
|
|
20
|
+
*/
|
|
21
|
+
export declare function pixel_sdk_ready(): boolean;
|
|
22
|
+
/** How long to wait before deciding the Pixel SDK is never going to load. */
|
|
23
|
+
export declare const PIXEL_READY_CHECK_DELAY_MS = 800;
|
|
24
|
+
export declare function check_pixel_after_delay(delay_ms?: number): Promise<devalon_pixel_state>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vendor-neutral event envelope. The browser Pixel and a future server-side
|
|
3
|
+
* CAPI endpoint use the same `event_id` so Meta can deduplicate them.
|
|
4
|
+
*/
|
|
5
|
+
export interface devalon_signal_event {
|
|
6
|
+
event_name: string;
|
|
7
|
+
event_id: string;
|
|
8
|
+
params: Record<string, unknown>;
|
|
9
|
+
emitted_at: string;
|
|
10
|
+
}
|
|
11
|
+
/** UUID v4 when available, with a deterministic-free fallback for old browsers. */
|
|
12
|
+
export declare function create_signal_event_id(): string;
|
|
13
|
+
export declare function create_signal_event(event_name: string, params?: Record<string, unknown>, event_id?: string): devalon_signal_event;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { DevalonSignal } from "./component";
|
|
2
|
+
export { signal } from "./signal";
|
|
3
|
+
export { DEVALON_CUSTOM_EVENT_NAMES, META_PIXEL_NOSCRIPT_BASE_URL, META_PIXEL_SCRIPT_URL, META_REQUIRED_EVENT_PARAMS, META_STANDARD_EVENT_NAMES, devalon_meta_pixel_html, devalon_meta_pixel_noscript, devalon_meta_pixel_script, loadMetaPixel, } from "./meta";
|
|
4
|
+
export { get_signal_pixel_id, reset_signal_pixel_id, set_signal_pixel_id, } from "./config";
|
|
5
|
+
export { create_signal_event, create_signal_event_id } from "./event";
|
|
6
|
+
export { PIXEL_READY_CHECK_DELAY_MS, check_pixel_after_delay, meta_fbq, pixel_sdk_ready, } from "./detect";
|
|
7
|
+
export type { devalon_custom_event_name, devalon_meta_event_name, devalon_signal_event_name, devalon_meta_fbq, devalon_meta_pixel_result, devalon_pixel_reason, devalon_pixel_state, devalon_pixel_status, devalon_signal_event, devalon_signal_options, devalon_signal_props, devalon_signals_config, } from "./types";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";var A=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var X=Object.prototype.hasOwnProperty;var H=(e,t)=>{for(var n in t)A(e,n,{get:t[n],enumerable:!0})},W=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of F(t))!X.call(e,i)&&i!==n&&A(e,i,{get:()=>t[i],enumerable:!(o=B(t,i))||o.enumerable});return e};var G=e=>W(A({},"__esModule",{value:!0}),e);var Y={};H(Y,{DEVALON_CUSTOM_EVENT_NAMES:()=>D,DevalonSignal:()=>L,META_PIXEL_NOSCRIPT_BASE_URL:()=>x,META_PIXEL_SCRIPT_URL:()=>E,META_REQUIRED_EVENT_PARAMS:()=>m,META_STANDARD_EVENT_NAMES:()=>u,PIXEL_READY_CHECK_DELAY_MS:()=>T,check_pixel_after_delay:()=>C,create_signal_event:()=>b,create_signal_event_id:()=>p,devalon_meta_pixel_html:()=>P,devalon_meta_pixel_noscript:()=>s,devalon_meta_pixel_script:()=>l,get_signal_pixel_id:()=>v,loadMetaPixel:()=>h,meta_fbq:()=>d,pixel_sdk_ready:()=>c,reset_signal_pixel_id:()=>N,set_signal_pixel_id:()=>g,signal:()=>$});module.exports=G(Y);function R(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var f;function g(e){f=e.trim()}function N(){f=void 0}function v(){if(f)return f;let t=globalThis.__DEVALON_SIGNAL_PIXEL_ID;return typeof t=="string"&&/^\d+$/.test(t)?t:void 0}var E="https://connect.facebook.net/en_US/fbevents.js",x="https://www.facebook.com/tr";function y(e){let t=e.trim();if(!/^\d+$/.test(t))throw new TypeError("pixelId must be a numeric Meta Pixel ID.");return t}function z(e){if(e!==void 0){if(!/^[A-Za-z0-9+/_=-]+$/.test(e))throw new TypeError("nonce contains unsupported characters.");return e}}function l(e){let t=y(e);return`!function(f,b,e,v,n,t,s)
|
|
2
|
+
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
|
|
3
|
+
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
|
|
4
|
+
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
|
|
5
|
+
n.queue=[];t=b.createElement(e);t.async=!0;
|
|
6
|
+
t.src=v;s=b.getElementsByTagName(e)[0];
|
|
7
|
+
s.parentNode.insertBefore(t,s)}(window, document,'script',
|
|
8
|
+
'${E}');
|
|
9
|
+
fbq('init', '${t}');
|
|
10
|
+
fbq('track', 'PageView');`}function s(e){let t=y(e);return`<img height="1" width="1" style="display:none"
|
|
11
|
+
src="${x}?id=${t}&ev=PageView&noscript=1"
|
|
12
|
+
/>`}var S=new Set;function h(e){let t=y(e);if(g(t),S.has(t))return;let n=globalThis.fbq;if(typeof n=="function"){n("init",t),S.add(t);return}let o=globalThis.document;if(!o)return;let i=`devalon-meta-pixel-${t}`;if(o.getElementById(i)){S.add(t);return}let r=o.createElement("script");r.id=i,r.textContent=l(t),o.head.appendChild(r),S.add(t)}function P(e,t){let n=l(e),o=s(e),i=z(t),r=i?` nonce="${R(i)}"`:"";return{script:n,noscript:o,html:`<!-- Meta Pixel Code -->
|
|
13
|
+
<script${r}>
|
|
14
|
+
${n}
|
|
15
|
+
</script>
|
|
16
|
+
<noscript>${o}</noscript>
|
|
17
|
+
<!-- End Meta Pixel Code -->`}}var a=require("react/jsx-runtime");function L({pixelId:e,nonce:t}){let n=e.trim(),o=l(n),i=s(n),r=`window.__DEVALON_SIGNAL_PIXEL_ID=${JSON.stringify(n)};`;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("script",{dangerouslySetInnerHTML:{__html:r},nonce:t}),(0,a.jsx)("script",{dangerouslySetInnerHTML:{__html:o},nonce:t}),(0,a.jsx)("noscript",{dangerouslySetInnerHTML:{__html:i}})]})}function d(){let e=globalThis;return typeof e.fbq=="function"?e.fbq:void 0}function c(){let e=d();return!!(e&&typeof e.callMethod=="function")}var T=800;function C(e=T){return new Promise(t=>{setTimeout(()=>{t(c()?{status:"sent"}:{status:"blocked",reason:"fbevents_not_loaded"})},e)})}function p(){let e=globalThis;return typeof e.crypto?.randomUUID=="function"?e.crypto.randomUUID():`evt_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,10)}`}function b(e,t={},n=p()){return{event_name:e,event_id:n,params:t,emitted_at:new Date().toISOString()}}var u=["PageView","ViewContent","Search","AddToCart","AddToWishlist","InitiateCheckout","AddPaymentInfo","Purchase","Lead","CompleteRegistration","Contact","CustomizeProduct","Donate","FindLocation","Schedule","StartTrial","SubmitApplication","Subscribe"],D=["ButtonClick","CtaClick","HeroCtaClick","PricingButtonClick","NavClick","MenuOpen","MenuClose","TabClick","AccordionToggle","CarouselNext","CarouselPrev","ModalOpen","ModalClose","DropdownSelect","SliderChange","ScrollDepth","ExitIntent","BackToTopClick","StickyBarClick","ToastDismiss","FormStart","FormSubmit","FormAbandon","FormStepComplete","FormValidationError","ContactFormSubmit","LeadFormSubmit","QuoteRequest","DemoRequest","CallbackRequest","NewsletterSignup","NewsletterUnsubscribe","WaitlistJoin","SurveyStart","SurveyComplete","FeedbackSubmit","NpsSubmit","RatingSubmit","ProductView","ProductListView","CategoryView","ProductCompare","RemoveFromCart","CartView","CheckoutStart","CheckoutStepComplete","ShippingSelect","PaymentSelect","OrderConfirm","OrderCancel","RefundRequest","ReviewSubmit","WishlistAdd","WishlistRemove","SearchNoResults","FilterApply","SortChange","StockAlertSubscribe","PromoCodeApply","GiftCardApply","ArticleView","BlogPostView","VideoPlay","VideoPause","VideoComplete","VideoProgress25","VideoProgress50","VideoProgress75","PodcastPlay","DocumentView","PdfView","GalleryOpen","ShareClick","CopyLink","OutboundClick","SocialClick","EmailClick","PhoneClick","WhatsAppClick","MapsClick","DirectionsClick","AppointmentClick","CalendarBook","BookingConfirm","ChatOpen","ChatMessageSent","ChatClose","SignUpStart","SignUpComplete","LoginSuccess","LoginFailure","Logout","OnboardingStart","OnboardingComplete","DashboardView","FeatureUse","SettingsChange","IntegrationConnect","ApiKeyCreate","InviteTeamMember","ReportExport","DataExport","SearchPerformed","NotificationEnable","PasswordReset","JsError","ApiError","PaymentError","CheckoutError","FormError","PageLoadError","RateLimitHit","FeatureUnavailable","PopupView","PopupClick","PopupClose","ExitPopupView","CampaignLandingView","AdClick","AffiliateClick","ReferralClick","BannerClick","CookieAccept","CookieReject"],m={ViewContent:["content_ids","value","currency"],Search:["search_string"],AddToCart:["value","currency"],AddToWishlist:["value","currency"],InitiateCheckout:["value","currency"],AddPaymentInfo:["value","currency"],Purchase:["value","currency"],Donate:["value","currency"],StartTrial:["value","currency"],Subscribe:["value","currency"]};var V=new Set(u);function q(e,t,n){typeof console<"u"&&typeof console.info=="function"&&console.info(`[Devalon Signal] ${e} \u2192 Pixel ${t} \u2713 (event_id=${n})`)}function O(e,t,n,o){if(typeof console>"u"||typeof console.warn!="function")return;console.warn(`[Devalon Signal] ${e} \u2192 Pixel ${t} ${o==="fbq_missing"?"MISSING":"BLOCKED"} \u2717 \u2014 send via CAPI with event_id=${n} (reason: ${o})`)}function Q(e,t){typeof console>"u"||typeof console.warn!="function"||console.warn(`[Devalon Signal] ${e} \u26A0 \u2014 missing recommended params: ${t.join(", ")}`)}function K(e,t){typeof console>"u"||typeof console.warn!="function"||console.warn(`[Devalon Signal] ${e} \u2717 \u2014 no Devalon pixel id configured (render <DevalonSignal/> or pass { pixelId }); event_id=${t}`)}function $(e,t={},n={}){let o=n.eventId??p(),i=b(e,t,o),r=n.pixelId??v(),k=d(),_=n.debug===!0;if(!r)return _&&K(e,o),i;if(!k)return _&&O(e,r,o,"fbq_missing"),i;if(_&&V.has(e)){let w=(m[e]??[]).filter(M=>!(M in t)||t[M]===void 0);w.length>0&&Q(e,w)}let U=V.has(e)?"trackSingle":"trackSingleCustom";return k(U,r,e,t,{eventID:o}),c()?(_&&q(e,r,o),i):(C().then(I=>{_&&(I.status==="sent"?q(e,r,o):O(e,r,o,"fbevents_not_loaded"))}),i)}0&&(module.exports={DEVALON_CUSTOM_EVENT_NAMES,DevalonSignal,META_PIXEL_NOSCRIPT_BASE_URL,META_PIXEL_SCRIPT_URL,META_REQUIRED_EVENT_PARAMS,META_STANDARD_EVENT_NAMES,PIXEL_READY_CHECK_DELAY_MS,check_pixel_after_delay,create_signal_event,create_signal_event_id,devalon_meta_pixel_html,devalon_meta_pixel_noscript,devalon_meta_pixel_script,get_signal_pixel_id,loadMetaPixel,meta_fbq,pixel_sdk_ready,reset_signal_pixel_id,set_signal_pixel_id,signal});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import{a as D}from"../chunk-IJASKDEW.mjs";var _;function g(e){_=e.trim()}function q(){_=void 0}function v(){if(_)return _;let t=globalThis.__DEVALON_SIGNAL_PIXEL_ID;return typeof t=="string"&&/^\d+$/.test(t)?t:void 0}var S="https://connect.facebook.net/en_US/fbevents.js",E="https://www.facebook.com/tr";function x(e){let t=e.trim();if(!/^\d+$/.test(t))throw new TypeError("pixelId must be a numeric Meta Pixel ID.");return t}function O(e){if(e!==void 0){if(!/^[A-Za-z0-9+/_=-]+$/.test(e))throw new TypeError("nonce contains unsupported characters.");return e}}function a(e){let t=x(e);return`!function(f,b,e,v,n,t,s)
|
|
2
|
+
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
|
|
3
|
+
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
|
|
4
|
+
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
|
|
5
|
+
n.queue=[];t=b.createElement(e);t.async=!0;
|
|
6
|
+
t.src=v;s=b.getElementsByTagName(e)[0];
|
|
7
|
+
s.parentNode.insertBefore(t,s)}(window, document,'script',
|
|
8
|
+
'${S}');
|
|
9
|
+
fbq('init', '${t}');
|
|
10
|
+
fbq('track', 'PageView');`}function s(e){let t=x(e);return`<img height="1" width="1" style="display:none"
|
|
11
|
+
src="${E}?id=${t}&ev=PageView&noscript=1"
|
|
12
|
+
/>`}var d=new Set;function k(e){let t=x(e);if(g(t),d.has(t))return;let o=globalThis.fbq;if(typeof o=="function"){o("init",t),d.add(t);return}let n=globalThis.document;if(!n)return;let r=`devalon-meta-pixel-${t}`;if(n.getElementById(r)){d.add(t);return}let i=n.createElement("script");i.id=r,i.textContent=a(t),n.head.appendChild(i),d.add(t)}function I(e,t){let o=a(e),n=s(e),r=O(t),i=r?` nonce="${D(r)}"`:"";return{script:o,noscript:n,html:`<!-- Meta Pixel Code -->
|
|
13
|
+
<script${i}>
|
|
14
|
+
${o}
|
|
15
|
+
</script>
|
|
16
|
+
<noscript>${n}</noscript>
|
|
17
|
+
<!-- End Meta Pixel Code -->`}}import{Fragment as U,jsx as C,jsxs as B}from"react/jsx-runtime";function $({pixelId:e,nonce:t}){let o=e.trim(),n=a(o),r=s(o),i=`window.__DEVALON_SIGNAL_PIXEL_ID=${JSON.stringify(o)};`;return B(U,{children:[C("script",{dangerouslySetInnerHTML:{__html:i},nonce:t}),C("script",{dangerouslySetInnerHTML:{__html:n},nonce:t}),C("noscript",{dangerouslySetInnerHTML:{__html:r}})]})}function c(){let e=globalThis;return typeof e.fbq=="function"?e.fbq:void 0}function p(){let e=c();return!!(e&&typeof e.callMethod=="function")}var w=800;function b(e=w){return new Promise(t=>{setTimeout(()=>{t(p()?{status:"sent"}:{status:"blocked",reason:"fbevents_not_loaded"})},e)})}function u(){let e=globalThis;return typeof e.crypto?.randomUUID=="function"?e.crypto.randomUUID():`evt_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,10)}`}function A(e,t={},o=u()){return{event_name:e,event_id:o,params:t,emitted_at:new Date().toISOString()}}var m=["PageView","ViewContent","Search","AddToCart","AddToWishlist","InitiateCheckout","AddPaymentInfo","Purchase","Lead","CompleteRegistration","Contact","CustomizeProduct","Donate","FindLocation","Schedule","StartTrial","SubmitApplication","Subscribe"],M=["ButtonClick","CtaClick","HeroCtaClick","PricingButtonClick","NavClick","MenuOpen","MenuClose","TabClick","AccordionToggle","CarouselNext","CarouselPrev","ModalOpen","ModalClose","DropdownSelect","SliderChange","ScrollDepth","ExitIntent","BackToTopClick","StickyBarClick","ToastDismiss","FormStart","FormSubmit","FormAbandon","FormStepComplete","FormValidationError","ContactFormSubmit","LeadFormSubmit","QuoteRequest","DemoRequest","CallbackRequest","NewsletterSignup","NewsletterUnsubscribe","WaitlistJoin","SurveyStart","SurveyComplete","FeedbackSubmit","NpsSubmit","RatingSubmit","ProductView","ProductListView","CategoryView","ProductCompare","RemoveFromCart","CartView","CheckoutStart","CheckoutStepComplete","ShippingSelect","PaymentSelect","OrderConfirm","OrderCancel","RefundRequest","ReviewSubmit","WishlistAdd","WishlistRemove","SearchNoResults","FilterApply","SortChange","StockAlertSubscribe","PromoCodeApply","GiftCardApply","ArticleView","BlogPostView","VideoPlay","VideoPause","VideoComplete","VideoProgress25","VideoProgress50","VideoProgress75","PodcastPlay","DocumentView","PdfView","GalleryOpen","ShareClick","CopyLink","OutboundClick","SocialClick","EmailClick","PhoneClick","WhatsAppClick","MapsClick","DirectionsClick","AppointmentClick","CalendarBook","BookingConfirm","ChatOpen","ChatMessageSent","ChatClose","SignUpStart","SignUpComplete","LoginSuccess","LoginFailure","Logout","OnboardingStart","OnboardingComplete","DashboardView","FeatureUse","SettingsChange","IntegrationConnect","ApiKeyCreate","InviteTeamMember","ReportExport","DataExport","SearchPerformed","NotificationEnable","PasswordReset","JsError","ApiError","PaymentError","CheckoutError","FormError","PageLoadError","RateLimitHit","FeatureUnavailable","PopupView","PopupClick","PopupClose","ExitPopupView","CampaignLandingView","AdClick","AffiliateClick","ReferralClick","BannerClick","CookieAccept","CookieReject"],f={ViewContent:["content_ids","value","currency"],Search:["search_string"],AddToCart:["value","currency"],AddToWishlist:["value","currency"],InitiateCheckout:["value","currency"],AddPaymentInfo:["value","currency"],Purchase:["value","currency"],Donate:["value","currency"],StartTrial:["value","currency"],Subscribe:["value","currency"]};var R=new Set(m);function N(e,t,o){typeof console<"u"&&typeof console.info=="function"&&console.info(`[Devalon Signal] ${e} \u2192 Pixel ${t} \u2713 (event_id=${o})`)}function L(e,t,o,n){if(typeof console>"u"||typeof console.warn!="function")return;console.warn(`[Devalon Signal] ${e} \u2192 Pixel ${t} ${n==="fbq_missing"?"MISSING":"BLOCKED"} \u2717 \u2014 send via CAPI with event_id=${o} (reason: ${n})`)}function F(e,t){typeof console>"u"||typeof console.warn!="function"||console.warn(`[Devalon Signal] ${e} \u26A0 \u2014 missing recommended params: ${t.join(", ")}`)}function X(e,t){typeof console>"u"||typeof console.warn!="function"||console.warn(`[Devalon Signal] ${e} \u2717 \u2014 no Devalon pixel id configured (render <DevalonSignal/> or pass { pixelId }); event_id=${t}`)}function H(e,t={},o={}){let n=o.eventId??u(),r=A(e,t,n),i=o.pixelId??v(),y=c(),l=o.debug===!0;if(!i)return l&&X(e,n),r;if(!y)return l&&L(e,i,n,"fbq_missing"),r;if(l&&R.has(e)){let P=(f[e]??[]).filter(T=>!(T in t)||t[T]===void 0);P.length>0&&F(e,P)}let V=R.has(e)?"trackSingle":"trackSingleCustom";return y(V,i,e,t,{eventID:n}),p()?(l&&N(e,i,n),r):(b().then(h=>{l&&(h.status==="sent"?N(e,i,n):L(e,i,n,"fbevents_not_loaded"))}),r)}export{M as DEVALON_CUSTOM_EVENT_NAMES,$ as DevalonSignal,E as META_PIXEL_NOSCRIPT_BASE_URL,S as META_PIXEL_SCRIPT_URL,f as META_REQUIRED_EVENT_PARAMS,m as META_STANDARD_EVENT_NAMES,w as PIXEL_READY_CHECK_DELAY_MS,b as check_pixel_after_delay,A as create_signal_event,u as create_signal_event_id,I as devalon_meta_pixel_html,s as devalon_meta_pixel_noscript,a as devalon_meta_pixel_script,v as get_signal_pixel_id,k as loadMetaPixel,c as meta_fbq,p as pixel_sdk_ready,q as reset_signal_pixel_id,g as set_signal_pixel_id,H as signal};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { META_PIXEL_NOSCRIPT_BASE_URL, META_PIXEL_SCRIPT_URL, devalon_meta_pixel_html, devalon_meta_pixel_noscript, devalon_meta_pixel_script, loadMetaPixel, } from "./pixel";
|
|
2
|
+
export { DEVALON_CUSTOM_EVENT_NAMES, META_REQUIRED_EVENT_PARAMS, META_STANDARD_EVENT_NAMES, } from "./types";
|
|
3
|
+
export type { devalon_custom_event_name, devalon_meta_event_name, devalon_meta_pixel_result, devalon_signal_event_name, } from "./types";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { devalon_meta_pixel_result } from "./types";
|
|
2
|
+
export declare const META_PIXEL_SCRIPT_URL = "https://connect.facebook.net/en_US/fbevents.js";
|
|
3
|
+
export declare const META_PIXEL_NOSCRIPT_BASE_URL = "https://www.facebook.com/tr";
|
|
4
|
+
/**
|
|
5
|
+
* The canonical Meta Pixel bootstrap, byte-for-byte identical to the snippet
|
|
6
|
+
* from Events Manager. The pixel ID is the only variable.
|
|
7
|
+
*/
|
|
8
|
+
export declare function devalon_meta_pixel_script(pixel_id: string): string;
|
|
9
|
+
/** The canonical noscript fallback image, with the pixel ID interpolated. */
|
|
10
|
+
export declare function devalon_meta_pixel_noscript(pixel_id: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Client-rendered counterpart of `DevalonSignal`, for Vite-style SPAs where
|
|
13
|
+
* there is no server HTML. Creates the script as a DOM node so the browser
|
|
14
|
+
* actually executes it, or registers our ID on an `fbq` instance that another
|
|
15
|
+
* Meta Pixel already installed. Safe to call more than once.
|
|
16
|
+
*/
|
|
17
|
+
export declare function loadMetaPixel(pixel_id: string): void;
|
|
18
|
+
export declare function devalon_meta_pixel_html(pixel_id: string, nonce?: string | undefined): devalon_meta_pixel_result;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Meta's standard Pixel events. Custom names are accepted by the trackers. */
|
|
2
|
+
export type devalon_meta_event_name = "PageView" | "ViewContent" | "Search" | "AddToCart" | "AddToWishlist" | "InitiateCheckout" | "AddPaymentInfo" | "Purchase" | "Lead" | "CompleteRegistration" | "Contact" | "CustomizeProduct" | "Donate" | "FindLocation" | "Schedule" | "StartTrial" | "SubmitApplication" | "Subscribe";
|
|
3
|
+
/** Meta's standard events. Anything else is sent via `fbq('trackCustom', …)`. */
|
|
4
|
+
export declare const META_STANDARD_EVENT_NAMES: readonly devalon_meta_event_name[];
|
|
5
|
+
/**
|
|
6
|
+
* Common custom events used across Devalon projects. This is a convenience
|
|
7
|
+
* catalog, not a restriction: `signal()` still accepts any other string.
|
|
8
|
+
*/
|
|
9
|
+
export declare const DEVALON_CUSTOM_EVENT_NAMES: readonly ["ButtonClick", "CtaClick", "HeroCtaClick", "PricingButtonClick", "NavClick", "MenuOpen", "MenuClose", "TabClick", "AccordionToggle", "CarouselNext", "CarouselPrev", "ModalOpen", "ModalClose", "DropdownSelect", "SliderChange", "ScrollDepth", "ExitIntent", "BackToTopClick", "StickyBarClick", "ToastDismiss", "FormStart", "FormSubmit", "FormAbandon", "FormStepComplete", "FormValidationError", "ContactFormSubmit", "LeadFormSubmit", "QuoteRequest", "DemoRequest", "CallbackRequest", "NewsletterSignup", "NewsletterUnsubscribe", "WaitlistJoin", "SurveyStart", "SurveyComplete", "FeedbackSubmit", "NpsSubmit", "RatingSubmit", "ProductView", "ProductListView", "CategoryView", "ProductCompare", "RemoveFromCart", "CartView", "CheckoutStart", "CheckoutStepComplete", "ShippingSelect", "PaymentSelect", "OrderConfirm", "OrderCancel", "RefundRequest", "ReviewSubmit", "WishlistAdd", "WishlistRemove", "SearchNoResults", "FilterApply", "SortChange", "StockAlertSubscribe", "PromoCodeApply", "GiftCardApply", "ArticleView", "BlogPostView", "VideoPlay", "VideoPause", "VideoComplete", "VideoProgress25", "VideoProgress50", "VideoProgress75", "PodcastPlay", "DocumentView", "PdfView", "GalleryOpen", "ShareClick", "CopyLink", "OutboundClick", "SocialClick", "EmailClick", "PhoneClick", "WhatsAppClick", "MapsClick", "DirectionsClick", "AppointmentClick", "CalendarBook", "BookingConfirm", "ChatOpen", "ChatMessageSent", "ChatClose", "SignUpStart", "SignUpComplete", "LoginSuccess", "LoginFailure", "Logout", "OnboardingStart", "OnboardingComplete", "DashboardView", "FeatureUse", "SettingsChange", "IntegrationConnect", "ApiKeyCreate", "InviteTeamMember", "ReportExport", "DataExport", "SearchPerformed", "NotificationEnable", "PasswordReset", "JsError", "ApiError", "PaymentError", "CheckoutError", "FormError", "PageLoadError", "RateLimitHit", "FeatureUnavailable", "PopupView", "PopupClick", "PopupClose", "ExitPopupView", "CampaignLandingView", "AdClick", "AffiliateClick", "ReferralClick", "BannerClick", "CookieAccept", "CookieReject"];
|
|
10
|
+
export type devalon_custom_event_name = (typeof DEVALON_CUSTOM_EVENT_NAMES)[number];
|
|
11
|
+
export type devalon_signal_event_name = devalon_meta_event_name | devalon_custom_event_name | (string & {});
|
|
12
|
+
/** Parameters Meta expects for each standard event. Used for debug warnings. */
|
|
13
|
+
export declare const META_REQUIRED_EVENT_PARAMS: Partial<Record<devalon_meta_event_name, readonly string[]>>;
|
|
14
|
+
export interface devalon_meta_pixel_result {
|
|
15
|
+
/** The canonical inline bootstrap script, without the <script> tag. */
|
|
16
|
+
script: string;
|
|
17
|
+
/** The canonical noscript fallback, without the <noscript> tag. */
|
|
18
|
+
noscript: string;
|
|
19
|
+
/** Full Meta Pixel snippet, ready to inject into server-rendered HTML. */
|
|
20
|
+
html: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { devalon_signal_event } from "./event";
|
|
2
|
+
import type { devalon_signal_event_name } from "./meta/types";
|
|
3
|
+
import type { devalon_signal_options } from "./types";
|
|
4
|
+
/**
|
|
5
|
+
* Sends one event to Devalon's Pixel only, even when other Meta Pixels are
|
|
6
|
+
* initialized on the page. Uses `trackSingle` / `trackSingleCustom` so events
|
|
7
|
+
* are not broadcast to the other Pixels' ad accounts.
|
|
8
|
+
*/
|
|
9
|
+
export declare function signal(name: devalon_signal_event_name, params?: Record<string, unknown>, options?: devalon_signal_options): devalon_signal_event;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface devalon_signal_options {
|
|
2
|
+
/** Log success/failure (including the CAPI fallback hint) to the console. */
|
|
3
|
+
debug?: boolean | undefined;
|
|
4
|
+
/** Reuse an existing id to deduplicate this event with a server CAPI event. */
|
|
5
|
+
eventId?: string | undefined;
|
|
6
|
+
/** Override Devalon's pixel ID (normally provided by `DevalonSignal`). */
|
|
7
|
+
pixelId?: string | undefined;
|
|
8
|
+
}
|
|
9
|
+
export interface devalon_signal_props {
|
|
10
|
+
/** Numeric Meta Pixel ID from Events Manager. */
|
|
11
|
+
pixelId: string;
|
|
12
|
+
/** Optional CSP nonce applied to the inline <script> tag. */
|
|
13
|
+
nonce?: string | undefined;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Config shape reserved for future vendor modules. Today only `meta` is
|
|
17
|
+
* consumed; Google and other vendors can be added without a breaking change.
|
|
18
|
+
*/
|
|
19
|
+
export interface devalon_signals_config {
|
|
20
|
+
meta?: {
|
|
21
|
+
pixelId: string;
|
|
22
|
+
} | undefined;
|
|
23
|
+
}
|
|
24
|
+
export type { devalon_signal_event } from "./event";
|
|
25
|
+
export type { devalon_meta_fbq, devalon_pixel_reason, devalon_pixel_state, devalon_pixel_status, } from "./detect";
|
|
26
|
+
export type { devalon_custom_event_name, devalon_meta_event_name, devalon_meta_pixel_result, devalon_signal_event_name, } from "./meta/types";
|