@gataca/qr 3.0.10 → 4.0.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/dist/{esm/qr-code-styling-0eeb38d5.js → cjs/gat-icon-check-c88a30ed.js} +15 -1
- package/dist/cjs/gataca-autoqr.cjs.entry.js +9 -9
- package/dist/cjs/gataca-qr_3.cjs.entry.js +620 -0
- package/dist/cjs/gataca-qrws.cjs.entry.js +39 -47
- package/dist/cjs/gataca-ssibuttonws.cjs.entry.js +61 -0
- package/dist/cjs/gatacaqr.cjs.js +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.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 +3 -3
- package/dist/collection/components/gataca-qr/components/readQR/ReadQR.js +7 -5
- 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 +64 -55
- package/dist/collection/components/gataca-qrdisplay/gataca-qrdisplay.js +33 -11
- 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 +224 -54
- 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 → gat-icon-check.js} +4 -4
- package/dist/components/gataca-autoqr.js +9 -9
- package/dist/components/gataca-qr2.js +56 -63
- package/dist/components/gataca-qrdisplay2.js +11 -6
- package/dist/components/gataca-qrws2.js +35 -42
- package/dist/components/gataca-ssibutton2.js +114 -34
- package/dist/components/gataca-ssibuttonws2.js +6 -6
- package/dist/components/index.js +1 -1
- package/dist/{cjs/qr-code-styling-412bbc7a.js → esm/gat-icon-check-c188cd29.js} +8 -2
- package/dist/esm/gataca-autoqr.entry.js +9 -9
- package/dist/esm/gataca-qr_3.entry.js +614 -0
- package/dist/esm/gataca-qrws.entry.js +36 -44
- package/dist/esm/gataca-ssibuttonws.entry.js +57 -0
- package/dist/esm/gatacaqr.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.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-5be73956.js +1 -0
- package/dist/gatacaqr/p-948e7d94.entry.js +1 -0
- package/dist/gatacaqr/p-e94e9be8.entry.js +1 -0
- package/dist/gatacaqr/p-fb41fad9.entry.js +1 -0
- package/dist/types/components/gataca-autoqr/gataca-autoqr.d.ts +7 -7
- package/dist/types/components/gataca-qr/components/qr/QR.d.ts +4 -2
- package/dist/types/components/gataca-qr/components/readQR/ReadQR.d.ts +3 -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 +13 -4
- package/dist/types/components/gataca-qrdisplay/gataca-qrdisplay.d.ts +6 -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 +38 -5
- package/dist/types/components/gataca-ssibuttonws/gataca-ssibuttonws.d.ts +3 -3
- package/dist/types/components.d.ts +78 -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/cjs/gat-icon-alert-0ad19b26.js +0 -14
- package/dist/cjs/gataca-qr_2.cjs.entry.js +0 -295
- package/dist/cjs/gataca-ssibutton_2.cjs.entry.js +0 -317
- package/dist/esm/gat-icon-alert-7b06ef3a.js +0 -9
- package/dist/esm/gataca-qr_2.entry.js +0 -290
- package/dist/esm/gataca-ssibutton_2.entry.js +0 -312
- package/dist/gatacaqr/p-0be4566d.js +0 -1
- package/dist/gatacaqr/p-3500ae66.entry.js +0 -1
- package/dist/gatacaqr/p-68272823.entry.js +0 -1
- package/dist/gatacaqr/p-92a2e6f0.entry.js +0 -1
- package/dist/gatacaqr/p-ea783014.js +0 -1
- /package/dist/gatacaqr/{p-2cd7b062.js → p-bce7e590.js} +0 -0
|
@@ -3,43 +3,42 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-93d47a75.js');
|
|
6
|
-
const
|
|
7
|
-
require('./
|
|
8
|
-
const utils = require('./utils-ef28b844.js');
|
|
6
|
+
const gatIconCheck = require('./gat-icon-check-c88a30ed.js');
|
|
7
|
+
const utils = require('./utils-b4e62bc0.js');
|
|
9
8
|
|
|
10
9
|
const Success = (props) => {
|
|
11
10
|
const { modalHeight, successLoginLabel } = props;
|
|
12
|
-
return (index.h("div", { class:
|
|
13
|
-
height: modalHeight ? (modalHeight === null || modalHeight === void 0 ? void 0 : modalHeight.toString()) +
|
|
11
|
+
return (index.h("div", { class: 'success', style: {
|
|
12
|
+
height: modalHeight ? (modalHeight === null || modalHeight === void 0 ? void 0 : modalHeight.toString()) + 'px' : '300px'
|
|
14
13
|
} },
|
|
15
|
-
index.h("img", { src:
|
|
14
|
+
index.h("img", { src: gatIconCheck.gatIconCheckSvg, height: 52, width: 52 }),
|
|
16
15
|
index.h("p", { class: "successMsg" }, successLoginLabel)));
|
|
17
16
|
};
|
|
18
17
|
|
|
19
18
|
const RetryButton = (props) => {
|
|
20
19
|
var _a;
|
|
21
|
-
const { errorMessage, modalWidth, clickInsideBoxLabel, refreshQrLabel, scanQrLabel, waitingStartSessionLabel, display, renderRetryQR
|
|
20
|
+
const { errorMessage, modalWidth, clickInsideBoxLabel, refreshQrLabel, scanQrLabel, waitingStartSessionLabel, display, renderRetryQR } = props;
|
|
22
21
|
return (index.h("div", { class: "reload", style: {
|
|
23
|
-
width: (modalWidth - 48).toString() +
|
|
24
|
-
height: modalWidth ? ((_a = (modalWidth - 48)) === null || _a === void 0 ? void 0 : _a.toString()) +
|
|
22
|
+
width: (modalWidth - 48).toString() + 'px',
|
|
23
|
+
height: modalWidth ? ((_a = (modalWidth - 48)) === null || _a === void 0 ? void 0 : _a.toString()) + 'px' : ''
|
|
25
24
|
} },
|
|
26
25
|
index.h("div", { id: "notify", onClick: () => display() },
|
|
27
|
-
index.h("img", { src:
|
|
26
|
+
index.h("img", { src: gatIconCheck.gatIconRefreshSvg, height: 24, width: 24 }),
|
|
28
27
|
index.h("p", { class: "notify-text" },
|
|
29
28
|
clickInsideBoxLabel,
|
|
30
29
|
" "),
|
|
31
|
-
errorMessage ?
|
|
30
|
+
errorMessage ? index.h("p", { class: "notify-text bold" }, refreshQrLabel) : index.h("p", { class: "notify-text bold" }, scanQrLabel),
|
|
32
31
|
errorMessage && (index.h("div", { class: "alert", style: {
|
|
33
|
-
width: (modalWidth - 48).toString() +
|
|
32
|
+
width: (modalWidth - 48).toString() + 'px'
|
|
34
33
|
} },
|
|
35
|
-
index.h("img", { src:
|
|
34
|
+
index.h("img", { src: gatIconCheck.gatIconAlertSvg, height: 24, width: 24 }),
|
|
36
35
|
index.h("p", null, errorMessage)))),
|
|
37
36
|
index.h("div", { id: "qrwait" }, renderRetryQR(waitingStartSessionLabel))));
|
|
38
37
|
};
|
|
39
38
|
|
|
40
39
|
const QR = (props) => {
|
|
41
40
|
const { value, useLogo, logoSrc, size, qrType } = props;
|
|
42
|
-
return
|
|
41
|
+
return index.h("gataca-qrdisplay", { qrData: value, rounded: true, size: size, qrType: qrType, "logo-size": useLogo ? 0.33 : 0, "logo-src": logoSrc });
|
|
43
42
|
};
|
|
44
43
|
|
|
45
44
|
const AnimatedLoader = () => {
|
|
@@ -59,8 +58,8 @@ const ReadQR = (props) => {
|
|
|
59
58
|
var _a;
|
|
60
59
|
const { modalWidth, readQrMessages, renderQR, url, sizeQR } = props;
|
|
61
60
|
return (index.h("div", { class: "blured", style: {
|
|
62
|
-
width: (modalWidth - 48).toString() +
|
|
63
|
-
height: modalWidth ? ((_a = (modalWidth - 48)) === null || _a === void 0 ? void 0 : _a.toString()) +
|
|
61
|
+
width: (modalWidth - 48).toString() + 'px',
|
|
62
|
+
height: modalWidth ? ((_a = (modalWidth - 48)) === null || _a === void 0 ? void 0 : _a.toString()) + 'px' : ''
|
|
64
63
|
} },
|
|
65
64
|
index.h("div", { id: "notify" },
|
|
66
65
|
index.h(AnimatedLoader, null),
|
|
@@ -73,11 +72,11 @@ const ReadQR = (props) => {
|
|
|
73
72
|
|
|
74
73
|
const gatacaQrwsCss = "@import url(\"https://fonts.googleapis.com/css2?family=Ubuntu:wght@100;300;400;500;600;700&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Poppins:wght@100;300;400;500;600;700&display=swap\"); @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}.brandSection{padding-top:5px;display:flex;align-items:center}.brandSection .gatacaImgSmall{height:13px;width:13px;margin:0;margin-right:10px}.popUpContainer .large-modal{width:300px;min-height:350px}.popUpContainer .modal-window{position:relative;border-radius:6px;overflow:hidden;color:rgba(24, 27, 94, 0.8);box-shadow:0px 3px 10px rgba(48, 48, 48, 0.1);display:flex;flex-direction:column;justify-content:space-between;align-items:center;display:flex;z-index:1001;padding:1px;background-color:white;border-radius:12px;-webkit-transition:opacity 0.5s, visibility 0s 0.5s;transition:opacity 0.5s, visibility 0s 0.5s;visibility:hidden;opacity:0}.popUpContainer .modal-window__content{width:100%;height:100%;text-align:left}.popUpContainer .modal-window__content .hidenText{display:none}.popUpContainer .modal-window .modalText{font-family:\"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:20px;font-style:normal;font-weight:700;line-height:24px;margin-top:10px;letter-spacing:1px}.popUpContainer .modal-window .qrTitleContainer{padding:14px 24px;padding-bottom:0px}.popUpContainer .modal-window .qrTitle{font-size:20px;font-weight:600;line-height:23.5px}.popUpContainer .modal-window .qrDescription{font-family:\"Poppins\", \"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:16px;color:#707074}.popUpContainer .modal-window .bold{font-weight:700}.popUpContainer .modal-window .qrBrand{margin-top:4px;font-size:14px;font-weight:400;line-height:16.5px;display:flex;align-items:center}.popUpContainer .modal-window .qrBrand img{margin-left:5px;height:12px}.popUpContainer .modal-window .qr-section{width:252px;height:252px}.popUpContainer .noBoxShadow{box-shadow:none}.popUpContainer .is-visible{opacity:1;visibility:visible}.is-transparent{opacity:0}.success{display:flex;height:300px;flex-direction:column;justify-content:center;align-items:center;padding:0px}.success>img{padding-bottom:12px}.success>.successMsg{line-height:23.5px;color:var(--neutral-1000, #1e1e20);text-align:center;font-family:\"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:20px;font-style:normal;font-weight:700;line-height:24px}.reload,.blured{height:252px;width:252px;border:1px dashed #a1a1a1;border-radius:12px;position:relative;top:24px;margin:0 24px 24px;display:flex;overflow:hidden;justify-content:center;align-items:center}#qrwait{display:flex;justify-content:center}#qrwait,#notify{width:100%;height:100%;top:0;left:0;border-radius:20px}#notify{z-index:10;position:absolute;justify-self:center;justify-items:center;justify-content:center;align-items:center;align-content:center;display:flex;flex-direction:column;box-sizing:border-box;padding:20px;background:rgba(255, 255, 255, 0.95)}#notify>img{padding-bottom:12px}.alert{display:flex;flex-direction:row;justify-content:start;width:252px;position:absolute;bottom:0px;border:1px solid #ee888c;background:#ffdedf;border-radius:11px;box-sizing:border-box;padding:12px;align-items:center;gap:12px}.alert>img{margin:0}.alert>p{font-family:\"Poppins\", \"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:14px;font-style:normal;font-weight:400;margin-top:0;line-height:16px;color:#1e1e20}.notify-text{font-family:\"Poppins\", \"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:16px;color:#707074;text-align:center}.containerLoader{display:flex;justify-content:center;align-items:center;width:30px;height:30px;margin-bottom:12px}.loader{position:relative;margin-left:0 !important}.loader__item{position:absolute;width:9.68px;height:4px;background:transparent;border-radius:2px}.loader__item__1{transform:translate(2.5846212025px, 5.4246212025px) rotate(45deg);-webkit-animation:translate(2.5846212025px, 5.4246212025px) rotate(45deg);-moz-animation:translate(2.5846212025px, 5.4246212025px) rotate(45deg);-o-animation:translate(2.5846212025px, 5.4246212025px) rotate(45deg);animation:blink 0.8333333333s linear 0.1041666667s infinite;-webkit-animation:blink 0.8333333333s linear 0.1041666667s infinite;-moz-animation:blink 0.8333333333s linear 0.1041666667s infinite;-o-animation:blink 0.8333333333s linear 0.1041666667s infinite}.loader__item__2{transform:translate(-4.84px, 8.5px) rotate(90deg);-webkit-animation:translate(-4.84px, 8.5px) rotate(90deg);-moz-animation:translate(-4.84px, 8.5px) rotate(90deg);-o-animation:translate(-4.84px, 8.5px) rotate(90deg);animation:blink 0.8333333333s linear 0.2083333333s infinite;-webkit-animation:blink 0.8333333333s linear 0.2083333333s infinite;-moz-animation:blink 0.8333333333s linear 0.2083333333s infinite;-o-animation:blink 0.8333333333s linear 0.2083333333s infinite}.loader__item__3{transform:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);-webkit-animation:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);-moz-animation:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);-o-animation:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);animation:blink 0.8333333333s linear 0.3125s infinite;-webkit-animation:blink 0.8333333333s linear 0.3125s infinite;-moz-animation:blink 0.8333333333s linear 0.3125s infinite;-o-animation:blink 0.8333333333s linear 0.3125s infinite}.loader__item__4{transform:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);-webkit-animation:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);-moz-animation:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);-o-animation:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);animation:blink 0.8333333333s linear 0.4166666667s infinite;-webkit-animation:blink 0.8333333333s linear 0.4166666667s infinite;-moz-animation:blink 0.8333333333s linear 0.4166666667s infinite;-o-animation:blink 0.8333333333s linear 0.4166666667s infinite}.loader__item__5{transform:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);-webkit-animation:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);-moz-animation:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);-o-animation:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);animation:blink 0.8333333333s linear 0.5208333333s infinite;-webkit-animation:blink 0.8333333333s linear 0.5208333333s infinite;-moz-animation:blink 0.8333333333s linear 0.5208333333s infinite;-o-animation:blink 0.8333333333s linear 0.5208333333s infinite}.loader__item__6{transform:translate(-4.8399941857px, -12.499998805px) rotate(270deg);-webkit-animation:translate(-4.8399941857px, -12.499998805px) rotate(270deg);-moz-animation:translate(-4.8399941857px, -12.499998805px) rotate(270deg);-o-animation:translate(-4.8399941857px, -12.499998805px) rotate(270deg);animation:blink 0.8333333333s linear 0.625s infinite;-webkit-animation:blink 0.8333333333s linear 0.625s infinite;-moz-animation:blink 0.8333333333s linear 0.625s infinite;-o-animation:blink 0.8333333333s linear 0.625s infinite}.loader__item__7{transform:translate(2.5847915061px, -9.4245803212px) rotate(315deg);-webkit-animation:translate(2.5847915061px, -9.4245803212px) rotate(315deg);-moz-animation:translate(2.5847915061px, -9.4245803212px) rotate(315deg);-o-animation:translate(2.5847915061px, -9.4245803212px) rotate(315deg);animation:blink 0.8333333333s linear 0.7291666667s infinite;-webkit-animation:blink 0.8333333333s linear 0.7291666667s infinite;-moz-animation:blink 0.8333333333s linear 0.7291666667s infinite;-o-animation:blink 0.8333333333s linear 0.7291666667s infinite}.loader__item__8{transform:translate(5.6631628524px, -1.99913122px) rotate(360deg);-webkit-animation:translate(5.6631628524px, -1.99913122px) rotate(360deg);-moz-animation:translate(5.6631628524px, -1.99913122px) rotate(360deg);-o-animation:translate(5.6631628524px, -1.99913122px) rotate(360deg);animation:blink 0.8333333333s linear 0.8333333333s infinite;-webkit-animation:blink 0.8333333333s linear 0.8333333333s infinite;-moz-animation:blink 0.8333333333s linear 0.8333333333s infinite;-o-animation:blink 0.8333333333s linear 0.8333333333s infinite}.loader__item__8{max-width:8.5px}@keyframes blink{0%{background:#4745B7}100%{background:#CCCBF8}}@keyframes rotate{0%{transform:rotate(0deg)}100%{background:rotate(360deg)}}";
|
|
75
74
|
|
|
76
|
-
const DEEP_LINK_PREFIX =
|
|
75
|
+
const DEEP_LINK_PREFIX = 'https://api.gataca.io/qr/redirect.html';
|
|
77
76
|
const DEFAULT_SESSION_TIMEOUT = 300;
|
|
78
|
-
const QR_ROLE_CONNECT =
|
|
77
|
+
const QR_ROLE_CONNECT = 'connect';
|
|
79
78
|
const GatacaQRWS = class {
|
|
80
|
-
constructor(hostRef) { index.registerInstance(this, hostRef); this.gatacaLoginCompleted = index.createEvent(this, "gatacaLoginCompleted", 7); this.gatacaLoginFailed = index.createEvent(this, "gatacaLoginFailed", 7); this.successCallback = undefined; this.errorCallback = undefined; this.qrRole = undefined; this.qrType =
|
|
79
|
+
constructor(hostRef) { index.registerInstance(this, hostRef); this.gatacaLoginCompleted = index.createEvent(this, "gatacaLoginCompleted", 7); this.gatacaLoginFailed = index.createEvent(this, "gatacaLoginFailed", 7); this.successCallback = undefined; this.errorCallback = undefined; this.qrRole = undefined; this.qrType = 'svg'; this.callbackServer = undefined; this.socketEndpoint = undefined; this.sessionTimeout = DEFAULT_SESSION_TIMEOUT; this.wsOnOpen = undefined; this.wsOnMessage = undefined; this.autostart = true; this.autorefresh = false; this.v = '3'; this.qrModalTitle = 'Quick Access'; this.modalTitleColor = '#4745B7'; this.qrModalDescription = 'Sign up or sign in by scanning the QR Code with the Gataca Wallet'; this.hideModalTexts = false; this.hideModalBoxShadow = false; this.hideBrandTitle = false; this.logoSize = 0; this.logoSrc = gatIconCheck.logoGatacaSvg; this.qrSize = 300; this.modalWidth = 300; this.modalHeight = undefined; this.qrCodeExpiredLabel = 'QR Code expired'; this.credentialsNotValidatedLabel = 'User credentials not validated'; this.clickInsideBoxLabel = 'Click inside the box to'; this.refreshQrLabel = 'Refresh QR Code'; this.scanQrLabel = 'Scan QR Code'; this.userNotScanInTimeErrorLabel = 'User did not scan the QR in the allowed time'; this.credsNotValidatedErrorLabel = "Provided user credentials couldn't be validated"; this.failedLoginErrorLabel = 'No successful login'; this.successLoginLabel = 'Successful Connection!'; this.byBrandLabel = 'by Gataca'; this.waitingStartSessionLabel = 'waiting to start a session'; this.readQrTitle = 'Processing...'; this.readQrDescription = 'Please wait a moment'; this.hideQrModalDescription = false; this.dynamicLink = true; this.sessionId = undefined; this.authenticationRequest = undefined; this.sessionData = undefined; this.result = utils.RESULT_STATUS.NOT_STARTED; }
|
|
81
80
|
disconnectedCallback() {
|
|
82
81
|
this.stop();
|
|
83
82
|
}
|
|
@@ -92,7 +91,7 @@ const GatacaQRWS = class {
|
|
|
92
91
|
async display() {
|
|
93
92
|
let socket = new WebSocket(this.socketEndpoint);
|
|
94
93
|
setTimeout(() => {
|
|
95
|
-
this.socket.close(1000,
|
|
94
|
+
this.socket.close(1000, '');
|
|
96
95
|
}, 1000 * this.sessionTimeout);
|
|
97
96
|
this.socket = socket;
|
|
98
97
|
socket.onopen = () => {
|
|
@@ -111,11 +110,11 @@ const GatacaQRWS = class {
|
|
|
111
110
|
}
|
|
112
111
|
};
|
|
113
112
|
socket.onerror = () => {
|
|
114
|
-
let error = new Error(
|
|
113
|
+
let error = new Error('Error connecting with server');
|
|
115
114
|
this.result = utils.RESULT_STATUS.FAILED;
|
|
116
115
|
this.gatacaLoginFailed.emit(error);
|
|
117
116
|
this.errorCallback(error);
|
|
118
|
-
socket.close(1000,
|
|
117
|
+
socket.close(1000, '');
|
|
119
118
|
};
|
|
120
119
|
socket.onclose = () => {
|
|
121
120
|
if (this.result === utils.RESULT_STATUS.ONGOING || utils.RESULT_STATUS.READ) {
|
|
@@ -126,7 +125,7 @@ const GatacaQRWS = class {
|
|
|
126
125
|
this.display();
|
|
127
126
|
}
|
|
128
127
|
else {
|
|
129
|
-
let error = new Error(
|
|
128
|
+
let error = new Error('User did not scan the QR in the alloted time');
|
|
130
129
|
this.gatacaLoginFailed.emit(error);
|
|
131
130
|
this.errorCallback(error);
|
|
132
131
|
}
|
|
@@ -152,7 +151,7 @@ const GatacaQRWS = class {
|
|
|
152
151
|
this.sessionData = wsresp.authenticatedUserData;
|
|
153
152
|
this.gatacaLoginCompleted.emit(wsresp.authenticatedUserData);
|
|
154
153
|
this.successCallback(wsresp.authenticatedUserData);
|
|
155
|
-
this.socket.close(1000,
|
|
154
|
+
this.socket.close(1000, '');
|
|
156
155
|
break;
|
|
157
156
|
case utils.RESULT_STATUS.FAILED:
|
|
158
157
|
this.socket.close();
|
|
@@ -166,7 +165,7 @@ const GatacaQRWS = class {
|
|
|
166
165
|
this.display();
|
|
167
166
|
}
|
|
168
167
|
else {
|
|
169
|
-
let error = new Error(
|
|
168
|
+
let error = new Error('User did not scan the QR in the alloted time');
|
|
170
169
|
this.gatacaLoginFailed.emit(error);
|
|
171
170
|
this.errorCallback(error);
|
|
172
171
|
}
|
|
@@ -178,21 +177,19 @@ const GatacaQRWS = class {
|
|
|
178
177
|
async stop() {
|
|
179
178
|
this.sessionData = undefined;
|
|
180
179
|
this.sessionId = undefined;
|
|
181
|
-
this.socket.close(1000,
|
|
180
|
+
this.socket.close(1000, 'Client stopped the connection');
|
|
182
181
|
}
|
|
183
182
|
/**
|
|
184
183
|
* Retrieve manually the session data on a successful login
|
|
185
184
|
*/
|
|
186
185
|
async getSessionData() {
|
|
187
|
-
return this.sessionData
|
|
188
|
-
? Promise.resolve(this.sessionData)
|
|
189
|
-
: Promise.reject(new Error("No successful login"));
|
|
186
|
+
return this.sessionData ? Promise.resolve(this.sessionData) : Promise.reject(new Error('No successful login'));
|
|
190
187
|
}
|
|
191
188
|
getLink() {
|
|
192
|
-
if (this.v ===
|
|
189
|
+
if (this.v === '2' && this.qrRole == QR_ROLE_CONNECT) {
|
|
193
190
|
return this.authenticationRequest;
|
|
194
191
|
}
|
|
195
|
-
const authRequestEncoded =
|
|
192
|
+
const authRequestEncoded = '?dl=' + utils.base64UrlEncode(this.authenticationRequest);
|
|
196
193
|
return DEEP_LINK_PREFIX + authRequestEncoded;
|
|
197
194
|
}
|
|
198
195
|
renderQRSection() {
|
|
@@ -210,40 +207,35 @@ const GatacaQRWS = class {
|
|
|
210
207
|
case utils.RESULT_STATUS.READ:
|
|
211
208
|
return this.renderReadQR({
|
|
212
209
|
title: this === null || this === void 0 ? void 0 : this.readQrTitle,
|
|
213
|
-
description: this === null || this === void 0 ? void 0 : this.readQrDescription
|
|
210
|
+
description: this === null || this === void 0 ? void 0 : this.readQrDescription
|
|
214
211
|
});
|
|
215
212
|
}
|
|
216
213
|
}
|
|
217
214
|
renderSuccess() {
|
|
218
|
-
return
|
|
215
|
+
return index.h(Success, { modalHeight: this === null || this === void 0 ? void 0 : this.modalHeight, successLoginLabel: this === null || this === void 0 ? void 0 : this.successLoginLabel });
|
|
219
216
|
}
|
|
220
217
|
renderRetryButton(errorMessage) {
|
|
221
218
|
return (index.h(RetryButton, { errorMessage: errorMessage, modalWidth: this === null || this === void 0 ? void 0 : this.modalWidth, clickInsideBoxLabel: this === null || this === void 0 ? void 0 : this.clickInsideBoxLabel, refreshQrLabel: this === null || this === void 0 ? void 0 : this.refreshQrLabel, scanQrLabel: this === null || this === void 0 ? void 0 : this.scanQrLabel, waitingStartSessionLabel: this === null || this === void 0 ? void 0 : this.waitingStartSessionLabel, display: this.display.bind(this), renderRetryQR: this.renderRetryQR.bind(this) }));
|
|
222
219
|
}
|
|
223
220
|
renderReadQR(readQrMessages) {
|
|
224
|
-
return
|
|
221
|
+
return index.h(ReadQR, { modalWidth: this === null || this === void 0 ? void 0 : this.modalWidth, readQrMessages: readQrMessages, url: this.getLink(), sizeQR: (this === null || this === void 0 ? void 0 : this.qrSize) ? (this === null || this === void 0 ? void 0 : this.qrSize) - 50 : undefined, renderQR: this.renderQR.bind(this) });
|
|
225
222
|
}
|
|
226
223
|
renderQR(value, useLogo, sizeQR) {
|
|
227
|
-
return
|
|
224
|
+
return index.h(QR, { value: value, qrType: this.qrType, useLogo: useLogo && this.logoSize !== 0, size: sizeQR || (this === null || this === void 0 ? void 0 : this.qrSize) || undefined, logoSrc: this === null || this === void 0 ? void 0 : this.logoSrc });
|
|
228
225
|
}
|
|
229
226
|
renderRetryQR(value, useLogo) {
|
|
230
|
-
return
|
|
227
|
+
return index.h(QR, { value: value, qrType: this.qrType, useLogo: useLogo && this.logoSize !== 0, size: (this === null || this === void 0 ? void 0 : this.qrSize) ? (this === null || this === void 0 ? void 0 : this.qrSize) - 50 : undefined, logoSrc: this === null || this === void 0 ? void 0 : this.logoSrc });
|
|
231
228
|
}
|
|
232
229
|
render() {
|
|
233
230
|
var _a, _b;
|
|
234
|
-
return (index.h("div", { class: "popUpContainer" }, index.h("div", { class: `is-visible modal-window ${this.hideModalTexts ?
|
|
235
|
-
width: (this.modalWidth - 2).toString() +
|
|
236
|
-
height: this.modalHeight
|
|
237
|
-
? ((_a = (this.modalHeight - 2)) === null || _a === void 0 ? void 0 : _a.toString()) + "px"
|
|
238
|
-
: "",
|
|
231
|
+
return (index.h("div", { class: "popUpContainer" }, index.h("div", { class: `is-visible modal-window ${this.hideModalTexts ? '' : 'large-modal'} ${this.hideModalBoxShadow ? 'noBoxShadow' : ''}`, style: {
|
|
232
|
+
width: (this.modalWidth - 2).toString() + 'px',
|
|
233
|
+
height: this.modalHeight ? ((_a = (this.modalHeight - 2)) === null || _a === void 0 ? void 0 : _a.toString()) + 'px' : ''
|
|
239
234
|
}, onClick: (event) => {
|
|
240
235
|
event.stopPropagation();
|
|
241
|
-
} }, index.h("div", { class: "modal-window__content" }, index.h("div", { class: `qrTitleContainer ${this.hideModalTexts ?
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
height: this.modalWidth
|
|
245
|
-
? ((_b = this.modalWidth) === null || _b === void 0 ? void 0 : _b.toString()) + "px"
|
|
246
|
-
: "",
|
|
236
|
+
} }, index.h("div", { class: "modal-window__content" }, index.h("div", { class: `qrTitleContainer ${this.hideModalTexts ? 'hidenText' : ''}` }, index.h("p", { class: "qrTitle modalText", style: { color: this.modalTitleColor || '#1e1e20' } }, this.qrModalTitle), !this.hideBrandTitle && (index.h("p", { class: "qrBrand modalText" }, this.byBrandLabel, ' ', index.h("span", null, index.h("img", { src: gatIconCheck.logoGatacaSvg })))), this.result !== utils.RESULT_STATUS.SUCCESS && !this.hideQrModalDescription && index.h("p", { class: "qrDescription modalText" }, this.qrModalDescription)), index.h("div", { class: "qrSection", style: {
|
|
237
|
+
width: this.modalWidth.toString() + 'px',
|
|
238
|
+
height: this.modalWidth ? ((_b = this.modalWidth) === null || _b === void 0 ? void 0 : _b.toString()) + 'px' : ''
|
|
247
239
|
} }, this.renderQRSection())))));
|
|
248
240
|
}
|
|
249
241
|
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-93d47a75.js');
|
|
6
|
+
|
|
7
|
+
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}";
|
|
8
|
+
|
|
9
|
+
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=';
|
|
10
|
+
const GatacaSSIButtonWS = class {
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
index.registerInstance(this, hostRef);
|
|
13
|
+
this.gatacaLoginCompleted = index.createEvent(this, "gatacaLoginCompleted", 7);
|
|
14
|
+
this.gatacaLoginFailed = index.createEvent(this, "gatacaLoginFailed", 7);
|
|
15
|
+
this.buttonText = 'Easy login';
|
|
16
|
+
this.successCallback = undefined;
|
|
17
|
+
this.errorCallback = undefined;
|
|
18
|
+
this.qrType = 'svg';
|
|
19
|
+
this.qrRole = undefined;
|
|
20
|
+
this.callbackServer = undefined;
|
|
21
|
+
this.socketEndpoint = undefined;
|
|
22
|
+
this.sessionTimeout = undefined;
|
|
23
|
+
this.wsOnOpen = undefined;
|
|
24
|
+
this.wsOnMessage = undefined;
|
|
25
|
+
this.autostart = true;
|
|
26
|
+
this.autorefresh = false;
|
|
27
|
+
this.v = '3';
|
|
28
|
+
this.qrModalTitle = 'Quick Access';
|
|
29
|
+
this.qrModalDescription = 'Sign up or sign in by scanning the QR Code with the Gataca Wallet';
|
|
30
|
+
this.hideBrandTitle = false;
|
|
31
|
+
this.dynamicLink = true;
|
|
32
|
+
this.open = false;
|
|
33
|
+
this.qr = (index.h("gataca-qrws", { wsOnMessage: this.wsOnMessage, wsOnOpen: this.wsOnOpen, successCallback: this.successCallback, errorCallback: this.errorCallback, qrRole: this.qrRole, qrType: this.qrType, callbackServer: this.callbackServer, sessionTimeout: this.sessionTimeout, socketEndpoint: this.socketEndpoint, autostart: true, autorefresh: this.autorefresh, v: this.v, qrModalTitle: this.qrModalTitle, qrModalDescription: this.qrModalDescription, hideBrandTitle: this.hideBrandTitle, dynamicLink: this.dynamicLink }));
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Retrieve manually the session data on a successful login
|
|
37
|
+
*/
|
|
38
|
+
async getSessionData() {
|
|
39
|
+
return this.qr.getSessionData();
|
|
40
|
+
}
|
|
41
|
+
renderModal() {
|
|
42
|
+
return this.qr;
|
|
43
|
+
}
|
|
44
|
+
renderButton() {
|
|
45
|
+
return (index.h("div", { class: "gatacaButtonWrapper" }, index.h("button", { class: "gatacaButton", onClick: () => {
|
|
46
|
+
this.open = !this.open;
|
|
47
|
+
if (this.open) {
|
|
48
|
+
this.qr.display();
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
this.qr.stop();
|
|
52
|
+
}
|
|
53
|
+
} }, index.h("img", { src: PHONE_ICON, class: "buttonImg", alt: this.buttonText }), index.h("span", null, this.buttonText))));
|
|
54
|
+
}
|
|
55
|
+
render() {
|
|
56
|
+
return (index.h("div", { class: "buttonContainer" }, this.renderButton(), this.open && this.renderModal()));
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
GatacaSSIButtonWS.style = gatacaSsibuttonwsCss;
|
|
60
|
+
|
|
61
|
+
exports.gataca_ssibuttonws = GatacaSSIButtonWS;
|
package/dist/cjs/gatacaqr.cjs.js
CHANGED
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["gataca-
|
|
18
|
+
return index.bootstrapLazy([["gataca-qr_3.cjs",[[1,"gataca-ssibutton",{"buttonText":[1,"button-text"],"buttonDCAPIText":[1,"button-d-c-a-p-i-text"],"qrType":[1,"qr-type"],"autostart":[4],"checkStatus":[16],"createSession":[16],"fillSession":[16],"successCallback":[16],"errorCallback":[16],"handleCheckAppLoading":[16],"checkAppTimeout":[2,"check-app-timeout"],"qrRole":[1,"qr-role"],"callbackServer":[1,"callback-server"],"sessionTimeout":[2,"session-timeout"],"pollingFrequency":[2,"polling-frequency"],"autorefresh":[4],"v":[1],"qrModalTitle":[1,"qr-modal-title"],"modalTitleColor":[1,"modal-title-color"],"qrModalDescription":[1,"qr-modal-description"],"hideBrandTitle":[4,"hide-brand-title"],"dynamicLink":[4,"dynamic-link"],"logoSize":[2,"logo-size"],"logoSrc":[1,"logo-src"],"qrCodeExpiredLabel":[1,"qr-code-expired-label"],"credentialsNotValidatedLabel":[1,"credentials-not-validated-label"],"clickInsideBoxLabel":[1,"click-inside-box-label"],"refreshQrLabel":[1,"refresh-qr-label"],"scanQrLabel":[1,"scan-qr-label"],"userNotScanInTimeErrorLabel":[1,"user-not-scan-in-time-error-label"],"credsNotValidatedErrorLabel":[1,"creds-not-validated-error-label"],"failedLoginErrorLabel":[1,"failed-login-error-label"],"successLoginLabel":[1,"success-login-label"],"byBrandLabel":[1,"by-brand-label"],"waitingStartSessionLabel":[1,"waiting-start-session-label"],"enableDcApi":[4,"enable-dc-api"],"hideQrModalDescription":[4,"hide-qr-modal-description"],"qrStyle":[16],"open":[32],"sessionId":[32],"authenticationRequest":[32],"sessionData":[32],"result":[32],"getSessionData":[64],"startMobilePolling":[64],"stop":[64]}],[1,"gataca-qr",{"checkStatus":[16],"createSession":[16],"successCallback":[16],"errorCallback":[16],"qrRole":[1,"qr-role"],"qrType":[1,"qr-type"],"callbackServer":[1,"callback-server"],"autostart":[4],"autorefresh":[4],"v":[1],"qrModalTitle":[1,"qr-modal-title"],"modalTitleColor":[1,"modal-title-color"],"qrModalDescription":[1,"qr-modal-description"],"hideModalTexts":[4,"hide-modal-texts"],"hideModalBoxShadow":[4,"hide-modal-box-shadow"],"hideBrandTitle":[4,"hide-brand-title"],"logoSize":[2,"logo-size"],"logoSrc":[1,"logo-src"],"qrSize":[2,"qr-size"],"modalWidth":[2,"modal-width"],"modalHeight":[2,"modal-height"],"qrCodeExpiredLabel":[1,"qr-code-expired-label"],"credentialsNotValidatedLabel":[1,"credentials-not-validated-label"],"clickInsideBoxLabel":[1,"click-inside-box-label"],"refreshQrLabel":[1,"refresh-qr-label"],"scanQrLabel":[1,"scan-qr-label"],"userNotScanInTimeErrorLabel":[1,"user-not-scan-in-time-error-label"],"credsNotValidatedErrorLabel":[1,"creds-not-validated-error-label"],"failedLoginErrorLabel":[1,"failed-login-error-label"],"successLoginLabel":[1,"success-login-label"],"byBrandLabel":[1,"by-brand-label"],"waitingStartSessionLabel":[1,"waiting-start-session-label"],"readQrTitle":[1,"read-qr-title"],"readQrDescription":[1,"read-qr-description"],"hideQrModalDescription":[4,"hide-qr-modal-description"],"sessionTimeout":[2,"session-timeout"],"pollingFrequency":[2,"polling-frequency"],"dynamicLink":[4,"dynamic-link"],"qrStyle":[16],"sessionId":[32],"authenticationRequest":[32],"sessionData":[32],"result":[32],"display":[64],"stop":[64],"getSessionData":[64]}],[0,"gataca-qrdisplay",{"qrData":[1,"qr-data"],"qrType":[1,"qr-type"],"size":[2],"logoSize":[2,"logo-size"],"logoSrc":[1,"logo-src"],"qrColor":[1,"qr-color"],"bgColor":[1,"bg-color"],"rounded":[4]}]]],["gataca-qrws.cjs",[[1,"gataca-qrws",{"successCallback":[16],"errorCallback":[16],"qrRole":[1,"qr-role"],"qrType":[1,"qr-type"],"callbackServer":[1,"callback-server"],"socketEndpoint":[1,"socket-endpoint"],"sessionTimeout":[2,"session-timeout"],"wsOnOpen":[16],"wsOnMessage":[16],"autostart":[4],"autorefresh":[4],"v":[1],"qrModalTitle":[1,"qr-modal-title"],"modalTitleColor":[1,"modal-title-color"],"qrModalDescription":[1,"qr-modal-description"],"hideModalTexts":[4,"hide-modal-texts"],"hideModalBoxShadow":[4,"hide-modal-box-shadow"],"hideBrandTitle":[4,"hide-brand-title"],"logoSize":[2,"logo-size"],"logoSrc":[1,"logo-src"],"qrSize":[2,"qr-size"],"modalWidth":[2,"modal-width"],"modalHeight":[2,"modal-height"],"qrCodeExpiredLabel":[1,"qr-code-expired-label"],"credentialsNotValidatedLabel":[1,"credentials-not-validated-label"],"clickInsideBoxLabel":[1,"click-inside-box-label"],"refreshQrLabel":[1,"refresh-qr-label"],"scanQrLabel":[1,"scan-qr-label"],"userNotScanInTimeErrorLabel":[1,"user-not-scan-in-time-error-label"],"credsNotValidatedErrorLabel":[1,"creds-not-validated-error-label"],"failedLoginErrorLabel":[1,"failed-login-error-label"],"successLoginLabel":[1,"success-login-label"],"byBrandLabel":[1,"by-brand-label"],"waitingStartSessionLabel":[1,"waiting-start-session-label"],"readQrTitle":[1,"read-qr-title"],"readQrDescription":[1,"read-qr-description"],"hideQrModalDescription":[4,"hide-qr-modal-description"],"dynamicLink":[4,"dynamic-link"],"sessionId":[32],"authenticationRequest":[32],"sessionData":[32],"result":[32],"display":[64],"stop":[64],"getSessionData":[64]},[[2,"sessionMsg","sessionMsgReceived"]]]]],["gataca-ssibuttonws.cjs",[[1,"gataca-ssibuttonws",{"buttonText":[1,"button-text"],"successCallback":[16],"errorCallback":[16],"qrType":[1,"qr-type"],"qrRole":[1,"qr-role"],"callbackServer":[1,"callback-server"],"socketEndpoint":[1,"socket-endpoint"],"sessionTimeout":[2,"session-timeout"],"wsOnOpen":[16],"wsOnMessage":[16],"autostart":[4],"autorefresh":[4],"v":[1],"qrModalTitle":[1,"qr-modal-title"],"qrModalDescription":[1,"qr-modal-description"],"hideBrandTitle":[4,"hide-brand-title"],"dynamicLink":[4,"dynamic-link"],"open":[32],"getSessionData":[64]}]]],["gataca-autoqr.cjs",[[1,"gataca-autoqr",{"configId":[1,"config-id"],"qrType":[1,"qr-type"],"configRepository":[1,"config-repository"],"successCallback":[16],"errorCallback":[16],"checkStatus":[16],"createSession":[16],"wsOnOpen":[16],"wsOnMessage":[16],"config":[32],"loading":[32],"getSessionData":[64]}]]]], options);
|
|
19
19
|
});
|
package/dist/cjs/index.cjs.js
CHANGED
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["gataca-
|
|
17
|
+
return index.bootstrapLazy([["gataca-qr_3.cjs",[[1,"gataca-ssibutton",{"buttonText":[1,"button-text"],"buttonDCAPIText":[1,"button-d-c-a-p-i-text"],"qrType":[1,"qr-type"],"autostart":[4],"checkStatus":[16],"createSession":[16],"fillSession":[16],"successCallback":[16],"errorCallback":[16],"handleCheckAppLoading":[16],"checkAppTimeout":[2,"check-app-timeout"],"qrRole":[1,"qr-role"],"callbackServer":[1,"callback-server"],"sessionTimeout":[2,"session-timeout"],"pollingFrequency":[2,"polling-frequency"],"autorefresh":[4],"v":[1],"qrModalTitle":[1,"qr-modal-title"],"modalTitleColor":[1,"modal-title-color"],"qrModalDescription":[1,"qr-modal-description"],"hideBrandTitle":[4,"hide-brand-title"],"dynamicLink":[4,"dynamic-link"],"logoSize":[2,"logo-size"],"logoSrc":[1,"logo-src"],"qrCodeExpiredLabel":[1,"qr-code-expired-label"],"credentialsNotValidatedLabel":[1,"credentials-not-validated-label"],"clickInsideBoxLabel":[1,"click-inside-box-label"],"refreshQrLabel":[1,"refresh-qr-label"],"scanQrLabel":[1,"scan-qr-label"],"userNotScanInTimeErrorLabel":[1,"user-not-scan-in-time-error-label"],"credsNotValidatedErrorLabel":[1,"creds-not-validated-error-label"],"failedLoginErrorLabel":[1,"failed-login-error-label"],"successLoginLabel":[1,"success-login-label"],"byBrandLabel":[1,"by-brand-label"],"waitingStartSessionLabel":[1,"waiting-start-session-label"],"enableDcApi":[4,"enable-dc-api"],"hideQrModalDescription":[4,"hide-qr-modal-description"],"qrStyle":[16],"open":[32],"sessionId":[32],"authenticationRequest":[32],"sessionData":[32],"result":[32],"getSessionData":[64],"startMobilePolling":[64],"stop":[64]}],[1,"gataca-qr",{"checkStatus":[16],"createSession":[16],"successCallback":[16],"errorCallback":[16],"qrRole":[1,"qr-role"],"qrType":[1,"qr-type"],"callbackServer":[1,"callback-server"],"autostart":[4],"autorefresh":[4],"v":[1],"qrModalTitle":[1,"qr-modal-title"],"modalTitleColor":[1,"modal-title-color"],"qrModalDescription":[1,"qr-modal-description"],"hideModalTexts":[4,"hide-modal-texts"],"hideModalBoxShadow":[4,"hide-modal-box-shadow"],"hideBrandTitle":[4,"hide-brand-title"],"logoSize":[2,"logo-size"],"logoSrc":[1,"logo-src"],"qrSize":[2,"qr-size"],"modalWidth":[2,"modal-width"],"modalHeight":[2,"modal-height"],"qrCodeExpiredLabel":[1,"qr-code-expired-label"],"credentialsNotValidatedLabel":[1,"credentials-not-validated-label"],"clickInsideBoxLabel":[1,"click-inside-box-label"],"refreshQrLabel":[1,"refresh-qr-label"],"scanQrLabel":[1,"scan-qr-label"],"userNotScanInTimeErrorLabel":[1,"user-not-scan-in-time-error-label"],"credsNotValidatedErrorLabel":[1,"creds-not-validated-error-label"],"failedLoginErrorLabel":[1,"failed-login-error-label"],"successLoginLabel":[1,"success-login-label"],"byBrandLabel":[1,"by-brand-label"],"waitingStartSessionLabel":[1,"waiting-start-session-label"],"readQrTitle":[1,"read-qr-title"],"readQrDescription":[1,"read-qr-description"],"hideQrModalDescription":[4,"hide-qr-modal-description"],"sessionTimeout":[2,"session-timeout"],"pollingFrequency":[2,"polling-frequency"],"dynamicLink":[4,"dynamic-link"],"qrStyle":[16],"sessionId":[32],"authenticationRequest":[32],"sessionData":[32],"result":[32],"display":[64],"stop":[64],"getSessionData":[64]}],[0,"gataca-qrdisplay",{"qrData":[1,"qr-data"],"qrType":[1,"qr-type"],"size":[2],"logoSize":[2,"logo-size"],"logoSrc":[1,"logo-src"],"qrColor":[1,"qr-color"],"bgColor":[1,"bg-color"],"rounded":[4]}]]],["gataca-qrws.cjs",[[1,"gataca-qrws",{"successCallback":[16],"errorCallback":[16],"qrRole":[1,"qr-role"],"qrType":[1,"qr-type"],"callbackServer":[1,"callback-server"],"socketEndpoint":[1,"socket-endpoint"],"sessionTimeout":[2,"session-timeout"],"wsOnOpen":[16],"wsOnMessage":[16],"autostart":[4],"autorefresh":[4],"v":[1],"qrModalTitle":[1,"qr-modal-title"],"modalTitleColor":[1,"modal-title-color"],"qrModalDescription":[1,"qr-modal-description"],"hideModalTexts":[4,"hide-modal-texts"],"hideModalBoxShadow":[4,"hide-modal-box-shadow"],"hideBrandTitle":[4,"hide-brand-title"],"logoSize":[2,"logo-size"],"logoSrc":[1,"logo-src"],"qrSize":[2,"qr-size"],"modalWidth":[2,"modal-width"],"modalHeight":[2,"modal-height"],"qrCodeExpiredLabel":[1,"qr-code-expired-label"],"credentialsNotValidatedLabel":[1,"credentials-not-validated-label"],"clickInsideBoxLabel":[1,"click-inside-box-label"],"refreshQrLabel":[1,"refresh-qr-label"],"scanQrLabel":[1,"scan-qr-label"],"userNotScanInTimeErrorLabel":[1,"user-not-scan-in-time-error-label"],"credsNotValidatedErrorLabel":[1,"creds-not-validated-error-label"],"failedLoginErrorLabel":[1,"failed-login-error-label"],"successLoginLabel":[1,"success-login-label"],"byBrandLabel":[1,"by-brand-label"],"waitingStartSessionLabel":[1,"waiting-start-session-label"],"readQrTitle":[1,"read-qr-title"],"readQrDescription":[1,"read-qr-description"],"hideQrModalDescription":[4,"hide-qr-modal-description"],"dynamicLink":[4,"dynamic-link"],"sessionId":[32],"authenticationRequest":[32],"sessionData":[32],"result":[32],"display":[64],"stop":[64],"getSessionData":[64]},[[2,"sessionMsg","sessionMsgReceived"]]]]],["gataca-ssibuttonws.cjs",[[1,"gataca-ssibuttonws",{"buttonText":[1,"button-text"],"successCallback":[16],"errorCallback":[16],"qrType":[1,"qr-type"],"qrRole":[1,"qr-role"],"callbackServer":[1,"callback-server"],"socketEndpoint":[1,"socket-endpoint"],"sessionTimeout":[2,"session-timeout"],"wsOnOpen":[16],"wsOnMessage":[16],"autostart":[4],"autorefresh":[4],"v":[1],"qrModalTitle":[1,"qr-modal-title"],"qrModalDescription":[1,"qr-modal-description"],"hideBrandTitle":[4,"hide-brand-title"],"dynamicLink":[4,"dynamic-link"],"open":[32],"getSessionData":[64]}]]],["gataca-autoqr.cjs",[[1,"gataca-autoqr",{"configId":[1,"config-id"],"qrType":[1,"qr-type"],"configRepository":[1,"config-repository"],"successCallback":[16],"errorCallback":[16],"checkStatus":[16],"createSession":[16],"wsOnOpen":[16],"wsOnMessage":[16],"config":[32],"loading":[32],"getSessionData":[64]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -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
|
-
const { value, useLogo, logoSrc, size, qrType } = props;
|
|
4
|
-
return
|
|
3
|
+
const { value, useLogo, logoSrc, size, qrType, style } = props;
|
|
4
|
+
return h("gataca-qrdisplay", { qrData: value, rounded: true, qrType: qrType, size: size, "logo-size": useLogo ? 0.33 : 0, "logo-src": logoSrc, qrColor: style === null || style === void 0 ? void 0 : style.color, bgColor: style === null || style === void 0 ? void 0 : style.bgColor });
|
|
5
5
|
};
|
|
@@ -1,11 +1,13 @@
|
|
|
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
|
-
const { modalWidth, readQrMessages, renderQR, url, sizeQR } = props;
|
|
5
|
+
const { modalWidth, readQrMessages, renderQR, url, sizeQR, style } = 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
|
+
backgroundColor: style === null || style === void 0 ? void 0 : style.bgColor,
|
|
10
|
+
color: style === null || style === void 0 ? void 0 : style.color
|
|
9
11
|
} }, h("div", { id: "notify" }, h(AnimatedLoader, null), h("p", { class: "notify-text" }, readQrMessages === null || readQrMessages === void 0 ? void 0 :
|
|
10
12
|
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
13
|
};
|
|
@@ -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
|
};
|