@_solaris/messenger-widget 0.5.48 → 0.5.49
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/iframe/iframe.js +1 -1
- package/dist/messenger.cjs +1 -1
- package/dist/messenger.js +1 -1
- package/dist/snippet.js +1 -1
- package/package.json +1 -1
package/dist/messenger.js
CHANGED
|
@@ -6571,7 +6571,7 @@ function ao(e, t, n, i, r, s) {
|
|
|
6571
6571
|
], 6)) : b("", !0)
|
|
6572
6572
|
], 6);
|
|
6573
6573
|
}
|
|
6574
|
-
const co = /* @__PURE__ */ R(Wa, [["render", ao], ["__scopeId", "data-v-543e7817"]]), uo = "0.5.
|
|
6574
|
+
const co = /* @__PURE__ */ R(Wa, [["render", ao], ["__scopeId", "data-v-543e7817"]]), uo = "0.5.49";
|
|
6575
6575
|
export {
|
|
6576
6576
|
oe as AIAvatar,
|
|
6577
6577
|
ve as AVATAR_COLORS,
|
package/dist/snippet.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var Messenger=function(h){"use strict";let t=null,r=null,a=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"),t.setAttribute("data-messenger-widget",""),E(t,o,"closed"),document.body.appendChild(t),r=document.createElement("div"),r.setAttribute("data-messenger-shadow",""),p(r,{hidden:!0}),document.body.appendChild(r),a=document.createElement("div"),a.setAttribute("data-messenger-peek-shadow",""),b(a,{hidden:!0}),document.body.appendChild(a);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}),r&&(n.state==="closed"&&n.launcherWidth&&n.launcherHeight?p(r,{width:n.launcherWidth,height:n.launcherHeight,hovered:!!n.launcherHovered}):p(r,{hidden:!0})),a&&(n.state==="closed"&&n.peek?b(a,{...n.peek,hovered:!!n.peekHovered}):b(a,{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),r&&(r.remove(),r=null),a&&(a.remove(),a=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.
|
|
1
|
+
var Messenger=function(h){"use strict";let t=null,r=null,a=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"),t.setAttribute("data-messenger-widget",""),E(t,o,"closed"),document.body.appendChild(t),r=document.createElement("div"),r.setAttribute("data-messenger-shadow",""),p(r,{hidden:!0}),document.body.appendChild(r),a=document.createElement("div"),a.setAttribute("data-messenger-peek-shadow",""),b(a,{hidden:!0}),document.body.appendChild(a);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}),r&&(n.state==="closed"&&n.launcherWidth&&n.launcherHeight?p(r,{width:n.launcherWidth,height:n.launcherHeight,hovered:!!n.launcherHovered}):p(r,{hidden:!0})),a&&(n.state==="closed"&&n.peek?b(a,{...n.peek,hovered:!!n.peekHovered}):b(a,{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),r&&(r.remove(),r=null),a&&(a.remove(),a=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.49",$={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.
|
|
3
|
+
"version": "0.5.49",
|
|
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",
|