@_solaris/messenger-widget 0.5.65 → 0.5.66

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
@@ -6871,7 +6871,7 @@ function go(e, t, n, r, a, s) {
6871
6871
  ], 6)) : w("", !0)
6872
6872
  ], 6);
6873
6873
  }
6874
- const yo = /* @__PURE__ */ P(Xa, [["render", go], ["__scopeId", "data-v-a54649f6"]]), wo = "0.5.65";
6874
+ const yo = /* @__PURE__ */ P(Xa, [["render", go], ["__scopeId", "data-v-a54649f6"]]), wo = "0.5.66";
6875
6875
  export {
6876
6876
  oe as AIAvatar,
6877
6877
  be as AVATAR_COLORS,
package/dist/snippet.js CHANGED
@@ -1 +1 @@
1
- var Messenger=function(h){"use strict";let t=null,a=null,r=null,d="",f=null;function v(e){t&&m();const i=e.widgetId||"",c=e.baseUrl||"";d=e.widgetOrigin||c;const s=e.token||"";let l=null;e.variables&&typeof e.variables=="object"?l=e.variables:e.context&&typeof e.context=="object"&&(l=e.context);const o=e.displayMode||"floating",u=e.language||"",g=e.allowUnauthenticated===!0;if(!i||!d){console.warn("[messenger] init skipped — missing widgetId or widgetOrigin");return}!g&&!s&&console.warn("[messenger] init: allowUnauthenticated=false but no token provided. In app mode you must pass a `token` (JWT linked) at every init() call. See messenger-back /auth/jwt to generate one server-side. Without a token, /session will return 403.");const w=new URL(`${O(d)}/widget/${encodeURIComponent(i)}`);o!=="floating"&&w.searchParams.set("display_mode",o),u&&w.searchParams.set("language",u),t=document.createElement("iframe"),t.src=w.toString(),t.title="Messenger",t.setAttribute("aria-label","Messenger"),t.setAttribute("allow","clipboard-write; microphone; notifications; display-capture"),t.setAttribute("data-messenger-widget",""),E(t,o,"closed"),document.body.appendChild(t),a=document.createElement("div"),a.setAttribute("data-messenger-shadow",""),p(a,{hidden:!0}),document.body.appendChild(a),r=document.createElement("div"),r.setAttribute("data-messenger-peek-shadow",""),b(r,{hidden:!0}),document.body.appendChild(r);let x=!1;const T=()=>{x||!t||(x=!0,t.contentWindow.postMessage({type:"INIT",origin:window.location.origin,token:s||null,variables:l||null,allowUnauthenticated:g},d))};f=k=>{if(k.origin!==d)return;const n=k.data;!n||typeof n!="object"||(n.type==="READY"?T():n.type==="RESIZE"&&t&&(E(t,n.displayMode||o,n.state,{width:n.width,height:n.height}),a&&(n.state==="closed"&&n.launcherWidth&&n.launcherHeight?p(a,{width:n.launcherWidth,height:n.launcherHeight,hovered:!!n.launcherHovered}):p(a,{hidden:!0})),r&&(n.state==="closed"&&n.peek?b(r,{...n.peek,hovered:!!n.peekHovered}):b(r,{hidden:!0}))))},window.addEventListener("message",f),t.addEventListener("load",T),setTimeout(()=>{x||console.warn("[messenger] iframe did not boot after",1e4,"ms — check CSP frame-ancestors and network")},1e4)}function m(){f&&(window.removeEventListener("message",f),f=null),t&&(t.remove(),t=null),a&&(a.remove(),a=null),r&&(r.remove(),r=null),d=""}function y(e){!t||!d||!e||typeof e!="object"||t.contentWindow.postMessage({type:"UPDATE",payload:e},d)}function S(e){!t||!d||!e||typeof e!="object"||t.contentWindow.postMessage({type:"CONTEXT",payload:e},d)}function p(e,i){if(i.hidden){e.style.cssText="display:none";return}const c=i.width||50,s=i.height||50,l=Math.max(20,c-6),o=Math.max(20,s-6),u=8+(c-l)/2,g=8+(s-o)/2,w=i.hovered?"0 8px 22px rgba(0, 0, 0, 0.26)":"0 4px 14px rgba(0, 0, 0, 0.18)";e.style.cssText=["position:fixed","pointer-events:none",`bottom:${g}px`,`right:${u}px`,`width:${l}px`,`height:${o}px`,"border-radius:50%","background:transparent",`box-shadow:${w}`,"transition:box-shadow 100ms ease","z-index:2147483646"].join(";")}function b(e,i){if(i.hidden){e.style.cssText="display:none";return}const c=i.width||286,s=i.height||80,l=8+(i.rightOffset||0),o=8+(i.bottomOffset||0),u=i.hovered?"0 6px 18px rgba(0, 0, 0, 0.16)":"0 3px 10px rgba(0, 0, 0, 0.10)";e.style.cssText=["position:fixed","pointer-events:none",`bottom:${o}px`,`right:${l}px`,`width:${c}px`,`height:${s}px`,"border-radius:16px 16px 8px 16px","background:transparent",`box-shadow:${u}`,"transition:box-shadow 100ms ease, width 100ms ease, height 100ms ease, right 100ms ease, bottom 100ms ease","z-index:2147483646"].join(";")}function O(e){return e.endsWith("/")?e.slice(0,-1):e}function E(e,i,c,s){const l=["position:fixed","border:0","z-index:2147483647","color-scheme:normal","background:transparent"];let o;if(i==="embedded")o=["inset:0","width:100%","height:100%"];else if(c==="closed"){const u=s&&s.width>0?s.width:80,g=s&&s.height>0?s.height:80;o=["bottom:0","right:0",`width:${u}px`,`height:${g}px`]}else i==="sheet"?o=["top:0","bottom:0","right:0","width:min(470px, 100vw)","height:100dvh"]:o=["bottom:0","right:0","width:460px","height:720px","max-width:100vw","max-height:100vh"];e.style.cssText=l.concat(o).join(";")}const M="0.5.65",$={init:v,destroy:m,update:y,context:S,version:M};return h.context=S,h.default=$,h.destroy=m,h.init=v,h.update=y,h.version=M,Object.defineProperties(h,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),h}({});
1
+ var Messenger=function(h){"use strict";let t=null,a=null,r=null,d="",f=null;function v(e){t&&m();const i=e.widgetId||"",c=e.baseUrl||"";d=e.widgetOrigin||c;const s=e.token||"";let l=null;e.variables&&typeof e.variables=="object"?l=e.variables:e.context&&typeof e.context=="object"&&(l=e.context);const o=e.displayMode||"floating",u=e.language||"",g=e.allowUnauthenticated===!0;if(!i||!d){console.warn("[messenger] init skipped — missing widgetId or widgetOrigin");return}!g&&!s&&console.warn("[messenger] init: allowUnauthenticated=false but no token provided. In app mode you must pass a `token` (JWT linked) at every init() call. See messenger-back /auth/jwt to generate one server-side. Without a token, /session will return 403.");const w=new URL(`${O(d)}/widget/${encodeURIComponent(i)}`);o!=="floating"&&w.searchParams.set("display_mode",o),u&&w.searchParams.set("language",u),t=document.createElement("iframe"),t.src=w.toString(),t.title="Messenger",t.setAttribute("aria-label","Messenger"),t.setAttribute("allow","clipboard-write; microphone; notifications; display-capture"),t.setAttribute("data-messenger-widget",""),E(t,o,"closed"),document.body.appendChild(t),a=document.createElement("div"),a.setAttribute("data-messenger-shadow",""),p(a,{hidden:!0}),document.body.appendChild(a),r=document.createElement("div"),r.setAttribute("data-messenger-peek-shadow",""),b(r,{hidden:!0}),document.body.appendChild(r);let x=!1;const T=()=>{x||!t||(x=!0,t.contentWindow.postMessage({type:"INIT",origin:window.location.origin,token:s||null,variables:l||null,allowUnauthenticated:g},d))};f=k=>{if(k.origin!==d)return;const n=k.data;!n||typeof n!="object"||(n.type==="READY"?T():n.type==="RESIZE"&&t&&(E(t,n.displayMode||o,n.state,{width:n.width,height:n.height}),a&&(n.state==="closed"&&n.launcherWidth&&n.launcherHeight?p(a,{width:n.launcherWidth,height:n.launcherHeight,hovered:!!n.launcherHovered}):p(a,{hidden:!0})),r&&(n.state==="closed"&&n.peek?b(r,{...n.peek,hovered:!!n.peekHovered}):b(r,{hidden:!0}))))},window.addEventListener("message",f),t.addEventListener("load",T),setTimeout(()=>{x||console.warn("[messenger] iframe did not boot after",1e4,"ms — check CSP frame-ancestors and network")},1e4)}function m(){f&&(window.removeEventListener("message",f),f=null),t&&(t.remove(),t=null),a&&(a.remove(),a=null),r&&(r.remove(),r=null),d=""}function y(e){!t||!d||!e||typeof e!="object"||t.contentWindow.postMessage({type:"UPDATE",payload:e},d)}function S(e){!t||!d||!e||typeof e!="object"||t.contentWindow.postMessage({type:"CONTEXT",payload:e},d)}function p(e,i){if(i.hidden){e.style.cssText="display:none";return}const c=i.width||50,s=i.height||50,l=Math.max(20,c-6),o=Math.max(20,s-6),u=8+(c-l)/2,g=8+(s-o)/2,w=i.hovered?"0 8px 22px rgba(0, 0, 0, 0.26)":"0 4px 14px rgba(0, 0, 0, 0.18)";e.style.cssText=["position:fixed","pointer-events:none",`bottom:${g}px`,`right:${u}px`,`width:${l}px`,`height:${o}px`,"border-radius:50%","background:transparent",`box-shadow:${w}`,"transition:box-shadow 100ms ease","z-index:2147483646"].join(";")}function b(e,i){if(i.hidden){e.style.cssText="display:none";return}const c=i.width||286,s=i.height||80,l=8+(i.rightOffset||0),o=8+(i.bottomOffset||0),u=i.hovered?"0 6px 18px rgba(0, 0, 0, 0.16)":"0 3px 10px rgba(0, 0, 0, 0.10)";e.style.cssText=["position:fixed","pointer-events:none",`bottom:${o}px`,`right:${l}px`,`width:${c}px`,`height:${s}px`,"border-radius:16px 16px 8px 16px","background:transparent",`box-shadow:${u}`,"transition:box-shadow 100ms ease, width 100ms ease, height 100ms ease, right 100ms ease, bottom 100ms ease","z-index:2147483646"].join(";")}function O(e){return e.endsWith("/")?e.slice(0,-1):e}function E(e,i,c,s){const l=["position:fixed","border:0","z-index:2147483647","color-scheme:normal","background:transparent"];let o;if(i==="embedded")o=["inset:0","width:100%","height:100%"];else if(c==="closed"){const u=s&&s.width>0?s.width:80,g=s&&s.height>0?s.height:80;o=["bottom:0","right:0",`width:${u}px`,`height:${g}px`]}else i==="sheet"?o=["top:0","bottom:0","right:0","width:min(470px, 100vw)","height:100dvh"]:o=["bottom:0","right:0","width:460px","height:720px","max-width:100vw","max-height:100vh"];e.style.cssText=l.concat(o).join(";")}const M="0.5.66",$={init:v,destroy:m,update:y,context:S,version:M};return h.context=S,h.default=$,h.destroy=m,h.init=v,h.update=y,h.version=M,Object.defineProperties(h,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),h}({});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@_solaris/messenger-widget",
3
- "version": "0.5.65",
3
+ "version": "0.5.66",
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",