@active-reach/web-sdk 1.11.0 → 1.11.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/index.js +12 -8
- package/dist/index.js.map +1 -1
- package/dist/runtime/AegisMessageRuntime.d.ts +0 -1
- package/dist/runtime/AegisMessageRuntime.d.ts.map +1 -1
- package/dist/triggers/IntentRuleEvaluator.d.ts.map +1 -1
- package/dist/widgets/AegisWidgetManager.d.ts +6 -0
- package/dist/widgets/AegisWidgetManager.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1024,10 +1024,10 @@ const _AegisInAppManager = class _AegisInAppManager {
|
|
|
1024
1024
|
this.log(`Error parsing SSE event: ${error}`, "error");
|
|
1025
1025
|
}
|
|
1026
1026
|
});
|
|
1027
|
-
this.eventSource.addEventListener("heartbeat", (
|
|
1027
|
+
this.eventSource.addEventListener("heartbeat", () => {
|
|
1028
1028
|
this.log("SSE heartbeat received");
|
|
1029
1029
|
});
|
|
1030
|
-
this.eventSource.addEventListener("error", (
|
|
1030
|
+
this.eventSource.addEventListener("error", () => {
|
|
1031
1031
|
var _a;
|
|
1032
1032
|
this.log("SSE connection error", "error");
|
|
1033
1033
|
if (((_a = this.eventSource) == null ? void 0 : _a.readyState) === EventSource.CLOSED) {
|
|
@@ -3216,7 +3216,7 @@ class AegisPlacementManager {
|
|
|
3216
3216
|
wrapper.innerHTML = this.sanitizeHTML(html);
|
|
3217
3217
|
const links = wrapper.querySelectorAll("a");
|
|
3218
3218
|
links.forEach((link) => {
|
|
3219
|
-
link.addEventListener("click", (
|
|
3219
|
+
link.addEventListener("click", () => {
|
|
3220
3220
|
this.trackEvent(content.placement_id, content.variant_id, "click");
|
|
3221
3221
|
});
|
|
3222
3222
|
});
|
|
@@ -3349,10 +3349,10 @@ class AegisPlacementManager {
|
|
|
3349
3349
|
this.log(`Error parsing SSE event: ${error}`, true);
|
|
3350
3350
|
}
|
|
3351
3351
|
});
|
|
3352
|
-
this.eventSource.addEventListener("heartbeat", (
|
|
3352
|
+
this.eventSource.addEventListener("heartbeat", () => {
|
|
3353
3353
|
this.log("SSE heartbeat received");
|
|
3354
3354
|
});
|
|
3355
|
-
this.eventSource.addEventListener("error", (
|
|
3355
|
+
this.eventSource.addEventListener("error", () => {
|
|
3356
3356
|
var _a;
|
|
3357
3357
|
this.log("SSE connection error", true);
|
|
3358
3358
|
if (((_a = this.eventSource) == null ? void 0 : _a.readyState) === EventSource.CLOSED) {
|
|
@@ -4763,7 +4763,14 @@ class AegisWidgetManager {
|
|
|
4763
4763
|
this.widgets = [];
|
|
4764
4764
|
this.isInitialized = false;
|
|
4765
4765
|
this.log("AegisWidgets destroyed");
|
|
4766
|
+
this.emitEvent("destroyed", {});
|
|
4766
4767
|
}
|
|
4768
|
+
/**
|
|
4769
|
+
* Fire a lifecycle event to the consumer-supplied callback. Public-API
|
|
4770
|
+
* hook configured via `AegisWidgetConfig.onEvent`. Currently only used
|
|
4771
|
+
* by external callers passing their own logger; internal widget lifecycle
|
|
4772
|
+
* events get wired through here as they're added.
|
|
4773
|
+
*/
|
|
4767
4774
|
emitEvent(eventType, data) {
|
|
4768
4775
|
if (this.onEvent) {
|
|
4769
4776
|
try {
|
|
@@ -6615,10 +6622,8 @@ class AegisWidgetManager {
|
|
|
6615
6622
|
class AegisMessageRuntime {
|
|
6616
6623
|
constructor(config) {
|
|
6617
6624
|
this.initialized = false;
|
|
6618
|
-
this.ownedTriggerEngine = null;
|
|
6619
6625
|
const triggerEngine = config.triggerEngine ?? new TriggerEngine();
|
|
6620
6626
|
const ownsTriggerEngine = !config.triggerEngine;
|
|
6621
|
-
if (ownsTriggerEngine) this.ownedTriggerEngine = triggerEngine;
|
|
6622
6627
|
this.widgets = new AegisWidgetManager({
|
|
6623
6628
|
writeKey: config.writeKey,
|
|
6624
6629
|
apiHost: config.apiHost,
|
|
@@ -6715,7 +6720,6 @@ class AegisMessageRuntime {
|
|
|
6715
6720
|
var _a, _b;
|
|
6716
6721
|
(_b = (_a = this.inApp).destroy) == null ? void 0 : _b.call(_a);
|
|
6717
6722
|
this.widgets.destroy();
|
|
6718
|
-
this.ownedTriggerEngine = null;
|
|
6719
6723
|
this.initialized = false;
|
|
6720
6724
|
}
|
|
6721
6725
|
/**
|