vrfi-design-system 1.1.89 → 1.1.92

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/index.d.ts CHANGED
@@ -311,6 +311,7 @@ export declare const ChatDetails: default_2.FC<ChatDetailsProps>;
311
311
 
312
312
  declare interface ChatDetailsProps {
313
313
  selectedChat: LooseChat | null;
314
+ loggedInUserId?: number;
314
315
  newMessage: string;
315
316
  onMessageChange: (e: default_2.ChangeEvent<HTMLInputElement>) => void;
316
317
  onSendMessage: () => void;
@@ -764,6 +765,7 @@ declare interface LooseMessage {
764
765
  senderType?: string;
765
766
  body?: string;
766
767
  createdAt?: string;
768
+ senderId?: number;
767
769
  }
768
770
 
769
771
  export { Menu }
package/dist/main.es.js CHANGED
@@ -68563,7 +68563,7 @@ const VDe = ({
68563
68563
  },
68564
68564
  children: /* @__PURE__ */ B.jsx(O8, { className: hEe.segmented, ...e })
68565
68565
  }
68566
- ), bEe = "_textArea_1bvta_24", CEe = "_textAreaContainer_1bvta_28", ll = {
68566
+ ), bEe = "_textArea_19113_24", CEe = "_textAreaContainer_19113_28", ll = {
68567
68567
  textArea: bEe,
68568
68568
  textAreaContainer: CEe
68569
68569
  }, yEe = Go.TextArea, UDe = ({
@@ -71635,50 +71635,51 @@ const mIe = "_chatDetails_12d43_24", gIe = "_dateSeparator_12d43_32", vIe = "_no
71635
71635
  newMessage: t,
71636
71636
  onMessageChange: n,
71637
71637
  onSendMessage: r,
71638
- userType: o
71638
+ userType: o,
71639
+ loggedInUserId: a
71639
71640
  }) => {
71640
- var A, f, g, v;
71641
- const a = _e(null);
71641
+ var f, g, v, p;
71642
+ const i = _e(null);
71642
71643
  jt(() => {
71643
- var p;
71644
- (p = a.current) == null || p.scrollIntoView({ behavior: "auto" });
71645
- }, [(A = e == null ? void 0 : e.messages) == null ? void 0 : A.length]);
71646
- const i = (p) => {
71647
- p.key === "Enter" && r();
71644
+ var m;
71645
+ (m = i.current) == null || m.scrollIntoView({ behavior: "auto" });
71646
+ }, [(f = e == null ? void 0 : e.messages) == null ? void 0 : f.length]);
71647
+ const l = (m) => {
71648
+ m.key === "Enter" && r();
71648
71649
  };
71649
71650
  if (!e)
71650
71651
  return /* @__PURE__ */ B.jsx("div", { className: Kn.selectChatPlaceholder, children: ia.START_CHAT_PLACEHOLDER });
71651
- const l = e.chatType === ia.SUPPORT_CHAT && o === hg.CANDIDATE ? ia.SUPPORT_CHAT_LABEL : ((f = e.participantDetails) == null ? void 0 : f.name) ?? "";
71652
- let s = "";
71653
- const d = (p, m) => {
71654
- var h;
71655
- return m && /* @__PURE__ */ B.jsxs("div", { className: Kn.avatarContainer, children: [
71652
+ const s = e.chatType === ia.SUPPORT_CHAT && o === hg.CANDIDATE ? ia.SUPPORT_CHAT_LABEL : ((g = e.participantDetails) == null ? void 0 : g.name) ?? "";
71653
+ let d = "";
71654
+ const u = (m, h) => {
71655
+ var b;
71656
+ return h && /* @__PURE__ */ B.jsxs("div", { className: Kn.avatarContainer, children: [
71656
71657
  /* @__PURE__ */ B.jsx(
71657
71658
  xo,
71658
71659
  {
71659
71660
  size: lo.LARGE,
71660
- name: l,
71661
- imageUrl: (h = e == null ? void 0 : e.participantDetails) == null ? void 0 : h.profileUrl
71661
+ name: s,
71662
+ imageUrl: (b = e == null ? void 0 : e.participantDetails) == null ? void 0 : b.profileUrl
71662
71663
  }
71663
71664
  ),
71664
- /* @__PURE__ */ B.jsx("p", { className: Kn.userDetailName, children: RIe(l) || ia.DEFAULT_USER_NAME }),
71665
- /* @__PURE__ */ B.jsx("div", { className: Kn.timestamp, children: HC((p == null ? void 0 : p.createdAt) ?? "") })
71665
+ /* @__PURE__ */ B.jsx("p", { className: Kn.userDetailName, children: RIe(s) || ia.DEFAULT_USER_NAME }),
71666
+ /* @__PURE__ */ B.jsx("div", { className: Kn.timestamp, children: HC((m == null ? void 0 : m.createdAt) ?? "") })
71666
71667
  ] });
71667
- }, u = (g = e.messages) == null ? void 0 : g.map((p, m) => {
71668
- var x, w;
71669
- const { showMeta: h, showDateLabel: b, currentDateLabel: C } = kIe(e.messages ?? [], m, s);
71670
- b && (s = C);
71671
- const y = o === p.senderType;
71668
+ }, A = (v = e.messages) == null ? void 0 : v.map((m, h) => {
71669
+ var w, S;
71670
+ const { showMeta: b, showDateLabel: C, currentDateLabel: y } = kIe(e.messages ?? [], h, d);
71671
+ C && (d = y);
71672
+ const x = a === m.senderId;
71672
71673
  return /* @__PURE__ */ B.jsxs(X.Fragment, { children: [
71673
- b && /* @__PURE__ */ B.jsxs(
71674
+ C && /* @__PURE__ */ B.jsxs(
71674
71675
  "div",
71675
71676
  {
71676
71677
  className: At(Kn.dateSeparator, {
71677
- [Kn.noTopMargin]: m === 0 || !((w = (x = e.messages) == null ? void 0 : x[m - 1]) != null && w.body)
71678
+ [Kn.noTopMargin]: h === 0 || !((S = (w = e.messages) == null ? void 0 : w[h - 1]) != null && S.body)
71678
71679
  }),
71679
71680
  children: [
71680
71681
  /* @__PURE__ */ B.jsx("hr", {}),
71681
- /* @__PURE__ */ B.jsx("span", { children: C }),
71682
+ /* @__PURE__ */ B.jsx("span", { children: y }),
71682
71683
  /* @__PURE__ */ B.jsx("hr", {})
71683
71684
  ]
71684
71685
  }
@@ -71687,27 +71688,27 @@ const mIe = "_chatDetails_12d43_24", gIe = "_dateSeparator_12d43_32", vIe = "_no
71687
71688
  "div",
71688
71689
  {
71689
71690
  className: At(Kn.message, {
71690
- [Kn.myMessage]: y,
71691
- [Kn.otherMessage]: !y
71691
+ [Kn.myMessage]: x,
71692
+ [Kn.otherMessage]: !x
71692
71693
  }),
71693
- children: y ? /* @__PURE__ */ B.jsxs(
71694
+ children: x ? /* @__PURE__ */ B.jsxs(
71694
71695
  "div",
71695
71696
  {
71696
71697
  className: At(Kn.myMessageContentWrapper, {
71697
- [Kn.withTimestampMargin]: h
71698
+ [Kn.withTimestampMargin]: b
71698
71699
  }),
71699
71700
  children: [
71700
- h && /* @__PURE__ */ B.jsx("div", { className: Kn.timestamp, children: HC(p.createdAt ?? "") }),
71701
- /* @__PURE__ */ B.jsx("div", { className: Kn.messageContent, children: p.body })
71701
+ b && /* @__PURE__ */ B.jsx("div", { className: Kn.timestamp, children: HC(m.createdAt ?? "") }),
71702
+ /* @__PURE__ */ B.jsx("div", { className: Kn.messageContent, children: m.body })
71702
71703
  ]
71703
71704
  }
71704
71705
  ) : /* @__PURE__ */ B.jsxs("div", { className: Kn.otherMessageBlock, children: [
71705
- d(p, h),
71706
- /* @__PURE__ */ B.jsx("div", { className: Kn.messageContent, children: p.body })
71706
+ u(m, b),
71707
+ /* @__PURE__ */ B.jsx("div", { className: Kn.messageContent, children: m.body })
71707
71708
  ] })
71708
71709
  }
71709
71710
  )
71710
- ] }, p.id ?? m);
71711
+ ] }, m.id ?? h);
71711
71712
  });
71712
71713
  return /* @__PURE__ */ B.jsxs("div", { className: Kn.chatDetails, children: [
71713
71714
  /* @__PURE__ */ B.jsxs("div", { className: Kn.chatHeader, children: [
@@ -71715,15 +71716,15 @@ const mIe = "_chatDetails_12d43_24", gIe = "_dateSeparator_12d43_32", vIe = "_no
71715
71716
  xo,
71716
71717
  {
71717
71718
  size: lo.LARGE,
71718
- name: l,
71719
- imageUrl: (v = e.participantDetails) == null ? void 0 : v.profileUrl
71719
+ name: s,
71720
+ imageUrl: (p = e.participantDetails) == null ? void 0 : p.profileUrl
71720
71721
  }
71721
71722
  ),
71722
- /* @__PURE__ */ B.jsx("div", { children: l || ia.DEFAULT_USER_NAME })
71723
+ /* @__PURE__ */ B.jsx("div", { children: s || ia.DEFAULT_USER_NAME })
71723
71724
  ] }),
71724
71725
  /* @__PURE__ */ B.jsxs("div", { className: Kn.messages, children: [
71725
- u,
71726
- /* @__PURE__ */ B.jsx("div", { ref: a })
71726
+ A,
71727
+ /* @__PURE__ */ B.jsx("div", { ref: i })
71727
71728
  ] }),
71728
71729
  /* @__PURE__ */ B.jsx("div", { className: Kn.inputContainer, children: /* @__PURE__ */ B.jsxs("div", { className: Kn.inputWrapper, children: [
71729
71730
  /* @__PURE__ */ B.jsx(
@@ -71731,7 +71732,7 @@ const mIe = "_chatDetails_12d43_24", gIe = "_dateSeparator_12d43_32", vIe = "_no
71731
71732
  {
71732
71733
  value: t,
71733
71734
  onChange: n,
71734
- onKeyDown: i,
71735
+ onKeyDown: l,
71735
71736
  placeholder: ia.INPUT_PLACEHOLDER
71736
71737
  }
71737
71738
  ),