artalk 2.4.4 → 2.5.1
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/README.md +27 -0
- package/dist/Artalk.css +1 -1
- package/dist/Artalk.es.js +7066 -6256
- package/dist/Artalk.iife.js +1 -1
- package/dist/Artalk.js +1 -1
- package/dist/ArtalkLite.css +1 -1
- package/dist/ArtalkLite.es.js +5095 -4396
- package/dist/ArtalkLite.iife.js +1 -1
- package/dist/ArtalkLite.js +1 -1
- package/dist/i18n/jp.js +1 -1
- package/dist/i18n/zh-TW.js +1 -1
- package/dist/src/api/index.d.ts +2 -2
- package/dist/src/api/system.d.ts +5 -2
- package/dist/src/artalk.d.ts +42 -34
- package/dist/src/comment/comment.d.ts +2 -2
- package/dist/src/comment/height-limit.d.ts +30 -0
- package/dist/src/comment/render-ctx.d.ts +23 -0
- package/dist/src/comment/render.d.ts +2 -50
- package/dist/src/comment/renders/actions.d.ts +5 -0
- package/dist/src/comment/renders/avatar.d.ts +5 -0
- package/dist/src/comment/renders/content.d.ts +5 -0
- package/dist/src/comment/renders/header.d.ts +5 -0
- package/dist/src/comment/renders/index.d.ts +2 -0
- package/dist/src/comment/renders/pending.d.ts +5 -0
- package/dist/src/comment/renders/reply-at.d.ts +5 -0
- package/dist/src/comment/renders/reply-to.d.ts +5 -0
- package/dist/src/components/dialog.d.ts +1 -1
- package/dist/src/config.d.ts +8 -0
- package/dist/src/context.d.ts +16 -29
- package/dist/src/editor/edit-mode.d.ts +9 -0
- package/dist/src/editor/editor.d.ts +37 -45
- package/dist/src/editor/funcs.d.ts +2 -0
- package/dist/src/editor/mover.d.ts +8 -0
- package/dist/src/editor/plug-manager.d.ts +17 -0
- package/dist/src/editor/plugs/editor-plug.d.ts +13 -1
- package/dist/src/editor/reply.d.ts +9 -0
- package/dist/src/editor/submit.d.ts +16 -0
- package/dist/src/editor/ui.d.ts +25 -0
- package/dist/src/i18n/external.d.ts +70 -0
- package/dist/src/i18n/index.d.ts +11 -75
- package/dist/src/layer/index.d.ts +2 -2
- package/dist/src/layer/layer.d.ts +1 -1
- package/dist/src/lib/checker/captcha-renders.d.ts +5 -0
- package/dist/src/lib/checker/index.d.ts +16 -10
- package/dist/src/lib/dark-mode.d.ts +4 -0
- package/dist/src/lib/marked.d.ts +9 -0
- package/dist/src/lib/user.d.ts +6 -3
- package/dist/src/lib/utils.d.ts +1 -5
- package/dist/src/list/list-lite.d.ts +15 -11
- package/dist/src/list/list-nest.d.ts +2 -2
- package/dist/src/list/list-ui.d.ts +16 -0
- package/dist/src/list/list.d.ts +0 -1
- package/dist/src/list/paginator/adaptors/index.d.ts +12 -0
- package/dist/src/list/paginator/adaptors/pagination.d.ts +9 -0
- package/dist/src/list/paginator/adaptors/read-more.d.ts +10 -0
- package/dist/src/list/paginator/holder.d.ts +16 -0
- package/dist/src/list/paginator/index.d.ts +10 -0
- package/dist/src/service.d.ts +46 -0
- package/dist/types/artalk-config.d.ts +5 -2
- package/dist/types/artalk-data.d.ts +3 -3
- package/dist/types/context.d.ts +13 -20
- package/dist/types/global.d.ts +1 -0
- package/package.json +6 -7
- package/src/api/comment.ts +7 -7
- package/src/api/page.ts +0 -2
- package/src/api/request.ts +6 -4
- package/src/api/system.ts +3 -12
- package/src/api/upload.ts +3 -4
- package/src/api/user.ts +6 -8
- package/src/artalk.ts +103 -158
- package/src/comment/comment.ts +7 -6
- package/src/comment/height-limit.ts +100 -0
- package/src/comment/render-ctx.ts +30 -0
- package/src/comment/render.ts +31 -375
- package/src/comment/renders/actions.ts +114 -0
- package/src/comment/renders/avatar.ts +22 -0
- package/src/comment/renders/content.ts +39 -0
- package/src/comment/renders/header.ts +84 -0
- package/src/comment/renders/index.ts +19 -0
- package/src/comment/renders/pending.ts +12 -0
- package/src/comment/renders/reply-at.ts +16 -0
- package/src/comment/renders/reply-to.ts +24 -0
- package/src/config.ts +65 -0
- package/src/context.ts +33 -86
- package/src/defaults.ts +1 -0
- package/src/editor/edit-mode.ts +103 -0
- package/src/editor/editor.ts +101 -395
- package/src/editor/funcs.ts +97 -0
- package/src/editor/mover.ts +43 -0
- package/src/editor/plug-manager.ts +172 -0
- package/src/editor/plugs/editor-plug.ts +20 -2
- package/src/editor/plugs/{emoticons-plug.less → emoticons-plug.scss} +5 -4
- package/src/editor/plugs/emoticons-plug.ts +2 -1
- package/src/editor/plugs/header-input-plug.ts +11 -10
- package/src/editor/plugs/{preview-plug.less → preview-plug.scss} +1 -1
- package/src/editor/plugs/preview-plug.ts +8 -4
- package/src/editor/plugs/upload-plug.ts +12 -14
- package/src/editor/reply.ts +62 -0
- package/src/editor/submit.ts +99 -0
- package/src/editor/ui.ts +36 -0
- package/src/i18n/external.ts +10 -0
- package/src/i18n/index.ts +22 -19
- package/src/i18n/jp.ts +1 -1
- package/src/i18n/zh-TW.ts +1 -1
- package/src/layer/index.ts +2 -2
- package/src/layer/layer.ts +4 -4
- package/src/layer/sidebar-layer.ts +4 -2
- package/src/lib/checker/admin.ts +37 -0
- package/src/lib/checker/captcha-renders.ts +68 -0
- package/src/lib/checker/captcha.ts +26 -0
- package/src/lib/checker/index.ts +36 -20
- package/src/lib/dark-mode.ts +48 -0
- package/src/lib/marked.ts +133 -0
- package/src/lib/user.ts +13 -7
- package/src/lib/utils.ts +1 -123
- package/src/list/list-lite.ts +59 -162
- package/src/list/list-ui.ts +137 -0
- package/src/list/list.ts +33 -60
- package/src/list/paginator/adaptors/index.ts +21 -0
- package/src/list/paginator/adaptors/pagination.ts +42 -0
- package/src/list/paginator/adaptors/read-more.ts +56 -0
- package/src/list/paginator/holder.ts +56 -0
- package/src/list/paginator/index.ts +13 -0
- package/src/service.ts +118 -0
- package/src/style/{_color.less → _color.scss} +3 -3
- package/src/style/{_extend.less → _extend.scss} +1 -1
- package/src/style/_variables.scss +3 -0
- package/src/style/{comment.less → comment.scss} +36 -12
- package/src/style/{editor.less → editor.scss} +11 -11
- package/src/style/{list.less → list.scss} +12 -10
- package/src/style/{main.less → main.scss} +24 -23
- package/src/style/{sidebar-layer.less → sidebar-layer.scss} +8 -8
- package/types/artalk-config.d.ts +5 -2
- package/types/artalk-data.d.ts +3 -3
- package/types/context.d.ts +13 -20
- package/types/global.d.ts +1 -0
- package/CNAME +0 -1
- package/LICENSE +0 -165
- package/index.html +0 -157
- package/postcss.config.js +0 -5
- package/scripts/build-i18n.mjs +0 -46
- package/src/lib/checker/admin-checker.ts +0 -36
- package/src/lib/checker/captcha-checker.ts +0 -84
- package/src/style/_variables.less +0 -3
- package/test/ArtalkCount.html +0 -16
- package/test/ArtalkI18n.html +0 -16
- package/test/ArtalkLite.html +0 -15
- package/test/CSRF.html +0 -26
- package/tsconfig.json +0 -12
- package/vite-base.config.ts +0 -21
- package/vite-demo.config.ts +0 -12
- package/vite-lite.config.ts +0 -22
- package/vite.config.ts +0 -27
- /package/dist/src/lib/checker/{admin-checker.d.ts → admin.d.ts} +0 -0
- /package/dist/src/lib/checker/{captcha-checker.d.ts → captcha.d.ts} +0 -0
- /package/src/style/{pagination.less → pagination.scss} +0 -0
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
img {
|
|
52
52
|
width: 50px;
|
|
53
53
|
height: 50px;
|
|
54
|
-
border-radius: (
|
|
54
|
+
border-radius: calc($block-radius / 2);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
margin-left: 63px;
|
|
61
61
|
|
|
62
62
|
& > .atk-header {
|
|
63
|
-
line-height: 1;
|
|
63
|
+
line-height: 1.5;
|
|
64
64
|
font-size: 13px;
|
|
65
65
|
margin-bottom: .5em;
|
|
66
66
|
overflow: hidden;
|
|
@@ -108,13 +108,13 @@
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
.badge
|
|
111
|
+
.badge {
|
|
112
112
|
display: inline-block;
|
|
113
113
|
color: var(--at-color-meta);
|
|
114
114
|
background: var(--at-color-bg-grey);
|
|
115
115
|
padding: 0px 6px;
|
|
116
116
|
line-height: 17px;
|
|
117
|
-
border-radius: (
|
|
117
|
+
border-radius: calc($block-radius / 2);
|
|
118
118
|
|
|
119
119
|
&:not(:last-child) {
|
|
120
120
|
margin-right: 6px;
|
|
@@ -126,24 +126,27 @@
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
.atk-badge {
|
|
129
|
-
.badge
|
|
129
|
+
@extend .badge;
|
|
130
130
|
color: #fff;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
+
.atk-region-badge {
|
|
134
|
+
@extend .badge;
|
|
135
|
+
}
|
|
136
|
+
|
|
133
137
|
.atk-pinned-badge {
|
|
134
|
-
.badge
|
|
138
|
+
@extend .badge;
|
|
135
139
|
color: #fff;
|
|
136
140
|
background: #f44336;
|
|
137
141
|
}
|
|
138
142
|
|
|
139
143
|
.atk-ua {
|
|
140
|
-
.badge
|
|
144
|
+
@extend .badge;
|
|
141
145
|
}
|
|
142
146
|
|
|
143
147
|
.atk-ua-wrap {
|
|
144
148
|
@media only screen and (max-width: 768px) {
|
|
145
149
|
display: block;
|
|
146
|
-
margin-top: 5px;
|
|
147
150
|
}
|
|
148
151
|
}
|
|
149
152
|
}
|
|
@@ -164,7 +167,7 @@
|
|
|
164
167
|
border: 3px solid var(--at-color-bg-grey);
|
|
165
168
|
border-bottom: 0;
|
|
166
169
|
padding: 5px 10px;
|
|
167
|
-
border-radius:
|
|
170
|
+
border-radius: $block-radius $block-radius 0 0;
|
|
168
171
|
margin-bottom: -5px;
|
|
169
172
|
}
|
|
170
173
|
|
|
@@ -193,7 +196,7 @@
|
|
|
193
196
|
|
|
194
197
|
& > .atk-reply-to {
|
|
195
198
|
padding: 5px 15px;
|
|
196
|
-
border-left: 3px solid
|
|
199
|
+
border-left: 3px solid var(--at-color-border);
|
|
197
200
|
margin-bottom: 10px;
|
|
198
201
|
position: relative;
|
|
199
202
|
margin-top: 10px;
|
|
@@ -217,7 +220,7 @@
|
|
|
217
220
|
padding: 10px 18px;
|
|
218
221
|
display: block;
|
|
219
222
|
background: var(--at-color-bg-grey);
|
|
220
|
-
border-radius:
|
|
223
|
+
border-radius: $block-radius;
|
|
221
224
|
|
|
222
225
|
.atk-text {
|
|
223
226
|
color: var(--at-color-meta);
|
|
@@ -291,7 +294,7 @@
|
|
|
291
294
|
transform: translateX(-50%);
|
|
292
295
|
cursor: pointer;
|
|
293
296
|
border: 1px solid var(--at-color-border);
|
|
294
|
-
border-radius:
|
|
297
|
+
border-radius: $block-radius;
|
|
295
298
|
background: var(--at-color-bg);
|
|
296
299
|
padding: 1px 20px;
|
|
297
300
|
font-size: 15px;
|
|
@@ -307,6 +310,27 @@
|
|
|
307
310
|
.atk-height-limit .atk-height-limit .atk-height-limit-btn {
|
|
308
311
|
display: none;
|
|
309
312
|
}
|
|
313
|
+
|
|
314
|
+
// 限高可滚动
|
|
315
|
+
.atk-height-limit-scroll {
|
|
316
|
+
// @extend .atk-slim-scrollbar;
|
|
317
|
+
margin-top: 10px;
|
|
318
|
+
overflow-y: auto;
|
|
319
|
+
$cBorder: var(--at-color-border);
|
|
320
|
+
$cOverwrite: var(--at-color-bg);
|
|
321
|
+
background:
|
|
322
|
+
/* Shadow covers */
|
|
323
|
+
linear-gradient($cOverwrite 1px, transparent 1px calc(100% - 1px)) center top,
|
|
324
|
+
linear-gradient(transparent calc(100% - 1px), $cOverwrite calc(100% - 1px) 1px) center bottom,
|
|
325
|
+
/* Shadows */
|
|
326
|
+
linear-gradient($cBorder 1px, transparent 1px calc(100% - 1px)) center top,
|
|
327
|
+
linear-gradient(transparent calc(100% - 1px), $cBorder calc(100% - 1px) 1px) center bottom;
|
|
328
|
+
background-repeat: no-repeat;
|
|
329
|
+
background-color: transparent;
|
|
330
|
+
background-size: 100% 1px, 100% 1px, 100% 1px, 100% 1px;
|
|
331
|
+
/* Opera doesn't support this in the shorthand */
|
|
332
|
+
background-attachment: local, local, scroll, scroll;
|
|
333
|
+
}
|
|
310
334
|
}
|
|
311
335
|
|
|
312
336
|
/** 子评论区域 **/
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
.atk-main-editor {
|
|
2
|
-
|
|
2
|
+
$editor-padding: 10px;
|
|
3
3
|
z-index: 5;
|
|
4
4
|
position: relative;
|
|
5
5
|
overflow: hidden;
|
|
6
6
|
background: var(--at-color-bg);
|
|
7
7
|
border: 1px solid var(--at-color-border);
|
|
8
|
-
border-radius:
|
|
8
|
+
border-radius: $block-radius;
|
|
9
9
|
margin-bottom: 10px;
|
|
10
10
|
|
|
11
11
|
@media only screen and (max-width: 768px) {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
font-size: 14px;
|
|
24
24
|
background: transparent;
|
|
25
25
|
border: 2px solid transparent;
|
|
26
|
-
border-radius: (
|
|
26
|
+
border-radius: calc($block-radius / 2);
|
|
27
27
|
padding: 6px 5px;
|
|
28
28
|
resize: none;
|
|
29
29
|
outline: none;
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
font-size: 15px;
|
|
45
45
|
background-color: var(--at-color-bg);
|
|
46
46
|
border: 2px solid transparent;
|
|
47
|
-
border-radius: (
|
|
47
|
+
border-radius: calc($block-radius / 2);
|
|
48
48
|
width: 100%;
|
|
49
49
|
min-height: 120px;
|
|
50
50
|
margin-top: 2px;
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
position: absolute;
|
|
71
71
|
right: 7px;
|
|
72
72
|
bottom: 2px;
|
|
73
|
-
max-width: (100% - 20px);
|
|
73
|
+
max-width: calc(100% - 20px);
|
|
74
74
|
height: 30px;
|
|
75
75
|
line-height: 30px;
|
|
76
76
|
font-size: 14px;
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
text-overflow: ellipsis;
|
|
81
81
|
white-space: nowrap;
|
|
82
82
|
cursor: pointer;
|
|
83
|
-
border-radius: (
|
|
83
|
+
border-radius: calc($block-radius / 2);
|
|
84
84
|
|
|
85
85
|
.atk-text {
|
|
86
86
|
}
|
|
@@ -129,9 +129,9 @@
|
|
|
129
129
|
line-height: 24px;
|
|
130
130
|
cursor: pointer;
|
|
131
131
|
color: var(--at-color-grey);
|
|
132
|
-
font-size:
|
|
132
|
+
font-size: $font-size;
|
|
133
133
|
user-select: none;
|
|
134
|
-
border-radius: (
|
|
134
|
+
border-radius: calc($block-radius / 2);
|
|
135
135
|
|
|
136
136
|
&:not(:last-child) {
|
|
137
137
|
margin-right: 2px;
|
|
@@ -163,15 +163,15 @@
|
|
|
163
163
|
.atk-send-btn {
|
|
164
164
|
background: var(--at-color-main);
|
|
165
165
|
color: #fff;
|
|
166
|
-
font-size:
|
|
166
|
+
font-size: $font-size;
|
|
167
167
|
border: none;
|
|
168
|
-
padding: 0 30px;
|
|
169
168
|
margin: 0;
|
|
170
169
|
height: 30px;
|
|
170
|
+
width: 8em;
|
|
171
171
|
cursor: pointer;
|
|
172
172
|
transition: opacity 0.3s ease-in-out;
|
|
173
173
|
outline: none;
|
|
174
|
-
border-radius: (
|
|
174
|
+
border-radius: calc($block-radius / 2);
|
|
175
175
|
|
|
176
176
|
&:active {
|
|
177
177
|
opacity: 0.9;
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
padding: 0.6rem 0;
|
|
47
47
|
border: 1px solid var(--at-color-border);
|
|
48
48
|
text-align: center;
|
|
49
|
-
border-radius:
|
|
49
|
+
border-radius: $block-radius;
|
|
50
50
|
white-space: nowrap;
|
|
51
51
|
margin: 0;
|
|
52
52
|
list-style: none;
|
|
@@ -159,11 +159,13 @@
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
.atk-list-no-comment {
|
|
162
|
-
text-align: center;
|
|
163
162
|
height: 150px;
|
|
164
|
-
|
|
165
|
-
display: block;
|
|
163
|
+
display: flex;
|
|
166
164
|
font-size: 19px;
|
|
165
|
+
justify-content: center;
|
|
166
|
+
align-items: center;
|
|
167
|
+
word-break: break-word;
|
|
168
|
+
text-align: center;
|
|
167
169
|
}
|
|
168
170
|
|
|
169
171
|
.atk-list-read-more {
|
|
@@ -175,12 +177,16 @@
|
|
|
175
177
|
padding-bottom: 10px;
|
|
176
178
|
}
|
|
177
179
|
|
|
180
|
+
&.atk-err .atk-text {
|
|
181
|
+
color: var(--at-color-red) !important;
|
|
182
|
+
}
|
|
183
|
+
|
|
178
184
|
.atk-list-read-more-inner {
|
|
179
185
|
cursor: pointer;
|
|
180
186
|
user-select: none;
|
|
181
187
|
padding: 0 15px;
|
|
182
|
-
font-size:
|
|
183
|
-
border-radius:
|
|
188
|
+
font-size: $font-size;
|
|
189
|
+
border-radius: $block-radius;
|
|
184
190
|
border: 1px solid transparent;
|
|
185
191
|
display: flex;
|
|
186
192
|
height: 30px;
|
|
@@ -193,10 +199,6 @@
|
|
|
193
199
|
background: var(--at-color-bg);
|
|
194
200
|
border-color: var(--at-color-border);
|
|
195
201
|
|
|
196
|
-
&.atk-err > .atk-text {
|
|
197
|
-
color: var(--at-color-red) !important;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
202
|
& > .atk-loading-icon {
|
|
201
203
|
height: 15px;
|
|
202
204
|
width: 15px;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
@import "./_color.
|
|
2
|
-
@import './comment.
|
|
3
|
-
@import './list.
|
|
4
|
-
@import './pagination.
|
|
5
|
-
@import './editor.
|
|
6
|
-
@import './sidebar-layer.
|
|
1
|
+
@import "./_color.scss";
|
|
2
|
+
@import './comment.scss';
|
|
3
|
+
@import './list.scss';
|
|
4
|
+
@import './pagination.scss';
|
|
5
|
+
@import './editor.scss';
|
|
6
|
+
@import './sidebar-layer.scss';
|
|
7
7
|
|
|
8
8
|
.artalk {
|
|
9
9
|
position: relative;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
.artalk, .atk-layer-wrap {
|
|
15
15
|
color: var(--at-color-font);
|
|
16
16
|
word-wrap: break-word;
|
|
17
|
-
word-break: break-
|
|
17
|
+
word-break: break-word;
|
|
18
18
|
|
|
19
19
|
* {
|
|
20
20
|
box-sizing: border-box;
|
|
@@ -26,17 +26,18 @@
|
|
|
26
26
|
font-size: inherit;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
$codeFont: source code pro, Consolas, Monaco, Menlo, sans-serif;
|
|
30
30
|
|
|
31
31
|
code {
|
|
32
|
-
font-family:
|
|
33
|
-
margin: 0 .
|
|
34
|
-
padding: 0 .
|
|
32
|
+
font-family: $codeFont;
|
|
33
|
+
margin: 0 .05em;
|
|
34
|
+
padding: 0 .4em;
|
|
35
35
|
display: inline-block;
|
|
36
|
+
vertical-align: middle;
|
|
36
37
|
font-size: .9em;
|
|
37
38
|
background-color: var(--at-color-bg-grey);
|
|
38
39
|
color: var(--at-color-font);
|
|
39
|
-
border-radius:
|
|
40
|
+
border-radius: 2px;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
pre {
|
|
@@ -46,8 +47,8 @@
|
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
pre code {
|
|
49
|
-
* { font-family:
|
|
50
|
-
line-height:
|
|
50
|
+
* { font-family: $codeFont; }
|
|
51
|
+
line-height: $line-height;
|
|
51
52
|
display: block;
|
|
52
53
|
padding: 10px 15px;
|
|
53
54
|
white-space: pre-wrap;
|
|
@@ -142,8 +143,8 @@
|
|
|
142
143
|
|
|
143
144
|
/* Loading */
|
|
144
145
|
.atk-loading {
|
|
146
|
+
@extend .atk-full-layer;
|
|
145
147
|
z-index: 11;
|
|
146
|
-
&:extend(.atk-full-layer);
|
|
147
148
|
}
|
|
148
149
|
|
|
149
150
|
.atk-loading-spinner {
|
|
@@ -278,7 +279,7 @@ i.atk-icon {
|
|
|
278
279
|
|
|
279
280
|
/* Layer */
|
|
280
281
|
.atk-error-layer {
|
|
281
|
-
|
|
282
|
+
@extend .atk-full-layer;
|
|
282
283
|
background-color: var(--at-color-bg-transl);
|
|
283
284
|
|
|
284
285
|
.atk-error-title {
|
|
@@ -312,8 +313,8 @@ i.atk-icon {
|
|
|
312
313
|
}
|
|
313
314
|
|
|
314
315
|
.atk-layer-dialog-wrap {
|
|
315
|
-
|
|
316
|
-
|
|
316
|
+
$formInputHeight: 30px;
|
|
317
|
+
@extend .atk-full-layer;
|
|
317
318
|
background-color: var(--at-color-bg-transl);
|
|
318
319
|
|
|
319
320
|
& > .atk-layer-dialog {
|
|
@@ -332,10 +333,10 @@ i.atk-icon {
|
|
|
332
333
|
|
|
333
334
|
input {
|
|
334
335
|
width: 100%;
|
|
335
|
-
line-height: (
|
|
336
|
+
line-height: calc($formInputHeight + 4px);
|
|
336
337
|
background-color: var(--at-color-bg);
|
|
337
338
|
border: 1px solid var(--at-color-border);
|
|
338
|
-
border-radius: (
|
|
339
|
+
border-radius: calc($block-radius / 2);
|
|
339
340
|
outline: none;
|
|
340
341
|
padding: 0 6px;
|
|
341
342
|
display: block;
|
|
@@ -356,9 +357,9 @@ i.atk-icon {
|
|
|
356
357
|
border: 1px solid var(--at-color-main);
|
|
357
358
|
background: transparent;
|
|
358
359
|
color: var(--at-color-main);
|
|
359
|
-
border-radius: (
|
|
360
|
+
border-radius: calc($block-radius / 2);
|
|
360
361
|
padding: 0 15px;
|
|
361
|
-
line-height:
|
|
362
|
+
line-height: $formInputHeight;
|
|
362
363
|
outline: none;
|
|
363
364
|
|
|
364
365
|
&:active {
|
|
@@ -426,7 +427,7 @@ i.atk-icon {
|
|
|
426
427
|
overflow: hidden;
|
|
427
428
|
background-color: #2c2c2c;
|
|
428
429
|
color: #FFF;
|
|
429
|
-
border-radius: (
|
|
430
|
+
border-radius: calc($block-radius / 2);
|
|
430
431
|
cursor: pointer;
|
|
431
432
|
font-size: 14px;
|
|
432
433
|
padding: 5px 15px;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
$header-height: 60px;
|
|
2
|
+
$nav-height: 40px;
|
|
3
3
|
|
|
4
4
|
.atk-sidebar-layer {
|
|
5
|
-
|
|
5
|
+
$width: 430px;
|
|
6
6
|
position: fixed;
|
|
7
7
|
z-index: 99999;
|
|
8
8
|
top: 0;
|
|
9
9
|
right: 0;
|
|
10
|
-
width:
|
|
10
|
+
width: $width;
|
|
11
11
|
height: 100%;
|
|
12
12
|
background: var(--at-color-bg);
|
|
13
13
|
transition: transform 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms;
|
|
14
|
-
transform: translate(
|
|
14
|
+
transform: translate($width, 0px);
|
|
15
15
|
|
|
16
|
-
@media only screen and (max-width:
|
|
16
|
+
@media only screen and (max-width: $width) {
|
|
17
17
|
& {
|
|
18
18
|
width: 100%;
|
|
19
19
|
}
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
.atk-sidebar-close {
|
|
38
38
|
display: flex;
|
|
39
39
|
flex-direction: column;
|
|
40
|
-
width:
|
|
41
|
-
height:
|
|
40
|
+
width: $header-height;
|
|
41
|
+
height: $header-height;
|
|
42
42
|
align-items: center;
|
|
43
43
|
place-content: center;
|
|
44
44
|
cursor: pointer;
|
package/types/artalk-config.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export default interface ArtalkConfig {
|
|
|
26
26
|
/** 发送按钮文字 */
|
|
27
27
|
sendBtn: string
|
|
28
28
|
|
|
29
|
-
/**
|
|
29
|
+
/** 评论框穿梭(显示在待回复评论后面) */
|
|
30
30
|
editorTravel: boolean
|
|
31
31
|
|
|
32
32
|
/** 表情包 */
|
|
@@ -60,6 +60,9 @@ export default interface ArtalkConfig {
|
|
|
60
60
|
|
|
61
61
|
/** 子评论区域限高 */
|
|
62
62
|
children: number
|
|
63
|
+
|
|
64
|
+
/** 滚动限高 */
|
|
65
|
+
scrollable: boolean
|
|
63
66
|
}
|
|
64
67
|
|
|
65
68
|
/** 评论投票按钮 */
|
|
@@ -77,7 +80,7 @@ export default interface ArtalkConfig {
|
|
|
77
80
|
/** PV 数绑定元素 Selector */
|
|
78
81
|
pvEl: string
|
|
79
82
|
|
|
80
|
-
/**
|
|
83
|
+
/** 夜间模式 */
|
|
81
84
|
darkMode: boolean|'auto'
|
|
82
85
|
|
|
83
86
|
/** 请求超时(单位:秒) */
|
package/types/artalk-data.d.ts
CHANGED
|
@@ -44,6 +44,9 @@ export interface CommentData {
|
|
|
44
44
|
/** 徽章颜色 */
|
|
45
45
|
badge_color?: string
|
|
46
46
|
|
|
47
|
+
/** IP 归属地 */
|
|
48
|
+
ip_region?: string
|
|
49
|
+
|
|
47
50
|
/** 是否允许回复 */
|
|
48
51
|
is_allow_reply?: boolean
|
|
49
52
|
|
|
@@ -221,7 +224,4 @@ export interface ApiVersionData {
|
|
|
221
224
|
|
|
222
225
|
/** API 程序 CommitHash */
|
|
223
226
|
commit_hash: string
|
|
224
|
-
|
|
225
|
-
/** API 程序要求前端最小版本 */
|
|
226
|
-
fe_min_version: string
|
|
227
227
|
}
|
package/types/context.d.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { marked as libMarked } from 'marked'
|
|
2
1
|
import ArtalkConfig from './artalk-config'
|
|
3
2
|
import { CommentData, NotifyData } from './artalk-data'
|
|
4
3
|
import { EventPayloadMap, Event, EventScopeType, Handler } from './event'
|
|
5
4
|
import { internal as internalLocales, I18n } from '../src/i18n'
|
|
6
5
|
import Api from '../src/api'
|
|
7
6
|
import User from '../src/lib/user'
|
|
8
|
-
import Editor from '../src/editor'
|
|
9
7
|
import Comment from '../src/comment'
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
8
|
+
import { SidebarShowPayload } from '../src/layer/sidebar-layer'
|
|
9
|
+
import { CheckerCaptchaPayload, CheckerPayload } from '../src/lib/checker'
|
|
10
|
+
import type { TMarked } from '../src/lib/marked'
|
|
11
|
+
import type { TInjectedServices } from '../src/service'
|
|
13
12
|
|
|
14
13
|
/**
|
|
15
14
|
* Context 接口
|
|
@@ -17,31 +16,25 @@ import CheckerLauncher, { CheckerCaptchaPayload, CheckerPayload } from '../src/l
|
|
|
17
16
|
* (面向接口的编程)
|
|
18
17
|
*/
|
|
19
18
|
export default interface ContextApi {
|
|
20
|
-
/** Context 唯一标识 */
|
|
21
|
-
cid: number
|
|
22
|
-
|
|
23
19
|
/** Artalk 根元素对象 */
|
|
24
20
|
$root: HTMLElement
|
|
25
21
|
|
|
22
|
+
/** 依赖注入函数 */
|
|
23
|
+
inject<K extends keyof TInjectedServices>(depName: K, obj: TInjectedServices[K]): void
|
|
24
|
+
|
|
25
|
+
/** 获取依赖对象 */
|
|
26
|
+
get<K extends keyof TInjectedServices>(depName: K): TInjectedServices[K]
|
|
27
|
+
|
|
26
28
|
/** 配置对象 */
|
|
29
|
+
// TODO 修改为 getConf() 和 setConf()
|
|
27
30
|
conf: ArtalkConfig
|
|
28
31
|
|
|
29
|
-
/** 用户对象 */
|
|
30
|
-
user: User
|
|
31
|
-
|
|
32
32
|
/** marked 依赖对象 */
|
|
33
|
-
|
|
33
|
+
getMarkedInstance(): TMarked | undefined
|
|
34
34
|
|
|
35
35
|
/** marked 内容替换器 */
|
|
36
36
|
markedReplacers: ((raw: string) => string)[]
|
|
37
37
|
|
|
38
|
-
/* 设置持有的同事类 (中介者模式) */
|
|
39
|
-
setApi(api: Api): void
|
|
40
|
-
setEditor(editor: Editor): void
|
|
41
|
-
setList(list?: ListLite): void
|
|
42
|
-
setSidebarLayer(list: SidebarLayer): void
|
|
43
|
-
setCheckerLauncher(checkerLauncher: CheckerLauncher): void
|
|
44
|
-
|
|
45
38
|
/** 获取 API 以供 HTTP 请求 */
|
|
46
39
|
getApi(): Api
|
|
47
40
|
|
|
@@ -141,7 +134,7 @@ export default interface ContextApi {
|
|
|
141
134
|
/** i18n 翻译 */
|
|
142
135
|
$t(key: keyof I18n, args?: {[key: string]: string}): string
|
|
143
136
|
|
|
144
|
-
/**
|
|
137
|
+
/** 设置夜间模式 */
|
|
145
138
|
setDarkMode(darkMode: boolean): void
|
|
146
139
|
|
|
147
140
|
/** 更新配置 */
|
package/types/global.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare const ARTALK_LITE: boolean
|
package/CNAME
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
artalk.js.org
|