@jmp-technologies/analytics 0.1.37 → 0.1.39
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/README.md +1 -1
- package/dist/astro/client.cjs +144 -4
- package/dist/astro/client.cjs.map +1 -1
- package/dist/astro/client.d.cts +2 -2
- package/dist/astro/client.d.ts +2 -2
- package/dist/astro/client.js +2 -2
- package/dist/astro/content.cjs +190 -8
- package/dist/astro/content.cjs.map +1 -1
- package/dist/astro/content.d.cts +5 -4
- package/dist/astro/content.d.ts +5 -4
- package/dist/astro/content.js +5 -3
- package/dist/astro/integration.cjs +149 -6
- package/dist/astro/integration.cjs.map +1 -1
- package/dist/astro/integration.js +3 -3
- package/dist/astro/middleware.cjs +5 -2
- package/dist/astro/middleware.cjs.map +1 -1
- package/dist/astro/middleware.d.cts +2 -2
- package/dist/astro/middleware.d.ts +2 -2
- package/dist/astro/middleware.js +2 -2
- package/dist/astro/register.cjs +149 -6
- package/dist/astro/register.cjs.map +1 -1
- package/dist/astro/register.js +3 -3
- package/dist/{chunk-EMZXL6VF.js → chunk-6WQMWPEY.js} +6 -3
- package/dist/chunk-6WQMWPEY.js.map +1 -0
- package/dist/{chunk-D43AEUXU.js → chunk-BXPMVR7M.js} +3 -3
- package/dist/{chunk-TN6PGIB5.js → chunk-JJ3JP3RV.js} +2 -2
- package/dist/{chunk-UHXWHKHJ.js → chunk-M66PHSBO.js} +16 -3
- package/dist/chunk-M66PHSBO.js.map +1 -0
- package/dist/{chunk-VQF6QYLR.js → chunk-OCIOQIE4.js} +3 -3
- package/dist/{chunk-PTXPNIMF.js → chunk-ONIPLMOY.js} +2 -2
- package/dist/{chunk-RT2YYDCK.js → chunk-XAEWXWSP.js} +189 -8
- package/dist/chunk-XAEWXWSP.js.map +1 -0
- package/dist/constants-DTZMYgi4.d.cts +12 -0
- package/dist/constants-DTZMYgi4.d.ts +12 -0
- package/dist/{create-jmp-analytics-Bz0-K0Af.d.cts → create-jmp-analytics-C1IH32ZF.d.cts} +1 -1
- package/dist/{create-jmp-analytics-DRjrlWUn.d.ts → create-jmp-analytics-CjVYSmPJ.d.ts} +1 -1
- package/dist/index.cjs +196 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -13
- package/dist/index.d.ts +11 -13
- package/dist/index.js +10 -2
- package/dist/next/content.cjs +195 -8
- package/dist/next/content.cjs.map +1 -1
- package/dist/next/content.d.cts +6 -4
- package/dist/next/content.d.ts +6 -4
- package/dist/next/content.js +11 -3
- package/dist/next/content.js.map +1 -1
- package/dist/next/instrumentation.cjs +149 -6
- package/dist/next/instrumentation.cjs.map +1 -1
- package/dist/next/instrumentation.js +2 -2
- package/dist/next/landing-pages.cjs +156 -7
- package/dist/next/landing-pages.cjs.map +1 -1
- package/dist/next/landing-pages.d.cts +2 -2
- package/dist/next/landing-pages.d.ts +2 -2
- package/dist/next/landing-pages.js +3 -3
- package/dist/next/locations.cjs +156 -7
- package/dist/next/locations.cjs.map +1 -1
- package/dist/next/locations.d.cts +2 -2
- package/dist/next/locations.d.ts +2 -2
- package/dist/next/locations.js +3 -3
- package/dist/next/middleware.cjs +5 -2
- package/dist/next/middleware.cjs.map +1 -1
- package/dist/next/middleware.d.cts +2 -2
- package/dist/next/middleware.d.ts +2 -2
- package/dist/next/middleware.js +2 -2
- package/dist/next/site-root-server.cjs +156 -7
- package/dist/next/site-root-server.cjs.map +1 -1
- package/dist/next/site-root-server.js +4 -4
- package/dist/next.cjs +144 -4
- package/dist/next.cjs.map +1 -1
- package/dist/next.d.cts +3 -3
- package/dist/next.d.ts +3 -3
- package/dist/next.js +4 -4
- package/dist/react.cjs +144 -4
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +3 -3
- package/dist/{site-config-BxEmJxBB.d.ts → site-config-BEaYpZ3X.d.ts} +9 -3
- package/dist/{site-config-Cgq67uQ1.d.cts → site-config-BN6Z2zIf.d.cts} +9 -3
- package/dist/{track-page-view-74Su6lQY.d.ts → track-page-view-B3OwUOYl.d.ts} +1 -1
- package/dist/{track-page-view-BCX1Dsfk.d.cts → track-page-view-BeVjC-pV.d.cts} +1 -1
- package/dist/{types-yNgoakwk.d.ts → types-uwXEaMD6.d.cts} +45 -2
- package/dist/{types-yNgoakwk.d.cts → types-uwXEaMD6.d.ts} +45 -2
- package/dist/{utils-BLoWWfSw.d.ts → utils-6a6lNKsg.d.ts} +1 -1
- package/dist/{utils-UPTIdK1D.d.cts → utils-Cbb3CO3i.d.cts} +1 -1
- package/docs/legal-and-privacy.md +2 -2
- package/package.json +1 -1
- package/dist/chunk-EMZXL6VF.js.map +0 -1
- package/dist/chunk-RT2YYDCK.js.map +0 -1
- package/dist/chunk-UHXWHKHJ.js.map +0 -1
- /package/dist/{chunk-D43AEUXU.js.map → chunk-BXPMVR7M.js.map} +0 -0
- /package/dist/{chunk-TN6PGIB5.js.map → chunk-JJ3JP3RV.js.map} +0 -0
- /package/dist/{chunk-VQF6QYLR.js.map → chunk-OCIOQIE4.js.map} +0 -0
- /package/dist/{chunk-PTXPNIMF.js.map → chunk-ONIPLMOY.js.map} +0 -0
package/dist/next.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { q as JmpAnalyticsConfig } from './types-uwXEaMD6.cjs';
|
|
4
4
|
export { b as buildLandingCaptureInlineScript } from './landing-capture-C8pyZWuF.cjs';
|
|
5
|
-
import { J as JmpAnalytics } from './create-jmp-analytics-
|
|
6
|
-
export { i as isJmpTrackingConsentGranted, s as setJmpTrackingConsent, a as subscribeJmpTrackingConsent } from './create-jmp-analytics-
|
|
5
|
+
import { J as JmpAnalytics } from './create-jmp-analytics-C1IH32ZF.cjs';
|
|
6
|
+
export { i as isJmpTrackingConsentGranted, s as setJmpTrackingConsent, a as subscribeJmpTrackingConsent } from './create-jmp-analytics-C1IH32ZF.cjs';
|
|
7
7
|
export { r as readJmpPublicEnvFromProcess } from './env-public-B6Y0DG68.cjs';
|
|
8
8
|
export { JmpTrackedMailtoLink, JmpTrackedTelLink } from './react.cjs';
|
|
9
9
|
export { JmpGoogleTag } from './next/google-tag.cjs';
|
package/dist/next.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { q as JmpAnalyticsConfig } from './types-uwXEaMD6.js';
|
|
4
4
|
export { b as buildLandingCaptureInlineScript } from './landing-capture-C8pyZWuF.js';
|
|
5
|
-
import { J as JmpAnalytics } from './create-jmp-analytics-
|
|
6
|
-
export { i as isJmpTrackingConsentGranted, s as setJmpTrackingConsent, a as subscribeJmpTrackingConsent } from './create-jmp-analytics-
|
|
5
|
+
import { J as JmpAnalytics } from './create-jmp-analytics-CjVYSmPJ.js';
|
|
6
|
+
export { i as isJmpTrackingConsentGranted, s as setJmpTrackingConsent, a as subscribeJmpTrackingConsent } from './create-jmp-analytics-CjVYSmPJ.js';
|
|
7
7
|
export { r as readJmpPublicEnvFromProcess } from './env-public-B6Y0DG68.js';
|
|
8
8
|
export { JmpTrackedMailtoLink, JmpTrackedTelLink } from './react.js';
|
|
9
9
|
export { JmpGoogleTag } from './next/google-tag.js';
|
package/dist/next.js
CHANGED
|
@@ -5,25 +5,25 @@ import {
|
|
|
5
5
|
JmpSiteRoot,
|
|
6
6
|
getOrCreateJmpAnalyticsForNextApp,
|
|
7
7
|
useJmpAnalytics
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-BXPMVR7M.js";
|
|
9
9
|
import {
|
|
10
10
|
JmpGoogleTag
|
|
11
11
|
} from "./chunk-2KAGOVRZ.js";
|
|
12
12
|
import {
|
|
13
13
|
JmpTrackedMailtoLink,
|
|
14
14
|
JmpTrackedTelLink
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-JJ3JP3RV.js";
|
|
16
16
|
import {
|
|
17
17
|
isJmpTrackingConsentGranted,
|
|
18
18
|
setJmpTrackingConsent,
|
|
19
19
|
subscribeJmpTrackingConsent
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-XAEWXWSP.js";
|
|
21
21
|
import {
|
|
22
22
|
buildLandingCaptureInlineScript
|
|
23
23
|
} from "./chunk-TCZ6TC2L.js";
|
|
24
24
|
import {
|
|
25
25
|
readJmpPublicEnvFromProcess
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-6WQMWPEY.js";
|
|
27
27
|
export {
|
|
28
28
|
JmpGoogleTag,
|
|
29
29
|
JmpNextAnalytics,
|
package/dist/react.cjs
CHANGED
|
@@ -306,7 +306,7 @@ function getOrCreateSessionIdFromStorage() {
|
|
|
306
306
|
}
|
|
307
307
|
|
|
308
308
|
// package.json
|
|
309
|
-
var version = "0.1.
|
|
309
|
+
var version = "0.1.39";
|
|
310
310
|
|
|
311
311
|
// src/constants.ts
|
|
312
312
|
var JMP_ANALYTICS_SDK_VERSION = version;
|
|
@@ -954,7 +954,8 @@ function normalizeJmpContentManifest(input) {
|
|
|
954
954
|
const externalSources = normalizeExternalSources(input.externalSources);
|
|
955
955
|
const trust = normalizeTrust(input.trust);
|
|
956
956
|
const contact = normalizeContact(input.contact);
|
|
957
|
-
|
|
957
|
+
const defaults = normalizeManifestDefaults(input.defaults);
|
|
958
|
+
if (routes.length === 0 && !externalSources && !trust && !contact && !defaults) {
|
|
958
959
|
return null;
|
|
959
960
|
}
|
|
960
961
|
return {
|
|
@@ -962,7 +963,8 @@ function normalizeJmpContentManifest(input) {
|
|
|
962
963
|
...routes.length > 0 ? { routes } : {},
|
|
963
964
|
...externalSources ? { externalSources } : {},
|
|
964
965
|
...trust ? { trust } : {},
|
|
965
|
-
...contact ? { contact } : {}
|
|
966
|
+
...contact ? { contact } : {},
|
|
967
|
+
...defaults ? { defaults } : {}
|
|
966
968
|
};
|
|
967
969
|
}
|
|
968
970
|
function normalizeRoutes(routes) {
|
|
@@ -1026,6 +1028,85 @@ function normalizeTrustLabels(labels) {
|
|
|
1026
1028
|
}
|
|
1027
1029
|
return Object.keys(out).length > 0 ? out : null;
|
|
1028
1030
|
}
|
|
1031
|
+
function readDefaultText(value, max = 500) {
|
|
1032
|
+
if (typeof value !== "string") return void 0;
|
|
1033
|
+
const trimmed = value.trim();
|
|
1034
|
+
if (!trimmed) return void 0;
|
|
1035
|
+
return trimmed.slice(0, max);
|
|
1036
|
+
}
|
|
1037
|
+
function normalizeManifestDefaults(defaults) {
|
|
1038
|
+
if (!defaults || typeof defaults !== "object") return null;
|
|
1039
|
+
const contactRaw = defaults.contact;
|
|
1040
|
+
const contact = {};
|
|
1041
|
+
if (contactRaw && typeof contactRaw === "object") {
|
|
1042
|
+
const displayName = readDefaultText(contactRaw.displayName, 120);
|
|
1043
|
+
const email = readDefaultText(contactRaw.email, 200);
|
|
1044
|
+
const phone = readDefaultText(contactRaw.phone, 40);
|
|
1045
|
+
const address = readDefaultText(contactRaw.address, 400);
|
|
1046
|
+
const hours = readDefaultText(contactRaw.hours, 400);
|
|
1047
|
+
const serviceArea = readDefaultText(contactRaw.serviceArea, 200);
|
|
1048
|
+
const googleMapsUrl = readDefaultText(contactRaw.googleMapsUrl, 2048);
|
|
1049
|
+
const linkedinUrl = readDefaultText(contactRaw.linkedinUrl, 2048);
|
|
1050
|
+
const instagramUrl = readDefaultText(contactRaw.instagramUrl, 2048);
|
|
1051
|
+
const facebookUrl = readDefaultText(contactRaw.facebookUrl, 2048);
|
|
1052
|
+
const xUrl = readDefaultText(contactRaw.xUrl, 2048);
|
|
1053
|
+
const youtubeUrl = readDefaultText(contactRaw.youtubeUrl, 2048);
|
|
1054
|
+
if (displayName) contact.displayName = displayName;
|
|
1055
|
+
if (email) contact.email = email;
|
|
1056
|
+
if (phone) contact.phone = phone;
|
|
1057
|
+
if (address) contact.address = address;
|
|
1058
|
+
if (hours) contact.hours = hours;
|
|
1059
|
+
if (serviceArea) contact.serviceArea = serviceArea;
|
|
1060
|
+
if (googleMapsUrl) contact.googleMapsUrl = googleMapsUrl;
|
|
1061
|
+
if (linkedinUrl) contact.linkedinUrl = linkedinUrl;
|
|
1062
|
+
if (instagramUrl) contact.instagramUrl = instagramUrl;
|
|
1063
|
+
if (facebookUrl) contact.facebookUrl = facebookUrl;
|
|
1064
|
+
if (xUrl) contact.xUrl = xUrl;
|
|
1065
|
+
if (youtubeUrl) contact.youtubeUrl = youtubeUrl;
|
|
1066
|
+
if (contactRaw.extras && typeof contactRaw.extras === "object") {
|
|
1067
|
+
const extras = {};
|
|
1068
|
+
for (const [rawKey, rawValue] of Object.entries(contactRaw.extras)) {
|
|
1069
|
+
if (Object.keys(extras).length >= 10) break;
|
|
1070
|
+
const key = normalizeKey(rawKey);
|
|
1071
|
+
const value = readDefaultText(rawValue, 200);
|
|
1072
|
+
if (key && isValidExtraKey(key) && value) extras[key] = value;
|
|
1073
|
+
}
|
|
1074
|
+
if (Object.keys(extras).length > 0) contact.extras = extras;
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
const faq = [];
|
|
1078
|
+
if (Array.isArray(defaults.faq)) {
|
|
1079
|
+
for (const raw of defaults.faq) {
|
|
1080
|
+
if (!raw || typeof raw !== "object" || faq.length >= 40) continue;
|
|
1081
|
+
const question = readDefaultText(raw.question, 300);
|
|
1082
|
+
const answer = readDefaultText(raw.answer, 8e3);
|
|
1083
|
+
if (!question || !answer) continue;
|
|
1084
|
+
const category = readDefaultText(raw.category, 80);
|
|
1085
|
+
faq.push({ question, answer, ...category ? { category } : {} });
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
const trustRaw = defaults.trust;
|
|
1089
|
+
const trust = {};
|
|
1090
|
+
if (trustRaw && typeof trustRaw === "object") {
|
|
1091
|
+
const assign = (key, max) => {
|
|
1092
|
+
const value = readDefaultText(trustRaw[key], max);
|
|
1093
|
+
if (value) trust[key] = value;
|
|
1094
|
+
};
|
|
1095
|
+
assign("googleReviewsUrl", 2048);
|
|
1096
|
+
assign("googlePlaceId", 128);
|
|
1097
|
+
assign("yelpUrl", 2048);
|
|
1098
|
+
assign("trustpilotUrl", 2048);
|
|
1099
|
+
assign("disclaimer", 1e3);
|
|
1100
|
+
}
|
|
1101
|
+
const hasContact = Object.keys(contact).length > 0;
|
|
1102
|
+
const hasTrust = Object.keys(trust).length > 0;
|
|
1103
|
+
if (!hasContact && faq.length === 0 && !hasTrust) return null;
|
|
1104
|
+
return {
|
|
1105
|
+
...hasContact ? { contact } : {},
|
|
1106
|
+
...faq.length > 0 ? { faq } : {},
|
|
1107
|
+
...hasTrust ? { trust } : {}
|
|
1108
|
+
};
|
|
1109
|
+
}
|
|
1029
1110
|
function normalizeContact(contact) {
|
|
1030
1111
|
if (!contact || typeof contact !== "object") return null;
|
|
1031
1112
|
const extras = normalizeContactExtras(contact.extras);
|
|
@@ -1077,6 +1158,7 @@ var WRAPPER_SLOT_ORDER = [
|
|
|
1077
1158
|
"blog",
|
|
1078
1159
|
"faq",
|
|
1079
1160
|
"contact",
|
|
1161
|
+
"legal",
|
|
1080
1162
|
"trust",
|
|
1081
1163
|
"trust.summary",
|
|
1082
1164
|
"trust.testimonials",
|
|
@@ -1092,7 +1174,65 @@ function getDiscoveredContentWrappers() {
|
|
|
1092
1174
|
return sortWrapperSlots([...discovered]);
|
|
1093
1175
|
}
|
|
1094
1176
|
function resolveContentManifestForReport(config) {
|
|
1095
|
-
|
|
1177
|
+
const site = getJmpSiteDefinition();
|
|
1178
|
+
const fallback = site?.contactFallback;
|
|
1179
|
+
const existing = config.contentManifest;
|
|
1180
|
+
const fromFallback = fallbackToManifestDefaults(fallback);
|
|
1181
|
+
if (!existing && !fromFallback) {
|
|
1182
|
+
return null;
|
|
1183
|
+
}
|
|
1184
|
+
const merged = {
|
|
1185
|
+
...existing ?? {},
|
|
1186
|
+
defaults: {
|
|
1187
|
+
...fromFallback ?? {},
|
|
1188
|
+
...existing?.defaults ?? {},
|
|
1189
|
+
contact: {
|
|
1190
|
+
...fromFallback?.contact ?? {},
|
|
1191
|
+
...existing?.defaults?.contact ?? {},
|
|
1192
|
+
extras: {
|
|
1193
|
+
...fromFallback?.contact?.extras ?? {},
|
|
1194
|
+
...existing?.defaults?.contact?.extras ?? {}
|
|
1195
|
+
}
|
|
1196
|
+
},
|
|
1197
|
+
trust: {
|
|
1198
|
+
...fromFallback?.trust ?? {},
|
|
1199
|
+
...existing?.defaults?.trust ?? {}
|
|
1200
|
+
},
|
|
1201
|
+
faq: existing?.defaults?.faq?.length ? existing.defaults.faq : fromFallback?.faq
|
|
1202
|
+
}
|
|
1203
|
+
};
|
|
1204
|
+
return normalizeJmpContentManifest(merged);
|
|
1205
|
+
}
|
|
1206
|
+
function fallbackToManifestDefaults(fallback) {
|
|
1207
|
+
if (!fallback) return null;
|
|
1208
|
+
const contact = {};
|
|
1209
|
+
if (fallback.displayName?.trim()) contact.displayName = fallback.displayName.trim();
|
|
1210
|
+
if (fallback.email?.trim()) contact.email = fallback.email.trim();
|
|
1211
|
+
if (typeof fallback.phone === "string" && fallback.phone.trim()) {
|
|
1212
|
+
contact.phone = fallback.phone.trim();
|
|
1213
|
+
}
|
|
1214
|
+
if (fallback.address?.trim()) contact.address = fallback.address.trim();
|
|
1215
|
+
if (fallback.hours?.trim()) contact.hours = fallback.hours.trim();
|
|
1216
|
+
if (fallback.serviceArea?.trim()) contact.serviceArea = fallback.serviceArea.trim();
|
|
1217
|
+
if (fallback.googleMapsUrl?.trim()) {
|
|
1218
|
+
contact.googleMapsUrl = fallback.googleMapsUrl.trim();
|
|
1219
|
+
}
|
|
1220
|
+
if (fallback.linkedin?.trim()) contact.linkedinUrl = fallback.linkedin.trim();
|
|
1221
|
+
if (fallback.instagram?.trim()) contact.instagramUrl = fallback.instagram.trim();
|
|
1222
|
+
if (fallback.facebook?.trim()) contact.facebookUrl = fallback.facebook.trim();
|
|
1223
|
+
if (fallback.x?.trim()) contact.xUrl = fallback.x.trim();
|
|
1224
|
+
if (fallback.youtube?.trim()) contact.youtubeUrl = fallback.youtube.trim();
|
|
1225
|
+
const trust = {};
|
|
1226
|
+
if (fallback.googleMapsUrl?.trim()) {
|
|
1227
|
+
trust.googleReviewsUrl = fallback.googleMapsUrl.trim();
|
|
1228
|
+
}
|
|
1229
|
+
const hasContact = Object.keys(contact).length > 0;
|
|
1230
|
+
const hasTrust = Object.keys(trust).length > 0;
|
|
1231
|
+
if (!hasContact && !hasTrust) return null;
|
|
1232
|
+
return {
|
|
1233
|
+
...hasContact ? { contact } : {},
|
|
1234
|
+
...hasTrust ? { trust } : {}
|
|
1235
|
+
};
|
|
1096
1236
|
}
|
|
1097
1237
|
function resolveContentWrappersForReport(config) {
|
|
1098
1238
|
const explicit = config.contentWrappers ?? [];
|