@vuepress-plume/plugin-search 1.0.0-rc.209 → 1.0.0-rc.211
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/client/composables/index.d.ts +12 -11
- package/dist/client/composables/index.js +40 -62
- package/dist/client/config.js +19 -15
- package/dist/client/index.d.ts +3 -3
- package/dist/client/index.js +4 -17
- package/dist/client/utils/index.d.ts +7 -9
- package/dist/client/utils/index.js +34 -104
- package/dist/node/index.d.ts +16 -12
- package/dist/node/index.js +323 -429
- package/dist/shared/index.d.ts +22 -24
- package/dist/shared/index.js +1 -1
- package/package.json +3 -2
package/dist/shared/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
//#region src/shared/index.d.ts
|
|
1
|
+
import {Options} from 'minisearch'
|
|
2
|
+
import {LocaleConfig, Page} from 'vuepress/core'
|
|
4
3
|
/**
|
|
5
4
|
* Locale options for search UI strings.
|
|
6
5
|
*
|
|
@@ -8,39 +7,39 @@ import { LocaleConfig, Page } from "vuepress/core";
|
|
|
8
7
|
*/
|
|
9
8
|
export interface SearchLocaleOptions {
|
|
10
9
|
/** Placeholder text for search input / 搜索输入框的占位文本 */
|
|
11
|
-
placeholder: string
|
|
10
|
+
placeholder: string
|
|
12
11
|
/** Text for search button / 搜索按钮的文本 */
|
|
13
|
-
buttonText: string
|
|
12
|
+
buttonText: string
|
|
14
13
|
/** Title for reset button / 重置按钮的标题 */
|
|
15
|
-
resetButtonTitle: string
|
|
14
|
+
resetButtonTitle: string
|
|
16
15
|
/** Title for back/close button / 返回/关闭按钮的标题 */
|
|
17
|
-
backButtonTitle: string
|
|
16
|
+
backButtonTitle: string
|
|
18
17
|
/** Text shown when no results found / 无搜索结果时显示的文本 */
|
|
19
|
-
noResultsText: string
|
|
18
|
+
noResultsText: string
|
|
20
19
|
/** Footer keyboard shortcut hints / 底部键盘快捷键提示 */
|
|
21
20
|
footer: {
|
|
22
21
|
/** Text for select action / 选择操作的文本 */
|
|
23
|
-
selectText: string
|
|
22
|
+
selectText: string
|
|
24
23
|
/** ARIA label for select key / 选择键的 ARIA 标签 */
|
|
25
|
-
selectKeyAriaLabel: string
|
|
24
|
+
selectKeyAriaLabel: string
|
|
26
25
|
/** Text for navigate action / 导航操作的文本 */
|
|
27
|
-
navigateText: string
|
|
26
|
+
navigateText: string
|
|
28
27
|
/** ARIA label for navigate up key / 向上导航键的 ARIA 标签 */
|
|
29
|
-
navigateUpKeyAriaLabel: string
|
|
28
|
+
navigateUpKeyAriaLabel: string
|
|
30
29
|
/** ARIA label for navigate down key / 向下导航键的 ARIA 标签 */
|
|
31
|
-
navigateDownKeyAriaLabel: string
|
|
30
|
+
navigateDownKeyAriaLabel: string
|
|
32
31
|
/** Text for close action / 关闭操作的文本 */
|
|
33
|
-
closeText: string
|
|
32
|
+
closeText: string
|
|
34
33
|
/** ARIA label for close key / 关闭键的 ARIA 标签 */
|
|
35
|
-
closeKeyAriaLabel: string
|
|
36
|
-
}
|
|
34
|
+
closeKeyAriaLabel: string
|
|
35
|
+
}
|
|
37
36
|
}
|
|
38
37
|
/**
|
|
39
38
|
* Locale configuration type for search box.
|
|
40
39
|
*
|
|
41
40
|
* 搜索框的语言配置类型。
|
|
42
41
|
*/
|
|
43
|
-
export type SearchBoxLocales = LocaleConfig<SearchLocaleOptions
|
|
42
|
+
export type SearchBoxLocales = LocaleConfig<SearchLocaleOptions>
|
|
44
43
|
/**
|
|
45
44
|
* Options for the search plugin.
|
|
46
45
|
*
|
|
@@ -48,7 +47,7 @@ export type SearchBoxLocales = LocaleConfig<SearchLocaleOptions>;
|
|
|
48
47
|
*/
|
|
49
48
|
export interface SearchPluginOptions extends SearchOptions {
|
|
50
49
|
/** Locale-specific search configurations / 特定语言的搜索配置 */
|
|
51
|
-
locales?: SearchBoxLocales
|
|
50
|
+
locales?: SearchBoxLocales
|
|
52
51
|
/**
|
|
53
52
|
* Function to determine if a page should be indexed.
|
|
54
53
|
*
|
|
@@ -57,7 +56,7 @@ export interface SearchPluginOptions extends SearchOptions {
|
|
|
57
56
|
* @param page - VuePress page object / VuePress 页面对象
|
|
58
57
|
* @returns Whether the page should be searchable / 页面是否可搜索
|
|
59
58
|
*/
|
|
60
|
-
isSearchable?: (page: Page) => boolean
|
|
59
|
+
isSearchable?: (page: Page) => boolean
|
|
61
60
|
}
|
|
62
61
|
/**
|
|
63
62
|
* Search configuration options.
|
|
@@ -72,7 +71,7 @@ export interface SearchOptions {
|
|
|
72
71
|
*
|
|
73
72
|
* @default false
|
|
74
73
|
*/
|
|
75
|
-
disableQueryPersistence?: boolean
|
|
74
|
+
disableQueryPersistence?: boolean
|
|
76
75
|
/**
|
|
77
76
|
* MiniSearch configuration options.
|
|
78
77
|
*
|
|
@@ -86,7 +85,7 @@ export interface SearchOptions {
|
|
|
86
85
|
*
|
|
87
86
|
* @see https://lucaong.github.io/minisearch/modules/_minisearch_.html#options
|
|
88
87
|
*/
|
|
89
|
-
options?: Pick<Options, 'extractField' | 'tokenize' | 'processTerm'
|
|
88
|
+
options?: Pick<Options, 'extractField' | 'tokenize' | 'processTerm'>
|
|
90
89
|
/**
|
|
91
90
|
* MiniSearch search options.
|
|
92
91
|
*
|
|
@@ -94,7 +93,6 @@ export interface SearchOptions {
|
|
|
94
93
|
*
|
|
95
94
|
* @see https://lucaong.github.io/minisearch/modules/_minisearch_.html#searchoptions-1
|
|
96
95
|
*/
|
|
97
|
-
searchOptions?: Options['searchOptions']
|
|
98
|
-
}
|
|
96
|
+
searchOptions?: Options['searchOptions']
|
|
97
|
+
}
|
|
99
98
|
}
|
|
100
|
-
//#endregion
|
package/dist/shared/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {}
|
|
1
|
+
export {}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuepress-plume/plugin-search",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.0-rc.
|
|
4
|
+
"version": "1.0.0-rc.211",
|
|
5
5
|
"description": "The Plugin for VuePress 2 - local search",
|
|
6
6
|
"author": "pengzhanbo <volodymyr@foxmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -41,7 +41,8 @@
|
|
|
41
41
|
"focus-trap": "^8.2.2",
|
|
42
42
|
"mark.js": "^8.11.1",
|
|
43
43
|
"minisearch": "^7.2.0",
|
|
44
|
-
"p-map": "^7.0.
|
|
44
|
+
"p-map": "^7.0.8",
|
|
45
|
+
"sanitize-html": "^2.17.7",
|
|
45
46
|
"vue": "^3.5.42"
|
|
46
47
|
},
|
|
47
48
|
"publishConfig": {
|