@_solaris/messenger-widget 0.5.24 → 0.5.25
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 +2 -2
- package/dist/messenger.cjs +2 -2
- package/dist/messenger.js +2 -2
- package/dist/snippet.js +1 -1
- package/package.json +1 -1
package/dist/messenger.js
CHANGED
|
@@ -738,7 +738,7 @@ function Qe(e) {
|
|
|
738
738
|
if (!h || typeof h != "object") return null;
|
|
739
739
|
const m = {}, g = {};
|
|
740
740
|
for (const [d, f] of Object.entries(h))
|
|
741
|
-
f !== void 0 && (d === "name" || d === "email" ? f != null && String(f).trim() !== "" && (m[d] = f) : (d === "values" || d === "metadata") && f && typeof f == "object" ? Object.assign(g, f) : g[d] = f);
|
|
741
|
+
f !== void 0 && (d === "name" || d === "email" || d === "language" ? f != null && String(f).trim() !== "" && (m[d] = f) : (d === "values" || d === "metadata") && f && typeof f == "object" ? Object.assign(g, f) : g[d] = f);
|
|
742
742
|
return Object.keys(g).length && (m.values = g), Object.keys(m).length ? m : null;
|
|
743
743
|
}
|
|
744
744
|
function de(h) {
|
|
@@ -6191,7 +6191,7 @@ function ja(e, t, n, i, r, s) {
|
|
|
6191
6191
|
], 6)) : b("", !0)
|
|
6192
6192
|
], 2);
|
|
6193
6193
|
}
|
|
6194
|
-
const Ha = /* @__PURE__ */ B(Ma, [["render", ja], ["__scopeId", "data-v-608c117b"]]), qa = "0.5.
|
|
6194
|
+
const Ha = /* @__PURE__ */ B(Ma, [["render", ja], ["__scopeId", "data-v-608c117b"]]), qa = "0.5.25";
|
|
6195
6195
|
export {
|
|
6196
6196
|
le as AIAvatar,
|
|
6197
6197
|
ge as AVATAR_COLORS,
|
package/dist/snippet.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var Messenger=function(l){"use strict";let n=null,d=null,r=null,c="",u=null;function y(e){n&&w();const i=e.widgetId||"",a=e.baseUrl||"";c=e.widgetOrigin||a;const o=e.token||"",h=e.context&&typeof e.context=="object"?e.context:null,s=e.displayMode||"floating",g=e.language||"",p=e.allowUnauthenticated===!0;if(!i||!c){console.warn("[messenger] init skipped — missing widgetId or widgetOrigin");return}const x=new URL(`${T(c)}/widget/${encodeURIComponent(i)}`);s!=="floating"&&x.searchParams.set("display_mode",s),g&&x.searchParams.set("language",g),n=document.createElement("iframe"),n.src=x.toString(),n.title="Messenger",n.setAttribute("aria-label","Messenger"),n.setAttribute("allow","clipboard-write; microphone; notifications"),n.setAttribute("data-messenger-widget",""),v(n,s,"closed"),document.body.appendChild(n),d=document.createElement("div"),d.setAttribute("data-messenger-shadow",""),m(d,{hidden:!0}),document.body.appendChild(d),r=document.createElement("div"),r.setAttribute("data-messenger-peek-shadow",""),f(r,{hidden:!0}),document.body.appendChild(r);let b=!1;const E=()=>{b||!n||(b=!0,n.contentWindow.postMessage({type:"INIT",origin:window.location.origin,token:o||null,context:h||null,allowUnauthenticated:p},c))};u=M=>{if(M.origin!==c)return;const t=M.data;!t||typeof t!="object"||(t.type==="READY"?E():t.type==="RESIZE"&&n&&(v(n,t.displayMode||s,t.state,{width:t.width,height:t.height}),d&&(t.state==="closed"&&t.launcherWidth&&t.launcherHeight?m(d,{width:t.launcherWidth,height:t.launcherHeight,hovered:!!t.launcherHovered}):m(d,{hidden:!0})),r&&(t.state==="closed"&&t.peek?f(r,{...t.peek,hovered:!!t.peekHovered}):f(r,{hidden:!0}))))},window.addEventListener("message",u),n.addEventListener("load",E),setTimeout(()=>{b||console.warn("[messenger] iframe did not boot after",1e4,"ms — check CSP frame-ancestors and network")},1e4)}function w(){u&&(window.removeEventListener("message",u),u=null),n&&(n.remove(),n=null),d&&(d.remove(),d=null),r&&(r.remove(),r=null),c=""}function m(e,i){if(i.hidden){e.style.cssText="display:none";return}const a=i.width||64,o=i.height||64,h=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:8px","right:8px",`width:${a}px`,`height:${o}px`,"border-radius:50%","background:transparent",`box-shadow:${h}`,"transition:box-shadow 100ms ease, width 100ms ease, height 100ms ease","z-index:2147483646"].join(";")}function f(e,i){if(i.hidden){e.style.cssText="display:none";return}const a=i.width||286,o=i.height||80,h=8+(i.rightOffset||0),s=8+(i.bottomOffset||0),g=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:${s}px`,`right:${h}px`,`width:${a}px`,`height:${o}px`,"border-radius:16px 16px 8px 16px","background:transparent",`box-shadow:${g}`,"transition:box-shadow 100ms ease, width 100ms ease, height 100ms ease, right 100ms ease, bottom 100ms ease","z-index:2147483646"].join(";")}function T(e){return e.endsWith("/")?e.slice(0,-1):e}function v(e,i,a,o){const h=["position:fixed","border:0","z-index:2147483647","color-scheme:normal","background:transparent"];let s;if(i==="embedded")s=["inset:0","width:100%","height:100%"];else if(a==="closed"){const g=o&&o.width>0?o.width:80,p=o&&o.height>0?o.height:80;s=["bottom:0","right:0",`width:${g}px`,`height:${p}px`]}else i==="sheet"?s=["top:0","bottom:0","right:0","width:min(470px, 100vw)","height:
|
|
1
|
+
var Messenger=function(l){"use strict";let n=null,d=null,r=null,c="",u=null;function y(e){n&&w();const i=e.widgetId||"",a=e.baseUrl||"";c=e.widgetOrigin||a;const o=e.token||"",h=e.context&&typeof e.context=="object"?e.context:null,s=e.displayMode||"floating",g=e.language||"",p=e.allowUnauthenticated===!0;if(!i||!c){console.warn("[messenger] init skipped — missing widgetId or widgetOrigin");return}const x=new URL(`${T(c)}/widget/${encodeURIComponent(i)}`);s!=="floating"&&x.searchParams.set("display_mode",s),g&&x.searchParams.set("language",g),n=document.createElement("iframe"),n.src=x.toString(),n.title="Messenger",n.setAttribute("aria-label","Messenger"),n.setAttribute("allow","clipboard-write; microphone; notifications"),n.setAttribute("data-messenger-widget",""),v(n,s,"closed"),document.body.appendChild(n),d=document.createElement("div"),d.setAttribute("data-messenger-shadow",""),m(d,{hidden:!0}),document.body.appendChild(d),r=document.createElement("div"),r.setAttribute("data-messenger-peek-shadow",""),f(r,{hidden:!0}),document.body.appendChild(r);let b=!1;const E=()=>{b||!n||(b=!0,n.contentWindow.postMessage({type:"INIT",origin:window.location.origin,token:o||null,context:h||null,allowUnauthenticated:p},c))};u=M=>{if(M.origin!==c)return;const t=M.data;!t||typeof t!="object"||(t.type==="READY"?E():t.type==="RESIZE"&&n&&(v(n,t.displayMode||s,t.state,{width:t.width,height:t.height}),d&&(t.state==="closed"&&t.launcherWidth&&t.launcherHeight?m(d,{width:t.launcherWidth,height:t.launcherHeight,hovered:!!t.launcherHovered}):m(d,{hidden:!0})),r&&(t.state==="closed"&&t.peek?f(r,{...t.peek,hovered:!!t.peekHovered}):f(r,{hidden:!0}))))},window.addEventListener("message",u),n.addEventListener("load",E),setTimeout(()=>{b||console.warn("[messenger] iframe did not boot after",1e4,"ms — check CSP frame-ancestors and network")},1e4)}function w(){u&&(window.removeEventListener("message",u),u=null),n&&(n.remove(),n=null),d&&(d.remove(),d=null),r&&(r.remove(),r=null),c=""}function m(e,i){if(i.hidden){e.style.cssText="display:none";return}const a=i.width||64,o=i.height||64,h=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:8px","right:8px",`width:${a}px`,`height:${o}px`,"border-radius:50%","background:transparent",`box-shadow:${h}`,"transition:box-shadow 100ms ease, width 100ms ease, height 100ms ease","z-index:2147483646"].join(";")}function f(e,i){if(i.hidden){e.style.cssText="display:none";return}const a=i.width||286,o=i.height||80,h=8+(i.rightOffset||0),s=8+(i.bottomOffset||0),g=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:${s}px`,`right:${h}px`,`width:${a}px`,`height:${o}px`,"border-radius:16px 16px 8px 16px","background:transparent",`box-shadow:${g}`,"transition:box-shadow 100ms ease, width 100ms ease, height 100ms ease, right 100ms ease, bottom 100ms ease","z-index:2147483646"].join(";")}function T(e){return e.endsWith("/")?e.slice(0,-1):e}function v(e,i,a,o){const h=["position:fixed","border:0","z-index:2147483647","color-scheme:normal","background:transparent"];let s;if(i==="embedded")s=["inset:0","width:100%","height:100%"];else if(a==="closed"){const g=o&&o.width>0?o.width:80,p=o&&o.height>0?o.height:80;s=["bottom:0","right:0",`width:${g}px`,`height:${p}px`]}else i==="sheet"?s=["top:0","bottom:0","right:0","width:min(470px, 100vw)","height:100dvh"]:s=["bottom:0","right:0","width:460px","height:720px","max-width:100vw","max-height:100vh"];e.style.cssText=h.concat(s).join(";")}const S="0.5.25",k={init:y,destroy:w,version:S};return l.default=k,l.destroy=w,l.init=y,l.version=S,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),l}({});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@_solaris/messenger-widget",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.25",
|
|
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",
|