artalk 2.1.3 → 2.1.6

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 (62) hide show
  1. package/CNAME +1 -0
  2. package/dist/Artalk.css +1 -1
  3. package/dist/Artalk.es.js +509 -1571
  4. package/dist/Artalk.iife.js +1 -1
  5. package/dist/Artalk.js +1 -1
  6. package/index.html +143 -0
  7. package/package.json +8 -32
  8. package/postcss.config.js +5 -0
  9. package/src/api/index.ts +16 -3
  10. package/src/api/request.ts +4 -2
  11. package/src/artalk.ts +30 -8
  12. package/src/components/action-btn.ts +1 -1
  13. package/src/components/comment.ts +88 -3
  14. package/src/components/editor-plugs/emoticons-plug.less +21 -11
  15. package/src/components/editor-plugs/emoticons-plug.ts +18 -18
  16. package/src/components/editor-plugs/preview-plug.less +1 -1
  17. package/src/components/editor.ts +15 -20
  18. package/src/components/html/comment.html +6 -13
  19. package/src/components/html/editor.html +8 -9
  20. package/src/components/html/list.html +1 -1
  21. package/src/components/html/sidebar-layer.html +8 -0
  22. package/src/components/list-lite.ts +203 -299
  23. package/src/components/list.ts +11 -9
  24. package/src/components/pagination.ts +2 -2
  25. package/src/components/read-more-btn.ts +27 -4
  26. package/src/components/sidebar-layer.ts +143 -0
  27. package/src/defaults.ts +2 -1
  28. package/src/lib/detect.js +3 -1
  29. package/src/lib/utils.ts +27 -1
  30. package/src/style/_color.less +19 -23
  31. package/src/style/_extend.less +0 -80
  32. package/src/style/_variables.less +0 -24
  33. package/src/style/comment.less +191 -197
  34. package/src/style/editor.less +69 -94
  35. package/src/style/list.less +13 -13
  36. package/src/style/main.less +32 -32
  37. package/src/style/pagination.less +6 -6
  38. package/src/style/sidebar-layer.less +92 -0
  39. package/types/artalk-config.d.ts +4 -1
  40. package/types/artalk-data.d.ts +2 -2
  41. package/vite-common.config.ts +15 -0
  42. package/vite-demo.config.ts +14 -0
  43. package/vite.config.ts +36 -0
  44. package/LICENSE +0 -674
  45. package/README.md +0 -84
  46. package/src/components/admin/page-list.ts +0 -194
  47. package/src/components/admin/site-list-floater.ts +0 -98
  48. package/src/components/admin/site-list.ts +0 -289
  49. package/src/components/html/sidebar.html +0 -22
  50. package/src/components/item-text-editor.ts +0 -136
  51. package/src/components/sidebar-view.ts +0 -26
  52. package/src/components/sidebar-views/comments-view.ts +0 -74
  53. package/src/components/sidebar-views/pages-view.ts +0 -61
  54. package/src/components/sidebar-views/setting-view.ts +0 -21
  55. package/src/components/sidebar-views/sites-view.ts +0 -36
  56. package/src/components/sidebar-views/transfer-view.ts +0 -218
  57. package/src/components/sidebar.ts +0 -293
  58. package/src/lib/md5.js +0 -6
  59. package/src/style/item-text-editor.less +0 -35
  60. package/src/style/page-list.less +0 -50
  61. package/src/style/sidebar.less +0 -420
  62. package/src/style/site-list.less +0 -208
@@ -64,8 +64,8 @@ export interface ListData {
64
64
  /** 评论数据 */
65
65
  comments: CommentData[]
66
66
 
67
- /** 父级评论总数 */
68
- total_parents: number
67
+ /** 根评论总数 */
68
+ total_roots: number
69
69
 
70
70
  /** 评论总数(包括所有子评论) */
71
71
  total: number
@@ -0,0 +1,15 @@
1
+ import { UserConfigExport } from 'vite'
2
+ import { version } from './package.json'
3
+
4
+ export default {
5
+ define: {
6
+ ARTALK_VERSION: JSON.stringify(version)
7
+ },
8
+ css: {
9
+ preprocessorOptions: {
10
+ less: {
11
+ additionalData: `@import "./src/style/_variables.less";@import "./src/style/_extend.less";`
12
+ },
13
+ },
14
+ },
15
+ } as UserConfigExport
@@ -0,0 +1,14 @@
1
+ import { defineConfig } from 'vite'
2
+ import { resolve } from 'path'
3
+ import commonConf from './vite-common.config'
4
+ import tsconfigPaths from 'vite-tsconfig-paths'
5
+
6
+ export default defineConfig({
7
+ build: {
8
+ target: 'esnext',
9
+ outDir: resolve(__dirname, "deploy"),
10
+ rollupOptions: {}
11
+ },
12
+ plugins: [tsconfigPaths()],
13
+ ...commonConf
14
+ })
package/vite.config.ts ADDED
@@ -0,0 +1,36 @@
1
+ import { defineConfig } from 'vite'
2
+ import { resolve } from 'path'
3
+ import commonConf from './vite-common.config'
4
+ import tsconfigPaths from 'vite-tsconfig-paths'
5
+
6
+ export default defineConfig({
7
+ build: {
8
+ target: 'es2015',
9
+ outDir: resolve(__dirname, "dist"),
10
+ minify: 'terser',
11
+ lib: {
12
+ entry: resolve(__dirname, 'src/main.ts'),
13
+ name: 'Artalk',
14
+ fileName: (format) => ((format == "umd") ? 'Artalk.js' : `Artalk.${format}.js`),
15
+ formats: ["es", "umd", "iife"]
16
+ },
17
+ rollupOptions: {
18
+ // 确保外部化处理那些你不想打包进库的依赖
19
+ external: ['vue'],
20
+ output: {
21
+ assetFileNames: assetInfo => {
22
+ if (/\.css$/.test(assetInfo.name)) {
23
+ return 'Artalk.css'
24
+ }
25
+ return "[name].[ext]"
26
+ },
27
+ // 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量
28
+ globals: {
29
+ vue: 'Vue'
30
+ }
31
+ }
32
+ }
33
+ },
34
+ plugins: [tsconfigPaths()],
35
+ ...commonConf
36
+ })