artalk 2.1.4 → 2.1.7

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 (48) hide show
  1. package/CNAME +1 -0
  2. package/dist/Artalk.css +1 -1
  3. package/dist/Artalk.es.js +303 -1248
  4. package/dist/Artalk.iife.js +1 -1
  5. package/dist/Artalk.js +1 -1
  6. package/index.html +143 -0
  7. package/package.json +8 -29
  8. package/postcss.config.js +5 -0
  9. package/src/api/index.ts +14 -0
  10. package/src/api/request.ts +4 -2
  11. package/src/artalk.ts +28 -6
  12. package/src/components/comment.ts +20 -3
  13. package/src/components/html/list.html +4 -2
  14. package/src/components/html/sidebar-layer.html +8 -0
  15. package/src/components/list.ts +60 -0
  16. package/src/components/sidebar-layer.ts +143 -0
  17. package/src/defaults.ts +1 -0
  18. package/src/lib/detect.js +3 -1
  19. package/src/lib/utils.ts +25 -0
  20. package/src/style/_extend.less +0 -80
  21. package/src/style/comment.less +6 -0
  22. package/src/style/list.less +66 -0
  23. package/src/style/main.less +1 -1
  24. package/src/style/sidebar-layer.less +92 -0
  25. package/types/artalk-config.d.ts +4 -1
  26. package/types/artalk-data.d.ts +3 -0
  27. package/vite-common.config.ts +15 -0
  28. package/vite-demo.config.ts +14 -0
  29. package/vite.config.ts +36 -0
  30. package/LICENSE +0 -674
  31. package/README.md +0 -84
  32. package/src/components/admin/page-list.ts +0 -194
  33. package/src/components/admin/site-list-floater.ts +0 -98
  34. package/src/components/admin/site-list.ts +0 -289
  35. package/src/components/html/sidebar.html +0 -22
  36. package/src/components/item-text-editor.ts +0 -136
  37. package/src/components/sidebar-view.ts +0 -26
  38. package/src/components/sidebar-views/comments-view.ts +0 -73
  39. package/src/components/sidebar-views/pages-view.ts +0 -61
  40. package/src/components/sidebar-views/setting-view.ts +0 -21
  41. package/src/components/sidebar-views/sites-view.ts +0 -36
  42. package/src/components/sidebar-views/transfer-view.ts +0 -218
  43. package/src/components/sidebar.ts +0 -293
  44. package/src/lib/md5.js +0 -6
  45. package/src/style/item-text-editor.less +0 -35
  46. package/src/style/page-list.less +0 -50
  47. package/src/style/sidebar.less +0 -420
  48. package/src/style/site-list.less +0 -208
@@ -1,420 +0,0 @@
1
- @header-height: 60px;
2
- @nav-height: 40px;
3
-
4
- .atk-sidebar {
5
- @width: 430px;
6
- position: fixed;
7
- z-index: 99999;
8
- top: 0;
9
- right: 0;
10
- width: @width;
11
- height: 100%;
12
- background: var(--at-color-bg);
13
- transition: transform 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms;
14
- transform: translate(@width, 0px);
15
-
16
- @media only screen and (max-width: @width) {
17
- & {
18
- width: 100%;
19
- }
20
- }
21
-
22
- .atk-sidebar-inner {
23
- position: relative;
24
- }
25
-
26
- // Header
27
- .atk-sidebar-header {
28
- display: flex;
29
- flex-direction: row;
30
- align-items: center;
31
- border-bottom: 1px solid var(--at-color-border);
32
-
33
- .atk-avatar {
34
- display: flex;
35
- width: @header-height + 5px;
36
- height: @header-height;
37
- align-items: center;
38
- justify-content: center;
39
-
40
- img, .atk-site-logo {
41
- @height: @header-height - 30px;
42
- height: @height;
43
- width: @header-height - 30px;
44
- border-radius: 2px;
45
- background: var(--at-color-meta);
46
- text-align: center;
47
- line-height: @height;
48
- font-size: 13px;
49
- color: var(--at-color-bg);
50
- }
51
-
52
- .atk-site-logo {
53
- user-select: none;
54
- cursor: pointer;
55
- }
56
- }
57
-
58
- .atk-menu {
59
- flex: auto;
60
- text-align: center;
61
-
62
- .atk-item {
63
- position: relative;
64
- color: var(--at-color-sub);
65
- font-size: 20px;
66
- // cursor: pointer;
67
- user-select: none;
68
-
69
- &:not(:last-child) {
70
- margin-right: 20px;
71
- }
72
-
73
- &.atk-active {
74
- color: var(--at-color-font);
75
-
76
- &:after {
77
- content: ' ';
78
- position: absolute;
79
- bottom: 0;
80
- left: 0;
81
- width: 100%;
82
- height: 6px;
83
- background: var(--at-color-main);
84
- opacity: .4;
85
- }
86
- }
87
- }
88
- }
89
-
90
- .atk-sidebar-close {
91
- display: flex;
92
- flex-direction: column;
93
- width: @header-height;
94
- height: @header-height;
95
- align-items: center;
96
- place-content: center;
97
- cursor: pointer;
98
- user-select: none;
99
- margin-left: 10px;
100
-
101
- &:hover .atk-icon-close {
102
- background-color: rgba(232, 17, 35, 0.9);
103
- }
104
- }
105
- }
106
-
107
- // Nav
108
- .atk-sidebar-nav {
109
- display: flex;
110
- flex-direction: row;
111
- border-bottom: 1px solid var(--at-color-border);
112
- height: @nav-height + 1px;
113
-
114
- .akt-curt-view-btn {
115
- display: flex;
116
- align-items: center;
117
- padding: 0 20px;
118
- border-right: 1px solid var(--at-color-border);
119
- cursor: pointer;
120
- user-select: none;
121
- height: @nav-height;
122
- line-height: @nav-height;
123
- white-space: nowrap;
124
-
125
- &:hover {
126
- background: var(--at-color-bg-grey);
127
- }
128
-
129
- .atk-icon {
130
- width: 17px;
131
-
132
- span {
133
- position: relative;
134
- display: block;
135
- width: 14px;
136
- height: 1px;
137
- margin: 0 auto 4px;
138
- background: var(--at-color-deep);
139
- transform-origin: 20px;
140
-
141
- &:last-child {
142
- margin-bottom: 0;
143
- }
144
- }
145
-
146
- &.atk-arrow span {
147
- width: 8px;
148
- opacity: 1;
149
- transform: rotate(-45deg);
150
- transform-origin: 7px;
151
-
152
- &:nth-child(2) {
153
- transform: rotate(0deg);
154
- width: 0;
155
- opacity: 0;
156
- }
157
-
158
- &:nth-child(3) {
159
- opacity: 1;
160
- transform: rotate(45deg);
161
- }
162
- }
163
- }
164
-
165
- .atk-text {
166
- margin-left: 10px;
167
- }
168
- }
169
-
170
- .atk-tabs {
171
- &::-webkit-scrollbar {
172
- width: 0;
173
- height: 0;
174
- background: transparent;
175
- }
176
-
177
- display: flex;
178
- flex-direction: row;
179
- overflow-y: auto;
180
-
181
- &.atk-views .atk-active {
182
-
183
- }
184
-
185
- .atk-tab-item {
186
- line-height: @nav-height;
187
- height: @nav-height;
188
- color: var(--at-color-sub);
189
- cursor: pointer;
190
- user-select: none;
191
- padding: 0 20px;
192
- white-space: nowrap;
193
-
194
- &:hover {
195
- background: var(--at-color-bg-grey);
196
- }
197
-
198
- &.atk-active {
199
- color: var(--at-color-deep);
200
- }
201
- }
202
- }
203
- }
204
-
205
- .atk-site-list-floater {
206
- .atk-slim-scrollbar();
207
-
208
- position: absolute;
209
- z-index: 9999;
210
- left: 50%;
211
- top: 70px;
212
- transform: translateX(-50%);
213
- pointer-events: all;
214
- background: var(--at-color-bg);
215
- width: 80%;
216
- max-height: 40%;
217
- margin: 0 auto;
218
- border: 1px solid var(--at-color-border);
219
- border-radius: 4px;
220
- overflow-y: auto;
221
-
222
- .atk-sites {
223
- display: flex;
224
- flex-direction: column;
225
- padding: 7px 0;
226
-
227
- .atk-site-item {
228
- display: flex;
229
- flex-direction: row;
230
- cursor: pointer;
231
- align-items: center;
232
- padding: 0 10px;
233
- margin-bottom: 1px;
234
-
235
- .atk-site-logo {
236
- width: 20px;
237
- height: 20px;
238
- line-height: 20px;
239
- background: var(--at-color-meta);
240
- margin: 10px;
241
- border-radius: 3px;
242
- text-align: center;
243
- color: var(--at-color-bg);
244
- font-size: 12px;
245
- }
246
-
247
- .atk-site-name {
248
- color: var(--at-color-font);
249
- font-size: 17px;
250
- margin-left: 7px;
251
- }
252
-
253
- &.atk-active, &:hover {
254
- background: var(--at-color-bg-grey);
255
- }
256
- }
257
- }
258
- }
259
-
260
- .atk-sidebar-view-wrap {
261
- position: relative;
262
- overflow-y: auto;
263
- height: calc(100vh - @header-height - @nav-height - 2px);
264
- .atk-slim-scrollbar();
265
-
266
- .atk-sidebar-no-content {
267
- position: absolute;
268
- left: 0;
269
- right: 0;
270
- top: 0;
271
- font-size: 35px;
272
- color: var(--at-color-meta);
273
- pointer-events: none;
274
- height: 100%;
275
- display: flex;
276
- justify-content: center;
277
- align-items: center;
278
- }
279
- }
280
-
281
- .atk-form {
282
- @form-height: 35px;
283
-
284
- padding: 20px 30px;
285
-
286
- .atk-label {
287
- font-size: 16px;
288
- margin-bottom: 12px;
289
- color: var(--at-color-font);
290
- }
291
-
292
- .atk-desc {
293
- font-size: 14px;
294
- margin-top: 12px;
295
- margin-left: 15px;
296
- margin-bottom: 20px;
297
- display: block;
298
- color: var(--at-color-meta);
299
-
300
- a {
301
- opacity: 0.8;
302
- }
303
- }
304
-
305
- input, textarea {
306
- display: block;
307
- line-height: @form-height;
308
- padding: 0 10px;
309
- margin: 0;
310
- border: none;
311
- border-bottom: 2px solid var(--at-color-border);
312
- outline: none;
313
- width: 100%;
314
- margin-bottom: 25px;
315
- background: var(--at-color-bg);
316
-
317
- &:focus {
318
- border-bottom-color: var(--at-color-bg-light);
319
- }
320
-
321
- &[type="file"] {
322
- border-radius: 2px;
323
- background: transparent;
324
- border-bottom: 2px solid var(--at-color-border);
325
- cursor: pointer;
326
- position: relative;
327
- padding: 0 15px;
328
- margin-bottom: 30px;
329
- }
330
- }
331
-
332
- textarea {
333
- font-size: 13px;
334
- line-height: 20px;
335
- min-height: 80px;
336
- resize: vertical;
337
- }
338
-
339
- select {
340
- display: block;
341
- outline: none;
342
- height: @form-height;
343
- padding: 5px 10px;
344
- width: 100%;
345
- border: none;
346
- border-bottom: 2px solid var(--at-color-border);
347
- margin-bottom: 25px;
348
- -webkit-appearance: none;
349
- border-radius: 0;
350
- background: var(--at-color-bg);
351
- }
352
-
353
- button {
354
- &:hover {
355
- background: var(--at-color-bg-light);
356
- }
357
-
358
- text-align: center;
359
- color: var(--at-color-light);
360
- background: transparent;
361
- border: 2px solid var(--at-color-bg-light);
362
- line-height: @form-height;
363
- letter-spacing: 2em;
364
- text-indent: 2em; // center
365
- cursor: pointer;
366
- outline: none;
367
- padding: 0 20px;
368
- border-radius: 4px;
369
- margin: 0 5px;
370
- width: 100%;
371
- }
372
-
373
- input, select, button {
374
- font-size: 15px;
375
- }
376
- }
377
-
378
- .atk-log-wrap {
379
- .atk-log-back-btn {
380
- display: inline-block;
381
- padding: 5px 33px;
382
- cursor: pointer;
383
- user-select: none;
384
- border-right: 1px solid var(--at-color-border);
385
- border-left: 1px solid transparent;
386
- &:hover {
387
- background: #f4f4f4;
388
- }
389
- }
390
-
391
- .atk-log {}
392
-
393
- .atk-iframe {
394
- width: 100%;
395
- height: calc(100vh - 150px);
396
- border: 0;
397
- background: #f4f4f4;
398
- border: 3px solid #eee;
399
- }
400
- }
401
- }
402
-
403
- .atk-view-name-pages, .atk-view-name-comments {
404
- padding-bottom: 55px;
405
-
406
- .atk-pagination-wrap {
407
- z-index: 200;
408
- position: fixed;
409
- width: 100%;
410
- bottom: 0;
411
- left: 0;
412
- background: var(--at-color-bg);
413
- border-top: 1px solid var(--at-color-border);
414
- }
415
-
416
- .atk-list-read-more {
417
- margin-top: 30px;
418
- margin-bottom: -40px;
419
- }
420
- }
@@ -1,208 +0,0 @@
1
- .atk-site-list {
2
- & > .atk-header {
3
- display: flex;
4
- flex-direction: row;
5
- padding: 15px 30px;
6
- align-items: center;
7
-
8
- .atk-title {
9
- flex: auto;
10
- padding-right: 10px;
11
- }
12
-
13
- .atk-actions {
14
- display: flex;
15
- flex-direction: row;
16
-
17
- .atk-item {
18
- display: flex;
19
- height: 30px;
20
- width: 30px;
21
- justify-content: center;
22
- align-items: center;
23
- user-select: none;
24
- cursor: pointer;
25
- border-radius: 2px;
26
-
27
- &:hover {
28
- background: var(--at-color-bg-grey);
29
- }
30
- }
31
- }
32
- }
33
-
34
- .atk-site-rows-wrap {
35
- position: relative;
36
-
37
- .atk-site-row {
38
- display: flex;
39
- flex-direction: row;
40
- padding: 10px 20px;
41
- padding-bottom: 0;
42
- }
43
-
44
- .atk-site-item {
45
- display: flex;
46
- flex-basis: 25%;
47
- flex-direction: column;
48
- align-items: center;
49
- padding-bottom: 5px;
50
- user-select: none;
51
- cursor: pointer;
52
- border: 1px solid transparent;
53
-
54
- .atk-site-logo {
55
- margin: 15px;
56
- text-align: center;
57
- font-size: 20px;
58
- height: 65px;
59
- width: 65px;
60
- line-height: 65px;
61
- background: #687a86;
62
- color: #fff;
63
- border-radius: 4px;
64
- }
65
-
66
- .atk-site-name {
67
- text-align: center;
68
- font-size: 15px;
69
- color: var(--at-color-sub);
70
- padding: 0 17px;
71
- word-break: break-word;
72
- }
73
-
74
- &.atk-active {
75
- background-color: var(--at-color-bg-grey);
76
- border: 1px solid var(--at-color-border);
77
- margin-top: -1px;
78
- border-radius: 0 0 4px 4px;
79
-
80
- .atk-site-name {
81
- color: var(--at-color-deep);
82
- }
83
- }
84
-
85
- &:hover {
86
- .atk-site-name {
87
- color: var(--at-color-font);
88
- }
89
- }
90
- }
91
- }
92
-
93
- .atk-site-edit, .atk-site-add {
94
- position: relative;
95
- min-height: 120px;
96
- width: 100%;
97
- border-top: 1px solid var(--at-color-border);
98
- border-bottom: 1px solid var(--at-color-border);
99
- margin-bottom: -10px;
100
-
101
- .atk-header {
102
- display: flex;
103
- flex-direction: row;
104
- align-items: center;
105
- padding: 10px 30px 0 35px;
106
- justify-content: space-between;
107
-
108
- .atk-site-info {
109
- .atk-site-name {
110
- cursor: pointer;
111
- display: inline-block;
112
- font-size: 23px;
113
- position: relative;
114
-
115
- &:after {
116
- content: ' ';
117
- position: absolute;
118
- width: 100%;
119
- height: 6px;
120
- background: var(--at-color-main);
121
- opacity: .4;
122
- left: 0;
123
- bottom: 6px;
124
- }
125
- }
126
-
127
- .atk-site-urls {
128
- display: flex;
129
- width: 100%;
130
- margin-top: 6px;
131
- flex-wrap: wrap;
132
- min-height: 23px;
133
-
134
- .atk-url-item {
135
- background: var(--at-color-bg-grey);
136
- color: var(--at-color-font);
137
- border-radius: 2px;
138
- padding: 0 8px;
139
- font-size: 13px;
140
- margin-bottom: 3px;
141
- margin-right: 3px;
142
- cursor: pointer;
143
-
144
- &:hover {
145
- }
146
- }
147
- }
148
- }
149
-
150
- .atk-close-btn {
151
- width: 50px;
152
- height: 50px;
153
- display: flex;
154
- justify-content: center;
155
- align-items: center;
156
- cursor: pointer;
157
-
158
- &:hover i {
159
- background-color: var(--at-color-red);
160
- }
161
- }
162
- }
163
-
164
- .atk-main {
165
- position: relative;
166
- display: flex;
167
- flex-direction: row;
168
- padding: 20px 30px 6px 35px;
169
- padding-bottom: 10px;
170
-
171
- .atk-site-text-actions {
172
- .atk-list-text-actions();
173
- height: 90px;
174
- padding: 0;
175
- padding-left: 10px;
176
-
177
- .atk-item {
178
- margin-bottom: 17px;
179
- margin-right: 25px;
180
- }
181
- }
182
-
183
- .atk-site-btn-actions {
184
- .atk-list-btn-actions();
185
-
186
- padding-right: 9px;
187
- }
188
-
189
- .atk-item-text-editor-layer {
190
- padding: 10px 20px;
191
- }
192
- }
193
- }
194
-
195
- .atk-site-add {
196
- position: relative;
197
-
198
- .atk-header {
199
- .atk-title {
200
- font-size: 20px;
201
- }
202
- }
203
-
204
- .atk-form {
205
- padding: 20px 40px;
206
- }
207
- }
208
- }