@_solaris/messenger-widget 0.5.5 → 0.5.6

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/messenger.js CHANGED
@@ -6102,7 +6102,7 @@ function Pa(e, t, n, i, r, s) {
6102
6102
  ], 6)) : w("", !0)
6103
6103
  ], 2);
6104
6104
  }
6105
- const Ha = /* @__PURE__ */ R(Ta, [["render", Pa], ["__scopeId", "data-v-1c840488"]]), $a = "0.5.5";
6105
+ const Ha = /* @__PURE__ */ R(Ta, [["render", Pa], ["__scopeId", "data-v-1c840488"]]), $a = "0.5.6";
6106
6106
  export {
6107
6107
  le as AIAvatar,
6108
6108
  _e as AVATAR_COLORS,
package/dist/snippet.js CHANGED
@@ -1 +1 @@
1
- var Messenger=function(o){"use strict";let e=null,s="",r=null;function m(t){e&&l();const d=t.widgetId||"",c=t.baseUrl||"";s=t.widgetOrigin||c;const g=t.token||"",n=t.context&&typeof t.context=="object"?t.context:null,a=t.displayMode||"floating",p=t.language||"";if(!d||!s){console.warn("[messenger] init skipped — missing widgetId or widgetOrigin");return}const u=new URL(`${b(s)}/widget/${encodeURIComponent(d)}`);a!=="floating"&&u.searchParams.set("display_mode",a),p&&u.searchParams.set("language",p),e=document.createElement("iframe"),e.src=u.toString(),e.title="Messenger",e.setAttribute("aria-label","Messenger"),e.setAttribute("allow","clipboard-write; microphone"),e.setAttribute("data-messenger-widget",""),w(e,a,"closed"),document.body.appendChild(e);let f=!1;const M=()=>{f||!e||(f=!0,e.contentWindow.postMessage({type:"INIT",origin:window.location.origin,token:g||null,context:n||null},s))};r=S=>{if(S.source!==(e==null?void 0:e.contentWindow))return;const i=S.data;!i||typeof i!="object"||(i.type==="READY"?M():i.type==="RESIZE"&&e&&w(e,i.displayMode||a,i.state))},window.addEventListener("message",r),e.addEventListener("load",M),setTimeout(()=>{f||console.warn("[messenger] iframe did not boot after",1e4,"ms — check CSP frame-ancestors and network")},1e4)}function l(){r&&(window.removeEventListener("message",r),r=null),e&&(e.remove(),e=null),s=""}function b(t){return t.endsWith("/")?t.slice(0,-1):t}function w(t,d,c){const g=["position:fixed","border:0","z-index:2147483647","color-scheme:normal","background:transparent"];let n;c==="closed"?n=["bottom:0","right:0","width:100px","height:100px"]:d==="sheet"?n=["top:0","bottom:0","right:0","width:min(480px, 100vw)","height:100vh"]:d==="embedded"?n=["inset:0","width:100%","height:100%"]:n=["bottom:20px","right:20px","width:380px","height:600px","max-height:calc(100vh - 40px)"],t.style.cssText=g.concat(n).join(";")}const h={init:m,destroy:l};return typeof window<"u"&&(window.Messenger=h),o.default=h,o.destroy=l,o.init=m,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),o}({});
1
+ var Messenger=function(o){"use strict";let e=null,s="",r=null;function m(t){e&&l();const d=t.widgetId||"",c=t.baseUrl||"";s=t.widgetOrigin||c;const g=t.token||"",n=t.context&&typeof t.context=="object"?t.context:null,a=t.displayMode||"floating",p=t.language||"";if(!d||!s){console.warn("[messenger] init skipped — missing widgetId or widgetOrigin");return}const u=new URL(`${b(s)}/widget/${encodeURIComponent(d)}`);a!=="floating"&&u.searchParams.set("display_mode",a),p&&u.searchParams.set("language",p),e=document.createElement("iframe"),e.src=u.toString(),e.title="Messenger",e.setAttribute("aria-label","Messenger"),e.setAttribute("allow","clipboard-write; microphone"),e.setAttribute("data-messenger-widget",""),w(e,a,"closed"),document.body.appendChild(e);let f=!1;const M=()=>{f||!e||(f=!0,e.contentWindow.postMessage({type:"INIT",origin:window.location.origin,token:g||null,context:n||null},s))};r=S=>{if(S.source!==(e==null?void 0:e.contentWindow))return;const i=S.data;!i||typeof i!="object"||(i.type==="READY"?M():i.type==="RESIZE"&&e&&w(e,i.displayMode||a,i.state))},window.addEventListener("message",r),e.addEventListener("load",M),setTimeout(()=>{f||console.warn("[messenger] iframe did not boot after",1e4,"ms — check CSP frame-ancestors and network")},1e4)}function l(){r&&(window.removeEventListener("message",r),r=null),e&&(e.remove(),e=null),s=""}function b(t){return t.endsWith("/")?t.slice(0,-1):t}function w(t,d,c){const g=["position:fixed","border:0","z-index:2147483647","color-scheme:normal","background:transparent"];let n;c==="closed"?n=["bottom:0","right:0","width:100px","height:100px"]:d==="sheet"?n=["top:0","bottom:0","right:0","width:min(480px, 100vw)","height:100vh"]:d==="embedded"?n=["inset:0","width:100%","height:100%"]:n=["bottom:20px","right:20px","width:380px","height:600px","max-height:calc(100vh - 40px)"],t.style.cssText=g.concat(n).join(";")}const h={init:m,destroy:l,version:"0.5.6"};return typeof window<"u"&&(window.Messenger=h),o.default=h,o.destroy=l,o.init=m,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),o}({});
@@ -2,6 +2,7 @@ export default Messenger;
2
2
  declare namespace Messenger {
3
3
  export { init };
4
4
  export { destroy };
5
+ export let version: string;
5
6
  }
6
7
  export function init(opts: any): void;
7
8
  export function destroy(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@_solaris/messenger-widget",
3
- "version": "0.5.5",
3
+ "version": "0.5.6",
4
4
  "description": "Embeddable chat messenger widget — Vue 3 library + iframe-hosted UI + snippet drop-in. Wired to messenger-server (cookie-based session).",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE",