-
Notifications
You must be signed in to change notification settings - Fork 13
/
constants.ts
114 lines (110 loc) · 7.06 KB
/
constants.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
export const MarkdownTemplate = `\`\`\`embed
title: \"{{{title}}}\"
image: \"{{{image}}}\"
description: \"{{{description}}}\"
url: \"{{{url}}}\"
\`\`\``;
export const HTMLTemplate = `<div
style="
border: 1px solid var(--background-modifier-border);
overflow: hidden;
border-radius: var(--radius-s);
box-shadow: rgba(0, 0, 0, 0.06) 0px 1px 3px;
"
>
<div class="w __if _lc _sm _od _alsd _alcd _lh14 _xm _xi _ts _dm">
<div class="wf">
<div class="wc">
<div class="e" style="padding-bottom: 100%">
<div class="em">
<a
href="{{{url}}}"
target="_blank"
rel="noopener"
data-do-not-bind-click
class="c"
style="
background-image: url(\'{{{image}}}\');
"
></a>
</div>
</div>
</div>
<div class="wt">
<div class="t _f0 _ffsa _fsn _fwn">
<div class="th _f1p _fsn _fwb">
<a href="{{{url}}}" target="_blank" rel="noopener" class="thl"
>{{title}}</a
>
</div>
<div class="td">{{description}}</div>
<div class="tf _f1m">
<div class="tc">
<a href="{{{url}}}" target="_blank" rel="noopener" class="tw _f1m"
><span class="twt">{{{url}}}</span
><span class="twd">{{{url}}}</span></a
>
</div>
</div>
</div>
</div>
</div>
</div>
</div>`;
export const REGEX = {
URL: '(http|ftp|https):\\/\\/([\\w_-]+(?:(?:\\.[\\w_-]+)+))([\\w.,@?^=%&:\\/~+#-]*[\\w@?^=%&\\/~+#-])',
HTML: `<div
style="
border: 1px solid rgb\\(222, 222, 222\\);
box-shadow: rgba\\(0, 0, 0, 0\\.06\\) 0px 1px 3px;
"
>
<div class="w __if _lc _sm _od _alsd _alcd _lh14 _xm _xi _ts _dm">
<div class="wf">
<div class="wc">
<div class="e" style="padding-bottom: 100%">
<div class="em">
<a
href="(.+)"
target="_blank"
rel="noopener"
data-do-not-bind-click
class="c"
style="
background-image: url\\(\\'(.*)\\'\\);
"
><\\/a>
<\\/div>
<\\/div>
<\\/div>
<div class="wt">
<div class="t _f0 _ffsa _fsn _fwn">
<div class="th _f1p _fsn _fwb">
<a href="(.+)" target="_blank" rel="noopener" class="thl"
>(.*)<\\/a
>
<\\/div>
<div class="td">([\\S\\s]*?)<\\/div>
<div class="tf _f1m">
<div class="tc">
<a href="(.+)" target="_blank" rel="noopener" class="tw _f1m"
><span class="twt">(.+)<\\/span
><span class="twd">(.+)<\\/span><\\/a
>
<\\/div>
<\\/div>
<\\/div>
<\\/div>
<\\/div>
<\\/div>
<\\/div>`,
ERROR: '<div class="em">',
};
export const SPINNER =
'data:image/svg+xml;base64,PHN2ZyBjbGFzcz0ibGRzLW1pY3Jvc29mdCIgd2lkdGg9IjgwcHgiICBoZWlnaHQ9IjgwcHgiICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCI+PGcgdHJhbnNmb3JtPSJyb3RhdGUoMCkiPjxjaXJjbGUgY3g9IjgxLjczNDEzMzYxMTY0OTQxIiBjeT0iNzQuMzUwNDU3MTYwMzQ4ODIiIGZpbGw9IiNlMTViNjQiIHI9IjUiIHRyYW5zZm9ybT0icm90YXRlKDM0MC4wMDEgNDkuOTk5OSA1MCkiPgogIDxhbmltYXRlVHJhbnNmb3JtIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIgdHlwZT0icm90YXRlIiBjYWxjTW9kZT0ic3BsaW5lIiB2YWx1ZXM9IjAgNTAgNTA7MzYwIDUwID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