@waline/client 2.5.1 → 2.6.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 (59) 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 +41 -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 +42 -1
  15. package/dist/shim.esm.d.ts +42 -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 +42 -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 +42 -1
  26. package/dist/waline.esm.d.ts +42 -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 +31 -32
  32. package/src/comment.ts +7 -2
  33. package/src/components/CommentBox.vue +88 -71
  34. package/src/components/CommentCard.vue +19 -17
  35. package/src/components/ImageWall.vue +34 -22
  36. package/src/composables/userInfo.ts +1 -1
  37. package/src/config/default.ts +93 -1
  38. package/src/config/i18n/en.ts +1 -0
  39. package/src/config/i18n/generate.ts +1 -0
  40. package/src/config/i18n/jp.ts +1 -0
  41. package/src/config/i18n/pt-BR.ts +1 -0
  42. package/src/config/i18n/ru.ts +1 -0
  43. package/src/config/i18n/vi-VN.ts +1 -0
  44. package/src/config/i18n/zh-CN.ts +1 -0
  45. package/src/config/i18n/zh-TW.ts +3 -2
  46. package/src/init.ts +0 -4
  47. package/src/pageview.ts +7 -2
  48. package/src/styles/emoji.scss +23 -0
  49. package/src/styles/gif.scss +6 -5
  50. package/src/typings/base.ts +40 -0
  51. package/src/typings/locale.ts +1 -0
  52. package/src/typings/waline.ts +8 -0
  53. package/src/utils/config.ts +5 -2
  54. package/src/utils/fetch.ts +3 -0
  55. package/src/utils/index.ts +0 -2
  56. package/src/utils/markedMathExtension.ts +1 -0
  57. package/LICENSE +0 -339
  58. package/src/utils/fetchGif.ts +0 -63
  59. package/src/utils/throttle.ts +0 -15
@@ -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;
@@ -147,6 +181,7 @@ interface WalineLocale extends WalineDateLocale, WalineLevelLocale {
147
181
  anonymous: string;
148
182
  gif: string;
149
183
  gifSearchPlaceholder: string;
184
+ profile: string;
150
185
  }
151
186
 
152
187
  interface WalineProps {
@@ -280,6 +315,12 @@ interface WalineProps {
280
315
  * @default ['//unpkg.com/@waline/emojis@1.0.1/weibo']
281
316
  */
282
317
  emoji?: (string | WalineEmojiInfo)[] | false;
318
+ /**
319
+ * 设置搜索功能
320
+ *
321
+ * Customize Search feature
322
+ */
323
+ search?: WalineSearchOptions | false;
283
324
  /**
284
325
  * 代码高亮
285
326
  *
@@ -526,4 +567,4 @@ interface WalineRecentCommentsResult {
526
567
  }
527
568
  declare const RecentComments: ({ el, serverURL, count, lang, }: WalineRecentCommentsOptions) => Promise<WalineRecentCommentsResult>;
528
569
 
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 };
570
+ 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 };