@gataca/qr 2.0.12 → 2.0.13

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.
Files changed (44) hide show
  1. package/dist/cjs/gataca-qr_2.cjs.entry.js +47 -16
  2. package/dist/cjs/gataca-qrws.cjs.entry.js +47 -16
  3. package/dist/cjs/gatacaqr.cjs.js +1 -1
  4. package/dist/cjs/index.cjs.js +1 -1
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/{utils-65e14ed0.js → utils-ef28b844.js} +1 -1
  7. package/dist/collection/components/gataca-qr/components/readQR/ReadQR.js +11 -0
  8. package/dist/collection/components/gataca-qr/components/readQR/components/AnimatedLoader.js +4 -0
  9. package/dist/collection/components/gataca-qr/components/retryButton/RetryButton.js +2 -3
  10. package/dist/collection/components/gataca-qr/gataca-qr.css +125 -2
  11. package/dist/collection/components/gataca-qr/gataca-qr.js +21 -16
  12. package/dist/collection/components/gataca-qrws/components/readQR/ReadQR.js +11 -0
  13. package/dist/collection/components/gataca-qrws/components/readQR/components/AnimatedLoader.js +4 -0
  14. package/dist/collection/components/gataca-qrws/components/retryButton/RetryButton.js +2 -3
  15. package/dist/collection/components/gataca-qrws/gataca-qrws.css +126 -2
  16. package/dist/collection/components/gataca-qrws/gataca-qrws.js +21 -16
  17. package/dist/collection/utils/utils.js +1 -1
  18. package/dist/components/gat-icon-alert.js +1 -1
  19. package/dist/components/gataca-qr2.js +48 -17
  20. package/dist/components/gataca-qrws2.js +48 -17
  21. package/dist/esm/gataca-qr_2.entry.js +47 -16
  22. package/dist/esm/gataca-qrws.entry.js +47 -16
  23. package/dist/esm/gatacaqr.js +1 -1
  24. package/dist/esm/index.js +1 -1
  25. package/dist/esm/loader.js +1 -1
  26. package/dist/esm/{utils-1b406699.js → utils-63e7a33b.js} +1 -1
  27. package/dist/gatacaqr/gatacaqr.esm.js +1 -1
  28. package/dist/gatacaqr/index.esm.js +1 -1
  29. package/dist/gatacaqr/{p-bceac8fa.js → p-2cd7b062.js} +1 -1
  30. package/dist/gatacaqr/p-64740141.entry.js +1 -0
  31. package/dist/gatacaqr/p-91a49030.entry.js +1 -0
  32. package/dist/types/components/gataca-qr/components/readQR/ReadQR.d.ts +13 -0
  33. package/dist/types/components/gataca-qr/components/readQR/components/AnimatedLoader.d.ts +2 -0
  34. package/dist/types/components/gataca-qr/components/retryButton/RetryButton.d.ts +0 -4
  35. package/dist/types/components/gataca-qr/gataca-qr.d.ts +6 -5
  36. package/dist/types/components/gataca-qrws/components/readQR/ReadQR.d.ts +13 -0
  37. package/dist/types/components/gataca-qrws/components/readQR/components/AnimatedLoader.d.ts +2 -0
  38. package/dist/types/components/gataca-qrws/components/retryButton/RetryButton.d.ts +0 -4
  39. package/dist/types/components/gataca-qrws/gataca-qrws.d.ts +6 -5
  40. package/dist/types/components.d.ts +24 -24
  41. package/dist/types/utils/utils.d.ts +1 -1
  42. package/package.json +1 -1
  43. package/dist/gatacaqr/p-5fe70d53.entry.js +0 -1
  44. package/dist/gatacaqr/p-8b58f3b3.entry.js +0 -1
@@ -55,6 +55,8 @@ table {
55
55
  border-spacing: 0;
56
56
  }
57
57
 
58
+ /* Sizes */
59
+ /* Trigonometry helpers */
58
60
  /*
59
61
  QR COMPONENT
60
62
  */
@@ -139,7 +141,7 @@ img {
139
141
  color: #707074;
140
142
  }
141
143
  .popUpContainer .modal-window .bold {
142
- font-weight: 600;
144
+ font-weight: 700;
143
145
  }
144
146
  .popUpContainer .modal-window .qrBrand {
145
147
  margin-top: 4px;
@@ -191,7 +193,7 @@ img {
191
193
  line-height: 24px;
192
194
  }
193
195
 
194
- .reload {
196
+ .reload, .blured {
195
197
  height: 252px;
196
198
  width: 252px;
197
199
  border: 1px dashed #a1a1a1;
@@ -273,4 +275,125 @@ img {
273
275
  line-height: 16px;
274
276
  color: #707074;
275
277
  text-align: center;
278
+ }
279
+
280
+ .containerLoader {
281
+ display: flex;
282
+ justify-content: center;
283
+ align-items: center;
284
+ width: 30px;
285
+ height: 30px;
286
+ margin-bottom: 12px;
287
+ }
288
+
289
+ .loader {
290
+ position: relative;
291
+ margin-left: 0 !important;
292
+ }
293
+ .loader__item {
294
+ position: absolute;
295
+ width: 9.68px;
296
+ height: 4px;
297
+ background: transparent;
298
+ border-radius: 2px;
299
+ }
300
+ .loader__item__1 {
301
+ transform: translate(2.5846212025px, 5.4246212025px) rotate(45deg);
302
+ -webkit-animation: translate(2.5846212025px, 5.4246212025px) rotate(45deg);
303
+ -moz-animation: translate(2.5846212025px, 5.4246212025px) rotate(45deg);
304
+ -o-animation: translate(2.5846212025px, 5.4246212025px) rotate(45deg);
305
+ animation: blink 0.8333333333s linear 0.1041666667s infinite;
306
+ -webkit-animation: blink 0.8333333333s linear 0.1041666667s infinite;
307
+ -moz-animation: blink 0.8333333333s linear 0.1041666667s infinite;
308
+ -o-animation: blink 0.8333333333s linear 0.1041666667s infinite;
309
+ }
310
+ .loader__item__2 {
311
+ transform: translate(-4.84px, 8.5px) rotate(90deg);
312
+ -webkit-animation: translate(-4.84px, 8.5px) rotate(90deg);
313
+ -moz-animation: translate(-4.84px, 8.5px) rotate(90deg);
314
+ -o-animation: translate(-4.84px, 8.5px) rotate(90deg);
315
+ animation: blink 0.8333333333s linear 0.2083333333s infinite;
316
+ -webkit-animation: blink 0.8333333333s linear 0.2083333333s infinite;
317
+ -moz-animation: blink 0.8333333333s linear 0.2083333333s infinite;
318
+ -o-animation: blink 0.8333333333s linear 0.2083333333s infinite;
319
+ }
320
+ .loader__item__3 {
321
+ transform: translate(-12.2646212025px, 5.4246212025px) rotate(135deg);
322
+ -webkit-animation: translate(-12.2646212025px, 5.4246212025px) rotate(135deg);
323
+ -moz-animation: translate(-12.2646212025px, 5.4246212025px) rotate(135deg);
324
+ -o-animation: translate(-12.2646212025px, 5.4246212025px) rotate(135deg);
325
+ animation: blink 0.8333333333s linear 0.3125s infinite;
326
+ -webkit-animation: blink 0.8333333333s linear 0.3125s infinite;
327
+ -moz-animation: blink 0.8333333333s linear 0.3125s infinite;
328
+ -o-animation: blink 0.8333333333s linear 0.3125s infinite;
329
+ }
330
+ .loader__item__4 {
331
+ transform: translate(-15.3399999992px, -1.9999999999px) rotate(180deg);
332
+ -webkit-animation: translate(-15.3399999992px, -1.9999999999px) rotate(180deg);
333
+ -moz-animation: translate(-15.3399999992px, -1.9999999999px) rotate(180deg);
334
+ -o-animation: translate(-15.3399999992px, -1.9999999999px) rotate(180deg);
335
+ animation: blink 0.8333333333s linear 0.4166666667s infinite;
336
+ -webkit-animation: blink 0.8333333333s linear 0.4166666667s infinite;
337
+ -moz-animation: blink 0.8333333333s linear 0.4166666667s infinite;
338
+ -o-animation: blink 0.8333333333s linear 0.4166666667s infinite;
339
+ }
340
+ .loader__item__5 {
341
+ transform: translate(-12.2646210959px, -9.4246211842px) rotate(225deg);
342
+ -webkit-animation: translate(-12.2646210959px, -9.4246211842px) rotate(225deg);
343
+ -moz-animation: translate(-12.2646210959px, -9.4246211842px) rotate(225deg);
344
+ -o-animation: translate(-12.2646210959px, -9.4246211842px) rotate(225deg);
345
+ animation: blink 0.8333333333s linear 0.5208333333s infinite;
346
+ -webkit-animation: blink 0.8333333333s linear 0.5208333333s infinite;
347
+ -moz-animation: blink 0.8333333333s linear 0.5208333333s infinite;
348
+ -o-animation: blink 0.8333333333s linear 0.5208333333s infinite;
349
+ }
350
+ .loader__item__6 {
351
+ transform: translate(-4.8399941857px, -12.499998805px) rotate(270deg);
352
+ -webkit-animation: translate(-4.8399941857px, -12.499998805px) rotate(270deg);
353
+ -moz-animation: translate(-4.8399941857px, -12.499998805px) rotate(270deg);
354
+ -o-animation: translate(-4.8399941857px, -12.499998805px) rotate(270deg);
355
+ animation: blink 0.8333333333s linear 0.625s infinite;
356
+ -webkit-animation: blink 0.8333333333s linear 0.625s infinite;
357
+ -moz-animation: blink 0.8333333333s linear 0.625s infinite;
358
+ -o-animation: blink 0.8333333333s linear 0.625s infinite;
359
+ }
360
+ .loader__item__7 {
361
+ transform: translate(2.5847915061px, -9.4245803212px) rotate(315deg);
362
+ -webkit-animation: translate(2.5847915061px, -9.4245803212px) rotate(315deg);
363
+ -moz-animation: translate(2.5847915061px, -9.4245803212px) rotate(315deg);
364
+ -o-animation: translate(2.5847915061px, -9.4245803212px) rotate(315deg);
365
+ animation: blink 0.8333333333s linear 0.7291666667s infinite;
366
+ -webkit-animation: blink 0.8333333333s linear 0.7291666667s infinite;
367
+ -moz-animation: blink 0.8333333333s linear 0.7291666667s infinite;
368
+ -o-animation: blink 0.8333333333s linear 0.7291666667s infinite;
369
+ }
370
+ .loader__item__8 {
371
+ transform: translate(5.6631628524px, -1.99913122px) rotate(360deg);
372
+ -webkit-animation: translate(5.6631628524px, -1.99913122px) rotate(360deg);
373
+ -moz-animation: translate(5.6631628524px, -1.99913122px) rotate(360deg);
374
+ -o-animation: translate(5.6631628524px, -1.99913122px) rotate(360deg);
375
+ animation: blink 0.8333333333s linear 0.8333333333s infinite;
376
+ -webkit-animation: blink 0.8333333333s linear 0.8333333333s infinite;
377
+ -moz-animation: blink 0.8333333333s linear 0.8333333333s infinite;
378
+ -o-animation: blink 0.8333333333s linear 0.8333333333s infinite;
379
+ }
380
+ .loader__item__8 {
381
+ max-width: 8.5px;
382
+ }
383
+
384
+ @keyframes blink {
385
+ 0% {
386
+ background: #4745B7;
387
+ }
388
+ 100% {
389
+ background: #CCCBF8;
390
+ }
391
+ }
392
+ @keyframes rotate {
393
+ 0% {
394
+ transform: rotate(0deg);
395
+ }
396
+ 100% {
397
+ background: rotate(360deg);
398
+ }
276
399
  }
@@ -4,6 +4,7 @@ import "../gataca-qrdisplay/gataca-qrdisplay";
4
4
  import { base64UrlEncode, checkMobile, RESULT_STATUS } from "../../utils/utils";
5
5
  import { Success } from "./components/success/Success";
6
6
  import { RetryButton } from "./components/retryButton/RetryButton";
7
+ import { ReadQR } from "./components/readQR/ReadQR";
7
8
  import { QR } from "./components/qr/QR";
8
9
  const DEEP_LINK_PREFIX = "https://gataca.page.link/?apn=com.gatacaapp&ibi=com.gataca.wallet&link=";
9
10
  //Default values
@@ -15,7 +16,7 @@ const FUNCTION_ROLES = {
15
16
  certify: "credential",
16
17
  };
17
18
  export class GatacaQR {
18
- constructor() { this.checkStatus = undefined; this.createSession = undefined; this.successCallback = undefined; this.errorCallback = undefined; this.qrRole = undefined; this.callbackServer = undefined; this.autostart = true; this.autorefresh = false; this.v2 = false; 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 = logoGataca; 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.readedQrLabel = "QR Code already scanned."; this.clickInsideBoxReadedQrLabel = "Click the box to refresh."; this.hideQrModalDescription = false; this.sessionTimeout = DEFAULT_SESSION_TIMEOUT; this.pollingFrequency = DEFAULT_POLLING_FREQ; this.dynamicLink = true; this.sessionId = undefined; this.authenticationRequest = undefined; this.sessionData = undefined; this.result = RESULT_STATUS.NOT_STARTED; }
19
+ constructor() { this.checkStatus = undefined; this.createSession = undefined; this.successCallback = undefined; this.errorCallback = undefined; this.qrRole = undefined; this.callbackServer = undefined; this.autostart = true; this.autorefresh = false; this.v2 = false; 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 = logoGataca; 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.sessionTimeout = DEFAULT_SESSION_TIMEOUT; this.pollingFrequency = DEFAULT_POLLING_FREQ; this.dynamicLink = true; this.sessionId = undefined; this.authenticationRequest = undefined; this.sessionData = undefined; this.result = RESULT_STATUS.NOT_STARTED; }
19
20
  disconnectedCallback() {
20
21
  this.stop();
21
22
  }
@@ -63,7 +64,7 @@ export class GatacaQR {
63
64
  */
64
65
  async stop() {
65
66
  this.clean();
66
- if (this.result === RESULT_STATUS.ONGOING) {
67
+ if (this.result === RESULT_STATUS.ONGOING || RESULT_STATUS.READ) {
67
68
  this.result = RESULT_STATUS.NOT_STARTED;
68
69
  }
69
70
  }
@@ -123,6 +124,7 @@ export class GatacaQR {
123
124
  resolve(data);
124
125
  break;
125
126
  case RESULT_STATUS.ONGOING:
127
+ case RESULT_STATUS.READ:
126
128
  if (component.sessionTimeout > 0 && new Date().getTime() < endTime) {
127
129
  setTimeout(checkCondition, interval, resolve, reject);
128
130
  }
@@ -149,18 +151,21 @@ export class GatacaQR {
149
151
  return this.renderRetryButton(this.credentialsNotValidatedLabel);
150
152
  case RESULT_STATUS.SUCCESS:
151
153
  return this.renderSuccess();
152
- case RESULT_STATUS.READED:
153
- return this.renderRetryButton(null, {
154
- title: this === null || this === void 0 ? void 0 : this.readedQrLabel,
155
- description: this === null || this === void 0 ? void 0 : this.clickInsideBoxReadedQrLabel,
154
+ case RESULT_STATUS.READ:
155
+ return this.renderReadQR({
156
+ title: this === null || this === void 0 ? void 0 : this.readQrTitle,
157
+ description: this === null || this === void 0 ? void 0 : this.readQrDescription,
156
158
  });
157
159
  }
158
160
  }
159
161
  renderSuccess() {
160
162
  return (h(Success, { modalHeight: this === null || this === void 0 ? void 0 : this.modalHeight, successLoginLabel: this === null || this === void 0 ? void 0 : this.successLoginLabel }));
161
163
  }
162
- renderRetryButton(errorMessage, readedQrMessages) {
163
- return (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), readedQrMessages: readedQrMessages }));
164
+ renderRetryButton(errorMessage) {
165
+ return (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) }));
166
+ }
167
+ renderReadQR(readQrMessages) {
168
+ return (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) }));
164
169
  }
165
170
  renderQR(value, useLogo) {
166
171
  return (h(QR, { value: value, useLogo: useLogo, size: (this === null || this === void 0 ? void 0 : this.qrSize) || undefined, logoSrc: this === null || this === void 0 ? void 0 : this.logoSrc }));
@@ -762,7 +767,7 @@ export class GatacaQR {
762
767
  "reflect": false,
763
768
  "defaultValue": "\"waiting to start a session\""
764
769
  },
765
- "readedQrLabel": {
770
+ "readQrTitle": {
766
771
  "type": "string",
767
772
  "mutable": false,
768
773
  "complexType": {
@@ -774,13 +779,13 @@ export class GatacaQR {
774
779
  "optional": true,
775
780
  "docs": {
776
781
  "tags": [],
777
- "text": "_[Optional]_\nString to show when QR already read"
782
+ "text": "_[Optional]_\nString title to show when QR already read"
778
783
  },
779
- "attribute": "readed-qr-label",
784
+ "attribute": "read-qr-title",
780
785
  "reflect": false,
781
- "defaultValue": "\"QR Code already scanned.\""
786
+ "defaultValue": "\"Processing...\""
782
787
  },
783
- "clickInsideBoxReadedQrLabel": {
788
+ "readQrDescription": {
784
789
  "type": "string",
785
790
  "mutable": false,
786
791
  "complexType": {
@@ -792,11 +797,11 @@ export class GatacaQR {
792
797
  "optional": true,
793
798
  "docs": {
794
799
  "tags": [],
795
- "text": "_[Optional]_\nString to show \"click inside\" label for QR already read"
800
+ "text": "_[Optional]_\nString description to show when QR already read"
796
801
  },
797
- "attribute": "click-inside-box-readed-qr-label",
802
+ "attribute": "read-qr-description",
798
803
  "reflect": false,
799
- "defaultValue": "\"Click the box to refresh.\""
804
+ "defaultValue": "\"Please wait a moment\""
800
805
  },
801
806
  "hideQrModalDescription": {
802
807
  "type": "boolean",
@@ -0,0 +1,11 @@
1
+ import { h } from "@stencil/core";
2
+ import { AnimatedLoader } from "./components/AnimatedLoader";
3
+ export const ReadQR = (props) => {
4
+ var _a;
5
+ const { modalWidth, readQrMessages, renderQR, url, sizeQR } = props;
6
+ return (h("div", { class: "blured", style: {
7
+ width: (modalWidth - 48).toString() + "px",
8
+ height: modalWidth ? ((_a = (modalWidth - 48)) === null || _a === void 0 ? void 0 : _a.toString()) + "px" : "",
9
+ } }, h("div", { id: "notify" }, h(AnimatedLoader, null), h("p", { class: "notify-text" }, readQrMessages === null || readQrMessages === void 0 ? void 0 :
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
+ };
@@ -0,0 +1,4 @@
1
+ import { h } from "@stencil/core";
2
+ export const AnimatedLoader = () => {
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
+ };
@@ -3,12 +3,11 @@ import refreshIcon from "../../../../assets/icons/gat-icon-refresh.svg";
3
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, readedQrMessages, } = props;
6
+ const { errorMessage, modalWidth, clickInsideBoxLabel, refreshQrLabel, scanQrLabel, waitingStartSessionLabel, display, renderRetryQR, } = props;
7
7
  return (h("div", { class: "reload", style: {
8
8
  width: (modalWidth - 48).toString() + "px",
9
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 }), readedQrMessages ? (h("p", { class: "notify-text" }, readedQrMessages === null || readedQrMessages === void 0 ? void 0 :
11
- readedQrMessages.title, " ")) : (h("p", { class: "notify-text" }, clickInsideBoxLabel, " ")), errorMessage ? (h("p", { class: "notify-text bold" }, refreshQrLabel)) : readedQrMessages ? (h("p", { class: "notify-text bold" }, readedQrMessages === null || readedQrMessages === void 0 ? void 0 : readedQrMessages.description)) : (h("p", { class: "notify-text bold" }, scanQrLabel)), errorMessage && (h("div", { class: "alert", style: {
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: {
12
11
  width: (modalWidth - 48).toString() + "px",
13
12
  } }, h("img", { src: alertIcon, height: 24, width: 24 }), h("p", null, errorMessage)))), h("div", { id: "qrwait" }, renderRetryQR(waitingStartSessionLabel))));
14
13
  };
@@ -55,6 +55,8 @@ table {
55
55
  border-spacing: 0;
56
56
  }
57
57
 
58
+ /* Sizes */
59
+ /* Trigonometry helpers */
58
60
  /*
59
61
  QR COMPONENT
60
62
  */
@@ -139,7 +141,7 @@ img {
139
141
  color: #707074;
140
142
  }
141
143
  .popUpContainer .modal-window .bold {
142
- font-weight: 600;
144
+ font-weight: 700;
143
145
  }
144
146
  .popUpContainer .modal-window .qrBrand {
145
147
  margin-top: 4px;
@@ -191,7 +193,8 @@ img {
191
193
  line-height: 24px;
192
194
  }
193
195
 
194
- .reload {
196
+ .reload,
197
+ .blured {
195
198
  height: 252px;
196
199
  width: 252px;
197
200
  border: 1px dashed #a1a1a1;
@@ -273,4 +276,125 @@ img {
273
276
  line-height: 16px;
274
277
  color: #707074;
275
278
  text-align: center;
279
+ }
280
+
281
+ .containerLoader {
282
+ display: flex;
283
+ justify-content: center;
284
+ align-items: center;
285
+ width: 30px;
286
+ height: 30px;
287
+ margin-bottom: 12px;
288
+ }
289
+
290
+ .loader {
291
+ position: relative;
292
+ margin-left: 0 !important;
293
+ }
294
+ .loader__item {
295
+ position: absolute;
296
+ width: 9.68px;
297
+ height: 4px;
298
+ background: transparent;
299
+ border-radius: 2px;
300
+ }
301
+ .loader__item__1 {
302
+ transform: translate(2.5846212025px, 5.4246212025px) rotate(45deg);
303
+ -webkit-animation: translate(2.5846212025px, 5.4246212025px) rotate(45deg);
304
+ -moz-animation: translate(2.5846212025px, 5.4246212025px) rotate(45deg);
305
+ -o-animation: translate(2.5846212025px, 5.4246212025px) rotate(45deg);
306
+ animation: blink 0.8333333333s linear 0.1041666667s infinite;
307
+ -webkit-animation: blink 0.8333333333s linear 0.1041666667s infinite;
308
+ -moz-animation: blink 0.8333333333s linear 0.1041666667s infinite;
309
+ -o-animation: blink 0.8333333333s linear 0.1041666667s infinite;
310
+ }
311
+ .loader__item__2 {
312
+ transform: translate(-4.84px, 8.5px) rotate(90deg);
313
+ -webkit-animation: translate(-4.84px, 8.5px) rotate(90deg);
314
+ -moz-animation: translate(-4.84px, 8.5px) rotate(90deg);
315
+ -o-animation: translate(-4.84px, 8.5px) rotate(90deg);
316
+ animation: blink 0.8333333333s linear 0.2083333333s infinite;
317
+ -webkit-animation: blink 0.8333333333s linear 0.2083333333s infinite;
318
+ -moz-animation: blink 0.8333333333s linear 0.2083333333s infinite;
319
+ -o-animation: blink 0.8333333333s linear 0.2083333333s infinite;
320
+ }
321
+ .loader__item__3 {
322
+ transform: translate(-12.2646212025px, 5.4246212025px) rotate(135deg);
323
+ -webkit-animation: translate(-12.2646212025px, 5.4246212025px) rotate(135deg);
324
+ -moz-animation: translate(-12.2646212025px, 5.4246212025px) rotate(135deg);
325
+ -o-animation: translate(-12.2646212025px, 5.4246212025px) rotate(135deg);
326
+ animation: blink 0.8333333333s linear 0.3125s infinite;
327
+ -webkit-animation: blink 0.8333333333s linear 0.3125s infinite;
328
+ -moz-animation: blink 0.8333333333s linear 0.3125s infinite;
329
+ -o-animation: blink 0.8333333333s linear 0.3125s infinite;
330
+ }
331
+ .loader__item__4 {
332
+ transform: translate(-15.3399999992px, -1.9999999999px) rotate(180deg);
333
+ -webkit-animation: translate(-15.3399999992px, -1.9999999999px) rotate(180deg);
334
+ -moz-animation: translate(-15.3399999992px, -1.9999999999px) rotate(180deg);
335
+ -o-animation: translate(-15.3399999992px, -1.9999999999px) rotate(180deg);
336
+ animation: blink 0.8333333333s linear 0.4166666667s infinite;
337
+ -webkit-animation: blink 0.8333333333s linear 0.4166666667s infinite;
338
+ -moz-animation: blink 0.8333333333s linear 0.4166666667s infinite;
339
+ -o-animation: blink 0.8333333333s linear 0.4166666667s infinite;
340
+ }
341
+ .loader__item__5 {
342
+ transform: translate(-12.2646210959px, -9.4246211842px) rotate(225deg);
343
+ -webkit-animation: translate(-12.2646210959px, -9.4246211842px) rotate(225deg);
344
+ -moz-animation: translate(-12.2646210959px, -9.4246211842px) rotate(225deg);
345
+ -o-animation: translate(-12.2646210959px, -9.4246211842px) rotate(225deg);
346
+ animation: blink 0.8333333333s linear 0.5208333333s infinite;
347
+ -webkit-animation: blink 0.8333333333s linear 0.5208333333s infinite;
348
+ -moz-animation: blink 0.8333333333s linear 0.5208333333s infinite;
349
+ -o-animation: blink 0.8333333333s linear 0.5208333333s infinite;
350
+ }
351
+ .loader__item__6 {
352
+ transform: translate(-4.8399941857px, -12.499998805px) rotate(270deg);
353
+ -webkit-animation: translate(-4.8399941857px, -12.499998805px) rotate(270deg);
354
+ -moz-animation: translate(-4.8399941857px, -12.499998805px) rotate(270deg);
355
+ -o-animation: translate(-4.8399941857px, -12.499998805px) rotate(270deg);
356
+ animation: blink 0.8333333333s linear 0.625s infinite;
357
+ -webkit-animation: blink 0.8333333333s linear 0.625s infinite;
358
+ -moz-animation: blink 0.8333333333s linear 0.625s infinite;
359
+ -o-animation: blink 0.8333333333s linear 0.625s infinite;
360
+ }
361
+ .loader__item__7 {
362
+ transform: translate(2.5847915061px, -9.4245803212px) rotate(315deg);
363
+ -webkit-animation: translate(2.5847915061px, -9.4245803212px) rotate(315deg);
364
+ -moz-animation: translate(2.5847915061px, -9.4245803212px) rotate(315deg);
365
+ -o-animation: translate(2.5847915061px, -9.4245803212px) rotate(315deg);
366
+ animation: blink 0.8333333333s linear 0.7291666667s infinite;
367
+ -webkit-animation: blink 0.8333333333s linear 0.7291666667s infinite;
368
+ -moz-animation: blink 0.8333333333s linear 0.7291666667s infinite;
369
+ -o-animation: blink 0.8333333333s linear 0.7291666667s infinite;
370
+ }
371
+ .loader__item__8 {
372
+ transform: translate(5.6631628524px, -1.99913122px) rotate(360deg);
373
+ -webkit-animation: translate(5.6631628524px, -1.99913122px) rotate(360deg);
374
+ -moz-animation: translate(5.6631628524px, -1.99913122px) rotate(360deg);
375
+ -o-animation: translate(5.6631628524px, -1.99913122px) rotate(360deg);
376
+ animation: blink 0.8333333333s linear 0.8333333333s infinite;
377
+ -webkit-animation: blink 0.8333333333s linear 0.8333333333s infinite;
378
+ -moz-animation: blink 0.8333333333s linear 0.8333333333s infinite;
379
+ -o-animation: blink 0.8333333333s linear 0.8333333333s infinite;
380
+ }
381
+ .loader__item__8 {
382
+ max-width: 8.5px;
383
+ }
384
+
385
+ @keyframes blink {
386
+ 0% {
387
+ background: #4745B7;
388
+ }
389
+ 100% {
390
+ background: #CCCBF8;
391
+ }
392
+ }
393
+ @keyframes rotate {
394
+ 0% {
395
+ transform: rotate(0deg);
396
+ }
397
+ 100% {
398
+ background: rotate(360deg);
399
+ }
276
400
  }
@@ -5,6 +5,7 @@ import { base64UrlEncode, checkMobile, RESULT_STATUS, } from "../../utils/utils"
5
5
  import { Success } from "./components/success/Success";
6
6
  import { RetryButton } from "./components/retryButton/RetryButton";
7
7
  import { QR } from "./components/qr/QR";
8
+ import { ReadQR } from "./components/readQR/ReadQR";
8
9
  const DEEP_LINK_PREFIX = "https://gataca.page.link/?apn=com.gatacaapp&ibi=com.gataca.wallet&link=";
9
10
  const DEFAULT_SESSION_TIMEOUT = 300;
10
11
  const QR_ROLE_CONNECT = "connect";
@@ -13,7 +14,7 @@ const FUNCTION_ROLES = {
13
14
  certify: "credential",
14
15
  };
15
16
  export class GatacaQRWS {
16
- constructor() { this.successCallback = undefined; this.errorCallback = undefined; this.qrRole = undefined; this.callbackServer = undefined; this.socketEndpoint = undefined; this.sessionTimeout = DEFAULT_SESSION_TIMEOUT; this.wsOnOpen = undefined; this.wsOnMessage = undefined; this.autostart = true; this.autorefresh = false; this.v2 = false; 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 = logoGataca; 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.readedQrLabel = "QR Code already scanned."; this.clickInsideBoxReadedQrLabel = "Click the box to refresh."; this.hideQrModalDescription = false; this.dynamicLink = true; this.sessionId = undefined; this.authenticationRequest = undefined; this.sessionData = undefined; this.result = RESULT_STATUS.NOT_STARTED; }
17
+ constructor() { this.successCallback = undefined; this.errorCallback = undefined; this.qrRole = undefined; this.callbackServer = undefined; this.socketEndpoint = undefined; this.sessionTimeout = DEFAULT_SESSION_TIMEOUT; this.wsOnOpen = undefined; this.wsOnMessage = undefined; this.autostart = true; this.autorefresh = false; this.v2 = false; 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 = logoGataca; 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 = RESULT_STATUS.NOT_STARTED; }
17
18
  disconnectedCallback() {
18
19
  this.stop();
19
20
  }
@@ -54,7 +55,7 @@ export class GatacaQRWS {
54
55
  socket.close(1000, "");
55
56
  };
56
57
  socket.onclose = () => {
57
- if (this.result === RESULT_STATUS.ONGOING) {
58
+ if (this.result === RESULT_STATUS.ONGOING || RESULT_STATUS.READ) {
58
59
  this.result = RESULT_STATUS.EXPIRED;
59
60
  }
60
61
  if (this.result === RESULT_STATUS.EXPIRED) {
@@ -80,6 +81,7 @@ export class GatacaQRWS {
80
81
  this.result = wsresp.result;
81
82
  switch (wsresp.result) {
82
83
  case RESULT_STATUS.ONGOING:
84
+ case RESULT_STATUS.READ:
83
85
  this.sessionId = wsresp.sessionId;
84
86
  this.authenticationRequest = wsresp.authenticationRequest;
85
87
  break;
@@ -150,18 +152,21 @@ export class GatacaQRWS {
150
152
  return this.renderRetryButton(this.credentialsNotValidatedLabel);
151
153
  case RESULT_STATUS.SUCCESS:
152
154
  return this.renderSuccess();
153
- case RESULT_STATUS.READED:
154
- return this.renderRetryButton(null, {
155
- title: this === null || this === void 0 ? void 0 : this.readedQrLabel,
156
- description: this === null || this === void 0 ? void 0 : this.clickInsideBoxReadedQrLabel,
155
+ case RESULT_STATUS.READ:
156
+ return this.renderReadQR({
157
+ title: this === null || this === void 0 ? void 0 : this.readQrTitle,
158
+ description: this === null || this === void 0 ? void 0 : this.readQrDescription,
157
159
  });
158
160
  }
159
161
  }
160
162
  renderSuccess() {
161
163
  return (h(Success, { modalHeight: this === null || this === void 0 ? void 0 : this.modalHeight, successLoginLabel: this === null || this === void 0 ? void 0 : this.successLoginLabel }));
162
164
  }
163
- renderRetryButton(errorMessage, readedQrMessages) {
164
- return (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), readedQrMessages: readedQrMessages }));
165
+ renderRetryButton(errorMessage) {
166
+ return (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) }));
167
+ }
168
+ renderReadQR(readQrMessages) {
169
+ return (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) }));
165
170
  }
166
171
  renderQR(value, useLogo) {
167
172
  return (h(QR, { value: value, useLogo: useLogo, size: (this === null || this === void 0 ? void 0 : this.qrSize) || undefined, logoSrc: this === null || this === void 0 ? void 0 : this.logoSrc }));
@@ -795,7 +800,7 @@ export class GatacaQRWS {
795
800
  "reflect": false,
796
801
  "defaultValue": "\"waiting to start a session\""
797
802
  },
798
- "readedQrLabel": {
803
+ "readQrTitle": {
799
804
  "type": "string",
800
805
  "mutable": false,
801
806
  "complexType": {
@@ -807,13 +812,13 @@ export class GatacaQRWS {
807
812
  "optional": true,
808
813
  "docs": {
809
814
  "tags": [],
810
- "text": "_[Optional]_\nString to show when QR already read"
815
+ "text": "_[Optional]_\nString title to show when QR already read"
811
816
  },
812
- "attribute": "readed-qr-label",
817
+ "attribute": "read-qr-title",
813
818
  "reflect": false,
814
- "defaultValue": "\"QR Code already scanned.\""
819
+ "defaultValue": "\"Processing...\""
815
820
  },
816
- "clickInsideBoxReadedQrLabel": {
821
+ "readQrDescription": {
817
822
  "type": "string",
818
823
  "mutable": false,
819
824
  "complexType": {
@@ -825,11 +830,11 @@ export class GatacaQRWS {
825
830
  "optional": true,
826
831
  "docs": {
827
832
  "tags": [],
828
- "text": "_[Optional]_\nString to show \"click inside\" label for QR already read"
833
+ "text": "_[Optional]_\nString description to show when QR already read"
829
834
  },
830
- "attribute": "click-inside-box-readed-qr-label",
835
+ "attribute": "read-qr-description",
831
836
  "reflect": false,
832
- "defaultValue": "\"Click the box to refresh.\""
837
+ "defaultValue": "\"Please wait a moment\""
833
838
  },
834
839
  "hideQrModalDescription": {
835
840
  "type": "boolean",
@@ -18,5 +18,5 @@ export var RESULT_STATUS;
18
18
  RESULT_STATUS[RESULT_STATUS["SUCCESS"] = 1] = "SUCCESS";
19
19
  RESULT_STATUS[RESULT_STATUS["FAILED"] = 2] = "FAILED";
20
20
  RESULT_STATUS[RESULT_STATUS["EXPIRED"] = 3] = "EXPIRED";
21
- RESULT_STATUS[RESULT_STATUS["READED"] = 5] = "READED";
21
+ RESULT_STATUS[RESULT_STATUS["READ"] = 5] = "READ";
22
22
  })(RESULT_STATUS || (RESULT_STATUS = {}));
@@ -18,7 +18,7 @@ var RESULT_STATUS;
18
18
  RESULT_STATUS[RESULT_STATUS["SUCCESS"] = 1] = "SUCCESS";
19
19
  RESULT_STATUS[RESULT_STATUS["FAILED"] = 2] = "FAILED";
20
20
  RESULT_STATUS[RESULT_STATUS["EXPIRED"] = 3] = "EXPIRED";
21
- RESULT_STATUS[RESULT_STATUS["READED"] = 5] = "READED";
21
+ RESULT_STATUS[RESULT_STATUS["READ"] = 5] = "READ";
22
22
  })(RESULT_STATUS || (RESULT_STATUS = {}));
23
23
 
24
24
  const gatIconCheckSvg = 'data:image/svg+xml;base64,Cjxzdmcgd2lkdGg9IjUyIiBoZWlnaHQ9IjUzIiB2aWV3Qm94PSIwIDAgNTIgNTMiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxjaXJjbGUgY3g9IjI2IiBjeT0iMjYuNjcxOSIgcj0iMjYiIGZpbGw9IiMzRDlBNTAiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zOC41MiAxNy43NDk1QzM5LjU4MDUgMTguODA5OSAzOS41ODA1IDIwLjUyOTMgMzguNTIgMjEuNTg5OEwyMy41ODQ2IDM2LjUyNTFDMjIuNTI0MiAzNy41ODU2IDIwLjgwNDggMzcuNTg1NiAxOS43NDQzIDM2LjUyNTFMMTIuOTU1NSAyOS43MzYzQzExLjg5NSAyOC42NzU5IDExLjg5NSAyNi45NTY1IDEyLjk1NTUgMjUuODk2QzE0LjAxNiAyNC44MzU1IDE1LjczNTQgMjQuODM1NSAxNi43OTU4IDI1Ljg5NkwyMS42NjQ1IDMwLjc2NDdMMzQuNjc5NyAxNy43NDk1QzM1Ljc0MDIgMTYuNjg5IDM3LjQ1OTUgMTYuNjg5IDM4LjUyIDE3Ljc0OTVaIiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K';