@waline/client 2.0.6 → 2.1.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 (52) hide show
  1. package/dist/component.js +1 -1
  2. package/dist/component.js.map +1 -1
  3. package/dist/legacy.d.ts +9 -7
  4. package/dist/legacy.js +1 -1
  5. package/dist/legacy.js.map +1 -1
  6. package/dist/pageview.cjs.js +1 -1
  7. package/dist/pageview.cjs.js.map +1 -1
  8. package/dist/pageview.d.ts +9 -1
  9. package/dist/pageview.esm.js +1 -1
  10. package/dist/pageview.esm.js.map +1 -1
  11. package/dist/pageview.js +1 -1
  12. package/dist/pageview.js.map +1 -1
  13. package/dist/shim.d.ts +38 -11
  14. package/dist/shim.esm.d.ts +38 -11
  15. package/dist/shim.esm.js +1 -1
  16. package/dist/shim.esm.js.map +1 -1
  17. package/dist/shim.js +1 -1
  18. package/dist/shim.js.map +1 -1
  19. package/dist/waline.cjs.d.ts +38 -11
  20. package/dist/waline.cjs.js +1 -1
  21. package/dist/waline.cjs.js.map +1 -1
  22. package/dist/waline.css +1 -1
  23. package/dist/waline.css.map +1 -1
  24. package/dist/waline.d.ts +38 -11
  25. package/dist/waline.esm.d.ts +38 -11
  26. package/dist/waline.esm.js +1 -1
  27. package/dist/waline.esm.js.map +1 -1
  28. package/dist/waline.js +1 -1
  29. package/dist/waline.js.map +1 -1
  30. package/package.json +23 -6
  31. package/src/comment.ts +11 -0
  32. package/src/components/CommentBox.vue +14 -8
  33. package/src/components/CommentCard.vue +5 -0
  34. package/src/components/Waline.vue +21 -40
  35. package/src/composables/timeAgo.ts +2 -48
  36. package/src/config/i18n/en.ts +6 -0
  37. package/src/config/i18n/generate.ts +6 -0
  38. package/src/config/i18n/zh-CN.ts +6 -0
  39. package/src/config/i18n/zh-TW.ts +6 -0
  40. package/src/entrys/legacy.ts +1 -1
  41. package/src/pageview.ts +12 -1
  42. package/src/styles/card.scss +4 -4
  43. package/src/styles/config.scss +2 -2
  44. package/src/styles/layout.scss +3 -3
  45. package/src/typings/comment.ts +1 -0
  46. package/src/typings/locale.ts +9 -6
  47. package/src/typings/waline.ts +1 -1
  48. package/src/utils/config.ts +1 -2
  49. package/src/utils/date.ts +54 -0
  50. package/src/utils/emoji.ts +2 -2
  51. package/src/utils/fetch.ts +20 -7
  52. package/src/widgets/recentComments.ts +11 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@waline/client",
3
- "version": "2.0.6",
3
+ "version": "2.1.1",
4
4
  "description": "client for waline comment system",
5
5
  "keywords": [
6
6
  "valine",
@@ -24,9 +24,23 @@
24
24
  "require": "./dist/shim.js",
25
25
  "default": "./dist/shim.js"
26
26
  },
27
- "./dist": "./dist/shim.js",
27
+ "./dist": {
28
+ "import": "./dist/shim.esm.js",
29
+ "require": "./dist/shim.js",
30
+ "default": "./dist/shim.js"
31
+ },
32
+ "./dist/pageview": {
33
+ "import": "./dist/pageview.esm.js",
34
+ "require": "./dist/pageview.cjs.js",
35
+ "default": "./dist/pageview.js"
36
+ },
37
+ "./dist/waline": {
38
+ "import": "./dist/waline.esm.js",
39
+ "require": "./dist/waline.cjs.js",
40
+ "default": "./dist/waline.js"
41
+ },
28
42
  "./dist/waline.css": "./dist/waline.css",
29
- "./dist/*": "./dist/*.js",
43
+ "./dist/*": "./dist/*",
30
44
  "./src/*": "./src/*",
31
45
  "./package.json": "./package.json"
32
46
  },
@@ -40,9 +54,10 @@
40
54
  "scripts": {
41
55
  "build": "npm run rollup && npm run style",
42
56
  "clean": "rimraf ./dist",
57
+ "dev": "vite -c config/vite.config.js",
43
58
  "lint": "eslint --ext .ts,.vue .",
44
59
  "prepublish": "npm run clean && npm run build",
45
- "rollup": "rollup -c ./scripts/rollup.config.js",
60
+ "rollup": "rollup -c ./config/rollup.config.js",
46
61
  "style": "sass ./src/styles/index.scss ./dist/waline.css --style=compressed"
47
62
  },
48
63
  "browserslist": {
@@ -63,12 +78,14 @@
63
78
  "@vueuse/core": "^8.3.1",
64
79
  "autosize": "^5.0.1",
65
80
  "hanabi": "^0.4.0",
66
- "marked": "^4.0.14",
81
+ "marked": "^4.0.15",
67
82
  "vue": "^3.2.33"
68
83
  },
69
84
  "devDependencies": {
70
85
  "@types/autosize": "^4.0.1",
71
- "@types/marked": "^4.0.3"
86
+ "@types/marked": "^4.0.3",
87
+ "@vitejs/plugin-vue": "^2.3.1",
88
+ "vite": "^2.9.6"
72
89
  },
73
90
  "engines": {
74
91
  "node": ">=12.20.0"
package/src/comment.ts CHANGED
@@ -27,12 +27,22 @@ export interface WalineCommentCountOptions {
27
27
  * @default window.location.pathname
28
28
  */
29
29
  path?: string;
30
+
31
+ /**
32
+ * 错误提示消息所使用的语言
33
+ *
34
+ * Language of error message
35
+ *
36
+ * @default 'zh-CN'
37
+ */
38
+ lang?: string;
30
39
  }
31
40
 
32
41
  export const commentCount = ({
33
42
  serverURL,
34
43
  path = window.location.pathname,
35
44
  selector = '.waline-comment-count',
45
+ lang = 'zh-CN',
36
46
  }: // eslint-disable-next-line @typescript-eslint/no-explicit-any
37
47
  WalineCommentCountOptions): WalineAbort => {
38
48
  const controller = new AbortController();
@@ -48,6 +58,7 @@ WalineCommentCountOptions): WalineAbort => {
48
58
  paths: Array.from(elements).map((element) =>
49
59
  decodePath(element.dataset.path || element.getAttribute('id') || path)
50
60
  ),
61
+ lang,
51
62
  signal: controller.signal,
52
63
  token: userInfo.value?.token,
53
64
  })
@@ -78,6 +78,7 @@
78
78
  </a>
79
79
 
80
80
  <button
81
+ v-show="emoji.tabs.length"
81
82
  ref="emojiButtonRef"
82
83
  class="wl-action"
83
84
  :class="{ actived: showEmoji }"
@@ -395,16 +396,19 @@ export default defineComponent({
395
396
  if (login === 'force') return;
396
397
 
397
398
  // check nick
398
- if (
399
- (requiredMeta.indexOf('nick') > -1 || comment.nick) &&
400
- !comment.nick
401
- ) {
399
+ if (requiredMeta.indexOf('nick') > -1 && !comment.nick) {
402
400
  inputRefs.value.nick?.focus();
403
401
  return alert(locale.value.nickError);
404
402
  }
405
403
 
406
404
  // check mail
407
- if (requiredMeta.indexOf('mail') > -1 && !comment.mail) {
405
+ if (
406
+ (requiredMeta.indexOf('mail') > -1 && !comment.mail) ||
407
+ (comment.mail &&
408
+ !/^\w(?:[\w._-]*\w)?@(?:\w(?:[\w-]*\w)?\.){0,2}\w+$/.exec(
409
+ comment.mail
410
+ ))
411
+ ) {
408
412
  inputRefs.value.mail?.focus();
409
413
  return alert(locale.value.mailError);
410
414
  }
@@ -602,9 +606,11 @@ export default defineComponent({
602
606
  watch(
603
607
  () => config.value.emoji,
604
608
  (emojiConfig) =>
605
- getEmojis(emojiConfig).then((config) => {
606
- emoji.value = config;
607
- }),
609
+ getEmojis(Array.isArray(emojiConfig) ? emojiConfig : []).then(
610
+ (config) => {
611
+ emoji.value = config;
612
+ }
613
+ ),
608
614
  { immediate: true }
609
615
  );
610
616
  });
@@ -23,6 +23,11 @@
23
23
  v-text="locale.admin"
24
24
  />
25
25
  <span v-if="comment.sticky" class="wl-badge" v-text="locale.sticky" />
26
+ <span
27
+ v-if="comment.level >= 0"
28
+ class="wl-badge"
29
+ v-text="locale[`level${comment.level}`] || `Level ${comment.level}`"
30
+ />
26
31
 
27
32
  <span class="wl-time" v-text="time" />
28
33
 
@@ -61,16 +61,8 @@
61
61
  </template>
62
62
 
63
63
  <script lang="ts">
64
- import {
65
- computed,
66
- defineComponent,
67
- onBeforeUnmount,
68
- onMounted,
69
- provide,
70
- ref,
71
- watch,
72
- watchEffect,
73
- } from 'vue';
64
+ import { useStyleTag } from '@vueuse/core';
65
+ import { computed, defineComponent, onMounted, provide, ref, watch } from 'vue';
74
66
  import CommentBox from './CommentBox.vue';
75
67
  import CommentCard from './CommentCard.vue';
76
68
  import { LoadingIcon } from './Icons';
@@ -171,23 +163,24 @@ export default defineComponent({
171
163
  },
172
164
 
173
165
  emoji: {
174
- type: Array as PropType<(string | WalineEmojiInfo)[]>,
166
+ type: [Array, Boolean] as PropType<(string | WalineEmojiInfo)[] | false>,
175
167
  ...(SHOULD_VALIDATE
176
168
  ? {
177
169
  validator: (value: unknown): boolean =>
178
- Array.isArray(value) &&
179
- value.every(
180
- (item) =>
181
- typeof item === 'string' ||
182
- (typeof item === 'object' &&
183
- typeof item.name === 'string' &&
184
- typeof item.folder === 'string' &&
185
- typeof item.icon === 'string' &&
186
- Array.isArray(item.items) &&
187
- (item.items as unknown[]).every(
188
- (icon) => typeof icon === 'string'
189
- ))
190
- ),
170
+ value === false ||
171
+ (Array.isArray(value) &&
172
+ value.every(
173
+ (item) =>
174
+ typeof item === 'string' ||
175
+ (typeof item === 'object' &&
176
+ typeof item.name === 'string' &&
177
+ typeof item.folder === 'string' &&
178
+ typeof item.icon === 'string' &&
179
+ Array.isArray(item.items) &&
180
+ (item.items as unknown[]).every(
181
+ (icon) => typeof icon === 'string'
182
+ ))
183
+ )),
191
184
  }
192
185
  : {}),
193
186
  },
@@ -225,9 +218,10 @@ export default defineComponent({
225
218
 
226
219
  const darkmodeStyle = computed(() => getDarkStyle(config.value.dark));
227
220
 
221
+ useStyleTag(darkmodeStyle);
222
+
228
223
  // eslint-disable-next-line vue/no-setup-props-destructure
229
224
  let abort: () => void;
230
- let stop: () => void;
231
225
 
232
226
  const fetchComment = (pageNumber: number): void => {
233
227
  const { serverURL, path, pageSize } = config.value;
@@ -239,6 +233,7 @@ export default defineComponent({
239
233
 
240
234
  fetchCommentList({
241
235
  serverURL,
236
+ lang: config.value.lang,
242
237
  path,
243
238
  pageSize,
244
239
  page: pageNumber,
@@ -293,21 +288,7 @@ export default defineComponent({
293
288
 
294
289
  watch(() => props.path, refresh);
295
290
 
296
- onMounted(() => {
297
- refresh();
298
-
299
- const style = document.createElement('style');
300
-
301
- style.innerText = darkmodeStyle.value;
302
-
303
- document.querySelector('[data-waline]')?.appendChild(style);
304
-
305
- stop = watchEffect(() => {
306
- style.innerText = darkmodeStyle.value;
307
- });
308
- });
309
-
310
- onBeforeUnmount(() => stop());
291
+ onMounted(() => refresh());
311
292
 
312
293
  return {
313
294
  config,
@@ -1,6 +1,6 @@
1
1
  import { useNow } from '@vueuse/core';
2
2
  import { computed } from 'vue';
3
- import { dateFormat } from '../utils';
3
+ import { getTimeAgo } from '../utils';
4
4
 
5
5
  import type { ComputedRef } from 'vue';
6
6
  import type { WalineLocale } from '../typings';
@@ -11,51 +11,5 @@ export const useTimeAgo = (
11
11
  ): ComputedRef<string> => {
12
12
  const now = useNow();
13
13
 
14
- return computed(() => {
15
- if (!date) return '';
16
-
17
- const time =
18
- typeof date === 'string'
19
- ? new Date(date.indexOf(' ') !== -1 ? date.replace(/-/g, '/') : date)
20
- : date;
21
-
22
- const timepassed = now.value.getTime() - time.getTime();
23
-
24
- const days = Math.floor(timepassed / (24 * 3600 * 1000));
25
-
26
- if (days === 0) {
27
- // 计算相差小时数
28
-
29
- // 计算天数后剩余的毫秒数
30
- const leave1 = timepassed % (24 * 3600 * 1000);
31
- const hours = Math.floor(leave1 / (3600 * 1000));
32
-
33
- if (hours === 0) {
34
- //计算相差分钟数
35
-
36
- // 计算小时数后剩余的毫秒数
37
- const leave2 = leave1 % (3600 * 1000);
38
- const minutes = Math.floor(leave2 / (60 * 1000));
39
-
40
- // 计算相差秒数
41
- if (minutes === 0) {
42
- // 计算分钟数后剩余的毫秒数
43
- const leave3 = leave2 % (60 * 1000);
44
- const seconds = Math.round(leave3 / 1000);
45
-
46
- return `${seconds} ${locale.seconds}`;
47
- }
48
-
49
- return `${minutes} ${locale.minutes}`;
50
- }
51
-
52
- return `${hours} ${locale.hours}`;
53
- }
54
-
55
- if (days < 0) return locale.now;
56
-
57
- if (days < 8) return `${days} ${locale.days}`;
58
-
59
- return dateFormat(time);
60
- });
14
+ return computed(() => getTimeAgo(date, now.value, locale));
61
15
  };
@@ -31,4 +31,10 @@ export default generateLocale([
31
31
  'Words',
32
32
  'Please input comments between $0 and $1 words!\n Current word number: $2',
33
33
  'Anonymous',
34
+ 'Dwarves',
35
+ 'Hobbits',
36
+ 'Ents',
37
+ 'Wizards',
38
+ 'Elves',
39
+ 'Maiar',
34
40
  ]);
@@ -31,6 +31,12 @@ const localeKeys = [
31
31
  'word',
32
32
  'wordHint',
33
33
  'anonymous',
34
+ 'level0',
35
+ 'level1',
36
+ 'level2',
37
+ 'level3',
38
+ 'level4',
39
+ 'level5',
34
40
  ];
35
41
 
36
42
  export const generateLocale = (locale: string[]): WalineLocale =>
@@ -31,4 +31,10 @@ export default generateLocale([
31
31
  '字',
32
32
  '评论字数应在 $0 到 $1 字之间!\n当前字数:$2',
33
33
  '匿名',
34
+ '潜水',
35
+ '冒泡',
36
+ '吐槽',
37
+ '活跃',
38
+ '话痨',
39
+ '传说',
34
40
  ]);
@@ -31,4 +31,10 @@ export default generateLocale([
31
31
  '字',
32
32
  '評論字數應在 $0 到 $1 字之間!\n當前字數:$2',
33
33
  '匿名',
34
+ '潛水',
35
+ '冒泡',
36
+ '吐槽',
37
+ '活躍',
38
+ '話癆',
39
+ '傳說',
34
40
  ]);
@@ -10,7 +10,7 @@ import type { WalineInitOptions } from '../typings';
10
10
  export { WalineInstance } from '../init';
11
11
 
12
12
  warning(
13
- ' This is a legacy package compatable with Valine and Waline@v1, please switch to Waline@v2 using https://<CDN.LINK>/@waline/client/dist/waline.js instead!'
13
+ ' This is a legacy package compatible with Valine and Waline@v1, please switch to Waline@v2 using https://<CDN.LINK>/@waline/client/dist/waline.js instead!'
14
14
  );
15
15
 
16
16
  // inject css styles
package/src/pageview.ts CHANGED
@@ -41,6 +41,15 @@ export interface WalinePageviewCountOptions {
41
41
  * @default true
42
42
  */
43
43
  update?: boolean;
44
+
45
+ /**
46
+ * 错误提示消息所使用的语言
47
+ *
48
+ * Language of error message
49
+ *
50
+ * @default 'zh-CN'
51
+ */
52
+ lang?: string;
44
53
  }
45
54
 
46
55
  const renderVisitorCount = (
@@ -57,6 +66,7 @@ export const pageviewCount = ({
57
66
  path = window.location.pathname,
58
67
  selector = '.waline-pageview-count',
59
68
  update = true,
69
+ lang = 'zh-CN',
60
70
  }: WalinePageviewCountOptions): WalineAbort => {
61
71
  const controller = new AbortController();
62
72
 
@@ -75,6 +85,7 @@ export const pageviewCount = ({
75
85
  fetchPageviews({
76
86
  serverURL,
77
87
  paths: elements.map((element) => getQuery(element) || path),
88
+ lang,
78
89
  signal: controller.signal,
79
90
  })
80
91
  .then((counts) => renderVisitorCount(counts, elements))
@@ -85,7 +96,7 @@ export const pageviewCount = ({
85
96
  const normalElements = elements.filter((element) => !filter(element));
86
97
  const elementsNeedstoBeFetched = elements.filter(filter);
87
98
 
88
- void updatePageviews({ serverURL, path }).then((count) =>
99
+ void updatePageviews({ serverURL, path, lang }).then((count) =>
89
100
  renderVisitorCount(
90
101
  new Array<number>(normalElements.length).fill(count),
91
102
  normalElements
@@ -85,12 +85,12 @@
85
85
  .wl-badge {
86
86
  display: inline-block;
87
87
 
88
- margin-right: 0.5em;
88
+ margin-right: 1em;
89
89
  padding: 0 0.3em;
90
- border-radius: 3px;
90
+ border: 1px solid var(--waline-badge-color);
91
+ border-radius: 4px;
91
92
 
92
- background: var(--waline-badge-color);
93
- color: var(--waline-white);
93
+ color: var(--waline-badge-color);
94
94
 
95
95
  font-size: var(--waline-badge-font-size);
96
96
  }
@@ -1,6 +1,6 @@
1
1
  :root {
2
2
  // font-size
3
- --waline-font-size: 16px;
3
+ --waline-font-size: 1rem;
4
4
 
5
5
  // regular colors
6
6
  --waline-white: #fff;
@@ -30,7 +30,7 @@
30
30
 
31
31
  // badge
32
32
  --waline-badge-color: #3498db;
33
- --waline-badge-font-size: 0.775em;
33
+ --waline-badge-font-size: 0.75em;
34
34
 
35
35
  // info
36
36
  --waline-info-bgcolor: #f8f8f8;
@@ -7,9 +7,9 @@
7
7
  .vemoji,
8
8
  .wl-emoji {
9
9
  display: inline-block;
10
- vertical-align: middle;
11
- width: 1.25em;
12
- margin: 0.25em;
10
+ vertical-align: baseline;
11
+ height: 1.25em;
12
+ margin: -0.125em 0.25em;
13
13
  }
14
14
 
15
15
  .wl-tex {
@@ -22,4 +22,5 @@ export interface WalineComment extends Exclude<WalineCommentData, 'ua'> {
22
22
  sticky?: boolean;
23
23
  browser?: string;
24
24
  os?: string;
25
+ level?: number;
25
26
  }
@@ -1,4 +1,12 @@
1
- export interface WalineLocale {
1
+ export interface WalineDateLocale {
2
+ seconds: string;
3
+ minutes: string;
4
+ hours: string;
5
+ days: string;
6
+ now: string;
7
+ }
8
+
9
+ export interface WalineLocale extends WalineDateLocale {
2
10
  nick: string;
3
11
  nickError: string;
4
12
  mail: string;
@@ -16,11 +24,6 @@ export interface WalineLocale {
16
24
  preview: string;
17
25
  emoji: string;
18
26
  uploadImage: string;
19
- seconds: string;
20
- minutes: string;
21
- hours: string;
22
- days: string;
23
- now: string;
24
27
  uploading: string;
25
28
  login: string;
26
29
  logout: string;
@@ -146,7 +146,7 @@ export interface WalineProps {
146
146
  *
147
147
  * @default ['https://cdn.jsdelivr.net/gh/walinejs/emojis/weibo']
148
148
  */
149
- emoji?: (string | WalineEmojiInfo)[];
149
+ emoji?: (string | WalineEmojiInfo)[] | false;
150
150
 
151
151
  /**
152
152
  * 代码高亮
@@ -50,7 +50,7 @@ export const getConfig = ({
50
50
  path = location.pathname,
51
51
  lang = defaultLang,
52
52
  locale,
53
- emoji = ['//unpkg.com/@waline/emojis@1.0.1/weibo/info.json'],
53
+ emoji = ['//unpkg.com/@waline/emojis@1.0.1/weibo'],
54
54
  meta = ['nick', 'mail', 'link'],
55
55
  requiredMeta = [],
56
56
  dark = false,
@@ -69,7 +69,6 @@ export const getConfig = ({
69
69
  ...(locales[lang] || locales[defaultLang]),
70
70
  ...(typeof locale === 'object' ? locale : {}),
71
71
  },
72
- // emoji: getEmojis(emoji),
73
72
  wordLimit: getWordLimit(wordLimit),
74
73
  meta: getMeta(meta),
75
74
  requiredMeta: getMeta(requiredMeta),
package/src/utils/date.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { WalineDateLocale } from '../typings';
2
+
1
3
  const padWithZeros = (vNumber: number, width: number): string => {
2
4
  let numAsString = vNumber.toString();
3
5
 
@@ -15,3 +17,55 @@ export const dateFormat = (date: Date): string => {
15
17
 
16
18
  return `${vYear}-${vMonth}-${vDay}`;
17
19
  };
20
+
21
+ export const getTimeAgo = (
22
+ date: Date | string,
23
+ now: Date,
24
+ locale: WalineDateLocale
25
+ ): string => {
26
+ if (!date) return '';
27
+
28
+ const time =
29
+ typeof date === 'string'
30
+ ? new Date(date.indexOf(' ') !== -1 ? date.replace(/-/g, '/') : date)
31
+ : date;
32
+
33
+ const timepassed = now.getTime() - time.getTime();
34
+
35
+ const days = Math.floor(timepassed / (24 * 3600 * 1000));
36
+
37
+ if (days === 0) {
38
+ // 计算相差小时数
39
+
40
+ // 计算天数后剩余的毫秒数
41
+ const leave1 = timepassed % (24 * 3600 * 1000);
42
+ const hours = Math.floor(leave1 / (3600 * 1000));
43
+
44
+ if (hours === 0) {
45
+ //计算相差分钟数
46
+
47
+ // 计算小时数后剩余的毫秒数
48
+ const leave2 = leave1 % (3600 * 1000);
49
+ const minutes = Math.floor(leave2 / (60 * 1000));
50
+
51
+ // 计算相差秒数
52
+ if (minutes === 0) {
53
+ // 计算分钟数后剩余的毫秒数
54
+ const leave3 = leave2 % (60 * 1000);
55
+ const seconds = Math.round(leave3 / 1000);
56
+
57
+ return `${seconds} ${locale.seconds}`;
58
+ }
59
+
60
+ return `${minutes} ${locale.minutes}`;
61
+ }
62
+
63
+ return `${hours} ${locale.hours}`;
64
+ }
65
+
66
+ if (days < 0) return locale.now;
67
+
68
+ if (days < 8) return `${days} ${locale.days}`;
69
+
70
+ return dateFormat(time);
71
+ };
@@ -16,7 +16,7 @@ const fetchEmoji = (link: string): Promise<WalineEmojiInfo> => {
16
16
  const result = hasVersion(link);
17
17
 
18
18
  if (result) {
19
- const info = emojiStore.value.link;
19
+ const info = emojiStore.value[link];
20
20
 
21
21
  if (info) return Promise.resolve(info);
22
22
  }
@@ -29,7 +29,7 @@ const fetchEmoji = (link: string): Promise<WalineEmojiInfo> => {
29
29
  ...emojiInfo,
30
30
  };
31
31
 
32
- if (result) emojiStore.value.link = info;
32
+ if (result) emojiStore.value[link] = info;
33
33
 
34
34
  return info;
35
35
  });