@active-reach/web-sdk 1.33.0 → 1.34.1
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/aegis.min.js +1 -1
- package/dist/aegis.min.js.map +1 -1
- package/dist/inapp/renderers/reviews.d.ts.map +1 -1
- package/dist/index.js +26 -5
- package/dist/index.js.map +1 -1
- package/dist/runtime/AegisMessageRuntime.d.ts +2 -0
- package/dist/runtime/AegisMessageRuntime.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -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,
|
|
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,CA4RT;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,kBAAkB,GAAG,IAAI,CAgCxF"}
|
package/dist/index.js
CHANGED
|
@@ -5170,12 +5170,13 @@ 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 cfg = target.closest("[data-aegis-slot]") ?? target;
|
|
5173
5174
|
const accent = ctx.sanitizeColor(
|
|
5174
|
-
|
|
5175
|
+
cfg.getAttribute("data-accent") || ctx.campaign.background_color || "#4169e1"
|
|
5175
5176
|
);
|
|
5176
|
-
const rawBrand = (
|
|
5177
|
+
const rawBrand = (cfg.getAttribute("data-brand-name") || String(ic.brand_name || "")).trim();
|
|
5177
5178
|
const brand = (rawBrand.split(/\s[|·–-]\s/)[0] || "").trim() || "The store";
|
|
5178
|
-
const productId =
|
|
5179
|
+
const productId = cfg.getAttribute("data-product-id") || ctx.campaign.product_id || null;
|
|
5179
5180
|
const state = { sort: "recent", withPhotos: false };
|
|
5180
5181
|
target.innerHTML = "";
|
|
5181
5182
|
target.appendChild(el("div", `font-family:${IN_APP_FONT_STACK};font-size:13px;color:#9ca3af;padding:10px 0;`, "Loading reviews…"));
|
|
@@ -14228,13 +14229,31 @@ class AegisLoyaltyManager {
|
|
|
14228
14229
|
this.giftCards = new GiftCardsClient(http);
|
|
14229
14230
|
}
|
|
14230
14231
|
}
|
|
14231
|
-
class
|
|
14232
|
+
const _AegisMessageRuntime = class _AegisMessageRuntime {
|
|
14232
14233
|
// Context is held in ONE place — `intentRuleEvaluator.namespaces` (fed via
|
|
14233
14234
|
// updateContext). The renderer cart reader + the cart_value signal are DERIVED
|
|
14234
14235
|
// from it; there is no parallel cart/context store on the runtime.
|
|
14235
14236
|
constructor(config) {
|
|
14236
14237
|
var _a;
|
|
14237
14238
|
this.initialized = false;
|
|
14239
|
+
{
|
|
14240
|
+
const v = "1.34.1";
|
|
14241
|
+
try {
|
|
14242
|
+
globalThis.__AEGIS_SDK_VERSION__ = v;
|
|
14243
|
+
} catch {
|
|
14244
|
+
}
|
|
14245
|
+
if (!_AegisMessageRuntime._bannerPrinted) {
|
|
14246
|
+
_AegisMessageRuntime._bannerPrinted = true;
|
|
14247
|
+
try {
|
|
14248
|
+
console.log(
|
|
14249
|
+
`%c[Aegis SDK]%c v${v} loaded`,
|
|
14250
|
+
"color:#fff;background:#7c3aed;padding:1px 6px;border-radius:4px;font-weight:700",
|
|
14251
|
+
"color:#7c3aed;font-weight:600"
|
|
14252
|
+
);
|
|
14253
|
+
} catch {
|
|
14254
|
+
}
|
|
14255
|
+
}
|
|
14256
|
+
}
|
|
14238
14257
|
const triggerEngine = config.triggerEngine ?? new TriggerEngine();
|
|
14239
14258
|
const ownsTriggerEngine = !config.triggerEngine;
|
|
14240
14259
|
this.contactId = config.contactId;
|
|
@@ -14559,7 +14578,9 @@ class AegisMessageRuntime {
|
|
|
14559
14578
|
getCampaigns() {
|
|
14560
14579
|
return this.inApp.campaigns ?? [];
|
|
14561
14580
|
}
|
|
14562
|
-
}
|
|
14581
|
+
};
|
|
14582
|
+
_AegisMessageRuntime._bannerPrinted = false;
|
|
14583
|
+
let AegisMessageRuntime = _AegisMessageRuntime;
|
|
14563
14584
|
const COOKIE_NAME = "aegis_fpc";
|
|
14564
14585
|
const COOKIE_MAX_AGE_DAYS = 365 * 2;
|
|
14565
14586
|
class BootstrapError extends Error {
|