@rspress/plugin-algolia 2.0.0-beta.11 → 2.0.0-beta.13
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/runtime/Search.js +11 -11
- package/dist/runtime/index.js +3 -5
- package/package.json +5 -5
package/dist/runtime/Search.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DocSearch } from "@docsearch/react";
|
|
3
|
+
import { useLang, useNavigate } from "@rspress/runtime";
|
|
4
|
+
import { Link } from "@theme";
|
|
5
5
|
import "@docsearch/css";
|
|
6
6
|
import "./Search.css";
|
|
7
|
-
import
|
|
8
|
-
const Hit = ({ hit, children })=>/*#__PURE__*/
|
|
7
|
+
import { useEffect } from "react";
|
|
8
|
+
const Hit = ({ hit, children })=>/*#__PURE__*/ jsx(Link, {
|
|
9
9
|
href: hit.url,
|
|
10
10
|
children: children
|
|
11
11
|
});
|
|
12
12
|
function Search({ locales = {}, docSearchProps }) {
|
|
13
|
-
const navigate =
|
|
14
|
-
const lang =
|
|
13
|
+
const navigate = useNavigate();
|
|
14
|
+
const lang = useLang();
|
|
15
15
|
const { translations, placeholder } = locales?.[lang] ?? {};
|
|
16
|
-
|
|
16
|
+
useEffect(()=>{
|
|
17
17
|
const preconnect = document.createElement('link');
|
|
18
18
|
const appId = docSearchProps.appId;
|
|
19
19
|
preconnect.id = appId;
|
|
@@ -27,8 +27,8 @@ function Search({ locales = {}, docSearchProps }) {
|
|
|
27
27
|
}, [
|
|
28
28
|
docSearchProps.appId
|
|
29
29
|
]);
|
|
30
|
-
return /*#__PURE__*/
|
|
31
|
-
children: /*#__PURE__*/
|
|
30
|
+
return /*#__PURE__*/ jsx(Fragment, {
|
|
31
|
+
children: /*#__PURE__*/ jsx(DocSearch, {
|
|
32
32
|
placeholder: placeholder,
|
|
33
33
|
translations: translations,
|
|
34
34
|
maxResultsPerGroup: 20,
|
package/dist/runtime/index.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
var __webpack_exports__ZH_LOCALES = __WEBPACK_EXTERNAL_MODULE__locales_js_0c471cb7__.ZH_LOCALES;
|
|
5
|
-
export { __webpack_exports__Search as Search, __webpack_exports__ZH_LOCALES as ZH_LOCALES };
|
|
1
|
+
import { Search } from "./Search.js";
|
|
2
|
+
import { ZH_LOCALES } from "./locales.js";
|
|
3
|
+
export { Search, ZH_LOCALES };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspress/plugin-algolia",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.13",
|
|
4
4
|
"description": "A plugin for rspress to search with algolia in docs.",
|
|
5
5
|
"bugs": "https://github.com/web-infra-dev/rspress/issues",
|
|
6
6
|
"repository": {
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@microsoft/api-extractor": "^7.52.8",
|
|
42
|
-
"@rsbuild/plugin-react": "~1.3.
|
|
43
|
-
"@rslib/core": "0.
|
|
42
|
+
"@rsbuild/plugin-react": "~1.3.2",
|
|
43
|
+
"@rslib/core": "0.9.2",
|
|
44
44
|
"@types/node": "^22.8.1",
|
|
45
45
|
"@types/react": "^19.1.6",
|
|
46
46
|
"@types/react-dom": "^19.1.6",
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
"rsbuild-plugin-publint": "^0.3.2",
|
|
49
49
|
"typescript": "^5.8.2",
|
|
50
50
|
"@rspress/config": "1.0.0",
|
|
51
|
-
"@rspress/shared": "2.0.0-beta.
|
|
51
|
+
"@rspress/shared": "2.0.0-beta.13"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"@rspress/runtime": "^2.0.0-beta.
|
|
54
|
+
"@rspress/runtime": "^2.0.0-beta.13"
|
|
55
55
|
},
|
|
56
56
|
"engines": {
|
|
57
57
|
"node": ">=18.0.0"
|