@soyio/soyio-widget 2.13.1 → 2.13.2
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/dist/index.js +1 -1
- package/dist/index.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -201,7 +201,7 @@ const Tt = "https://app.soyio.id", Rt = "https://sandbox.soyio.id", Pn = "https:
|
|
|
201
201
|
], Rn = "WIDGET_CLOSED", On = 420, An = 720, Nn = 500, Dn = {
|
|
202
202
|
minWidth: "375px"
|
|
203
203
|
}, Ln = {
|
|
204
|
-
minWidth: "
|
|
204
|
+
minWidth: "0px"
|
|
205
205
|
}, zn = {
|
|
206
206
|
minWidth: "375px"
|
|
207
207
|
};
|
package/dist/index.umd.cjs
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
opacity: 1;
|
|
32
32
|
transition: height 0.35s,
|
|
33
33
|
opacity 0.4s 0.1s;
|
|
34
|
-
`,d}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"},an={minWidth:"
|
|
34
|
+
`,d}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"},an={minWidth:"0px"},sn={minWidth:"375px"};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 xe(this.iframe,this.appearance,this.uniqueIdentifier),this.skeleton&&this.skeleton.hide())})}handleTooltipChange(p){if(!this.iframe)return;const g=this.iframe.getBoundingClientRect(),{text:d,coordinates:w,isVisible:y}=p,E=w.x+g.left,R=w.y+g.top;y?this.tooltipManager.show(d,E,R):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(!C)return this;yield this.setupListeners(),Vt(this.iframeIdentifier);const g=Yt(p),d=this.iframeUrl();return this.iframe=Jt(d,this.iframeIdentifier,this.defaultIframeCSSConfig),this.Skeleton&&(this.skeleton=new this.Skeleton(this.uniqueIdentifier),this.skeleton.mount(g)),g.appendChild(this.iframe),this})}unmount(){C&&($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
35
|
position: absolute;
|
|
36
36
|
left: 50%;
|
|
37
37
|
top: 50%;
|