@social-mail/social-mail-client 1.2.62 → 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.
Files changed (38) hide show
  1. package/dist/admin/AdminAppIndex.pack.js +16 -7
  2. package/dist/admin/AdminAppIndex.pack.js.map +1 -1
  3. package/dist/admin/AdminAppIndex.pack.min.js +2 -2
  4. package/dist/admin/AdminAppIndex.pack.min.js.map +1 -1
  5. package/dist/common/controls/repeater/InfiniteRepeater.d.ts.map +1 -1
  6. package/dist/common/controls/repeater/InfiniteRepeater.js +8 -5
  7. package/dist/common/controls/repeater/InfiniteRepeater.js.map +1 -1
  8. package/dist/public/channel/ChannelMessage.d.ts +7 -0
  9. package/dist/public/channel/ChannelMessage.d.ts.map +1 -0
  10. package/dist/public/channel/ChannelMessage.js +42 -0
  11. package/dist/public/channel/ChannelMessage.js.map +1 -0
  12. package/dist/public/channel/ChannelMessageList.d.ts +12 -0
  13. package/dist/public/channel/ChannelMessageList.d.ts.map +1 -0
  14. package/dist/public/channel/ChannelMessageList.js +103 -0
  15. package/dist/public/channel/ChannelMessageList.js.map +1 -0
  16. package/dist/public/channel/ChannelView.d.ts +3 -10
  17. package/dist/public/channel/ChannelView.d.ts.map +1 -1
  18. package/dist/public/channel/ChannelView.js +20 -87
  19. package/dist/public/channel/ChannelView.js.map +1 -1
  20. package/dist/public/channel/ChannelView.pack.js +6578 -6491
  21. package/dist/public/channel/ChannelView.pack.js.map +1 -1
  22. package/dist/public/channel/ChannelView.pack.min.js +193 -185
  23. package/dist/public/channel/ChannelView.pack.min.js.map +1 -1
  24. package/dist/site-editor/styler/Styler.d.ts +25 -1
  25. package/dist/site-editor/styler/Styler.d.ts.map +1 -1
  26. package/dist/site-editor/styler/Styler.js +8 -2
  27. package/dist/site-editor/styler/Styler.js.map +1 -1
  28. package/dist/tsconfig.tsbuildinfo +1 -1
  29. package/dist/web/AppIndex.pack.js +16 -7
  30. package/dist/web/AppIndex.pack.js.map +1 -1
  31. package/dist/web/AppIndex.pack.min.js +2 -2
  32. package/dist/web/AppIndex.pack.min.js.map +1 -1
  33. package/package.json +1 -1
  34. package/src/common/controls/repeater/InfiniteRepeater.tsx +8 -4
  35. package/src/public/channel/ChannelMessage.tsx +18 -0
  36. package/src/public/channel/ChannelMessageList.tsx +93 -0
  37. package/src/public/channel/ChannelView.tsx +16 -82
  38. package/src/site-editor/styler/Styler.ts +21 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@social-mail/social-mail-client",
3
- "version": "1.2.62",
3
+ "version": "1.2.63",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -63,10 +63,14 @@ const pagedItemsSetter = AtomControl.registerProperty("paged-items", "paged-item
63
63
  control.items = value.items;
64
64
  }
65
65
 
66
- setTimeout(() => {
67
- const ce = control.element?.firstElementChild as HTMLElement;
68
- ce?.scrollIntoView();
69
- }, 100);
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
- @Pack
66
- export default class ChannelView extends AtomControl {
67
-
68
- @InjectProperty
69
- blogService: BlogService;
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
- const { channelID, emailAddress } = (window as any).socialMail ?? {};
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
+
@@ -50,11 +50,17 @@ export const stylerVars = prepareVariables({
50
50
 
51
51
  size10Pc: "10%",
52
52
  size20Pc: "20%",
53
- size33Pc: "33.3%",
54
53
  size25Pc: "25%",
54
+ size30Pc: "30%",
55
+ size33Pc: "33.3%",
56
+ size40Pc: "40%",
55
57
  size50Pc: "50%",
58
+ size60Pc: "60%",
56
59
  size66Pc: "66.6%",
60
+ size70Pc: "70%",
57
61
  size75Pc: "75%",
62
+ size80Pc: "80%",
63
+ size90Pc: "90%",
58
64
  size100Pc: "100%",
59
65
 
60
66
  rem1: "1rem",
@@ -166,6 +172,20 @@ export const sizeVarList = [
166
172
  stylerVars.sizeDefault,
167
173
  stylerVars.sizeLarger,
168
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,
169
189
  stylerVars.relSizeXS,
170
190
  stylerVars.relSizeSmall,
171
191
  stylerVars.relSizeMedium,