@axsdk/browser 0.1.3 → 0.1.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.
@@ -1 +1 @@
1
- var AXSDK=(function(){"use strict";let e=null,s;const c=window.matchMedia("(max-width: 767px)");function l(r){e&&(r?e.style.cssText=["position:fixed","top:0","left:0","right:0","bottom:0","width:100%","height:100dvh","border:none","z-index:99999","background:transparent"].join(";"):e.style.cssText=["position:fixed","right:0","bottom:0","width:420px","height:680px","border:none","z-index:99999","background:transparent"].join(";"))}c.addEventListener("change",r=>{l(r.matches)});const d=document.currentScript,m=((d==null?void 0:d.src)??"").replace(/axsdk-browser\.js$/,""),p=m?m+"axsdk-browser-frame.js":"./axsdk-browser-frame.js";return window.addEventListener("message",async r=>{var a,t;if(!e||r.source!==e.contentWindow)return;const n=r.data;if((n==null?void 0:n.type)==="AXSDK_HANDLER_REQUEST"&&s){const{requestId:o,command:h,args:f}=n;try{const i=await s(h,f);(a=e.contentWindow)==null||a.postMessage({type:"AXSDK_HANDLER_RESPONSE",requestId:o,result:i},"*")}catch(i){const u=i instanceof Error?i.message:String(i);(t=e.contentWindow)==null||t.postMessage({type:"AXSDK_HANDLER_RESPONSE",requestId:o,error:u},"*")}}}),{init(r){if(e){console.warn("[AXSDKBrowser] Already initialized. Ignoring duplicate init() call.");return}s=r.axHandler;const{axHandler:n,...a}=r,t=document.createElement("iframe");e=t,l(c.matches),t.setAttribute("allowtransparency","true"),t.setAttribute("frameborder","0"),t.srcdoc=["<!DOCTYPE html>","<html>","<head>",'<meta charset="utf-8">','<meta name="viewport" content="width=device-width,initial-scale=1">',"<style>*{margin:0;padding:0;box-sizing:border-box}html,body{height:100%;width:100%;overflow:hidden}</style>","</head>","<body>",`<script src="${p}"><\/script>`,"</body>","</html>"].join(""),t.addEventListener("load",()=>{var o;(o=t.contentWindow)==null||o.postMessage({type:"AXSDK_INIT",config:a},"*")}),document.body.appendChild(t)},destroy(){e&&e.parentNode&&e.parentNode.removeChild(e),e=null,s=void 0}}})();
1
+ var AXSDK=(function(){"use strict";let e=null,s;const c=window.matchMedia("(max-width: 767px)");function l(r){e&&(r?e.style.cssText=["position:fixed","top:0","left:0","right:0","bottom:0","width:100%","height:100dvh","border:none","z-index:99999","background:transparent"].join(";"):e.style.cssText=["position:fixed","right:0","bottom:0","width:420px","height:680px","border:none","z-index:99999","background:transparent"].join(";"))}c.addEventListener("change",r=>{l(r.matches)});const d=document.currentScript,m=((d==null?void 0:d.src)??"").replace(/axsdk-browser\.js$/,""),p=m?m+"/axsdk-browser-frame.js":"./axsdk-browser-frame.js";return window.addEventListener("message",async r=>{var a,t;if(!e||r.source!==e.contentWindow)return;const n=r.data;if((n==null?void 0:n.type)==="AXSDK_HANDLER_REQUEST"&&s){const{requestId:o,command:h,args:f}=n;try{const i=await s(h,f);(a=e.contentWindow)==null||a.postMessage({type:"AXSDK_HANDLER_RESPONSE",requestId:o,result:i},"*")}catch(i){const u=i instanceof Error?i.message:String(i);(t=e.contentWindow)==null||t.postMessage({type:"AXSDK_HANDLER_RESPONSE",requestId:o,error:u},"*")}}}),{init(r){if(e){console.warn("[AXSDKBrowser] Already initialized. Ignoring duplicate init() call.");return}s=r.axHandler;const{axHandler:n,...a}=r,t=document.createElement("iframe");e=t,l(c.matches),t.setAttribute("allowtransparency","true"),t.setAttribute("frameborder","0"),t.srcdoc=["<!DOCTYPE html>","<html>","<head>",'<meta charset="utf-8">','<meta name="viewport" content="width=device-width,initial-scale=1">',"<style>*{margin:0;padding:0;box-sizing:border-box}html,body{height:100%;width:100%;overflow:hidden}</style>","</head>","<body>",`<script src="${p}"><\/script>`,"</body>","</html>"].join(""),t.addEventListener("load",()=>{var o;(o=t.contentWindow)==null||o.postMessage({type:"AXSDK_INIT",config:a},"*")}),document.body.appendChild(t)},destroy(){e&&e.parentNode&&e.parentNode.removeChild(e),e=null,s=void 0}}})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axsdk/browser",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "private": false,
5
5
  "description": "axsdk browser - embed AXSDK widget in web",
6
6
  "keywords": [],