@ada-support/embed2 1.6.29 → 1.6.30

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 | undefined> | null;
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 notificationPermListener(notificationPermChangeHandler: (notificationStatus: NotificationPermission) => void): void;
11
+ export declare function notificationPermissionsListener(notificationPermissionsChangeHandler: (notificationStatus: NotificationPermission) => void): void;
@@ -13260,7 +13260,7 @@ const client = new error_tracker_BrowserClient({
13260
13260
  return event;
13261
13261
  },
13262
13262
  environment: "production",
13263
- release: "1.6.29-e224a5d",
13263
+ release: "1.6.30-1215812",
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}/${"e224a5d"}/index.html`;
13835
+ return `${host}/embed/${frameName}/${"1215812"}/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 notificationPermListener(notificationPermChangeHandler) {
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
- notificationPermChangeHandler(notificationPermissionGuard(notificationPerm.state));
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
@@ -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.29",
15299
+ version: "1.6.30",
15298
15300
  isNpm: true,
15299
- commitHash: "e224a5d"
15301
+ commitHash: "1215812"
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: "e224a5d".slice(0, 7),
15830
+ embedVersion: "1215812".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
- notificationPermListener(notificationStatus => {
17518
+ notificationPermissionsListener(notificationStatus => {
17517
17519
  setGlobalState({
17518
17520
  notificationsPermission: notificationStatus
17519
17521
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ada-support/embed2",
3
- "version": "1.6.29",
3
+ "version": "1.6.30",
4
4
  "description": "",
5
5
  "main": "dist/npm-entry",
6
6
  "typings": "dist/npm-entry/index-npm.d.ts",