artalk 2.7.1 → 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.
- package/README.md +1 -1
- package/dist/Artalk.css +1 -1
- package/dist/Artalk.es.js +155 -147
- package/dist/Artalk.es.js.map +1 -1
- package/dist/Artalk.iife.js +1 -1
- package/dist/Artalk.iife.js.map +1 -1
- package/dist/Artalk.js +1 -1
- package/dist/Artalk.js.map +1 -1
- package/dist/ArtalkLite.css +1 -1
- package/dist/ArtalkLite.es.js +155 -147
- package/dist/ArtalkLite.es.js.map +1 -1
- package/dist/ArtalkLite.iife.js +1 -1
- package/dist/ArtalkLite.iife.js.map +1 -1
- package/dist/ArtalkLite.js +1 -1
- package/dist/ArtalkLite.js.map +1 -1
- package/dist/i18n/jp.js +1 -1
- package/dist/i18n/zh-TW.js +1 -1
- package/dist/src/api/_base.d.ts +7 -0
- package/dist/src/api/_options.d.ts +5 -0
- package/dist/src/components/checker/index.d.ts +2 -0
- package/dist/src/i18n/en.d.ts +1 -0
- package/dist/src/i18n/external.d.ts +1 -0
- package/dist/src/i18n/index.d.ts +3 -0
- package/dist/src/i18n/jp.d.ts +1 -0
- package/dist/src/i18n/zh-TW.d.ts +1 -0
- package/dist/src/lib/user.d.ts +8 -6
- package/dist/src/plugins/editor/_kit.d.ts +7 -1
- package/dist/src/service.d.ts +2 -8
- package/dist/types/event.d.ts +1 -1
- package/package.json +43 -17
- package/dist/src/components/dark-mode.d.ts +0 -2
- package/src/api/_base.ts +0 -18
- package/src/api/_options.ts +0 -25
- package/src/api/_request.ts +0 -104
- package/src/api/admin.ts +0 -18
- package/src/api/captcha.ts +0 -24
- package/src/api/comment.ts +0 -84
- package/src/api/index.ts +0 -29
- package/src/api/page.ts +0 -83
- package/src/api/site.ts +0 -51
- package/src/api/system.ts +0 -49
- package/src/api/upload.ts +0 -28
- package/src/api/user.ts +0 -132
- package/src/artalk.ts +0 -115
- package/src/comment/actions.ts +0 -83
- package/src/comment/comment.html +0 -18
- package/src/comment/comment.ts +0 -192
- package/src/comment/height-limit.ts +0 -100
- package/src/comment/index.ts +0 -3
- package/src/comment/render.ts +0 -150
- package/src/comment/renders/actions.ts +0 -114
- package/src/comment/renders/avatar.ts +0 -22
- package/src/comment/renders/content.ts +0 -39
- package/src/comment/renders/header.ts +0 -84
- package/src/comment/renders/index.ts +0 -19
- package/src/comment/renders/pending.ts +0 -12
- package/src/comment/renders/reply-at.ts +0 -16
- package/src/comment/renders/reply-to.ts +0 -24
- package/src/components/action-btn.ts +0 -170
- package/src/components/checker/admin.ts +0 -37
- package/src/components/checker/captcha-renders.ts +0 -69
- package/src/components/checker/captcha.ts +0 -26
- package/src/components/checker/index.ts +0 -192
- package/src/components/dark-mode.ts +0 -30
- package/src/components/dialog.ts +0 -62
- package/src/components/error-dialog.ts +0 -35
- package/src/components/pagination.ts +0 -153
- package/src/components/read-more-btn.ts +0 -92
- package/src/config.ts +0 -119
- package/src/context.ts +0 -146
- package/src/data.ts +0 -110
- package/src/defaults.ts +0 -61
- package/src/editor/editor.html +0 -18
- package/src/editor/editor.ts +0 -114
- package/src/editor/state.ts +0 -52
- package/src/editor/ui.ts +0 -36
- package/src/i18n/en.ts +0 -84
- package/src/i18n/external.ts +0 -10
- package/src/i18n/index.ts +0 -67
- package/src/i18n/jp.ts +0 -86
- package/src/i18n/zh-CN.ts +0 -88
- package/src/i18n/zh-TW.ts +0 -86
- package/src/layer/index.ts +0 -4
- package/src/layer/layer-manager.ts +0 -32
- package/src/layer/layer.ts +0 -39
- package/src/layer/scrollbar-helper.ts +0 -24
- package/src/layer/sidebar-layer.html +0 -8
- package/src/layer/sidebar-layer.ts +0 -155
- package/src/layer/wrap.ts +0 -77
- package/src/lib/component.ts +0 -12
- package/src/lib/detect.ts +0 -222
- package/src/lib/event-manager.ts +0 -47
- package/src/lib/highlight.ts +0 -5
- package/src/lib/marked-renderer.ts +0 -32
- package/src/lib/marked.ts +0 -72
- package/src/lib/sanitizer.ts +0 -57
- package/src/lib/ui.ts +0 -193
- package/src/lib/user.ts +0 -55
- package/src/lib/utils.ts +0 -236
- package/src/list/comment.ts +0 -20
- package/src/list/layout.ts +0 -120
- package/src/list/list.html +0 -20
- package/src/list/list.ts +0 -79
- package/src/list/nest.ts +0 -66
- package/src/list/page.ts +0 -97
- package/src/list/paginator/index.ts +0 -25
- package/src/list/paginator/read-more.ts +0 -67
- package/src/list/paginator/up-down.ts +0 -51
- package/src/main.ts +0 -14
- package/src/plugins/admin-only-elem.ts +0 -40
- package/src/plugins/conf-remoter.ts +0 -54
- package/src/plugins/dark-mode.ts +0 -12
- package/src/plugins/editor/_kit.ts +0 -57
- package/src/plugins/editor/_plug.ts +0 -60
- package/src/plugins/editor/_sample.ts +0 -8
- package/src/plugins/editor/closable.ts +0 -44
- package/src/plugins/editor/emoticons.scss +0 -72
- package/src/plugins/editor/emoticons.ts +0 -293
- package/src/plugins/editor/header-event.ts +0 -35
- package/src/plugins/editor/header-link.ts +0 -31
- package/src/plugins/editor/header-user.ts +0 -98
- package/src/plugins/editor/index.ts +0 -40
- package/src/plugins/editor/local-storage.ts +0 -36
- package/src/plugins/editor/mover.ts +0 -29
- package/src/plugins/editor/preview.scss +0 -7
- package/src/plugins/editor/preview.ts +0 -41
- package/src/plugins/editor/state-edit.ts +0 -116
- package/src/plugins/editor/state-reply.ts +0 -91
- package/src/plugins/editor/submit-add.ts +0 -33
- package/src/plugins/editor/submit-btn.ts +0 -25
- package/src/plugins/editor/submit.ts +0 -73
- package/src/plugins/editor/textarea.ts +0 -55
- package/src/plugins/editor/upload.ts +0 -145
- package/src/plugins/editor-kit.ts +0 -161
- package/src/plugins/index.ts +0 -16
- package/src/plugins/list/copyright.ts +0 -16
- package/src/plugins/list/count.ts +0 -31
- package/src/plugins/list/dropdown.ts +0 -95
- package/src/plugins/list/error-dialog.ts +0 -22
- package/src/plugins/list/fetch.ts +0 -64
- package/src/plugins/list/goto-first.ts +0 -23
- package/src/plugins/list/goto.ts +0 -72
- package/src/plugins/list/index.ts +0 -25
- package/src/plugins/list/loading.ts +0 -17
- package/src/plugins/list/no-comment.ts +0 -25
- package/src/plugins/list/reach-bottom.ts +0 -46
- package/src/plugins/list/sidebar-btn.ts +0 -39
- package/src/plugins/list/time-ticking.ts +0 -22
- package/src/plugins/list/unread-badge.ts +0 -26
- package/src/plugins/list/unread.ts +0 -38
- package/src/plugins/list/with-editor.ts +0 -59
- package/src/plugins/markdown.ts +0 -10
- package/src/plugins/stat.ts +0 -82
- package/src/plugins/version-check.ts +0 -36
- package/src/service.ts +0 -91
- package/src/style/_color.scss +0 -41
- package/src/style/_extend.scss +0 -20
- package/src/style/_variables.scss +0 -3
- package/src/style/comment.scss +0 -360
- package/src/style/editor.scss +0 -194
- package/src/style/list.scss +0 -212
- package/src/style/main.scss +0 -486
- package/src/style/pagination.scss +0 -58
- package/src/style/sidebar-layer.scss +0 -92
- package/types/config.ts +0 -153
- package/types/context.ts +0 -84
- package/types/data.ts +0 -271
- package/types/editor.ts +0 -95
- package/types/event.ts +0 -40
- package/types/global.d.ts +0 -1
- package/types/index.ts +0 -7
- package/types/plugin.ts +0 -3
- package/types/sidebar.ts +0 -3
package/src/plugins/stat.ts
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import type { ContextApi, ArtalkPlugin } from '~/types'
|
|
2
|
-
import Api from '../api'
|
|
3
|
-
|
|
4
|
-
export interface CountOptions {
|
|
5
|
-
getApi(): Api
|
|
6
|
-
|
|
7
|
-
pageKey: string
|
|
8
|
-
countEl: string
|
|
9
|
-
pvEl: string
|
|
10
|
-
|
|
11
|
-
/** 是否增加当前页面 PV 数 */
|
|
12
|
-
pvAdd?: boolean
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const PvCountWidget: ArtalkPlugin = (ctx: ContextApi) => {
|
|
16
|
-
ctx.on('conf-loaded', () => {
|
|
17
|
-
initCountWidget({
|
|
18
|
-
getApi: () => ctx.getApi(),
|
|
19
|
-
pageKey: ctx.conf.pageKey,
|
|
20
|
-
countEl: ctx.conf.countEl,
|
|
21
|
-
pvEl: ctx.conf.pvEl,
|
|
22
|
-
pvAdd: true,
|
|
23
|
-
})
|
|
24
|
-
})
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/** 初始化评论数和 PV 数量展示元素 */
|
|
28
|
-
export async function initCountWidget(opt: CountOptions) {
|
|
29
|
-
// 评论数
|
|
30
|
-
if (opt.countEl && document.querySelector(opt.countEl)) {
|
|
31
|
-
refreshStatCount(opt, { query: 'page_comment', numEl: opt.countEl })
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// PV
|
|
35
|
-
const initialData = opt.pvAdd ? {
|
|
36
|
-
[opt.pageKey]: (await opt.getApi().page.pv()) // pv+1 and get pv count
|
|
37
|
-
} : undefined
|
|
38
|
-
|
|
39
|
-
if (opt.pvEl && document.querySelector(opt.pvEl)) {
|
|
40
|
-
refreshStatCount(opt, {
|
|
41
|
-
query: 'page_pv',
|
|
42
|
-
numEl: opt.pvEl,
|
|
43
|
-
data: initialData,
|
|
44
|
-
})
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
type CountData = { [pageKey: string]: number }
|
|
49
|
-
|
|
50
|
-
async function refreshStatCount(
|
|
51
|
-
opt: CountOptions,
|
|
52
|
-
args: {
|
|
53
|
-
query: 'page_pv' | 'page_comment'
|
|
54
|
-
numEl: string
|
|
55
|
-
data?: CountData
|
|
56
|
-
}
|
|
57
|
-
) {
|
|
58
|
-
let data: CountData = args.data || {}
|
|
59
|
-
|
|
60
|
-
// Get page keys which will be queried
|
|
61
|
-
let queryPageKeys = Array.from(document.querySelectorAll(args.numEl))
|
|
62
|
-
.map((e) => e.getAttribute('data-page-key') || opt.pageKey)
|
|
63
|
-
.filter((k) => typeof data[k] !== 'number') // filter out keys that already have data
|
|
64
|
-
|
|
65
|
-
queryPageKeys = [...new Set(queryPageKeys)] // deduplicate
|
|
66
|
-
|
|
67
|
-
// Fetch count data from server
|
|
68
|
-
if (queryPageKeys.length > 0) {
|
|
69
|
-
const res = await opt.getApi().page.stat(args.query, queryPageKeys) as CountData
|
|
70
|
-
data = { ...data, ...res }
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
applyCountData(args.numEl, data, data[opt.pageKey])
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function applyCountData(selector: string, data: CountData, defaultCount: number) {
|
|
77
|
-
document.querySelectorAll(selector).forEach((el) => {
|
|
78
|
-
const pageKey = el.getAttribute('data-page-key')
|
|
79
|
-
const count = Number(pageKey ? (data[pageKey]) : defaultCount)
|
|
80
|
-
el.innerHTML = `${count}`
|
|
81
|
-
})
|
|
82
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { ArtalkPlugin } from '~/types'
|
|
2
|
-
import { version as ARTALK_VERSION } from '~/package.json'
|
|
3
|
-
import type List from '~/src/list/list'
|
|
4
|
-
import * as Ui from '@/lib/ui'
|
|
5
|
-
import * as Utils from '@/lib/utils'
|
|
6
|
-
import $t from '@/i18n'
|
|
7
|
-
|
|
8
|
-
let IgnoreVersionCheck = false
|
|
9
|
-
|
|
10
|
-
export const VersionCheck: ArtalkPlugin = (ctx) => {
|
|
11
|
-
ctx.on('conf-loaded', () => {
|
|
12
|
-
const list = ctx.get('list')
|
|
13
|
-
if (ctx.conf.apiVersion && ctx.conf.versionCheck && !IgnoreVersionCheck)
|
|
14
|
-
versionCheck(list, ARTALK_VERSION, ctx.conf.apiVersion)
|
|
15
|
-
})
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function versionCheck(list: List, feVer: string, beVer: string) {
|
|
19
|
-
const comp = Utils.versionCompare(feVer, beVer)
|
|
20
|
-
const sameVer = (comp === 0)
|
|
21
|
-
if (sameVer) return
|
|
22
|
-
|
|
23
|
-
const errEl = Utils.createElement(
|
|
24
|
-
`<div>${$t('updateMsg', { name: (comp < 0) ? $t('frontend') : $t('backend') })}` +
|
|
25
|
-
`<br/><br/><span style="color: var(--at-color-meta);">` +
|
|
26
|
-
`${$t('currentVersion')}: ${$t('frontend')} ${feVer} / ${$t('backend')} ${beVer}` +
|
|
27
|
-
`</span><br/><br/></div>`)
|
|
28
|
-
const ignoreBtn = Utils.createElement(`<span style="cursor:pointer">${$t('ignore')}</span>`)
|
|
29
|
-
ignoreBtn.onclick = () => {
|
|
30
|
-
Ui.setError(list.$el.parentElement!, null)
|
|
31
|
-
IgnoreVersionCheck = true
|
|
32
|
-
list.ctx.fetch({ offset: 0 })
|
|
33
|
-
}
|
|
34
|
-
errEl.append(ignoreBtn)
|
|
35
|
-
Ui.setError(list.$el.parentElement!, errEl, '<span class="atk-warn-title">Artalk Warn</span>')
|
|
36
|
-
}
|
package/src/service.ts
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import type { ContextApi } from '~/types'
|
|
2
|
-
import CheckerLauncher from './components/checker'
|
|
3
|
-
import Editor from './editor/editor'
|
|
4
|
-
import SidebarLayer from './layer/sidebar-layer'
|
|
5
|
-
|
|
6
|
-
import User from './lib/user'
|
|
7
|
-
import List from './list/list'
|
|
8
|
-
|
|
9
|
-
import * as I18n from './i18n'
|
|
10
|
-
import { PlugManager } from './plugins/editor-kit'
|
|
11
|
-
import { LayerManager } from './layer/layer-manager'
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Services
|
|
15
|
-
*
|
|
16
|
-
* @description Call these services by `ctx.get('serviceName')` or `ctx.serviceName`
|
|
17
|
-
*/
|
|
18
|
-
const services = {
|
|
19
|
-
// I18n
|
|
20
|
-
i18n(ctx: ContextApi) {
|
|
21
|
-
I18n.setLocale(ctx.conf.locale)
|
|
22
|
-
|
|
23
|
-
ctx.on('conf-loaded', () => {
|
|
24
|
-
I18n.setLocale(ctx.conf.locale)
|
|
25
|
-
})
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
// User Store
|
|
29
|
-
user(ctx: ContextApi) {
|
|
30
|
-
User.setOnUserChanged((user) => {
|
|
31
|
-
ctx?.trigger('user-changed', user)
|
|
32
|
-
})
|
|
33
|
-
return User
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
// 弹出层
|
|
37
|
-
layerManager(ctx: ContextApi) {
|
|
38
|
-
return new LayerManager(ctx)
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
// CheckerLauncher
|
|
42
|
-
checkerLauncher(ctx: ContextApi) {
|
|
43
|
-
const checkerLauncher = new CheckerLauncher({
|
|
44
|
-
getCtx: () => ctx,
|
|
45
|
-
getApi: () => ctx.getApi(),
|
|
46
|
-
getIframeURLBase: () => ctx.conf.server,
|
|
47
|
-
onReload: () => ctx.reload()
|
|
48
|
-
})
|
|
49
|
-
return checkerLauncher
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
// 编辑器
|
|
53
|
-
editor(ctx: ContextApi) {
|
|
54
|
-
const editor = new Editor(ctx)
|
|
55
|
-
ctx.$root.appendChild(editor.$el)
|
|
56
|
-
return editor
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
// 评论列表
|
|
60
|
-
list(ctx: ContextApi): List {
|
|
61
|
-
const list = new List(ctx)
|
|
62
|
-
ctx.$root.appendChild(list.$el)
|
|
63
|
-
return list
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
// 侧边栏 Layer
|
|
67
|
-
sidebarLayer(ctx: ContextApi) {
|
|
68
|
-
const sidebarLayer = new SidebarLayer(ctx)
|
|
69
|
-
return sidebarLayer
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
// Extra Service
|
|
73
|
-
// -----------------------------------------
|
|
74
|
-
// Only for type check
|
|
75
|
-
// Not inject to ctx immediately,
|
|
76
|
-
// but can be injected by other occasions
|
|
77
|
-
|
|
78
|
-
editorPlugs(): PlugManager|undefined {
|
|
79
|
-
return undefined
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export default services
|
|
84
|
-
|
|
85
|
-
// type tricks for dependency injection
|
|
86
|
-
type TServiceImps = typeof services
|
|
87
|
-
type TObjectWithFuncs = {[k: string]: (...args: any) => any}
|
|
88
|
-
type TKeysOnlyReturn<T extends TObjectWithFuncs, V> = {[K in keyof T]: ReturnType<T[K]> extends V ? K : never}[keyof T]
|
|
89
|
-
type TOmitConditions = TKeysOnlyReturn<TServiceImps, void>
|
|
90
|
-
type TServiceInjectors = Omit<TServiceImps, TOmitConditions>
|
|
91
|
-
export type TInjectedServices = {[K in keyof TServiceInjectors]: ReturnType<TServiceInjectors[K]>}
|
package/src/style/_color.scss
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
.artalk, .atk-layer-wrap {
|
|
2
|
-
--at-color-font: #2a2e2e;
|
|
3
|
-
--at-color-deep: #2a2e2e;
|
|
4
|
-
--at-color-sub: #757575;
|
|
5
|
-
--at-color-grey: #747474;
|
|
6
|
-
--at-color-meta: #697182;
|
|
7
|
-
--at-color-border: #eceff2;
|
|
8
|
-
--at-color-light: #4285f4;
|
|
9
|
-
--at-color-bg: #FFF;
|
|
10
|
-
--at-color-bg-transl: rgba(255, 255, 255, 0.94);
|
|
11
|
-
--at-color-bg-grey: #f3f4f5;
|
|
12
|
-
--at-color-bg-grey-transl: rgba(244, 244, 244, 0.75);
|
|
13
|
-
--at-color-bg-light: rgba(29, 161, 242, 0.1);
|
|
14
|
-
--at-color-main: #0083ff;
|
|
15
|
-
--at-color-red: #ff5652;
|
|
16
|
-
--at-color-pink: #fa5a57;
|
|
17
|
-
--at-color-yellow: #ff7c37;
|
|
18
|
-
--at-color-green: #4caf50;
|
|
19
|
-
--at-color-gradient: linear-gradient(180deg, transparent, rgba(255, 255, 255));
|
|
20
|
-
|
|
21
|
-
&.atk-dark-mode {
|
|
22
|
-
--at-color-font: #fff;
|
|
23
|
-
--at-color-deep: #e7e7e7;
|
|
24
|
-
--at-color-sub: #e7e7e7;
|
|
25
|
-
--at-color-grey: #fff;
|
|
26
|
-
--at-color-meta: #fff;
|
|
27
|
-
--at-color-border: #2d3235;
|
|
28
|
-
--at-color-light: #687a86;
|
|
29
|
-
--at-color-bg: #1e2224;
|
|
30
|
-
--at-color-bg-transl: rgba(30, 34, 36, 0.95);
|
|
31
|
-
--at-color-bg-grey: #46494e;
|
|
32
|
-
--at-color-bg-grey-transl: rgba(8, 8, 8, 0.95);
|
|
33
|
-
--at-color-bg-light: rgba(29, 161, 242, 0.1);
|
|
34
|
-
--at-color-main: #0083ff;
|
|
35
|
-
--at-color-red: #ff5652;
|
|
36
|
-
--at-color-pink: #fa5a57;
|
|
37
|
-
--at-color-yellow: #ff7c37;
|
|
38
|
-
--at-color-green: #4caf50;
|
|
39
|
-
--at-color-gradient: linear-gradient(180deg, transparent, rgba(30, 34, 36, 1));
|
|
40
|
-
}
|
|
41
|
-
}
|
package/src/style/_extend.scss
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
.atk-slim-scrollbar {
|
|
2
|
-
&::-webkit-scrollbar {
|
|
3
|
-
width: 4px;
|
|
4
|
-
height: 4px;
|
|
5
|
-
background: transparent;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
&::-webkit-scrollbar-thumb,
|
|
9
|
-
&::-webkit-scrollbar-thumb:window-inactive {
|
|
10
|
-
background: rgba(86,86,86,.3);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
&::-webkit-scrollbar-thumb:vertical:hover {
|
|
14
|
-
background: rgba(65,74,82,.77);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
&::-webkit-scrollbar-thumb:vertical:active {
|
|
18
|
-
background: rgba(41,47,53,.77);
|
|
19
|
-
}
|
|
20
|
-
}
|
package/src/style/comment.scss
DELETED
|
@@ -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
|
-
}
|