@soyio/soyio-widget 2.11.3 → 2.12.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/README.md CHANGED
@@ -253,7 +253,7 @@ The **`auth_request`** is a process where, using a previously created `auth_requ
253
253
 
254
254
  // Widget configuration
255
255
  const widgetConfig = {
256
- request: "authentication",
256
+ request: "authentication_request",
257
257
  configProps: {
258
258
  authRequestId: "<auth request id>",
259
259
  customColor: "<custom color>",
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  declare type AuthRequestConfig = {
2
- request: 'authentication';
2
+ request: 'authentication_request';
3
3
  configProps: AuthRequestProps;
4
4
  onEvent: (data: EventData) => void;
5
5
  isSandbox?: boolean;
package/dist/index.js CHANGED
@@ -197,7 +197,8 @@ const Tt = "https://app.soyio.id", Rt = "https://sandbox.soyio.id", Cn = "https:
197
197
  "IDENTITY_SIGNATURE",
198
198
  "UNEXPECTED_ERROR",
199
199
  "DENIED_CAMERA_PERMISSION",
200
- "REJECTED_SIGNATURE"
200
+ "REJECTED_SIGNATURE",
201
+ "CLOSE_POPUP"
201
202
  ], Rn = "WIDGET_CLOSED", An = 420, On = 720, Nn = 500, Dn = {
202
203
  minWidth: "375px",
203
204
  maxWidth: "50rem"
@@ -32,7 +32,7 @@
32
32
  opacity: 1;
33
33
  transition: height 0.35s,
34
34
  opacity 0.4s 0.1s;
35
- `,l}function Zt(){return Math.random().toString(36).substring(2,10)}const nt="https://app.soyio.id",rt="https://sandbox.soyio.id",Xt="https://privacy.soyio.id",Kt="https://privacy-sandbox.soyio.id",Qt=["DISCLOSURE_REQUEST_SUCCESSFUL","IDENTITY_REGISTERED","IDENTITY_SIGNATURE","UNEXPECTED_ERROR","DENIED_CAMERA_PERMISSION","REJECTED_SIGNATURE"],en="WIDGET_CLOSED",tn=420,nn=720,rn=500,on={minWidth:"375px",maxWidth:"50rem"},an={minWidth:"375px",maxWidth:"36rem"},sn={minWidth:"375px",maxWidth:"50rem"};class be{constructor(p){L(this,"iframe",null);L(this,"skeleton",null);L(this,"options");L(this,"appearance");L(this,"tooltipManager");L(this,"defaultIframeCSSConfig",on);L(this,"Skeleton",null);L(this,"defaultUniqueId");this.options=p,this.appearance=p.appearance||null,this.tooltipManager=new F,this.defaultUniqueId=be.generateUniqueId()}static generateUniqueId(){return Zt()}get uniqueIdentifier(){return this.defaultUniqueId}get iframeIdentifier(){return`${this.defaultIframePrefix}-${this.uniqueIdentifier}`}handleHeightChange(p){if(!this.iframe||(this.iframe.style.height=`${p}px`,p>0))return;const{parentElement:g}=this.iframe;g&&(g.style.display="none")}handleIframeReady(){return q(this,null,function*(){this.iframe&&(this.options.onReady&&this.options.onReady(),yield Se(this.iframe,this.appearance,this.uniqueIdentifier),this.skeleton&&this.skeleton.hide())})}handleTooltipChange(p){if(!this.iframe)return;const g=this.iframe.getBoundingClientRect(),{text:l,coordinates:w,isVisible:y}=p,E=w.x+g.left,C=w.y+g.top;y?this.tooltipManager.show(l,E,C):this.tooltipManager.hide()}setupListeners(){return q(this,null,function*(){yield Gt();const p={onHeightChange:this.handleHeightChange.bind(this),onIframeReady:this.handleIframeReady.bind(this),onTooltipChange:this.handleTooltipChange.bind(this),onInfo:this.options.onEvent.bind(this)};tt(this.uniqueIdentifier,p)})}mount(p){return q(this,null,function*(){if(!T)return this;yield this.setupListeners(),Vt(this.iframeIdentifier);const g=Yt(p),l=this.iframeUrl();return this.iframe=Jt(l,this.iframeIdentifier,this.defaultIframeCSSConfig),this.Skeleton&&(this.skeleton=new this.Skeleton(this.uniqueIdentifier),this.skeleton.mount(g)),g.appendChild(this.iframe),this})}unmount(){T&&($t(this.uniqueIdentifier),this.skeleton&&(this.skeleton.hide(),this.skeleton=null),this.iframe&&(this.iframe.remove(),this.iframe=null))}}class un{constructor(p){L(this,"element");L(this,"identifier");this.identifier=`skeleton-${p}`,this.element=document.createElement("div"),this.element.id=this.identifier,this.element.style.cssText=`
35
+ `,l}function Zt(){return Math.random().toString(36).substring(2,10)}const nt="https://app.soyio.id",rt="https://sandbox.soyio.id",Xt="https://privacy.soyio.id",Kt="https://privacy-sandbox.soyio.id",Qt=["DISCLOSURE_REQUEST_SUCCESSFUL","IDENTITY_REGISTERED","IDENTITY_SIGNATURE","UNEXPECTED_ERROR","DENIED_CAMERA_PERMISSION","REJECTED_SIGNATURE","CLOSE_POPUP"],en="WIDGET_CLOSED",tn=420,nn=720,rn=500,on={minWidth:"375px",maxWidth:"50rem"},an={minWidth:"375px",maxWidth:"36rem"},sn={minWidth:"375px",maxWidth:"50rem"};class be{constructor(p){L(this,"iframe",null);L(this,"skeleton",null);L(this,"options");L(this,"appearance");L(this,"tooltipManager");L(this,"defaultIframeCSSConfig",on);L(this,"Skeleton",null);L(this,"defaultUniqueId");this.options=p,this.appearance=p.appearance||null,this.tooltipManager=new F,this.defaultUniqueId=be.generateUniqueId()}static generateUniqueId(){return Zt()}get uniqueIdentifier(){return this.defaultUniqueId}get iframeIdentifier(){return`${this.defaultIframePrefix}-${this.uniqueIdentifier}`}handleHeightChange(p){if(!this.iframe||(this.iframe.style.height=`${p}px`,p>0))return;const{parentElement:g}=this.iframe;g&&(g.style.display="none")}handleIframeReady(){return q(this,null,function*(){this.iframe&&(this.options.onReady&&this.options.onReady(),yield Se(this.iframe,this.appearance,this.uniqueIdentifier),this.skeleton&&this.skeleton.hide())})}handleTooltipChange(p){if(!this.iframe)return;const g=this.iframe.getBoundingClientRect(),{text:l,coordinates:w,isVisible:y}=p,E=w.x+g.left,C=w.y+g.top;y?this.tooltipManager.show(l,E,C):this.tooltipManager.hide()}setupListeners(){return q(this,null,function*(){yield Gt();const p={onHeightChange:this.handleHeightChange.bind(this),onIframeReady:this.handleIframeReady.bind(this),onTooltipChange:this.handleTooltipChange.bind(this),onInfo:this.options.onEvent.bind(this)};tt(this.uniqueIdentifier,p)})}mount(p){return q(this,null,function*(){if(!T)return this;yield this.setupListeners(),Vt(this.iframeIdentifier);const g=Yt(p),l=this.iframeUrl();return this.iframe=Jt(l,this.iframeIdentifier,this.defaultIframeCSSConfig),this.Skeleton&&(this.skeleton=new this.Skeleton(this.uniqueIdentifier),this.skeleton.mount(g)),g.appendChild(this.iframe),this})}unmount(){T&&($t(this.uniqueIdentifier),this.skeleton&&(this.skeleton.hide(),this.skeleton=null),this.iframe&&(this.iframe.remove(),this.iframe=null))}}class un{constructor(p){L(this,"element");L(this,"identifier");this.identifier=`skeleton-${p}`,this.element=document.createElement("div"),this.element.id=this.identifier,this.element.style.cssText=`
36
36
  position: absolute;
37
37
  left: 50%;
38
38
  top: 50%;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soyio/soyio-widget",
3
- "version": "2.11.3",
3
+ "version": "2.12.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.umd.cjs",
6
6
  "module": "./dist/index.js",