@everymatrix/general-registration-otp-standalone 0.0.2 → 0.0.4

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.
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b0fda18c.js');
6
- const generalRegistrationOtpStandalone = require('./general-registration-otp-standalone-597153d4.js');
6
+ const generalRegistrationOtpStandalone = require('./general-registration-otp-standalone-6d5019bc.js');
7
7
 
8
8
  const DEFAULT_LANGUAGE = 'en';
9
9
  const TRANSLATIONS = {
@@ -6467,7 +6467,7 @@ const EmailInput = class {
6467
6467
  };
6468
6468
  EmailInput.style = EmailInputStyle0;
6469
6469
 
6470
- var qr=Object.defineProperty,Yr=Object.defineProperties;var Kr=Object.getOwnPropertyDescriptors;var lo=Object.getOwnPropertySymbols;var Gr=Object.prototype.hasOwnProperty,Xr=Object.prototype.propertyIsEnumerable;var Mt=(s,t,e)=>t in s?qr(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,we=(s,t)=>{for(var e in t||(t={}))Gr.call(t,e)&&Mt(s,e,t[e]);if(lo)for(var e of lo(t))Xr.call(t,e)&&Mt(s,e,t[e]);return s},Nt=(s,t)=>Yr(s,Kr(t));var k=(s,t,e)=>(Mt(s,typeof t!="symbol"?t+"":t,e),e);var Ce=(s,t,e)=>new Promise((i,o)=>{var r=l=>{try{a(e.next(l));}catch(d){o(d);}},n=l=>{try{a(e.throw(l));}catch(d){o(d);}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(r,n);a((e=e.apply(s,t)).next());});/**
6470
+ var qr=Object.defineProperty,Yr=Object.defineProperties;var Kr=Object.getOwnPropertyDescriptors;var lo=Object.getOwnPropertySymbols;var Gr=Object.prototype.hasOwnProperty,Xr=Object.prototype.propertyIsEnumerable;var Mt=(s,t,e)=>t in s?qr(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,we=(s,t)=>{for(var e in t||(t={}))Gr.call(t,e)&&Mt(s,e,t[e]);if(lo)for(var e of lo(t))Xr.call(t,e)&&Mt(s,e,t[e]);return s},Nt=(s,t)=>Yr(s,Kr(t));var k=(s,t,e)=>Mt(s,typeof t!="symbol"?t+"":t,e);var Ce=(s,t,e)=>new Promise((i,o)=>{var r=l=>{try{a(e.next(l));}catch(d){o(d);}},n=l=>{try{a(e.throw(l));}catch(d){o(d);}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(r,n);a((e=e.apply(s,t)).next());});/**
6471
6471
  * @license
6472
6472
  * Copyright (c) 2021 - 2024 Vaadin Ltd.
6473
6473
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
@@ -1380,10 +1380,12 @@ const GeneralRegistrationOtpStandalone = class {
1380
1380
  const result = await this.request(registerPath, isGm2 ? 'POST' : 'PUT', {
1381
1381
  registrationId: stepResult.registrationId
1382
1382
  });
1383
+ window.postMessage({ type: 'WidgetNotification', data: { type: 'success', message: translate('successMessage', this.language) } }, window.location.href);
1383
1384
  window.postMessage({ type: 'registrationSuccessful', userId: result === null || result === void 0 ? void 0 : result.userId, extraActions: [] }, window.location.href);
1384
1385
  }
1385
1386
  catch (error) {
1386
1387
  this.errorMessage = this.getErrorMessage(error);
1388
+ window.postMessage({ type: 'WidgetNotification', data: { type: 'error', message: this.errorMessage } }, window.location.href);
1387
1389
  window.postMessage({ type: 'registrationFailed', errorMessage: this.errorMessage }, window.location.href);
1388
1390
  }
1389
1391
  finally {
@@ -1391,7 +1393,7 @@ const GeneralRegistrationOtpStandalone = class {
1391
1393
  }
1392
1394
  }
1393
1395
  render() {
1394
- return (index.h("div", { key: '28793fb63e99cffcc3db3da99f3594987114f276', class: "registration-otp", ref: el => (this.stylingContainer = el) }, index.h("form", { key: '737bfd076f32e84b67271a1473d5f0dc52b6043b', class: "registration-otp__form", onSubmit: event => this.handleSubmit(event) }, index.h("general-input", { key: '46685ab2b974e02bc60f97a6863680afe835326a', type: "twofa", name: this.otpFieldName, validation: { mandatory: true, maxLength: this.otpLength }, emitValue: true, language: this.language, translationUrl: this.translationUrl, mbSource: this.mbSource, clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, twofaDestination: this.destination, twofaResendIntervalSeconds: this.resendIntervalSeconds, twofaStartCountDown: this.startCountDown, pinAttemptsExceeded: this.pinAttemptsExceeded }), this.errorMessage && index.h("div", { key: 'dfcadb1ca92b303f810ce9bd608da7787dd803dd', class: "registration-otp__error", role: "alert" }, this.errorMessage), index.h("button", { key: '1d850e57e3d507a967255d497f05d3c4831912c0', class: "registration-otp__submit", type: "submit", disabled: this.isSubmitting || !this.isOtpValid }, translate('doneButton', this.language)))));
1396
+ return (index.h("div", { key: 'd5013543cd8c5d8d465babebe8076b777f092eb2', class: "registration-otp", ref: el => (this.stylingContainer = el) }, index.h("form", { key: '64e04ad25e0b31868426dc3b3f6a52a841fd0c1f', class: "registration-otp__form", onSubmit: event => this.handleSubmit(event) }, index.h("general-input", { key: 'bfa197f23758acdf92f6aa6266d6e443b5ed0416', type: "twofa", name: this.otpFieldName, validation: { mandatory: true, maxLength: this.otpLength }, emitValue: true, language: this.language, translationUrl: this.translationUrl, mbSource: this.mbSource, clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, twofaDestination: this.destination, twofaResendIntervalSeconds: this.resendIntervalSeconds, twofaStartCountDown: this.startCountDown, pinAttemptsExceeded: this.pinAttemptsExceeded }), this.errorMessage && index.h("div", { key: '650ec330269c98649bc6ab31a8d19251a19a551b', class: "registration-otp__error", role: "alert" }, this.errorMessage), index.h("button", { key: 'd4d626673bbb05fccb4b9cd65e25564601e3ee09', class: "registration-otp__submit", type: "submit", disabled: this.isSubmitting || !this.isOtpValid }, translate('doneButton', this.language)))));
1395
1397
  }
1396
1398
  get host() { return index.getElement(this); }
1397
1399
  static get watchers() { return {
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const generalRegistrationOtpStandalone = require('./general-registration-otp-standalone-597153d4.js');
5
+ const generalRegistrationOtpStandalone = require('./general-registration-otp-standalone-6d5019bc.js');
6
6
  require('./index-b0fda18c.js');
7
7
 
8
8
 
@@ -143,10 +143,12 @@ export class GeneralRegistrationOtpStandalone {
143
143
  const result = await this.request(registerPath, isGm2 ? 'POST' : 'PUT', {
144
144
  registrationId: stepResult.registrationId
145
145
  });
146
+ window.postMessage({ type: 'WidgetNotification', data: { type: 'success', message: translate('successMessage', this.language) } }, window.location.href);
146
147
  window.postMessage({ type: 'registrationSuccessful', userId: result === null || result === void 0 ? void 0 : result.userId, extraActions: [] }, window.location.href);
147
148
  }
148
149
  catch (error) {
149
150
  this.errorMessage = this.getErrorMessage(error);
151
+ window.postMessage({ type: 'WidgetNotification', data: { type: 'error', message: this.errorMessage } }, window.location.href);
150
152
  window.postMessage({ type: 'registrationFailed', errorMessage: this.errorMessage }, window.location.href);
151
153
  }
152
154
  finally {
@@ -154,7 +156,7 @@ export class GeneralRegistrationOtpStandalone {
154
156
  }
155
157
  }
156
158
  render() {
157
- return (h("div", { key: '28793fb63e99cffcc3db3da99f3594987114f276', class: "registration-otp", ref: el => (this.stylingContainer = el) }, h("form", { key: '737bfd076f32e84b67271a1473d5f0dc52b6043b', class: "registration-otp__form", onSubmit: event => this.handleSubmit(event) }, h("general-input", { key: '46685ab2b974e02bc60f97a6863680afe835326a', type: "twofa", name: this.otpFieldName, validation: { mandatory: true, maxLength: this.otpLength }, emitValue: true, language: this.language, translationUrl: this.translationUrl, mbSource: this.mbSource, clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, twofaDestination: this.destination, twofaResendIntervalSeconds: this.resendIntervalSeconds, twofaStartCountDown: this.startCountDown, pinAttemptsExceeded: this.pinAttemptsExceeded }), this.errorMessage && h("div", { key: 'dfcadb1ca92b303f810ce9bd608da7787dd803dd', class: "registration-otp__error", role: "alert" }, this.errorMessage), h("button", { key: '1d850e57e3d507a967255d497f05d3c4831912c0', class: "registration-otp__submit", type: "submit", disabled: this.isSubmitting || !this.isOtpValid }, translate('doneButton', this.language)))));
159
+ return (h("div", { key: 'd5013543cd8c5d8d465babebe8076b777f092eb2', class: "registration-otp", ref: el => (this.stylingContainer = el) }, h("form", { key: '64e04ad25e0b31868426dc3b3f6a52a841fd0c1f', class: "registration-otp__form", onSubmit: event => this.handleSubmit(event) }, h("general-input", { key: 'bfa197f23758acdf92f6aa6266d6e443b5ed0416', type: "twofa", name: this.otpFieldName, validation: { mandatory: true, maxLength: this.otpLength }, emitValue: true, language: this.language, translationUrl: this.translationUrl, mbSource: this.mbSource, clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, twofaDestination: this.destination, twofaResendIntervalSeconds: this.resendIntervalSeconds, twofaStartCountDown: this.startCountDown, pinAttemptsExceeded: this.pinAttemptsExceeded }), this.errorMessage && h("div", { key: '650ec330269c98649bc6ab31a8d19251a19a551b', class: "registration-otp__error", role: "alert" }, this.errorMessage), h("button", { key: 'd4d626673bbb05fccb4b9cd65e25564601e3ee09', class: "registration-otp__submit", type: "submit", disabled: this.isSubmitting || !this.isOtpValid }, translate('doneButton', this.language)))));
158
160
  }
159
161
  static get is() { return "general-registration-otp-standalone"; }
160
162
  static get encapsulation() { return "shadow"; }
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, c as createEvent, h, g as getElement, H as Host, f as forceUpdate } from './index-5fadd4cf.js';
2
- import { s as setClientStyling, a as setStreamStyling, b as setClientStylingURL, g as getStreamTranslations } from './general-registration-otp-standalone-f724cbe2.js';
3
- export { G as general_registration_otp_standalone } from './general-registration-otp-standalone-f724cbe2.js';
2
+ import { s as setClientStyling, a as setStreamStyling, b as setClientStylingURL, g as getStreamTranslations } from './general-registration-otp-standalone-933a7f9d.js';
3
+ export { G as general_registration_otp_standalone } from './general-registration-otp-standalone-933a7f9d.js';
4
4
 
5
5
  const DEFAULT_LANGUAGE = 'en';
6
6
  const TRANSLATIONS = {
@@ -6464,7 +6464,7 @@ const EmailInput = class {
6464
6464
  };
6465
6465
  EmailInput.style = EmailInputStyle0;
6466
6466
 
6467
- var qr=Object.defineProperty,Yr=Object.defineProperties;var Kr=Object.getOwnPropertyDescriptors;var lo=Object.getOwnPropertySymbols;var Gr=Object.prototype.hasOwnProperty,Xr=Object.prototype.propertyIsEnumerable;var Mt=(s,t,e)=>t in s?qr(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,we=(s,t)=>{for(var e in t||(t={}))Gr.call(t,e)&&Mt(s,e,t[e]);if(lo)for(var e of lo(t))Xr.call(t,e)&&Mt(s,e,t[e]);return s},Nt=(s,t)=>Yr(s,Kr(t));var k=(s,t,e)=>(Mt(s,typeof t!="symbol"?t+"":t,e),e);var Ce=(s,t,e)=>new Promise((i,o)=>{var r=l=>{try{a(e.next(l));}catch(d){o(d);}},n=l=>{try{a(e.throw(l));}catch(d){o(d);}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(r,n);a((e=e.apply(s,t)).next());});/**
6467
+ var qr=Object.defineProperty,Yr=Object.defineProperties;var Kr=Object.getOwnPropertyDescriptors;var lo=Object.getOwnPropertySymbols;var Gr=Object.prototype.hasOwnProperty,Xr=Object.prototype.propertyIsEnumerable;var Mt=(s,t,e)=>t in s?qr(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,we=(s,t)=>{for(var e in t||(t={}))Gr.call(t,e)&&Mt(s,e,t[e]);if(lo)for(var e of lo(t))Xr.call(t,e)&&Mt(s,e,t[e]);return s},Nt=(s,t)=>Yr(s,Kr(t));var k=(s,t,e)=>Mt(s,typeof t!="symbol"?t+"":t,e);var Ce=(s,t,e)=>new Promise((i,o)=>{var r=l=>{try{a(e.next(l));}catch(d){o(d);}},n=l=>{try{a(e.throw(l));}catch(d){o(d);}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(r,n);a((e=e.apply(s,t)).next());});/**
6468
6468
  * @license
6469
6469
  * Copyright (c) 2021 - 2024 Vaadin Ltd.
6470
6470
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
@@ -1378,10 +1378,12 @@ const GeneralRegistrationOtpStandalone = class {
1378
1378
  const result = await this.request(registerPath, isGm2 ? 'POST' : 'PUT', {
1379
1379
  registrationId: stepResult.registrationId
1380
1380
  });
1381
+ window.postMessage({ type: 'WidgetNotification', data: { type: 'success', message: translate('successMessage', this.language) } }, window.location.href);
1381
1382
  window.postMessage({ type: 'registrationSuccessful', userId: result === null || result === void 0 ? void 0 : result.userId, extraActions: [] }, window.location.href);
1382
1383
  }
1383
1384
  catch (error) {
1384
1385
  this.errorMessage = this.getErrorMessage(error);
1386
+ window.postMessage({ type: 'WidgetNotification', data: { type: 'error', message: this.errorMessage } }, window.location.href);
1385
1387
  window.postMessage({ type: 'registrationFailed', errorMessage: this.errorMessage }, window.location.href);
1386
1388
  }
1387
1389
  finally {
@@ -1389,7 +1391,7 @@ const GeneralRegistrationOtpStandalone = class {
1389
1391
  }
1390
1392
  }
1391
1393
  render() {
1392
- return (h("div", { key: '28793fb63e99cffcc3db3da99f3594987114f276', class: "registration-otp", ref: el => (this.stylingContainer = el) }, h("form", { key: '737bfd076f32e84b67271a1473d5f0dc52b6043b', class: "registration-otp__form", onSubmit: event => this.handleSubmit(event) }, h("general-input", { key: '46685ab2b974e02bc60f97a6863680afe835326a', type: "twofa", name: this.otpFieldName, validation: { mandatory: true, maxLength: this.otpLength }, emitValue: true, language: this.language, translationUrl: this.translationUrl, mbSource: this.mbSource, clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, twofaDestination: this.destination, twofaResendIntervalSeconds: this.resendIntervalSeconds, twofaStartCountDown: this.startCountDown, pinAttemptsExceeded: this.pinAttemptsExceeded }), this.errorMessage && h("div", { key: 'dfcadb1ca92b303f810ce9bd608da7787dd803dd', class: "registration-otp__error", role: "alert" }, this.errorMessage), h("button", { key: '1d850e57e3d507a967255d497f05d3c4831912c0', class: "registration-otp__submit", type: "submit", disabled: this.isSubmitting || !this.isOtpValid }, translate('doneButton', this.language)))));
1394
+ return (h("div", { key: 'd5013543cd8c5d8d465babebe8076b777f092eb2', class: "registration-otp", ref: el => (this.stylingContainer = el) }, h("form", { key: '64e04ad25e0b31868426dc3b3f6a52a841fd0c1f', class: "registration-otp__form", onSubmit: event => this.handleSubmit(event) }, h("general-input", { key: 'bfa197f23758acdf92f6aa6266d6e443b5ed0416', type: "twofa", name: this.otpFieldName, validation: { mandatory: true, maxLength: this.otpLength }, emitValue: true, language: this.language, translationUrl: this.translationUrl, mbSource: this.mbSource, clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, twofaDestination: this.destination, twofaResendIntervalSeconds: this.resendIntervalSeconds, twofaStartCountDown: this.startCountDown, pinAttemptsExceeded: this.pinAttemptsExceeded }), this.errorMessage && h("div", { key: '650ec330269c98649bc6ab31a8d19251a19a551b', class: "registration-otp__error", role: "alert" }, this.errorMessage), h("button", { key: 'd4d626673bbb05fccb4b9cd65e25564601e3ee09', class: "registration-otp__submit", type: "submit", disabled: this.isSubmitting || !this.isOtpValid }, translate('doneButton', this.language)))));
1393
1395
  }
1394
1396
  get host() { return getElement(this); }
1395
1397
  static get watchers() { return {
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { G as GeneralRegistrationOtpStandalone } from './general-registration-otp-standalone-f724cbe2.js';
1
+ export { G as GeneralRegistrationOtpStandalone } from './general-registration-otp-standalone-933a7f9d.js';
2
2
  import './index-5fadd4cf.js';