@waline/client 2.4.2 → 2.6.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 (57) hide show
  1. package/dist/component.esm.js +1 -1
  2. package/dist/component.esm.js.map +1 -1
  3. package/dist/component.js +1 -1
  4. package/dist/component.js.map +1 -1
  5. package/dist/legacy.d.ts +42 -0
  6. package/dist/legacy.js +1 -1
  7. package/dist/legacy.js.map +1 -1
  8. package/dist/pageview.cjs.js +1 -1
  9. package/dist/pageview.cjs.js.map +1 -1
  10. package/dist/pageview.esm.js +1 -1
  11. package/dist/pageview.esm.js.map +1 -1
  12. package/dist/pageview.js +1 -1
  13. package/dist/pageview.js.map +1 -1
  14. package/dist/shim.d.ts +43 -1
  15. package/dist/shim.esm.d.ts +43 -1
  16. package/dist/shim.esm.js +1 -1
  17. package/dist/shim.esm.js.map +1 -1
  18. package/dist/shim.js +1 -1
  19. package/dist/shim.js.map +1 -1
  20. package/dist/waline.cjs.d.ts +43 -1
  21. package/dist/waline.cjs.js +1 -1
  22. package/dist/waline.cjs.js.map +1 -1
  23. package/dist/waline.css +1 -1
  24. package/dist/waline.css.map +1 -1
  25. package/dist/waline.d.ts +43 -1
  26. package/dist/waline.esm.d.ts +43 -1
  27. package/dist/waline.esm.js +1 -1
  28. package/dist/waline.esm.js.map +1 -1
  29. package/dist/waline.js +1 -1
  30. package/dist/waline.js.map +1 -1
  31. package/package.json +21 -22
  32. package/src/comment.ts +7 -2
  33. package/src/components/CommentBox.vue +121 -4
  34. package/src/components/CommentCard.vue +1 -1
  35. package/src/components/Icons.ts +20 -0
  36. package/src/components/ImageWall.vue +166 -0
  37. package/src/composables/like.ts +1 -1
  38. package/src/config/default.ts +91 -1
  39. package/src/config/i18n/en.ts +2 -0
  40. package/src/config/i18n/generate.ts +2 -0
  41. package/src/config/i18n/jp.ts +8 -0
  42. package/src/config/i18n/pt-BR.ts +8 -0
  43. package/src/config/i18n/ru.ts +8 -0
  44. package/src/config/i18n/vi-VN.ts +8 -0
  45. package/src/config/i18n/zh-CN.ts +2 -0
  46. package/src/config/i18n/zh-TW.ts +2 -0
  47. package/src/init.ts +0 -3
  48. package/src/pageview.ts +2 -1
  49. package/src/styles/card.scss +1 -0
  50. package/src/styles/emoji.scss +112 -94
  51. package/src/styles/gif.scss +70 -0
  52. package/src/styles/index.scss +3 -0
  53. package/src/styles/panel.scss +0 -4
  54. package/src/typings/base.ts +40 -0
  55. package/src/typings/locale.ts +2 -0
  56. package/src/typings/waline.ts +8 -0
  57. package/src/utils/config.ts +5 -2
@@ -37,6 +37,40 @@ interface WalineEmojiInfo {
37
37
  items: string[];
38
38
  }
39
39
  declare type WalineEmojiMaps = Record<string, string>;
40
+ interface WalineSearchResult extends Record<string, unknown> {
41
+ /**
42
+ * Image link
43
+ */
44
+ src: string;
45
+ /**
46
+ * Image title, optional
47
+ */
48
+ title?: string;
49
+ /**
50
+ * Image preview link, optional
51
+ *
52
+ * @default src
53
+ */
54
+ preview?: string;
55
+ }
56
+ interface WalineSearchOptions {
57
+ /**
58
+ * Search action
59
+ */
60
+ search: (word: string) => Promise<WalineSearchResult[]>;
61
+ /**
62
+ * Default search action
63
+ *
64
+ * @default () => search('')
65
+ */
66
+ default?: () => Promise<WalineSearchResult[]>;
67
+ /**
68
+ * Fetch more action
69
+ *
70
+ * @default (word) => search(word)
71
+ */
72
+ more?: (word: string, currectCount: number) => Promise<WalineSearchResult[]>;
73
+ }
40
74
  declare type WalineMeta = 'nick' | 'mail' | 'link';
41
75
  declare type WalineImageUploader = (image: File) => Promise<string>;
42
76
  declare type WalineHighlighter = (code: string, lang: string) => string;
@@ -145,6 +179,8 @@ interface WalineLocale extends WalineDateLocale, WalineLevelLocale {
145
179
  word: string;
146
180
  wordHint: string;
147
181
  anonymous: string;
182
+ gif: string;
183
+ gifSearchPlaceholder: string;
148
184
  }
149
185
 
150
186
  interface WalineProps {
@@ -278,6 +314,12 @@ interface WalineProps {
278
314
  * @default ['//unpkg.com/@waline/emojis@1.0.1/weibo']
279
315
  */
280
316
  emoji?: (string | WalineEmojiInfo)[] | false;
317
+ /**
318
+ * 设置搜索功能
319
+ *
320
+ * Customize Search feature
321
+ */
322
+ search?: WalineSearchOptions | false;
281
323
  /**
282
324
  * 代码高亮
283
325
  *
@@ -524,4 +566,4 @@ interface WalineRecentCommentsResult {
524
566
  }
525
567
  declare const RecentComments: ({ el, serverURL, count, lang, }: WalineRecentCommentsOptions) => Promise<WalineRecentCommentsResult>;
526
568
 
527
- export { RecentComments, WalineAbort, WalineComment, WalineCommentCountOptions, WalineCommentData, WalineCommentStatus, WalineDateLocale, WalineEmojiInfo, WalineEmojiMaps, WalineHighlighter, WalineImageUploader, WalineInitOptions, WalineInstance, WalineLevelLocale, WalineLocale, WalineMeta, WalinePageviewCountOptions, WalineProps, WalineRecentCommentsOptions, WalineRecentCommentsResult, WalineTexRenderer, commentCount, defaultLocales, init, pageviewCount, version };
569
+ export { RecentComments, WalineAbort, WalineComment, WalineCommentCountOptions, WalineCommentData, WalineCommentStatus, WalineDateLocale, WalineEmojiInfo, WalineEmojiMaps, WalineHighlighter, WalineImageUploader, WalineInitOptions, WalineInstance, WalineLevelLocale, WalineLocale, WalineMeta, WalinePageviewCountOptions, WalineProps, WalineRecentCommentsOptions, WalineRecentCommentsResult, WalineSearchOptions, WalineSearchResult, WalineTexRenderer, commentCount, defaultLocales, init, pageviewCount, version };