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.
Files changed (175) hide show
  1. package/README.md +1 -1
  2. package/dist/Artalk.css +1 -1
  3. package/dist/Artalk.es.js +209 -188
  4. package/dist/Artalk.es.js.map +1 -0
  5. package/dist/Artalk.iife.js +2 -1
  6. package/dist/Artalk.iife.js.map +1 -0
  7. package/dist/Artalk.js +2 -1
  8. package/dist/Artalk.js.map +1 -0
  9. package/dist/ArtalkLite.css +1 -1
  10. package/dist/ArtalkLite.es.js +209 -188
  11. package/dist/ArtalkLite.es.js.map +1 -0
  12. package/dist/ArtalkLite.iife.js +2 -1
  13. package/dist/ArtalkLite.iife.js.map +1 -0
  14. package/dist/ArtalkLite.js +2 -1
  15. package/dist/ArtalkLite.js.map +1 -0
  16. package/dist/i18n/jp.js +1 -1
  17. package/dist/i18n/zh-TW.js +1 -1
  18. package/dist/src/api/_base.d.ts +7 -0
  19. package/dist/src/api/_options.d.ts +5 -0
  20. package/dist/src/artalk.d.ts +0 -2
  21. package/dist/src/components/checker/index.d.ts +2 -0
  22. package/dist/src/i18n/en.d.ts +4 -0
  23. package/dist/src/i18n/external.d.ts +4 -0
  24. package/dist/src/i18n/index.d.ts +12 -0
  25. package/dist/src/i18n/jp.d.ts +4 -0
  26. package/dist/src/i18n/zh-TW.d.ts +4 -0
  27. package/dist/src/lib/user.d.ts +8 -6
  28. package/dist/src/main.d.ts +3 -0
  29. package/dist/src/plugins/editor/_kit.d.ts +7 -1
  30. package/dist/src/service.d.ts +2 -8
  31. package/dist/types/event.d.ts +1 -1
  32. package/package.json +43 -17
  33. package/dist/src/components/dark-mode.d.ts +0 -2
  34. package/src/api/_base.ts +0 -18
  35. package/src/api/_options.ts +0 -25
  36. package/src/api/_request.ts +0 -104
  37. package/src/api/admin.ts +0 -18
  38. package/src/api/captcha.ts +0 -24
  39. package/src/api/comment.ts +0 -84
  40. package/src/api/index.ts +0 -29
  41. package/src/api/page.ts +0 -83
  42. package/src/api/site.ts +0 -51
  43. package/src/api/system.ts +0 -49
  44. package/src/api/upload.ts +0 -28
  45. package/src/api/user.ts +0 -132
  46. package/src/artalk.ts +0 -119
  47. package/src/comment/actions.ts +0 -83
  48. package/src/comment/comment.html +0 -18
  49. package/src/comment/comment.ts +0 -192
  50. package/src/comment/height-limit.ts +0 -100
  51. package/src/comment/index.ts +0 -3
  52. package/src/comment/render.ts +0 -150
  53. package/src/comment/renders/actions.ts +0 -114
  54. package/src/comment/renders/avatar.ts +0 -22
  55. package/src/comment/renders/content.ts +0 -39
  56. package/src/comment/renders/header.ts +0 -84
  57. package/src/comment/renders/index.ts +0 -19
  58. package/src/comment/renders/pending.ts +0 -12
  59. package/src/comment/renders/reply-at.ts +0 -16
  60. package/src/comment/renders/reply-to.ts +0 -24
  61. package/src/components/action-btn.ts +0 -170
  62. package/src/components/checker/admin.ts +0 -37
  63. package/src/components/checker/captcha-renders.ts +0 -69
  64. package/src/components/checker/captcha.ts +0 -26
  65. package/src/components/checker/index.ts +0 -192
  66. package/src/components/dark-mode.ts +0 -30
  67. package/src/components/dialog.ts +0 -62
  68. package/src/components/error-dialog.ts +0 -35
  69. package/src/components/pagination.ts +0 -153
  70. package/src/components/read-more-btn.ts +0 -92
  71. package/src/config.ts +0 -119
  72. package/src/context.ts +0 -146
  73. package/src/data.ts +0 -110
  74. package/src/defaults.ts +0 -61
  75. package/src/editor/editor.html +0 -18
  76. package/src/editor/editor.ts +0 -114
  77. package/src/editor/state.ts +0 -52
  78. package/src/editor/ui.ts +0 -36
  79. package/src/i18n/en.ts +0 -81
  80. package/src/i18n/external.ts +0 -10
  81. package/src/i18n/index.ts +0 -67
  82. package/src/i18n/jp.ts +0 -83
  83. package/src/i18n/zh-CN.ts +0 -85
  84. package/src/i18n/zh-TW.ts +0 -83
  85. package/src/layer/index.ts +0 -4
  86. package/src/layer/layer-manager.ts +0 -32
  87. package/src/layer/layer.ts +0 -39
  88. package/src/layer/scrollbar-helper.ts +0 -24
  89. package/src/layer/sidebar-layer.html +0 -8
  90. package/src/layer/sidebar-layer.ts +0 -155
  91. package/src/layer/wrap.ts +0 -77
  92. package/src/lib/component.ts +0 -12
  93. package/src/lib/detect.ts +0 -222
  94. package/src/lib/event-manager.ts +0 -47
  95. package/src/lib/highlight.ts +0 -5
  96. package/src/lib/marked-renderer.ts +0 -32
  97. package/src/lib/marked.ts +0 -72
  98. package/src/lib/sanitizer.ts +0 -57
  99. package/src/lib/ui.ts +0 -193
  100. package/src/lib/user.ts +0 -55
  101. package/src/lib/utils.ts +0 -236
  102. package/src/list/comment.ts +0 -20
  103. package/src/list/layout.ts +0 -120
  104. package/src/list/list.html +0 -20
  105. package/src/list/list.ts +0 -79
  106. package/src/list/nest.ts +0 -66
  107. package/src/list/page.ts +0 -97
  108. package/src/list/paginator/index.ts +0 -25
  109. package/src/list/paginator/read-more.ts +0 -67
  110. package/src/list/paginator/up-down.ts +0 -51
  111. package/src/main.ts +0 -5
  112. package/src/plugins/admin-only-elem.ts +0 -40
  113. package/src/plugins/conf-remoter.ts +0 -54
  114. package/src/plugins/dark-mode.ts +0 -12
  115. package/src/plugins/editor/_kit.ts +0 -57
  116. package/src/plugins/editor/_plug.ts +0 -60
  117. package/src/plugins/editor/_sample.ts +0 -8
  118. package/src/plugins/editor/closable.ts +0 -44
  119. package/src/plugins/editor/emoticons.scss +0 -72
  120. package/src/plugins/editor/emoticons.ts +0 -293
  121. package/src/plugins/editor/header-event.ts +0 -35
  122. package/src/plugins/editor/header-link.ts +0 -31
  123. package/src/plugins/editor/header-user.ts +0 -98
  124. package/src/plugins/editor/index.ts +0 -40
  125. package/src/plugins/editor/local-storage.ts +0 -36
  126. package/src/plugins/editor/mover.ts +0 -29
  127. package/src/plugins/editor/preview.scss +0 -7
  128. package/src/plugins/editor/preview.ts +0 -41
  129. package/src/plugins/editor/state-edit.ts +0 -116
  130. package/src/plugins/editor/state-reply.ts +0 -91
  131. package/src/plugins/editor/submit-add.ts +0 -33
  132. package/src/plugins/editor/submit-btn.ts +0 -25
  133. package/src/plugins/editor/submit.ts +0 -73
  134. package/src/plugins/editor/textarea.ts +0 -55
  135. package/src/plugins/editor/upload.ts +0 -145
  136. package/src/plugins/editor-kit.ts +0 -161
  137. package/src/plugins/index.ts +0 -16
  138. package/src/plugins/list/copyright.ts +0 -16
  139. package/src/plugins/list/count.ts +0 -31
  140. package/src/plugins/list/dropdown.ts +0 -95
  141. package/src/plugins/list/error-dialog.ts +0 -22
  142. package/src/plugins/list/fetch.ts +0 -64
  143. package/src/plugins/list/goto-first.ts +0 -23
  144. package/src/plugins/list/goto.ts +0 -72
  145. package/src/plugins/list/index.ts +0 -25
  146. package/src/plugins/list/loading.ts +0 -17
  147. package/src/plugins/list/no-comment.ts +0 -25
  148. package/src/plugins/list/reach-bottom.ts +0 -46
  149. package/src/plugins/list/sidebar-btn.ts +0 -39
  150. package/src/plugins/list/time-ticking.ts +0 -22
  151. package/src/plugins/list/unread-badge.ts +0 -26
  152. package/src/plugins/list/unread.ts +0 -38
  153. package/src/plugins/list/with-editor.ts +0 -59
  154. package/src/plugins/markdown.ts +0 -10
  155. package/src/plugins/stat.ts +0 -79
  156. package/src/plugins/version-check.ts +0 -37
  157. package/src/service.ts +0 -91
  158. package/src/style/_color.scss +0 -41
  159. package/src/style/_extend.scss +0 -20
  160. package/src/style/_variables.scss +0 -3
  161. package/src/style/comment.scss +0 -360
  162. package/src/style/editor.scss +0 -194
  163. package/src/style/list.scss +0 -212
  164. package/src/style/main.scss +0 -486
  165. package/src/style/pagination.scss +0 -58
  166. package/src/style/sidebar-layer.scss +0 -92
  167. package/types/config.ts +0 -153
  168. package/types/context.ts +0 -84
  169. package/types/data.ts +0 -271
  170. package/types/editor.ts +0 -95
  171. package/types/event.ts +0 -40
  172. package/types/global.d.ts +0 -1
  173. package/types/index.ts +0 -7
  174. package/types/plugin.ts +0 -3
  175. package/types/sidebar.ts +0 -3
package/types/editor.ts DELETED
@@ -1,95 +0,0 @@
1
- import type { CommentData, NotifyLevel } from '.'
2
- import type Component from '../src/lib/component'
3
- import type { EditorUI } from '../src/editor/ui'
4
-
5
- export type EditorState = 'reply' | 'edit' | 'normal'
6
-
7
- export interface EditorApi extends Component {
8
- getUI(): EditorUI
9
-
10
- /**
11
- * Get the header input elements
12
- */
13
- getHeaderInputEls(): Record<string, HTMLInputElement>
14
-
15
- /**
16
- * Set content
17
- */
18
- setContent(val: string): void
19
-
20
- /**
21
- * Insert content
22
- */
23
- insertContent(val: string): void
24
-
25
- /**
26
- * Get the final content
27
- *
28
- * This function returns the raw content or the content transformed through a plugin hook.
29
- */
30
- getContentFinal(): string
31
-
32
- /**
33
- * Get the raw content which is inputed by user
34
- */
35
- getContentRaw(): string
36
-
37
- /**
38
- * Get the HTML format content which is rendered by marked (a markdown parser)
39
- */
40
- getContentMarked(): string
41
-
42
- /**
43
- * Get editor current state
44
- */
45
- getState(): EditorState
46
-
47
- /**
48
- * Focus editor
49
- */
50
- focus(): void
51
-
52
- /**
53
- * Reset editor
54
- */
55
- reset(): void
56
-
57
- /**
58
- * Reset editor UI
59
- *
60
- * call it will move editor to the initial position
61
- */
62
- resetState(): void
63
-
64
- /**
65
- * Submit comment
66
- */
67
- submit(): void
68
-
69
- /**
70
- * Show notification message
71
- */
72
- showNotify(msg: string, type: NotifyLevel): void
73
-
74
- /**
75
- * Show loading on editor
76
- */
77
- showLoading(): void
78
-
79
- /**
80
- * Hide loading on editor
81
- */
82
- hideLoading(): void
83
-
84
- /**
85
- * Start replaying a comment
86
- */
87
- setReply(commentData: CommentData, $comment: HTMLElement, scroll?: boolean): void
88
-
89
- /**
90
- * Start editing a comment
91
- */
92
- setEditComment(commentData: CommentData, $comment: HTMLElement): void
93
- }
94
-
95
- export default EditorApi
package/types/event.ts DELETED
@@ -1,40 +0,0 @@
1
- import type Comment from '~/src/comment'
2
- import { CommentData, ListData, ListFetchParams, NotifyData, PageData } from './data'
3
- import { ArtalkConfig, LocalUser } from './config'
4
-
5
- interface ErrorData { msg: string, data?: any }
6
- interface ListFetchedArgs { params: Partial<ListFetchParams>, data?: ListData, error?: ErrorData }
7
-
8
- /** EventName to EventPayload Type */
9
- export interface EventPayloadMap {
10
- 'inited': undefined // Artalk 初始化后
11
- 'destroy': undefined // Artalk 销毁时
12
- 'list-fetch': Partial<ListFetchParams> // 评论列表请求时
13
- 'list-fetched': ListFetchedArgs // 评论列表请求后
14
- 'list-load': CommentData[] // 评论装载前
15
-
16
- // TODO merge 'list-loaded' and 'list-error', for purpose of `once` 'list-loaded' and simplify
17
- // example need bind 'list-loaded' and 'list-error' to same handler
18
- // consider name it to 'list-fetched': { data: CommentData[], error?: { msg: string, data?: any } }
19
- // and remove `list-load`
20
- 'list-loaded': CommentData[] // 评论装载后
21
- 'list-error': ErrorData // 评论加载错误时
22
-
23
- 'list-goto-first': undefined // 评论列表归位时
24
- 'list-reach-bottom': undefined // 评论列表滚动到底部时
25
-
26
- 'comment-inserted': CommentData // 评论插入后
27
- 'comment-updated': CommentData // 评论更新后
28
- 'comment-deleted': CommentData // 评论删除后
29
- 'comment-rendered': Comment // 评论节点渲染后
30
- 'unreads-updated': NotifyData[] // 未读消息变更时
31
- 'list-goto': number // 评论跳转时
32
- 'page-loaded': PageData // 页面数据更新后
33
- 'editor-submit': undefined // 编辑器提交时
34
- 'editor-submitted': undefined // 编辑器提交后
35
- 'user-changed': LocalUser // 本地用户数据变更时
36
- 'conf-loaded': ArtalkConfig // Artalk 配置变更时
37
- 'dark-mode-changed': boolean // 深色模式变更时
38
- 'sidebar-show': undefined // 侧边栏显示
39
- 'sidebar-hide': undefined // 侧边栏隐藏
40
- }
package/types/global.d.ts DELETED
@@ -1 +0,0 @@
1
- declare const ARTALK_LITE: boolean
package/types/index.ts DELETED
@@ -1,7 +0,0 @@
1
- export * from './config'
2
- export * from './data'
3
- export * from './context'
4
- export * from './editor'
5
- export * from './event'
6
- export * from './plugin'
7
- export * from './sidebar'
package/types/plugin.ts DELETED
@@ -1,3 +0,0 @@
1
- import { ContextApi } from './context'
2
-
3
- export type ArtalkPlugin = (ctx: ContextApi) => void
package/types/sidebar.ts DELETED
@@ -1,3 +0,0 @@
1
- export interface SidebarShowPayload {
2
- view?: 'comments'|'sites'|'pages'|'transfer'
3
- }