@ada-support/embed2 1.1.40 → 1.1.43

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/README.md CHANGED
@@ -3,26 +3,35 @@
3
3
  Embed 2 allows clients to setup Ada Web Chat in their web application. For further information on how to use Embed, check out our [docs repo](https://adasupport.github.io/documentation/#embed2).
4
4
 
5
5
  ## 1. Installation
6
+
6
7
  NPM:
8
+
7
9
  ```
8
10
  npm install @ada-support/embed2
9
11
  ```
12
+
10
13
  Yarn:
14
+
11
15
  ```
12
16
  yarn add @ada-support/embed2
13
17
  ```
14
- This will install the Embed 2 package and it's dependencies.
15
18
 
19
+ This will install the Embed 2 package and it's dependencies.
16
20
 
17
21
  ## 2. Usage
18
- First, import Embed 2 into your App:
22
+
23
+ First, import Embed 2 into your App:
24
+
19
25
  ```
20
26
  import adaEmbed from "@ada-support/embed2";
21
27
  ```
28
+
22
29
  Second, place the code below to start Embed 2 when the DOM is ready:
30
+
23
31
  ```
24
32
  adaEmbed.start({
25
33
  handle: "bot-handle",
26
34
  });
27
35
  ```
36
+
28
37
  In the example above the `handle` key is a part of `AdaSettings`. To learn more about other settings, consult the [API reference](https://adasupport.github.io/documentation/#api-reference).
@@ -57,6 +57,7 @@ export declare class ChatFrame extends Component<ChatFrameProps, ChatFrameState>
57
57
  static get parentElementStyles(): string;
58
58
  get chooseStyles(): string;
59
59
  handleScrollLock(): void;
60
+ collapseIframe(): void;
60
61
  /**
61
62
  * Initial body "overflow" style may be set to something other than "auto"
62
63
  * We should remember it, to put back the initial value when we unlock the scrolling
@@ -13195,7 +13195,7 @@ const client = new error_tracker_BrowserClient({
13195
13195
  },
13196
13196
 
13197
13197
  environment: "production",
13198
- release: "1.1.40-b7e43fc",
13198
+ release: "1.1.43-36cf0b3",
13199
13199
  sampleRate: 0.25,
13200
13200
  autoSessionTracking: false,
13201
13201
  // Integrations don't seem to work with Sentry: https://github.com/getsentry/sentry-javascript/issues/2541
@@ -13793,7 +13793,7 @@ function getEmbedURL(_ref) {
13793
13793
  host = "http://".concat(window.location.hostname, ":9001");
13794
13794
  }
13795
13795
 
13796
- return "".concat(host, "/embed/").concat(frameName, "/").concat("b7e43fc", "/index.html");
13796
+ return "".concat(host, "/embed/").concat(frameName, "/").concat("36cf0b3", "/index.html");
13797
13797
  }
13798
13798
  /**
13799
13799
  * Generate the Chat / API URL
@@ -15318,9 +15318,9 @@ async function log(message, extra, options) {
15318
15318
  service: "embed",
15319
15319
  env: "production",
15320
15320
  embedVersion: 2,
15321
- version: "1.1.40",
15321
+ version: "1.1.43",
15322
15322
  isNpm: true,
15323
- commitHash: "b7e43fc"
15323
+ commitHash: "36cf0b3"
15324
15324
  }))
15325
15325
  });
15326
15326
  }
@@ -15723,7 +15723,7 @@ class ChatFrame extends d {
15723
15723
  cluster,
15724
15724
  domain,
15725
15725
  qp: {
15726
- embedVersion: "b7e43fc".slice(0, 7),
15726
+ embedVersion: "36cf0b3".slice(0, 7),
15727
15727
  greeting,
15728
15728
  language,
15729
15729
  skipGreeting,
@@ -15864,12 +15864,24 @@ class ChatFrame extends d {
15864
15864
  */
15865
15865
 
15866
15866
  setTimeout(() => {
15867
- this.iframeRef.current.style.width = 0;
15868
- this.iframeRef.current.style.height = 0;
15867
+ this.collapseIframe();
15869
15868
  }, closeTransitionTime);
15870
15869
  };
15871
15870
  }
15872
15871
  }
15872
+
15873
+ collapseIframe() {
15874
+ const {
15875
+ isDrawerOpen
15876
+ } = this.props; // Don't try to collapse iFrame if at this point isDrawerOpen is true
15877
+
15878
+ if (isDrawerOpen) {
15879
+ return;
15880
+ }
15881
+
15882
+ this.iframeRef.current.style.width = 0;
15883
+ this.iframeRef.current.style.height = 0;
15884
+ }
15873
15885
  /**
15874
15886
  * Initial body "overflow" style may be set to something other than "auto"
15875
15887
  * We should remember it, to put back the initial value when we unlock the scrolling
@@ -17820,7 +17832,7 @@ class Embed {
17820
17832
 
17821
17833
  }
17822
17834
 
17823
- _defineProperty(Embed, "embed2Version", "b7e43fc");
17835
+ _defineProperty(Embed, "embed2Version", "36cf0b3");
17824
17836
  ;// CONCATENATED MODULE: ./src/common/helpers/startup.ts
17825
17837
 
17826
17838
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ada-support/embed2",
3
- "version": "1.1.40",
3
+ "version": "1.1.43",
4
4
  "description": "",
5
5
  "main": "dist/npm-entry",
6
6
  "typings": "dist/npm-entry/index.d.ts",
@@ -107,8 +107,7 @@
107
107
  "uniqid": "^5.3.0",
108
108
  "webpack": "^5.67.0",
109
109
  "webpack-cli": "^4.9.2",
110
- "webpack-merge": "^5.8.0",
111
- "webpack-subresource-integrity": "^5.1.0"
110
+ "webpack-merge": "^5.8.0"
112
111
  },
113
112
  "resolutions": {
114
113
  "@lambdatest/node-tunnel": ">=3.0.2",