@social-mail/social-mail-client 1.2.61 → 1.2.63
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/admin/AdminAppIndex.pack.js +25 -6
- package/dist/admin/AdminAppIndex.pack.js.map +1 -1
- package/dist/admin/AdminAppIndex.pack.min.js +2 -2
- package/dist/admin/AdminAppIndex.pack.min.js.map +1 -1
- package/dist/common/controls/repeater/InfiniteRepeater.d.ts.map +1 -1
- package/dist/common/controls/repeater/InfiniteRepeater.js +8 -5
- package/dist/common/controls/repeater/InfiniteRepeater.js.map +1 -1
- package/dist/public/channel/ChannelMessage.d.ts +7 -0
- package/dist/public/channel/ChannelMessage.d.ts.map +1 -0
- package/dist/public/channel/ChannelMessage.js +42 -0
- package/dist/public/channel/ChannelMessage.js.map +1 -0
- package/dist/public/channel/ChannelMessageList.d.ts +12 -0
- package/dist/public/channel/ChannelMessageList.d.ts.map +1 -0
- package/dist/public/channel/ChannelMessageList.js +103 -0
- package/dist/public/channel/ChannelMessageList.js.map +1 -0
- package/dist/public/channel/ChannelView.d.ts +3 -10
- package/dist/public/channel/ChannelView.d.ts.map +1 -1
- package/dist/public/channel/ChannelView.js +20 -87
- package/dist/public/channel/ChannelView.js.map +1 -1
- package/dist/public/channel/ChannelView.pack.js +6578 -6491
- package/dist/public/channel/ChannelView.pack.js.map +1 -1
- package/dist/public/channel/ChannelView.pack.min.js +193 -185
- package/dist/public/channel/ChannelView.pack.min.js.map +1 -1
- package/dist/site-editor/styler/Styler.d.ts +64 -0
- package/dist/site-editor/styler/Styler.d.ts.map +1 -1
- package/dist/site-editor/styler/Styler.js +17 -1
- package/dist/site-editor/styler/Styler.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/web/AppIndex.pack.js +25 -6
- package/dist/web/AppIndex.pack.js.map +1 -1
- package/dist/web/AppIndex.pack.min.js +2 -2
- package/dist/web/AppIndex.pack.min.js.map +1 -1
- package/package.json +1 -1
- package/src/common/controls/repeater/InfiniteRepeater.tsx +8 -4
- package/src/public/channel/ChannelMessage.tsx +18 -0
- package/src/public/channel/ChannelMessageList.tsx +93 -0
- package/src/public/channel/ChannelView.tsx +16 -82
- package/src/site-editor/styler/Styler.ts +32 -0
package/package.json
CHANGED
|
@@ -63,10 +63,14 @@ const pagedItemsSetter = AtomControl.registerProperty("paged-items", "paged-item
|
|
|
63
63
|
control.items = value.items;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
const autoScroll = control.element.getAttribute("data-auto-scroll") !== "false";
|
|
67
|
+
|
|
68
|
+
if (autoScroll) {
|
|
69
|
+
setTimeout(() => {
|
|
70
|
+
const ce = control.element?.firstElementChild as HTMLElement;
|
|
71
|
+
ce?.scrollIntoView();
|
|
72
|
+
}, 100);
|
|
73
|
+
}
|
|
70
74
|
|
|
71
75
|
control.footer = value.total && value.items && value.items.length < value.total;
|
|
72
76
|
(control as any).pagedItems = value;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import InjectProperty from "@web-atoms/core/dist/core/InjectProperty";
|
|
2
|
+
import { AtomControl } from "@web-atoms/core/dist/web/controls/AtomControl";
|
|
3
|
+
import BlogService from "./BlogService";
|
|
4
|
+
|
|
5
|
+
const url = (window as any).pageUrl as URL;
|
|
6
|
+
|
|
7
|
+
const {1: channelID = 1, 2: emailID = 1 } = /^\/channels\/(\d+)\/(\d+)\//.exec(url.pathname) ?? {} as any;
|
|
8
|
+
|
|
9
|
+
export default class ChannelMessage extends AtomControl {
|
|
10
|
+
|
|
11
|
+
@InjectProperty
|
|
12
|
+
blogService: BlogService;
|
|
13
|
+
|
|
14
|
+
async init() {
|
|
15
|
+
const { items: [ email ]} = await this.blogService.getEmails({ channelID, start: 0, size: 1, cancelToken: null});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import Bind from "@web-atoms/core/dist/core/Bind";
|
|
2
|
+
import InjectProperty from "@web-atoms/core/dist/core/InjectProperty";
|
|
3
|
+
import XNode from "@web-atoms/core/dist/core/XNode";
|
|
4
|
+
import { AtomControl } from "@web-atoms/core/dist/web/controls/AtomControl";
|
|
5
|
+
import AtomRepeater from "@web-atoms/web-controls/dist/basic/AtomRepeater";
|
|
6
|
+
import LimitedText from "@web-atoms/web-controls/dist/basic/LimitedText";
|
|
7
|
+
import InfiniteRepeater from "../../common/controls/repeater/InfiniteRepeater";
|
|
8
|
+
import { DateFormats } from "../../common/date/DateFormats";
|
|
9
|
+
import { IMailbox, IEmail } from "../../model/model";
|
|
10
|
+
import { renderMail } from "../../web/page/mails/service/ConversationService";
|
|
11
|
+
import BlogService from "./BlogService";
|
|
12
|
+
import { channelViewStyle } from "./channelViewStyle";
|
|
13
|
+
|
|
14
|
+
export default class ChannelView extends AtomControl {
|
|
15
|
+
|
|
16
|
+
@InjectProperty
|
|
17
|
+
blogService: BlogService;
|
|
18
|
+
|
|
19
|
+
search = "";
|
|
20
|
+
|
|
21
|
+
channel: IMailbox;
|
|
22
|
+
|
|
23
|
+
mails = [] as IEmail[];
|
|
24
|
+
|
|
25
|
+
constructor(app, e = document.createElement("section")) {
|
|
26
|
+
super(app, e);
|
|
27
|
+
this.runAfterInit(() => this.app.runAsync(() => this.init()));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async init() {
|
|
31
|
+
|
|
32
|
+
const { channelID, emailAddress } = (window as any).socialMail ?? {};
|
|
33
|
+
|
|
34
|
+
this.element.setAttribute("data-blog-list", "blog-list");
|
|
35
|
+
|
|
36
|
+
this.channel = await this.blogService.getChannel(emailAddress, channelID);
|
|
37
|
+
|
|
38
|
+
this.renderer = <div data-layout="flex-center">
|
|
39
|
+
<span text="..."/>
|
|
40
|
+
</div>;
|
|
41
|
+
|
|
42
|
+
this.element.className = channelViewStyle;
|
|
43
|
+
this.renderer = <section>
|
|
44
|
+
<header>
|
|
45
|
+
<div>
|
|
46
|
+
<span text={this.channel.emailAddress.name}/>
|
|
47
|
+
<a href={`mailto:subscribe-${this.channel.emailAddress.emailAddress}?subject=subscribe`}><button>Follow</button></a>
|
|
48
|
+
</div>
|
|
49
|
+
<div>
|
|
50
|
+
<input
|
|
51
|
+
placeholder="Search..."
|
|
52
|
+
value={Bind.twoWaysImmediate(() => this.search)}/>
|
|
53
|
+
</div>
|
|
54
|
+
</header>
|
|
55
|
+
<section>
|
|
56
|
+
<AtomRepeater
|
|
57
|
+
items={this.mails}
|
|
58
|
+
data-auto-scroll="false"
|
|
59
|
+
{ ... InfiniteRepeater.pagedItems((start) =>
|
|
60
|
+
(c, e, cancelToken) =>
|
|
61
|
+
this.blogService.getEmails({
|
|
62
|
+
channelID: this.channel.mailboxID,
|
|
63
|
+
start,
|
|
64
|
+
search: this.search,
|
|
65
|
+
cancelToken
|
|
66
|
+
})
|
|
67
|
+
)}
|
|
68
|
+
itemRenderer={(email: IEmail) => {
|
|
69
|
+
return <section data-element="blog-item">
|
|
70
|
+
<h4 data-element="title">
|
|
71
|
+
<a href={`/channels/${this.channel.mailboxID}/${email.emailID}/${email.subject?.trim() ?? ""}`} text={email.subject}></a>
|
|
72
|
+
</h4>
|
|
73
|
+
<h6 data-element="date" text={DateFormats.relative.short(email.dateSent)}/>
|
|
74
|
+
<h6 text={email.senderName}/>
|
|
75
|
+
<section
|
|
76
|
+
data-element="content">
|
|
77
|
+
<LimitedText height={200}>
|
|
78
|
+
<section { ... renderMail({ email })}/>
|
|
79
|
+
</LimitedText>
|
|
80
|
+
</section>
|
|
81
|
+
</section>;
|
|
82
|
+
}}
|
|
83
|
+
/>
|
|
84
|
+
</section>
|
|
85
|
+
<aside>
|
|
86
|
+
<AtomRepeater
|
|
87
|
+
/>
|
|
88
|
+
</aside>
|
|
89
|
+
<footer></footer>
|
|
90
|
+
</section>;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
}
|
|
@@ -1,19 +1,6 @@
|
|
|
1
|
-
import { AtomControl } from "@web-atoms/core/dist/web/controls/AtomControl";
|
|
2
1
|
import "../../style/GlobalStyle";
|
|
3
|
-
import InjectProperty from "@web-atoms/core/dist/core/InjectProperty";
|
|
4
|
-
import EntityService from "../../services/EntityService";
|
|
5
|
-
import XNode from "@web-atoms/core/dist/core/XNode";
|
|
6
|
-
import { channelViewStyle } from "./channelViewStyle";
|
|
7
|
-
import Bind from "@web-atoms/core/dist/core/Bind";
|
|
8
|
-
import AtomRepeater from "@web-atoms/web-controls/dist/basic/AtomRepeater";
|
|
9
|
-
import { IEmail, IMailbox } from "../../model/model";
|
|
10
|
-
import InfiniteRepeater from "../../common/controls/repeater/InfiniteRepeater";
|
|
11
|
-
import BlogService from "./BlogService";
|
|
12
2
|
import Pack from "@web-atoms/core/dist/Pack";
|
|
13
|
-
import { renderMail } from "../../web/page/mails/service/ConversationService";
|
|
14
|
-
import { DateFormats } from "../../common/date/DateFormats";
|
|
15
3
|
import styled from "@web-atoms/core/dist/style/styled";
|
|
16
|
-
import LimitedText from "@web-atoms/web-controls/dist/basic/LimitedText";
|
|
17
4
|
|
|
18
5
|
styled.css `
|
|
19
6
|
|
|
@@ -40,6 +27,14 @@ import LimitedText from "@web-atoms/web-controls/dist/basic/LimitedText";
|
|
|
40
27
|
margin-block-start: 0;
|
|
41
28
|
margin-block-end: 0;
|
|
42
29
|
padding: 10px;
|
|
30
|
+
& > a {
|
|
31
|
+
text-decoration: none;
|
|
32
|
+
color: white;
|
|
33
|
+
&:hover {
|
|
34
|
+
text-decoration: underline;
|
|
35
|
+
color: #73ff73;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
43
38
|
}
|
|
44
39
|
|
|
45
40
|
& > h6 {
|
|
@@ -62,75 +57,14 @@ import LimitedText from "@web-atoms/web-controls/dist/basic/LimitedText";
|
|
|
62
57
|
|
|
63
58
|
`.installGlobal("[data-blog-list=blog-list]");
|
|
64
59
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
search = "";
|
|
72
|
-
|
|
73
|
-
channel: IMailbox;
|
|
74
|
-
|
|
75
|
-
mails = [] as IEmail[];
|
|
76
|
-
|
|
77
|
-
constructor(app, e = document.createElement("section")) {
|
|
78
|
-
super(app, e);
|
|
79
|
-
this.runAfterInit(() => this.app.runAsync(() => this.init()));
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
async init() {
|
|
60
|
+
const url = new URL(location.href);
|
|
61
|
+
(window as any).pageUrl = url;
|
|
62
|
+
const { default: view } = await (/\/channels\//.test(url.pathname)
|
|
63
|
+
? import("./ChannelMessage")
|
|
64
|
+
: import("./ChannelMessageList")) as any;
|
|
83
65
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
this.element.setAttribute("data-blog-list", "blog-list");
|
|
87
|
-
|
|
88
|
-
this.channel = await this.blogService.getChannel(emailAddress, channelID);
|
|
89
|
-
|
|
90
|
-
this.renderer = <div data-layout="flex-center">
|
|
91
|
-
<span text="..."/>
|
|
92
|
-
</div>;
|
|
93
|
-
|
|
94
|
-
this.element.className = channelViewStyle;
|
|
95
|
-
this.renderer = <section>
|
|
96
|
-
<header>
|
|
97
|
-
<input
|
|
98
|
-
placeholder="Search..."
|
|
99
|
-
value={Bind.twoWaysImmediate(() => this.search)}/>
|
|
100
|
-
</header>
|
|
101
|
-
<section>
|
|
102
|
-
<AtomRepeater
|
|
103
|
-
items={this.mails}
|
|
104
|
-
{ ... InfiniteRepeater.pagedItems((start) =>
|
|
105
|
-
(c, e, cancelToken) =>
|
|
106
|
-
this.blogService.getEmails({
|
|
107
|
-
channelID: this.channel.mailboxID,
|
|
108
|
-
start,
|
|
109
|
-
search: this.search,
|
|
110
|
-
cancelToken
|
|
111
|
-
})
|
|
112
|
-
)}
|
|
113
|
-
itemRenderer={(email: IEmail) => {
|
|
114
|
-
return <section data-element="blog-item">
|
|
115
|
-
<h4 data-element="title" text={email.subject}/>
|
|
116
|
-
<h6 data-element="date" text={DateFormats.relative.short(email.dateSent)}/>
|
|
117
|
-
<h6 text={email.senderName}/>
|
|
118
|
-
<section
|
|
119
|
-
data-element="content">
|
|
120
|
-
<LimitedText height={200}>
|
|
121
|
-
<section { ... renderMail({ email })}/>
|
|
122
|
-
</LimitedText>
|
|
123
|
-
</section>
|
|
124
|
-
</section>;
|
|
125
|
-
}}
|
|
126
|
-
/>
|
|
127
|
-
</section>
|
|
128
|
-
<aside>
|
|
129
|
-
<AtomRepeater
|
|
130
|
-
/>
|
|
131
|
-
</aside>
|
|
132
|
-
<footer></footer>
|
|
133
|
-
</section>;
|
|
134
|
-
}
|
|
66
|
+
@Pack
|
|
67
|
+
export default class Empty extends view {
|
|
135
68
|
|
|
136
69
|
}
|
|
70
|
+
|
|
@@ -45,6 +45,24 @@ export const stylerVars = prepareVariables({
|
|
|
45
45
|
sizeLarger: "15px",
|
|
46
46
|
sizeLarge: "20px",
|
|
47
47
|
|
|
48
|
+
sizeMobileWidth: "350px",
|
|
49
|
+
sizeTabletWidth: "1024px",
|
|
50
|
+
|
|
51
|
+
size10Pc: "10%",
|
|
52
|
+
size20Pc: "20%",
|
|
53
|
+
size25Pc: "25%",
|
|
54
|
+
size30Pc: "30%",
|
|
55
|
+
size33Pc: "33.3%",
|
|
56
|
+
size40Pc: "40%",
|
|
57
|
+
size50Pc: "50%",
|
|
58
|
+
size60Pc: "60%",
|
|
59
|
+
size66Pc: "66.6%",
|
|
60
|
+
size70Pc: "70%",
|
|
61
|
+
size75Pc: "75%",
|
|
62
|
+
size80Pc: "80%",
|
|
63
|
+
size90Pc: "90%",
|
|
64
|
+
size100Pc: "100%",
|
|
65
|
+
|
|
48
66
|
rem1: "1rem",
|
|
49
67
|
rem2: "2rem",
|
|
50
68
|
rem3: "3rem",
|
|
@@ -154,6 +172,20 @@ export const sizeVarList = [
|
|
|
154
172
|
stylerVars.sizeDefault,
|
|
155
173
|
stylerVars.sizeLarger,
|
|
156
174
|
stylerVars.sizeLarge,
|
|
175
|
+
stylerVars.size10Pc,
|
|
176
|
+
stylerVars.size20Pc,
|
|
177
|
+
stylerVars.size25Pc,
|
|
178
|
+
stylerVars.size30Pc,
|
|
179
|
+
stylerVars.size33Pc,
|
|
180
|
+
stylerVars.size40Pc,
|
|
181
|
+
stylerVars.size50Pc,
|
|
182
|
+
stylerVars.size60Pc,
|
|
183
|
+
stylerVars.size66Pc,
|
|
184
|
+
stylerVars.size70Pc,
|
|
185
|
+
stylerVars.size75Pc,
|
|
186
|
+
stylerVars.size80Pc,
|
|
187
|
+
stylerVars.size90Pc,
|
|
188
|
+
stylerVars.size100Pc,
|
|
157
189
|
stylerVars.relSizeXS,
|
|
158
190
|
stylerVars.relSizeSmall,
|
|
159
191
|
stylerVars.relSizeMedium,
|