keystone-design-bootstrap 1.0.60 → 1.0.62
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/design_system/sections/index.js +48 -2
- package/dist/design_system/sections/index.js.map +1 -1
- package/dist/index.js +48 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/design_system/portal/LoginForm.tsx +5 -1
- package/src/design_system/portal/PortalPage.tsx +10 -4
- package/src/design_system/sections/contact-section-form.aman.tsx +2 -1
- package/src/design_system/sections/contact-section-form.balance.tsx +2 -1
- package/src/design_system/sections/contact-section-form.barelux.tsx +2 -1
- package/src/design_system/sections/contact-section-form.tsx +2 -1
- package/src/next/routes/chat.ts +7 -1
- package/src/next/routes/consumer-auth.ts +6 -4
- package/src/next/routes/form.ts +3 -0
- package/src/next/routes/proxy-headers.ts +22 -0
- package/src/tracking/MetaPixel.tsx +4 -0
- package/src/tracking/firePixelEvent.ts +80 -3
- package/src/tracking/index.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -6198,13 +6198,55 @@ function DynamicFormFields({ form, jobSlug, privacyPolicyUrl, termsOfServiceUrl
|
|
|
6198
6198
|
}
|
|
6199
6199
|
|
|
6200
6200
|
// src/tracking/firePixelEvent.ts
|
|
6201
|
+
var STORAGE_KEY = "ks_pud";
|
|
6202
|
+
async function sha256Hex(str) {
|
|
6203
|
+
const buffer = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(str));
|
|
6204
|
+
return Array.from(new Uint8Array(buffer)).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
6205
|
+
}
|
|
6206
|
+
function getFbq() {
|
|
6207
|
+
if (typeof window === "undefined") return void 0;
|
|
6208
|
+
return window.fbq;
|
|
6209
|
+
}
|
|
6210
|
+
function getRegisteredPixelIds() {
|
|
6211
|
+
var _a;
|
|
6212
|
+
return (_a = window.__ks_pixel_ids) != null ? _a : [];
|
|
6213
|
+
}
|
|
6214
|
+
function applyStoredUserData(fbq) {
|
|
6215
|
+
try {
|
|
6216
|
+
const raw = sessionStorage.getItem(STORAGE_KEY);
|
|
6217
|
+
if (!raw) return;
|
|
6218
|
+
const hashed = JSON.parse(raw);
|
|
6219
|
+
if (Object.keys(hashed).length === 0) return;
|
|
6220
|
+
getRegisteredPixelIds().forEach((id3) => fbq("init", id3, hashed));
|
|
6221
|
+
} catch (e) {
|
|
6222
|
+
}
|
|
6223
|
+
}
|
|
6224
|
+
async function setPixelUserData(userData) {
|
|
6225
|
+
const hashed = {};
|
|
6226
|
+
if (userData.email) {
|
|
6227
|
+
hashed.em = await sha256Hex(userData.email.trim().toLowerCase());
|
|
6228
|
+
}
|
|
6229
|
+
if (userData.phone) {
|
|
6230
|
+
const digits = userData.phone.replace(/\D/g, "");
|
|
6231
|
+
if (digits) hashed.ph = await sha256Hex(digits);
|
|
6232
|
+
}
|
|
6233
|
+
if (Object.keys(hashed).length === 0) return;
|
|
6234
|
+
try {
|
|
6235
|
+
sessionStorage.setItem(STORAGE_KEY, JSON.stringify(hashed));
|
|
6236
|
+
} catch (e) {
|
|
6237
|
+
}
|
|
6238
|
+
const fbq = getFbq();
|
|
6239
|
+
if (fbq) {
|
|
6240
|
+
getRegisteredPixelIds().forEach((id3) => fbq("init", id3, hashed));
|
|
6241
|
+
}
|
|
6242
|
+
}
|
|
6201
6243
|
function firePixelEvent(event, params) {
|
|
6202
|
-
|
|
6203
|
-
const fbq = window.fbq;
|
|
6244
|
+
const fbq = getFbq();
|
|
6204
6245
|
if (!fbq) {
|
|
6205
6246
|
console.debug("[MetaPixel] skipped \u2014 fbq not loaded", { event });
|
|
6206
6247
|
return;
|
|
6207
6248
|
}
|
|
6249
|
+
applyStoredUserData(fbq);
|
|
6208
6250
|
const normalized = {};
|
|
6209
6251
|
if (params == null ? void 0 : params.contentName) normalized.content_name = params.contentName;
|
|
6210
6252
|
if (params == null ? void 0 : params.contentCategory) normalized.content_category = params.contentCategory;
|
|
@@ -6266,6 +6308,7 @@ var ContactSectionForm = ({
|
|
|
6266
6308
|
setStatusMessage(result.message || successMessage);
|
|
6267
6309
|
(_a = formRef.current) == null ? void 0 : _a.reset();
|
|
6268
6310
|
onSuccess == null ? void 0 : onSuccess();
|
|
6311
|
+
await setPixelUserData({ email: data.email, phone: data.phone });
|
|
6269
6312
|
firePixelEvent("Lead");
|
|
6270
6313
|
setTimeout(() => setSubmitStatus("idle"), 5e3);
|
|
6271
6314
|
} else {
|
|
@@ -9027,6 +9070,7 @@ var ContactSectionForm2 = ({
|
|
|
9027
9070
|
setStatusMessage(result.message || successMessage);
|
|
9028
9071
|
(_a = formRef.current) == null ? void 0 : _a.reset();
|
|
9029
9072
|
onSuccess == null ? void 0 : onSuccess();
|
|
9073
|
+
await setPixelUserData({ email: data.email, phone: data.phone });
|
|
9030
9074
|
firePixelEvent("Lead");
|
|
9031
9075
|
setTimeout(() => setSubmitStatus("idle"), 5e3);
|
|
9032
9076
|
} else {
|
|
@@ -18228,6 +18272,7 @@ var ContactSectionForm3 = ({
|
|
|
18228
18272
|
setStatusMessage(result.message || successMessage);
|
|
18229
18273
|
(_a = formRef.current) == null ? void 0 : _a.reset();
|
|
18230
18274
|
onSuccess == null ? void 0 : onSuccess();
|
|
18275
|
+
await setPixelUserData({ email: data.email, phone: data.phone });
|
|
18231
18276
|
firePixelEvent("Lead");
|
|
18232
18277
|
setTimeout(() => setSubmitStatus("idle"), 5e3);
|
|
18233
18278
|
} else {
|
|
@@ -18721,6 +18766,7 @@ var ContactSectionForm4 = ({
|
|
|
18721
18766
|
setStatusMessage(result.message || successMessage);
|
|
18722
18767
|
(_a = formRef.current) == null ? void 0 : _a.reset();
|
|
18723
18768
|
onSuccess == null ? void 0 : onSuccess();
|
|
18769
|
+
await setPixelUserData({ email: data.email, phone: data.phone });
|
|
18724
18770
|
firePixelEvent("Lead");
|
|
18725
18771
|
setTimeout(() => setSubmitStatus("idle"), 5e3);
|
|
18726
18772
|
} else {
|