@ada-support/embed2 1.6.29 → 1.6.31
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,6 +1,6 @@
|
|
|
1
1
|
export declare const browserHasNotificationSupport: boolean;
|
|
2
2
|
export declare function checkIfUserHasGivenPermission(): boolean;
|
|
3
|
-
export declare function requestNotificationPermission(): Promise<NotificationPermission
|
|
3
|
+
export declare function requestNotificationPermission(): Promise<NotificationPermission> | null;
|
|
4
4
|
export declare function createNotification(title: string, isChatOpen: boolean, onClickHandler?: (...args: unknown[]) => unknown, options?: {
|
|
5
5
|
body?: string;
|
|
6
6
|
icon?: string;
|
|
@@ -8,4 +8,4 @@ export declare function createNotification(title: string, isChatOpen: boolean, o
|
|
|
8
8
|
/**
|
|
9
9
|
* Used to listen for changes in Notification permission state
|
|
10
10
|
*/
|
|
11
|
-
export declare function
|
|
11
|
+
export declare function notificationPermissionsListener(notificationPermissionsChangeHandler: (notificationStatus: NotificationPermission) => void): void;
|
package/dist/npm-entry/index.js
CHANGED
|
@@ -13260,7 +13260,7 @@ const client = new error_tracker_BrowserClient({
|
|
|
13260
13260
|
return event;
|
|
13261
13261
|
},
|
|
13262
13262
|
environment: "production",
|
|
13263
|
-
release: "1.6.
|
|
13263
|
+
release: "1.6.31-2bf6fdf",
|
|
13264
13264
|
sampleRate: 0.25,
|
|
13265
13265
|
autoSessionTracking: false,
|
|
13266
13266
|
// Integrations don't seem to work with Sentry: https://github.com/getsentry/sentry-javascript/issues/2541
|
|
@@ -13832,7 +13832,7 @@ function getEmbedURL(_ref) {
|
|
|
13832
13832
|
} else {
|
|
13833
13833
|
host = `http://${window.location.hostname}:9001`;
|
|
13834
13834
|
}
|
|
13835
|
-
return `${host}/embed/${frameName}/${"
|
|
13835
|
+
return `${host}/embed/${frameName}/${"2bf6fdf"}/index.html`;
|
|
13836
13836
|
}
|
|
13837
13837
|
function constructQueryString(query) {
|
|
13838
13838
|
return Object.keys(query).map(key => {
|
|
@@ -14252,7 +14252,7 @@ function notificationPermissionGuard(state) {
|
|
|
14252
14252
|
/**
|
|
14253
14253
|
* Used to listen for changes in Notification permission state
|
|
14254
14254
|
*/
|
|
14255
|
-
function
|
|
14255
|
+
function notificationPermissionsListener(notificationPermissionsChangeHandler) {
|
|
14256
14256
|
if (!("permissions" in navigator)) {
|
|
14257
14257
|
return;
|
|
14258
14258
|
}
|
|
@@ -14261,8 +14261,10 @@ function notificationPermListener(notificationPermChangeHandler) {
|
|
|
14261
14261
|
}).then(notificationPerm => {
|
|
14262
14262
|
// eslint-disable-next-line no-param-reassign
|
|
14263
14263
|
notificationPerm.onchange = () => {
|
|
14264
|
-
|
|
14264
|
+
notificationPermissionsChangeHandler(notificationPermissionGuard(notificationPerm.state));
|
|
14265
14265
|
};
|
|
14266
|
+
}).catch(() => {
|
|
14267
|
+
// We have to catch an exception to avoid errors being thrown in console
|
|
14266
14268
|
});
|
|
14267
14269
|
}
|
|
14268
14270
|
;// CONCATENATED MODULE: ./src/common/constants/storage-keys.ts
|
|
@@ -14670,7 +14672,7 @@ function recordCampaignTrigger(campaignKey, frequency, handle) {
|
|
|
14670
14672
|
}
|
|
14671
14673
|
case "once-per-user":
|
|
14672
14674
|
{
|
|
14673
|
-
const currentStorageValue = dist/*
|
|
14675
|
+
const currentStorageValue = dist/* adaLocalStorage.getFnItem */.wG.getFnItem("marketing_campaigns_shown");
|
|
14674
14676
|
const newStorageValue = addCampaignToStorageString(currentStorageValue ? currentStorageValue[handle] || "" : "", campaignKey);
|
|
14675
14677
|
dist/* adaLocalStorage.setFnItem */.wG.setFnItem("marketing_campaigns_shown", campaign_objectSpread(campaign_objectSpread({}, currentStorageValue), {}, {
|
|
14676
14678
|
[handle]: newStorageValue
|
|
@@ -15294,9 +15296,9 @@ async function log(message, extra, options) {
|
|
|
15294
15296
|
service: "embed",
|
|
15295
15297
|
env: "production",
|
|
15296
15298
|
embedVersion: 2,
|
|
15297
|
-
version: "1.6.
|
|
15299
|
+
version: "1.6.31",
|
|
15298
15300
|
isNpm: true,
|
|
15299
|
-
commitHash: "
|
|
15301
|
+
commitHash: "2bf6fdf"
|
|
15300
15302
|
}))
|
|
15301
15303
|
});
|
|
15302
15304
|
}
|
|
@@ -15825,7 +15827,7 @@ class ChatFrame extends d {
|
|
|
15825
15827
|
const hostPageUrlParams = new URL(window.location.href).searchParams;
|
|
15826
15828
|
const smsToken = hostPageUrlParams.get("adaSMSToken");
|
|
15827
15829
|
const queryParams = {
|
|
15828
|
-
embedVersion: "
|
|
15830
|
+
embedVersion: "2bf6fdf".slice(0, 7),
|
|
15829
15831
|
greeting,
|
|
15830
15832
|
language,
|
|
15831
15833
|
skipGreeting,
|
|
@@ -17513,7 +17515,7 @@ class Container extends d {
|
|
|
17513
17515
|
const {
|
|
17514
17516
|
setGlobalState
|
|
17515
17517
|
} = this.props;
|
|
17516
|
-
|
|
17518
|
+
notificationPermissionsListener(notificationStatus => {
|
|
17517
17519
|
setGlobalState({
|
|
17518
17520
|
notificationsPermission: notificationStatus
|
|
17519
17521
|
});
|