@waline/client 2.13.0 → 2.14.0

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 (78) hide show
  1. package/LICENSE +339 -0
  2. package/dist/api.cjs +1 -1
  3. package/dist/api.cjs.map +1 -1
  4. package/dist/api.d.cts +302 -69
  5. package/dist/api.d.mts +302 -69
  6. package/dist/api.d.ts +302 -69
  7. package/dist/api.mjs +1 -1
  8. package/dist/api.mjs.map +1 -1
  9. package/dist/comment.cjs +1 -1
  10. package/dist/comment.cjs.map +1 -1
  11. package/dist/comment.d.cts +2 -2
  12. package/dist/comment.d.mts +2 -2
  13. package/dist/comment.d.ts +2 -2
  14. package/dist/comment.js +68 -1
  15. package/dist/comment.js.map +1 -1
  16. package/dist/comment.mjs +1 -1
  17. package/dist/comment.mjs.map +1 -1
  18. package/dist/component.mjs +1 -1
  19. package/dist/component.mjs.map +1 -1
  20. package/dist/legacy.umd.d.ts +21 -11
  21. package/dist/legacy.umd.js +1 -1
  22. package/dist/legacy.umd.js.map +1 -1
  23. package/dist/pageview.cjs +1 -1
  24. package/dist/pageview.cjs.map +1 -1
  25. package/dist/pageview.d.cts +1 -1
  26. package/dist/pageview.d.mts +1 -1
  27. package/dist/pageview.d.ts +1 -1
  28. package/dist/pageview.js +121 -1
  29. package/dist/pageview.js.map +1 -1
  30. package/dist/pageview.mjs +1 -1
  31. package/dist/pageview.mjs.map +1 -1
  32. package/dist/shim.cjs +1 -1
  33. package/dist/shim.cjs.map +1 -1
  34. package/dist/shim.d.cts +25 -19
  35. package/dist/shim.d.mts +25 -19
  36. package/dist/shim.mjs +1 -1
  37. package/dist/shim.mjs.map +1 -1
  38. package/dist/waline.cjs +1 -1
  39. package/dist/waline.cjs.map +1 -1
  40. package/dist/waline.css +1 -1
  41. package/dist/waline.css.map +1 -1
  42. package/dist/waline.d.cts +25 -19
  43. package/dist/waline.d.mts +25 -19
  44. package/dist/waline.d.ts +25 -19
  45. package/dist/waline.js +6787 -1
  46. package/dist/waline.js.map +1 -1
  47. package/dist/waline.mjs +1 -1
  48. package/dist/waline.mjs.map +1 -1
  49. package/package.json +28 -29
  50. package/src/api/articleCounter.ts +52 -22
  51. package/src/api/comment.ts +158 -55
  52. package/src/api/commentCount.ts +24 -21
  53. package/src/api/login.ts +49 -6
  54. package/src/api/pageview.ts +26 -13
  55. package/src/api/recentComment.ts +23 -10
  56. package/src/api/user.ts +24 -18
  57. package/src/api/utils.ts +33 -10
  58. package/src/comment.ts +1 -1
  59. package/src/compact/convert.ts +1 -1
  60. package/src/components/ArticleReaction.vue +12 -3
  61. package/src/components/CommentBox.vue +37 -29
  62. package/src/components/ImageWall.vue +14 -14
  63. package/src/components/Waline.vue +59 -49
  64. package/src/config/default.ts +23 -24
  65. package/src/pageview.ts +3 -3
  66. package/src/styles/index.scss +3 -3
  67. package/src/styles/{nomalize.scss → normalize.scss} +0 -0
  68. package/src/styles/panel.scss +1 -1
  69. package/src/styles/user-list.scss +158 -0
  70. package/src/typings/base.ts +5 -1
  71. package/src/typings/comment.ts +1 -5
  72. package/src/typings/waline.ts +13 -2
  73. package/src/utils/config.ts +2 -0
  74. package/src/utils/date.ts +3 -3
  75. package/src/utils/emoji.ts +1 -1
  76. package/src/widgets/recentComments.ts +2 -2
  77. package/src/widgets/userList.ts +8 -10
  78. package/src/styles/userlist.scss +0 -116
@@ -1,3 +1,4 @@
1
+ type WalineCommentSorting = 'latest' | 'oldest' | 'hottest';
1
2
  interface WalineEmojiInfo {
2
3
  /**
3
4
  * 选项卡上的 Emoji 名称
@@ -36,6 +37,7 @@ interface WalineEmojiInfo {
36
37
  */
37
38
  items: string[];
38
39
  }
40
+ type WalineLoginStatus = 'enable' | 'disable' | 'force';
39
41
  interface WalineSearchImageData extends Record<string, unknown> {
40
42
  /**
41
43
  * 图片链接
@@ -66,7 +68,7 @@ interface WalineSearchImageData extends Record<string, unknown> {
66
68
  */
67
69
  preview?: string;
68
70
  }
69
- declare type WalineSearchResult = WalineSearchImageData[];
71
+ type WalineSearchResult = WalineSearchImageData[];
70
72
  interface WalineSearchOptions {
71
73
  /**
72
74
  * 搜索操作
@@ -93,12 +95,12 @@ interface WalineSearchOptions {
93
95
  *
94
96
  * @default (word) => search(word)
95
97
  */
96
- more?: (word: string, currectCount: number) => Promise<WalineSearchResult>;
98
+ more?: (word: string, currentCount: number) => Promise<WalineSearchResult>;
97
99
  }
98
- declare type WalineMeta = 'nick' | 'mail' | 'link';
99
- declare type WalineImageUploader = (image: File) => Promise<string>;
100
- declare type WalineHighlighter = (code: string, lang: string) => string;
101
- declare type WalineTexRenderer = (blockMode: boolean, tex: string) => string;
100
+ type WalineMeta = 'nick' | 'mail' | 'link';
101
+ type WalineImageUploader = (image: File) => Promise<string>;
102
+ type WalineHighlighter = (code: string, lang: string) => string;
103
+ type WalineTexRenderer = (blockMode: boolean, tex: string) => string;
102
104
 
103
105
  interface WalineDateLocale {
104
106
  seconds: string;
@@ -107,7 +109,7 @@ interface WalineDateLocale {
107
109
  days: string;
108
110
  now: string;
109
111
  }
110
- declare type WalineLevelLocale = Record<`level${number}`, string>;
112
+ type WalineLevelLocale = Record<`level${number}`, string>;
111
113
  interface WalineReactionLocale {
112
114
  reactionTitle: string;
113
115
  reaction0: string;
@@ -273,6 +275,14 @@ interface WalineProps {
273
275
  * @see [I18n](https://waline.js.org/en/client/i18n.html)
274
276
  */
275
277
  locale?: Partial<WalineLocale>;
278
+ /**
279
+ * 评论列表排序方式
280
+ *
281
+ * Sorting method for comment list
282
+ *
283
+ * @default 'latest'
284
+ */
285
+ commentSorting?: WalineCommentSorting;
276
286
  /**
277
287
  * 是否启用暗黑模式适配
278
288
  *
@@ -330,12 +340,12 @@ interface WalineProps {
330
340
  * Login mode status, optional values:
331
341
  *
332
342
  * - `'enable'`: enable login (default)
333
- * - `'disable'`: Login is disabled, users should fill in infomation to comment
343
+ * - `'disable'`: Login is disabled, users should fill in information to comment
334
344
  * - `'force'`: Forced login, users must login to comment
335
345
  *
336
346
  * @default 'enable'
337
347
  */
338
- login?: 'enable' | 'disable' | 'force';
348
+ login?: WalineLoginStatus;
339
349
  /**
340
350
  * 是否在页脚展示版权信息
341
351
  *
@@ -424,8 +434,8 @@ interface WalineInstance {
424
434
  destroy: () => void;
425
435
  }
426
436
 
427
- declare type DeprecatedAvatar = '' | 'mp' | 'identicon' | 'monsterid' | 'wavatar' | 'retro' | 'robohash' | 'hide';
428
- declare type DeprecatedEmojiMaps = Record<string, string>;
437
+ type DeprecatedAvatar = '' | 'mp' | 'identicon' | 'monsterid' | 'wavatar' | 'retro' | 'robohash' | 'hide';
438
+ type DeprecatedEmojiMaps = Record<string, string>;
429
439
  interface DeprecatedValineOptions {
430
440
  /**
431
441
  * @deprecated Use `locale.placeholder` instead, dropped in V2