@waline/client 2.0.1 → 2.0.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.
- package/dist/component.js +1 -1
- package/dist/component.js.map +1 -1
- 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/shim.d.ts +29 -4
- package/dist/shim.esm.d.ts +29 -4
- 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 +29 -4
- package/dist/waline.cjs.js +1 -1
- package/dist/waline.cjs.js.map +1 -1
- package/dist/waline.css +1 -1
- package/dist/waline.css.map +1 -1
- package/dist/waline.d.ts +29 -4
- package/dist/waline.esm.d.ts +29 -4
- 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 +1 -1
- package/src/compact/convert.ts +1 -1
- package/src/components/CommentBox.vue +2 -4
- package/src/components/Waline.vue +5 -5
- package/src/config/default.ts +2 -2
- package/src/styles/layout.scss +1 -1
- package/src/styles/panel.scss +0 -2
- package/src/utils/markdown.ts +1 -1
- package/src/widgets/recentComments.ts +31 -3
package/package.json
CHANGED
package/src/compact/convert.ts
CHANGED
|
@@ -51,7 +51,7 @@ export const covertOptions = (
|
|
|
51
51
|
warning(`Option "${item}" is REMOVED and CAN NOT be polyfilled!`)
|
|
52
52
|
);
|
|
53
53
|
|
|
54
|
-
// warnings with those which
|
|
54
|
+
// warnings with those which is being polyfilled
|
|
55
55
|
DROPPED_OPTIONS_WHICH_CAN_STILL_BE_POLYFILLED.filter(([oldOption]) =>
|
|
56
56
|
Object.keys(options).includes(oldOption)
|
|
57
57
|
).forEach(([oldOption, newOption]) =>
|
|
@@ -58,10 +58,8 @@
|
|
|
58
58
|
@paste="onPaste"
|
|
59
59
|
/>
|
|
60
60
|
|
|
61
|
-
<div
|
|
62
|
-
|
|
63
|
-
:style="{ display: showPreview ? 'block' : 'none' }"
|
|
64
|
-
>
|
|
61
|
+
<div class="wl-preview" v-show="showPreview">
|
|
62
|
+
<hr />
|
|
65
63
|
<h4>{{ locale.preview }}:</h4>
|
|
66
64
|
<div class="wl-content" v-html="previewText" />
|
|
67
65
|
</div>
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
/>
|
|
19
19
|
</div>
|
|
20
20
|
|
|
21
|
-
<div v-if="status === 'error'" class="wl-
|
|
21
|
+
<div v-if="status === 'error'" class="wl-operation">
|
|
22
22
|
<button
|
|
23
23
|
type="button"
|
|
24
24
|
class="wl-btn"
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
<div v-else-if="!data.length" class="wl-empty" v-text="i18n.sofa" />
|
|
36
36
|
|
|
37
37
|
<!-- Load more button -->
|
|
38
|
-
<div v-else-if="page < totalPages" class="wl-
|
|
38
|
+
<div v-else-if="page < totalPages" class="wl-operation">
|
|
39
39
|
<button
|
|
40
40
|
type="button"
|
|
41
41
|
class="wl-btn"
|
|
@@ -226,12 +226,12 @@ export default defineComponent({
|
|
|
226
226
|
// }),
|
|
227
227
|
},
|
|
228
228
|
|
|
229
|
-
|
|
229
|
+
texRenderer: {
|
|
230
230
|
type: Function as PropType<WalineTexRenderer>,
|
|
231
231
|
// default: (blockMode: boolean): string =>
|
|
232
232
|
// blockMode === true
|
|
233
|
-
// ? '<p class="
|
|
234
|
-
// : '<span class="
|
|
233
|
+
// ? '<p class="wl-tex">Tex is not available in preview</p>'
|
|
234
|
+
// : '<span class="wl-tex">Tex is not available in preview</span>',
|
|
235
235
|
},
|
|
236
236
|
},
|
|
237
237
|
|
package/src/config/default.ts
CHANGED
|
@@ -17,5 +17,5 @@ export const defaultUploadImage = (file: File): Promise<string> =>
|
|
|
17
17
|
|
|
18
18
|
export const defaultTexRenderer = (blockMode: boolean): string =>
|
|
19
19
|
blockMode === true
|
|
20
|
-
? '<p class="
|
|
21
|
-
: '<span class="
|
|
20
|
+
? '<p class="wl-tex">Tex is not available in preview</p>'
|
|
21
|
+
: '<span class="wl-tex">Tex is not available in preview</span>';
|
package/src/styles/layout.scss
CHANGED
package/src/styles/panel.scss
CHANGED
package/src/utils/markdown.ts
CHANGED
|
@@ -10,7 +10,7 @@ import type {
|
|
|
10
10
|
export const parseEmoji = (text = '', emojiMap: WalineEmojiMaps = {}): string =>
|
|
11
11
|
text.replace(/:(.+?):/g, (placeholder, key: string) =>
|
|
12
12
|
emojiMap[key]
|
|
13
|
-
? `<img class="
|
|
13
|
+
? `<img class="wl-emoji" src="${emojiMap[key]}" alt="${key}">`
|
|
14
14
|
: placeholder
|
|
15
15
|
);
|
|
16
16
|
|
|
@@ -2,14 +2,42 @@ import { fetchRecentComment, getRoot, getUserInfo } from '../utils';
|
|
|
2
2
|
|
|
3
3
|
import type { WalineComment } from '../typings';
|
|
4
4
|
|
|
5
|
-
export interface
|
|
5
|
+
export interface WalineRecentCommentsOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Waline 服务端地址
|
|
8
|
+
*
|
|
9
|
+
* Waline serverURL
|
|
10
|
+
*/
|
|
6
11
|
serverURL: string;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* 获取最新评论的数量
|
|
15
|
+
*
|
|
16
|
+
* fetch number of latest comments
|
|
17
|
+
*/
|
|
7
18
|
count: number;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* 需要挂载的元素
|
|
22
|
+
*
|
|
23
|
+
* Element to be mounted
|
|
24
|
+
*/
|
|
8
25
|
el?: string | HTMLElement;
|
|
9
26
|
}
|
|
10
27
|
|
|
11
|
-
export interface
|
|
28
|
+
export interface WalineRecentCommentsResult {
|
|
29
|
+
/**
|
|
30
|
+
* 评论数据
|
|
31
|
+
*
|
|
32
|
+
* Comment Data
|
|
33
|
+
*/
|
|
12
34
|
comments: WalineComment[];
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* 取消挂载挂件
|
|
38
|
+
*
|
|
39
|
+
* Umount widget
|
|
40
|
+
*/
|
|
13
41
|
destroy: () => void;
|
|
14
42
|
}
|
|
15
43
|
|
|
@@ -17,7 +45,7 @@ export const RecentComments = ({
|
|
|
17
45
|
el,
|
|
18
46
|
serverURL,
|
|
19
47
|
count,
|
|
20
|
-
}:
|
|
48
|
+
}: WalineRecentCommentsOptions): Promise<WalineRecentCommentsResult> => {
|
|
21
49
|
const root = getRoot(el);
|
|
22
50
|
const controller = new AbortController();
|
|
23
51
|
|