@blotoutio/providers-blotout-wallet-sdk 0.58.0 → 0.59.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.
Files changed (4) hide show
  1. package/index.cjs.js +27 -10
  2. package/index.js +27 -10
  3. package/index.mjs +27 -10
  4. package/package.json +1 -1
package/index.cjs.js CHANGED
@@ -36,6 +36,7 @@ new Set([
36
36
 
37
37
  const customAttributes = {
38
38
  '--bw-primary': { type: 'color', defaultValue: '#000000' },
39
+ '--bw-title-color': { type: 'color', defaultValue: '#000000' },
39
40
  '--bw-secondary': { type: 'color', defaultValue: '#4e647f' },
40
41
  '--bw-background': { type: 'color', defaultValue: '#ffffff' },
41
42
  '--bw-button-foreground': { type: 'color', defaultValue: '#ffffff' },
@@ -310,6 +311,13 @@ const cssVars = i$4 `
310
311
  --bw-secondary,
311
312
  ${r$5(customAttributes['--bw-secondary'].defaultValue)}
312
313
  );
314
+ --title-color: var(
315
+ --bw-title-color,
316
+ var(
317
+ --primary,
318
+ ${r$5(customAttributes['--bw-title-color'].defaultValue)}
319
+ )
320
+ );
313
321
  --background: var(
314
322
  --bw-background,
315
323
  ${r$5(customAttributes['--bw-background'].defaultValue)}
@@ -439,10 +447,9 @@ let BlotoutWallet = class BlotoutWallet extends s {
439
447
  .then(() => flipIn(this.dialog));
440
448
  };
441
449
  this.onSubmit = async (ev) => {
442
- var _a;
443
450
  ev.preventDefault();
444
451
  ev.stopPropagation();
445
- const email = (_a = this.email) === null || _a === void 0 ? void 0 : _a.value.trim().toLowerCase();
452
+ const email = this.email.value.trim().toLowerCase();
446
453
  try {
447
454
  await this.transitionTo('loading');
448
455
  if (email) {
@@ -457,6 +464,8 @@ let BlotoutWallet = class BlotoutWallet extends s {
457
464
  if (!response.ok) {
458
465
  throw new Error(`Could not save email ${response.status}: ${await response.text()}`);
459
466
  }
467
+ this.email.value = '';
468
+ this.hasEmail = true;
460
469
  this.dispatchEvent(new CustomEvent('blotout-wallet-email-saved', { bubbles: true }));
461
470
  window.edgetag('tag', 'WalletEmailSaved', {}, {}, { destination: this.edgeURL });
462
471
  }
@@ -502,7 +511,7 @@ let BlotoutWallet = class BlotoutWallet extends s {
502
511
  await this.transitionTo('restored');
503
512
  delay(2000).then(() => {
504
513
  if (this.state == 'restored') {
505
- this.hideModal();
514
+ this.hideModal('restore');
506
515
  }
507
516
  });
508
517
  }
@@ -517,13 +526,16 @@ let BlotoutWallet = class BlotoutWallet extends s {
517
526
  }
518
527
  this.hideModal();
519
528
  this.email.value = '';
520
- if (this.state == 'ready' || this.state == 'failed') {
521
- this.setDismissed();
522
- }
523
529
  };
524
530
  this.onWrapperClick = (ev) => {
525
531
  ev.stopPropagation();
526
532
  };
533
+ this.onDialogClose = () => {
534
+ const action = this.dialog.returnValue;
535
+ if (!action && (this.state == 'ready' || this.state == 'failed')) {
536
+ this.setDismissed();
537
+ }
538
+ };
527
539
  this.expiredCartContent = () => {
528
540
  var _a, _b, _c, _d, _e;
529
541
  return x `<form
@@ -643,8 +655,8 @@ let BlotoutWallet = class BlotoutWallet extends s {
643
655
  body: JSON.stringify({ action: 'popupShown' }),
644
656
  }).catch(logger.error);
645
657
  }
646
- hideModal() {
647
- fadeOutToBottom(this.dialog).then(() => { var _a; return (_a = this.dialog) === null || _a === void 0 ? void 0 : _a.close(); });
658
+ hideModal(action) {
659
+ fadeOutToBottom(this.dialog).then(() => { var _a; return (_a = this.dialog) === null || _a === void 0 ? void 0 : _a.close(action); });
648
660
  this.dispatchEvent(new CustomEvent('blotout-wallet-hidden', { bubbles: true }));
649
661
  }
650
662
  getHeaders(json = false) {
@@ -665,7 +677,7 @@ let BlotoutWallet = class BlotoutWallet extends s {
665
677
  return url;
666
678
  }
667
679
  async skipCarts() {
668
- this.hideModal();
680
+ this.hideModal('skip');
669
681
  await fetch(this.getUrl('/cart/skip'), {
670
682
  method: 'POST',
671
683
  headers: this.getHeaders(),
@@ -683,7 +695,11 @@ let BlotoutWallet = class BlotoutWallet extends s {
683
695
  if (this.isPopUpDismissed) {
684
696
  return T;
685
697
  }
686
- return x ` <dialog class="popup" @click=${this.onDialogClick}>
698
+ return x ` <dialog
699
+ class="popup"
700
+ @click=${this.onDialogClick}
701
+ @close=${this.onDialogClose}
702
+ >
687
703
  <div @click=${this.onWrapperClick}>
688
704
  <div
689
705
  class="centered"
@@ -768,6 +784,7 @@ BlotoutWallet.styles = [
768
784
  font-size: 20px;
769
785
  font-weight: bold;
770
786
  line-height: 30px;
787
+ color: var(--title-color);
771
788
  }
772
789
 
773
790
  .text {
package/index.js CHANGED
@@ -37,6 +37,7 @@ var ProvidersBlotoutWalletSdk = (function () {
37
37
 
38
38
  const customAttributes = {
39
39
  '--bw-primary': { type: 'color', defaultValue: '#000000' },
40
+ '--bw-title-color': { type: 'color', defaultValue: '#000000' },
40
41
  '--bw-secondary': { type: 'color', defaultValue: '#4e647f' },
41
42
  '--bw-background': { type: 'color', defaultValue: '#ffffff' },
42
43
  '--bw-button-foreground': { type: 'color', defaultValue: '#ffffff' },
@@ -311,6 +312,13 @@ var ProvidersBlotoutWalletSdk = (function () {
311
312
  --bw-secondary,
312
313
  ${r$5(customAttributes['--bw-secondary'].defaultValue)}
313
314
  );
315
+ --title-color: var(
316
+ --bw-title-color,
317
+ var(
318
+ --primary,
319
+ ${r$5(customAttributes['--bw-title-color'].defaultValue)}
320
+ )
321
+ );
314
322
  --background: var(
315
323
  --bw-background,
316
324
  ${r$5(customAttributes['--bw-background'].defaultValue)}
@@ -440,10 +448,9 @@ var ProvidersBlotoutWalletSdk = (function () {
440
448
  .then(() => flipIn(this.dialog));
441
449
  };
442
450
  this.onSubmit = async (ev) => {
443
- var _a;
444
451
  ev.preventDefault();
445
452
  ev.stopPropagation();
446
- const email = (_a = this.email) === null || _a === void 0 ? void 0 : _a.value.trim().toLowerCase();
453
+ const email = this.email.value.trim().toLowerCase();
447
454
  try {
448
455
  await this.transitionTo('loading');
449
456
  if (email) {
@@ -458,6 +465,8 @@ var ProvidersBlotoutWalletSdk = (function () {
458
465
  if (!response.ok) {
459
466
  throw new Error(`Could not save email ${response.status}: ${await response.text()}`);
460
467
  }
468
+ this.email.value = '';
469
+ this.hasEmail = true;
461
470
  this.dispatchEvent(new CustomEvent('blotout-wallet-email-saved', { bubbles: true }));
462
471
  window.edgetag('tag', 'WalletEmailSaved', {}, {}, { destination: this.edgeURL });
463
472
  }
@@ -503,7 +512,7 @@ var ProvidersBlotoutWalletSdk = (function () {
503
512
  await this.transitionTo('restored');
504
513
  delay(2000).then(() => {
505
514
  if (this.state == 'restored') {
506
- this.hideModal();
515
+ this.hideModal('restore');
507
516
  }
508
517
  });
509
518
  }
@@ -518,13 +527,16 @@ var ProvidersBlotoutWalletSdk = (function () {
518
527
  }
519
528
  this.hideModal();
520
529
  this.email.value = '';
521
- if (this.state == 'ready' || this.state == 'failed') {
522
- this.setDismissed();
523
- }
524
530
  };
525
531
  this.onWrapperClick = (ev) => {
526
532
  ev.stopPropagation();
527
533
  };
534
+ this.onDialogClose = () => {
535
+ const action = this.dialog.returnValue;
536
+ if (!action && (this.state == 'ready' || this.state == 'failed')) {
537
+ this.setDismissed();
538
+ }
539
+ };
528
540
  this.expiredCartContent = () => {
529
541
  var _a, _b, _c, _d, _e;
530
542
  return x `<form
@@ -644,8 +656,8 @@ var ProvidersBlotoutWalletSdk = (function () {
644
656
  body: JSON.stringify({ action: 'popupShown' }),
645
657
  }).catch(logger.error);
646
658
  }
647
- hideModal() {
648
- fadeOutToBottom(this.dialog).then(() => { var _a; return (_a = this.dialog) === null || _a === void 0 ? void 0 : _a.close(); });
659
+ hideModal(action) {
660
+ fadeOutToBottom(this.dialog).then(() => { var _a; return (_a = this.dialog) === null || _a === void 0 ? void 0 : _a.close(action); });
649
661
  this.dispatchEvent(new CustomEvent('blotout-wallet-hidden', { bubbles: true }));
650
662
  }
651
663
  getHeaders(json = false) {
@@ -666,7 +678,7 @@ var ProvidersBlotoutWalletSdk = (function () {
666
678
  return url;
667
679
  }
668
680
  async skipCarts() {
669
- this.hideModal();
681
+ this.hideModal('skip');
670
682
  await fetch(this.getUrl('/cart/skip'), {
671
683
  method: 'POST',
672
684
  headers: this.getHeaders(),
@@ -684,7 +696,11 @@ var ProvidersBlotoutWalletSdk = (function () {
684
696
  if (this.isPopUpDismissed) {
685
697
  return T;
686
698
  }
687
- return x ` <dialog class="popup" @click=${this.onDialogClick}>
699
+ return x ` <dialog
700
+ class="popup"
701
+ @click=${this.onDialogClick}
702
+ @close=${this.onDialogClose}
703
+ >
688
704
  <div @click=${this.onWrapperClick}>
689
705
  <div
690
706
  class="centered"
@@ -769,6 +785,7 @@ var ProvidersBlotoutWalletSdk = (function () {
769
785
  font-size: 20px;
770
786
  font-weight: bold;
771
787
  line-height: 30px;
788
+ color: var(--title-color);
772
789
  }
773
790
 
774
791
  .text {
package/index.mjs CHANGED
@@ -34,6 +34,7 @@ new Set([
34
34
 
35
35
  const customAttributes = {
36
36
  '--bw-primary': { type: 'color', defaultValue: '#000000' },
37
+ '--bw-title-color': { type: 'color', defaultValue: '#000000' },
37
38
  '--bw-secondary': { type: 'color', defaultValue: '#4e647f' },
38
39
  '--bw-background': { type: 'color', defaultValue: '#ffffff' },
39
40
  '--bw-button-foreground': { type: 'color', defaultValue: '#ffffff' },
@@ -308,6 +309,13 @@ const cssVars = i$4 `
308
309
  --bw-secondary,
309
310
  ${r$5(customAttributes['--bw-secondary'].defaultValue)}
310
311
  );
312
+ --title-color: var(
313
+ --bw-title-color,
314
+ var(
315
+ --primary,
316
+ ${r$5(customAttributes['--bw-title-color'].defaultValue)}
317
+ )
318
+ );
311
319
  --background: var(
312
320
  --bw-background,
313
321
  ${r$5(customAttributes['--bw-background'].defaultValue)}
@@ -437,10 +445,9 @@ let BlotoutWallet = class BlotoutWallet extends s {
437
445
  .then(() => flipIn(this.dialog));
438
446
  };
439
447
  this.onSubmit = async (ev) => {
440
- var _a;
441
448
  ev.preventDefault();
442
449
  ev.stopPropagation();
443
- const email = (_a = this.email) === null || _a === void 0 ? void 0 : _a.value.trim().toLowerCase();
450
+ const email = this.email.value.trim().toLowerCase();
444
451
  try {
445
452
  await this.transitionTo('loading');
446
453
  if (email) {
@@ -455,6 +462,8 @@ let BlotoutWallet = class BlotoutWallet extends s {
455
462
  if (!response.ok) {
456
463
  throw new Error(`Could not save email ${response.status}: ${await response.text()}`);
457
464
  }
465
+ this.email.value = '';
466
+ this.hasEmail = true;
458
467
  this.dispatchEvent(new CustomEvent('blotout-wallet-email-saved', { bubbles: true }));
459
468
  window.edgetag('tag', 'WalletEmailSaved', {}, {}, { destination: this.edgeURL });
460
469
  }
@@ -500,7 +509,7 @@ let BlotoutWallet = class BlotoutWallet extends s {
500
509
  await this.transitionTo('restored');
501
510
  delay(2000).then(() => {
502
511
  if (this.state == 'restored') {
503
- this.hideModal();
512
+ this.hideModal('restore');
504
513
  }
505
514
  });
506
515
  }
@@ -515,13 +524,16 @@ let BlotoutWallet = class BlotoutWallet extends s {
515
524
  }
516
525
  this.hideModal();
517
526
  this.email.value = '';
518
- if (this.state == 'ready' || this.state == 'failed') {
519
- this.setDismissed();
520
- }
521
527
  };
522
528
  this.onWrapperClick = (ev) => {
523
529
  ev.stopPropagation();
524
530
  };
531
+ this.onDialogClose = () => {
532
+ const action = this.dialog.returnValue;
533
+ if (!action && (this.state == 'ready' || this.state == 'failed')) {
534
+ this.setDismissed();
535
+ }
536
+ };
525
537
  this.expiredCartContent = () => {
526
538
  var _a, _b, _c, _d, _e;
527
539
  return x `<form
@@ -641,8 +653,8 @@ let BlotoutWallet = class BlotoutWallet extends s {
641
653
  body: JSON.stringify({ action: 'popupShown' }),
642
654
  }).catch(logger.error);
643
655
  }
644
- hideModal() {
645
- fadeOutToBottom(this.dialog).then(() => { var _a; return (_a = this.dialog) === null || _a === void 0 ? void 0 : _a.close(); });
656
+ hideModal(action) {
657
+ fadeOutToBottom(this.dialog).then(() => { var _a; return (_a = this.dialog) === null || _a === void 0 ? void 0 : _a.close(action); });
646
658
  this.dispatchEvent(new CustomEvent('blotout-wallet-hidden', { bubbles: true }));
647
659
  }
648
660
  getHeaders(json = false) {
@@ -663,7 +675,7 @@ let BlotoutWallet = class BlotoutWallet extends s {
663
675
  return url;
664
676
  }
665
677
  async skipCarts() {
666
- this.hideModal();
678
+ this.hideModal('skip');
667
679
  await fetch(this.getUrl('/cart/skip'), {
668
680
  method: 'POST',
669
681
  headers: this.getHeaders(),
@@ -681,7 +693,11 @@ let BlotoutWallet = class BlotoutWallet extends s {
681
693
  if (this.isPopUpDismissed) {
682
694
  return T;
683
695
  }
684
- return x ` <dialog class="popup" @click=${this.onDialogClick}>
696
+ return x ` <dialog
697
+ class="popup"
698
+ @click=${this.onDialogClick}
699
+ @close=${this.onDialogClose}
700
+ >
685
701
  <div @click=${this.onWrapperClick}>
686
702
  <div
687
703
  class="centered"
@@ -766,6 +782,7 @@ BlotoutWallet.styles = [
766
782
  font-size: 20px;
767
783
  font-weight: bold;
768
784
  line-height: 30px;
785
+ color: var(--title-color);
769
786
  }
770
787
 
771
788
  .text {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blotoutio/providers-blotout-wallet-sdk",
3
- "version": "0.58.0",
3
+ "version": "0.59.0",
4
4
  "description": "Blotout Wallet SDK for EdgeTag",
5
5
  "author": "Blotout",
6
6
  "license": "MIT",