@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.
@@ -36138,7 +36138,13 @@ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "
36138
36138
  margin-bottom: 25px;
36139
36139
  }
36140
36140
  & .engagements {
36141
- & > * {
36141
+ display: flex;
36142
+ flex-wrap: wrap;
36143
+ gap: 5px;
36144
+ margin-top: 5px;
36145
+ margin-bottom: 5px;
36146
+ align-items: center;
36147
+ & > span {
36142
36148
  border: solid 1px lightgray;
36143
36149
  padding: 3px;
36144
36150
  padding-left: 7px;
@@ -36210,6 +36216,15 @@ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "
36210
36216
  this.registerDisposable(yield this.resolve(MailboxSocket).join(mb.mailboxID.toString(), {
36211
36217
  newMail: () => {
36212
36218
  this.version++;
36219
+ },
36220
+ mailRead: (mailboxID, emailAddressID, emailID) => {
36221
+ for (const iterator of this.mailsRepeater.items) {
36222
+ if (iterator.emailID !== emailID) {
36223
+ continue;
36224
+ }
36225
+ iterator.timeRead = DateTime.now;
36226
+ this.mailsRepeater.refreshItem(iterator);
36227
+ }
36213
36228
  }
36214
36229
  }));
36215
36230
  this.renderer = XNode.create("div", null, XNode.create(AtomRepeater, Object.assign({
@@ -36227,12 +36242,29 @@ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "
36227
36242
  cancelToken
36228
36243
  })), {
36229
36244
  itemRenderer: thread => {
36230
- var _a, _b, _c, _d, _e, _f, _g;
36245
+ var _a, _b, _c, _d, _e, _f, _g, _h;
36231
36246
  const item = thread.email;
36232
36247
  const internalDate = (_b = (_a = item.dateSent) !== null && _a !== void 0 ? _a : item.dateReceived) !== null && _b !== void 0 ? _b : item.dateCreated;
36233
36248
  const sent = item.senderID === thread.mailboxID;
36234
36249
  const remaining = DateTime.from((_c = item.dateSent) !== null && _c !== void 0 ? _c : DateTime.today).diff(DateTime.now);
36235
36250
  const isSending = thread.email.status === "scheduled" && remaining.totalSeconds > 3;
36251
+ const engagements = (_d = thread.email.engagements) !== null && _d !== void 0 ? _d : [];
36252
+ const tags = ((_e = thread.email.tags) !== null && _e !== void 0 ? _e : "").split(",").filter(x => x);
36253
+ let readStatus = "";
36254
+ let readColor = "";
36255
+ if (sent) {
36256
+ const timeRead = thread.timeRead && DateTime.from(thread.timeRead);
36257
+ if (timeRead) {
36258
+ readStatus = `Read ${DateFormats.relative.short(timeRead)}`;
36259
+ readColor = "green";
36260
+ } else if (item.status === "sent") {
36261
+ readStatus = "Sent";
36262
+ readColor = "yellow";
36263
+ } else {
36264
+ readStatus = "In queue";
36265
+ readColor = "lightblue";
36266
+ }
36267
+ }
36236
36268
  if (remaining.totalSeconds > 0) {
36237
36269
  setTimeout(() => this.mailsRepeater.refreshItem(thread), 2000);
36238
36270
  }
@@ -36246,8 +36278,8 @@ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "
36246
36278
  text: item.subject
36247
36279
  }), item.received ? XNode.create("div", null) : item.userID !== SocialMailApp.user.userID && XNode.create("div", {
36248
36280
  "style-max-width": "20ch",
36249
- title: (_d = item.senderUser) === null || _d === void 0 ? void 0 : _d.displayName,
36250
- text: (_e = item.senderUser) === null || _e === void 0 ? void 0 : _e.displayName
36281
+ title: (_f = item.senderUser) === null || _f === void 0 ? void 0 : _f.displayName,
36282
+ text: (_g = item.senderUser) === null || _g === void 0 ? void 0 : _g.displayName
36251
36283
  }), XNode.create("div", {
36252
36284
  text: DateFormats.relative.short(internalDate),
36253
36285
  title: DateFormats.withWeekDayAndTime(internalDate)
@@ -36259,22 +36291,29 @@ System.register(["tslib", "@web-atoms/web-controls/dist/mobile-app/MobileApp", "
36259
36291
  height: "40vh"
36260
36292
  }, XNode.create("div", Object.assign({
36261
36293
  class: "message"
36262
- }, renderMail(thread)))), ((_f = item.engagements) === null || _f === void 0 ? void 0 : _f.length) && XNode.create("div", {
36294
+ }, renderMail(thread)))), XNode.create("div", {
36263
36295
  class: "engagements"
36264
- }, ...item.engagements.map(x => XNode.create("span", {
36296
+ }, sent && XNode.create("i", {
36297
+ class: "fa-solid fa-circle-small",
36298
+ "style-color": readColor,
36299
+ title: readStatus
36300
+ }), ...engagements.map(x => XNode.create("span", {
36265
36301
  "data-click-event": "view-engagements",
36266
36302
  "data-cursor": "pointer",
36267
36303
  title: `View all ${x.engagement} ${x.count}`,
36268
36304
  text: `${x.engagement} ${x.count}`
36269
- }))), ((_g = item.attachments) === null || _g === void 0 ? void 0 : _g.length) && XNode.create("div", {
36305
+ }))), ((_h = item.attachments) === null || _h === void 0 ? void 0 : _h.length) && XNode.create("div", {
36270
36306
  class: "attachments",
36271
36307
  "data-layout": "flex-wrap-padding"
36272
- }, ...item.attachments.map(FilePreview)), thread.email.tags && XNode.create("div", {
36273
- "data-layout": "row"
36274
- }, ...thread.email.tags.split(",").map(x => XNode.create("span", {
36308
+ }, ...item.attachments.map(FilePreview)), XNode.create("div", {
36309
+ "data-layout": "row",
36310
+ "data-margin-top": "default",
36311
+ "data-margin-bottom": "default"
36312
+ }, ...tags.map(x => XNode.create("span", {
36275
36313
  text: `#${x.startsWith("#") ? x.substring(1) : x}`
36276
36314
  }))), !sent && XNode.create("div", {
36277
- "data-layout": "row"
36315
+ "data-layout": "row",
36316
+ "data-margin-top": "default"
36278
36317
  }, XNode.create("i", {
36279
36318
  "data-click-event": "react-email",
36280
36319
  class: "fa-light fa-face-smile-plus",