@social-mail/social-mail-web-server 1.8.299 → 1.8.301

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@social-mail/social-mail-web-server",
3
- "version": "1.8.299",
3
+ "version": "1.8.301",
4
4
  "description": "## Phase 1",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -15,32 +15,41 @@ export const RegExpExtra = {
15
15
  replaceLinks(input: string, blog = "") {
16
16
  return RegExpExtra.replaceAll(
17
17
  input,
18
- /(([^@\s,;]{5,80}@)|([📅📆📆]:\s{0,5}\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{1,5}Z)|(#\p{L}[\p{L}\d\-_\/]{2,200}))/gui,
18
+ /((?<email>(?<emailPrefix>[^@\s,;]{5,80}@)(?<emailDomain>[^@\s,;]{2,100}))|(?<link>https?:\/\/[^\s]{2,1024})|(?<timeBlock>[📅📆📆]:(?<time>\s{0,5}\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{1,5}Z))|(?<tag>#\p{L}[\p{L}\d\-_\/]{2,200}))/gui,
19
19
  ({ text, match }) => {
20
20
  if (text) {
21
21
  return text;
22
22
  }
23
- const m = match[1];
24
- const date = match[3];
25
- if (date) {
26
- return `<time datetime="${date}">${m}</time>`;
23
+ const {
24
+ email,
25
+ emailPrefix,
26
+ emailDomain,
27
+ time,
28
+ timeBlock,
29
+ link,
30
+ tag
31
+ } = match.groups;
32
+ if (time) {
33
+ return `<time datetime="${time}">${timeBlock}</time>`;
27
34
  }
28
- // const empty = match[4];
29
- // if (empty !== null && empty !== void 0) {
30
- // return empty;
31
- // }
32
- const tag = match[4];
33
35
  if (tag) {
34
36
  if (blog) {
35
37
  return `<a href="/${blog}/tag/${tag.substring(1)}" hash-tag="${tag}">${tag}</a>`;
36
38
  }
37
39
  return `<a href="#${tag.substring(1)}" hash-tag="${tag}">${tag}</a>`;
38
40
  }
39
- if (!blog) {
40
- return text;
41
+ if (link) {
42
+ return `<a href="${link}">${link}</a>`;
41
43
  }
42
- const t = (m[0].padEnd(m.length, "*") + "@");
43
- return t;
44
+ if (email) {
45
+ if (blog) {
46
+ if(emailPrefix) {
47
+ return emailPrefix[0] + "@".padStart(emailPrefix.length - 1, "x") + emailDomain;
48
+ }
49
+ }
50
+ return `<a href="mailto:${email}">${email}</a>`;
51
+ }
52
+ return text;
44
53
  });
45
54
  },
46
55
 
@@ -17,7 +17,7 @@ export default async function seedUI(config: DBConfig) {
17
17
  await config.saveVersion(UIPackageConfig, {
18
18
  package: "@social-mail/social-mail-client",
19
19
  view: "dist/web/AppIndex",
20
- version: "1.9.8"
20
+ version: "1.9.10"
21
21
  });
22
22
 
23
23
  await config.saveVersion(WebComponentsPackageConfig, {