isometrik-plugin-chat-sdk 2.0.3 → 2.0.5
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/cjs/{app-globals-61a8bfde.js → app-globals-dba84d07.js} +4 -4
- package/dist/cjs/{app-globals-61a8bfde.js.map → app-globals-dba84d07.js.map} +1 -1
- package/dist/cjs/attachment-preview_22.cjs.entry.js +65 -53
- package/dist/cjs/attachment-preview_22.cjs.entry.js.map +1 -1
- package/dist/cjs/{send-media-14908d4b.js → groupcast-5e3d49c4.js} +1 -127
- package/dist/cjs/groupcast-5e3d49c4.js.map +1 -0
- package/dist/cjs/index.cjs.js +9 -9
- package/dist/cjs/isometrik-webchat.cjs.js +4 -4
- package/dist/cjs/loader.cjs.js +4 -4
- package/dist/cjs/login-page_3.cjs.entry.js +45 -43
- package/dist/cjs/login-page_3.cjs.entry.js.map +1 -1
- package/dist/cjs/{runtime-controls-201c71ba.js → runtime-controls-b5a3836e.js} +21 -21
- package/dist/cjs/{runtime-controls-201c71ba.js.map → runtime-controls-b5a3836e.js.map} +1 -1
- package/dist/cjs/send-media-2c02bba7.js +319 -0
- package/dist/cjs/send-media-2c02bba7.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js +25 -17
- package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js +15 -16
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js +9 -6
- package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/message-info/message-info.js +6 -2
- package/dist/collection/components/ChatUIComponent/shared/message-info/message-info.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/offline-host.js +7 -6
- package/dist/collection/components/my-component/web-chat/offline-host.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/public-send.js +3 -3
- package/dist/collection/components/my-component/web-chat/public-send.js.map +1 -1
- package/dist/collection/components/theme-provider.js +2 -1
- package/dist/collection/components/theme-provider.js.map +1 -1
- package/dist/collection/lib/chat/index.js +1 -1
- package/dist/collection/lib/chat/index.js.map +1 -1
- package/dist/collection/lib/chat/send-media.js +30 -5
- package/dist/collection/lib/chat/send-media.js.map +1 -1
- package/dist/components/ChatFooter.js +15 -16
- package/dist/components/ChatFooter.js.map +1 -1
- package/dist/components/ChatSidebar.js +25 -17
- package/dist/components/ChatSidebar.js.map +1 -1
- package/dist/components/WebChat.js +10 -8
- package/dist/components/WebChat.js.map +1 -1
- package/dist/components/WebChatBody.js +9 -6
- package/dist/components/WebChatBody.js.map +1 -1
- package/dist/components/client.js +1 -121
- package/dist/components/client.js.map +1 -1
- package/dist/components/index.js +3 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/message-info2.js +6 -2
- package/dist/components/message-info2.js.map +1 -1
- package/dist/components/send-media.js +150 -0
- package/dist/components/send-media.js.map +1 -0
- package/dist/components/theme-provider2.js +2 -1
- package/dist/components/theme-provider2.js.map +1 -1
- package/dist/esm/{app-globals-2beecb81.js → app-globals-8fea092d.js} +3 -3
- package/dist/esm/{app-globals-2beecb81.js.map → app-globals-8fea092d.js.map} +1 -1
- package/dist/esm/attachment-preview_22.entry.js +54 -42
- package/dist/esm/attachment-preview_22.entry.js.map +1 -1
- package/dist/esm/{send-media-917dcc2f.js → groupcast-58a59d64.js} +2 -122
- package/dist/esm/groupcast-58a59d64.js.map +1 -0
- package/dist/esm/index.js +4 -4
- package/dist/esm/isometrik-webchat.js +4 -4
- package/dist/esm/loader.js +4 -4
- package/dist/esm/login-page_3.entry.js +12 -10
- package/dist/esm/login-page_3.entry.js.map +1 -1
- package/dist/esm/{runtime-controls-cf599fe2.js → runtime-controls-c5ba5009.js} +3 -3
- package/dist/esm/{runtime-controls-cf599fe2.js.map → runtime-controls-c5ba5009.js.map} +1 -1
- package/dist/esm/send-media-588837c7.js +296 -0
- package/dist/esm/send-media-588837c7.js.map +1 -0
- package/dist/isometrik-webchat/index.esm.js +1 -1
- package/dist/isometrik-webchat/isometrik-webchat.esm.js +1 -1
- package/dist/isometrik-webchat/p-1953573d.js +2 -0
- package/dist/isometrik-webchat/p-1953573d.js.map +1 -0
- package/dist/isometrik-webchat/p-1a6e6524.js +2 -0
- package/dist/isometrik-webchat/p-1a6e6524.js.map +1 -0
- package/dist/isometrik-webchat/p-70f66001.js +2 -0
- package/dist/isometrik-webchat/{p-0731d488.js.map → p-70f66001.js.map} +1 -1
- package/dist/isometrik-webchat/p-8816acc1.js +2 -0
- package/dist/isometrik-webchat/p-92eec03b.entry.js +2 -0
- package/dist/isometrik-webchat/p-92eec03b.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-b16c3db0.entry.js +2 -0
- package/dist/isometrik-webchat/p-b16c3db0.entry.js.map +1 -0
- package/dist/types/components/ChatUIComponent/Footer/ChatFooter.d.ts +2 -22
- package/dist/types/lib/chat/index.d.ts +1 -1
- package/dist/types/lib/chat/send-media.d.ts +8 -0
- package/package.json +2 -1
- package/dist/cjs/media-limits-eba42629.js +0 -165
- package/dist/cjs/media-limits-eba42629.js.map +0 -1
- package/dist/cjs/send-media-14908d4b.js.map +0 -1
- package/dist/esm/media-limits-3fa07c09.js +0 -152
- package/dist/esm/media-limits-3fa07c09.js.map +0 -1
- package/dist/esm/send-media-917dcc2f.js.map +0 -1
- package/dist/isometrik-webchat/p-04803c0b.entry.js +0 -2
- package/dist/isometrik-webchat/p-04803c0b.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-0731d488.js +0 -2
- package/dist/isometrik-webchat/p-7d4cc4e3.entry.js +0 -2
- package/dist/isometrik-webchat/p-7d4cc4e3.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-7f415f28.js +0 -2
- package/dist/isometrik-webchat/p-bdcdf1c5.js +0 -2
- package/dist/isometrik-webchat/p-bdcdf1c5.js.map +0 -1
- package/dist/isometrik-webchat/p-eb54f75d.js +0 -2
- package/dist/isometrik-webchat/p-eb54f75d.js.map +0 -1
- /package/dist/isometrik-webchat/{p-7f415f28.js.map → p-8816acc1.js.map} +0 -0
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{d as t}from"./p-5162774c.js";import{r as e,n,i as o,f as s,a as i,b as r,s as a,m as c,c as u,d as f,e as d,g as l,h as m,p as h,j as p}from"./p-eb54f75d.js";import{f as y,s as v,a as b,b as w,c as C,d as g}from"./p-bdcdf1c5.js";import{f as M}from"./p-b1330793.js";const R=["chatReady","conversationsChange","messagesChange","conversationSelect","replyChange","chatError","unreadMessageCountUpdated","conversationNotFound","messageReadStatusUpdated"];const T=["selectConversation","sendText","sendMedia","setReply","clearReply","loadMoreMessages","loadMoreConversations","getChatState","setCustomParts"];function j(t,e,...n){const o=t===null||t===void 0?void 0:t[e];if(typeof o!=="function"){return Promise.reject(new Error(`[isometrik-webchat] method "${e}" is not available`))}return Promise.resolve(o.apply(t,n))}function E(t){if(!t)return null;const e=t;return{selectConversation:t=>j(e,"selectConversation",t),sendText:(t,n)=>j(e,"sendText",t,n),sendMedia:(t,n,o)=>j(e,"sendMedia",t,n,o),setReply:t=>j(e,"setReply",t),clearReply:()=>j(e,"clearReply"),loadMoreMessages:()=>j(e,"loadMoreMessages"),loadMoreConversations:()=>j(e,"loadMoreConversations"),getChatState:()=>j(e,"getChatState"),setCustomParts:t=>j(e,"setCustomParts",t),on(t,n){e.addEventListener(t,n);return()=>e.removeEventListener(t,n)},methods:T,events:R}}function P(t){return!!t&&t.nodeType===1}function k(t){return t.getAttribute("slot")||t.slot||null}function O(t,e,n){if(!t||!n)return null;x(t,e);n.slot=e;n.setAttribute("slot",e);t.appendChild(n);return n}function x(t,e){if(!t)return;Array.from(t.children).forEach((t=>{if(!P(t))return;if(k(t)===e){t.remove()}}))}function _(t,e){const n=document.createElement("div");n.slot=t;n.setAttribute("slot",t);n.setAttribute("data-isometrik-slot",t);if(e)n.className=e;n.style.height="100%";n.style.width="100%";n.style.display="contents";return n}function D(t,e){if(!t||!e)return;Object.entries(e).forEach((([e,n])=>{if(n)O(t,e,n)}))}function z(){if(typeof window==="undefined")return{};window.__isometrikChatComponents=window.__isometrikChatComponents||{};return window.__isometrikChatComponents}function S(t){const e=z();if(t.themeProvider!==undefined)e.themeProvider=t.themeProvider;if(t.chatComponent!==undefined)e.chatComponent=t.chatComponent}function A(){if(typeof window==="undefined")return;window.__isometrikChatComponents={}}function H(t){var e,n;if(t){const o=t;if(o.tagName==="THEME-PROVIDER")return o;const s=(e=o.closest)===null||e===void 0?void 0:e.call(o,"theme-provider");if(s)return s;const i=M(o);if(((n=i===null||i===void 0?void 0:i.parentElement)===null||n===void 0?void 0:n.tagName)==="THEME-PROVIDER"){return i.parentElement}}const o=z().themeProvider;if(o)return o;if(typeof document==="undefined")return null;return document.querySelector("theme-provider")}function I(t){if(t){const e=t;if(e.tagName==="WEB-CHAT")return e;const n=M(e);if(n)return n}const e=z().chatComponent;if(e)return e;if(typeof document==="undefined")return null;return document.querySelector("web-chat")}const q="https://isometrik-website-bucket.s3.ap-south-1.amazonaws.com/styles/chat-combined-theme.css";function K(t){return[t.containerId||"__body__",t.isometrikUserId,t.userToken,t.projectId,t.accountId,t.keysetId].join("|")}function U(){if(typeof window==="undefined"){return{count:0,sessionKey:"",instance:null,pendingDestroy:null}}const t=window;if(!t.__isometrikChatRetain){t.__isometrikChatRetain={count:0,sessionKey:"",instance:null,pendingDestroy:null}}return t.__isometrikChatRetain}function B(t){const e=Object.assign(Object.assign({},t.themeObject||{}),t.theme||{});const o=n(e);return Object.keys(o).length?o:undefined}function F(t,e,n){if(n!==undefined)t[e]=n}function L(t){if(!t)return false;const{themeProvider:e,chatComponent:n}=t;if(!e||!n)return false;const o=z();return o.chatComponent===n&&o.themeProvider===e}function W(){const e=U();if(e.pendingDestroy){clearTimeout(e.pendingDestroy);e.pendingDestroy=null}e.count=0;e.sessionKey="";e.instance=null;t();document.querySelectorAll("theme-provider").forEach((t=>{if(!t.querySelector("web-chat")&&t.childNodes.length===0){t.remove()}}));A()}const $=W;function V(t){if(!t.licenseKey||!t.appSecret||!t.userSecret||!t.userToken||!t.isometrikUserId||!t.projectId||!t.keysetId||!t.accountId){console.error("Missing required props to Initialize chat!");return null}W();const n=K(t);const o=document.createElement("theme-provider");const s=t.themeUrl||q;const i=B(t);if(t.defaultTheme){o.setAttribute("mode",t.defaultTheme)}o.setAttribute("theme-path",s);if(i){o.themeObject=i}const r=document.createElement("web-chat");r.baseUrl=t.baseUrl||"https://apis.isometrik.io";r.hostUrl=t.hostUrl||"wss://connections.isometrik.io:2053/mqtt";r.licenseKey=t.licenseKey;r.appSecret=t.appSecret;r.userSecret=t.userSecret;r.userToken=t.userToken;r.isometrikUserId=t.isometrikUserId;r.projectId=t.projectId;r.keysetId=t.keysetId;r.accountId=t.accountId;r.defaultTheme=t.defaultTheme||"light";r.themeUrl=s;r.style.width="100%";r.style.height="100%";if(t.customParts){r.customParts=t.customParts}F(r,"showProfileRail",e(t));F(r,"showChatWallpaper",t.showChatWallpaper);F(r,"groupcastEnabled",t.groupcastEnabled);F(r,"showHeader",t.showHeader);F(r,"showComposer",t.showComposer);F(r,"showEmptyState",t.showEmptyState);F(r,"showConversationList",t.showConversationList);F(r,"showRightPanel",t.showRightPanel);D(r,t.slots);o.appendChild(r);o.style.width="100%";o.style.height="100%";o.style.display="block";const a=t.containerId?document.getElementById(t.containerId):document.body;if(a){a.appendChild(o)}else{console.error("Container with the specified ID not found. Appending to body instead.");document.body.appendChild(o)}S({themeProvider:o,chatComponent:r});const c=E(r);const u={themeProvider:o,chatComponent:r,api:c,sessionKey:n,destroy:W};const f=U();f.instance=u;f.sessionKey=n;f.count=Math.max(f.count,1);return u}function N(t){const e=U();if(e.pendingDestroy){clearTimeout(e.pendingDestroy);e.pendingDestroy=null}const n=K(t);if(e.sessionKey===n&&L(e.instance)){return e.instance}return V(t)}function G(t){const e=U();if(e.pendingDestroy){clearTimeout(e.pendingDestroy);e.pendingDestroy=null}e.count+=1;return N(t)}function J(t=0){const e=U();e.count=Math.max(0,e.count-1);if(e.count>0)return;if(e.pendingDestroy)clearTimeout(e.pendingDestroy);e.pendingDestroy=setTimeout((()=>{e.pendingDestroy=null;if(e.count>0)return;W()}),t)}const Q=V;const X={session:{init:t=>o(t),fetchUserDetails:s},conversations:{list:i,details:r,sortByLatest:a,mergeUnique:c},messages:{list:y,search:v,links:b,mediaCount:w,mediaAttachments:C,filterMedia:g},groupcast:{details:u,members:f,contacts:d},media:{mediaTypeFromMime:l,customTypeFromMime:m,prepareMediaAttachments:h,buildReplyMetaData:p}};const Y="__isometrikReactBridge";function Z(t,e,n){t.root.render(e.createElement(t.Component,Object.assign(Object.assign({},t.extraProps||{}),n)))}function tt(t,e,n){if(typeof customElements==="undefined")return t;if(customElements.get(t))return t;const{react:o,createRoot:s,propKeys:i,extraProps:r}=n;class a extends HTMLElement{constructor(){super(...arguments);this._store=null}connectedCallback(){if(!this._store){this._store={root:s(this),Component:e,extraProps:r}}this.render()}disconnectedCallback(){var t;try{(t=this._store)===null||t===void 0?void 0:t.root.unmount()}catch(t){}this._store=null}render(){if(!this._store||!this.isConnected)return;const t={};i.forEach((e=>{t[e]=this[`_${e}`]}));Z(this._store,o,t)}}i.forEach((t=>{const e=`_${t}`;Object.defineProperty(a.prototype,t,{get(){return this[e]},set(t){if(this[e]===t)return;this[e]=t;if(this.isConnected)this.render()},configurable:true})}));customElements.define(t,a);return t}function et(t,e,n){const o=_(t,n.className);o.style.display="block";o.style.height="100%";const s={root:n.createRoot(o),Component:e,extraProps:n.props};o[Y]=s;Z(s,n.react,{});o.updateProps=t=>{s.extraProps=Object.assign(Object.assign({},s.extraProps||{}),t);Z(s,n.react,{})};o.unmount=()=>{try{s.root.unmount()}catch(t){}delete o[Y]};return o}function nt(t){if(!t)return;const e=t;if(typeof e.unmount==="function"){e.unmount();return}const n=t[Y];if(!n)return;try{n.root.unmount()}catch(t){}delete t[Y]}function ot(t,e){const n=I(e);if(!n){console.error("Isometrik chat is not initialized");return}if(t.isChatFilter!==undefined){n.isChatFilter=t.isChatFilter}}function st(t,e){const n=H(e);const o=I(e);if(o){o.defaultTheme=t}if(n){n.setAttribute("mode",t);if(typeof n.setTheme==="function"){n.setTheme(t)}return}console.error("Theme provider is not initialized")}function it(t,e){const o=H(e);if(!o){console.error("Theme provider is not initialized");return}if(t.themePath){o.setAttribute("theme-path",t.themePath)}if(t.themeObject){o.themeObject=n(t.themeObject)}}function rt(t){const e=H(t);if(!e){console.error("Theme provider is not initialized");return}if(typeof e.toggleTheme==="function"){e.toggleTheme()}}export{R as W,J as a,X as b,E as c,W as d,N as e,tt as f,it as g,H as h,V as i,I as j,ot as k,T as l,et as m,K as n,Q as o,$ as p,O as q,G as r,st as s,rt as t,nt as u,x as v,_ as w,D as x,z as y};
|
|
2
|
-
//# sourceMappingURL=p-0731d488.js.map
|