@authid/web-component 1.0.1 → 1.1.0

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
@@ -10,6 +10,7 @@ This integration is the most universal one as it can be used with any frontend t
10
10
  * `authid-component` - a custom HTML component with the following attributes:
11
11
  - `data-url` - required parameter with operation/transaction URL received from authID,
12
12
  - `data-target` - force selection of either `mobile` or `desktop` integration variant, `auto` is the default.
13
+ *NOTE: this parameter is obsolete, and it has no effect at the moment.*
13
14
 
14
15
  ## Example
15
16
 
@@ -31,30 +31,7 @@ class AuthIDComponent extends HTMLElement {
31
31
  iframe.setAttribute('src', dataUrl);
32
32
 
33
33
  const styleNode = document.createElement('style');
34
- styleNode.textContent = ((dataTarget === 'desktop') ? (
35
- 'div, iframe {' +
36
- 'position: fixed;' +
37
- 'top: 50%;' +
38
- 'left: 50%;' +
39
- 'transform: translate(-50%, -50%);' +
40
- 'min-height: 500px;' +
41
- 'min-width: 300px;' +
42
- 'box-sizing: border-box;' +
43
- 'border: 0;' +
44
- 'padding: 0;' +
45
- 'margin: 0;' +
46
- '}' +
47
- 'div {' +
48
- 'height: 94vh;' +
49
- 'width: 94vw;' +
50
- 'border: 2px solid #A6A8AE;' +
51
- '}' +
52
- 'iframe {' +
53
- 'height: 95vh;' +
54
- 'width: 95vw;' +
55
- 'box-shadow: 0px 2px 18px 3px rgba(0, 0, 0, 0.11);' +
56
- '}'
57
- ) : (
34
+ styleNode.textContent = (
58
35
  'div, iframe {' +
59
36
  'position: fixed;' +
60
37
  'top: 0;' +
@@ -64,10 +41,6 @@ class AuthIDComponent extends HTMLElement {
64
41
  'border: 0;' +
65
42
  'padding: 0;' +
66
43
  'margin: 0;' +
67
- '}'
68
- )) + (
69
- 'div {' +
70
- 'background-color: #e5e5e5;' +
71
44
  '}' +
72
45
  'svg {' +
73
46
  'position: fixed;' +
@@ -89,6 +62,10 @@ class AuthIDComponent extends HTMLElement {
89
62
  shadow.appendChild(container);
90
63
  shadow.appendChild(iframe);
91
64
 
65
+ iframe.addEventListener('load', () => {
66
+ shadow.removeChild(container);
67
+ }, { capture: true, once: true });
68
+
92
69
  if (window.getComputedStyle(this)['z-index'] === 'auto') {
93
70
  this.style['z-index'] = 1000;
94
71
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authid/web-component",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "authID integration as a Web Component",
5
5
  "main": "authid-web-component.js",
6
6
  "scripts": {
@@ -15,6 +15,6 @@
15
15
  "author": "authID Team <team@authid.ai>",
16
16
  "license": "Apache-2.0",
17
17
  "devDependencies": {
18
- "eslint": "^8.8.0"
18
+ "eslint": "^8.10.0"
19
19
  }
20
20
  }