@active-reach/web-sdk 1.32.0 → 1.33.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"reviews.d.ts","sourceRoot":"","sources":["../../../src/inapp/renderers/reviews.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG7C;iFACiF;AACjF,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAuKD,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,aAAa,EAClB,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,kBAAkB,GACxB,OAAO,CA8QT;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,kBAAkB,GAAG,IAAI,CAgCxF"}
1
+ {"version":3,"file":"reviews.d.ts","sourceRoot":"","sources":["../../../src/inapp/renderers/reviews.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG7C;iFACiF;AACjF,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAuKD,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,aAAa,EAClB,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,kBAAkB,GACxB,OAAO,CAqRT;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,kBAAkB,GAAG,IAAI,CAgCxF"}
package/dist/index.js CHANGED
@@ -5170,7 +5170,9 @@ function renderReviewsInline(ctx, target, creds) {
5170
5170
  if (typeof document === "undefined" || !(creds == null ? void 0 : creds.apiHost) || !(creds == null ? void 0 : creds.writeKey)) return false;
5171
5171
  ensureInAppFont();
5172
5172
  const ic = ctx.campaign.interactive_config || {};
5173
- const accent = ctx.sanitizeColor(ctx.campaign.background_color || "#4169e1");
5173
+ const accent = ctx.sanitizeColor(
5174
+ target.getAttribute("data-accent") || ctx.campaign.background_color || "#4169e1"
5175
+ );
5174
5176
  const rawBrand = (target.getAttribute("data-brand-name") || String(ic.brand_name || "")).trim();
5175
5177
  const brand = (rawBrand.split(/\s[|·–-]\s/)[0] || "").trim() || "The store";
5176
5178
  const productId = target.getAttribute("data-product-id") || ctx.campaign.product_id || null;
@@ -5186,7 +5188,7 @@ function renderReviewsInline(ctx, target, creds) {
5186
5188
  return url.toString();
5187
5189
  }
5188
5190
  function fetchReviews() {
5189
- return fetch(buildUrl(), { method: "GET", headers: { "X-Aegis-Write-Key": creds.writeKey } }).then((r) => r.ok ? r.json() : null).catch(() => null);
5191
+ return fetch(buildUrl(), { method: "GET", cache: "no-store", headers: { "X-Aegis-Write-Key": creds.writeKey } }).then((r) => r.ok ? r.json() : null).catch(() => null);
5190
5192
  }
5191
5193
  let listContainer = null;
5192
5194
  function reviewCard(r) {
@@ -5297,7 +5299,7 @@ function renderReviewsInline(ctx, target, creds) {
5297
5299
  return bar;
5298
5300
  }
5299
5301
  function distributionPanel(dist, total) {
5300
- const box = el("div", "flex:1 1 260px;max-width:340px;display:flex;flex-direction:column;gap:7px;");
5302
+ const box = el("div", "flex:0 1 300px;width:300px;max-width:100%;display:flex;flex-direction:column;gap:7px;");
5301
5303
  for (let r = 5; r >= 1; r--) {
5302
5304
  const n = dist[String(r)] ?? 0;
5303
5305
  const pct = total > 0 ? Math.round(n / total * 100) : 0;