vuepress-theme-uniapp-official 1.6.15 → 1.6.17
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/CHANGELOG.md
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# vuepress-theme-uniapp-official
|
|
2
|
+
|
|
3
|
+
## 1.6.17
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- feat: Algolia 搜索结果点击事件分析
|
|
8
|
+
|
|
9
|
+
## 1.6.16
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- fix: 在 uni-app-x 下搜索到 uni-app 文档 plugin 内容时跳转 404
|
|
14
|
+
|
|
15
|
+
## 1.6.15
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- feat: 搜索结果使用当前 origin
|
|
20
|
+
- a252012: feat: 自定义 code 添加圆角
|
|
21
|
+
|
|
22
|
+
## 1.6.13
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- feat: 改进 navbar 显示
|
|
27
|
+
|
|
28
|
+
## 1.6.12
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- fix: 兼容旧版 AI 回答数据
|
|
33
|
+
|
|
34
|
+
## 1.6.11
|
|
35
|
+
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- feat: 提高 Popover 的 z-index
|
|
39
|
+
feat: Popover 组件支持鼠标 hover 弹出不隐藏
|
|
40
|
+
feat: AI 回答支持赞、踩
|
|
41
|
+
|
|
42
|
+
## 1.6.10
|
|
43
|
+
|
|
44
|
+
### Patch Changes
|
|
45
|
+
|
|
46
|
+
- feat: 更新请求 url
|
|
47
|
+
fix: input 输入错误判断逻辑
|
|
48
|
+
|
|
49
|
+
## 1.6.9
|
|
50
|
+
|
|
51
|
+
### Patch Changes
|
|
52
|
+
|
|
53
|
+
- fix: 问 AI 限制中文时判断条件错误
|
|
54
|
+
|
|
55
|
+
## 1.6.8
|
|
56
|
+
|
|
57
|
+
### Patch Changes
|
|
58
|
+
|
|
59
|
+
- feat: 问 AI 添加限制: 要有中文
|
|
60
|
+
|
|
61
|
+
## 1.6.7
|
|
62
|
+
|
|
63
|
+
### Patch Changes
|
|
64
|
+
|
|
65
|
+
- fix: AI 回答 code 代码颜色
|
|
66
|
+
feat: 搜索结果 AI 回答限制必须有中文
|
|
67
|
+
|
|
68
|
+
## 1.6.6
|
|
69
|
+
|
|
70
|
+
### Patch Changes
|
|
71
|
+
|
|
72
|
+
- fix: AI 回答 md 格式异常
|
|
73
|
+
|
|
74
|
+
## 1.6.5
|
|
75
|
+
|
|
76
|
+
### Patch Changes
|
|
77
|
+
|
|
78
|
+
- feat: 调整输入框样式,使用绝对定位
|
|
79
|
+
feat: 限制 AI 输入的字符长度
|
|
80
|
+
|
|
81
|
+
## 1.6.4
|
|
82
|
+
|
|
83
|
+
### Patch Changes
|
|
84
|
+
|
|
85
|
+
- style: 调整 AI 回答样式
|
|
86
|
+
fix: `1.` 等序号 marked 解析失败
|
|
87
|
+
|
|
88
|
+
## 1.6.3
|
|
89
|
+
|
|
90
|
+
### Patch Changes
|
|
91
|
+
|
|
92
|
+
- fix: vue 显示不高亮
|
|
93
|
+
- feat: 问 AI 添加上下文
|
|
94
|
+
- feat: 搜索结果添加 AI 回答
|
|
95
|
+
|
|
96
|
+
## 1.6.2
|
|
97
|
+
|
|
98
|
+
### Patch Changes
|
|
99
|
+
|
|
100
|
+
- fix: marked 版本过高导致 build error
|
|
101
|
+
|
|
102
|
+
## 1.6.1
|
|
103
|
+
|
|
104
|
+
### Patch Changes
|
|
105
|
+
|
|
106
|
+
- feat: 调整 AI 信息样式,容器宽度跟随文字
|
|
107
|
+
feat:调整搜索结果样式
|
|
108
|
+
|
|
109
|
+
## 1.6.0
|
|
110
|
+
|
|
111
|
+
### Minor Changes
|
|
112
|
+
|
|
113
|
+
- feat: 支持 AI
|
|
114
|
+
|
|
115
|
+
## 1.5.4
|
|
116
|
+
|
|
117
|
+
### Patch Changes
|
|
118
|
+
|
|
119
|
+
- fix: 问答社区、插件市场搜索结果样式失效
|
|
120
|
+
chore: 分离 animation 样式
|
|
121
|
+
|
|
122
|
+
## 1.5.3
|
|
123
|
+
|
|
124
|
+
### Patch Changes
|
|
125
|
+
|
|
126
|
+
- feat: 弹出时添加动画
|
|
127
|
+
feat: 搜索时重置搜索结果滚动条
|
|
128
|
+
|
|
129
|
+
## 1.5.2
|
|
130
|
+
|
|
131
|
+
### Patch Changes
|
|
132
|
+
|
|
133
|
+
- feat: 调整 search footer
|
|
134
|
+
|
|
135
|
+
## 1.5.1
|
|
136
|
+
|
|
137
|
+
### Patch Changes
|
|
138
|
+
|
|
139
|
+
- feat: 调整搜索页样式
|
|
140
|
+
|
|
141
|
+
## 1.5.0
|
|
142
|
+
|
|
143
|
+
### Minor Changes
|
|
144
|
+
|
|
145
|
+
- fix: 优化爬虫获取 H 标签
|
|
146
|
+
|
|
147
|
+
## 1.4.44
|
|
148
|
+
|
|
149
|
+
### Patch Changes
|
|
150
|
+
|
|
151
|
+
- Updated dependencies
|
|
152
|
+
- vuepress-plugin-noscript-code@1.0.2
|
|
153
|
+
|
|
154
|
+
## 1.4.43
|
|
155
|
+
|
|
156
|
+
### Patch Changes
|
|
157
|
+
|
|
158
|
+
- Updated dependencies
|
|
159
|
+
- vuepress-plugin-noscript-code@1.0.1
|
|
160
|
+
|
|
161
|
+
## 1.4.42
|
|
162
|
+
|
|
163
|
+
### Patch Changes
|
|
164
|
+
|
|
165
|
+
- feat: 新增 vuepress-plugin-noscript-code
|
|
166
|
+
|
|
167
|
+
## 1.4.41
|
|
168
|
+
|
|
169
|
+
### Patch Changes
|
|
170
|
+
|
|
171
|
+
- feat: 使用 SourceCode container 如果页面上没有 title 则改写 document.title
|
|
172
|
+
|
|
173
|
+
## 1.4.40
|
|
174
|
+
|
|
175
|
+
### Patch Changes
|
|
176
|
+
|
|
177
|
+
- feat: 新增 container sourceCode
|
|
178
|
+
|
|
179
|
+
## 1.4.39
|
|
180
|
+
|
|
181
|
+
### Patch Changes
|
|
182
|
+
|
|
183
|
+
- feat: 调整导航栏样式
|
|
184
|
+
|
|
185
|
+
## 1.4.38
|
|
186
|
+
|
|
187
|
+
### Patch Changes
|
|
188
|
+
|
|
189
|
+
- feat: 代码预览 web 示例 iframe 使用 lazy 加载
|
|
190
|
+
|
|
191
|
+
## 1.4.36
|
|
192
|
+
|
|
193
|
+
### Patch Changes
|
|
194
|
+
|
|
195
|
+
- fix: 优化在移动设备上侧边栏的显示效果
|
|
196
|
+
|
|
197
|
+
## 1.4.35
|
|
198
|
+
|
|
199
|
+
### Patch Changes
|
|
200
|
+
|
|
201
|
+
- chore: 移除无用代码
|
|
202
|
+
|
|
203
|
+
## 1.4.34
|
|
204
|
+
|
|
205
|
+
### Patch Changes
|
|
206
|
+
|
|
207
|
+
- feat: search 使用 extraFacetFilters 配置
|
|
@@ -134,6 +134,7 @@
|
|
|
134
134
|
</template>
|
|
135
135
|
|
|
136
136
|
<script>
|
|
137
|
+
import aa from "search-insights";
|
|
137
138
|
import searchPageConfig from '@theme-config/searchPage';
|
|
138
139
|
import NavbarLogo from '../NavbarLogo.vue';
|
|
139
140
|
import Results from './components/Results.vue';
|
|
@@ -162,8 +163,15 @@ const {
|
|
|
162
163
|
aiChatForDocSearch = AI_CHAT_FOR_DOC_SEARCH_URL,
|
|
163
164
|
} = searchPageConfig;
|
|
164
165
|
const crawlerUrl = 'https://zh.uniapp.dcloud.io/'
|
|
166
|
+
const unidocsUrl = 'https://uniapp.dcloud.io/'
|
|
167
|
+
const docDcloudNetUrl = 'https://doc.dcloud.net.cn'
|
|
165
168
|
|
|
166
169
|
const resolveRoutePathFromUrl = (url, base = '/') => {
|
|
170
|
+
// uni-app-x、uniCloud (doc.dcloud.net.cn 域名下) 等独立站点不需要转换,只需要将爬虫的域名替换为正确域名即可
|
|
171
|
+
if (location.origin === docDcloudNetUrl) {
|
|
172
|
+
return url.replace(crawlerUrl, unidocsUrl)
|
|
173
|
+
}
|
|
174
|
+
// unidocs 文档分中英文,因此需要转换回当前站点域名 zh、en
|
|
167
175
|
if (url.indexOf(crawlerUrl) === 0) {
|
|
168
176
|
return url.replace(crawlerUrl, location.origin + '/');
|
|
169
177
|
}
|
|
@@ -377,13 +385,22 @@ export default {
|
|
|
377
385
|
case 'algolia':
|
|
378
386
|
this.showLoading = true;
|
|
379
387
|
this.searchByAlgolia()
|
|
380
|
-
.then(({ hitsPerPage, nbHits, nbPages, page, hits }) => {
|
|
388
|
+
.then(({ hitsPerPage, nbHits, nbPages, page, hits, queryID, indexName }) => {
|
|
381
389
|
this.resultList = hits.map(item => {
|
|
382
390
|
const items = item.getItems();
|
|
383
391
|
return {
|
|
384
392
|
...item,
|
|
385
393
|
title: removeHighlightTags(items[0]),
|
|
386
394
|
items,
|
|
395
|
+
onSelect: ({ item, event }) => {
|
|
396
|
+
aa("clickedObjectIDsAfterSearch", {
|
|
397
|
+
index: indexName,
|
|
398
|
+
eventName: `[${this.currentCategory.text}] Item Clicked`,
|
|
399
|
+
queryID,
|
|
400
|
+
objectIDs: [item.objectID],
|
|
401
|
+
positions: [1],
|
|
402
|
+
});
|
|
403
|
+
}
|
|
387
404
|
};
|
|
388
405
|
});
|
|
389
406
|
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import algoliasearch from 'algoliasearch/dist/algoliasearch-lite.esm.browser';
|
|
2
|
+
import aa from "search-insights";
|
|
2
3
|
import { removeHighlightTags, groupBy } from './searchUtils'
|
|
3
4
|
|
|
4
5
|
let searchClient
|
|
5
6
|
function createSearchClient(appId, apiKey) {
|
|
6
7
|
if (searchClient) return searchClient
|
|
7
8
|
searchClient = algoliasearch(appId, apiKey);
|
|
9
|
+
aa("init", { appId, apiKey });
|
|
8
10
|
searchClient.addAlgoliaAgent('dcloudsearch', '1.0.0');
|
|
9
11
|
|
|
10
12
|
return searchClient
|
|
@@ -45,6 +47,7 @@ export function search({ query, indexName, appId, apiKey, searchParameters = {},
|
|
|
45
47
|
highlightPreTag: '<mark>',
|
|
46
48
|
highlightPostTag: '</mark>',
|
|
47
49
|
hitsPerPage: 20,
|
|
50
|
+
clickAnalytics: true,
|
|
48
51
|
...searchParameters,
|
|
49
52
|
...args,
|
|
50
53
|
},
|
|
@@ -54,7 +57,7 @@ export function search({ query, indexName, appId, apiKey, searchParameters = {},
|
|
|
54
57
|
throw error;
|
|
55
58
|
})
|
|
56
59
|
.then(({ results }) => {
|
|
57
|
-
const { hits, hitsPerPage, nbHits, nbPages, page } = results[0];
|
|
60
|
+
const { hits, hitsPerPage, nbHits, nbPages, page, queryID } = results[0];
|
|
58
61
|
const sources = groupBy(hits, (hit) => removeHighlightTags(hit));
|
|
59
62
|
return {
|
|
60
63
|
hitsPerPage, nbHits, nbPages, page,
|
|
@@ -95,7 +98,9 @@ export function search({ query, indexName, appId, apiKey, searchParameters = {},
|
|
|
95
98
|
},
|
|
96
99
|
};
|
|
97
100
|
}
|
|
98
|
-
)
|
|
101
|
+
),
|
|
102
|
+
queryID,
|
|
103
|
+
indexName
|
|
99
104
|
}
|
|
100
105
|
});
|
|
101
106
|
}
|
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.17",
|
|
4
4
|
"description": "uni-app official website theme for vuepress",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
"styles",
|
|
26
26
|
"util",
|
|
27
27
|
"enhanceApp.js",
|
|
28
|
-
"index.js"
|
|
28
|
+
"index.js",
|
|
29
|
+
"CHANGELOG.md"
|
|
29
30
|
],
|
|
30
31
|
"publishConfig": {
|
|
31
32
|
"access": "public"
|
|
@@ -41,13 +42,14 @@
|
|
|
41
42
|
"markdown-it-task-lists": "^2.1.1",
|
|
42
43
|
"marked": "^3.0.8",
|
|
43
44
|
"qr-code-with-logo": "^1.1.0",
|
|
45
|
+
"search-insights": "^2.17.3",
|
|
44
46
|
"vuepress-plugin-juejin-style-copy": "^1.0.4",
|
|
45
47
|
"vuepress-plugin-mermaidjs": "1.9.1",
|
|
46
48
|
"vuepress-plugin-named-chunks": "^1.1.4",
|
|
47
49
|
"vuepress-plugin-zooming": "^1.1.8",
|
|
48
|
-
"vuepress-plugin-noscript-code": "^1.0.2",
|
|
49
50
|
"vuepress-plugin-check-md2": "^1.0.5",
|
|
50
|
-
"vuepress-plugin-expandable-row": "^1.0.10"
|
|
51
|
+
"vuepress-plugin-expandable-row": "^1.0.10",
|
|
52
|
+
"vuepress-plugin-noscript-code": "^1.0.2"
|
|
51
53
|
},
|
|
52
54
|
"resolutions": {
|
|
53
55
|
"terser-webpack-plugin": "1.4.6",
|