artalk 2.2.6 → 2.2.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.
- package/dist/Artalk.es.js +13 -3
- package/dist/Artalk.iife.js +1 -1
- package/dist/Artalk.js +1 -1
- package/package.json +1 -1
- package/src/api/index.ts +17 -1
- package/src/artalk.ts +2 -2
- package/src/components/comment.ts +1 -1
- package/src/components/editor-plugs/emoticons-plug.ts +2 -2
- package/src/components/editor-plugs/preview-plug.ts +1 -1
- package/src/components/editor.ts +1 -1
- package/src/components/list-lite.ts +4 -1
- package/src/components/list.ts +1 -1
- package/src/components/sidebar-layer.ts +2 -2
- package/src/context.ts +1 -1
- package/src/lib/checker/index.ts +1 -1
package/package.json
CHANGED
package/src/api/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Context from '../context'
|
|
2
1
|
import { CommentData, ListData, UserData, PageData, SiteData, NotifyData } from '~/types/artalk-data'
|
|
2
|
+
import Context from '../context'
|
|
3
3
|
import { Fetch, ToFormData, POST, GET } from './request'
|
|
4
4
|
import * as Utils from '../lib/utils'
|
|
5
5
|
|
|
@@ -318,4 +318,20 @@ export default class Api {
|
|
|
318
318
|
const data = await POST<any>(this.ctx, `${this.baseURL}/captcha/status`)
|
|
319
319
|
return (data || { is_pass: false }) as { is_pass: boolean }
|
|
320
320
|
}
|
|
321
|
+
|
|
322
|
+
// ============================
|
|
323
|
+
// 管理员缓存操作
|
|
324
|
+
// ============================
|
|
325
|
+
|
|
326
|
+
/** 缓存清除 */
|
|
327
|
+
public cacheFlushAll() {
|
|
328
|
+
const params: any = { flush_all: true }
|
|
329
|
+
return POST(this.ctx, `${this.baseURL}/admin/cache-flush`, params)
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/** 缓存预热 */
|
|
333
|
+
public cacheWarmUp() {
|
|
334
|
+
const params: any = {}
|
|
335
|
+
return POST(this.ctx, `${this.baseURL}/admin/cache-warm`, params)
|
|
336
|
+
}
|
|
321
337
|
}
|
package/src/artalk.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import './style/main.less'
|
|
2
2
|
|
|
3
|
-
import Context from './context'
|
|
4
3
|
import ArtalkConfig from '~/types/artalk-config'
|
|
4
|
+
import { EventPayloadMap, Handler } from '~/types/event'
|
|
5
|
+
import Context from './context'
|
|
5
6
|
import defaults from './defaults'
|
|
6
7
|
|
|
7
8
|
import CheckerLauncher from './lib/checker'
|
|
@@ -10,7 +11,6 @@ import List from './components/list'
|
|
|
10
11
|
import SidebarLayer from './components/sidebar-layer'
|
|
11
12
|
|
|
12
13
|
import Layer, { GetLayerWrap } from './components/layer'
|
|
13
|
-
import { EventPayloadMap, Handler } from '~/types/event'
|
|
14
14
|
import Api from './api'
|
|
15
15
|
import * as Utils from './lib/utils'
|
|
16
16
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import '../style/comment.less'
|
|
2
2
|
|
|
3
|
+
import { CommentData } from '~/types/artalk-data'
|
|
3
4
|
import Context from '../context'
|
|
4
5
|
import Component from '../lib/component'
|
|
5
6
|
import * as Utils from '../lib/utils'
|
|
6
7
|
import * as Ui from '../lib/ui'
|
|
7
8
|
import UADetect from '../lib/detect'
|
|
8
|
-
import { CommentData } from '~/types/artalk-data'
|
|
9
9
|
import CommentHTML from './html/comment.html?raw'
|
|
10
10
|
import Api from '../api'
|
|
11
11
|
import ActionBtn from './action-btn'
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import './emoticons-plug.less'
|
|
2
2
|
|
|
3
|
-
import Editor from '../editor'
|
|
4
|
-
import EditorPlug from './editor-plug'
|
|
5
3
|
import * as Utils from '~/src/lib/utils'
|
|
6
4
|
import * as Ui from '~/src/lib/ui'
|
|
7
5
|
import { EmoticonListData, EmoticonGrpData } from '~/types/artalk-data'
|
|
6
|
+
import EditorPlug from './editor-plug'
|
|
7
|
+
import Editor from '../editor'
|
|
8
8
|
|
|
9
9
|
type OwOFormatType = {
|
|
10
10
|
[key: string] : {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import './preview-plug.less'
|
|
2
2
|
|
|
3
|
+
import * as Utils from '~/src/lib/utils'
|
|
3
4
|
import Editor from '../editor'
|
|
4
5
|
import EditorPlug from './editor-plug'
|
|
5
|
-
import * as Utils from '~/src/lib/utils'
|
|
6
6
|
|
|
7
7
|
export default class PreviewPlug extends EditorPlug {
|
|
8
8
|
$el!: HTMLElement
|
package/src/components/editor.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import '../style/editor.less'
|
|
2
2
|
|
|
3
|
+
import { CommentData } from '~/types/artalk-data'
|
|
3
4
|
import Context from '../context'
|
|
4
5
|
import Component from '../lib/component'
|
|
5
6
|
import * as Utils from '../lib/utils'
|
|
@@ -8,7 +9,6 @@ import EditorHTML from './html/editor.html?raw'
|
|
|
8
9
|
|
|
9
10
|
import EmoticonsPlug from './editor-plugs/emoticons-plug'
|
|
10
11
|
import PreviewPlug from './editor-plugs/preview-plug'
|
|
11
|
-
import { CommentData } from '~/types/artalk-data'
|
|
12
12
|
import Api from '../api'
|
|
13
13
|
|
|
14
14
|
export default class Editor extends Component {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { ListData, CommentData, NotifyData, ApiVersionData } from '~/types/artalk-data'
|
|
1
2
|
import Context from '../context'
|
|
2
3
|
import Component from '../lib/component'
|
|
3
4
|
import * as Utils from '../lib/utils'
|
|
4
5
|
import * as Ui from '../lib/ui'
|
|
5
6
|
import Api from '../api'
|
|
6
7
|
import Comment from './comment'
|
|
7
|
-
import { ListData, CommentData, NotifyData, ApiVersionData } from '~/types/artalk-data'
|
|
8
8
|
import Pagination from './pagination'
|
|
9
9
|
import ReadMoreBtn from './read-more-btn'
|
|
10
10
|
import { backendMinVersion } from '../../package.json'
|
|
@@ -49,6 +49,9 @@ export default class ListLite extends Component {
|
|
|
49
49
|
</div>`)
|
|
50
50
|
this.$commentsWrap = this.$el.querySelector('.atk-list-comments-wrap')!
|
|
51
51
|
|
|
52
|
+
// 评论为空时显示字符
|
|
53
|
+
if (ctx.conf.noComment) this.noCommentText = ctx.conf.noComment
|
|
54
|
+
|
|
52
55
|
// 评论时间自动更新
|
|
53
56
|
window.setInterval(() => {
|
|
54
57
|
this.$el.querySelectorAll<HTMLElement>('[data-atk-comment-date]').forEach(el => {
|
package/src/components/list.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import '../style/list.less'
|
|
2
2
|
|
|
3
|
+
import { ListData } from '~/types/artalk-data'
|
|
3
4
|
import Context from '../context'
|
|
4
5
|
import * as Utils from '../lib/utils'
|
|
5
6
|
import * as Ui from '../lib/ui'
|
|
6
7
|
import Api from '../api'
|
|
7
8
|
import ListHTML from './html/list.html?raw'
|
|
8
9
|
import ListLite from './list-lite'
|
|
9
|
-
import { ListData } from '~/types/artalk-data'
|
|
10
10
|
|
|
11
11
|
export default class List extends ListLite {
|
|
12
12
|
private $closeCommentBtn!: HTMLElement
|
|
@@ -3,11 +3,11 @@ import '../style/sidebar-layer.less'
|
|
|
3
3
|
import Context from '@/context'
|
|
4
4
|
import Component from '@/lib/component'
|
|
5
5
|
import * as Utils from '@/lib/utils'
|
|
6
|
-
import SidebarHTML from './html/sidebar-layer.html?raw'
|
|
7
6
|
import * as Ui from '@/lib/ui'
|
|
7
|
+
import { SidebarShowPayload } from '~/types/event'
|
|
8
|
+
import SidebarHTML from './html/sidebar-layer.html?raw'
|
|
8
9
|
import Layer from './layer'
|
|
9
10
|
import Api from '../api'
|
|
10
|
-
import { SidebarShowPayload } from '~/types/event'
|
|
11
11
|
|
|
12
12
|
export default class SidebarLayer extends Component {
|
|
13
13
|
public layer?: Layer
|
package/src/context.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { marked as libMarked } from 'marked'
|
|
2
|
-
import User from './lib/user'
|
|
3
2
|
import ArtalkConfig from '~/types/artalk-config'
|
|
4
3
|
import { EventPayloadMap, Event, EventScopeType, Handler } from '~/types/event'
|
|
4
|
+
import User from './lib/user'
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Artalk Context
|
package/src/lib/checker/index.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import Context from '@/context'
|
|
2
2
|
import Layer from '@/components/layer'
|
|
3
3
|
import Dialog from '@/components/dialog'
|
|
4
|
+
import { CheckerPayload } from '~/types/event'
|
|
4
5
|
import * as Utils from '../utils'
|
|
5
6
|
import * as Ui from '../ui'
|
|
6
|
-
import { CheckerPayload } from '~/types/event'
|
|
7
7
|
import CaptchaChecker from './captcha-checker'
|
|
8
8
|
import AdminChecker from './admin-checker'
|
|
9
9
|
|