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.
- package/README.md +1 -1
- package/dist/Artalk.css +1 -1
- package/dist/Artalk.es.js +209 -188
- package/dist/Artalk.es.js.map +1 -0
- package/dist/Artalk.iife.js +2 -1
- package/dist/Artalk.iife.js.map +1 -0
- package/dist/Artalk.js +2 -1
- package/dist/Artalk.js.map +1 -0
- package/dist/ArtalkLite.css +1 -1
- package/dist/ArtalkLite.es.js +209 -188
- package/dist/ArtalkLite.es.js.map +1 -0
- package/dist/ArtalkLite.iife.js +2 -1
- package/dist/ArtalkLite.iife.js.map +1 -0
- package/dist/ArtalkLite.js +2 -1
- package/dist/ArtalkLite.js.map +1 -0
- 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/artalk.d.ts +0 -2
- package/dist/src/components/checker/index.d.ts +2 -0
- package/dist/src/i18n/en.d.ts +4 -0
- package/dist/src/i18n/external.d.ts +4 -0
- package/dist/src/i18n/index.d.ts +12 -0
- package/dist/src/i18n/jp.d.ts +4 -0
- package/dist/src/i18n/zh-TW.d.ts +4 -0
- package/dist/src/lib/user.d.ts +8 -6
- package/dist/src/main.d.ts +3 -0
- 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 -119
- 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 -81
- package/src/i18n/external.ts +0 -10
- package/src/i18n/index.ts +0 -67
- package/src/i18n/jp.ts +0 -83
- package/src/i18n/zh-CN.ts +0 -85
- package/src/i18n/zh-TW.ts +0 -83
- 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 -5
- 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 -79
- package/src/plugins/version-check.ts +0 -37
- 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
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
.atk-pagination {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: row;
|
|
4
|
-
justify-content: center;
|
|
5
|
-
padding: 10px 0;
|
|
6
|
-
position: relative;
|
|
7
|
-
|
|
8
|
-
& > .atk-btn,
|
|
9
|
-
& > .atk-input {
|
|
10
|
-
font-size: 15px;
|
|
11
|
-
height: 30px;
|
|
12
|
-
border: 1px solid var(--at-color-border);
|
|
13
|
-
border-radius: 3px;
|
|
14
|
-
padding: 0 5px;
|
|
15
|
-
text-align: center;
|
|
16
|
-
background: var(--at-color-bg);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
& > .atk-btn {
|
|
20
|
-
user-select: none;
|
|
21
|
-
width: 70px;
|
|
22
|
-
cursor: pointer;
|
|
23
|
-
display: flex;
|
|
24
|
-
justify-content: center;
|
|
25
|
-
align-items: center;
|
|
26
|
-
|
|
27
|
-
&:hover {
|
|
28
|
-
background: var(--at-color-bg-grey);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
&.atk-disabled {
|
|
32
|
-
color: var(--at-color-sub);
|
|
33
|
-
|
|
34
|
-
&:hover {
|
|
35
|
-
cursor: default;
|
|
36
|
-
background: initial;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
& > .atk-input {
|
|
42
|
-
background: transparent;
|
|
43
|
-
color: var(--at-color-font);
|
|
44
|
-
font-size: 18px;
|
|
45
|
-
width: 60px;
|
|
46
|
-
outline: none;
|
|
47
|
-
|
|
48
|
-
&:focus {
|
|
49
|
-
border-color: var(--at-color-main);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
& > * {
|
|
54
|
-
&:not(:last-child) {
|
|
55
|
-
margin-right: 10px;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
$header-height: 60px;
|
|
2
|
-
$nav-height: 40px;
|
|
3
|
-
|
|
4
|
-
.atk-sidebar-layer {
|
|
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
|
-
height: 100%;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// Header
|
|
28
|
-
.atk-sidebar-header {
|
|
29
|
-
position: absolute;
|
|
30
|
-
top: 0;
|
|
31
|
-
right: 0;
|
|
32
|
-
display: flex;
|
|
33
|
-
flex-direction: row;
|
|
34
|
-
align-items: center;
|
|
35
|
-
z-index: 99999;
|
|
36
|
-
|
|
37
|
-
.atk-sidebar-close {
|
|
38
|
-
display: flex;
|
|
39
|
-
flex-direction: column;
|
|
40
|
-
width: $header-height;
|
|
41
|
-
height: $header-height;
|
|
42
|
-
align-items: center;
|
|
43
|
-
place-content: center;
|
|
44
|
-
cursor: pointer;
|
|
45
|
-
user-select: none;
|
|
46
|
-
margin-left: 10px;
|
|
47
|
-
|
|
48
|
-
&:hover .atk-icon-close {
|
|
49
|
-
background-color: rgba(232, 17, 35, 0.9);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.atk-sidebar-iframe-wrap {
|
|
55
|
-
height: 100%;
|
|
56
|
-
position: relative;
|
|
57
|
-
|
|
58
|
-
iframe {
|
|
59
|
-
border: 0;
|
|
60
|
-
width: 100%;
|
|
61
|
-
height: 100%;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.atk-err-alert {
|
|
65
|
-
z-index: 9999;
|
|
66
|
-
top: 50%;
|
|
67
|
-
left: 50%;
|
|
68
|
-
transform: translate(-50%, -50%);
|
|
69
|
-
position: absolute;
|
|
70
|
-
background: var(--at-color-bg);
|
|
71
|
-
padding: 40px 30px;
|
|
72
|
-
width: 80%;
|
|
73
|
-
text-align: center;
|
|
74
|
-
border-radius: 4px;
|
|
75
|
-
|
|
76
|
-
.atk-title {
|
|
77
|
-
font-size: 1.4em;
|
|
78
|
-
margin-bottom: 20px;
|
|
79
|
-
color: var(--at-color-font);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.atk-text {
|
|
83
|
-
color: var(--at-color-font);
|
|
84
|
-
|
|
85
|
-
span {
|
|
86
|
-
cursor: pointer;
|
|
87
|
-
color: var(--at-color-main);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
package/types/config.ts
DELETED
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import { I18n } from '~/src/i18n'
|
|
2
|
-
import { CommentData } from './data'
|
|
3
|
-
|
|
4
|
-
export interface ArtalkConfig {
|
|
5
|
-
/** 装载元素 */
|
|
6
|
-
el: string|HTMLElement
|
|
7
|
-
|
|
8
|
-
/** 页面唯一标识(完整 URL) */
|
|
9
|
-
pageKey: string
|
|
10
|
-
|
|
11
|
-
/** 页面标题 */
|
|
12
|
-
pageTitle: string
|
|
13
|
-
|
|
14
|
-
/** 服务器地址 */
|
|
15
|
-
server: string
|
|
16
|
-
|
|
17
|
-
/** 站点名 */
|
|
18
|
-
site: string
|
|
19
|
-
|
|
20
|
-
/** 评论框占位字符 */
|
|
21
|
-
placeholder: string
|
|
22
|
-
|
|
23
|
-
/** 评论为空时显示字符 */
|
|
24
|
-
noComment: string
|
|
25
|
-
|
|
26
|
-
/** 发送按钮文字 */
|
|
27
|
-
sendBtn: string
|
|
28
|
-
|
|
29
|
-
/** 评论框穿梭(显示在待回复评论后面) */
|
|
30
|
-
editorTravel: boolean
|
|
31
|
-
|
|
32
|
-
/** 表情包 */
|
|
33
|
-
emoticons: object|any[]|string|false
|
|
34
|
-
|
|
35
|
-
/** Gravatar 头像 */
|
|
36
|
-
gravatar: {
|
|
37
|
-
/** API 地址 */
|
|
38
|
-
mirror: string
|
|
39
|
-
/** API 参数 */
|
|
40
|
-
params: string
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/** 头像链接生成器 */
|
|
44
|
-
avatarURLBuilder?: (comment: CommentData) => string,
|
|
45
|
-
|
|
46
|
-
/** 分页配置 */
|
|
47
|
-
pagination: {
|
|
48
|
-
/** 每次请求获取数量 */
|
|
49
|
-
pageSize: number
|
|
50
|
-
/** 阅读更多模式 */
|
|
51
|
-
readMore: boolean
|
|
52
|
-
/** 滚动到底部自动加载 */
|
|
53
|
-
autoLoad: boolean
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/** 内容限高 */
|
|
57
|
-
heightLimit: {
|
|
58
|
-
/** 评论内容限高 */
|
|
59
|
-
content: number
|
|
60
|
-
|
|
61
|
-
/** 子评论区域限高 */
|
|
62
|
-
children: number
|
|
63
|
-
|
|
64
|
-
/** 滚动限高 */
|
|
65
|
-
scrollable: boolean
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/** 评论投票按钮 */
|
|
69
|
-
vote: boolean
|
|
70
|
-
|
|
71
|
-
/** 评论投票反对按钮 */
|
|
72
|
-
voteDown: boolean
|
|
73
|
-
|
|
74
|
-
/** 评论预览功能 */
|
|
75
|
-
preview: boolean
|
|
76
|
-
|
|
77
|
-
/** 评论数绑定元素 Selector */
|
|
78
|
-
countEl: string
|
|
79
|
-
|
|
80
|
-
/** PV 数绑定元素 Selector */
|
|
81
|
-
pvEl: string
|
|
82
|
-
|
|
83
|
-
/** 夜间模式 */
|
|
84
|
-
darkMode: boolean|'auto'
|
|
85
|
-
|
|
86
|
-
/** 请求超时(单位:秒) */
|
|
87
|
-
reqTimeout: number
|
|
88
|
-
|
|
89
|
-
/** 平铺模式 */
|
|
90
|
-
flatMode: boolean|'auto'
|
|
91
|
-
|
|
92
|
-
/** 嵌套模式 · 最大层数 */
|
|
93
|
-
nestMax: number
|
|
94
|
-
|
|
95
|
-
/** 嵌套模式 · 排序方式 */
|
|
96
|
-
nestSort: 'DATE_ASC'|'DATE_DESC'
|
|
97
|
-
|
|
98
|
-
/** 显示 UA 徽标 */
|
|
99
|
-
uaBadge: boolean
|
|
100
|
-
|
|
101
|
-
/** 评论列表排序功能 (显示 Dropdown) */
|
|
102
|
-
listSort: boolean
|
|
103
|
-
|
|
104
|
-
/** 图片上传功能 */
|
|
105
|
-
imgUpload: boolean
|
|
106
|
-
|
|
107
|
-
/** 图片上传器 */
|
|
108
|
-
imgUploader?: (file: File) => Promise<string>
|
|
109
|
-
|
|
110
|
-
/** 版本检测 */
|
|
111
|
-
versionCheck: boolean
|
|
112
|
-
|
|
113
|
-
/** 引用后端配置 */
|
|
114
|
-
useBackendConf: boolean
|
|
115
|
-
|
|
116
|
-
/** 语言本地化 */
|
|
117
|
-
locale: I18n|string
|
|
118
|
-
|
|
119
|
-
/** 后端版本 (系统数据,用户不允许更改) */
|
|
120
|
-
apiVersion?: string
|
|
121
|
-
|
|
122
|
-
/** Replacer for marked */
|
|
123
|
-
markedReplacers?: ((raw: string) => string)[]
|
|
124
|
-
|
|
125
|
-
/** 列表请求参数修改器 */
|
|
126
|
-
listFetchParamsModifier?: (params: any) => void
|
|
127
|
-
|
|
128
|
-
// TODO consider merge list related config into one object, or flatten all to keep simple (keep consistency)
|
|
129
|
-
remoteConfModifier?: (conf: Partial<ArtalkConfig>) => void
|
|
130
|
-
listUnreadHighlight?: boolean
|
|
131
|
-
scrollRelativeTo?: () => HTMLElement
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* 本地持久化用户数据
|
|
136
|
-
* @note 始终保持一层结构,不支持多层结构
|
|
137
|
-
*/
|
|
138
|
-
export interface LocalUser {
|
|
139
|
-
/** 昵称 */
|
|
140
|
-
nick: string
|
|
141
|
-
|
|
142
|
-
/** 邮箱 */
|
|
143
|
-
email: string
|
|
144
|
-
|
|
145
|
-
/** 链接 */
|
|
146
|
-
link: string
|
|
147
|
-
|
|
148
|
-
/** TOKEN */
|
|
149
|
-
token: string
|
|
150
|
-
|
|
151
|
-
/** 是否为管理员 */
|
|
152
|
-
isAdmin: boolean
|
|
153
|
-
}
|
package/types/context.ts
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import type { TInjectedServices } from '@/service'
|
|
2
|
-
import type { CheckerCaptchaPayload, CheckerPayload } from '@/components/checker'
|
|
3
|
-
import type { EventManagerFuncs } from '@/lib/event-manager'
|
|
4
|
-
import type { TMarked } from '@/lib/marked'
|
|
5
|
-
import type { I18n } from '@/i18n'
|
|
6
|
-
import type Api from '@/api'
|
|
7
|
-
import type { SidebarShowPayload, EventPayloadMap, ArtalkConfig, CommentData, DataManagerApi, ListFetchParams, NotifyLevel } from '.'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Context 接口
|
|
11
|
-
*
|
|
12
|
-
* (面向接口的编程)
|
|
13
|
-
*/
|
|
14
|
-
export interface ContextApi extends EventManagerFuncs<EventPayloadMap> {
|
|
15
|
-
/** Artalk 根元素对象 */
|
|
16
|
-
$root: HTMLElement
|
|
17
|
-
|
|
18
|
-
/** 依赖注入函数 */
|
|
19
|
-
inject<K extends keyof TInjectedServices>(depName: K, obj: TInjectedServices[K]): void
|
|
20
|
-
|
|
21
|
-
/** 获取依赖对象 */
|
|
22
|
-
get<K extends keyof TInjectedServices>(depName: K): TInjectedServices[K]
|
|
23
|
-
|
|
24
|
-
/** 配置对象 */
|
|
25
|
-
// TODO 修改为 getConf() 和 setConf() 并且返回拷贝而不是引用
|
|
26
|
-
conf: ArtalkConfig
|
|
27
|
-
|
|
28
|
-
/** marked 依赖对象 */
|
|
29
|
-
getMarked(): TMarked | undefined
|
|
30
|
-
|
|
31
|
-
/** 获取 API 以供 HTTP 请求 */
|
|
32
|
-
getApi(): Api
|
|
33
|
-
|
|
34
|
-
/** 获取数据管理器对象 */
|
|
35
|
-
getData(): DataManagerApi
|
|
36
|
-
|
|
37
|
-
/** 评论回复 */
|
|
38
|
-
replyComment(commentData: CommentData, $comment: HTMLElement): void
|
|
39
|
-
|
|
40
|
-
/** 编辑评论 */
|
|
41
|
-
editComment(commentData: CommentData, $comment: HTMLElement): void
|
|
42
|
-
|
|
43
|
-
/** 获取评论数据 */
|
|
44
|
-
fetch(params: Partial<ListFetchParams>): void
|
|
45
|
-
|
|
46
|
-
/** 重载评论数据 */
|
|
47
|
-
reload(): void
|
|
48
|
-
|
|
49
|
-
/** 列表滚动到第一个评论的位置 */
|
|
50
|
-
listGotoFirst(): void
|
|
51
|
-
|
|
52
|
-
/** 显示侧边栏 */
|
|
53
|
-
showSidebar(payload?: SidebarShowPayload): void
|
|
54
|
-
|
|
55
|
-
/** 隐藏侧边栏 */
|
|
56
|
-
hideSidebar(): void
|
|
57
|
-
|
|
58
|
-
/** 编辑器 - 显示加载 */
|
|
59
|
-
editorShowLoading(): void
|
|
60
|
-
|
|
61
|
-
/** 编辑器 - 隐藏加载 */
|
|
62
|
-
editorHideLoading(): void
|
|
63
|
-
|
|
64
|
-
/** 编辑器 - 显示提示消息 */
|
|
65
|
-
editorShowNotify(msg: string, type: NotifyLevel): void
|
|
66
|
-
|
|
67
|
-
/** 评论框 - 复原状态 */
|
|
68
|
-
editorResetState(): void
|
|
69
|
-
|
|
70
|
-
/** 验证码检测 */
|
|
71
|
-
checkCaptcha(payload: CheckerCaptchaPayload): void
|
|
72
|
-
|
|
73
|
-
/** 管理员检测 */
|
|
74
|
-
checkAdmin(payload: CheckerPayload): void
|
|
75
|
-
|
|
76
|
-
/** i18n 翻译 */
|
|
77
|
-
$t(key: keyof I18n, args?: {[key: string]: string}): string
|
|
78
|
-
|
|
79
|
-
/** 设置夜间模式 */
|
|
80
|
-
setDarkMode(darkMode: boolean|'auto'): void
|
|
81
|
-
|
|
82
|
-
/** 更新配置 */
|
|
83
|
-
updateConf(conf: Partial<ArtalkConfig>): void
|
|
84
|
-
}
|
package/types/data.ts
DELETED
|
@@ -1,271 +0,0 @@
|
|
|
1
|
-
export interface CommentData {
|
|
2
|
-
/** 评论 ID */
|
|
3
|
-
id: number
|
|
4
|
-
|
|
5
|
-
/** 评论正文 */
|
|
6
|
-
content: string
|
|
7
|
-
|
|
8
|
-
/** 用户昵称 */
|
|
9
|
-
nick: string
|
|
10
|
-
|
|
11
|
-
/** 用户邮箱 (该字段仅管理员可见) */
|
|
12
|
-
email?: string
|
|
13
|
-
|
|
14
|
-
/** 用户邮箱(已加密) */
|
|
15
|
-
email_encrypted: string
|
|
16
|
-
|
|
17
|
-
/** 用户链接 */
|
|
18
|
-
link: string
|
|
19
|
-
|
|
20
|
-
/** 回复目标评论 ID */
|
|
21
|
-
rid: number
|
|
22
|
-
|
|
23
|
-
/** User Agent */
|
|
24
|
-
ua: string
|
|
25
|
-
|
|
26
|
-
/** 评论日期 */
|
|
27
|
-
date: string
|
|
28
|
-
|
|
29
|
-
/** 是否折叠 */
|
|
30
|
-
is_collapsed?: boolean
|
|
31
|
-
|
|
32
|
-
/** 是否待审 */
|
|
33
|
-
is_pending?: boolean
|
|
34
|
-
|
|
35
|
-
/** 是否置顶 */
|
|
36
|
-
is_pinned?: boolean
|
|
37
|
-
|
|
38
|
-
/** 是否为管理员 */
|
|
39
|
-
is_admin?: boolean
|
|
40
|
-
|
|
41
|
-
/** 徽章文字 */
|
|
42
|
-
badge_name?: string
|
|
43
|
-
|
|
44
|
-
/** 徽章颜色 */
|
|
45
|
-
badge_color?: string
|
|
46
|
-
|
|
47
|
-
/** IP 归属地 */
|
|
48
|
-
ip_region?: string
|
|
49
|
-
|
|
50
|
-
/** 是否允许回复 */
|
|
51
|
-
is_allow_reply?: boolean
|
|
52
|
-
|
|
53
|
-
/** 评论页面 key */
|
|
54
|
-
page_key: string
|
|
55
|
-
|
|
56
|
-
/** 评论页面 url */
|
|
57
|
-
page_url?: string
|
|
58
|
-
|
|
59
|
-
/** 是否可见 */
|
|
60
|
-
visible: boolean
|
|
61
|
-
|
|
62
|
-
/** 站点名(用于隔离) */
|
|
63
|
-
site_name: string
|
|
64
|
-
|
|
65
|
-
/** 赞同数 */
|
|
66
|
-
vote_up: number
|
|
67
|
-
|
|
68
|
-
/** 反对数 */
|
|
69
|
-
vote_down: number
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export interface ListData {
|
|
73
|
-
/** 评论数据 */
|
|
74
|
-
comments: CommentData[]
|
|
75
|
-
|
|
76
|
-
/** 根评论总数 */
|
|
77
|
-
total_roots: number
|
|
78
|
-
|
|
79
|
-
/** 评论总数(包括所有子评论) */
|
|
80
|
-
total: number
|
|
81
|
-
|
|
82
|
-
/** 页面信息 */
|
|
83
|
-
page: PageData
|
|
84
|
-
|
|
85
|
-
/** 站点信息 */
|
|
86
|
-
site: SiteData
|
|
87
|
-
|
|
88
|
-
/** 未读的 Notifies */
|
|
89
|
-
unread: NotifyData[]
|
|
90
|
-
|
|
91
|
-
/** 未读计数 */
|
|
92
|
-
unread_count: number
|
|
93
|
-
|
|
94
|
-
/** API 版本 */
|
|
95
|
-
api_version: ApiVersionData
|
|
96
|
-
|
|
97
|
-
/** 后端配置 */
|
|
98
|
-
conf: any // TODO
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export interface PageData {
|
|
102
|
-
/** 页面 ID */
|
|
103
|
-
id: number
|
|
104
|
-
|
|
105
|
-
/** 页面唯一标识符 */
|
|
106
|
-
key: string
|
|
107
|
-
|
|
108
|
-
/** 页面标题 */
|
|
109
|
-
title: string
|
|
110
|
-
|
|
111
|
-
/** 页面 url */
|
|
112
|
-
url: string
|
|
113
|
-
|
|
114
|
-
/** 仅管理员可评 */
|
|
115
|
-
admin_only: boolean
|
|
116
|
-
|
|
117
|
-
/** 站点名(用于隔离) */
|
|
118
|
-
site_name: string
|
|
119
|
-
|
|
120
|
-
/** 赞同数 */
|
|
121
|
-
vote_up: number
|
|
122
|
-
|
|
123
|
-
/** 反对数 */
|
|
124
|
-
vote_down: number
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export interface SiteData {
|
|
128
|
-
/** 站点 ID */
|
|
129
|
-
id: number
|
|
130
|
-
|
|
131
|
-
/** 站点名 */
|
|
132
|
-
name: string
|
|
133
|
-
|
|
134
|
-
/** 站点 URLs */
|
|
135
|
-
urls: string[]
|
|
136
|
-
|
|
137
|
-
/** 站点 URLs(原始字符串) */
|
|
138
|
-
urls_raw: string
|
|
139
|
-
|
|
140
|
-
/** 站点主 URL */
|
|
141
|
-
first_url: string
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
export interface UserData {
|
|
145
|
-
/** 用户 ID */
|
|
146
|
-
id: number
|
|
147
|
-
|
|
148
|
-
/** 用户名 */
|
|
149
|
-
name: string
|
|
150
|
-
|
|
151
|
-
/** 邮箱 */
|
|
152
|
-
email: string
|
|
153
|
-
|
|
154
|
-
/** 链接 */
|
|
155
|
-
link: string
|
|
156
|
-
|
|
157
|
-
/** 徽章名称 */
|
|
158
|
-
badge_name: string
|
|
159
|
-
|
|
160
|
-
/** 徽章颜色 */
|
|
161
|
-
badge_color: string
|
|
162
|
-
|
|
163
|
-
/** 是否属于管理员 */
|
|
164
|
-
is_admin: boolean
|
|
165
|
-
|
|
166
|
-
/** 所属站点名 */
|
|
167
|
-
site_names: string[]
|
|
168
|
-
|
|
169
|
-
/** 所属站点名 (字符串) */
|
|
170
|
-
site_names_raw: string,
|
|
171
|
-
|
|
172
|
-
/** 是否允许接收邮件通知 */
|
|
173
|
-
receive_email: boolean
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
export interface UserDataForAdmin extends UserData {
|
|
177
|
-
/** 最后一次操作 IP */
|
|
178
|
-
last_ip: string
|
|
179
|
-
|
|
180
|
-
/** 最后一次操作 UA */
|
|
181
|
-
last_ua: string
|
|
182
|
-
|
|
183
|
-
/** 是否存在于配置文件中 */
|
|
184
|
-
is_in_conf: boolean
|
|
185
|
-
|
|
186
|
-
/** 评论数 */
|
|
187
|
-
comment_count: number
|
|
188
|
-
|
|
189
|
-
/** 密码 */
|
|
190
|
-
password: string
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
export interface NotifyData {
|
|
194
|
-
/** 通知 ID */
|
|
195
|
-
id: number
|
|
196
|
-
|
|
197
|
-
/** 用户 ID */
|
|
198
|
-
user_id: number
|
|
199
|
-
|
|
200
|
-
/** 评论 ID */
|
|
201
|
-
comment_id: number
|
|
202
|
-
|
|
203
|
-
/** 是否已读 */
|
|
204
|
-
is_read: boolean
|
|
205
|
-
|
|
206
|
-
/** 是否已发送邮件通知 */
|
|
207
|
-
is_emailed: boolean
|
|
208
|
-
|
|
209
|
-
/** 标为已读地址 */
|
|
210
|
-
read_link: string
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
export type EmoticonGrpData = {
|
|
214
|
-
name: string,
|
|
215
|
-
type: 'emoticon'|'image'|'emoji'
|
|
216
|
-
items: {key: string, val: string}[]
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
export type EmoticonListData = EmoticonGrpData[]
|
|
220
|
-
|
|
221
|
-
export interface ApiVersionData {
|
|
222
|
-
/** API 程序名 */
|
|
223
|
-
app: string
|
|
224
|
-
|
|
225
|
-
/** API 程序版本号 */
|
|
226
|
-
version: string
|
|
227
|
-
|
|
228
|
-
/** API 程序 CommitHash */
|
|
229
|
-
commit_hash: string
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
export interface ListFetchParams {
|
|
233
|
-
offset: number
|
|
234
|
-
limit: number
|
|
235
|
-
flatMode: boolean
|
|
236
|
-
paramsModifier?: (p: any) => void
|
|
237
|
-
onSuccess?: (data: ListData) => void
|
|
238
|
-
onError?: (err: any) => void
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
export interface ListLastFetchData {
|
|
242
|
-
params: ListFetchParams
|
|
243
|
-
data?: ListData
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
export interface DataManagerApi {
|
|
247
|
-
getLoading(): boolean
|
|
248
|
-
setLoading(val: boolean): void
|
|
249
|
-
|
|
250
|
-
getListLastFetch(): ListLastFetchData|undefined
|
|
251
|
-
setListLastFetch(val: ListLastFetchData): void
|
|
252
|
-
|
|
253
|
-
getComments(): CommentData[]
|
|
254
|
-
findComment(id: number): CommentData|undefined
|
|
255
|
-
|
|
256
|
-
fetchComments(params: Partial<ListFetchParams>): void
|
|
257
|
-
loadComments(comments: CommentData[]): void
|
|
258
|
-
clearComments(): void
|
|
259
|
-
|
|
260
|
-
insertComment(comment: CommentData): void
|
|
261
|
-
updateComment(comment: CommentData): void
|
|
262
|
-
deleteComment(id: number): void
|
|
263
|
-
|
|
264
|
-
getUnreads(): NotifyData[]
|
|
265
|
-
updateUnreads(unreads: NotifyData[]): void
|
|
266
|
-
|
|
267
|
-
getPage(): PageData|undefined
|
|
268
|
-
updatePage(pageData: PageData): void
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
export type NotifyLevel = "i" | "s" | "w" | "e"
|