vuepress-theme-uniapp-official 1.6.6 → 1.6.7

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.
@@ -8,6 +8,10 @@
8
8
  & + pre
9
9
  margin-top 8px
10
10
 
11
+ code
12
+ font-size 14px
13
+ color #24292e
14
+
11
15
  pre, code
12
16
  white-space pre-wrap
13
17
  word-break break-word
@@ -245,7 +245,11 @@ export default {
245
245
  }
246
246
  },
247
247
  showAIMessage() {
248
- return this.searchValue.trim().length >= MAX_AI_ANSWER_LENGTH || this.aiMessage.msg.trim().length > 0
248
+ const searchText = this.searchValue.trim()
249
+ const hasAIMessageHistory = this.aiMessage.msg.trim().length > 0
250
+ const wordLimitExceeded = searchText.length >= MAX_AI_ANSWER_LENGTH
251
+ const hasChineseCharacters = /[\u4e00-\u9fa5]/.test(searchText)
252
+ return this.enableAI && ((wordLimitExceeded && hasChineseCharacters) || hasAIMessageHistory)
249
253
  }
250
254
  },
251
255
 
@@ -356,7 +360,7 @@ export default {
356
360
  }
357
361
  this.aiMessage.msg = ''
358
362
  this.searchAIResult = null
359
- if (this.enableAI && this.searchValue.trim().length) {
363
+ if (this.showAIMessage) {
360
364
  this.searchByAI()
361
365
  }
362
366
  },
@@ -389,7 +393,7 @@ export default {
389
393
  this.totalPage = nbPages;
390
394
  this.curPage = page + 1;
391
395
 
392
- if (this.enableAI && this.curPage === 1 && this.showAIMessage) {
396
+ if (this.curPage === 1 && this.showAIMessage) {
393
397
  this.resultList.splice(1, 0, this.aiMessage);
394
398
  }
395
399
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vuepress-theme-uniapp-official",
3
- "version": "1.6.6",
3
+ "version": "1.6.7",
4
4
  "description": "uni-app official website theme for vuepress",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -45,8 +45,8 @@
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-check-md2": "^1.0.5",
49
48
  "vuepress-plugin-expandable-row": "^1.0.10",
49
+ "vuepress-plugin-check-md2": "^1.0.5",
50
50
  "vuepress-plugin-noscript-code": "^1.0.2"
51
51
  },
52
52
  "resolutions": {