@ada-support/embed2 1.14.12 → 1.14.13
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/npm-entry/index.js
CHANGED
|
@@ -16125,7 +16125,7 @@ const client = new BrowserClient({
|
|
|
16125
16125
|
return event;
|
|
16126
16126
|
},
|
|
16127
16127
|
environment: "production",
|
|
16128
|
-
release: "1.14.
|
|
16128
|
+
release: "1.14.13-26c9c4d",
|
|
16129
16129
|
sampleRate: 0.25,
|
|
16130
16130
|
autoSessionTracking: false,
|
|
16131
16131
|
// Integrations don't seem to work with Sentry: https://github.com/getsentry/sentry-javascript/issues/2541
|
|
@@ -16751,7 +16751,7 @@ function getEmbedURL(_ref) {
|
|
|
16751
16751
|
} else {
|
|
16752
16752
|
host = `http://${handle}.localhost:${ports.localhost.default}`;
|
|
16753
16753
|
}
|
|
16754
|
-
return `${host}/embed/${frameName}/${"
|
|
16754
|
+
return `${host}/embed/${frameName}/${"26c9c4d"}/index.html`;
|
|
16755
16755
|
}
|
|
16756
16756
|
function constructQueryString(query) {
|
|
16757
16757
|
return Object.keys(query).map(key => {
|
|
@@ -17538,9 +17538,9 @@ async function log(message, extra, options) {
|
|
|
17538
17538
|
service: "embed",
|
|
17539
17539
|
env: "production",
|
|
17540
17540
|
embedVersion: 2,
|
|
17541
|
-
version: "1.14.
|
|
17541
|
+
version: "1.14.13",
|
|
17542
17542
|
isNpm: true,
|
|
17543
|
-
commitHash: "
|
|
17543
|
+
commitHash: "26c9c4d"
|
|
17544
17544
|
}))
|
|
17545
17545
|
});
|
|
17546
17546
|
}
|
|
@@ -18671,6 +18671,11 @@ function proactiveConversation_objectSpread(e) { for (var r = 1; r < arguments.l
|
|
|
18671
18671
|
|
|
18672
18672
|
|
|
18673
18673
|
|
|
18674
|
+
// Once-per-user suppression persists in localStorage across sessions. It uses a
|
|
18675
|
+
// key distinct from `proactive_conversations_shown` because that key is owned by
|
|
18676
|
+
// the ranking "shown" set (see getRankedShownKeys); sharing it would conflate
|
|
18677
|
+
// user-frequency suppression with ranking's advance-across-visits state.
|
|
18678
|
+
const USER_FREQUENCY_STORAGE_KEY = "proactive_conversations_shown_user";
|
|
18674
18679
|
function proactiveShownWithinFrequency(proactiveConversationKey, frequency, handle) {
|
|
18675
18680
|
switch (frequency) {
|
|
18676
18681
|
case "always":
|
|
@@ -18681,6 +18686,12 @@ function proactiveShownWithinFrequency(proactiveConversationKey, frequency, hand
|
|
|
18681
18686
|
const perSessionProactives = storageValue ? (storageValue[handle] || "").split(",") : [];
|
|
18682
18687
|
return perSessionProactives.includes(proactiveConversationKey);
|
|
18683
18688
|
}
|
|
18689
|
+
case "user":
|
|
18690
|
+
{
|
|
18691
|
+
const storageValue = dist/* adaLocalStorage */.BB.getFnItem(USER_FREQUENCY_STORAGE_KEY);
|
|
18692
|
+
const perUserProactives = storageValue ? (storageValue[handle] || "").split(",") : [];
|
|
18693
|
+
return perUserProactives.includes(proactiveConversationKey);
|
|
18694
|
+
}
|
|
18684
18695
|
default:
|
|
18685
18696
|
return false;
|
|
18686
18697
|
}
|
|
@@ -18762,6 +18773,15 @@ function recordProactiveTrigger(proactiveConversationKey, frequency, handle) {
|
|
|
18762
18773
|
}));
|
|
18763
18774
|
break;
|
|
18764
18775
|
}
|
|
18776
|
+
case "user":
|
|
18777
|
+
{
|
|
18778
|
+
const currentStorageValue = dist/* adaLocalStorage */.BB.getFnItem(USER_FREQUENCY_STORAGE_KEY);
|
|
18779
|
+
const newStorageValue = addProactiveToStorageString(currentStorageValue ? currentStorageValue[handle] || "" : "", proactiveConversationKey);
|
|
18780
|
+
dist/* adaLocalStorage */.BB.setFnItem(USER_FREQUENCY_STORAGE_KEY, proactiveConversation_objectSpread(proactiveConversation_objectSpread({}, currentStorageValue), {}, {
|
|
18781
|
+
[handle]: newStorageValue
|
|
18782
|
+
}));
|
|
18783
|
+
break;
|
|
18784
|
+
}
|
|
18765
18785
|
default:
|
|
18766
18786
|
break;
|
|
18767
18787
|
}
|
|
@@ -20330,7 +20350,7 @@ class ChatFrame extends d {
|
|
|
20330
20350
|
log("Chat frame mount", {
|
|
20331
20351
|
handle,
|
|
20332
20352
|
chatUrl: this.url,
|
|
20333
|
-
embedVersion: "
|
|
20353
|
+
embedVersion: "26c9c4d".slice(0, 7),
|
|
20334
20354
|
embedSettings: adaSettings
|
|
20335
20355
|
});
|
|
20336
20356
|
|
|
@@ -20418,7 +20438,7 @@ class ChatFrame extends d {
|
|
|
20418
20438
|
const hostPageUrlParams = new URL(window.location.href).searchParams;
|
|
20419
20439
|
const smsToken = hostPageUrlParams.get("adaSMSToken");
|
|
20420
20440
|
const queryParams = {
|
|
20421
|
-
embedVersion: "
|
|
20441
|
+
embedVersion: "26c9c4d".slice(0, 7),
|
|
20422
20442
|
greeting,
|
|
20423
20443
|
language,
|
|
20424
20444
|
skipGreeting,
|
|
@@ -39,7 +39,7 @@ export interface RecentProactiveConversationConfig {
|
|
|
39
39
|
key: string;
|
|
40
40
|
params: Record<string, string>;
|
|
41
41
|
}
|
|
42
|
-
export type ProactiveConversationFrequency = "always" | "session";
|
|
42
|
+
export type ProactiveConversationFrequency = "always" | "session" | "user";
|
|
43
43
|
export type ProactiveConversationUrlTriggerConditionType = "equals" | "ends-with" | "regex" | "contains";
|
|
44
44
|
export interface UrlTriggerCondition {
|
|
45
45
|
type: ProactiveConversationUrlTriggerConditionType;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ada-support/embed2",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.13",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/npm-entry",
|
|
6
6
|
"typings": "dist/npm-entry/index-npm.d.ts",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
},
|
|
92
92
|
"dependencies": {
|
|
93
93
|
"@ada-support/embed-types": "^1.9.2",
|
|
94
|
-
"@ada-support/web-storage": "^1.
|
|
94
|
+
"@ada-support/web-storage": "^1.4.1",
|
|
95
95
|
"@babel/runtime-corejs3": "^7.26.10",
|
|
96
96
|
"@sentry/browser": "^8.33.0",
|
|
97
97
|
"@sentry/types": "^8.33.1",
|