@social-mail/social-mail-client 1.2.546 → 1.2.548
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/content/images/svg/logo/logo-orange.svg +57 -0
- package/dist/admin/AdminAppIndex.pack.js +2 -1
- package/dist/admin/AdminAppIndex.pack.js.map +1 -1
- package/dist/admin/AdminAppIndex.pack.min.js +1 -1
- package/dist/admin/AdminAppIndex.pack.min.js.map +1 -1
- package/dist/common/cache/CacheTTL.d.ts +1 -0
- package/dist/common/cache/CacheTTL.d.ts.map +1 -1
- package/dist/common/cache/CacheTTL.js +2 -1
- package/dist/common/cache/CacheTTL.js.map +1 -1
- package/dist/common/toBase36.d.ts +4 -0
- package/dist/common/toBase36.d.ts.map +1 -1
- package/dist/common/toBase36.js +33 -1
- package/dist/common/toBase36.js.map +1 -1
- package/dist/public/channel/BlogImageService.d.ts.map +1 -1
- package/dist/public/channel/BlogImageService.js +5 -2
- package/dist/public/channel/BlogImageService.js.map +1 -1
- package/dist/public/channel/BlogService.d.ts +4 -5
- package/dist/public/channel/BlogService.d.ts.map +1 -1
- package/dist/public/channel/BlogService.js +26 -10
- package/dist/public/channel/BlogService.js.map +1 -1
- package/dist/public/channel/ChannelMessage.d.ts +0 -12
- package/dist/public/channel/ChannelMessage.d.ts.map +1 -1
- package/dist/public/channel/ChannelMessage.js +3 -137
- package/dist/public/channel/ChannelMessage.js.map +1 -1
- package/dist/public/channel/ChannelMessageList.d.ts +0 -12
- package/dist/public/channel/ChannelMessageList.d.ts.map +1 -1
- package/dist/public/channel/ChannelMessageList.js +3 -127
- package/dist/public/channel/ChannelMessageList.js.map +1 -1
- package/dist/public/channel/ChannelView.d.ts +15 -3
- package/dist/public/channel/ChannelView.d.ts.map +1 -1
- package/dist/public/channel/ChannelView.js +169 -11
- package/dist/public/channel/ChannelView.js.map +1 -1
- package/dist/public/channel/ChannelView.pack.js +902 -884
- package/dist/public/channel/ChannelView.pack.js.map +1 -1
- package/dist/public/channel/ChannelView.pack.min.js +155 -142
- package/dist/public/channel/ChannelView.pack.min.js.map +1 -1
- package/dist/public/channel/PostSummary.d.ts +6 -0
- package/dist/public/channel/PostSummary.d.ts.map +1 -0
- package/dist/public/channel/PostSummary.js +61 -0
- package/dist/public/channel/PostSummary.js.map +1 -0
- package/dist/public/channel/UrlService.d.ts +3 -1
- package/dist/public/channel/UrlService.d.ts.map +1 -1
- package/dist/public/channel/UrlService.js +30 -4
- package/dist/public/channel/UrlService.js.map +1 -1
- package/dist/public/channel/controls/BlogHeader.d.ts +6 -0
- package/dist/public/channel/controls/BlogHeader.d.ts.map +1 -0
- package/dist/public/channel/controls/BlogHeader.js +42 -0
- package/dist/public/channel/controls/BlogHeader.js.map +1 -0
- package/dist/public/channel/controls/PostList.d.ts.map +1 -1
- package/dist/public/channel/controls/PostList.js +32 -9
- package/dist/public/channel/controls/PostList.js.map +1 -1
- package/dist/public/channel/controls/TagCloud.d.ts.map +1 -1
- package/dist/public/channel/controls/TagCloud.js +18 -5
- package/dist/public/channel/controls/TagCloud.js.map +1 -1
- package/dist/public/channel/styles/channelViewStyle.d.ts.map +1 -1
- package/dist/public/channel/styles/channelViewStyle.js +28 -16
- package/dist/public/channel/styles/channelViewStyle.js.map +1 -1
- package/dist/public/store/Store.pack.js +33 -1
- package/dist/public/store/Store.pack.js.map +1 -1
- package/dist/public/store/Store.pack.min.js +1 -1
- package/dist/public/store/Store.pack.min.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/web/AppIndex.pack.js +2 -1
- package/dist/web/AppIndex.pack.js.map +1 -1
- package/dist/web/AppIndex.pack.min.js +1 -1
- package/dist/web/AppIndex.pack.min.js.map +1 -1
- package/package.json +1 -1
- package/src/common/cache/CacheTTL.ts +2 -1
- package/src/common/toBase36.ts +36 -0
- package/src/public/channel/BlogImageService.ts +3 -0
- package/src/public/channel/BlogService.ts +19 -5
- package/src/public/channel/ChannelMessage.tsx +113 -117
- package/src/public/channel/ChannelMessageList.tsx +110 -106
- package/src/public/channel/ChannelView.tsx +153 -7
- package/src/public/channel/PostSummary.tsx +46 -0
- package/src/public/channel/UrlService.ts +23 -4
- package/src/public/channel/controls/BlogHeader.tsx +29 -0
- package/src/public/channel/controls/PostList.tsx +32 -5
- package/src/public/channel/controls/TagCloud.tsx +18 -4
- package/src/public/channel/styles/channelViewStyle.ts +28 -16
|
@@ -1,15 +1,161 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import InjectProperty from "@web-atoms/core/dist/core/InjectProperty";
|
|
4
|
+
import { AtomControl } from "@web-atoms/core/dist/web/controls/AtomControl";
|
|
5
|
+
import BlogService from "./BlogService";
|
|
6
|
+
import XNode from "@web-atoms/core/dist/core/XNode";
|
|
7
|
+
import Action from "@web-atoms/core/dist/view-model/Action";
|
|
8
|
+
import EmojiPopup from "./emoji/EmojiPopup";
|
|
1
9
|
import "../../style/GlobalStyle";
|
|
10
|
+
import "./styles/channelViewStyle";
|
|
11
|
+
import PopupService from "@web-atoms/core/dist/web/services/PopupService";
|
|
12
|
+
import { IEmail, IMailbox } from "../../model/model";
|
|
13
|
+
import AtomRepeater from "@web-atoms/web-controls/dist/basic/AtomRepeater";
|
|
14
|
+
import PostView from "./PostView";
|
|
15
|
+
import CopyIcon from "../../common/controls/buttons/CopyIcon";
|
|
16
|
+
import TagCloud from "./controls/TagCloud";
|
|
17
|
+
import PopularPosts from "./controls/PostList";
|
|
18
|
+
import RecentPosts from "./controls/RecentPosts";
|
|
19
|
+
import BlogHeader from "./controls/BlogHeader";
|
|
2
20
|
import Pack from "@web-atoms/core/dist/Pack";
|
|
21
|
+
import InfiniteRepeater from "../../common/controls/repeater/InfiniteRepeater";
|
|
22
|
+
import Bind from "@web-atoms/core/dist/core/Bind";
|
|
23
|
+
import PostSummary from "./PostSummary";
|
|
24
|
+
import { Base36 } from "../../common/toBase36";
|
|
25
|
+
|
|
26
|
+
const url = (window as any).pageUrl as URL ?? new URL(location.href);
|
|
27
|
+
|
|
28
|
+
let {
|
|
29
|
+
1: channelID = url.searchParams.get("p0") ,
|
|
30
|
+
2: type = url.searchParams.get("p1"),
|
|
31
|
+
3: p2 = url.searchParams.get("p2"),
|
|
32
|
+
}
|
|
33
|
+
= /^\/channels\/([^\/]+)\/([^\/]+)\/([^\/]+)\//.exec(url?.pathname) ?? {} as any;
|
|
3
34
|
|
|
35
|
+
if (channelID) {
|
|
36
|
+
channelID = Base36.decode(channelID) as any;
|
|
37
|
+
}
|
|
38
|
+
type ||= "";
|
|
39
|
+
if (p2) {
|
|
40
|
+
p2 = Base36.decode(p2);
|
|
41
|
+
}
|
|
42
|
+
const emailID = type === "p" ? p2 : void 0;
|
|
4
43
|
|
|
5
|
-
const
|
|
6
|
-
(window as any).pageUrl = url;
|
|
7
|
-
const { default: view } = await (/\/channels\//.test(url.pathname) || url.searchParams.has("detail")
|
|
8
|
-
? import("./ChannelMessage")
|
|
9
|
-
: import("./ChannelMessageList")) as any;
|
|
44
|
+
const commentIcon = "💬";
|
|
10
45
|
|
|
11
46
|
@Pack
|
|
12
|
-
export default class
|
|
47
|
+
export default class ChannelMessage extends AtomControl {
|
|
13
48
|
|
|
14
|
-
|
|
49
|
+
@InjectProperty
|
|
50
|
+
blogService: BlogService;
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
private channel: IMailbox;
|
|
54
|
+
private email: IEmail;
|
|
55
|
+
private search = "";
|
|
56
|
+
|
|
57
|
+
private tagID = type === "t" ? p2 : null;
|
|
58
|
+
private authorID = type === "a" ? p2 : null;
|
|
59
|
+
|
|
60
|
+
private emails: IEmail[] = [];
|
|
61
|
+
|
|
62
|
+
constructor(app, e = document.createElement("section")) {
|
|
63
|
+
super(app, e);
|
|
64
|
+
this.pushInit();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
async init() {
|
|
68
|
+
|
|
69
|
+
const channel = await this.blogService.getChannel(void 0, channelID, void 0);
|
|
70
|
+
this.channel = channel;
|
|
71
|
+
|
|
72
|
+
if (emailID){
|
|
73
|
+
this.email = await this.blogService.getEmail({ emailID, channelID});
|
|
74
|
+
this.email.engagements ??= [];
|
|
75
|
+
this.emails = [this.email];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const search = Bind.twoWaysImmediate(() => this.search);
|
|
79
|
+
|
|
80
|
+
this.element.setAttribute("data-blog-list", "blog-list");
|
|
81
|
+
this.element.setAttribute("data-layout", "flex-center");
|
|
82
|
+
this.renderer = <section>
|
|
83
|
+
<BlogHeader
|
|
84
|
+
search={search}
|
|
85
|
+
channel={channel}/>
|
|
86
|
+
<section>
|
|
87
|
+
{ emailID
|
|
88
|
+
? <AtomRepeater
|
|
89
|
+
items={this.emails}
|
|
90
|
+
itemRenderer={(x) => <PostView email={x} />}
|
|
91
|
+
/>
|
|
92
|
+
: <AtomRepeater
|
|
93
|
+
items={this.emails}
|
|
94
|
+
data-auto-scroll="false"
|
|
95
|
+
{ ... InfiniteRepeater.pagedItems((start) =>
|
|
96
|
+
(c, e, cancelToken) =>
|
|
97
|
+
this.blogService.getEmails({
|
|
98
|
+
channelID: this.channel.mailboxID,
|
|
99
|
+
authorID: this.authorID,
|
|
100
|
+
tagID: this.tagID,
|
|
101
|
+
start,
|
|
102
|
+
search: this.search,
|
|
103
|
+
cancelToken
|
|
104
|
+
})
|
|
105
|
+
)}
|
|
106
|
+
itemRenderer={(x) => <PostSummary mailboxEmail={x} />}
|
|
107
|
+
/> }
|
|
108
|
+
</section>
|
|
109
|
+
<aside>
|
|
110
|
+
<TagCloud/>
|
|
111
|
+
<PopularPosts/>
|
|
112
|
+
<RecentPosts/>
|
|
113
|
+
</aside>
|
|
114
|
+
<footer></footer>
|
|
115
|
+
</section>;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
@Action({ onEvent: "react-email"})
|
|
119
|
+
async reactEmail(email, ce: CustomEvent) {
|
|
120
|
+
const { headerMessageID } = email;
|
|
121
|
+
const emoji: string = await EmojiPopup.showControl(ce.target as any, { parentElement: ce.target as any});
|
|
122
|
+
const { channel } = this;
|
|
123
|
+
const subject = `${emoji}:${Number(email.emailID).toString(36)}:${headerMessageID}`;
|
|
124
|
+
await PopupService.alert({
|
|
125
|
+
message: <div data-layout="vertical-flex">
|
|
126
|
+
To add your emoji to this post, email just the emoji {emoji} with given subject to the channel email address.
|
|
127
|
+
<div>To: {channel.emailAddress.emailAddress} <CopyIcon text={channel.emailAddress.emailAddress}/> </div>
|
|
128
|
+
<div>Subject: {subject} <CopyIcon text={subject}/></div>
|
|
129
|
+
<div>Body: {emoji} <CopyIcon text={emoji}/></div>
|
|
130
|
+
<br/>
|
|
131
|
+
<div>If you have email client configured, you can click on following link.</div>
|
|
132
|
+
<div>
|
|
133
|
+
<a href={`mailto:${channel.emailAddress.emailAddress}?subject=${subject}&body=${emoji}&in-reply-to=${headerMessageID}`}>Email Now</a>
|
|
134
|
+
</div>
|
|
135
|
+
</div>,
|
|
136
|
+
title: "Send Email"
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
@Action({ onEvent: "reply-email"})
|
|
141
|
+
async replyEmail(email, ce: CustomEvent) {
|
|
142
|
+
const emoji = commentIcon;
|
|
143
|
+
const { headerMessageID } = email;
|
|
144
|
+
const { channel } = this;
|
|
145
|
+
const subject = `${emoji}:${Number(email.emailID).toString(36)}:${headerMessageID}`;
|
|
146
|
+
await PopupService.alert({
|
|
147
|
+
message: <div data-layout="vertical-flex">
|
|
148
|
+
To send comment to this post, email us your comment with given subject to the channel email address.
|
|
149
|
+
<div>To: {channel.emailAddress.emailAddress} <CopyIcon text={channel.emailAddress.emailAddress}/></div>
|
|
150
|
+
<div>Subject: {subject} <CopyIcon text={subject}/></div>
|
|
151
|
+
<br/>
|
|
152
|
+
<div>If you have email client configured, you can click on following link.</div>
|
|
153
|
+
<div>
|
|
154
|
+
<a href={`mailto:${channel.emailAddress.emailAddress}?subject=${subject}&in-reply-to=${headerMessageID}`}>Email Now</a>
|
|
155
|
+
</div>
|
|
156
|
+
</div>,
|
|
157
|
+
title: "Send Email"
|
|
158
|
+
});
|
|
159
|
+
}
|
|
15
160
|
|
|
161
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import XNode from "@web-atoms/core/dist/core/XNode";
|
|
2
|
+
import { IEmail, IEmailEngagement, IMailboxEmail } from "../../model/model";
|
|
3
|
+
import { DateFormats } from "../../common/date/DateFormats";
|
|
4
|
+
import { UMD } from "@web-atoms/core/dist/core/types";
|
|
5
|
+
import { renderMail } from "../../web/page/mails/service/ConversationService";
|
|
6
|
+
import { UrlService } from "./UrlService";
|
|
7
|
+
|
|
8
|
+
const commentIcon = "💬";
|
|
9
|
+
|
|
10
|
+
export default function PostSummary ({
|
|
11
|
+
mailboxEmail = void 0 as IMailboxEmail,
|
|
12
|
+
itemPath = void 0 as string
|
|
13
|
+
}) {
|
|
14
|
+
|
|
15
|
+
const { mailboxID, email } = mailboxEmail;
|
|
16
|
+
const { engagements = [] } = email;
|
|
17
|
+
|
|
18
|
+
const isComment = email.parentID !== null;
|
|
19
|
+
|
|
20
|
+
return <section
|
|
21
|
+
data-element="blog-item"
|
|
22
|
+
data-comment={isComment}
|
|
23
|
+
data-item-path={itemPath}>
|
|
24
|
+
<h4 data-element="title">
|
|
25
|
+
<a href={UrlService.toBlogUrl(mailboxEmail)} text={ isComment ? email.senderName : email.subject}/>
|
|
26
|
+
</h4>
|
|
27
|
+
<h6 data-element="date" text={DateFormats.relative.short(email.dateSent)}/>
|
|
28
|
+
{!isComment && <h5 text={email.senderName}/> }
|
|
29
|
+
<section
|
|
30
|
+
data-element="content"
|
|
31
|
+
data-fade="bottom">
|
|
32
|
+
{ !email.parentID
|
|
33
|
+
? <section { ... renderMail({ email })}/>
|
|
34
|
+
: <section text={email.textBody}/>
|
|
35
|
+
}
|
|
36
|
+
</section>
|
|
37
|
+
<footer>
|
|
38
|
+
{ ... engagements.map((x: IEmailEngagement) =>
|
|
39
|
+
<span
|
|
40
|
+
data-click-event={ x.engagement === commentIcon ? "view-comments" : "none" }
|
|
41
|
+
data-element="engagements"
|
|
42
|
+
title={`View all ${x.engagement} ${x.count}`}
|
|
43
|
+
text={`${x.engagement} ${x.count}`}/>)}
|
|
44
|
+
</footer>
|
|
45
|
+
</section>;
|
|
46
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { AppLocation } from "../../common/TestMode";
|
|
2
|
+
import { IMailboxEmail, IMailboxTag } from "../../model/model";
|
|
2
3
|
|
|
3
4
|
export const UrlService = {
|
|
4
5
|
|
|
5
|
-
toBlogUrl
|
|
6
|
+
toBlogUrl ({ mailboxID, emailID, email: { subject } = {} as any }: IMailboxEmail) {
|
|
6
7
|
subject ||= "";
|
|
7
8
|
if(subject.length > 400) {
|
|
8
9
|
subject = subject.substring(0, 400);
|
|
@@ -10,13 +11,31 @@ export const UrlService = {
|
|
|
10
11
|
subject = subject.replace(/[^\p{L}\p{N}]+/ug, "-");
|
|
11
12
|
subject = encodeURIComponent(subject).replace(/\%20/g, "-");
|
|
12
13
|
|
|
13
|
-
const cid = BigInt(
|
|
14
|
+
const cid = BigInt(mailboxID).toString(36);
|
|
14
15
|
const eid = BigInt(emailID).toString(36);
|
|
15
16
|
|
|
16
17
|
if (AppLocation.isLocalTesting) {
|
|
17
|
-
return `?detail=true&
|
|
18
|
+
return `?detail=true&p0=${cid}&p1=p&p2=${eid}`;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
return `/channels/${cid}/${eid}/${subject}`;
|
|
21
|
+
return `/channels/${cid}/p/${eid}/${subject}`;
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
toTagUrl ({ mailboxID, tagID, tag: { name } = {} as any }: IMailboxTag) {
|
|
25
|
+
const cid = BigInt(mailboxID).toString(36);
|
|
26
|
+
const eid = BigInt(tagID).toString(36);
|
|
27
|
+
if (AppLocation.isLocalTesting) {
|
|
28
|
+
return `?detail=true&p0=${cid}&p1=t&p2=${eid}`;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
name ||= "";
|
|
32
|
+
if(name.length > 400) {
|
|
33
|
+
name = name.substring(0, 400);
|
|
34
|
+
}
|
|
35
|
+
name = name.replace(/[^\p{L}\p{N}]+/ug, "-");
|
|
36
|
+
name = encodeURIComponent(name).replace(/\%20/g, "-");
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
return `/channels/${cid}/t/${eid}/${name}`;
|
|
21
40
|
}
|
|
22
41
|
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import XNode from "@web-atoms/core/dist/core/XNode";
|
|
2
|
+
import { IMailbox } from "../../../model/model";
|
|
3
|
+
import styled from "@web-atoms/core/dist/style/styled";
|
|
4
|
+
|
|
5
|
+
styled.css `
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
gap: 10px;
|
|
9
|
+
& > * {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: row;
|
|
12
|
+
gap: 10px;
|
|
13
|
+
align-items: center;
|
|
14
|
+
}
|
|
15
|
+
`.installGlobal("header.blog-header");
|
|
16
|
+
|
|
17
|
+
export default function BlogHeader({ channel, search }: { channel: IMailbox, search?: string }) {
|
|
18
|
+
return <header class="blog-header">
|
|
19
|
+
<div>
|
|
20
|
+
<span text={channel.emailAddress.name}/>
|
|
21
|
+
<a href={`mailto:subscribe-${channel.emailAddress.emailAddress}?subject=subscribe`}><button>Follow</button></a>
|
|
22
|
+
</div>
|
|
23
|
+
{ search && <div>
|
|
24
|
+
<input
|
|
25
|
+
placeholder="Search..."
|
|
26
|
+
value={search}/>
|
|
27
|
+
</div>}
|
|
28
|
+
</header>;
|
|
29
|
+
}
|
|
@@ -12,6 +12,9 @@ import Bind from "@web-atoms/core/dist/core/Bind";
|
|
|
12
12
|
import loaderImage from "@social-mail/social-mail-client/content/images/gif/loader.gif";
|
|
13
13
|
import { Sql } from "../../../common/Sql";
|
|
14
14
|
import BlogImageService from "../BlogImageService";
|
|
15
|
+
import { CacheTTL } from "../../../common/cache/CacheTTL";
|
|
16
|
+
|
|
17
|
+
const cacheVersion = "1a";
|
|
15
18
|
|
|
16
19
|
|
|
17
20
|
styled.css `
|
|
@@ -23,8 +26,8 @@ import BlogImageService from "../BlogImageService";
|
|
|
23
26
|
& > header {
|
|
24
27
|
display: block;
|
|
25
28
|
flex: 1 1 100%;
|
|
26
|
-
|
|
27
|
-
color:
|
|
29
|
+
color: var(--accent-color, gray);
|
|
30
|
+
background-color: #cccccc0a;
|
|
28
31
|
padding: 5px;
|
|
29
32
|
}
|
|
30
33
|
|
|
@@ -36,6 +39,25 @@ import BlogImageService from "../BlogImageService";
|
|
|
36
39
|
}
|
|
37
40
|
}
|
|
38
41
|
|
|
42
|
+
& [data-item-index] {
|
|
43
|
+
display: grid;
|
|
44
|
+
grid-template-columns: 50px 1fr;
|
|
45
|
+
column-gap: 10px;
|
|
46
|
+
align-items: center;
|
|
47
|
+
& > img {
|
|
48
|
+
width: 50px;
|
|
49
|
+
height: 30px;
|
|
50
|
+
object-fit: contain;
|
|
51
|
+
grid-column: 1;
|
|
52
|
+
}
|
|
53
|
+
& > a {
|
|
54
|
+
grid-column: 2;
|
|
55
|
+
white-space: nowrap;
|
|
56
|
+
overflow: hidden;
|
|
57
|
+
text-overflow: ellipsis;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
39
61
|
`.installGlobal("post-list");
|
|
40
62
|
|
|
41
63
|
export default class PostList extends AtomRepeater {
|
|
@@ -57,9 +79,12 @@ export default class PostList extends AtomRepeater {
|
|
|
57
79
|
|
|
58
80
|
this.setHeader();
|
|
59
81
|
this.headerRenderer = (text) => <header text={text}/>;
|
|
60
|
-
this.itemRenderer = (x: IMailboxEmail) => <div
|
|
82
|
+
this.itemRenderer = (x: IMailboxEmail) => <div>
|
|
61
83
|
<img src={Bind.oneTimeAsync(() => this.blogImageService.getImage(x), loaderImage)}/>
|
|
62
|
-
<a
|
|
84
|
+
<a
|
|
85
|
+
href={UrlService.toBlogUrl(x)}
|
|
86
|
+
title={x.email.subject}
|
|
87
|
+
target="_blank" text={x.email.subject}></a>
|
|
63
88
|
</div>;
|
|
64
89
|
const q = this.entityService.query(MailboxEmail, "channelEmails")
|
|
65
90
|
.include((x) => x.email);
|
|
@@ -76,7 +101,9 @@ export default class PostList extends AtomRepeater {
|
|
|
76
101
|
return q
|
|
77
102
|
.orderByDescending((x) => x.engagementCount)
|
|
78
103
|
.toPagedList({
|
|
79
|
-
size: 5
|
|
104
|
+
size: 5,
|
|
105
|
+
cacheVersion,
|
|
106
|
+
cacheSeconds: CacheTTL.seconds.fifteenMinutes
|
|
80
107
|
});
|
|
81
108
|
}
|
|
82
109
|
}
|
|
@@ -4,6 +4,11 @@ import EntityService from "../../../services/EntityService";
|
|
|
4
4
|
import { IMailbox, IMailboxTag, MailboxTag } from "../../../model/model";
|
|
5
5
|
import XNode from "@web-atoms/core/dist/core/XNode";
|
|
6
6
|
import styled from "@web-atoms/core/dist/style/styled";
|
|
7
|
+
import { UrlService } from "../UrlService";
|
|
8
|
+
import { CacheTTL } from "../../../common/cache/CacheTTL";
|
|
9
|
+
|
|
10
|
+
const cacheVersion = "1a";
|
|
11
|
+
|
|
7
12
|
|
|
8
13
|
styled.css `
|
|
9
14
|
display: flex;
|
|
@@ -19,6 +24,13 @@ import styled from "@web-atoms/core/dist/style/styled";
|
|
|
19
24
|
padding: 5px;
|
|
20
25
|
}
|
|
21
26
|
|
|
27
|
+
& a {
|
|
28
|
+
text-decoration: none;
|
|
29
|
+
&:hover {
|
|
30
|
+
text-decoration: underline;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
22
34
|
`.installGlobal("tag-cloud");
|
|
23
35
|
|
|
24
36
|
export default class TagCloud extends AtomRepeater {
|
|
@@ -33,17 +45,19 @@ export default class TagCloud extends AtomRepeater {
|
|
|
33
45
|
|
|
34
46
|
async init() {
|
|
35
47
|
|
|
36
|
-
this.header = true;
|
|
37
|
-
this.headerRenderer = () => <header>Tags</header>;
|
|
48
|
+
// this.header = true;
|
|
49
|
+
// this.headerRenderer = () => <header>Tags</header>;
|
|
38
50
|
|
|
39
51
|
const tags = await this.entityService.query(MailboxTag, "channelTags")
|
|
40
52
|
.include((x) => x.tag)
|
|
41
53
|
.orderByDescending((x) => x.count)
|
|
42
54
|
.toPagedList({
|
|
43
|
-
size: 20
|
|
55
|
+
size: 20,
|
|
56
|
+
cacheVersion,
|
|
57
|
+
cacheSeconds: CacheTTL.seconds.fifteenMinutes
|
|
44
58
|
});
|
|
45
59
|
|
|
46
|
-
this.itemRenderer = (x: IMailboxTag) => <a text={`# ${x.tag.name}`}></a>;
|
|
60
|
+
this.itemRenderer = (x: IMailboxTag) => <a href={UrlService.toTagUrl(x)} text={`# ${x.tag.name}`}></a>;
|
|
47
61
|
this.items = tags.items;
|
|
48
62
|
}
|
|
49
63
|
|
|
@@ -24,13 +24,10 @@ box-sizing: border-box;
|
|
|
24
24
|
|
|
25
25
|
& section[data-element=blog-item] {
|
|
26
26
|
margin: 10px;
|
|
27
|
-
border: solid 1px lightgray;
|
|
28
|
-
border-radius: 10px;
|
|
27
|
+
border-right: solid 1px lightgray;
|
|
29
28
|
display: grid;
|
|
30
|
-
grid-template-columns: 1fr auto
|
|
31
|
-
grid-template-rows: auto 1fr auto auto;
|
|
32
|
-
|
|
33
|
-
background-color: gray;
|
|
29
|
+
grid-template-columns: 1fr auto;
|
|
30
|
+
grid-template-rows: auto auto 1fr auto auto;
|
|
34
31
|
|
|
35
32
|
& video, & img {
|
|
36
33
|
max-width: 100%;
|
|
@@ -41,46 +38,61 @@ box-sizing: border-box;
|
|
|
41
38
|
color: canvastext;
|
|
42
39
|
}
|
|
43
40
|
|
|
41
|
+
& [data-fade=bottom] {
|
|
42
|
+
position: relative;
|
|
43
|
+
max-height: 200px;
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
&:after {
|
|
46
|
+
position: absolute;
|
|
47
|
+
left: 0;
|
|
48
|
+
right: 0;
|
|
49
|
+
top: 0;
|
|
50
|
+
bottom: 0;
|
|
51
|
+
content: "";
|
|
52
|
+
margin: 0;
|
|
53
|
+
pointer-events: none;
|
|
54
|
+
background: linear-gradient(to top, rgba(255, 255, 255, 1) 1px, rgba(255, 255, 255, 0) 32px);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
44
58
|
& > h4 {
|
|
45
59
|
grid-row: 1;
|
|
46
|
-
grid-column: 1;
|
|
60
|
+
grid-column: 1 / span 2;
|
|
47
61
|
margin-block-start: 0;
|
|
48
62
|
margin-block-end: 0;
|
|
49
63
|
padding: 10px;
|
|
50
64
|
& > a {
|
|
51
65
|
text-decoration: none;
|
|
52
|
-
color: white;
|
|
53
66
|
&:hover {
|
|
54
67
|
text-decoration: underline;
|
|
55
|
-
color: #73ff73;
|
|
56
68
|
}
|
|
57
69
|
}
|
|
58
70
|
}
|
|
59
71
|
|
|
60
72
|
& > h5 {
|
|
61
|
-
grid-row:
|
|
62
|
-
grid-column:
|
|
73
|
+
grid-row: 2;
|
|
74
|
+
grid-column: 1;
|
|
63
75
|
margin-block-start: 0;
|
|
64
76
|
margin-block-end: 0;
|
|
65
77
|
padding: 10px;
|
|
66
78
|
}
|
|
67
79
|
& > h6 {
|
|
68
|
-
grid-row:
|
|
69
|
-
grid-column:
|
|
80
|
+
grid-row: 2;
|
|
81
|
+
grid-column: 2;
|
|
70
82
|
margin-block-start: 0;
|
|
71
83
|
margin-block-end: 0;
|
|
72
84
|
padding: 10px;
|
|
73
85
|
}
|
|
74
86
|
& > section {
|
|
75
87
|
padding: 10px;
|
|
76
|
-
grid-row:
|
|
88
|
+
grid-row: 3;
|
|
77
89
|
grid-column: 1 / span 3;
|
|
78
90
|
background-color: canvas;
|
|
79
91
|
color: canvastext;
|
|
80
92
|
}
|
|
81
93
|
& > footer {
|
|
82
94
|
padding: 10px;
|
|
83
|
-
grid-row:
|
|
95
|
+
grid-row: 5;
|
|
84
96
|
grid-column: 1/ span 3;
|
|
85
97
|
background-color: canvas;
|
|
86
98
|
color: canvastext;
|
|
@@ -148,7 +160,7 @@ gap: 5px;
|
|
|
148
160
|
& > aside {
|
|
149
161
|
grid-row: 2;
|
|
150
162
|
grid-column: 2;
|
|
151
|
-
justify-self:
|
|
163
|
+
justify-self: stretch;
|
|
152
164
|
align-self: start;
|
|
153
165
|
display: flex;
|
|
154
166
|
flex-direction: column;
|