artalk 2.1.0 → 2.1.4
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.css +1 -1
- package/dist/Artalk.es.js +3895 -3106
- package/dist/Artalk.iife.js +1 -266
- package/dist/Artalk.js +1 -266
- package/package.json +19 -21
- package/src/api/index.ts +6 -7
- package/src/artalk.ts +11 -4
- package/src/components/action-btn.ts +1 -1
- package/src/components/comment.ts +102 -27
- package/src/components/editor-plugs/_example-plug.ts.txt +2 -7
- package/src/components/editor-plugs/editor-plug.ts +3 -3
- package/src/components/editor-plugs/emoticons-plug.less +21 -11
- package/src/components/editor-plugs/emoticons-plug.ts +199 -79
- package/src/components/editor-plugs/preview-plug.less +1 -1
- package/src/components/editor-plugs/preview-plug.ts +2 -7
- package/src/components/editor.ts +75 -34
- package/src/components/html/comment.html +6 -13
- package/src/components/html/editor.html +9 -10
- package/src/components/html/list.html +1 -1
- package/src/components/layer.ts +33 -14
- package/src/components/list-lite.ts +218 -235
- package/src/components/list.ts +11 -9
- package/src/components/pagination.ts +2 -2
- package/src/components/read-more-btn.ts +27 -10
- package/src/components/sidebar-views/comments-view.ts +12 -5
- package/src/components/sidebar-views/sites-view.ts +0 -6
- package/src/components/sidebar.ts +7 -2
- package/src/{default-conf.ts → defaults.ts} +7 -7
- package/src/lib/utils.ts +41 -12
- package/src/style/_color.less +19 -23
- package/src/style/_extend.less +3 -3
- package/src/style/_variables.less +0 -24
- package/src/style/comment.less +191 -197
- package/src/style/editor.less +78 -103
- package/src/style/item-text-editor.less +2 -2
- package/src/style/list.less +14 -13
- package/src/style/main.less +35 -31
- package/src/style/page-list.less +4 -4
- package/src/style/pagination.less +6 -6
- package/src/style/sidebar.less +35 -35
- package/src/style/site-list.less +13 -13
- package/types/artalk-config.d.ts +13 -10
- package/types/artalk-data.d.ts +10 -5
- package/types/event.d.ts +10 -1
- package/src/assets/emoticons.json +0 -100
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<span data-action="admin-close-comment" class="atk-hide" atk-only-admin-show>关闭评论</span>
|
|
9
9
|
<span data-action="open-sidebar" class="atk-hide atk-on">
|
|
10
10
|
<span class="atk-unread-badge" style="display: none;"></span>
|
|
11
|
-
|
|
11
|
+
<div class="atk-text">通知中心</div>
|
|
12
12
|
</span>
|
|
13
13
|
</div>
|
|
14
14
|
</div>
|
package/src/components/layer.ts
CHANGED
|
@@ -13,6 +13,8 @@ export default class Layer extends Component {
|
|
|
13
13
|
private bodyStyleOrgOverflow = ''
|
|
14
14
|
private bodyStyleOrgPaddingRight = ''
|
|
15
15
|
|
|
16
|
+
public afterHide?: Function
|
|
17
|
+
|
|
16
18
|
constructor (ctx: Context, name: string, el?: HTMLElement) {
|
|
17
19
|
super(ctx)
|
|
18
20
|
|
|
@@ -50,13 +52,8 @@ export default class Layer extends Component {
|
|
|
50
52
|
return this.$el
|
|
51
53
|
}
|
|
52
54
|
|
|
53
|
-
private static hideTimeoutList: number[] = []
|
|
54
|
-
|
|
55
55
|
show () {
|
|
56
|
-
|
|
57
|
-
clearTimeout(item)
|
|
58
|
-
})
|
|
59
|
-
Layer.hideTimeoutList = []
|
|
56
|
+
this.fireAllActionTimer()
|
|
60
57
|
|
|
61
58
|
this.$wrap.style.display = 'block'
|
|
62
59
|
this.$mask.style.display = 'block'
|
|
@@ -77,26 +74,48 @@ export default class Layer extends Component {
|
|
|
77
74
|
}
|
|
78
75
|
|
|
79
76
|
hide () {
|
|
80
|
-
|
|
77
|
+
if (this.afterHide) this.afterHide()
|
|
78
|
+
this.$wrap.classList.add('atk-fade-out')
|
|
79
|
+
this.$el.style.display = 'none'
|
|
80
|
+
|
|
81
|
+
this.newActionTimer(() => {
|
|
81
82
|
this.$wrap.style.display = 'none'
|
|
82
83
|
// body style 禁止滚动解除
|
|
83
84
|
document.body.style.overflow = this.bodyStyleOrgOverflow
|
|
84
85
|
document.body.style.paddingRight = this.bodyStyleOrgPaddingRight
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
this
|
|
88
|
-
Layer.hideTimeoutList.push(window.setTimeout(() => {
|
|
86
|
+
this.checkCleanLayer()
|
|
87
|
+
}, 450)
|
|
88
|
+
this.newActionTimer(() => {
|
|
89
89
|
this.$wrap.style.display = 'none'
|
|
90
90
|
this.$wrap.classList.remove('atk-fade-out')
|
|
91
|
-
}, 200)
|
|
92
|
-
|
|
93
|
-
this.$el.style.display = 'none'
|
|
91
|
+
}, 200)
|
|
94
92
|
}
|
|
95
93
|
|
|
96
94
|
setMaskClickHide (enable: boolean) {
|
|
97
95
|
this.maskClickHideEnable = enable
|
|
98
96
|
}
|
|
99
97
|
|
|
98
|
+
// Timers
|
|
99
|
+
private static actionTimers: {act: Function, tid: number}[] = []
|
|
100
|
+
|
|
101
|
+
private newActionTimer(func: Function, delay: number) {
|
|
102
|
+
const act = () => {
|
|
103
|
+
func() // 执行
|
|
104
|
+
Layer.actionTimers = Layer.actionTimers.filter(o => o.act !== act) // 删除
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const tid = window.setTimeout(() => act(), delay)
|
|
108
|
+
|
|
109
|
+
Layer.actionTimers.push({ act, tid })
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
private fireAllActionTimer() {
|
|
113
|
+
Layer.actionTimers.forEach(item => {
|
|
114
|
+
clearTimeout(item.tid)
|
|
115
|
+
item.act() // 立即执行
|
|
116
|
+
})
|
|
117
|
+
}
|
|
118
|
+
|
|
100
119
|
/** 销毁 - 无动画 */
|
|
101
120
|
disposeNow () {
|
|
102
121
|
document.body.style.overflow = ''
|