@gataca/qr 3.0.10 → 3.0.11
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/dist/cjs/gataca-autoqr.cjs.entry.js +9 -9
- package/dist/cjs/gataca-qr_2.cjs.entry.js +36 -46
- package/dist/cjs/gataca-qrws.cjs.entry.js +35 -42
- package/dist/cjs/gataca-ssibutton_2.cjs.entry.js +34 -38
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/{utils-ef28b844.js → utils-b4e62bc0.js} +1 -1
- package/dist/collection/components/gataca-autoqr/gataca-autoqr.js +13 -13
- package/dist/collection/components/gataca-qr/components/qr/QR.js +2 -2
- package/dist/collection/components/gataca-qr/components/readQR/ReadQR.js +4 -4
- package/dist/collection/components/gataca-qr/components/readQR/components/AnimatedLoader.js +1 -1
- package/dist/collection/components/gataca-qr/components/retryButton/RetryButton.js +8 -8
- package/dist/collection/components/gataca-qr/components/success/Success.js +4 -4
- package/dist/collection/components/gataca-qr/gataca-qr.js +45 -55
- package/dist/collection/components/gataca-qrdisplay/gataca-qrdisplay.js +12 -12
- package/dist/collection/components/gataca-qrws/components/qr/QR.js +2 -2
- package/dist/collection/components/gataca-qrws/components/readQR/ReadQR.js +4 -4
- package/dist/collection/components/gataca-qrws/components/readQR/components/AnimatedLoader.js +1 -1
- package/dist/collection/components/gataca-qrws/components/retryButton/RetryButton.js +8 -8
- package/dist/collection/components/gataca-qrws/components/success/Success.js +4 -4
- package/dist/collection/components/gataca-qrws/gataca-qrws.js +49 -56
- package/dist/collection/components/gataca-ssibutton/gataca-ssibutton.js +62 -52
- package/dist/collection/components/gataca-ssibuttonws/gataca-ssibuttonws.js +12 -12
- package/dist/collection/index.js +2 -2
- package/dist/collection/utils/index.js +1 -1
- package/dist/collection/utils/utils.js +1 -1
- package/dist/components/gat-icon-alert.js +1 -1
- package/dist/components/gataca-autoqr.js +9 -9
- package/dist/components/gataca-qr2.js +28 -38
- package/dist/components/gataca-qrdisplay2.js +7 -7
- package/dist/components/gataca-qrws2.js +34 -41
- package/dist/components/gataca-ssibutton2.js +27 -31
- package/dist/components/gataca-ssibuttonws2.js +6 -6
- package/dist/esm/gataca-autoqr.entry.js +9 -9
- package/dist/esm/gataca-qr_2.entry.js +36 -46
- package/dist/esm/gataca-qrws.entry.js +35 -42
- package/dist/esm/gataca-ssibutton_2.entry.js +34 -38
- package/dist/esm/index.js +1 -1
- package/dist/esm/{utils-63e7a33b.js → utils-21ffcc1e.js} +1 -1
- package/dist/gatacaqr/gatacaqr.esm.js +1 -1
- package/dist/gatacaqr/index.esm.js +1 -1
- package/dist/gatacaqr/{p-3500ae66.entry.js → p-2adc0bcc.entry.js} +1 -1
- package/dist/gatacaqr/p-2ddbc2fc.entry.js +1 -0
- package/dist/gatacaqr/{p-68272823.entry.js → p-d2dd7c85.entry.js} +1 -1
- package/dist/types/components/gataca-autoqr/gataca-autoqr.d.ts +7 -7
- package/dist/types/components/gataca-qr/components/qr/QR.d.ts +2 -2
- package/dist/types/components/gataca-qr/components/readQR/ReadQR.d.ts +1 -1
- package/dist/types/components/gataca-qr/components/readQR/components/AnimatedLoader.d.ts +1 -1
- package/dist/types/components/gataca-qr/components/retryButton/RetryButton.d.ts +1 -1
- package/dist/types/components/gataca-qr/components/success/Success.d.ts +1 -1
- package/dist/types/components/gataca-qr/gataca-qr.d.ts +4 -4
- package/dist/types/components/gataca-qrdisplay/gataca-qrdisplay.d.ts +1 -1
- package/dist/types/components/gataca-qrws/components/qr/QR.d.ts +2 -2
- package/dist/types/components/gataca-qrws/components/readQR/ReadQR.d.ts +1 -1
- package/dist/types/components/gataca-qrws/components/readQR/components/AnimatedLoader.d.ts +1 -1
- package/dist/types/components/gataca-qrws/components/retryButton/RetryButton.d.ts +1 -1
- package/dist/types/components/gataca-qrws/components/success/Success.d.ts +1 -1
- package/dist/types/components/gataca-qrws/gataca-qrws.d.ts +4 -4
- package/dist/types/components/gataca-ssibutton/gataca-ssibutton.d.ts +9 -5
- package/dist/types/components/gataca-ssibuttonws/gataca-ssibuttonws.d.ts +3 -3
- package/dist/types/components.d.ts +28 -36
- package/dist/types/index.d.ts +2 -2
- package/dist/types/utils/index.d.ts +1 -1
- package/package.json +30 -7
- package/dist/gatacaqr/p-92a2e6f0.entry.js +0 -1
- /package/dist/gatacaqr/{p-2cd7b062.js → p-bce7e590.js} +0 -0
|
@@ -4,11 +4,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-93d47a75.js');
|
|
6
6
|
require('./qr-code-styling-412bbc7a.js');
|
|
7
|
-
const utils = require('./utils-
|
|
7
|
+
const utils = require('./utils-b4e62bc0.js');
|
|
8
8
|
|
|
9
9
|
const gatacaSsibuttonCss = "@import url(\"https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400&display=swap\"); html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:\"\";content:none}table{border-collapse:collapse;border-spacing:0}.img-fluid{height:auto;max-width:50%}img{margin-left:auto;margin-right:auto}.buttonContainer{display:inline-block;text-align:right;padding:10px;position:relative}.gatacaButtonWrapper{margin:8px}.gatacaButtonWrapper .gatacaButton{display:flex;min-width:100px;padding:8px 8px;background-color:white;font-size:12px;font-family:\"Work Sans\", sans-serif;letter-spacing:1px;font-weight:2;justify-content:space-between;align-items:center;border-radius:6px;border:1px solid rgba(24, 27, 94, 0.5);color:rgba(24, 27, 94, 0.8);box-shadow:0px 1px 3px rgba(48, 48, 48, 0.15);cursor:pointer}.gatacaButtonWrapper .gatacaButton>span{margin-right:10px}.gatacaButtonWrapper .gatacaButton:hover{box-shadow:0px 2px 8px rgba(48, 48, 48, 0.1)}.gatacaButtonWrapper .buttonText{text-align:right;font-size:8px;color:rgba(24, 27, 94, 0.5);font-family:\"Helvetica Neue\", sans-serif;letter-spacing:1px;padding-right:8px;font-weight:1}.gatacaButtonWrapper .buttonImg{height:25px;width:25px;margin:0;margin-right:20px}";
|
|
10
10
|
|
|
11
|
-
const PHONE_ICON$1 =
|
|
11
|
+
const PHONE_ICON$1 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAYAAACN1PRVAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAHvSURBVHgB3ZZPTttAFMbfe3YjL7qYLopcpZXSG7Q3CDfIsqrSJpyg5QQtJ2h7glgUdVs4AeEE5AYEQSDAgtnw357Hm0hAQDaeIRFCfFKyeKPxzzPzvc+DUKCZN80GEv1ABgWOQgSdGbOwv7u0nDueV4zjTzUIKhuAZna4vdQFR828azbI0K/TI/qodaLvjlP+tLDGDCs+IKv9Lbsi7kcv0w9541Q0EREPYcoieEQ9KiyECRXHzbpBUOcnYTfPFOOaaGVx9WsLiDrSIp0iU0wFNgIx/AQyc9I/OmOjy+Y8aBvHQcDUYebewc6/Xtk8J5htcg5efEPGhk0JtqkyBjo7DuZcnuO2sqCyKv8rUDmfTS9IBURqBAL+I6CkzBjOMOs22TLY21n8fl17KzXR3uDvb/CQk0GEdfvN07QvpnAOaGfYaRT25JzU6+rnG2tTpcWAy+Cp0m3U/URLms8HWfg/rn6RFaGSs9KQkZMpvGBWNs2Vandt46ac6YNBuc0fDLMaOU5DFybQ8039p/KJ4bq4rwPewtqoM/1gsCm/NfBXvWjgHhhuDAeLyd3qVSifHQULeZkou9EqemLhmUmav8qrZ4GEMGA7ivzjKvfeqGptFV2YdWPMPHHq0cCh3DdpVdLl/XCY9J1gVvbCiWa6N+JLocPFjCsx9cAAAAAASUVORK5CYII=';
|
|
12
12
|
//Default values
|
|
13
13
|
const DEFAULT_SESSION_TIMEOUT = 300; //5mins as in connect
|
|
14
14
|
const DEFAULT_POLLING_FREQ = 3;
|
|
@@ -17,8 +17,9 @@ const GatacaSSIButton = class {
|
|
|
17
17
|
index.registerInstance(this, hostRef);
|
|
18
18
|
this.gatacaLoginCompleted = index.createEvent(this, "gatacaLoginCompleted", 7);
|
|
19
19
|
this.gatacaLoginFailed = index.createEvent(this, "gatacaLoginFailed", 7);
|
|
20
|
-
this.
|
|
21
|
-
this.
|
|
20
|
+
this.gatacaButtonPushed = index.createEvent(this, "gatacaButtonPushed", 7);
|
|
21
|
+
this.buttonText = 'Easy login';
|
|
22
|
+
this.qrType = 'svg';
|
|
22
23
|
this.autostart = true;
|
|
23
24
|
this.checkStatus = undefined;
|
|
24
25
|
this.createSession = undefined;
|
|
@@ -31,25 +32,25 @@ const GatacaSSIButton = class {
|
|
|
31
32
|
this.sessionTimeout = undefined;
|
|
32
33
|
this.pollingFrequency = undefined;
|
|
33
34
|
this.autorefresh = false;
|
|
34
|
-
this.v =
|
|
35
|
-
this.qrModalTitle =
|
|
36
|
-
this.modalTitleColor =
|
|
37
|
-
this.qrModalDescription =
|
|
35
|
+
this.v = '3';
|
|
36
|
+
this.qrModalTitle = 'Quick Access';
|
|
37
|
+
this.modalTitleColor = '#4745B7';
|
|
38
|
+
this.qrModalDescription = 'Sign up or sign in by scanning the QR Code with the Gataca Wallet';
|
|
38
39
|
this.hideBrandTitle = false;
|
|
39
40
|
this.dynamicLink = true;
|
|
40
41
|
this.logoSize = 0;
|
|
41
42
|
this.logoSrc = undefined;
|
|
42
|
-
this.qrCodeExpiredLabel =
|
|
43
|
-
this.credentialsNotValidatedLabel =
|
|
44
|
-
this.clickInsideBoxLabel =
|
|
45
|
-
this.refreshQrLabel =
|
|
46
|
-
this.scanQrLabel =
|
|
47
|
-
this.userNotScanInTimeErrorLabel =
|
|
43
|
+
this.qrCodeExpiredLabel = 'QR Code expired';
|
|
44
|
+
this.credentialsNotValidatedLabel = 'User credentials not validated';
|
|
45
|
+
this.clickInsideBoxLabel = 'Click inside the box to';
|
|
46
|
+
this.refreshQrLabel = 'Refresh QR Code';
|
|
47
|
+
this.scanQrLabel = 'Scan QR Code';
|
|
48
|
+
this.userNotScanInTimeErrorLabel = 'User did not scan the QR in the allowed time';
|
|
48
49
|
this.credsNotValidatedErrorLabel = "Provided user credentials couldn't be validated";
|
|
49
|
-
this.failedLoginErrorLabel =
|
|
50
|
-
this.successLoginLabel =
|
|
51
|
-
this.byBrandLabel =
|
|
52
|
-
this.waitingStartSessionLabel =
|
|
50
|
+
this.failedLoginErrorLabel = 'No successful login';
|
|
51
|
+
this.successLoginLabel = 'Successful Connection!';
|
|
52
|
+
this.byBrandLabel = 'by Gataca';
|
|
53
|
+
this.waitingStartSessionLabel = 'waiting to start a session';
|
|
53
54
|
this.hideQrModalDescription = false;
|
|
54
55
|
this.open = false;
|
|
55
56
|
this.sessionId = undefined;
|
|
@@ -94,9 +95,7 @@ const GatacaSSIButton = class {
|
|
|
94
95
|
}
|
|
95
96
|
else {
|
|
96
97
|
if (err !== utils.RESULT_STATUS.NOT_STARTED) {
|
|
97
|
-
let error = expired
|
|
98
|
-
? new Error(this.userNotScanInTimeErrorLabel)
|
|
99
|
-
: new Error(this.credsNotValidatedErrorLabel);
|
|
98
|
+
let error = expired ? new Error(this.userNotScanInTimeErrorLabel) : new Error(this.credsNotValidatedErrorLabel);
|
|
100
99
|
this.result = err;
|
|
101
100
|
this.gatacaLoginFailed.emit(error);
|
|
102
101
|
this.errorCallback(error);
|
|
@@ -121,8 +120,7 @@ const GatacaSSIButton = class {
|
|
|
121
120
|
return this.qr;
|
|
122
121
|
}
|
|
123
122
|
async poll() {
|
|
124
|
-
let endTime = new Date().getTime() +
|
|
125
|
-
(this.sessionTimeout || DEFAULT_SESSION_TIMEOUT) * 1000;
|
|
123
|
+
let endTime = new Date().getTime() + (this.sessionTimeout || DEFAULT_SESSION_TIMEOUT) * 1000;
|
|
126
124
|
let interval = (this.pollingFrequency || DEFAULT_POLLING_FREQ) * 1000;
|
|
127
125
|
let checkFunc = async (component) => {
|
|
128
126
|
if (component.result === utils.RESULT_STATUS.NOT_STARTED) {
|
|
@@ -179,10 +177,10 @@ const GatacaSSIButton = class {
|
|
|
179
177
|
cleanup();
|
|
180
178
|
}
|
|
181
179
|
};
|
|
182
|
-
document.addEventListener(
|
|
180
|
+
document.addEventListener('visibilitychange', handleVisibilityChange);
|
|
183
181
|
function cleanup() {
|
|
184
182
|
clearTimeout(timeout);
|
|
185
|
-
document.removeEventListener(
|
|
183
|
+
document.removeEventListener('visibilitychange', handleVisibilityChange);
|
|
186
184
|
}
|
|
187
185
|
}
|
|
188
186
|
renderDesktopButton() {
|
|
@@ -216,8 +214,8 @@ const GatacaSSIButton = class {
|
|
|
216
214
|
};
|
|
217
215
|
const executeRedirection = async () => {
|
|
218
216
|
handleLoading(true);
|
|
219
|
-
const androidStoreLink =
|
|
220
|
-
const iosStoreLink =
|
|
217
|
+
const androidStoreLink = 'https://play.google.com/store/apps/details?id=com.gataca.identity';
|
|
218
|
+
const iosStoreLink = 'https://apps.apple.com/us/app/gataca/id1498607616';
|
|
221
219
|
try {
|
|
222
220
|
const appScheme = await this.getAuthRequest();
|
|
223
221
|
this.isAppInstalled(appScheme, (installed) => {
|
|
@@ -239,6 +237,7 @@ const GatacaSSIButton = class {
|
|
|
239
237
|
}
|
|
240
238
|
};
|
|
241
239
|
return (index.h("div", { class: "gatacaButtonWrapper" }, index.h("button", { class: "gatacaButton", onClick: () => {
|
|
240
|
+
this.gatacaButtonPushed.emit();
|
|
242
241
|
executeRedirection();
|
|
243
242
|
}, disabled: loading }, index.h("img", { src: PHONE_ICON$1, class: "buttonImg", alt: this.buttonText }), index.h("span", null, this.buttonText))));
|
|
244
243
|
}
|
|
@@ -249,28 +248,25 @@ const GatacaSSIButton = class {
|
|
|
249
248
|
const isAndroid = /android/i.test(userAgent);
|
|
250
249
|
const isIos =
|
|
251
250
|
// @ts-ignore
|
|
252
|
-
(/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) ||
|
|
253
|
-
(navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1);
|
|
251
|
+
(/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
|
|
254
252
|
const isMobile = isAndroid || isIos;
|
|
255
|
-
return (index.h("div", { class: "buttonContainer" }, isMobile && this.v ===
|
|
256
|
-
? this.renderMobileButton(isAndroid, isIos)
|
|
257
|
-
: this.renderDesktopButton(), this.open && (!isMobile || this.v === "3") && this.renderModal()));
|
|
253
|
+
return (index.h("div", { class: "buttonContainer" }, isMobile && this.v === '3' ? this.renderMobileButton(isAndroid, isIos) : this.renderDesktopButton(), this.open && (!isMobile || this.v === '3') && this.renderModal()));
|
|
258
254
|
}
|
|
259
255
|
};
|
|
260
256
|
GatacaSSIButton.style = gatacaSsibuttonCss;
|
|
261
257
|
|
|
262
258
|
const gatacaSsibuttonwsCss = "@import url(\"https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400&display=swap\"); html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:\"\";content:none}table{border-collapse:collapse;border-spacing:0}.img-fluid{height:auto;max-width:50%}img{margin-left:auto;margin-right:auto}.buttonContainer{display:inline-block;text-align:right;padding:10px;position:relative}.gatacaButtonWrapper{margin:8px}.gatacaButtonWrapper .gatacaButton{display:flex;min-width:100px;padding:8px 8px;background-color:white;font-size:12px;font-family:\"Work Sans\", sans-serif;letter-spacing:1px;font-weight:2;justify-content:space-between;align-items:center;border-radius:6px;border:1px solid rgba(24, 27, 94, 0.5);color:rgba(24, 27, 94, 0.8);box-shadow:0px 1px 3px rgba(48, 48, 48, 0.15);cursor:pointer}.gatacaButtonWrapper .gatacaButton>span{margin-right:10px}.gatacaButtonWrapper .gatacaButton:hover{box-shadow:0px 2px 8px rgba(48, 48, 48, 0.1)}.gatacaButtonWrapper .buttonText{text-align:right;font-size:8px;color:rgba(24, 27, 94, 0.5);font-family:\"Helvetica Neue\", sans-serif;letter-spacing:1px;padding-right:8px;font-weight:1}.gatacaButtonWrapper .buttonImg{height:25px;width:25px;margin:0;margin-right:20px}";
|
|
263
259
|
|
|
264
|
-
const PHONE_ICON =
|
|
260
|
+
const PHONE_ICON = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAYAAACN1PRVAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAHvSURBVHgB3ZZPTttAFMbfe3YjL7qYLopcpZXSG7Q3CDfIsqrSJpyg5QQtJ2h7glgUdVs4AeEE5AYEQSDAgtnw357Hm0hAQDaeIRFCfFKyeKPxzzPzvc+DUKCZN80GEv1ABgWOQgSdGbOwv7u0nDueV4zjTzUIKhuAZna4vdQFR828azbI0K/TI/qodaLvjlP+tLDGDCs+IKv9Lbsi7kcv0w9541Q0EREPYcoieEQ9KiyECRXHzbpBUOcnYTfPFOOaaGVx9WsLiDrSIp0iU0wFNgIx/AQyc9I/OmOjy+Y8aBvHQcDUYebewc6/Xtk8J5htcg5efEPGhk0JtqkyBjo7DuZcnuO2sqCyKv8rUDmfTS9IBURqBAL+I6CkzBjOMOs22TLY21n8fl17KzXR3uDvb/CQk0GEdfvN07QvpnAOaGfYaRT25JzU6+rnG2tTpcWAy+Cp0m3U/URLms8HWfg/rn6RFaGSs9KQkZMpvGBWNs2Vandt46ac6YNBuc0fDLMaOU5DFybQ8039p/KJ4bq4rwPewtqoM/1gsCm/NfBXvWjgHhhuDAeLyd3qVSifHQULeZkou9EqemLhmUmav8qrZ4GEMGA7ivzjKvfeqGptFV2YdWPMPHHq0cCh3DdpVdLl/XCY9J1gVvbCiWa6N+JLocPFjCsx9cAAAAAASUVORK5CYII=';
|
|
265
261
|
const GatacaSSIButtonWS = class {
|
|
266
262
|
constructor(hostRef) {
|
|
267
263
|
index.registerInstance(this, hostRef);
|
|
268
264
|
this.gatacaLoginCompleted = index.createEvent(this, "gatacaLoginCompleted", 7);
|
|
269
265
|
this.gatacaLoginFailed = index.createEvent(this, "gatacaLoginFailed", 7);
|
|
270
|
-
this.buttonText =
|
|
266
|
+
this.buttonText = 'Easy login';
|
|
271
267
|
this.successCallback = undefined;
|
|
272
268
|
this.errorCallback = undefined;
|
|
273
|
-
this.qrType =
|
|
269
|
+
this.qrType = 'svg';
|
|
274
270
|
this.qrRole = undefined;
|
|
275
271
|
this.callbackServer = undefined;
|
|
276
272
|
this.socketEndpoint = undefined;
|
|
@@ -279,9 +275,9 @@ const GatacaSSIButtonWS = class {
|
|
|
279
275
|
this.wsOnMessage = undefined;
|
|
280
276
|
this.autostart = true;
|
|
281
277
|
this.autorefresh = false;
|
|
282
|
-
this.v =
|
|
283
|
-
this.qrModalTitle =
|
|
284
|
-
this.qrModalDescription =
|
|
278
|
+
this.v = '3';
|
|
279
|
+
this.qrModalTitle = 'Quick Access';
|
|
280
|
+
this.qrModalDescription = 'Sign up or sign in by scanning the QR Code with the Gataca Wallet';
|
|
285
281
|
this.hideBrandTitle = false;
|
|
286
282
|
this.dynamicLink = true;
|
|
287
283
|
this.open = false;
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -11,7 +11,7 @@ function checkMobile() {
|
|
|
11
11
|
}
|
|
12
12
|
function base64UrlEncode(str) {
|
|
13
13
|
let b64 = btoa(str);
|
|
14
|
-
return b64.replace(/\+/g,
|
|
14
|
+
return b64.replace(/\+/g, '-').replace(/\//g, '_').replace(/\=+$/, '');
|
|
15
15
|
}
|
|
16
16
|
exports.RESULT_STATUS = void 0;
|
|
17
17
|
(function (RESULT_STATUS) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h
|
|
2
|
-
const DEFAULT_REPOSITORY =
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
const DEFAULT_REPOSITORY = 'https://studio.gataca.io/api/v1/qrconfigs';
|
|
3
3
|
const fixFunctions = (data) => {
|
|
4
4
|
var _a, _b, _c, _d, _e, _f;
|
|
5
5
|
data.errorCallback = deserializeFunction((_a = data.errorCallback) === null || _a === void 0 ? void 0 : _a.toString());
|
|
@@ -12,14 +12,14 @@ const fixFunctions = (data) => {
|
|
|
12
12
|
};
|
|
13
13
|
const deserializeFunction = (data) => {
|
|
14
14
|
if (data) {
|
|
15
|
-
return new Function(
|
|
15
|
+
return new Function('return ' + data)();
|
|
16
16
|
}
|
|
17
17
|
return undefined;
|
|
18
18
|
};
|
|
19
19
|
export class GatacaAutoQR {
|
|
20
20
|
constructor() {
|
|
21
21
|
this.configId = undefined;
|
|
22
|
-
this.qrType =
|
|
22
|
+
this.qrType = 'svg';
|
|
23
23
|
this.configRepository = DEFAULT_REPOSITORY;
|
|
24
24
|
this.successCallback = undefined;
|
|
25
25
|
this.errorCallback = undefined;
|
|
@@ -30,11 +30,11 @@ export class GatacaAutoQR {
|
|
|
30
30
|
this.config = undefined;
|
|
31
31
|
this.loading = undefined;
|
|
32
32
|
this.loading = true;
|
|
33
|
-
fetch(this.configRepository +
|
|
34
|
-
method:
|
|
33
|
+
fetch(this.configRepository + '/' + this.configId, {
|
|
34
|
+
method: 'GET',
|
|
35
35
|
headers: {
|
|
36
|
-
|
|
37
|
-
}
|
|
36
|
+
'Content-Type': 'application/json'
|
|
37
|
+
}
|
|
38
38
|
})
|
|
39
39
|
.then((response) => {
|
|
40
40
|
response
|
|
@@ -45,12 +45,12 @@ export class GatacaAutoQR {
|
|
|
45
45
|
this.loading = false;
|
|
46
46
|
})
|
|
47
47
|
.catch((err) => {
|
|
48
|
-
console.log(
|
|
48
|
+
console.log('Cannot retrieve selected config', err);
|
|
49
49
|
this.loading = false;
|
|
50
50
|
});
|
|
51
51
|
})
|
|
52
52
|
.catch((err) => {
|
|
53
|
-
console.log(
|
|
53
|
+
console.log('Cannot retrieve selected config', err);
|
|
54
54
|
this.loading = false;
|
|
55
55
|
});
|
|
56
56
|
}
|
|
@@ -142,7 +142,7 @@ export class GatacaAutoQR {
|
|
|
142
142
|
},
|
|
143
143
|
"attribute": "qr-type",
|
|
144
144
|
"reflect": false,
|
|
145
|
-
"defaultValue": "
|
|
145
|
+
"defaultValue": "'svg'"
|
|
146
146
|
},
|
|
147
147
|
"configRepository": {
|
|
148
148
|
"type": "string",
|
|
@@ -202,7 +202,7 @@ export class GatacaAutoQR {
|
|
|
202
202
|
"type": "unknown",
|
|
203
203
|
"mutable": false,
|
|
204
204
|
"complexType": {
|
|
205
|
-
"original": "(
|
|
205
|
+
"original": "(id?: string) => Promise<{result: RESULT_STATUS; data?: any}>",
|
|
206
206
|
"resolved": "(id?: string) => Promise<{ result: RESULT_STATUS; data?: any; }>",
|
|
207
207
|
"references": {
|
|
208
208
|
"Promise": {
|
|
@@ -226,7 +226,7 @@ export class GatacaAutoQR {
|
|
|
226
226
|
"type": "unknown",
|
|
227
227
|
"mutable": false,
|
|
228
228
|
"complexType": {
|
|
229
|
-
"original": "() => Promise<{\n
|
|
229
|
+
"original": "() => Promise<{\n sessionId: string;\n authenticationRequest?: string;\n }>",
|
|
230
230
|
"resolved": "() => Promise<{ sessionId: string; authenticationRequest?: string; }>",
|
|
231
231
|
"references": {
|
|
232
232
|
"Promise": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h } from
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
2
|
export const QR = (props) => {
|
|
3
3
|
const { value, useLogo, logoSrc, size, qrType } = props;
|
|
4
|
-
return
|
|
4
|
+
return h("gataca-qrdisplay", { qrData: value, rounded: true, qrType: qrType, size: size, "logo-size": useLogo ? 0.33 : 0, "logo-src": logoSrc });
|
|
5
5
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { h } from
|
|
2
|
-
import { AnimatedLoader } from
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import { AnimatedLoader } from './components/AnimatedLoader';
|
|
3
3
|
export const ReadQR = (props) => {
|
|
4
4
|
var _a;
|
|
5
5
|
const { modalWidth, readQrMessages, renderQR, url, sizeQR } = props;
|
|
6
6
|
return (h("div", { class: "blured", style: {
|
|
7
|
-
width: (modalWidth - 48).toString() +
|
|
8
|
-
height: modalWidth ? ((_a = (modalWidth - 48)) === null || _a === void 0 ? void 0 : _a.toString()) +
|
|
7
|
+
width: (modalWidth - 48).toString() + 'px',
|
|
8
|
+
height: modalWidth ? ((_a = (modalWidth - 48)) === null || _a === void 0 ? void 0 : _a.toString()) + 'px' : ''
|
|
9
9
|
} }, h("div", { id: "notify" }, h(AnimatedLoader, null), h("p", { class: "notify-text" }, readQrMessages === null || readQrMessages === void 0 ? void 0 :
|
|
10
10
|
readQrMessages.title, " "), h("p", { class: "notify-text bold" }, readQrMessages === null || readQrMessages === void 0 ? void 0 : readQrMessages.description)), h("div", { id: "qrwait" }, renderQR(url, false, sizeQR))));
|
|
11
11
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h } from
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
2
|
export const AnimatedLoader = () => {
|
|
3
3
|
return (h("div", { class: "containerLoader" }, h("div", { class: "loader" }, h("div", { class: "loader__item loader__item__1" }), h("div", { class: "loader__item loader__item__2" }), h("div", { class: "loader__item loader__item__3" }), h("div", { class: "loader__item loader__item__4" }), h("div", { class: "loader__item loader__item__5" }), h("div", { class: "loader__item loader__item__6" }), h("div", { class: "loader__item loader__item__7" }), h("div", { class: "loader__item loader__item__8" }))));
|
|
4
4
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { h } from
|
|
2
|
-
import refreshIcon from
|
|
3
|
-
import alertIcon from
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import refreshIcon from '../../../../assets/icons/gat-icon-refresh.svg';
|
|
3
|
+
import alertIcon from '../../../../assets/icons/gat-icon-alert.svg';
|
|
4
4
|
export const RetryButton = (props) => {
|
|
5
5
|
var _a;
|
|
6
|
-
const { errorMessage, modalWidth, clickInsideBoxLabel, refreshQrLabel, scanQrLabel, waitingStartSessionLabel, display, renderRetryQR
|
|
6
|
+
const { errorMessage, modalWidth, clickInsideBoxLabel, refreshQrLabel, scanQrLabel, waitingStartSessionLabel, display, renderRetryQR } = props;
|
|
7
7
|
return (h("div", { class: "reload", style: {
|
|
8
|
-
width: (modalWidth - 48).toString() +
|
|
9
|
-
height: modalWidth ? ((_a = (modalWidth - 48)) === null || _a === void 0 ? void 0 : _a.toString()) +
|
|
10
|
-
} }, h("div", { id: "notify", onClick: () => display() }, h("img", { src: refreshIcon, height: 24, width: 24 }), h("p", { class: "notify-text" }, clickInsideBoxLabel, " "), errorMessage ?
|
|
11
|
-
width: (modalWidth - 48).toString() +
|
|
8
|
+
width: (modalWidth - 48).toString() + 'px',
|
|
9
|
+
height: modalWidth ? ((_a = (modalWidth - 48)) === null || _a === void 0 ? void 0 : _a.toString()) + 'px' : ''
|
|
10
|
+
} }, h("div", { id: "notify", onClick: () => display() }, h("img", { src: refreshIcon, height: 24, width: 24 }), h("p", { class: "notify-text" }, clickInsideBoxLabel, " "), errorMessage ? h("p", { class: "notify-text bold" }, refreshQrLabel) : h("p", { class: "notify-text bold" }, scanQrLabel), errorMessage && (h("div", { class: "alert", style: {
|
|
11
|
+
width: (modalWidth - 48).toString() + 'px'
|
|
12
12
|
} }, h("img", { src: alertIcon, height: 24, width: 24 }), h("p", null, errorMessage)))), h("div", { id: "qrwait" }, renderRetryQR(waitingStartSessionLabel))));
|
|
13
13
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import successIcon from
|
|
2
|
-
import { h } from
|
|
1
|
+
import successIcon from '../../../../assets/icons/gat-icon-check.svg';
|
|
2
|
+
import { h } from '@stencil/core';
|
|
3
3
|
export const Success = (props) => {
|
|
4
4
|
const { modalHeight, successLoginLabel } = props;
|
|
5
|
-
return (h("div", { class:
|
|
6
|
-
height: modalHeight ? (modalHeight === null || modalHeight === void 0 ? void 0 : modalHeight.toString()) +
|
|
5
|
+
return (h("div", { class: 'success', style: {
|
|
6
|
+
height: modalHeight ? (modalHeight === null || modalHeight === void 0 ? void 0 : modalHeight.toString()) + 'px' : '300px'
|
|
7
7
|
} }, h("img", { src: successIcon, height: 52, width: 52 }), h("p", { class: "successMsg" }, successLoginLabel)));
|
|
8
8
|
};
|