@bcc-code/vue-bcc-chat-ui 1.3.0 → 1.3.1

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.
@@ -70707,17 +70707,17 @@ async function q$e() {
70707
70707
  o = await t.fetchNext(), n = n.concat(o);
70708
70708
  while (o.length == 50);
70709
70709
  const a = n.map((s) => {
70710
- const i = s.getLastMessage(), d = s.getUnreadMessageCount(), u = i.getType(), l = s.getConversationWith();
70710
+ const i = s.getLastMessage(), d = s.getUnreadMessageCount(), u = s.getConversationWith();
70711
70711
  return {
70712
70712
  chatUid: s.getConversationId().split("_")[1],
70713
- name: l.getName(),
70713
+ name: u.getName(),
70714
70714
  lastMessage: {
70715
- text: u === q.CometChat.MESSAGE_TYPE.TEXT ? i.getText() : u === q.CometChat.MESSAGE_TYPE.IMAGE || u === q.CometChat.MESSAGE_TYPE.VIDEO || u === q.CometChat.MESSAGE_TYPE.AUDIO || u === q.CometChat.MESSAGE_TYPE.FILE ? i.getAttachment().getName() : "",
70715
+ text: X$e(i),
70716
70716
  type: i ? i.getType() : "",
70717
70717
  senderName: i ? i.getSender().getName() : "",
70718
70718
  sentAt: new Date(i ? i.getSentAt() * 1e3 : 0)
70719
70719
  },
70720
- membersCount: l.getMembersCount(),
70720
+ membersCount: u.getMembersCount(),
70721
70721
  tags: s.getTags(),
70722
70722
  unreadMessageCount: isNaN(d) ? 0 : d
70723
70723
  };
@@ -70727,6 +70727,21 @@ async function q$e() {
70727
70727
  return console.error(e), ki;
70728
70728
  }
70729
70729
  }
70730
+ function X$e(e) {
70731
+ if (e.getDeletedAt())
70732
+ return "";
70733
+ switch (e.getType()) {
70734
+ case q.CometChat.MESSAGE_TYPE.TEXT:
70735
+ return e.getText();
70736
+ case q.CometChat.MESSAGE_TYPE.IMAGE:
70737
+ case q.CometChat.MESSAGE_TYPE.VIDEO:
70738
+ case q.CometChat.MESSAGE_TYPE.AUDIO:
70739
+ case q.CometChat.MESSAGE_TYPE.FILE:
70740
+ return e.getAttachment().getName();
70741
+ default:
70742
+ return "";
70743
+ }
70744
+ }
70730
70745
  const Ui = oe(new c.CometChatTheme({
70731
70746
  palette: new c.CometChatPalette({
70732
70747
  mode: "light",
@@ -70799,26 +70814,26 @@ const Ui = oe(new c.CometChatTheme({
70799
70814
  Ui.value.palette.setMode(e);
70800
70815
  }, wI = () => {
70801
70816
  Ui.value.palette.mode == "dark" ? Ui.value.palette.setMode("light") : Ui.value.palette.setMode("dark");
70802
- }, X$e = (e, t) => {
70817
+ }, eVe = (e, t) => {
70803
70818
  bI(t.mode), e.provide("theme", { theme: Ui, switchThemeMode: wI });
70804
70819
  }, RI = {
70805
- install: X$e,
70820
+ install: eVe,
70806
70821
  switchThemeMode: wI,
70807
70822
  setThemeMode: bI,
70808
70823
  theme: Ui
70809
- }, eVe = async (e, t) => {
70824
+ }, tVe = async (e, t) => {
70810
70825
  e.use(Hp, t.environment), await I$e.init(), e.use($p), e.use(RI, { mode: t.themeMode }), t.accessToken && (typeof t.accessToken == "string" ? ih.accessToken.value = t.accessToken : t.accessToken.value && (ih.accessToken = t.accessToken));
70811
70826
  }, $a = {
70812
- install: eVe,
70827
+ install: tVe,
70813
70828
  environment: Hp,
70814
70829
  theme: RI,
70815
70830
  mobileView: $p,
70816
70831
  connection: ih,
70817
70832
  data: Z$e
70818
- }, tVe = {
70833
+ }, nVe = {
70819
70834
  key: 0,
70820
70835
  class: "bcc-chat-message-list"
70821
- }, gHe = /* @__PURE__ */ Ht({
70836
+ }, CHe = /* @__PURE__ */ Ht({
70822
70837
  __name: "BccChatMessageList",
70823
70838
  props: {
70824
70839
  chatUid: { type: String, required: !0 }
@@ -70876,7 +70891,7 @@ const Ui = oe(new c.CometChatTheme({
70876
70891
  templates: E
70877
70892
  });
70878
70893
  }
70879
- return (E, p) => o.value ? (w(), B("div", tVe, [
70894
+ return (E, p) => o.value ? (w(), B("div", nVe, [
70880
70895
  o.value ? (w(), gt(qh($l), {
70881
70896
  key: 0,
70882
70897
  hideMessageHeader: !0,
@@ -70891,6 +70906,6 @@ const Ui = oe(new c.CometChatTheme({
70891
70906
  }
70892
70907
  });
70893
70908
  export {
70894
- gHe as BccChatMessageList,
70909
+ CHe as BccChatMessageList,
70895
70910
  $a as chat
70896
70911
  };
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.3.0",
5
+ "version": "1.3.1",
6
6
  "type": "module",
7
7
  "private": false,
8
8
  "files": [