@social-mail/social-mail-client 1.2.563 → 1.2.565

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.
Files changed (40) hide show
  1. package/dist/admin/AdminAppIndex.pack.js +1 -1
  2. package/dist/admin/AdminAppIndex.pack.js.map +1 -1
  3. package/dist/admin/AdminAppIndex.pack.min.js +1 -1
  4. package/dist/admin/AdminAppIndex.pack.min.js.map +1 -1
  5. package/dist/model/model.d.ts +1 -0
  6. package/dist/model/model.d.ts.map +1 -1
  7. package/dist/model/model.js.map +1 -1
  8. package/dist/public/channel/ChannelView.js +1 -0
  9. package/dist/public/channel/ChannelView.js.map +1 -1
  10. package/dist/public/channel/ChannelView.pack.js +15 -17
  11. package/dist/public/channel/ChannelView.pack.js.map +1 -1
  12. package/dist/public/channel/ChannelView.pack.min.js +3 -3
  13. package/dist/public/channel/ChannelView.pack.min.js.map +1 -1
  14. package/dist/public/channel/PostSummary.d.ts +3 -2
  15. package/dist/public/channel/PostSummary.d.ts.map +1 -1
  16. package/dist/public/channel/PostSummary.js +4 -1
  17. package/dist/public/channel/PostSummary.js.map +1 -1
  18. package/dist/public/channel/UrlService.d.ts +1 -1
  19. package/dist/public/channel/UrlService.d.ts.map +1 -1
  20. package/dist/public/channel/UrlService.js +9 -15
  21. package/dist/public/channel/UrlService.js.map +1 -1
  22. package/dist/public/channel/controls/PostList.js +1 -1
  23. package/dist/public/channel/controls/PostList.js.map +1 -1
  24. package/dist/public/store/Store.pack.js.map +1 -1
  25. package/dist/public/store/Store.pack.min.js.map +1 -1
  26. package/dist/public/store/cart/ShoppingCart.pack.js.map +1 -1
  27. package/dist/public/store/cart/ShoppingCart.pack.min.js.map +1 -1
  28. package/dist/site-editor/editor/webComponentsPath.js +1 -1
  29. package/dist/tsconfig.tsbuildinfo +1 -1
  30. package/dist/web/AppIndex.pack.js +1 -1
  31. package/dist/web/AppIndex.pack.js.map +1 -1
  32. package/dist/web/AppIndex.pack.min.js +1 -1
  33. package/dist/web/AppIndex.pack.min.js.map +1 -1
  34. package/package.json +1 -1
  35. package/src/model/model.ts +1 -0
  36. package/src/public/channel/ChannelView.tsx +1 -1
  37. package/src/public/channel/PostSummary.tsx +3 -2
  38. package/src/public/channel/UrlService.ts +5 -12
  39. package/src/public/channel/controls/PostList.tsx +1 -1
  40. package/src/site-editor/editor/webComponentsPath.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@social-mail/social-mail-client",
3
- "version": "1.2.563",
3
+ "version": "1.2.565",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -765,6 +765,7 @@ export interface IMailboxEmail extends IClrEntity {
765
765
  engagementCount?: number;
766
766
  dateUpdated?: DateTime | null;
767
767
  datePublished?: DateTime | null;
768
+ slug?: string;
768
769
  mailbox?: IMailbox;
769
770
  email?: IEmail;
770
771
  }
@@ -95,7 +95,7 @@ export default class ChannelMessage extends AtomControl {
95
95
  data-items-updated-event="items-updated"
96
96
  event-items-updated={() => this.itemsUpdated()}
97
97
  data-auto-scroll="false"
98
- itemRenderer={(x) => <PostSummary mailboxEmail={x} />}
98
+ itemRenderer={(x) => <PostSummary channel={channel} mailboxEmail={x} />}
99
99
  items={this.emails}
100
100
  { ... InfiniteRepeater.pagedItems((start) =>
101
101
  (c, e, cancelToken) =>
@@ -1,5 +1,5 @@
1
1
  import XNode from "@web-atoms/core/dist/core/XNode";
2
- import { IEmail, IEmailEngagement, IMailboxEmail } from "../../model/model";
2
+ import { IEmail, IEmailEngagement, IMailbox, IMailboxEmail } from "../../model/model";
3
3
  import { DateFormats } from "../../common/date/DateFormats";
4
4
  import { UMD } from "@web-atoms/core/dist/core/types";
5
5
  import { renderMail } from "../../web/page/mails/service/ConversationService";
@@ -8,6 +8,7 @@ import { UrlService } from "./UrlService";
8
8
  const commentIcon = "💬";
9
9
 
10
10
  export default function PostSummary ({
11
+ channel = void 0 as IMailbox,
11
12
  mailboxEmail = void 0 as IMailboxEmail,
12
13
  itemPath = void 0 as string
13
14
  }) {
@@ -22,7 +23,7 @@ export default function PostSummary ({
22
23
  data-comment={isComment}
23
24
  data-item-path={itemPath}>
24
25
  <h4 data-element="title">
25
- <a href={UrlService.toBlogUrl(mailboxEmail)} text={ isComment ? email.senderName : email.subject}/>
26
+ <a href={UrlService.toBlogUrl({ mailbox: channel, ... mailboxEmail })} text={ isComment ? email.senderName : email.subject}/>
26
27
  </h4>
27
28
  <h6 data-element="date" text={DateFormats.relative.short(email.dateSent)}/>
28
29
  {!isComment && <h5 text={email.senderName}/> }
@@ -1,24 +1,17 @@
1
1
  import { AppLocation } from "../../common/TestMode";
2
- import { IMailboxEmail, IMailboxTag } from "../../model/model";
2
+ import { IMailbox, IMailboxEmail, IMailboxTag } from "../../model/model";
3
3
 
4
4
  export const UrlService = {
5
5
 
6
- toBlogUrl ({ mailboxID, emailID, email: { subject } = {} as any }: IMailboxEmail) {
7
- subject ||= "";
8
- if(subject.length > 400) {
9
- subject = subject.substring(0, 400);
10
- }
11
- subject = subject.replace(/[^\p{L}\p{N}]+/ug, "-");
12
- subject = encodeURIComponent(subject).replace(/\%20/g, "-");
6
+ toBlogUrl ({ slug, mailbox: { emailAddress: { emailAddress } } }: IMailboxEmail) {
13
7
 
14
- const cid = BigInt(mailboxID).toString(36);
15
- const eid = BigInt(emailID).toString(36);
8
+ const cid = "@" + emailAddress.split("@")[0];
16
9
 
17
10
  if (AppLocation.isLocalTesting) {
18
- return `?detail=true&p0=${cid}&p1=p&p2=${eid}`;
11
+ return `?detail=${cid}/${slug}`;
19
12
  }
20
13
 
21
- return `/channels/${cid}/p/${eid}/${subject}`;
14
+ return `/c/${cid}/${slug}`;
22
15
  },
23
16
 
24
17
  toTagUrl ({ mailboxID, tagID, tag: { name } = {} as any }: IMailboxTag) {
@@ -88,7 +88,7 @@ export default class PostList extends AtomRepeater {
88
88
  </div>;
89
89
  const q = this.entityService.query(MailboxEmail, "channelEmails")
90
90
  .where((x) => x.email.parentID === null)
91
- .include((x) => x.email);
91
+ .include((x) => [x.email, x.mailbox.emailAddress]);
92
92
  const posts = await this.query(q as any as Query<IMailboxEmail>);
93
93
  this.items = posts.items;
94
94
  }
@@ -26,7 +26,7 @@ const addAttributes = (target, values: (x: any) => IEditableAttribute[]) => {
26
26
 
27
27
  export class WebComponents {
28
28
 
29
- static path = `//cdn.jsdelivr.net/npm/@social-mail/web-components@1.0.118`;
29
+ static path = `//cdn.jsdelivr.net/npm/@social-mail/web-components@1.0.119`;
30
30
 
31
31
  static async run2(frame: HTMLIFrameElement, doc: Document) {
32
32
  const url = this.path + "/dist/editable.js";