@_solaris/messenger-widget 0.5.5 → 0.5.7
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/dist/types/snippet.d.ts +4 -2
- package/package.json +1 -1
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.
|
|
6105
|
+
const Ha = /* @__PURE__ */ R(Ta, [["render", Pa], ["__scopeId", "data-v-1c840488"]]), $a = "0.5.7";
|
|
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(
|
|
1
|
+
var Messenger=function(i){"use strict";let e=null,s="",r=null;function m(t){e&&l();const a=t.widgetId||"",c=t.baseUrl||"";s=t.widgetOrigin||c;const g=t.token||"",n=t.context&&typeof t.context=="object"?t.context:null,d=t.displayMode||"floating",p=t.language||"";if(!a||!s){console.warn("[messenger] init skipped — missing widgetId or widgetOrigin");return}const u=new URL(`${M(s)}/widget/${encodeURIComponent(a)}`);d!=="floating"&&u.searchParams.set("display_mode",d),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",""),h(e,d,"closed"),document.body.appendChild(e);let f=!1;const S=()=>{f||!e||(f=!0,e.contentWindow.postMessage({type:"INIT",origin:window.location.origin,token:g||null,context:n||null},s))};r=b=>{if(b.source!==(e==null?void 0:e.contentWindow))return;const o=b.data;!o||typeof o!="object"||(o.type==="READY"?S():o.type==="RESIZE"&&e&&h(e,o.displayMode||d,o.state))},window.addEventListener("message",r),e.addEventListener("load",S),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 M(t){return t.endsWith("/")?t.slice(0,-1):t}function h(t,a,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"]:a==="sheet"?n=["top:0","bottom:0","right:0","width:min(480px, 100vw)","height:100vh"]:a==="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 w="0.5.7",E={init:m,destroy:l,version:w};return i.default=E,i.destroy=l,i.init=m,i.version=w,Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),i}({});
|
package/dist/types/snippet.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
declare namespace Messenger {
|
|
1
|
+
declare namespace _default {
|
|
3
2
|
export { init };
|
|
4
3
|
export { destroy };
|
|
4
|
+
export { version };
|
|
5
5
|
}
|
|
6
|
+
export default _default;
|
|
6
7
|
export function init(opts: any): void;
|
|
7
8
|
export function destroy(): void;
|
|
9
|
+
export const version: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@_solaris/messenger-widget",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.7",
|
|
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",
|