@axsdk/browser 0.1.4 → 0.1.5

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
@@ -63,7 +63,7 @@ Both files **must be served from the same path prefix** — the loader automatic
63
63
 
64
64
  ```html
65
65
  <!-- Both files must live at the same URL prefix -->
66
- <script src="https://unpkg.com/@axsdk/browser/axsdk-browser.js"></script>
66
+ <script src="https://unpkg.com/@axsdk/browser@latest/dist/axsdk-browser.js"></script>
67
67
  ```
68
68
 
69
69
  ---
@@ -80,7 +80,7 @@ Both files **must be served from the same path prefix** — the loader automatic
80
80
  <body>
81
81
  <!-- Your page content -->
82
82
 
83
- <script src="https://unpkg.com/@axsdk/browser/axsdk-browser.js"></script>
83
+ <script src="https://unpkg.com/@axsdk/browser/dist/axsdk-browser.js"></script>
84
84
  <script>
85
85
  AXSDKBrowser.init({
86
86
  apiKey: 'YOUR_API_KEY',
@@ -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.4",
3
+ "version": "0.1.5",
4
4
  "private": false,
5
5
  "description": "axsdk browser - embed AXSDK widget in web",
6
6
  "keywords": [],