@bcc-code/vue-bcc-chat-ui 1.0.6 → 1.0.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.
@@ -1,12 +1,10 @@
1
1
  declare const _default: import("vue").DefineComponent<{
2
2
  accessToken: StringConstructor;
3
3
  chatUid: StringConstructor;
4
- environment: StringConstructor;
5
4
  active: BooleanConstructor;
6
5
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
7
6
  accessToken: StringConstructor;
8
7
  chatUid: StringConstructor;
9
- environment: StringConstructor;
10
8
  active: BooleanConstructor;
11
9
  }>>, {
12
10
  active: boolean;
@@ -70420,7 +70420,6 @@ const RFe = async (e) => {
70420
70420
  props: {
70421
70421
  accessToken: String,
70422
70422
  chatUid: String,
70423
- environment: String,
70424
70423
  active: Boolean
70425
70424
  },
70426
70425
  setup(e) {
@@ -3612,4 +3612,4 @@ input {
3612
3612
  <cometchat-button iconURL="${c0}" buttonStyle='${JSON.stringify(c)}'></cometchat-button>
3613
3613
  </span>
3614
3614
  </div>
3615
- `}}function k9(){return{height:"auto",width:"100%",minHeight:"150px",padding:"16px",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",boxSizing:"border-box",gap:"8px"}}function x9(){return{position:"absolute",top:"15px",left:"15px",display:"flex",gap:"8px",justifyContent:"center"}}function U9(e,t){return{height:"24px",width:"24px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:(t==null?void 0:t.backIconTint)||e.palette.getPrimary()}}function j9(e,t){return{height:(t==null?void 0:t.height)||"100%",width:(t==null?void 0:t.width)||"100%",background:(t==null?void 0:t.background)||e.palette.getBackground(),borderRadius:(t==null?void 0:t.borderRadius)||"0",border:(t==null?void 0:t.border)||"none",position:"relative"}}function B9(e,t){return{font:(t==null?void 0:t.titleFont)||u.fontHelper(e.typography.text1),color:(t==null?void 0:t.titleColor)||e.palette.getAccent(),background:"transparent"}}const z9=n.defineComponent({name:"CometChatCallLogDetails",components:{CometChatCallButtons:S0,CometChatCallLogRecordings:MS,CometChatCallLogParticipants:pS,CometChatCallLogHistory:mS},props:{call:{type:Object,required:!0},title:{type:String,default:u.localize("CALL_DETAIL”")},backIconUrl:{type:String,default:Mo},avatarStyle:{type:Object,default:()=>({})},onBackClick:{type:Function},data:{type:Function},callLogHistoryConfiguration:{type:Object,default:()=>({})},callLogParticipantsConfiguration:{type:Object,default:()=>({})},callLogRecordingsConfiguration:{type:Object,default:()=>({})},callLogDetailsStyle:{type:Object,default:()=>({})}},setup(e){let{theme:t}=n.inject("theme",{theme:n.ref(new u.CometChatTheme({}))});const o=n.ref(e.call),r=n.ref(null),a=n.ref([]),l=n.ref(!1),s=n.ref(!1),g=n.ref(!1);n.onBeforeMount(()=>{var v;(v=lo.getLoggedinUser())==null||v.then(D=>{D&&(r.value=D,C())}).catch(()=>{console.log("error getting details:")})}),n.watch(()=>e.call,(v,D)=>{v!==D&&(C(),g.value=!1,l.value=!1,s.value=!1),o.value={...v}},{deep:!0});function d(v,D){return new Re.AvatarStyle({height:(D==null?void 0:D.height)||"50px",width:(D==null?void 0:D.width)||"50px"})}function c(v,D){return{color:(D==null?void 0:D.nameTextColor)||v.palette.getAccent(),font:(D==null?void 0:D.nameTextFont)||u.fontHelper(v.typography.title1)}}const C=()=>{var v;a.value=(v=e.data)==null?void 0:v.call(e,e.call,r.value,t.value),(!a.value||!a.value.length)&&(a.value=R9.getDefaultCallTemplate(e.call,r.value,t.value))},S=v=>{const{options:D,id:E}=v;let L=[];if(D&&E!=null){const G=Kr(e.call,r.value);G!=null&&G.getUid?L=D(G,void 0,E):L=D(void 0,G,E)}return L};function p(v){if(v!=null&&v.onClick)v.onClick(e.call);else switch(v.id){case"participants":l.value=!0;break;case"recordings":s.value=!0;break;case"callHistory":g.value=!0;break}}const M=n.computed(()=>r.value&&!l.value&&!s.value&&!g.value),A=n.computed(()=>r.value&&l.value&&!s.value&&!g.value),y=n.computed(()=>r.value&&!l.value&&s.value&&!g.value),T=n.computed(()=>r.value&&!l.value&&!s.value&&g.value);return{theme:t,verifyCallUser:Kr,loggedInUser:r,getAvatarStyle:d,getAvatarTitleStyle:c,templates:a,getOptionsForTemplate:S,getProfileContainerStyle:k9,getBackButtonStyle:U9,getButtonContainerStyle:x9,handleOptionClick:p,showDetailsPage:M,showParticipantsPage:A,showRecordingsPage:y,showCallHistoryPage:T,handlePageOnBackClick:()=>{l.value=!1,s.value=!1,g.value=!1},getCallUser:()=>{const v=Kr(e.call,r.value);if(v!=null&&v.getUid)return v},getCallGroup:()=>{const v=Kr(e.call,r.value);if(v!=null&&v.getGuid)return v},getContainerStyle:j9,getTitleStyle:B9,localize:u.localize}}}),P9={key:0},G9=["iconURL","buttonStyle"],Y9=["avatarStyle","image","name"],F9={key:0,class:"cc-call-details__option-content",style:{display:"flex","justify-content":"center","align-items":"center",width:"100%"}},V9=["innerHTML","onClick"],$9=["v-slot","v-html"];function H9(e,t,o,r,a,l){var s,g,d;const c=n.resolveComponent("CometChatCallLogParticipants"),C=n.resolveComponent("CometChatCallLogRecordings"),S=n.resolveComponent("CometChatCallLogHistory");return n.openBlock(),n.createElementBlock("div",{style:n.normalizeStyle(e.getContainerStyle(e.theme,e.callLogDetailsStyle))},[e.showDetailsPage?(n.openBlock(),n.createElementBlock("div",P9,[e.onBackClick?(n.openBlock(),n.createElementBlock("div",{key:0,style:n.normalizeStyle(e.getButtonContainerStyle())},[n.createElementVNode("cometchat-button",{iconURL:e.backIconUrl,buttonStyle:e.getBackButtonStyle(e.theme,e.callLogDetailsStyle),onCcButtonClicked:t[0]||(t[0]=()=>e.onBackClick())},null,40,G9),n.createElementVNode("div",{style:n.normalizeStyle(e.getTitleStyle(e.theme,e.callLogDetailsStyle))},n.toDisplayString(e.title),5)],4)):n.createCommentVNode("",!0),n.createElementVNode("div",{style:n.normalizeStyle(e.getProfileContainerStyle())},[n.createElementVNode("cometchat-avatar",{avatarStyle:e.getAvatarStyle(e.theme,e.avatarStyle),image:(s=e.verifyCallUser(e.call,e.loggedInUser))==null?void 0:s.avatar,name:(g=e.verifyCallUser(e.call,e.loggedInUser))==null?void 0:g.getName()},null,8,Y9),n.createElementVNode("span",{style:n.normalizeStyle(e.getAvatarTitleStyle(e.theme,e.callLogDetailsStyle))},n.toDisplayString((d=e.verifyCallUser(e.call,e.loggedInUser))==null?void 0:d.getName()),5)],4),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.templates,(p,M)=>(n.openBlock(),n.createElementBlock("div",{key:M},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.getOptionsForTemplate(p),A=>{var y;return n.openBlock(),n.createElementBlock("div",{key:A.id},[(n.openBlock(),n.createElementBlock("div",{key:A.id,style:{width:"100%"},class:"cc-call-details__option"},[A.customView?(n.openBlock(),n.createElementBlock("div",F9,[A.customView.html?(n.openBlock(),n.createElementBlock("div",{key:0,style:{width:"100%"},innerHTML:A.customView.html,onClick:T=>e.handleOptionClick(A)},null,8,V9)):(n.openBlock(),n.createBlock(n.resolveDynamicComponent(A.customView.componentName),n.mergeProps({key:1},{...A.customView.props},n.toHandlers((y=A.customView)==null?void 0:y.listeners)),{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(A.customView.slots,(T,v)=>(n.openBlock(),n.createElementBlock("div",{key:v,"v-slot":[v],"v-html":T},null,8,$9))),128))]),_:2},1040))])):n.createCommentVNode("",!0)]))])}),128)),n.createTextVNode(" "+n.toDisplayString(p.title),1)]))),128))])):n.createCommentVNode("",!0),e.showParticipantsPage?(n.openBlock(),n.createBlock(c,{key:1,call:e.call,title:e.localize("PARTICIPANTS"),backIconUrl:e.callLogParticipantsConfiguration.backIconUrl||e.backIconUrl,onBackClick:e.callLogParticipantsConfiguration.onBackClick||e.handlePageOnBackClick,avatarStyle:e.callLogParticipantsConfiguration.avatarStyle,onItemClick:e.callLogParticipantsConfiguration.onItemClick||null,datePattern:e.callLogParticipantsConfiguration.datePattern||null,listItemStyle:e.callLogParticipantsConfiguration.listItemStyle||null,callLogParticipantsStyle:e.callLogParticipantsConfiguration.callLogParticipantsStyle||null,listItemView:e.callLogParticipantsConfiguration.listItemView||null,subtitleView:e.callLogParticipantsConfiguration.subtitleView||null,tailView:e.callLogParticipantsConfiguration.tailView||null},null,8,["call","title","backIconUrl","onBackClick","avatarStyle","onItemClick","datePattern","listItemStyle","callLogParticipantsStyle","listItemView","subtitleView","tailView"])):n.createCommentVNode("",!0),e.showRecordingsPage?(n.openBlock(),n.createBlock(C,{key:2,call:e.call,title:e.localize("RECORDING"),backIconUrl:e.callLogRecordingsConfiguration.backIconUrl||e.backIconUrl,onBackClick:e.callLogRecordingsConfiguration.onBackClick||e.handlePageOnBackClick,onItemClick:e.callLogRecordingsConfiguration.onItemClick||null,datePattern:e.callLogRecordingsConfiguration.datePattern||null,listItemStyle:e.callLogRecordingsConfiguration.listItemStyle||null,callLogRecordingsStyle:e.callLogRecordingsConfiguration.callLogRecordingsStyle||null,downloadIconUrl:e.callLogRecordingsConfiguration.downloadIconUrl||null,hideDownloadButton:e.callLogRecordingsConfiguration.hideDownloadButton||!1,onDownloadClick:e.callLogRecordingsConfiguration.onDownloadClick||null,listItemView:e.callLogRecordingsConfiguration.listItemView||null,subtitleView:e.callLogRecordingsConfiguration.subtitleView||null,tailView:e.callLogRecordingsConfiguration.tailView||null},null,8,["call","title","backIconUrl","onBackClick","onItemClick","datePattern","listItemStyle","callLogRecordingsStyle","downloadIconUrl","hideDownloadButton","onDownloadClick","listItemView","subtitleView","tailView"])):n.createCommentVNode("",!0),e.showCallHistoryPage?(n.openBlock(),n.createBlock(S,{key:3,callUser:e.getCallUser(),callGroup:e.getCallGroup(),title:e.localize("CALL_HISTORY"),backIconUrl:e.callLogHistoryConfiguration.backIconUrl||e.backIconUrl,emptyStateView:e.callLogHistoryConfiguration.emptyStateView||null,errorStateView:e.callLogHistoryConfiguration.errorStateView||null,loadingIconURL:e.callLogHistoryConfiguration.loadingIconURL||null,loadingStateView:e.callLogHistoryConfiguration.loadingStateView||null,subtitleView:e.callLogHistoryConfiguration.subtitleView||null,tailView:e.callLogHistoryConfiguration.tailView||null,callLogRequestBuilder:e.callLogHistoryConfiguration.callLogRequestBuilder||null,onItemClick:e.callLogHistoryConfiguration.onItemClick||null,onBackClick:e.callLogHistoryConfiguration.onBackClick||e.handlePageOnBackClick,listItemStyle:e.callLogHistoryConfiguration.listItemStyle||null,datePattern:e.callLogHistoryConfiguration.datePattern||null,dateSeparatorPattern:e.callLogHistoryConfiguration.dateSeparatorPattern||null,callLogHistoryStyle:e.callLogHistoryConfiguration.callLogHistoryStyle||null,onError:e.callLogHistoryConfiguration.onError||null},null,8,["callUser","callGroup","title","backIconUrl","emptyStateView","errorStateView","loadingIconURL","loadingStateView","subtitleView","tailView","callLogRequestBuilder","onItemClick","onBackClick","listItemStyle","datePattern","dateSeparatorPattern","callLogHistoryStyle","onError"])):n.createCommentVNode("",!0)],4)}const IS=kt(z9,[["render",H9]]);function Q9(e,t){return{height:(t==null?void 0:t.height)||"100%",width:(t==null?void 0:t.width)||"100%",border:(t==null?void 0:t.border)||"none",borderRadius:(t==null?void 0:t.borderRadius)||"0px",background:(t==null?void 0:t.background)||e.palette.getBackground(),display:"flex",boxSizing:"border-box",position:"relative"}}function W9(e,t){return new Re.LabelStyle({background:"transparent",textFont:(t==null?void 0:t.messageTextFont)||u.fontHelper(e.typography.heading),textColor:(t==null?void 0:t.messageTextColor)||e.palette.getAccent700()})}function K9(){return{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",width:"100%"}}const J9=n.defineComponent({name:"CometChatCallLogsWithDetails",components:{CometChatCallLogs:hS,CometChatCallLogDetails:IS},props:{isMobileView:{type:Boolean,default:!1},messageText:{type:String,default:()=>u.localize("NO_CALLS_SELECTED")},withDetailsStyle:{type:Object,default:()=>({})},callLogDetailsConfiguration:{type:Object,default:()=>({})},callLogConfiguration:{type:Object,default:()=>({})}},setup(e){let{theme:t}=n.inject("theme",{theme:n.ref(new u.CometChatTheme({}))});const o=n.ref(null),r=n.computed(()=>{var d,c;const C=new ce.CallLogDetailsConfiguration({});return Object.assign(C,e.callLogDetailsConfiguration),C.callLogHistoryConfiguration.onItemClick||(C.callLogHistoryConfiguration.onItemClick=S=>{o.value=S}),C.callLogDetailsStyle={...C.callLogDetailsStyle,border:`1px solid ${(c=(d=t.value)==null?void 0:d.palette)==null?void 0:c.getAccent100()}`},e.isMobileView&&(C.onBackClick=()=>{o.value=null}),C}),a=n.computed(()=>{var d,c;const C=new ce.CallLogsConfiguration({});return Object.assign(C,e.callLogConfiguration),C.callLogsStyle={...C.callLogsStyle,border:`1px solid ${(c=(d=t.value)==null?void 0:d.palette)==null?void 0:c.getAccent100()}`},C}),l=d=>{o.value=d};function s(){return e.isMobileView?{width:"100%",display:o.value?"none":"block"}:{width:"280px",minWidth:"25%"}}function g(){return e.isMobileView?{width:"100%",display:o.value?"block":"none"}:{width:"calc(100% - 280px)"}}return{activeCall:o,handleInfoClick:l,getCallLogStyle:s,getCallDetailStyle:g,getContainerStyle:Q9,getLabelStyle:W9,getEmptyContainerStyle:K9,theme:t,localize:u.localize,computedCallLogDetailsConfiguration:r,computedCallLogConfiguration:a}}}),Z9=["text","labelStyle"];function q9(e,t,o,r,a,l){const s=n.resolveComponent("CometChatCallLogs"),g=n.resolveComponent("CometChatCallLogDetails");return n.openBlock(),n.createElementBlock("div",{style:n.normalizeStyle(e.getContainerStyle(e.theme,e.withDetailsStyle))},[n.createElementVNode("div",{style:n.normalizeStyle(e.getCallLogStyle())},[n.createVNode(s,{title:e.localize("CALLS"),activeCall:e.activeCall,titleAlignment:e.computedCallLogConfiguration.titleAlignment,listItemView:e.computedCallLogConfiguration.listItemView,subtitleView:e.computedCallLogConfiguration.subtitleView,tailView:e.computedCallLogConfiguration.tailView,emptyStateView:e.computedCallLogConfiguration.emptyStateView,errorStateView:e.computedCallLogConfiguration.errorStateView,loadingIconURL:e.computedCallLogConfiguration.loadingIconURL,loadingStateView:e.computedCallLogConfiguration.loadingStateView,callLogRequestBuilder:e.computedCallLogConfiguration.callLogRequestBuilder,onItemClick:e.computedCallLogConfiguration.onItemClick,onError:e.computedCallLogConfiguration.onError,listItemStyle:e.computedCallLogConfiguration.listItemStyle,infoIconUrl:e.computedCallLogConfiguration.infoIconUrl,onInfoClick:e.computedCallLogConfiguration.onInfoClick||e.handleInfoClick,datePattern:e.computedCallLogConfiguration.datePattern,dateSeparatorPattern:e.computedCallLogConfiguration.dateSeparatorPattern,incomingAudioCallIconUrl:e.computedCallLogConfiguration.incomingAudioCallIconUrl,incomingVideoCallIconUrl:e.computedCallLogConfiguration.incomingVideoCallIconUrl,outgoingAudioCallIconUrl:e.computedCallLogConfiguration.outgoingAudioCallIconUrl,outgoingVideoCallIconUrl:e.computedCallLogConfiguration.outgoingVideoCallIconUrl,missedAudioCallIconUrl:e.computedCallLogConfiguration.missedAudioCallIconUrl,missedVideoCallIconUrl:e.computedCallLogConfiguration.missedVideoCallIconUrl,callLogsStyle:e.computedCallLogConfiguration.callLogsStyle,avatarStyle:e.computedCallLogConfiguration.avatarStyle,hideSeparator:e.computedCallLogConfiguration.hideSeparator,outgoingCallConfiguration:e.computedCallLogConfiguration.outgoingCallConfiguration},null,8,["title","activeCall","titleAlignment","listItemView","subtitleView","tailView","emptyStateView","errorStateView","loadingIconURL","loadingStateView","callLogRequestBuilder","onItemClick","onError","listItemStyle","infoIconUrl","onInfoClick","datePattern","dateSeparatorPattern","incomingAudioCallIconUrl","incomingVideoCallIconUrl","outgoingAudioCallIconUrl","outgoingVideoCallIconUrl","missedAudioCallIconUrl","missedVideoCallIconUrl","callLogsStyle","avatarStyle","hideSeparator","outgoingCallConfiguration"])],4),n.createElementVNode("div",{style:n.normalizeStyle(e.getCallDetailStyle())},[e.activeCall?(n.openBlock(),n.createBlock(g,{key:0,title:e.localize("CALL_DETAIL"),call:e.activeCall,"call-details-style":{border:"1px solid #ebebeb"},backIconUrl:e.computedCallLogDetailsConfiguration.backIconUrl,avatarStyle:e.computedCallLogDetailsConfiguration.avatarStyle,onBackClick:e.computedCallLogDetailsConfiguration.onBackClick,data:e.computedCallLogDetailsConfiguration.data,callLogHistoryConfiguration:e.computedCallLogDetailsConfiguration.callLogHistoryConfiguration,callLogParticipantsConfiguration:e.computedCallLogDetailsConfiguration.callLogParticipantsConfiguration,callLogRecordingsConfiguration:e.computedCallLogDetailsConfiguration.callLogRecordingsConfiguration,callLogDetailsStyle:e.computedCallLogDetailsConfiguration.callLogDetailsStyle},null,8,["title","call","backIconUrl","avatarStyle","onBackClick","data","callLogHistoryConfiguration","callLogParticipantsConfiguration","callLogRecordingsConfiguration","callLogDetailsStyle"])):(n.openBlock(),n.createElementBlock("div",{key:1,style:n.normalizeStyle(e.getEmptyContainerStyle())},[n.createElementVNode("cometchat-label",{text:e.messageText,labelStyle:e.getLabelStyle(e.theme,e.withDetailsStyle)},null,8,Z9)],4))],4)],4)}const X9=kt(J9,[["render",q9]]);let TS=null;const e6={connect:async e=>{let t="";if(typeof e=="string"?t=e:t=await e(),TS==e){const a=await lo.getLoggedinUser();if(a)return a}const o=await RS(t,pg().chatApiEndpoint),r=await lo.loginWithAuthToken(o);return TS=t,r},disconnect:async()=>{await lo.logout()}},AS=()=>{const e=pg();let t=new ce.UIKitSettingsBuilder().setAppId(e.appId).setRegion(e.region);return e.authKey&&(t=t.setAuthKey(e.authKey)),t.build()},t6={init:async()=>{let e=AS();await lo.init(e)},getUIKitSettings:AS},n6={getGroup:ee.CometChat.getGroup},Wa=n.ref(new u.CometChatTheme({palette:new u.CometChatPalette({mode:"light",primary:{light:"#004e48",dark:"#004e48"}})})),yS=e=>{Wa.value.palette.setMode(e)},vS=()=>{Wa.value.palette.mode=="dark"?Wa.value.palette.setMode("light"):Wa.value.palette.setMode("dark")},NS={install:(e,t)=>{yS(t.mode),e.provide("theme",{theme:Wa,switchThemeMode:vS})},switchThemeMode:vS,setThemeMode:yS,theme:Wa},O0={install:async(e,t)=>{e.use(tE,t.environment),await t6.init(),e.use(XC),e.use(NS,{mode:t.themeMode})},environment:tE,theme:NS,mobileView:XC,connection:e6,data:n6},o6={key:0,class:"bcc-chat-message-list"},r6=n.defineComponent({__name:"BccChatMessageList",props:{accessToken:String,chatUid:String,environment:String,active:Boolean},setup(e){const t=e,o=n.computed(()=>t.accessToken),r=n.computed(()=>t.active),a=n.ref(!1),l=n.ref(),s=n.ref(),g=async()=>{o.value&&r.value&&(s.value=await O0.connection.connect(o.value),console.log("USER",s.value),t.chatUid&&(l.value=await O0.data.getGroup(t.chatUid),console.log("GROUP",l.value)),a.value=!0)},d=async()=>{console.log("Disconnecting"),a.value&&(await O0.connection.disconnect(),console.log("Disconnected"),a.value=!1)};return n.watch(o,async c=>{c&&r&&await g()}),n.watch(r,async(c,C)=>{c&&!C&&await g(),!c&&a.value&&await d()}),n.onBeforeMount(async()=>{await g()}),(c,C)=>a.value?(n.openBlock(),n.createElementBlock("div",o6,[n.createVNode(n.unref(ps),{hideMessageHeader:!0,hideMessageComposer:!1,hideDetails:!0,group:l.value},null,8,["group"])])):n.createCommentVNode("",!0)}});_r.BccChatMessageList=r6,Object.defineProperty(_r,Symbol.toStringTag,{value:"Module"})});
3615
+ `}}function k9(){return{height:"auto",width:"100%",minHeight:"150px",padding:"16px",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",boxSizing:"border-box",gap:"8px"}}function x9(){return{position:"absolute",top:"15px",left:"15px",display:"flex",gap:"8px",justifyContent:"center"}}function U9(e,t){return{height:"24px",width:"24px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:(t==null?void 0:t.backIconTint)||e.palette.getPrimary()}}function j9(e,t){return{height:(t==null?void 0:t.height)||"100%",width:(t==null?void 0:t.width)||"100%",background:(t==null?void 0:t.background)||e.palette.getBackground(),borderRadius:(t==null?void 0:t.borderRadius)||"0",border:(t==null?void 0:t.border)||"none",position:"relative"}}function B9(e,t){return{font:(t==null?void 0:t.titleFont)||u.fontHelper(e.typography.text1),color:(t==null?void 0:t.titleColor)||e.palette.getAccent(),background:"transparent"}}const z9=n.defineComponent({name:"CometChatCallLogDetails",components:{CometChatCallButtons:S0,CometChatCallLogRecordings:MS,CometChatCallLogParticipants:pS,CometChatCallLogHistory:mS},props:{call:{type:Object,required:!0},title:{type:String,default:u.localize("CALL_DETAIL”")},backIconUrl:{type:String,default:Mo},avatarStyle:{type:Object,default:()=>({})},onBackClick:{type:Function},data:{type:Function},callLogHistoryConfiguration:{type:Object,default:()=>({})},callLogParticipantsConfiguration:{type:Object,default:()=>({})},callLogRecordingsConfiguration:{type:Object,default:()=>({})},callLogDetailsStyle:{type:Object,default:()=>({})}},setup(e){let{theme:t}=n.inject("theme",{theme:n.ref(new u.CometChatTheme({}))});const o=n.ref(e.call),r=n.ref(null),a=n.ref([]),l=n.ref(!1),s=n.ref(!1),g=n.ref(!1);n.onBeforeMount(()=>{var v;(v=lo.getLoggedinUser())==null||v.then(D=>{D&&(r.value=D,C())}).catch(()=>{console.log("error getting details:")})}),n.watch(()=>e.call,(v,D)=>{v!==D&&(C(),g.value=!1,l.value=!1,s.value=!1),o.value={...v}},{deep:!0});function d(v,D){return new Re.AvatarStyle({height:(D==null?void 0:D.height)||"50px",width:(D==null?void 0:D.width)||"50px"})}function c(v,D){return{color:(D==null?void 0:D.nameTextColor)||v.palette.getAccent(),font:(D==null?void 0:D.nameTextFont)||u.fontHelper(v.typography.title1)}}const C=()=>{var v;a.value=(v=e.data)==null?void 0:v.call(e,e.call,r.value,t.value),(!a.value||!a.value.length)&&(a.value=R9.getDefaultCallTemplate(e.call,r.value,t.value))},S=v=>{const{options:D,id:E}=v;let L=[];if(D&&E!=null){const G=Kr(e.call,r.value);G!=null&&G.getUid?L=D(G,void 0,E):L=D(void 0,G,E)}return L};function p(v){if(v!=null&&v.onClick)v.onClick(e.call);else switch(v.id){case"participants":l.value=!0;break;case"recordings":s.value=!0;break;case"callHistory":g.value=!0;break}}const M=n.computed(()=>r.value&&!l.value&&!s.value&&!g.value),A=n.computed(()=>r.value&&l.value&&!s.value&&!g.value),y=n.computed(()=>r.value&&!l.value&&s.value&&!g.value),T=n.computed(()=>r.value&&!l.value&&!s.value&&g.value);return{theme:t,verifyCallUser:Kr,loggedInUser:r,getAvatarStyle:d,getAvatarTitleStyle:c,templates:a,getOptionsForTemplate:S,getProfileContainerStyle:k9,getBackButtonStyle:U9,getButtonContainerStyle:x9,handleOptionClick:p,showDetailsPage:M,showParticipantsPage:A,showRecordingsPage:y,showCallHistoryPage:T,handlePageOnBackClick:()=>{l.value=!1,s.value=!1,g.value=!1},getCallUser:()=>{const v=Kr(e.call,r.value);if(v!=null&&v.getUid)return v},getCallGroup:()=>{const v=Kr(e.call,r.value);if(v!=null&&v.getGuid)return v},getContainerStyle:j9,getTitleStyle:B9,localize:u.localize}}}),P9={key:0},G9=["iconURL","buttonStyle"],Y9=["avatarStyle","image","name"],F9={key:0,class:"cc-call-details__option-content",style:{display:"flex","justify-content":"center","align-items":"center",width:"100%"}},V9=["innerHTML","onClick"],$9=["v-slot","v-html"];function H9(e,t,o,r,a,l){var s,g,d;const c=n.resolveComponent("CometChatCallLogParticipants"),C=n.resolveComponent("CometChatCallLogRecordings"),S=n.resolveComponent("CometChatCallLogHistory");return n.openBlock(),n.createElementBlock("div",{style:n.normalizeStyle(e.getContainerStyle(e.theme,e.callLogDetailsStyle))},[e.showDetailsPage?(n.openBlock(),n.createElementBlock("div",P9,[e.onBackClick?(n.openBlock(),n.createElementBlock("div",{key:0,style:n.normalizeStyle(e.getButtonContainerStyle())},[n.createElementVNode("cometchat-button",{iconURL:e.backIconUrl,buttonStyle:e.getBackButtonStyle(e.theme,e.callLogDetailsStyle),onCcButtonClicked:t[0]||(t[0]=()=>e.onBackClick())},null,40,G9),n.createElementVNode("div",{style:n.normalizeStyle(e.getTitleStyle(e.theme,e.callLogDetailsStyle))},n.toDisplayString(e.title),5)],4)):n.createCommentVNode("",!0),n.createElementVNode("div",{style:n.normalizeStyle(e.getProfileContainerStyle())},[n.createElementVNode("cometchat-avatar",{avatarStyle:e.getAvatarStyle(e.theme,e.avatarStyle),image:(s=e.verifyCallUser(e.call,e.loggedInUser))==null?void 0:s.avatar,name:(g=e.verifyCallUser(e.call,e.loggedInUser))==null?void 0:g.getName()},null,8,Y9),n.createElementVNode("span",{style:n.normalizeStyle(e.getAvatarTitleStyle(e.theme,e.callLogDetailsStyle))},n.toDisplayString((d=e.verifyCallUser(e.call,e.loggedInUser))==null?void 0:d.getName()),5)],4),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.templates,(p,M)=>(n.openBlock(),n.createElementBlock("div",{key:M},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.getOptionsForTemplate(p),A=>{var y;return n.openBlock(),n.createElementBlock("div",{key:A.id},[(n.openBlock(),n.createElementBlock("div",{key:A.id,style:{width:"100%"},class:"cc-call-details__option"},[A.customView?(n.openBlock(),n.createElementBlock("div",F9,[A.customView.html?(n.openBlock(),n.createElementBlock("div",{key:0,style:{width:"100%"},innerHTML:A.customView.html,onClick:T=>e.handleOptionClick(A)},null,8,V9)):(n.openBlock(),n.createBlock(n.resolveDynamicComponent(A.customView.componentName),n.mergeProps({key:1},{...A.customView.props},n.toHandlers((y=A.customView)==null?void 0:y.listeners)),{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(A.customView.slots,(T,v)=>(n.openBlock(),n.createElementBlock("div",{key:v,"v-slot":[v],"v-html":T},null,8,$9))),128))]),_:2},1040))])):n.createCommentVNode("",!0)]))])}),128)),n.createTextVNode(" "+n.toDisplayString(p.title),1)]))),128))])):n.createCommentVNode("",!0),e.showParticipantsPage?(n.openBlock(),n.createBlock(c,{key:1,call:e.call,title:e.localize("PARTICIPANTS"),backIconUrl:e.callLogParticipantsConfiguration.backIconUrl||e.backIconUrl,onBackClick:e.callLogParticipantsConfiguration.onBackClick||e.handlePageOnBackClick,avatarStyle:e.callLogParticipantsConfiguration.avatarStyle,onItemClick:e.callLogParticipantsConfiguration.onItemClick||null,datePattern:e.callLogParticipantsConfiguration.datePattern||null,listItemStyle:e.callLogParticipantsConfiguration.listItemStyle||null,callLogParticipantsStyle:e.callLogParticipantsConfiguration.callLogParticipantsStyle||null,listItemView:e.callLogParticipantsConfiguration.listItemView||null,subtitleView:e.callLogParticipantsConfiguration.subtitleView||null,tailView:e.callLogParticipantsConfiguration.tailView||null},null,8,["call","title","backIconUrl","onBackClick","avatarStyle","onItemClick","datePattern","listItemStyle","callLogParticipantsStyle","listItemView","subtitleView","tailView"])):n.createCommentVNode("",!0),e.showRecordingsPage?(n.openBlock(),n.createBlock(C,{key:2,call:e.call,title:e.localize("RECORDING"),backIconUrl:e.callLogRecordingsConfiguration.backIconUrl||e.backIconUrl,onBackClick:e.callLogRecordingsConfiguration.onBackClick||e.handlePageOnBackClick,onItemClick:e.callLogRecordingsConfiguration.onItemClick||null,datePattern:e.callLogRecordingsConfiguration.datePattern||null,listItemStyle:e.callLogRecordingsConfiguration.listItemStyle||null,callLogRecordingsStyle:e.callLogRecordingsConfiguration.callLogRecordingsStyle||null,downloadIconUrl:e.callLogRecordingsConfiguration.downloadIconUrl||null,hideDownloadButton:e.callLogRecordingsConfiguration.hideDownloadButton||!1,onDownloadClick:e.callLogRecordingsConfiguration.onDownloadClick||null,listItemView:e.callLogRecordingsConfiguration.listItemView||null,subtitleView:e.callLogRecordingsConfiguration.subtitleView||null,tailView:e.callLogRecordingsConfiguration.tailView||null},null,8,["call","title","backIconUrl","onBackClick","onItemClick","datePattern","listItemStyle","callLogRecordingsStyle","downloadIconUrl","hideDownloadButton","onDownloadClick","listItemView","subtitleView","tailView"])):n.createCommentVNode("",!0),e.showCallHistoryPage?(n.openBlock(),n.createBlock(S,{key:3,callUser:e.getCallUser(),callGroup:e.getCallGroup(),title:e.localize("CALL_HISTORY"),backIconUrl:e.callLogHistoryConfiguration.backIconUrl||e.backIconUrl,emptyStateView:e.callLogHistoryConfiguration.emptyStateView||null,errorStateView:e.callLogHistoryConfiguration.errorStateView||null,loadingIconURL:e.callLogHistoryConfiguration.loadingIconURL||null,loadingStateView:e.callLogHistoryConfiguration.loadingStateView||null,subtitleView:e.callLogHistoryConfiguration.subtitleView||null,tailView:e.callLogHistoryConfiguration.tailView||null,callLogRequestBuilder:e.callLogHistoryConfiguration.callLogRequestBuilder||null,onItemClick:e.callLogHistoryConfiguration.onItemClick||null,onBackClick:e.callLogHistoryConfiguration.onBackClick||e.handlePageOnBackClick,listItemStyle:e.callLogHistoryConfiguration.listItemStyle||null,datePattern:e.callLogHistoryConfiguration.datePattern||null,dateSeparatorPattern:e.callLogHistoryConfiguration.dateSeparatorPattern||null,callLogHistoryStyle:e.callLogHistoryConfiguration.callLogHistoryStyle||null,onError:e.callLogHistoryConfiguration.onError||null},null,8,["callUser","callGroup","title","backIconUrl","emptyStateView","errorStateView","loadingIconURL","loadingStateView","subtitleView","tailView","callLogRequestBuilder","onItemClick","onBackClick","listItemStyle","datePattern","dateSeparatorPattern","callLogHistoryStyle","onError"])):n.createCommentVNode("",!0)],4)}const IS=kt(z9,[["render",H9]]);function Q9(e,t){return{height:(t==null?void 0:t.height)||"100%",width:(t==null?void 0:t.width)||"100%",border:(t==null?void 0:t.border)||"none",borderRadius:(t==null?void 0:t.borderRadius)||"0px",background:(t==null?void 0:t.background)||e.palette.getBackground(),display:"flex",boxSizing:"border-box",position:"relative"}}function W9(e,t){return new Re.LabelStyle({background:"transparent",textFont:(t==null?void 0:t.messageTextFont)||u.fontHelper(e.typography.heading),textColor:(t==null?void 0:t.messageTextColor)||e.palette.getAccent700()})}function K9(){return{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",width:"100%"}}const J9=n.defineComponent({name:"CometChatCallLogsWithDetails",components:{CometChatCallLogs:hS,CometChatCallLogDetails:IS},props:{isMobileView:{type:Boolean,default:!1},messageText:{type:String,default:()=>u.localize("NO_CALLS_SELECTED")},withDetailsStyle:{type:Object,default:()=>({})},callLogDetailsConfiguration:{type:Object,default:()=>({})},callLogConfiguration:{type:Object,default:()=>({})}},setup(e){let{theme:t}=n.inject("theme",{theme:n.ref(new u.CometChatTheme({}))});const o=n.ref(null),r=n.computed(()=>{var d,c;const C=new ce.CallLogDetailsConfiguration({});return Object.assign(C,e.callLogDetailsConfiguration),C.callLogHistoryConfiguration.onItemClick||(C.callLogHistoryConfiguration.onItemClick=S=>{o.value=S}),C.callLogDetailsStyle={...C.callLogDetailsStyle,border:`1px solid ${(c=(d=t.value)==null?void 0:d.palette)==null?void 0:c.getAccent100()}`},e.isMobileView&&(C.onBackClick=()=>{o.value=null}),C}),a=n.computed(()=>{var d,c;const C=new ce.CallLogsConfiguration({});return Object.assign(C,e.callLogConfiguration),C.callLogsStyle={...C.callLogsStyle,border:`1px solid ${(c=(d=t.value)==null?void 0:d.palette)==null?void 0:c.getAccent100()}`},C}),l=d=>{o.value=d};function s(){return e.isMobileView?{width:"100%",display:o.value?"none":"block"}:{width:"280px",minWidth:"25%"}}function g(){return e.isMobileView?{width:"100%",display:o.value?"block":"none"}:{width:"calc(100% - 280px)"}}return{activeCall:o,handleInfoClick:l,getCallLogStyle:s,getCallDetailStyle:g,getContainerStyle:Q9,getLabelStyle:W9,getEmptyContainerStyle:K9,theme:t,localize:u.localize,computedCallLogDetailsConfiguration:r,computedCallLogConfiguration:a}}}),Z9=["text","labelStyle"];function q9(e,t,o,r,a,l){const s=n.resolveComponent("CometChatCallLogs"),g=n.resolveComponent("CometChatCallLogDetails");return n.openBlock(),n.createElementBlock("div",{style:n.normalizeStyle(e.getContainerStyle(e.theme,e.withDetailsStyle))},[n.createElementVNode("div",{style:n.normalizeStyle(e.getCallLogStyle())},[n.createVNode(s,{title:e.localize("CALLS"),activeCall:e.activeCall,titleAlignment:e.computedCallLogConfiguration.titleAlignment,listItemView:e.computedCallLogConfiguration.listItemView,subtitleView:e.computedCallLogConfiguration.subtitleView,tailView:e.computedCallLogConfiguration.tailView,emptyStateView:e.computedCallLogConfiguration.emptyStateView,errorStateView:e.computedCallLogConfiguration.errorStateView,loadingIconURL:e.computedCallLogConfiguration.loadingIconURL,loadingStateView:e.computedCallLogConfiguration.loadingStateView,callLogRequestBuilder:e.computedCallLogConfiguration.callLogRequestBuilder,onItemClick:e.computedCallLogConfiguration.onItemClick,onError:e.computedCallLogConfiguration.onError,listItemStyle:e.computedCallLogConfiguration.listItemStyle,infoIconUrl:e.computedCallLogConfiguration.infoIconUrl,onInfoClick:e.computedCallLogConfiguration.onInfoClick||e.handleInfoClick,datePattern:e.computedCallLogConfiguration.datePattern,dateSeparatorPattern:e.computedCallLogConfiguration.dateSeparatorPattern,incomingAudioCallIconUrl:e.computedCallLogConfiguration.incomingAudioCallIconUrl,incomingVideoCallIconUrl:e.computedCallLogConfiguration.incomingVideoCallIconUrl,outgoingAudioCallIconUrl:e.computedCallLogConfiguration.outgoingAudioCallIconUrl,outgoingVideoCallIconUrl:e.computedCallLogConfiguration.outgoingVideoCallIconUrl,missedAudioCallIconUrl:e.computedCallLogConfiguration.missedAudioCallIconUrl,missedVideoCallIconUrl:e.computedCallLogConfiguration.missedVideoCallIconUrl,callLogsStyle:e.computedCallLogConfiguration.callLogsStyle,avatarStyle:e.computedCallLogConfiguration.avatarStyle,hideSeparator:e.computedCallLogConfiguration.hideSeparator,outgoingCallConfiguration:e.computedCallLogConfiguration.outgoingCallConfiguration},null,8,["title","activeCall","titleAlignment","listItemView","subtitleView","tailView","emptyStateView","errorStateView","loadingIconURL","loadingStateView","callLogRequestBuilder","onItemClick","onError","listItemStyle","infoIconUrl","onInfoClick","datePattern","dateSeparatorPattern","incomingAudioCallIconUrl","incomingVideoCallIconUrl","outgoingAudioCallIconUrl","outgoingVideoCallIconUrl","missedAudioCallIconUrl","missedVideoCallIconUrl","callLogsStyle","avatarStyle","hideSeparator","outgoingCallConfiguration"])],4),n.createElementVNode("div",{style:n.normalizeStyle(e.getCallDetailStyle())},[e.activeCall?(n.openBlock(),n.createBlock(g,{key:0,title:e.localize("CALL_DETAIL"),call:e.activeCall,"call-details-style":{border:"1px solid #ebebeb"},backIconUrl:e.computedCallLogDetailsConfiguration.backIconUrl,avatarStyle:e.computedCallLogDetailsConfiguration.avatarStyle,onBackClick:e.computedCallLogDetailsConfiguration.onBackClick,data:e.computedCallLogDetailsConfiguration.data,callLogHistoryConfiguration:e.computedCallLogDetailsConfiguration.callLogHistoryConfiguration,callLogParticipantsConfiguration:e.computedCallLogDetailsConfiguration.callLogParticipantsConfiguration,callLogRecordingsConfiguration:e.computedCallLogDetailsConfiguration.callLogRecordingsConfiguration,callLogDetailsStyle:e.computedCallLogDetailsConfiguration.callLogDetailsStyle},null,8,["title","call","backIconUrl","avatarStyle","onBackClick","data","callLogHistoryConfiguration","callLogParticipantsConfiguration","callLogRecordingsConfiguration","callLogDetailsStyle"])):(n.openBlock(),n.createElementBlock("div",{key:1,style:n.normalizeStyle(e.getEmptyContainerStyle())},[n.createElementVNode("cometchat-label",{text:e.messageText,labelStyle:e.getLabelStyle(e.theme,e.withDetailsStyle)},null,8,Z9)],4))],4)],4)}const X9=kt(J9,[["render",q9]]);let TS=null;const e6={connect:async e=>{let t="";if(typeof e=="string"?t=e:t=await e(),TS==e){const a=await lo.getLoggedinUser();if(a)return a}const o=await RS(t,pg().chatApiEndpoint),r=await lo.loginWithAuthToken(o);return TS=t,r},disconnect:async()=>{await lo.logout()}},AS=()=>{const e=pg();let t=new ce.UIKitSettingsBuilder().setAppId(e.appId).setRegion(e.region);return e.authKey&&(t=t.setAuthKey(e.authKey)),t.build()},t6={init:async()=>{let e=AS();await lo.init(e)},getUIKitSettings:AS},n6={getGroup:ee.CometChat.getGroup},Wa=n.ref(new u.CometChatTheme({palette:new u.CometChatPalette({mode:"light",primary:{light:"#004e48",dark:"#004e48"}})})),yS=e=>{Wa.value.palette.setMode(e)},vS=()=>{Wa.value.palette.mode=="dark"?Wa.value.palette.setMode("light"):Wa.value.palette.setMode("dark")},NS={install:(e,t)=>{yS(t.mode),e.provide("theme",{theme:Wa,switchThemeMode:vS})},switchThemeMode:vS,setThemeMode:yS,theme:Wa},O0={install:async(e,t)=>{e.use(tE,t.environment),await t6.init(),e.use(XC),e.use(NS,{mode:t.themeMode})},environment:tE,theme:NS,mobileView:XC,connection:e6,data:n6},o6={key:0,class:"bcc-chat-message-list"},r6=n.defineComponent({__name:"BccChatMessageList",props:{accessToken:String,chatUid:String,active:Boolean},setup(e){const t=e,o=n.computed(()=>t.accessToken),r=n.computed(()=>t.active),a=n.ref(!1),l=n.ref(),s=n.ref(),g=async()=>{o.value&&r.value&&(s.value=await O0.connection.connect(o.value),console.log("USER",s.value),t.chatUid&&(l.value=await O0.data.getGroup(t.chatUid),console.log("GROUP",l.value)),a.value=!0)},d=async()=>{console.log("Disconnecting"),a.value&&(await O0.connection.disconnect(),console.log("Disconnected"),a.value=!1)};return n.watch(o,async c=>{c&&r&&await g()}),n.watch(r,async(c,C)=>{c&&!C&&await g(),!c&&a.value&&await d()}),n.onBeforeMount(async()=>{await g()}),(c,C)=>a.value?(n.openBlock(),n.createElementBlock("div",o6,[n.createVNode(n.unref(ps),{hideMessageHeader:!0,hideMessageComposer:!1,hideDetails:!0,group:l.value},null,8,["group"])])):n.createCommentVNode("",!0)}});_r.BccChatMessageList=r6,Object.defineProperty(_r,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@bcc-code/vue-bcc-chat-ui",
3
3
  "author": "bcc-code",
4
4
  "license": "Apache-2.0",
5
- "version": "1.0.6",
5
+ "version": "1.0.7",
6
6
  "type": "module",
7
7
  "private": false,
8
8
  "files": [
@@ -15,17 +15,19 @@
15
15
  },
16
16
  "main": "./dist/vue-bcc-chat-ui.umd.cjs",
17
17
  "module": "./dist/vue-bcc-chat-ui.js",
18
- "types": "./dist/index",
18
+ "types": "./dist/index.d.ts",
19
19
  "exports": {
20
20
  ".": {
21
- "import": "./dist/vue-bcc-chat-ui.js",
22
- "require": "./dist/vue-bcc-chat-ui.umd.cjs"
21
+ "import": {
22
+ "types": "./dist/index.d.ts",
23
+ "default": "./dist/vue-bcc-chat-ui.js"
24
+ },
25
+ "require": {
26
+ "types": "./dist/index.d.ts",
27
+ "default": "./dist/vue-bcc-chat-ui.umd.cjs"
28
+ }
23
29
  },
24
- "./style.css": "./dist/style.css",
25
- "./dist/index.d.ts": {
26
- "import": "./dist/index.d.ts",
27
- "require": "./dist/index.d.ts"
28
- }
30
+ "./style.css": "./dist/style.css"
29
31
  },
30
32
  "publishConfig": {
31
33
  "access": "public"
@@ -8,7 +8,6 @@ import { CometChatMessages } from '@cometchat/chat-uikit-vue'
8
8
  const props = defineProps({
9
9
  accessToken: String,
10
10
  chatUid: String,
11
- environment: String,
12
11
  active: Boolean
13
12
  })
14
13
 
@@ -78,7 +77,6 @@ onBeforeMount(async() => {
78
77
 
79
78
  /* 1.1 Messages component */
80
79
  .cc-messages-wrapper__messages {
81
-
82
80
 
83
81
  /* 1.1.1 Wrapper for Messages List */
84
82
  .cc-messages-wrapper__messages-list {
@@ -91,36 +89,25 @@ onBeforeMount(async() => {
91
89
 
92
90
  /* 1.1.1.2 Messages List messages */
93
91
  .cc-messagelist {
94
-
95
-
96
-
97
-
98
92
  .cc-list__wrapper {
99
93
  .cc-list__header {
100
-
101
94
  }
102
95
  .cc-list__list {
103
-
104
96
  }
105
97
  }
106
-
107
98
  }
108
99
 
109
100
  /* 1.1.1.3 Message List footer */
110
101
  .cc__messagelist__footerview {
111
-
112
102
  }
113
-
114
103
  }
115
104
 
116
105
  /* 1.1.2 Wrapper for Composer */
117
106
  .cc-messages-wrapper__composer {
118
-
119
107
  }
120
108
 
121
109
  /* 1.1.3 Wrapper for Live Reaction */
122
110
  .cc__messages__livereaction {
123
-
124
111
  }
125
112
 
126
113
  }