@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.
@@ -1,19 +1,19 @@
1
- import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
2
- import * as __WEBPACK_EXTERNAL_MODULE__docsearch_react_bddc4633__ from "@docsearch/react";
3
- import * as __WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__ from "@rspress/runtime";
4
- import * as __WEBPACK_EXTERNAL_MODULE__theme_75e53063__ from "@theme";
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 * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
8
- const Hit = ({ hit, children })=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__theme_75e53063__.Link, {
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 = (0, __WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__.useNavigate)();
14
- const lang = (0, __WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__.useLang)();
13
+ const navigate = useNavigate();
14
+ const lang = useLang();
15
15
  const { translations, placeholder } = locales?.[lang] ?? {};
16
- (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
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__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.Fragment, {
31
- children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__docsearch_react_bddc4633__.DocSearch, {
30
+ return /*#__PURE__*/ jsx(Fragment, {
31
+ children: /*#__PURE__*/ jsx(DocSearch, {
32
32
  placeholder: placeholder,
33
33
  translations: translations,
34
34
  maxResultsPerGroup: 20,
@@ -1,5 +1,3 @@
1
- import * as __WEBPACK_EXTERNAL_MODULE__Search_js_267571c1__ from "./Search.js";
2
- import * as __WEBPACK_EXTERNAL_MODULE__locales_js_0c471cb7__ from "./locales.js";
3
- var __webpack_exports__Search = __WEBPACK_EXTERNAL_MODULE__Search_js_267571c1__.Search;
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.11",
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.1",
43
- "@rslib/core": "0.8.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.11"
51
+ "@rspress/shared": "2.0.0-beta.13"
52
52
  },
53
53
  "peerDependencies": {
54
- "@rspress/runtime": "^2.0.0-beta.11"
54
+ "@rspress/runtime": "^2.0.0-beta.13"
55
55
  },
56
56
  "engines": {
57
57
  "node": ">=18.0.0"