@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.
Files changed (95) hide show
  1. package/README.md +1 -1
  2. package/dist/astro/client.cjs +144 -4
  3. package/dist/astro/client.cjs.map +1 -1
  4. package/dist/astro/client.d.cts +2 -2
  5. package/dist/astro/client.d.ts +2 -2
  6. package/dist/astro/client.js +2 -2
  7. package/dist/astro/content.cjs +190 -8
  8. package/dist/astro/content.cjs.map +1 -1
  9. package/dist/astro/content.d.cts +5 -4
  10. package/dist/astro/content.d.ts +5 -4
  11. package/dist/astro/content.js +5 -3
  12. package/dist/astro/integration.cjs +149 -6
  13. package/dist/astro/integration.cjs.map +1 -1
  14. package/dist/astro/integration.js +3 -3
  15. package/dist/astro/middleware.cjs +5 -2
  16. package/dist/astro/middleware.cjs.map +1 -1
  17. package/dist/astro/middleware.d.cts +2 -2
  18. package/dist/astro/middleware.d.ts +2 -2
  19. package/dist/astro/middleware.js +2 -2
  20. package/dist/astro/register.cjs +149 -6
  21. package/dist/astro/register.cjs.map +1 -1
  22. package/dist/astro/register.js +3 -3
  23. package/dist/{chunk-EMZXL6VF.js → chunk-6WQMWPEY.js} +6 -3
  24. package/dist/chunk-6WQMWPEY.js.map +1 -0
  25. package/dist/{chunk-D43AEUXU.js → chunk-BXPMVR7M.js} +3 -3
  26. package/dist/{chunk-TN6PGIB5.js → chunk-JJ3JP3RV.js} +2 -2
  27. package/dist/{chunk-UHXWHKHJ.js → chunk-M66PHSBO.js} +16 -3
  28. package/dist/chunk-M66PHSBO.js.map +1 -0
  29. package/dist/{chunk-VQF6QYLR.js → chunk-OCIOQIE4.js} +3 -3
  30. package/dist/{chunk-PTXPNIMF.js → chunk-ONIPLMOY.js} +2 -2
  31. package/dist/{chunk-RT2YYDCK.js → chunk-XAEWXWSP.js} +189 -8
  32. package/dist/chunk-XAEWXWSP.js.map +1 -0
  33. package/dist/constants-DTZMYgi4.d.cts +12 -0
  34. package/dist/constants-DTZMYgi4.d.ts +12 -0
  35. package/dist/{create-jmp-analytics-Bz0-K0Af.d.cts → create-jmp-analytics-C1IH32ZF.d.cts} +1 -1
  36. package/dist/{create-jmp-analytics-DRjrlWUn.d.ts → create-jmp-analytics-CjVYSmPJ.d.ts} +1 -1
  37. package/dist/index.cjs +196 -8
  38. package/dist/index.cjs.map +1 -1
  39. package/dist/index.d.cts +11 -13
  40. package/dist/index.d.ts +11 -13
  41. package/dist/index.js +10 -2
  42. package/dist/next/content.cjs +195 -8
  43. package/dist/next/content.cjs.map +1 -1
  44. package/dist/next/content.d.cts +6 -4
  45. package/dist/next/content.d.ts +6 -4
  46. package/dist/next/content.js +11 -3
  47. package/dist/next/content.js.map +1 -1
  48. package/dist/next/instrumentation.cjs +149 -6
  49. package/dist/next/instrumentation.cjs.map +1 -1
  50. package/dist/next/instrumentation.js +2 -2
  51. package/dist/next/landing-pages.cjs +156 -7
  52. package/dist/next/landing-pages.cjs.map +1 -1
  53. package/dist/next/landing-pages.d.cts +2 -2
  54. package/dist/next/landing-pages.d.ts +2 -2
  55. package/dist/next/landing-pages.js +3 -3
  56. package/dist/next/locations.cjs +156 -7
  57. package/dist/next/locations.cjs.map +1 -1
  58. package/dist/next/locations.d.cts +2 -2
  59. package/dist/next/locations.d.ts +2 -2
  60. package/dist/next/locations.js +3 -3
  61. package/dist/next/middleware.cjs +5 -2
  62. package/dist/next/middleware.cjs.map +1 -1
  63. package/dist/next/middleware.d.cts +2 -2
  64. package/dist/next/middleware.d.ts +2 -2
  65. package/dist/next/middleware.js +2 -2
  66. package/dist/next/site-root-server.cjs +156 -7
  67. package/dist/next/site-root-server.cjs.map +1 -1
  68. package/dist/next/site-root-server.js +4 -4
  69. package/dist/next.cjs +144 -4
  70. package/dist/next.cjs.map +1 -1
  71. package/dist/next.d.cts +3 -3
  72. package/dist/next.d.ts +3 -3
  73. package/dist/next.js +4 -4
  74. package/dist/react.cjs +144 -4
  75. package/dist/react.cjs.map +1 -1
  76. package/dist/react.d.cts +2 -2
  77. package/dist/react.d.ts +2 -2
  78. package/dist/react.js +3 -3
  79. package/dist/{site-config-BxEmJxBB.d.ts → site-config-BEaYpZ3X.d.ts} +9 -3
  80. package/dist/{site-config-Cgq67uQ1.d.cts → site-config-BN6Z2zIf.d.cts} +9 -3
  81. package/dist/{track-page-view-74Su6lQY.d.ts → track-page-view-B3OwUOYl.d.ts} +1 -1
  82. package/dist/{track-page-view-BCX1Dsfk.d.cts → track-page-view-BeVjC-pV.d.cts} +1 -1
  83. package/dist/{types-yNgoakwk.d.ts → types-uwXEaMD6.d.cts} +45 -2
  84. package/dist/{types-yNgoakwk.d.cts → types-uwXEaMD6.d.ts} +45 -2
  85. package/dist/{utils-BLoWWfSw.d.ts → utils-6a6lNKsg.d.ts} +1 -1
  86. package/dist/{utils-UPTIdK1D.d.cts → utils-Cbb3CO3i.d.cts} +1 -1
  87. package/docs/legal-and-privacy.md +2 -2
  88. package/package.json +1 -1
  89. package/dist/chunk-EMZXL6VF.js.map +0 -1
  90. package/dist/chunk-RT2YYDCK.js.map +0 -1
  91. package/dist/chunk-UHXWHKHJ.js.map +0 -1
  92. /package/dist/{chunk-D43AEUXU.js.map → chunk-BXPMVR7M.js.map} +0 -0
  93. /package/dist/{chunk-TN6PGIB5.js.map → chunk-JJ3JP3RV.js.map} +0 -0
  94. /package/dist/{chunk-VQF6QYLR.js.map → chunk-OCIOQIE4.js.map} +0 -0
  95. /package/dist/{chunk-PTXPNIMF.js.map → chunk-ONIPLMOY.js.map} +0 -0
@@ -3,20 +3,20 @@ import {
3
3
  } from "../chunk-G5BMWPQ6.js";
4
4
  import {
5
5
  JmpSiteRoot
6
- } from "../chunk-D43AEUXU.js";
6
+ } from "../chunk-BXPMVR7M.js";
7
7
  import {
8
8
  JmpGoogleTag
9
9
  } from "../chunk-2KAGOVRZ.js";
10
- import "../chunk-TN6PGIB5.js";
10
+ import "../chunk-JJ3JP3RV.js";
11
11
  import {
12
12
  getJmpSiteProfile
13
- } from "../chunk-RT2YYDCK.js";
13
+ } from "../chunk-XAEWXWSP.js";
14
14
  import "../chunk-TCZ6TC2L.js";
15
15
  import {
16
16
  getJmpContentConfig,
17
17
  getJmpSiteDefinition,
18
18
  readJmpPublicEnvFromProcess
19
- } from "../chunk-EMZXL6VF.js";
19
+ } from "../chunk-6WQMWPEY.js";
20
20
 
21
21
  // src/next/site-root-server.tsx
22
22
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
package/dist/next.cjs CHANGED
@@ -95,7 +95,7 @@ function readJmpPublicEnvFromProcess(overrides) {
95
95
  }
96
96
 
97
97
  // package.json
98
- var version = "0.1.37";
98
+ var version = "0.1.39";
99
99
 
100
100
  // src/constants.ts
101
101
  var JMP_ANALYTICS_SDK_VERSION = version;
@@ -992,7 +992,8 @@ function normalizeJmpContentManifest(input) {
992
992
  const externalSources = normalizeExternalSources(input.externalSources);
993
993
  const trust = normalizeTrust(input.trust);
994
994
  const contact = normalizeContact(input.contact);
995
- if (routes.length === 0 && !externalSources && !trust && !contact) {
995
+ const defaults = normalizeManifestDefaults(input.defaults);
996
+ if (routes.length === 0 && !externalSources && !trust && !contact && !defaults) {
996
997
  return null;
997
998
  }
998
999
  return {
@@ -1000,7 +1001,8 @@ function normalizeJmpContentManifest(input) {
1000
1001
  ...routes.length > 0 ? { routes } : {},
1001
1002
  ...externalSources ? { externalSources } : {},
1002
1003
  ...trust ? { trust } : {},
1003
- ...contact ? { contact } : {}
1004
+ ...contact ? { contact } : {},
1005
+ ...defaults ? { defaults } : {}
1004
1006
  };
1005
1007
  }
1006
1008
  function normalizeRoutes(routes) {
@@ -1064,6 +1066,85 @@ function normalizeTrustLabels(labels) {
1064
1066
  }
1065
1067
  return Object.keys(out).length > 0 ? out : null;
1066
1068
  }
1069
+ function readDefaultText(value, max = 500) {
1070
+ if (typeof value !== "string") return void 0;
1071
+ const trimmed = value.trim();
1072
+ if (!trimmed) return void 0;
1073
+ return trimmed.slice(0, max);
1074
+ }
1075
+ function normalizeManifestDefaults(defaults) {
1076
+ if (!defaults || typeof defaults !== "object") return null;
1077
+ const contactRaw = defaults.contact;
1078
+ const contact = {};
1079
+ if (contactRaw && typeof contactRaw === "object") {
1080
+ const displayName = readDefaultText(contactRaw.displayName, 120);
1081
+ const email = readDefaultText(contactRaw.email, 200);
1082
+ const phone = readDefaultText(contactRaw.phone, 40);
1083
+ const address = readDefaultText(contactRaw.address, 400);
1084
+ const hours = readDefaultText(contactRaw.hours, 400);
1085
+ const serviceArea = readDefaultText(contactRaw.serviceArea, 200);
1086
+ const googleMapsUrl = readDefaultText(contactRaw.googleMapsUrl, 2048);
1087
+ const linkedinUrl = readDefaultText(contactRaw.linkedinUrl, 2048);
1088
+ const instagramUrl = readDefaultText(contactRaw.instagramUrl, 2048);
1089
+ const facebookUrl = readDefaultText(contactRaw.facebookUrl, 2048);
1090
+ const xUrl = readDefaultText(contactRaw.xUrl, 2048);
1091
+ const youtubeUrl = readDefaultText(contactRaw.youtubeUrl, 2048);
1092
+ if (displayName) contact.displayName = displayName;
1093
+ if (email) contact.email = email;
1094
+ if (phone) contact.phone = phone;
1095
+ if (address) contact.address = address;
1096
+ if (hours) contact.hours = hours;
1097
+ if (serviceArea) contact.serviceArea = serviceArea;
1098
+ if (googleMapsUrl) contact.googleMapsUrl = googleMapsUrl;
1099
+ if (linkedinUrl) contact.linkedinUrl = linkedinUrl;
1100
+ if (instagramUrl) contact.instagramUrl = instagramUrl;
1101
+ if (facebookUrl) contact.facebookUrl = facebookUrl;
1102
+ if (xUrl) contact.xUrl = xUrl;
1103
+ if (youtubeUrl) contact.youtubeUrl = youtubeUrl;
1104
+ if (contactRaw.extras && typeof contactRaw.extras === "object") {
1105
+ const extras = {};
1106
+ for (const [rawKey, rawValue] of Object.entries(contactRaw.extras)) {
1107
+ if (Object.keys(extras).length >= 10) break;
1108
+ const key = normalizeKey(rawKey);
1109
+ const value = readDefaultText(rawValue, 200);
1110
+ if (key && isValidExtraKey(key) && value) extras[key] = value;
1111
+ }
1112
+ if (Object.keys(extras).length > 0) contact.extras = extras;
1113
+ }
1114
+ }
1115
+ const faq = [];
1116
+ if (Array.isArray(defaults.faq)) {
1117
+ for (const raw of defaults.faq) {
1118
+ if (!raw || typeof raw !== "object" || faq.length >= 40) continue;
1119
+ const question = readDefaultText(raw.question, 300);
1120
+ const answer = readDefaultText(raw.answer, 8e3);
1121
+ if (!question || !answer) continue;
1122
+ const category = readDefaultText(raw.category, 80);
1123
+ faq.push({ question, answer, ...category ? { category } : {} });
1124
+ }
1125
+ }
1126
+ const trustRaw = defaults.trust;
1127
+ const trust = {};
1128
+ if (trustRaw && typeof trustRaw === "object") {
1129
+ const assign = (key, max) => {
1130
+ const value = readDefaultText(trustRaw[key], max);
1131
+ if (value) trust[key] = value;
1132
+ };
1133
+ assign("googleReviewsUrl", 2048);
1134
+ assign("googlePlaceId", 128);
1135
+ assign("yelpUrl", 2048);
1136
+ assign("trustpilotUrl", 2048);
1137
+ assign("disclaimer", 1e3);
1138
+ }
1139
+ const hasContact = Object.keys(contact).length > 0;
1140
+ const hasTrust = Object.keys(trust).length > 0;
1141
+ if (!hasContact && faq.length === 0 && !hasTrust) return null;
1142
+ return {
1143
+ ...hasContact ? { contact } : {},
1144
+ ...faq.length > 0 ? { faq } : {},
1145
+ ...hasTrust ? { trust } : {}
1146
+ };
1147
+ }
1067
1148
  function normalizeContact(contact) {
1068
1149
  if (!contact || typeof contact !== "object") return null;
1069
1150
  const extras = normalizeContactExtras(contact.extras);
@@ -1108,6 +1189,7 @@ var WRAPPER_SLOT_ORDER = [
1108
1189
  "blog",
1109
1190
  "faq",
1110
1191
  "contact",
1192
+ "legal",
1111
1193
  "trust",
1112
1194
  "trust.summary",
1113
1195
  "trust.testimonials",
@@ -1123,7 +1205,65 @@ function getDiscoveredContentWrappers() {
1123
1205
  return sortWrapperSlots([...discovered]);
1124
1206
  }
1125
1207
  function resolveContentManifestForReport(config) {
1126
- return normalizeJmpContentManifest(config.contentManifest);
1208
+ const site = getJmpSiteDefinition();
1209
+ const fallback = site?.contactFallback;
1210
+ const existing = config.contentManifest;
1211
+ const fromFallback = fallbackToManifestDefaults(fallback);
1212
+ if (!existing && !fromFallback) {
1213
+ return null;
1214
+ }
1215
+ const merged = {
1216
+ ...existing ?? {},
1217
+ defaults: {
1218
+ ...fromFallback ?? {},
1219
+ ...existing?.defaults ?? {},
1220
+ contact: {
1221
+ ...fromFallback?.contact ?? {},
1222
+ ...existing?.defaults?.contact ?? {},
1223
+ extras: {
1224
+ ...fromFallback?.contact?.extras ?? {},
1225
+ ...existing?.defaults?.contact?.extras ?? {}
1226
+ }
1227
+ },
1228
+ trust: {
1229
+ ...fromFallback?.trust ?? {},
1230
+ ...existing?.defaults?.trust ?? {}
1231
+ },
1232
+ faq: existing?.defaults?.faq?.length ? existing.defaults.faq : fromFallback?.faq
1233
+ }
1234
+ };
1235
+ return normalizeJmpContentManifest(merged);
1236
+ }
1237
+ function fallbackToManifestDefaults(fallback) {
1238
+ if (!fallback) return null;
1239
+ const contact = {};
1240
+ if (fallback.displayName?.trim()) contact.displayName = fallback.displayName.trim();
1241
+ if (fallback.email?.trim()) contact.email = fallback.email.trim();
1242
+ if (typeof fallback.phone === "string" && fallback.phone.trim()) {
1243
+ contact.phone = fallback.phone.trim();
1244
+ }
1245
+ if (fallback.address?.trim()) contact.address = fallback.address.trim();
1246
+ if (fallback.hours?.trim()) contact.hours = fallback.hours.trim();
1247
+ if (fallback.serviceArea?.trim()) contact.serviceArea = fallback.serviceArea.trim();
1248
+ if (fallback.googleMapsUrl?.trim()) {
1249
+ contact.googleMapsUrl = fallback.googleMapsUrl.trim();
1250
+ }
1251
+ if (fallback.linkedin?.trim()) contact.linkedinUrl = fallback.linkedin.trim();
1252
+ if (fallback.instagram?.trim()) contact.instagramUrl = fallback.instagram.trim();
1253
+ if (fallback.facebook?.trim()) contact.facebookUrl = fallback.facebook.trim();
1254
+ if (fallback.x?.trim()) contact.xUrl = fallback.x.trim();
1255
+ if (fallback.youtube?.trim()) contact.youtubeUrl = fallback.youtube.trim();
1256
+ const trust = {};
1257
+ if (fallback.googleMapsUrl?.trim()) {
1258
+ trust.googleReviewsUrl = fallback.googleMapsUrl.trim();
1259
+ }
1260
+ const hasContact = Object.keys(contact).length > 0;
1261
+ const hasTrust = Object.keys(trust).length > 0;
1262
+ if (!hasContact && !hasTrust) return null;
1263
+ return {
1264
+ ...hasContact ? { contact } : {},
1265
+ ...hasTrust ? { trust } : {}
1266
+ };
1127
1267
  }
1128
1268
  function resolveContentWrappersForReport(config) {
1129
1269
  const explicit = config.contentWrappers ?? [];