@waline/client 2.5.0 → 2.6.1

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 (50) hide show
  1. package/LICENSE +339 -0
  2. package/dist/component.esm.js +1 -1
  3. package/dist/component.esm.js.map +1 -1
  4. package/dist/component.js +1 -1
  5. package/dist/component.js.map +1 -1
  6. package/dist/legacy.d.ts +40 -0
  7. package/dist/legacy.js +1 -1
  8. package/dist/legacy.js.map +1 -1
  9. package/dist/pageview.cjs.js +1 -1
  10. package/dist/pageview.cjs.js.map +1 -1
  11. package/dist/pageview.esm.js +1 -1
  12. package/dist/pageview.esm.js.map +1 -1
  13. package/dist/pageview.js +1 -1
  14. package/dist/pageview.js.map +1 -1
  15. package/dist/shim.d.ts +41 -1
  16. package/dist/shim.esm.d.ts +41 -1
  17. package/dist/shim.esm.js +1 -1
  18. package/dist/shim.esm.js.map +1 -1
  19. package/dist/shim.js +1 -1
  20. package/dist/shim.js.map +1 -1
  21. package/dist/waline.cjs.d.ts +41 -1
  22. package/dist/waline.cjs.js +1 -1
  23. package/dist/waline.cjs.js.map +1 -1
  24. package/dist/waline.css +1 -1
  25. package/dist/waline.css.map +1 -1
  26. package/dist/waline.d.ts +41 -1
  27. package/dist/waline.esm.d.ts +41 -1
  28. package/dist/waline.esm.js +1 -1
  29. package/dist/waline.esm.js.map +1 -1
  30. package/dist/waline.js +1 -1
  31. package/dist/waline.js.map +1 -1
  32. package/package.json +31 -33
  33. package/src/comment.ts +7 -2
  34. package/src/components/CommentBox.vue +57 -63
  35. package/src/components/CommentCard.vue +1 -1
  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/init.ts +2 -10
  40. package/src/pageview.ts +7 -2
  41. package/src/styles/emoji.scss +112 -94
  42. package/src/styles/gif.scss +58 -139
  43. package/src/styles/index.scss +3 -0
  44. package/src/styles/panel.scss +0 -6
  45. package/src/typings/base.ts +40 -0
  46. package/src/typings/waline.ts +8 -0
  47. package/src/utils/config.ts +5 -2
  48. package/src/utils/index.ts +0 -2
  49. package/src/utils/fetchGif.ts +0 -62
  50. package/src/utils/throttle.ts +0 -16
@@ -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;
@@ -280,6 +314,12 @@ interface WalineProps {
280
314
  * @default ['//unpkg.com/@waline/emojis@1.0.1/weibo']
281
315
  */
282
316
  emoji?: (string | WalineEmojiInfo)[] | false;
317
+ /**
318
+ * 设置搜索功能
319
+ *
320
+ * Customize Search feature
321
+ */
322
+ search?: WalineSearchOptions | false;
283
323
  /**
284
324
  * 代码高亮
285
325
  *
@@ -526,4 +566,4 @@ interface WalineRecentCommentsResult {
526
566
  }
527
567
  declare const RecentComments: ({ el, serverURL, count, lang, }: WalineRecentCommentsOptions) => Promise<WalineRecentCommentsResult>;
528
568
 
529
- 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 };