@gataca/qr 2.0.1 → 2.0.3

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 (29) hide show
  1. package/dist/cjs/gataca-autoqr_6.cjs.entry.js +32 -18
  2. package/dist/cjs/gatacaqr.cjs.js +2 -2
  3. package/dist/cjs/{index-0b7a1532.js → index-4be0cdca.js} +25 -0
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/collection/assets/images/logo_gataca.svg +1 -1
  6. package/dist/collection/components/gataca-autoqr/gataca-autoqr.js +0 -2
  7. package/dist/collection/components/gataca-qr/gataca-qr.css +19 -9
  8. package/dist/collection/components/gataca-qr/gataca-qr.js +281 -10
  9. package/dist/collection/components/gataca-qrdisplay/gataca-qrdisplay.js +2 -2
  10. package/dist/collection/components/gataca-qrws/gataca-qrws.css +2 -2
  11. package/dist/collection/components/gataca-ssibutton/gataca-ssibutton.js +285 -1
  12. package/dist/components/gataca-autoqr.js +0 -2
  13. package/dist/components/gataca-qr2.js +27 -11
  14. package/dist/components/gataca-qrdisplay2.js +2 -2
  15. package/dist/components/gataca-qrws2.js +1 -1
  16. package/dist/components/gataca-ssibutton2.js +31 -1
  17. package/dist/esm/gataca-autoqr_6.entry.js +32 -18
  18. package/dist/esm/gatacaqr.js +2 -2
  19. package/dist/esm/{index-19eef502.js → index-80311733.js} +25 -0
  20. package/dist/esm/loader.js +2 -2
  21. package/dist/gatacaqr/gatacaqr.esm.js +1 -1
  22. package/dist/gatacaqr/p-a5648391.js +2 -0
  23. package/dist/gatacaqr/p-b37057bb.entry.js +1 -0
  24. package/dist/types/components/gataca-qr/gataca-qr.d.ts +75 -0
  25. package/dist/types/components/gataca-ssibutton/gataca-ssibutton.d.ts +75 -0
  26. package/dist/types/components.d.ts +240 -0
  27. package/package.json +1 -1
  28. package/dist/gatacaqr/p-4807b345.entry.js +0 -1
  29. package/dist/gatacaqr/p-a6f85341.js +0 -2
@@ -15,7 +15,7 @@ const FUNCTION_ROLES = {
15
15
  certify: "credential",
16
16
  };
17
17
  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.qrModalDescription = "Sign up or sign in by scanning the QR Code with the Gataca Wallet"; this.hideBrandTitle = 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; }
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.hideBrandTitle = false; this.logoSize = 0; this.logoSrc = logoGataca; 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.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
19
  disconnectedCallback() {
20
20
  this.stop();
21
21
  }
@@ -46,8 +46,8 @@ export class GatacaQR {
46
46
  else {
47
47
  if (err !== RESULT_STATUS.NOT_STARTED) {
48
48
  let error = expired
49
- ? new Error("User did not scan the QR in the alloted time")
50
- : new Error("Provided user credentials couldn't be validated");
49
+ ? new Error(this.userNotScanInTimeErrorLabel)
50
+ : new Error(this.credsNotValidatedErrorLabel);
51
51
  this.result = err;
52
52
  this.gatacaLoginFailed.emit(error);
53
53
  this.errorCallback(error);
@@ -77,7 +77,7 @@ export class GatacaQR {
77
77
  async getSessionData() {
78
78
  return this.sessionData
79
79
  ? Promise.resolve(this.sessionData)
80
- : Promise.reject(new Error("No successful login"));
80
+ : Promise.reject(new Error(this.failedLoginErrorLabel));
81
81
  }
82
82
  async getSessionId() {
83
83
  if (this.sessionId) {
@@ -144,26 +144,27 @@ export class GatacaQR {
144
144
  case RESULT_STATUS.ONGOING:
145
145
  return this.renderQR(this.getLink(), 300, true);
146
146
  case RESULT_STATUS.EXPIRED:
147
- return this.renderRetryButton("QR Code expired");
147
+ return this.renderRetryButton(this.qrCodeExpiredLabel);
148
148
  case RESULT_STATUS.FAILED:
149
- return this.renderRetryButton("User credentials not validated");
149
+ return this.renderRetryButton(this.credentialsNotValidatedLabel);
150
150
  case RESULT_STATUS.SUCCESS:
151
151
  return this.renderSuccess();
152
152
  }
153
153
  }
154
154
  renderSuccess() {
155
- return (h("div", { class: "success" }, h("img", { src: successIcon, height: 52, width: 52 }), h("p", { class: "successMsg" }, "Successful Connection!")));
155
+ return (h("div", { class: "success" }, h("img", { src: successIcon, height: 52, width: 52 }), h("p", { class: "successMsg" }, this.successLoginLabel)));
156
156
  }
157
157
  renderRetryButton(errorMessage) {
158
- return (h("div", { class: "reload" }, h("div", { id: "notify", onClick: () => this.display() }, h("img", { src: refreshIcon, height: 24, width: 24 }), h("p", { class: "qrDescription" }, "Click inside the box to "), errorMessage ? (h("p", { class: "qrDescription bold" }, "Refresh QR Code")) : (h("p", { class: "qrDescription bold" }, "Scan QR Code")), errorMessage && (h("div", { class: "alert" }, h("img", { src: alertIcon, height: 24, width: 24 }), h("p", null, errorMessage)))), h("div", { id: "qrwait" }, this.renderQR("waiting to start a session", 250))));
158
+ return (h("div", { class: "reload" }, h("div", { id: "notify", onClick: () => this.display() }, h("img", { src: refreshIcon, height: 24, width: 24 }), h("p", { class: "qrDescription" }, this.clickInsideBoxLabel, " "), errorMessage ? (h("p", { class: "qrDescription bold" }, this.refreshQrLabel)) : (h("p", { class: "qrDescription bold" }, this.scanQrLabel, "e")), errorMessage && (h("div", { class: "alert" }, h("img", { src: alertIcon, height: 24, width: 24 }), h("p", null, errorMessage)))), h("div", { id: "qrwait" }, this.renderQR(this.waitingStartSessionLabel, 250))));
159
159
  }
160
160
  renderQR(value, size, useLogo) {
161
- return (h("gataca-qrdisplay", { qrData: value, rounded: true, size: size, "logo-size": useLogo ? 0.33 : 0 }));
161
+ return (h("gataca-qrdisplay", { qrData: value, rounded: true, size: size, "logo-size": useLogo ? 0.33 : 0, "logo-src": this.logoSrc }));
162
162
  }
163
163
  render() {
164
164
  return (h("div", { class: "popUpContainer" }, h("div", { class: "modal-window is-visible", onClick: (event) => {
165
165
  event.stopPropagation();
166
- } }, h("div", { class: "modal-window__content" }, h("div", { class: "qrTitleContainer" }, h("p", { class: "qrTitle" }, this.qrModalTitle), !this.hideBrandTitle && (h("p", { class: "qrBrand" }, "by Gataca", " ", h("span", null, h("img", { src: logoGataca })))), this.result !== RESULT_STATUS.SUCCESS && (h("p", { class: "qrDescription" }, this.qrModalDescription))), h("div", { class: "qrSection" }, this.renderQRSection())))));
166
+ } }, h("div", { class: "modal-window__content" }, h("div", { class: "qrTitleContainer" }, h("p", { class: "qrTitle", style: { color: this.modalTitleColor || "#1e1e20" } }, this.qrModalTitle), !this.hideBrandTitle && (h("p", { class: "qrBrand" }, this.byBrandLabel, " ", h("span", null, h("img", { src: logoGataca })))), this.result !== RESULT_STATUS.SUCCESS &&
167
+ !this.hideQrModalDescription && (h("p", { class: "qrDescription" }, this.qrModalDescription))), h("div", { class: "qrSection" }, this.renderQRSection())))));
167
168
  }
168
169
  static get is() { return "gataca-qr"; }
169
170
  static get encapsulation() { return "shadow"; }
@@ -365,6 +366,24 @@ export class GatacaQR {
365
366
  "reflect": false,
366
367
  "defaultValue": "\"Quick Access\""
367
368
  },
369
+ "modalTitleColor": {
370
+ "type": "string",
371
+ "mutable": false,
372
+ "complexType": {
373
+ "original": "string",
374
+ "resolved": "string",
375
+ "references": {}
376
+ },
377
+ "required": false,
378
+ "optional": true,
379
+ "docs": {
380
+ "tags": [],
381
+ "text": "_[Optional]_\nString to set Modal title color"
382
+ },
383
+ "attribute": "modal-title-color",
384
+ "reflect": false,
385
+ "defaultValue": "\"#4745B7\""
386
+ },
368
387
  "qrModalDescription": {
369
388
  "type": "string",
370
389
  "mutable": false,
@@ -401,6 +420,258 @@ export class GatacaQR {
401
420
  "reflect": false,
402
421
  "defaultValue": "false"
403
422
  },
423
+ "logoSize": {
424
+ "type": "number",
425
+ "mutable": false,
426
+ "complexType": {
427
+ "original": "number",
428
+ "resolved": "number",
429
+ "references": {}
430
+ },
431
+ "required": false,
432
+ "optional": true,
433
+ "docs": {
434
+ "tags": [],
435
+ "text": "_[Optional]_\nSize of the logo to display in percentage to the total size [0-1]. 0 means no logo will be displayed. Default is the GATACA logo. Recommended size is around 0.33"
436
+ },
437
+ "attribute": "logo-size",
438
+ "reflect": false,
439
+ "defaultValue": "0"
440
+ },
441
+ "logoSrc": {
442
+ "type": "string",
443
+ "mutable": false,
444
+ "complexType": {
445
+ "original": "string",
446
+ "resolved": "string",
447
+ "references": {}
448
+ },
449
+ "required": false,
450
+ "optional": true,
451
+ "docs": {
452
+ "tags": [],
453
+ "text": "_[Optional]_\nLogo to display, just if the logo size is greater than 0. No logo is the GATACA logo."
454
+ },
455
+ "attribute": "logo-src",
456
+ "reflect": false,
457
+ "defaultValue": "logoGataca"
458
+ },
459
+ "qrCodeExpiredLabel": {
460
+ "type": "string",
461
+ "mutable": false,
462
+ "complexType": {
463
+ "original": "string",
464
+ "resolved": "string",
465
+ "references": {}
466
+ },
467
+ "required": false,
468
+ "optional": true,
469
+ "docs": {
470
+ "tags": [],
471
+ "text": "_[Optional]_\nString to show when qr code expired"
472
+ },
473
+ "attribute": "qr-code-expired-label",
474
+ "reflect": false,
475
+ "defaultValue": "\"QR Code expired\""
476
+ },
477
+ "credentialsNotValidatedLabel": {
478
+ "type": "string",
479
+ "mutable": false,
480
+ "complexType": {
481
+ "original": "string",
482
+ "resolved": "string",
483
+ "references": {}
484
+ },
485
+ "required": false,
486
+ "optional": true,
487
+ "docs": {
488
+ "tags": [],
489
+ "text": "_[Optional]_\nString to show when credentials not validatedd"
490
+ },
491
+ "attribute": "credentials-not-validated-label",
492
+ "reflect": false,
493
+ "defaultValue": "\"User credentials not validated\""
494
+ },
495
+ "clickInsideBoxLabel": {
496
+ "type": "string",
497
+ "mutable": false,
498
+ "complexType": {
499
+ "original": "string",
500
+ "resolved": "string",
501
+ "references": {}
502
+ },
503
+ "required": false,
504
+ "optional": true,
505
+ "docs": {
506
+ "tags": [],
507
+ "text": "_[Optional]_\nString to show \"click inside\" label"
508
+ },
509
+ "attribute": "click-inside-box-label",
510
+ "reflect": false,
511
+ "defaultValue": "\"Click inside the box to\""
512
+ },
513
+ "refreshQrLabel": {
514
+ "type": "string",
515
+ "mutable": false,
516
+ "complexType": {
517
+ "original": "string",
518
+ "resolved": "string",
519
+ "references": {}
520
+ },
521
+ "required": false,
522
+ "optional": true,
523
+ "docs": {
524
+ "tags": [],
525
+ "text": "_[Optional]_\nString to show \"refresh QR\" label"
526
+ },
527
+ "attribute": "refresh-qr-label",
528
+ "reflect": false,
529
+ "defaultValue": "\"Refresh QR Code\""
530
+ },
531
+ "scanQrLabel": {
532
+ "type": "string",
533
+ "mutable": false,
534
+ "complexType": {
535
+ "original": "string",
536
+ "resolved": "string",
537
+ "references": {}
538
+ },
539
+ "required": false,
540
+ "optional": true,
541
+ "docs": {
542
+ "tags": [],
543
+ "text": "_[Optional]_\nString to show \"scan QR\" label"
544
+ },
545
+ "attribute": "scan-qr-label",
546
+ "reflect": false,
547
+ "defaultValue": "\"Scan QR Code\""
548
+ },
549
+ "userNotScanInTimeErrorLabel": {
550
+ "type": "string",
551
+ "mutable": false,
552
+ "complexType": {
553
+ "original": "string",
554
+ "resolved": "string",
555
+ "references": {}
556
+ },
557
+ "required": false,
558
+ "optional": true,
559
+ "docs": {
560
+ "tags": [],
561
+ "text": "_[Optional]_\nString to show \"user not scan in time\" error"
562
+ },
563
+ "attribute": "user-not-scan-in-time-error-label",
564
+ "reflect": false,
565
+ "defaultValue": "\"User did not scan the QR in the allowed time\""
566
+ },
567
+ "credsNotValidatedErrorLabel": {
568
+ "type": "string",
569
+ "mutable": false,
570
+ "complexType": {
571
+ "original": "string",
572
+ "resolved": "string",
573
+ "references": {}
574
+ },
575
+ "required": false,
576
+ "optional": true,
577
+ "docs": {
578
+ "tags": [],
579
+ "text": "_[Optional]_\nString to show \"provided credentials not validates\" error"
580
+ },
581
+ "attribute": "creds-not-validated-error-label",
582
+ "reflect": false,
583
+ "defaultValue": "\"Provided user credentials couldn't be validated\""
584
+ },
585
+ "failedLoginErrorLabel": {
586
+ "type": "string",
587
+ "mutable": false,
588
+ "complexType": {
589
+ "original": "string",
590
+ "resolved": "string",
591
+ "references": {}
592
+ },
593
+ "required": false,
594
+ "optional": true,
595
+ "docs": {
596
+ "tags": [],
597
+ "text": "_[Optional]_\nString to show \"failed login\" error"
598
+ },
599
+ "attribute": "failed-login-error-label",
600
+ "reflect": false,
601
+ "defaultValue": "\"No successful login\""
602
+ },
603
+ "successLoginLabel": {
604
+ "type": "string",
605
+ "mutable": false,
606
+ "complexType": {
607
+ "original": "string",
608
+ "resolved": "string",
609
+ "references": {}
610
+ },
611
+ "required": false,
612
+ "optional": true,
613
+ "docs": {
614
+ "tags": [],
615
+ "text": "_[Optional]_\nString to show \"successful login\" label"
616
+ },
617
+ "attribute": "success-login-label",
618
+ "reflect": false,
619
+ "defaultValue": "\"Successful Connection!\""
620
+ },
621
+ "byBrandLabel": {
622
+ "type": "string",
623
+ "mutable": false,
624
+ "complexType": {
625
+ "original": "string",
626
+ "resolved": "string",
627
+ "references": {}
628
+ },
629
+ "required": false,
630
+ "optional": true,
631
+ "docs": {
632
+ "tags": [],
633
+ "text": "_[Optional]_\nString to show \"by brand\" label"
634
+ },
635
+ "attribute": "by-brand-label",
636
+ "reflect": false,
637
+ "defaultValue": "\"by Gataca\""
638
+ },
639
+ "waitingStartSessionLabel": {
640
+ "type": "string",
641
+ "mutable": false,
642
+ "complexType": {
643
+ "original": "string",
644
+ "resolved": "string",
645
+ "references": {}
646
+ },
647
+ "required": false,
648
+ "optional": true,
649
+ "docs": {
650
+ "tags": [],
651
+ "text": "_[Optional]_\nString to show \"waiting start session\" label"
652
+ },
653
+ "attribute": "waiting-start-session-label",
654
+ "reflect": false,
655
+ "defaultValue": "\"waiting to start a session\""
656
+ },
657
+ "hideQrModalDescription": {
658
+ "type": "boolean",
659
+ "mutable": false,
660
+ "complexType": {
661
+ "original": "boolean",
662
+ "resolved": "boolean",
663
+ "references": {}
664
+ },
665
+ "required": false,
666
+ "optional": true,
667
+ "docs": {
668
+ "tags": [],
669
+ "text": "_[Optional]_\nBoolean to show or not show the QR Modal description"
670
+ },
671
+ "attribute": "hide-qr-modal-description",
672
+ "reflect": false,
673
+ "defaultValue": "false"
674
+ },
404
675
  "sessionTimeout": {
405
676
  "type": "number",
406
677
  "mutable": false,
@@ -7,7 +7,7 @@ export class GatacaQRDisplay {
7
7
  this.size = 256;
8
8
  this.logoSize = 0;
9
9
  this.logoSrc = undefined;
10
- this.qrColor = "#181B5E";
10
+ this.qrColor = "#1E1E20";
11
11
  this.rounded = true;
12
12
  }
13
13
  componentDidLoad() {
@@ -129,7 +129,7 @@ export class GatacaQRDisplay {
129
129
  },
130
130
  "attribute": "qr-color",
131
131
  "reflect": false,
132
- "defaultValue": "\"#181B5E\""
132
+ "defaultValue": "\"#1E1E20\""
133
133
  },
134
134
  "rounded": {
135
135
  "type": "boolean",
@@ -109,10 +109,10 @@ img {
109
109
  font-weight: normal;
110
110
  font-size: 12px;
111
111
  letter-spacing: 1px;
112
- color: #181B5E;
112
+ color: #1e1e20;
113
113
  }
114
114
  .popUpContainer .modal-window .qrTitleContainer {
115
- padding: 24px;
115
+ padding: 14px 24px;
116
116
  padding-bottom: 0px;
117
117
  }
118
118
  .popUpContainer .modal-window .qrTitle {