@waline/client 2.1.2-test.0 → 2.3.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.
- package/dist/component.esm.js +2 -0
- package/dist/component.esm.js.map +1 -0
- package/dist/component.js +1 -1
- package/dist/component.js.map +1 -1
- package/dist/legacy.d.ts +10 -2
- package/dist/legacy.js +1 -1
- package/dist/legacy.js.map +1 -1
- package/dist/pageview.cjs.js +1 -1
- package/dist/pageview.esm.js +1 -1
- package/dist/pageview.js +1 -1
- package/dist/pageview.js.map +1 -1
- package/dist/shim.d.ts +14 -9
- package/dist/shim.esm.d.ts +14 -9
- package/dist/shim.esm.js +1 -1
- package/dist/shim.esm.js.map +1 -1
- package/dist/shim.js +1 -1
- package/dist/shim.js.map +1 -1
- package/dist/waline.cjs.d.ts +14 -9
- package/dist/waline.cjs.js +1 -1
- package/dist/waline.cjs.js.map +1 -1
- package/dist/waline.d.ts +14 -9
- package/dist/waline.esm.d.ts +14 -9
- package/dist/waline.esm.js +1 -1
- package/dist/waline.esm.js.map +1 -1
- package/dist/waline.js +1 -1
- package/dist/waline.js.map +1 -1
- package/package.json +9 -5
- package/src/components/CommentCard.vue +3 -1
- package/src/components/Waline.vue +2 -2
- package/src/config/i18n/index.ts +1 -1
- package/src/entrys/full.ts +1 -1
- package/src/entrys/init.ts +1 -1
- package/src/init.ts +2 -2
- package/src/typings/comment.ts +2 -0
- package/src/typings/locale.ts +10 -1
- package/src/utils/config.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@waline/client",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "client for waline comment system",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"valine",
|
|
@@ -29,8 +29,11 @@
|
|
|
29
29
|
"require": "./dist/shim.js",
|
|
30
30
|
"default": "./dist/shim.js"
|
|
31
31
|
},
|
|
32
|
-
"./dist/component":
|
|
33
|
-
|
|
32
|
+
"./dist/component": {
|
|
33
|
+
"import": "./dist/component.esm.js",
|
|
34
|
+
"require": "./dist/component.js",
|
|
35
|
+
"default": "./dist/component.esm.js"
|
|
36
|
+
},
|
|
34
37
|
"./dist/pageview": {
|
|
35
38
|
"import": "./dist/pageview.esm.js",
|
|
36
39
|
"require": "./dist/pageview.cjs.js",
|
|
@@ -42,6 +45,7 @@
|
|
|
42
45
|
"default": "./dist/waline.js"
|
|
43
46
|
},
|
|
44
47
|
"./dist/waline.css": "./dist/waline.css",
|
|
48
|
+
"./dist/*": "./dist/*",
|
|
45
49
|
"./src/*": "./src/*",
|
|
46
50
|
"./package.json": "./package.json"
|
|
47
51
|
},
|
|
@@ -76,7 +80,7 @@
|
|
|
76
80
|
]
|
|
77
81
|
},
|
|
78
82
|
"dependencies": {
|
|
79
|
-
"@vueuse/core": "^8.
|
|
83
|
+
"@vueuse/core": "^8.4.0",
|
|
80
84
|
"autosize": "^5.0.1",
|
|
81
85
|
"hanabi": "^0.4.0",
|
|
82
86
|
"marked": "^4.0.15",
|
|
@@ -86,7 +90,7 @@
|
|
|
86
90
|
"@types/autosize": "^4.0.1",
|
|
87
91
|
"@types/marked": "^4.0.3",
|
|
88
92
|
"@vitejs/plugin-vue": "^2.3.1",
|
|
89
|
-
"vite": "^2.9.
|
|
93
|
+
"vite": "^2.9.7"
|
|
90
94
|
},
|
|
91
95
|
"engines": {
|
|
92
96
|
"node": ">=12.20.0"
|
|
@@ -22,10 +22,11 @@
|
|
|
22
22
|
class="wl-badge"
|
|
23
23
|
v-text="locale.admin"
|
|
24
24
|
/>
|
|
25
|
+
<span v-if="comment.label" class="wl-badge" v-text="comment.label" />
|
|
25
26
|
<span v-if="comment.sticky" class="wl-badge" v-text="locale.sticky" />
|
|
26
27
|
<span
|
|
27
28
|
v-if="comment.level >= 0"
|
|
28
|
-
class="wl-badge"
|
|
29
|
+
:class="`wl-badge level${comment.level}`"
|
|
29
30
|
v-text="locale[`level${comment.level}`] || `Level ${comment.level}`"
|
|
30
31
|
/>
|
|
31
32
|
|
|
@@ -41,6 +42,7 @@
|
|
|
41
42
|
</button>
|
|
42
43
|
</div>
|
|
43
44
|
<div class="wl-meta" aria-hidden="true">
|
|
45
|
+
<span v-if="comment.addr" v-text="comment.addr" />
|
|
44
46
|
<span v-if="comment.browser" v-text="comment.browser" />
|
|
45
47
|
<span v-if="comment.os" v-text="comment.os" />
|
|
46
48
|
</div>
|
|
@@ -67,7 +67,7 @@ import CommentBox from './CommentBox.vue';
|
|
|
67
67
|
import CommentCard from './CommentCard.vue';
|
|
68
68
|
import { LoadingIcon } from './Icons';
|
|
69
69
|
import { useUserInfo } from '../composables';
|
|
70
|
-
import {
|
|
70
|
+
import { defaultLocales } from '../config';
|
|
71
71
|
import { fetchCommentList, getConfig, getDarkStyle } from '../utils';
|
|
72
72
|
|
|
73
73
|
import type { PropType } from 'vue';
|
|
@@ -135,7 +135,7 @@ export default defineComponent({
|
|
|
135
135
|
...(SHOULD_VALIDATE
|
|
136
136
|
? {
|
|
137
137
|
validator: (value: unknown): boolean =>
|
|
138
|
-
Object.keys(
|
|
138
|
+
Object.keys(defaultLocales).includes(value as string),
|
|
139
139
|
}
|
|
140
140
|
: {}),
|
|
141
141
|
},
|
package/src/config/i18n/index.ts
CHANGED
package/src/entrys/full.ts
CHANGED
package/src/entrys/init.ts
CHANGED
package/src/init.ts
CHANGED
|
@@ -28,7 +28,7 @@ export interface WalineInstance {
|
|
|
28
28
|
*
|
|
29
29
|
* @description when not setting `path` option, it will be reset to `window.location.pathname`
|
|
30
30
|
*/
|
|
31
|
-
update: (newOptions
|
|
31
|
+
update: (newOptions?: Partial<Omit<WalineInitOptions, 'el'>>) => void;
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* 取消挂载并摧毁 Waline 实例
|
|
@@ -96,7 +96,7 @@ export const init = ({
|
|
|
96
96
|
pageview,
|
|
97
97
|
path = window.location.pathname,
|
|
98
98
|
...newProps
|
|
99
|
-
}: Partial<Omit<WalineInitOptions, 'el'>>): void => {
|
|
99
|
+
}: Partial<Omit<WalineInitOptions, 'el'>> = {}): void => {
|
|
100
100
|
Object.entries(newProps).forEach(([key, value]) => {
|
|
101
101
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
102
102
|
// @ts-ignore
|
package/src/typings/comment.ts
CHANGED
package/src/typings/locale.ts
CHANGED
|
@@ -6,7 +6,16 @@ export interface WalineDateLocale {
|
|
|
6
6
|
now: string;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export interface
|
|
9
|
+
export interface WalineLevelLocale {
|
|
10
|
+
level0: string;
|
|
11
|
+
level1: string;
|
|
12
|
+
level2: string;
|
|
13
|
+
level3: string;
|
|
14
|
+
level4: string;
|
|
15
|
+
level5: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface WalineLocale extends WalineDateLocale, WalineLevelLocale {
|
|
10
19
|
nick: string;
|
|
11
20
|
nickError: string;
|
|
12
21
|
mail: string;
|
package/src/utils/config.ts
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
defaultUploadImage,
|
|
4
4
|
defaultTexRenderer,
|
|
5
5
|
getMeta,
|
|
6
|
-
|
|
6
|
+
defaultLocales,
|
|
7
7
|
} from '../config';
|
|
8
8
|
|
|
9
9
|
import { decodePath, isLinkHttp, removeEndingSplash } from './path';
|
|
@@ -66,7 +66,7 @@ export const getConfig = ({
|
|
|
66
66
|
serverURL: getServerURL(serverURL),
|
|
67
67
|
path: decodePath(path),
|
|
68
68
|
locale: {
|
|
69
|
-
...(
|
|
69
|
+
...(defaultLocales[lang] || defaultLocales[defaultLang]),
|
|
70
70
|
...(typeof locale === 'object' ? locale : {}),
|
|
71
71
|
},
|
|
72
72
|
wordLimit: getWordLimit(wordLimit),
|