vuepress-theme-uniapp-official 1.6.5 → 1.6.6
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/components/DcloudSearchPage/AIChat/index.vue +7 -19
- package/components/DcloudSearchPage/AIChat/markdown-loader.js +2 -2
- package/components/DcloudSearchPage/ai-answer-style-reset.styl +17 -0
- package/components/DcloudSearchPage/components/AIAnswer.vue +3 -21
- package/components/DcloudSearchPage/index.styl +0 -6
- package/package.json +3 -3
|
@@ -57,13 +57,13 @@
|
|
|
57
57
|
|
|
58
58
|
<script setup>
|
|
59
59
|
import { ref, nextTick, watchEffect, onMounted, computed } from 'vue'
|
|
60
|
-
import { renderMarkdown } from "./markdown-loader";
|
|
61
60
|
import searchPageConfig from '@theme-config/searchPage';
|
|
61
|
+
import { renderMarkdown } from "./markdown-loader";
|
|
62
62
|
import { MAX_AI_ANSWER_LENGTH } from '../constants';
|
|
63
|
+
import { ajax } from '../utils/postDcloudServer';
|
|
63
64
|
import SelectPlatform from '../components/SelectPlatform.vue';
|
|
64
65
|
import LikeButton from '../components/LikeButton.vue';
|
|
65
66
|
import Skeleton from '../components/Skeleton.vue';
|
|
66
|
-
import { ajax } from '../utils/postDcloudServer';
|
|
67
67
|
|
|
68
68
|
const { aiPlatforms = [], aiChatForDocSearch = 'https://ai-assist-api.dcloud.net.cn/tbox/chatForDocSearch' } = searchPageConfig;
|
|
69
69
|
|
|
@@ -287,6 +287,8 @@ window.addEventListener('resize', scrollToBottom)
|
|
|
287
287
|
</script>
|
|
288
288
|
|
|
289
289
|
<style lang="stylus">
|
|
290
|
+
@import '../ai-answer-style-reset.styl'
|
|
291
|
+
|
|
290
292
|
.__backdrop-filter__
|
|
291
293
|
backdrop-filter blur(15px)
|
|
292
294
|
.__not-support-backdrop-filter__
|
|
@@ -309,7 +311,7 @@ window.addEventListener('resize', scrollToBottom)
|
|
|
309
311
|
border-bottom 1px solid #eee */
|
|
310
312
|
|
|
311
313
|
.title
|
|
312
|
-
margin
|
|
314
|
+
margin 30px auto
|
|
313
315
|
text-align center
|
|
314
316
|
font-size 30px
|
|
315
317
|
font-weight 600
|
|
@@ -352,27 +354,13 @@ window.addEventListener('resize', scrollToBottom)
|
|
|
352
354
|
.bubble
|
|
353
355
|
display inline-block
|
|
354
356
|
max-width 50%
|
|
355
|
-
padding
|
|
357
|
+
padding 0 14px
|
|
356
358
|
border-radius 14px
|
|
357
359
|
line-height 1.5
|
|
358
360
|
font-size 15px
|
|
359
361
|
word-break break-word
|
|
360
362
|
box-shadow 0 1px 3px rgba(0,0,0,0.08)
|
|
361
|
-
|
|
362
|
-
margin: 0
|
|
363
|
-
padding: 5px
|
|
364
|
-
border-radius 10px
|
|
365
|
-
& + pre
|
|
366
|
-
margin-top 8px
|
|
367
|
-
pre, code
|
|
368
|
-
white-space: pre-wrap; /* 允许换行 */
|
|
369
|
-
word-wrap: break-word; /* 允许长行断开 */
|
|
370
|
-
word-break: break-word;
|
|
371
|
-
h1, h2, h3, h4, h5, h6, p, ul, ol, dl, figure, blockquote
|
|
372
|
-
margin: 0
|
|
373
|
-
padding: 0
|
|
374
|
-
ul, ol
|
|
375
|
-
list-style: none
|
|
363
|
+
@extend .ai-answer-style-reset
|
|
376
364
|
|
|
377
365
|
.meta
|
|
378
366
|
font-size 12px
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// markdown-loader.js
|
|
2
2
|
let markedInstance = null;
|
|
3
3
|
|
|
4
|
-
//
|
|
4
|
+
// 防止 ``` 和上一行之前没有空行 marked 解析失败
|
|
5
5
|
function escapeMD(str) {
|
|
6
6
|
return str
|
|
7
|
-
.replace(
|
|
7
|
+
.replace(/\n(```)/g, '\n\n$1')
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
function getLangCodeFromExtension(extension) {
|
|
@@ -65,6 +65,8 @@ function dislike() {
|
|
|
65
65
|
</script>
|
|
66
66
|
|
|
67
67
|
<style lang="stylus">
|
|
68
|
+
@import '../ai-answer-style-reset.styl'
|
|
69
|
+
|
|
68
70
|
.ai-answer-card
|
|
69
71
|
padding 14px 16px
|
|
70
72
|
margin-top 12px
|
|
@@ -101,27 +103,7 @@ function dislike() {
|
|
|
101
103
|
animation fadeIn .25s ease
|
|
102
104
|
|
|
103
105
|
/* --- reset 内容区 --- */
|
|
104
|
-
|
|
105
|
-
margin 0
|
|
106
|
-
padding 6px 8px
|
|
107
|
-
border-radius 10px
|
|
108
|
-
background #f6f8fa
|
|
109
|
-
white-space pre-wrap
|
|
110
|
-
word-break break-word
|
|
111
|
-
|
|
112
|
-
& + pre
|
|
113
|
-
margin-top 8px
|
|
114
|
-
|
|
115
|
-
code
|
|
116
|
-
white-space pre-wrap
|
|
117
|
-
word-break break-word
|
|
118
|
-
|
|
119
|
-
h1, h2, h3, h4, h5, h6, p, ul, ol, dl, figure, blockquote
|
|
120
|
-
margin 0
|
|
121
|
-
padding 0
|
|
122
|
-
|
|
123
|
-
ul, ol
|
|
124
|
-
list-style none
|
|
106
|
+
@extend .ai-answer-style-reset
|
|
125
107
|
|
|
126
108
|
@keyframes fadeIn
|
|
127
109
|
from
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vuepress-theme-uniapp-official",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.6",
|
|
4
4
|
"description": "uni-app official website theme for vuepress",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"vuepress-plugin-mermaidjs": "1.9.1",
|
|
46
46
|
"vuepress-plugin-named-chunks": "^1.1.4",
|
|
47
47
|
"vuepress-plugin-zooming": "^1.1.8",
|
|
48
|
-
"vuepress-plugin-
|
|
48
|
+
"vuepress-plugin-check-md2": "^1.0.5",
|
|
49
49
|
"vuepress-plugin-expandable-row": "^1.0.10",
|
|
50
|
-
"vuepress-plugin-
|
|
50
|
+
"vuepress-plugin-noscript-code": "^1.0.2"
|
|
51
51
|
},
|
|
52
52
|
"resolutions": {
|
|
53
53
|
"terser-webpack-plugin": "1.4.6",
|