@social-mail/social-mail-client 1.2.93 → 1.2.96

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.
@@ -28821,7 +28821,13 @@ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "
28821
28821
  margin-bottom: 25px;
28822
28822
  }
28823
28823
  & .engagements {
28824
- & > * {
28824
+ display: flex;
28825
+ flex-wrap: wrap;
28826
+ gap: 5px;
28827
+ margin-top: 5px;
28828
+ margin-bottom: 5px;
28829
+ align-items: center;
28830
+ & > span {
28825
28831
  border: solid 1px lightgray;
28826
28832
  padding: 3px;
28827
28833
  padding-left: 7px;
@@ -28893,6 +28899,15 @@ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "
28893
28899
  this.registerDisposable(yield this.resolve(MailboxSocket).join(mb.mailboxID.toString(), {
28894
28900
  newMail: () => {
28895
28901
  this.version++;
28902
+ },
28903
+ mailRead: (mailboxID, emailAddressID, emailID) => {
28904
+ for (const iterator of this.mailsRepeater.items) {
28905
+ if (iterator.emailID !== emailID) {
28906
+ continue;
28907
+ }
28908
+ iterator.timeRead = DateTime.now;
28909
+ this.mailsRepeater.refreshItem(iterator);
28910
+ }
28896
28911
  }
28897
28912
  }));
28898
28913
  this.renderer = XNode.create("div", null, XNode.create(AtomRepeater, Object.assign({
@@ -28910,12 +28925,29 @@ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "
28910
28925
  cancelToken
28911
28926
  })), {
28912
28927
  itemRenderer: thread => {
28913
- var _a, _b, _c, _d, _e, _f, _g;
28928
+ var _a, _b, _c, _d, _e, _f, _g, _h;
28914
28929
  const item = thread.email;
28915
28930
  const internalDate = (_b = (_a = item.dateSent) !== null && _a !== void 0 ? _a : item.dateReceived) !== null && _b !== void 0 ? _b : item.dateCreated;
28916
28931
  const sent = item.senderID === thread.mailboxID;
28917
28932
  const remaining = DateTime.from((_c = item.dateSent) !== null && _c !== void 0 ? _c : DateTime.today).diff(DateTime.now);
28918
28933
  const isSending = thread.email.status === "scheduled" && remaining.totalSeconds > 3;
28934
+ const engagements = (_d = thread.email.engagements) !== null && _d !== void 0 ? _d : [];
28935
+ const tags = ((_e = thread.email.tags) !== null && _e !== void 0 ? _e : "").split(",").filter(x => x);
28936
+ let readStatus = "";
28937
+ let readColor = "";
28938
+ if (sent) {
28939
+ const timeRead = thread.timeRead && DateTime.from(thread.timeRead);
28940
+ if (timeRead) {
28941
+ readStatus = `Read ${DateFormats.relative.short(timeRead)}`;
28942
+ readColor = "green";
28943
+ } else if (item.status === "sent") {
28944
+ readStatus = "Sent";
28945
+ readColor = "yellow";
28946
+ } else {
28947
+ readStatus = "In queue";
28948
+ readColor = "lightblue";
28949
+ }
28950
+ }
28919
28951
  if (remaining.totalSeconds > 0) {
28920
28952
  setTimeout(() => this.mailsRepeater.refreshItem(thread), 2000);
28921
28953
  }
@@ -28929,8 +28961,8 @@ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "
28929
28961
  text: item.subject
28930
28962
  }), item.received ? XNode.create("div", null) : item.userID !== SocialMailApp.user.userID && XNode.create("div", {
28931
28963
  "style-max-width": "20ch",
28932
- title: (_d = item.senderUser) === null || _d === void 0 ? void 0 : _d.displayName,
28933
- text: (_e = item.senderUser) === null || _e === void 0 ? void 0 : _e.displayName
28964
+ title: (_f = item.senderUser) === null || _f === void 0 ? void 0 : _f.displayName,
28965
+ text: (_g = item.senderUser) === null || _g === void 0 ? void 0 : _g.displayName
28934
28966
  }), XNode.create("div", {
28935
28967
  text: DateFormats.relative.short(internalDate),
28936
28968
  title: DateFormats.withWeekDayAndTime(internalDate)
@@ -28942,22 +28974,29 @@ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "
28942
28974
  height: "40vh"
28943
28975
  }, XNode.create("div", Object.assign({
28944
28976
  class: "message"
28945
- }, renderMail(thread)))), ((_f = item.engagements) === null || _f === void 0 ? void 0 : _f.length) && XNode.create("div", {
28977
+ }, renderMail(thread)))), XNode.create("div", {
28946
28978
  class: "engagements"
28947
- }, ...item.engagements.map(x => XNode.create("span", {
28979
+ }, sent && XNode.create("i", {
28980
+ class: "fa-solid fa-circle-small",
28981
+ "style-color": readColor,
28982
+ title: readStatus
28983
+ }), ...engagements.map(x => XNode.create("span", {
28948
28984
  "data-click-event": "view-engagements",
28949
28985
  "data-cursor": "pointer",
28950
28986
  title: `View all ${x.engagement} ${x.count}`,
28951
28987
  text: `${x.engagement} ${x.count}`
28952
- }))), ((_g = item.attachments) === null || _g === void 0 ? void 0 : _g.length) && XNode.create("div", {
28988
+ }))), ((_h = item.attachments) === null || _h === void 0 ? void 0 : _h.length) && XNode.create("div", {
28953
28989
  class: "attachments",
28954
28990
  "data-layout": "flex-wrap-padding"
28955
- }, ...item.attachments.map(FilePreview)), thread.email.tags && XNode.create("div", {
28956
- "data-layout": "row"
28957
- }, ...thread.email.tags.split(",").map(x => XNode.create("span", {
28991
+ }, ...item.attachments.map(FilePreview)), XNode.create("div", {
28992
+ "data-layout": "row",
28993
+ "data-margin-top": "default",
28994
+ "data-margin-bottom": "default"
28995
+ }, ...tags.map(x => XNode.create("span", {
28958
28996
  text: `#${x.startsWith("#") ? x.substring(1) : x}`
28959
28997
  }))), !sent && XNode.create("div", {
28960
- "data-layout": "row"
28998
+ "data-layout": "row",
28999
+ "data-margin-top": "default"
28961
29000
  }, XNode.create("i", {
28962
29001
  "data-click-event": "react-email",
28963
29002
  class: "fa-light fa-face-smile-plus",