artalk 2.7.0 → 2.7.2

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 (175) hide show
  1. package/README.md +1 -1
  2. package/dist/Artalk.css +1 -1
  3. package/dist/Artalk.es.js +209 -188
  4. package/dist/Artalk.es.js.map +1 -0
  5. package/dist/Artalk.iife.js +2 -1
  6. package/dist/Artalk.iife.js.map +1 -0
  7. package/dist/Artalk.js +2 -1
  8. package/dist/Artalk.js.map +1 -0
  9. package/dist/ArtalkLite.css +1 -1
  10. package/dist/ArtalkLite.es.js +209 -188
  11. package/dist/ArtalkLite.es.js.map +1 -0
  12. package/dist/ArtalkLite.iife.js +2 -1
  13. package/dist/ArtalkLite.iife.js.map +1 -0
  14. package/dist/ArtalkLite.js +2 -1
  15. package/dist/ArtalkLite.js.map +1 -0
  16. package/dist/i18n/jp.js +1 -1
  17. package/dist/i18n/zh-TW.js +1 -1
  18. package/dist/src/api/_base.d.ts +7 -0
  19. package/dist/src/api/_options.d.ts +5 -0
  20. package/dist/src/artalk.d.ts +0 -2
  21. package/dist/src/components/checker/index.d.ts +2 -0
  22. package/dist/src/i18n/en.d.ts +4 -0
  23. package/dist/src/i18n/external.d.ts +4 -0
  24. package/dist/src/i18n/index.d.ts +12 -0
  25. package/dist/src/i18n/jp.d.ts +4 -0
  26. package/dist/src/i18n/zh-TW.d.ts +4 -0
  27. package/dist/src/lib/user.d.ts +8 -6
  28. package/dist/src/main.d.ts +3 -0
  29. package/dist/src/plugins/editor/_kit.d.ts +7 -1
  30. package/dist/src/service.d.ts +2 -8
  31. package/dist/types/event.d.ts +1 -1
  32. package/package.json +43 -17
  33. package/dist/src/components/dark-mode.d.ts +0 -2
  34. package/src/api/_base.ts +0 -18
  35. package/src/api/_options.ts +0 -25
  36. package/src/api/_request.ts +0 -104
  37. package/src/api/admin.ts +0 -18
  38. package/src/api/captcha.ts +0 -24
  39. package/src/api/comment.ts +0 -84
  40. package/src/api/index.ts +0 -29
  41. package/src/api/page.ts +0 -83
  42. package/src/api/site.ts +0 -51
  43. package/src/api/system.ts +0 -49
  44. package/src/api/upload.ts +0 -28
  45. package/src/api/user.ts +0 -132
  46. package/src/artalk.ts +0 -119
  47. package/src/comment/actions.ts +0 -83
  48. package/src/comment/comment.html +0 -18
  49. package/src/comment/comment.ts +0 -192
  50. package/src/comment/height-limit.ts +0 -100
  51. package/src/comment/index.ts +0 -3
  52. package/src/comment/render.ts +0 -150
  53. package/src/comment/renders/actions.ts +0 -114
  54. package/src/comment/renders/avatar.ts +0 -22
  55. package/src/comment/renders/content.ts +0 -39
  56. package/src/comment/renders/header.ts +0 -84
  57. package/src/comment/renders/index.ts +0 -19
  58. package/src/comment/renders/pending.ts +0 -12
  59. package/src/comment/renders/reply-at.ts +0 -16
  60. package/src/comment/renders/reply-to.ts +0 -24
  61. package/src/components/action-btn.ts +0 -170
  62. package/src/components/checker/admin.ts +0 -37
  63. package/src/components/checker/captcha-renders.ts +0 -69
  64. package/src/components/checker/captcha.ts +0 -26
  65. package/src/components/checker/index.ts +0 -192
  66. package/src/components/dark-mode.ts +0 -30
  67. package/src/components/dialog.ts +0 -62
  68. package/src/components/error-dialog.ts +0 -35
  69. package/src/components/pagination.ts +0 -153
  70. package/src/components/read-more-btn.ts +0 -92
  71. package/src/config.ts +0 -119
  72. package/src/context.ts +0 -146
  73. package/src/data.ts +0 -110
  74. package/src/defaults.ts +0 -61
  75. package/src/editor/editor.html +0 -18
  76. package/src/editor/editor.ts +0 -114
  77. package/src/editor/state.ts +0 -52
  78. package/src/editor/ui.ts +0 -36
  79. package/src/i18n/en.ts +0 -81
  80. package/src/i18n/external.ts +0 -10
  81. package/src/i18n/index.ts +0 -67
  82. package/src/i18n/jp.ts +0 -83
  83. package/src/i18n/zh-CN.ts +0 -85
  84. package/src/i18n/zh-TW.ts +0 -83
  85. package/src/layer/index.ts +0 -4
  86. package/src/layer/layer-manager.ts +0 -32
  87. package/src/layer/layer.ts +0 -39
  88. package/src/layer/scrollbar-helper.ts +0 -24
  89. package/src/layer/sidebar-layer.html +0 -8
  90. package/src/layer/sidebar-layer.ts +0 -155
  91. package/src/layer/wrap.ts +0 -77
  92. package/src/lib/component.ts +0 -12
  93. package/src/lib/detect.ts +0 -222
  94. package/src/lib/event-manager.ts +0 -47
  95. package/src/lib/highlight.ts +0 -5
  96. package/src/lib/marked-renderer.ts +0 -32
  97. package/src/lib/marked.ts +0 -72
  98. package/src/lib/sanitizer.ts +0 -57
  99. package/src/lib/ui.ts +0 -193
  100. package/src/lib/user.ts +0 -55
  101. package/src/lib/utils.ts +0 -236
  102. package/src/list/comment.ts +0 -20
  103. package/src/list/layout.ts +0 -120
  104. package/src/list/list.html +0 -20
  105. package/src/list/list.ts +0 -79
  106. package/src/list/nest.ts +0 -66
  107. package/src/list/page.ts +0 -97
  108. package/src/list/paginator/index.ts +0 -25
  109. package/src/list/paginator/read-more.ts +0 -67
  110. package/src/list/paginator/up-down.ts +0 -51
  111. package/src/main.ts +0 -5
  112. package/src/plugins/admin-only-elem.ts +0 -40
  113. package/src/plugins/conf-remoter.ts +0 -54
  114. package/src/plugins/dark-mode.ts +0 -12
  115. package/src/plugins/editor/_kit.ts +0 -57
  116. package/src/plugins/editor/_plug.ts +0 -60
  117. package/src/plugins/editor/_sample.ts +0 -8
  118. package/src/plugins/editor/closable.ts +0 -44
  119. package/src/plugins/editor/emoticons.scss +0 -72
  120. package/src/plugins/editor/emoticons.ts +0 -293
  121. package/src/plugins/editor/header-event.ts +0 -35
  122. package/src/plugins/editor/header-link.ts +0 -31
  123. package/src/plugins/editor/header-user.ts +0 -98
  124. package/src/plugins/editor/index.ts +0 -40
  125. package/src/plugins/editor/local-storage.ts +0 -36
  126. package/src/plugins/editor/mover.ts +0 -29
  127. package/src/plugins/editor/preview.scss +0 -7
  128. package/src/plugins/editor/preview.ts +0 -41
  129. package/src/plugins/editor/state-edit.ts +0 -116
  130. package/src/plugins/editor/state-reply.ts +0 -91
  131. package/src/plugins/editor/submit-add.ts +0 -33
  132. package/src/plugins/editor/submit-btn.ts +0 -25
  133. package/src/plugins/editor/submit.ts +0 -73
  134. package/src/plugins/editor/textarea.ts +0 -55
  135. package/src/plugins/editor/upload.ts +0 -145
  136. package/src/plugins/editor-kit.ts +0 -161
  137. package/src/plugins/index.ts +0 -16
  138. package/src/plugins/list/copyright.ts +0 -16
  139. package/src/plugins/list/count.ts +0 -31
  140. package/src/plugins/list/dropdown.ts +0 -95
  141. package/src/plugins/list/error-dialog.ts +0 -22
  142. package/src/plugins/list/fetch.ts +0 -64
  143. package/src/plugins/list/goto-first.ts +0 -23
  144. package/src/plugins/list/goto.ts +0 -72
  145. package/src/plugins/list/index.ts +0 -25
  146. package/src/plugins/list/loading.ts +0 -17
  147. package/src/plugins/list/no-comment.ts +0 -25
  148. package/src/plugins/list/reach-bottom.ts +0 -46
  149. package/src/plugins/list/sidebar-btn.ts +0 -39
  150. package/src/plugins/list/time-ticking.ts +0 -22
  151. package/src/plugins/list/unread-badge.ts +0 -26
  152. package/src/plugins/list/unread.ts +0 -38
  153. package/src/plugins/list/with-editor.ts +0 -59
  154. package/src/plugins/markdown.ts +0 -10
  155. package/src/plugins/stat.ts +0 -79
  156. package/src/plugins/version-check.ts +0 -37
  157. package/src/service.ts +0 -91
  158. package/src/style/_color.scss +0 -41
  159. package/src/style/_extend.scss +0 -20
  160. package/src/style/_variables.scss +0 -3
  161. package/src/style/comment.scss +0 -360
  162. package/src/style/editor.scss +0 -194
  163. package/src/style/list.scss +0 -212
  164. package/src/style/main.scss +0 -486
  165. package/src/style/pagination.scss +0 -58
  166. package/src/style/sidebar-layer.scss +0 -92
  167. package/types/config.ts +0 -153
  168. package/types/context.ts +0 -84
  169. package/types/data.ts +0 -271
  170. package/types/editor.ts +0 -95
  171. package/types/event.ts +0 -40
  172. package/types/global.d.ts +0 -1
  173. package/types/index.ts +0 -7
  174. package/types/plugin.ts +0 -3
  175. package/types/sidebar.ts +0 -3
@@ -1,360 +0,0 @@
1
- .atk-comment-wrap {
2
- overflow: hidden;
3
- position: relative;
4
- border-bottom: 1px solid transparent;
5
-
6
- &.atk-flash-once {
7
- animation: atkFlashOnce 1s ease-in-out 0s;
8
-
9
- @keyframes atkFlashOnce {
10
- from { background: rgba(0, 131, 255, 0.2); }
11
- to { background: transparent; }
12
- }
13
- }
14
-
15
- &.atk-unread:before {
16
- content: ' ';
17
- position: absolute;
18
- left: 0;
19
- top: 10%;
20
- width: 3px;
21
- height: 80%;
22
- background: var(--at-color-main);
23
- }
24
-
25
- &.atk-openable {
26
- cursor: pointer;
27
-
28
- &:hover {
29
- background: var(--at-color-bg-grey);
30
- }
31
-
32
- .atk-height-limit:after {
33
- background: transparent !important;
34
- }
35
- }
36
-
37
- &:last-child {
38
- border-bottom: none;
39
- }
40
- }
41
-
42
- .atk-comment {
43
- display: block;
44
- padding: 10px;
45
-
46
- & > .atk-avatar {
47
- display: block;
48
- padding: 2px 0;
49
- float: left;
50
-
51
- img {
52
- width: 50px;
53
- height: 50px;
54
- border-radius: calc($block-radius / 2);
55
- }
56
- }
57
-
58
- & > .atk-main {
59
- display: block;
60
- margin-left: 63px;
61
-
62
- & > .atk-header {
63
- line-height: 1.5;
64
- font-size: 13px;
65
- margin-bottom: .5em;
66
- overflow: hidden;
67
- position: relative;
68
- display: flex;
69
- flex-wrap: wrap;
70
- align-items: center;
71
-
72
- .atk-item {
73
- display: flex;
74
- align-items: center;
75
- margin-top: 2px;
76
- margin-bottom: 2px;
77
- color: var(--at-color-meta);
78
-
79
- &:not(:last-child) {
80
- margin-right: 6px;
81
- }
82
-
83
- &.atk-nick, &.atk-nick a {
84
- font-size: 14px;
85
- color: var(--at-color-main);
86
- text-decoration: none;
87
- }
88
-
89
- &.atk-reply-at {
90
- margin-left: 2px;
91
-
92
- & > .atk-arrow:before {
93
- content: '';
94
- vertical-align: middle;
95
- transform: rotate(90deg);
96
- border-bottom: 4px solid var(--at-color-grey);
97
- border-left: 3px solid transparent;
98
- border-right: 3px solid transparent;
99
- display: inline-block;
100
- margin-top: -1px;
101
- }
102
-
103
- & > .atk-nick {
104
- color: var(--at-color-main);
105
- cursor: pointer;
106
- margin-left: 6px;
107
- }
108
- }
109
- }
110
-
111
- .badge {
112
- display: inline-block;
113
- color: var(--at-color-meta);
114
- background: var(--at-color-bg-grey);
115
- padding: 0px 6px;
116
- line-height: 17px;
117
- border-radius: calc($block-radius / 2);
118
-
119
- &:not(:last-child) {
120
- margin-right: 6px;
121
- }
122
- }
123
-
124
- .atk-badge-wrap > *:last-child {
125
- margin-right: 6px;
126
- }
127
-
128
- .atk-badge {
129
- @extend .badge;
130
- color: #fff;
131
- }
132
-
133
- .atk-region-badge {
134
- @extend .badge;
135
- }
136
-
137
- .atk-pinned-badge {
138
- @extend .badge;
139
- color: #fff;
140
- background: #f44336;
141
- }
142
-
143
- .atk-ua {
144
- @extend .badge;
145
- }
146
-
147
- .atk-ua-wrap {
148
- @media only screen and (max-width: 768px) {
149
- display: block;
150
- }
151
- }
152
- }
153
-
154
- & > .atk-body {
155
- display: block;
156
- overflow: hidden;
157
- position: relative;
158
-
159
- img {
160
- max-width: 100%;
161
- }
162
-
163
- & > .atk-content {
164
- word-break: break-all;
165
-
166
- &.atk-type-collapsed {
167
- border: 3px solid var(--at-color-bg-grey);
168
- border-bottom: 0;
169
- padding: 5px 10px;
170
- border-radius: $block-radius $block-radius 0 0;
171
- margin-bottom: -5px;
172
- }
173
-
174
- & > *:first-child {
175
- margin-top: 0;
176
- }
177
-
178
- & > *:last-child {
179
- margin-bottom: 0;
180
- }
181
-
182
- .atk-height-limit-btn {
183
- bottom: 5px;
184
- }
185
- }
186
-
187
- & > .atk-pending {
188
- color: var(--at-color-meta);
189
- margin: 3px 0;
190
- font-size: 13px;
191
- padding: 10px 18px;
192
- display: block;
193
- background: var(--at-color-bg-grey);
194
- border-left: 4px solid #f44336;
195
- }
196
-
197
- & > .atk-reply-to {
198
- padding: 5px 15px;
199
- border-left: 3px solid var(--at-color-border);
200
- margin-bottom: 10px;
201
- position: relative;
202
- margin-top: 10px;
203
-
204
- .atk-meta {
205
- font-size: 15px;
206
-
207
- .atk-nick {
208
- color: var(--at-color-main)
209
- }
210
- }
211
-
212
- .atk-content {
213
- margin-top: 5px;
214
- }
215
- }
216
-
217
- & > .atk-collapsed {
218
- margin: 3px 0;
219
- font-size: 13px;
220
- padding: 10px 18px;
221
- display: block;
222
- background: var(--at-color-bg-grey);
223
- border-radius: $block-radius;
224
-
225
- .atk-text {
226
- color: var(--at-color-meta);
227
- }
228
-
229
- .atk-show-btn {
230
- color: var(--at-color-main);
231
- cursor: pointer;
232
- user-select: none;
233
- margin-left: 3px;
234
- &:hover {
235
- color: var(--at-color-main);
236
- }
237
- }
238
- }
239
- }
240
-
241
- & > .atk-footer {
242
- margin-top: 5px;
243
-
244
- .atk-actions {
245
- display: flex;
246
- flex-direction: row;
247
- align-items: center;
248
- flex-wrap: wrap;
249
-
250
- & > span {
251
- color: var(--at-color-meta);
252
- font-size: 13px;
253
- line-height: 25px;
254
- display: inline-flex;
255
- cursor: pointer;
256
- user-select: none;
257
-
258
- &.atk-error, &.atk-error:hover {
259
- color: var(--at-color-red);
260
- }
261
-
262
- &:not(:last-child):not(.atk-hide) {
263
- margin-right: 16px;
264
- }
265
-
266
- &:hover {
267
- color: var(--at-color-deep);
268
- }
269
- }
270
- }
271
- }
272
- }
273
-
274
- /** 内容限高 **/
275
- .atk-height-limit:after {
276
- position: absolute;
277
- z-index: 1;
278
- display: block;
279
- overflow: hidden;
280
- width: 100%;
281
- content: " ";
282
- bottom: 0;
283
- height: 80px;
284
- background: var(--at-color-gradient);
285
- }
286
-
287
- .atk-height-limit-btn {
288
- z-index: 2;
289
- position: absolute;
290
- left: 50%;
291
- bottom: 10px;
292
- transform: translateX(-50%);
293
- cursor: pointer;
294
- border: 1px solid var(--at-color-border);
295
- border-radius: $block-radius;
296
- background: var(--at-color-bg);
297
- padding: 1px 20px;
298
- font-size: 15px;
299
- color: var(--at-color-meta);
300
- user-select: none;
301
-
302
- &:hover {
303
- background: var(--at-color-bg-grey);
304
- }
305
- }
306
-
307
- // 避免重复显示按钮
308
- .atk-height-limit .atk-height-limit .atk-height-limit-btn {
309
- display: none;
310
- }
311
-
312
- // 限高可滚动
313
- .atk-height-limit-scroll {
314
- // @extend .atk-slim-scrollbar;
315
- margin-top: 10px;
316
- overflow-y: auto;
317
- $cBorder: var(--at-color-border);
318
- $cOverwrite: var(--at-color-bg);
319
- background:
320
- /* Shadow covers */
321
- linear-gradient($cOverwrite 1px, transparent 1px calc(100% - 1px)) center top,
322
- linear-gradient(transparent calc(100% - 1px), $cOverwrite calc(100% - 1px) 1px) center bottom,
323
- /* Shadows */
324
- linear-gradient($cBorder 1px, transparent 1px calc(100% - 1px)) center top,
325
- linear-gradient(transparent calc(100% - 1px), $cBorder calc(100% - 1px) 1px) center bottom;
326
- background-repeat: no-repeat;
327
- background-color: transparent;
328
- background-size: 100% 1px, 100% 1px, 100% 1px, 100% 1px;
329
- /* Opera doesn't support this in the shorthand */
330
- background-attachment: local, local, scroll, scroll;
331
- }
332
- }
333
-
334
- /** 子评论区域 **/
335
- .atk-comment-children {
336
- & > .atk-comment-wrap {
337
- margin-top: 10px;
338
- border-left: 1px dashed transparent;
339
- border-bottom-color: transparent;
340
- &:not(:last-child) {
341
- margin-bottom: 10px;
342
- }
343
-
344
- & > .atk-comment {
345
- padding: 0;
346
-
347
- & > .atk-avatar img {
348
- width: 36px;
349
- height: 36px;
350
- }
351
-
352
- & > .atk-main {
353
- margin-left: 47px;
354
-
355
- & > .atk-body > .atk-content {
356
- }
357
- }
358
- }
359
- }
360
- }
@@ -1,194 +0,0 @@
1
- .atk-main-editor {
2
- $editor-padding: 10px;
3
- position: relative;
4
- overflow: hidden;
5
- background: var(--at-color-bg);
6
- border: 1px solid var(--at-color-border);
7
- border-radius: $block-radius;
8
- margin-bottom: 10px;
9
-
10
- @media only screen and (max-width: 768px) {
11
- margin-bottom: 7px;
12
- }
13
-
14
- &.editor-traveling {
15
- margin-top: 5px;
16
- margin-bottom: 10px;
17
- }
18
-
19
- & > .atk-header {
20
- display: flex;
21
- flex-direction: row;
22
- padding: 10px 14px 0;
23
-
24
- input {
25
- flex: 1;
26
- width: 100%;
27
- font-size: 14px;
28
- background: transparent;
29
- border: 2px solid transparent;
30
- border-radius: calc($block-radius / 2);
31
- padding: 6px 5px;
32
- resize: none;
33
- outline: none;
34
-
35
- &:not(:last-child) {
36
- margin-right: 2px;
37
- }
38
- }
39
- }
40
-
41
- & > .atk-textarea-wrap {
42
- position: relative;
43
-
44
- & > .atk-textarea {
45
- display: block;
46
- overflow: hidden;
47
- color: var(--at-color-font);
48
- font-size: 15px;
49
- background-color: var(--at-color-bg);
50
- border: 2px solid transparent;
51
- border-radius: calc($block-radius / 2);
52
- width: 100%;
53
- min-height: 120px;
54
- margin-top: 2px;
55
- padding: 10px 20px;
56
- resize: none;
57
- word-wrap: break-word;
58
- outline: none;
59
- }
60
-
61
- & > .atk-comment-closed {
62
- pointer-events: none;
63
- color: var(--at-color-meta);
64
- font-size: 12px;
65
- background-color: var(--at-color-bg);
66
- border-top: 1px solid var(--at-color-border);
67
- padding: 5px 15px;
68
- margin-top: 10px;
69
- // background: repeating-linear-gradient(145deg, #f2f2f2, #f2f2f2 15px, #fff 0, #fff 30px);
70
- }
71
-
72
- & > .atk-send-reply {
73
- z-index: 2;
74
- position: absolute;
75
- right: 7px;
76
- bottom: 2px;
77
- max-width: calc(100% - 20px);
78
- height: 30px;
79
- line-height: 30px;
80
- font-size: 14px;
81
- background: var(--at-color-bg-grey-transl);
82
- padding: 0 30px 0 10px;
83
- overflow: hidden;
84
- text-overflow: ellipsis;
85
- white-space: nowrap;
86
- cursor: pointer;
87
- border-radius: calc($block-radius / 2);
88
-
89
- .atk-text {
90
- }
91
-
92
- .atk-cancel {
93
- position: absolute;
94
- right: 0;
95
- bottom: 0;
96
- height: 30px;
97
- text-align: center;
98
- width: 30px;
99
- line-height: 30px;
100
- font-weight: 700;
101
-
102
- &:hover {
103
- color: var(--at-color-deep);
104
- }
105
- }
106
- }
107
- }
108
-
109
- & > .atk-plug-panel-wrap {
110
- position: relative;
111
- height: 180px;
112
- width: 100%;
113
- overflow: hidden;
114
- border-top: 1px solid var(--at-color-border);
115
- animation: 0.3s both atkFadeIn;
116
- transition: 0.2s height ease-in-out;
117
- }
118
-
119
- & > .atk-bottom {
120
- display: flex;
121
- flex-direction: row;
122
- justify-content: space-between;
123
- padding: 5px 5px 5px 10px;
124
-
125
- & > .atk-item {
126
- display: flex;
127
- flex-direction: row;
128
- align-items: center;
129
- }
130
-
131
- .atk-plug-btn {
132
- padding: 0 8px;
133
- line-height: 24px;
134
- cursor: pointer;
135
- color: var(--at-color-grey);
136
- font-size: $font-size;
137
- user-select: none;
138
- border-radius: calc($block-radius / 2);
139
-
140
- &:not(:last-child) {
141
- margin-right: 2px;
142
- }
143
-
144
- &:hover {
145
- background: var(--at-color-bg-grey);
146
- }
147
-
148
- &.active {
149
- color: var(--at-color-main);
150
-
151
- svg.markdown path {
152
- fill: var(--at-color-main);
153
- }
154
- }
155
-
156
- i {
157
- color: var(--at-color-grey);
158
- display: inline-flex;
159
- vertical-align: sub;
160
- margin-left: 4px;
161
- svg.markdown path {
162
- fill: var(--at-color-grey);
163
- }
164
- }
165
- }
166
-
167
- .atk-send-btn {
168
- background: var(--at-color-main);
169
- color: #fff;
170
- font-size: $font-size;
171
- border: none;
172
- margin: 0;
173
- height: 30px;
174
- width: 8em;
175
- cursor: pointer;
176
- transition: opacity 0.3s ease-in-out;
177
- outline: none;
178
- border-radius: calc($block-radius / 2);
179
-
180
- &:active {
181
- opacity: 0.9;
182
- }
183
- }
184
- }
185
-
186
- & > .atk-notify-wrap {
187
- z-index: 3;
188
- position: absolute;
189
- right: -2px;
190
- bottom: 40px;
191
- width: 225px;
192
- opacity: 0.83;
193
- }
194
- }