@authid/web-component 1.3.0 → 1.3.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/README.md CHANGED
@@ -20,5 +20,5 @@ Please see `example.html` for full details.
20
20
 
21
21
  ```html
22
22
  <script src="path-to/authid-web-component.js"></script>
23
- <authid-component data-url="https://id.ipsidy.net/?...."></authid-component>
23
+ <authid-component data-url="https://id.authid.ai/?...."></authid-component>
24
24
  ```
@@ -60,7 +60,6 @@ class AuthIDComponent extends HTMLElement {
60
60
  const container = document.createElement('div');
61
61
  container.appendChild(container.ownerDocument.importNode(loader.documentElement, true));
62
62
  shadow.appendChild(container);
63
- shadow.appendChild(iframe);
64
63
 
65
64
  const dataWebauth = this.getAttribute('data-webauth');
66
65
 
@@ -78,8 +77,15 @@ class AuthIDComponent extends HTMLElement {
78
77
  shadow.appendChild(controlHandler);
79
78
  }
80
79
 
80
+ shadow.appendChild(iframe);
81
+
81
82
  iframe.addEventListener('load', () => {
82
- shadow.removeChild(container);
83
+ shadow.removeChild(container);
84
+
85
+ shadow.dispatchEvent(new CustomEvent('load', {
86
+ composed: true,
87
+ bubbles: true,
88
+ }));
83
89
  }, { capture: true, once: true });
84
90
 
85
91
  if (window.getComputedStyle(this)['z-index'] === 'auto') {
package/example.html CHANGED
@@ -11,5 +11,10 @@
11
11
  </head>
12
12
  <body>
13
13
  <authid-component data-url="https://id.authid.ai/?demo" data-webauth="true"></authid-component>
14
+ <script>
15
+ document.getElementsByTagName('authid-component')[0].addEventListener('load', function(){
16
+ console.log('Iframe has just loaded, the component is ready');
17
+ });
18
+ </script>
14
19
  </body>
15
20
  </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authid/web-component",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "authID integration as a Web Component",
5
5
  "main": "authid-web-component.js",
6
6
  "scripts": {