@rspress/core 2.0.5 → 2.0.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.
Files changed (265) hide show
  1. package/dist/0~1402.js +1 -0
  2. package/dist/{0~7675.423f6a06.js → 0~execa.js} +6 -5
  3. package/dist/1361.js +5 -0
  4. package/dist/1965.js +7 -0
  5. package/dist/4454.js +8 -0
  6. package/dist/{7744.421b464f.js → 4524.js} +20 -5
  7. package/dist/7397.js +18 -0
  8. package/dist/{5485.0bb24594.js → 8311.js} +5 -2
  9. package/dist/8474.js +4 -0
  10. package/dist/8885.js +4 -0
  11. package/dist/cli/index.js +2 -3
  12. package/dist/config/loadConfigFile.js +1 -2
  13. package/dist/eject-theme/components/Banner/index.tsx +1 -1
  14. package/dist/eject-theme/components/Button/index.tsx +1 -1
  15. package/dist/eject-theme/components/CodeBlock/index.scss +54 -1
  16. package/dist/eject-theme/components/CodeBlock/index.tsx +77 -7
  17. package/dist/eject-theme/components/CodeBlockRuntime/index.tsx +12 -2
  18. package/dist/eject-theme/components/CodeButtonGroup/CopyCodeButton.tsx +1 -1
  19. package/dist/eject-theme/components/CodeButtonGroup/index.tsx +15 -15
  20. package/dist/eject-theme/components/DocContent/docComponents/a.tsx +1 -1
  21. package/dist/eject-theme/components/DocContent/docComponents/pre.tsx +5 -1
  22. package/dist/eject-theme/components/DocContent/docComponents/title.tsx +6 -1
  23. package/dist/eject-theme/components/DocContent/index.tsx +1 -1
  24. package/dist/eject-theme/components/DocFooter/index.tsx +1 -1
  25. package/dist/eject-theme/components/EditLink/index.tsx +1 -1
  26. package/dist/eject-theme/components/FallbackHeading/index.tsx +4 -1
  27. package/dist/eject-theme/components/HomeFeature/index.tsx +5 -1
  28. package/dist/eject-theme/components/HomeFooter/index.tsx +1 -1
  29. package/dist/eject-theme/components/HomeHero/index.tsx +2 -2
  30. package/dist/eject-theme/components/HoverGroup/index.tsx +5 -2
  31. package/dist/eject-theme/components/Link/useLinkNavigate.ts +1 -1
  32. package/dist/eject-theme/components/Llms/LlmsCopyButton.tsx +3 -2
  33. package/dist/eject-theme/components/Llms/LlmsCopyRow.tsx +3 -2
  34. package/dist/eject-theme/components/Llms/LlmsOpenRow.tsx +1 -1
  35. package/dist/eject-theme/components/Llms/LlmsViewOptions.tsx +3 -2
  36. package/dist/eject-theme/components/Llms/copy.ts +12 -0
  37. package/dist/eject-theme/components/Nav/NavMenu.tsx +9 -2
  38. package/dist/eject-theme/components/Nav/index.tsx +1 -1
  39. package/dist/eject-theme/components/NavHamburger/index.tsx +6 -1
  40. package/dist/eject-theme/components/NavScreen/NavScreenAppearance.tsx +1 -1
  41. package/dist/eject-theme/components/NavScreen/NavScreenLangs.tsx +1 -1
  42. package/dist/eject-theme/components/NavScreen/NavScreenMenuItem.tsx +5 -1
  43. package/dist/eject-theme/components/NavScreen/NavScreenMenuOthers.tsx +1 -1
  44. package/dist/eject-theme/components/NavScreen/NavScreenVersions.tsx +1 -1
  45. package/dist/eject-theme/components/NavScreen/index.tsx +1 -1
  46. package/dist/eject-theme/components/NavTitle/index.tsx +1 -1
  47. package/dist/eject-theme/components/Outline/ScrollToTop.tsx +5 -1
  48. package/dist/eject-theme/components/Outline/index.tsx +1 -1
  49. package/dist/eject-theme/components/Overview/index.tsx +1 -1
  50. package/dist/eject-theme/components/OverviewGroup/index.tsx +2 -2
  51. package/dist/eject-theme/components/PackageManagerTabs/index.tsx +1 -1
  52. package/dist/eject-theme/components/PrevNextPage/index.tsx +1 -1
  53. package/dist/eject-theme/components/Root/index.tsx +1 -1
  54. package/dist/eject-theme/components/Search/NoSearchResult.tsx +1 -1
  55. package/dist/eject-theme/components/Search/SearchButton.tsx +1 -1
  56. package/dist/eject-theme/components/Search/SearchPanel.tsx +3 -1
  57. package/dist/eject-theme/components/Search/SuggestItem.tsx +1 -1
  58. package/dist/eject-theme/components/Search/index.tsx +1 -1
  59. package/dist/eject-theme/components/Sidebar/SidebarGroup.tsx +5 -1
  60. package/dist/eject-theme/components/Sidebar/SidebarItem.scss +0 -4
  61. package/dist/eject-theme/components/Sidebar/SidebarItem.tsx +1 -1
  62. package/dist/eject-theme/components/Sidebar/SidebarSectionHeader.tsx +1 -1
  63. package/dist/eject-theme/components/SidebarMenu/index.tsx +1 -1
  64. package/dist/eject-theme/components/SocialLinks/index.tsx +1 -1
  65. package/dist/eject-theme/components/SourceCode/index.tsx +1 -1
  66. package/dist/eject-theme/components/SvgWrapper/index.tsx +1 -1
  67. package/dist/eject-theme/components/SwitchAppearance/index.tsx +1 -1
  68. package/dist/eject-theme/components/Tabs/index.scss +13 -15
  69. package/dist/eject-theme/components/Tabs/index.tsx +1 -1
  70. package/dist/eject-theme/components/Tag/index.tsx +1 -1
  71. package/dist/eject-theme/components/Toc/TocItem.tsx +5 -1
  72. package/dist/eject-theme/components/Toc/index.tsx +1 -1
  73. package/dist/index.js +1 -3
  74. package/dist/node/PluginDriver.js +3 -8
  75. package/dist/node/auto-nav-sidebar/index.js +1 -2
  76. package/dist/node/auto-nav-sidebar/locales.js +1 -1
  77. package/dist/node/auto-nav-sidebar/normalize.js +3 -2
  78. package/dist/node/auto-nav-sidebar/utils.js +1 -2
  79. package/dist/node/auto-nav-sidebar/walk.js +1 -2
  80. package/dist/node/constants.js +1 -2
  81. package/dist/node/eject.js +1 -1
  82. package/dist/node/initRsbuild.js +2 -4
  83. package/dist/node/last-updated/index.js +1 -1
  84. package/dist/node/logger/hint.js +4 -1
  85. package/dist/node/mdx/options.js +1 -3
  86. package/dist/node/mdx/processor.js +1 -2
  87. package/dist/node/mdx/rehypePlugins/codeMeta.js +1 -1
  88. package/dist/node/mdx/rehypePlugins/headerAnchor.js +1 -2
  89. package/dist/node/mdx/rehypePlugins/shiki.d.ts +1 -1
  90. package/dist/node/mdx/rehypePlugins/shiki.js +2 -1
  91. package/dist/node/mdx/rehypePlugins/transformers/add-fold.d.ts +6 -0
  92. package/dist/node/mdx/rehypePlugins/transformers/add-fold.js +38 -0
  93. package/dist/node/mdx/rehypePlugins/transformers/index.d.ts +1 -0
  94. package/dist/node/mdx/rehypePlugins/transformers/index.js +1 -0
  95. package/dist/node/mdx/rehypePlugins/transformers/meta-highlight.js +1 -1
  96. package/dist/node/mdx/remarkPlugins/builtin.js +1 -1
  97. package/dist/node/mdx/remarkPlugins/fileCodeBlock.js +1 -2
  98. package/dist/node/mdx/remarkPlugins/image.js +1 -1
  99. package/dist/node/mdx/remarkPlugins/link.js +1 -2
  100. package/dist/node/mdx/remarkPlugins/toc.js +1 -1
  101. package/dist/node/medium-zoom/index.js +1 -1
  102. package/dist/node/route/RoutePage.js +1 -1
  103. package/dist/node/route/RouteService.js +1 -3
  104. package/dist/node/route/extractPageData.js +1 -3
  105. package/dist/node/route/normalizeRoutePath.js +1 -2
  106. package/dist/node/runtimeModule/i18n.js +2 -3
  107. package/dist/node/runtimeModule/pageData/createPageData.js +1 -2
  108. package/dist/node/runtimeModule/pageData/rsbuildPlugin.js +1 -2
  109. package/dist/node/runtimeModule/searchHooks.js +1 -1
  110. package/dist/node/runtimeModule/siteData/createSiteData.js +1 -1
  111. package/dist/node/runtimeModule/siteData/normalizeThemeConfig.js +1 -1
  112. package/dist/node/runtimeModule/siteData/rsbuildPlugin.js +1 -1
  113. package/dist/node/serve.js +1 -1
  114. package/dist/node/ssg/renderPage.js +1 -2
  115. package/dist/node/ssg/renderPageWorker.js +2 -2
  116. package/dist/node/ssg/renderPages.js +3 -4
  117. package/dist/node/ssg/rsbuildPluginSSG.js +1 -2
  118. package/dist/node/ssg/ssgEnv.d.ts +1 -1
  119. package/dist/node/ssg/ssgEnv.js +2 -2
  120. package/dist/node/ssg-md/llms/emitLlmsTxt.js +5 -7
  121. package/dist/node/ssg-md/llms/llmsTxt.js +1 -2
  122. package/dist/node/ssg-md/remarkSplitMdx.js +1 -2
  123. package/dist/node/ssg-md/renderPage.js +1 -2
  124. package/dist/node/ssg-md/renderPages.js +2 -2
  125. package/dist/node/ssg-md/rsbuildPluginSSGMD.js +1 -2
  126. package/dist/node/utils/checkLanguageParity.js +1 -1
  127. package/dist/node/utils/createHash.js +1 -1
  128. package/dist/node/utils/error.js +1 -1
  129. package/dist/node/utils/flattenMdxContent.js +1 -3
  130. package/dist/node/utils/fs.js +1 -1
  131. package/dist/node/utils/getPageKey.js +1 -1
  132. package/dist/node/utils/normalizePath.js +1 -2
  133. package/dist/node/utils/reactAlias.js +15 -10
  134. package/dist/runtime/index.js +20 -21
  135. package/dist/runtime/ssrMdServerEntry.js +2 -2
  136. package/dist/runtime/ssrServerEntry.js +2 -2
  137. package/dist/runtime/utils.d.ts +1 -1
  138. package/dist/runtime/utils.js +1 -1
  139. package/dist/shiki-transformers.js +1 -0
  140. package/dist/theme/assets/arrow-down.js +1 -1
  141. package/dist/theme/assets/arrow-right.js +1 -1
  142. package/dist/theme/assets/close.js +1 -1
  143. package/dist/theme/assets/copy.js +1 -1
  144. package/dist/theme/assets/deprecated.js +1 -1
  145. package/dist/theme/assets/down.js +1 -1
  146. package/dist/theme/assets/edit.js +1 -1
  147. package/dist/theme/assets/empty.js +1 -1
  148. package/dist/theme/assets/experimental.js +1 -1
  149. package/dist/theme/assets/external-link.js +1 -1
  150. package/dist/theme/assets/file.js +1 -1
  151. package/dist/theme/assets/github.js +1 -1
  152. package/dist/theme/assets/gitlab.js +1 -1
  153. package/dist/theme/assets/header.js +1 -1
  154. package/dist/theme/assets/jump.js +1 -1
  155. package/dist/theme/assets/link.js +1 -1
  156. package/dist/theme/assets/loading.js +1 -1
  157. package/dist/theme/assets/menu.js +1 -1
  158. package/dist/theme/assets/moon.js +1 -1
  159. package/dist/theme/assets/scroll-to-top.js +1 -1
  160. package/dist/theme/assets/search.js +1 -1
  161. package/dist/theme/assets/small-menu.js +1 -1
  162. package/dist/theme/assets/success.js +1 -1
  163. package/dist/theme/assets/sun.js +1 -1
  164. package/dist/theme/assets/title.js +1 -1
  165. package/dist/theme/assets/wrap.js +1 -1
  166. package/dist/theme/assets/wrapped.js +1 -1
  167. package/dist/theme/components/Banner/index.js +1 -1
  168. package/dist/theme/components/Button/index.js +1 -1
  169. package/dist/theme/components/Callout/index.js +2 -1
  170. package/dist/theme/components/CodeBlock/index.css +49 -1
  171. package/dist/theme/components/CodeBlock/index.d.ts +11 -3
  172. package/dist/theme/components/CodeBlock/index.js +51 -6
  173. package/dist/theme/components/CodeBlockRuntime/index.d.ts +2 -2
  174. package/dist/theme/components/CodeBlockRuntime/index.js +10 -2
  175. package/dist/theme/components/CodeButtonGroup/CopyCodeButton.js +1 -1
  176. package/dist/theme/components/CodeButtonGroup/index.d.ts +6 -6
  177. package/dist/theme/components/CodeButtonGroup/index.js +10 -10
  178. package/dist/theme/components/DocContent/docComponents/a.js +1 -1
  179. package/dist/theme/components/DocContent/docComponents/pre.d.ts +2 -2
  180. package/dist/theme/components/DocContent/docComponents/pre.js +4 -2
  181. package/dist/theme/components/DocContent/docComponents/title.js +1 -1
  182. package/dist/theme/components/DocContent/index.js +1 -1
  183. package/dist/theme/components/DocFooter/index.js +1 -1
  184. package/dist/theme/components/EditLink/index.js +1 -1
  185. package/dist/theme/components/FallbackHeading/index.js +1 -1
  186. package/dist/theme/components/HomeBackground/index.css +1 -0
  187. package/dist/theme/components/HomeFeature/index.css +3 -3
  188. package/dist/theme/components/HomeFeature/index.js +1 -1
  189. package/dist/theme/components/HomeFooter/index.js +1 -1
  190. package/dist/theme/components/HomeHero/index.d.ts +1 -1
  191. package/dist/theme/components/HomeHero/index.js +1 -1
  192. package/dist/theme/components/HoverGroup/index.d.ts +1 -1
  193. package/dist/theme/components/HoverGroup/index.js +4 -1
  194. package/dist/theme/components/Link/useLinkNavigate.d.ts +1 -1
  195. package/dist/theme/components/Llms/LlmsCopyButton.js +4 -3
  196. package/dist/theme/components/Llms/LlmsCopyRow.js +3 -2
  197. package/dist/theme/components/Llms/LlmsOpenRow.js +1 -1
  198. package/dist/theme/components/Llms/LlmsViewOptions.js +4 -3
  199. package/dist/theme/components/Llms/copy.d.ts +1 -0
  200. package/dist/theme/components/Llms/copy.js +9 -0
  201. package/dist/theme/components/Llms/index.css +1 -0
  202. package/dist/theme/components/Llms/index.js +4 -5
  203. package/dist/theme/components/Nav/NavMenu.d.ts +1 -1
  204. package/dist/theme/components/Nav/NavMenu.js +2 -1
  205. package/dist/theme/components/Nav/index.css +1 -1
  206. package/dist/theme/components/Nav/index.js +1 -1
  207. package/dist/theme/components/NavHamburger/index.js +1 -1
  208. package/dist/theme/components/NavScreen/NavScreenAppearance.js +1 -1
  209. package/dist/theme/components/NavScreen/NavScreenLangs.js +1 -1
  210. package/dist/theme/components/NavScreen/NavScreenMenuItem.d.ts +2 -1
  211. package/dist/theme/components/NavScreen/NavScreenMenuItem.js +4 -2
  212. package/dist/theme/components/NavScreen/NavScreenMenuOthers.js +1 -1
  213. package/dist/theme/components/NavScreen/NavScreenVersions.js +1 -1
  214. package/dist/theme/components/NavScreen/index.css +1 -1
  215. package/dist/theme/components/NavScreen/index.js +1 -1
  216. package/dist/theme/components/NavTitle/index.js +1 -1
  217. package/dist/theme/components/Outline/ScrollToTop.js +1 -1
  218. package/dist/theme/components/Outline/index.js +1 -1
  219. package/dist/theme/components/Overview/index.d.ts +1 -1
  220. package/dist/theme/components/Overview/index.js +1 -1
  221. package/dist/theme/components/OverviewGroup/icons/plugin.js +1 -1
  222. package/dist/theme/components/OverviewGroup/index.css +1 -0
  223. package/dist/theme/components/OverviewGroup/index.js +1 -1
  224. package/dist/theme/components/PackageManagerTabs/index.js +1 -1
  225. package/dist/theme/components/PrevNextPage/index.js +1 -1
  226. package/dist/theme/components/Root/index.d.ts +1 -1
  227. package/dist/theme/components/Search/NoSearchResult.js +1 -1
  228. package/dist/theme/components/Search/SearchButton.js +1 -1
  229. package/dist/theme/components/Search/SearchPanel.js +3 -2
  230. package/dist/theme/components/Search/SuggestItem.js +1 -1
  231. package/dist/theme/components/Search/index.js +1 -1
  232. package/dist/theme/components/Search/logic/providers/LocalProvider.js +1 -1
  233. package/dist/theme/components/Sidebar/SidebarGroup.js +1 -1
  234. package/dist/theme/components/Sidebar/SidebarItem.css +0 -4
  235. package/dist/theme/components/Sidebar/SidebarItem.js +1 -1
  236. package/dist/theme/components/Sidebar/SidebarSectionHeader.js +1 -1
  237. package/dist/theme/components/SidebarMenu/index.js +1 -1
  238. package/dist/theme/components/SocialLinks/index.js +1 -1
  239. package/dist/theme/components/SourceCode/index.js +1 -1
  240. package/dist/theme/components/SvgWrapper/index.js +1 -1
  241. package/dist/theme/components/SwitchAppearance/index.js +1 -1
  242. package/dist/theme/components/Tabs/index.css +14 -8
  243. package/dist/theme/components/Tabs/index.js +1 -1
  244. package/dist/theme/components/Tag/index.js +1 -1
  245. package/dist/theme/components/Toc/TocItem.css +1 -1
  246. package/dist/theme/components/Toc/TocItem.js +1 -1
  247. package/dist/theme/components/Toc/index.js +1 -1
  248. package/dist/theme/index.js +66 -67
  249. package/dist/theme/layout/DocLayout/index.css +11 -11
  250. package/dist/theme/layout/DocLayout/index.js +1 -1
  251. package/dist/theme/layout/HomeLayout/index.js +1 -1
  252. package/dist/theme/layout/Layout/index.d.ts +2 -2
  253. package/dist/theme/layout/Layout/index.js +16 -6
  254. package/dist/theme/layout/NotFountLayout/index.js +1 -1
  255. package/dist/theme/styles/base.css +7 -4
  256. package/dist/theme/styles/preflight.css +2 -0
  257. package/dist/theme/styles/vars/home-vars.css +28 -4
  258. package/nav-json-schema.json +3 -0
  259. package/package.json +14 -14
  260. package/dist/6289.29817fb4.js +0 -4
  261. package/dist/9348.1beb3e25.js +0 -11
  262. package/dist/cli/index.44f3184c.js +0 -2
  263. package/dist/node/mdx/loader.15134034.js +0 -9
  264. /package/dist/{node/ssg/renderPageWorker.165b5d46.js → 9224.js} +0 -0
  265. /package/dist/{rslib-runtime.99091bf6.js → rslib-runtime.js} +0 -0
@@ -1,5 +1,5 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { Link } from "@theme";
2
+ import { Link } from "@rspress/core/theme";
3
3
  const A = (props)=>/*#__PURE__*/ jsx(Link, {
4
4
  ...props
5
5
  });
@@ -1,3 +1,3 @@
1
- import { type CodeBlockProps } from '@theme';
1
+ import { type CodeBlockProps } from '@rspress/core/theme';
2
2
  export type ShikiPreProps = CodeBlockProps & React.HTMLAttributes<HTMLPreElement>;
3
- export declare function ShikiPre({ title, lang, wrapCode, lineNumbers, containerElementClassName, codeButtonGroupProps, ...otherProps }: ShikiPreProps): import("react/jsx-runtime").JSX.Element;
3
+ export declare function ShikiPre({ title, lang, wrapCode, lineNumbers, fold, height, containerElementClassName, codeButtonGroupProps, ...otherProps }: ShikiPreProps): import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,13 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { CodeBlock } from "@theme";
3
- function ShikiPre({ title, lang, wrapCode, lineNumbers, containerElementClassName, codeButtonGroupProps, ...otherProps }) {
2
+ import { CodeBlock } from "@rspress/core/theme";
3
+ function ShikiPre({ title, lang, wrapCode, lineNumbers, fold, height, containerElementClassName, codeButtonGroupProps, ...otherProps }) {
4
4
  return /*#__PURE__*/ jsx(CodeBlock, {
5
5
  title: title,
6
6
  lang: lang,
7
7
  wrapCode: wrapCode,
8
8
  lineNumbers: lineNumbers,
9
+ fold: fold,
10
+ height: height,
9
11
  containerElementClassName: containerElementClassName,
10
12
  codeButtonGroupProps: codeButtonGroupProps,
11
13
  children: /*#__PURE__*/ jsx("pre", {
@@ -1,6 +1,6 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useFrontmatter, useSite } from "@rspress/core/runtime";
3
- import { LlmsContainer, LlmsCopyButton, LlmsViewOptions, Tag } from "@theme";
3
+ import { LlmsContainer, LlmsCopyButton, LlmsViewOptions, Tag } from "@rspress/core/theme";
4
4
  import clsx from "clsx";
5
5
  const H1 = (props)=>{
6
6
  const { className, children, ...rest } = props;
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { MDXProvider } from "@mdx-js/react";
3
3
  import { Content, usePage, useSite } from "@rspress/core/runtime";
4
- import { Callout, FallbackHeading, getCustomMDXComponent, useScrollAfterNav } from "@theme";
4
+ import { Callout, FallbackHeading, getCustomMDXComponent, useScrollAfterNav } from "@rspress/core/theme";
5
5
  import "./doc.css";
6
6
  function FallbackTitle() {
7
7
  const { site } = useSite();
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { EditLink, LastUpdated, PrevNextPage } from "@theme";
2
+ import { EditLink, LastUpdated, PrevNextPage } from "@rspress/core/theme";
3
3
  import "./index.css";
4
4
  function DocFooter() {
5
5
  return /*#__PURE__*/ jsxs("footer", {
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { IconEdit, Link, SvgWrapper } from "@theme";
2
+ import { IconEdit, Link, SvgWrapper } from "@rspress/core/theme";
3
3
  import "./index.css";
4
4
  import { useEditLink } from "./useEditLink.js";
5
5
  function EditLink({ isOutline }) {
@@ -1,5 +1,5 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import { getCustomMDXComponent, renderInlineMarkdown } from "@theme";
2
+ import { getCustomMDXComponent, renderInlineMarkdown } from "@rspress/core/theme";
3
3
  import { slug } from "github-slugger";
4
4
  import { useMemo } from "react";
5
5
  const getHeadingMap = ()=>{
@@ -2,6 +2,7 @@
2
2
  z-index: -1;
3
3
  filter: blur(2px);
4
4
  pointer-events: none;
5
+ -webkit-user-select: none;
5
6
  user-select: none;
6
7
  background: var(--rp-home-background-bg);
7
8
  width: 100%;
@@ -26,17 +26,17 @@
26
26
  }
27
27
 
28
28
  .rp-home-feature__item--span-3, .rp-home-feature__item--span-6 {
29
- width: calc((100% - 2 * var(--rp-home-feature-gap)) / 3);
29
+ width: calc((100% - 2*var(--rp-home-feature-gap))/3);
30
30
  }
31
31
  }
32
32
 
33
33
  @media (width >= 960px) {
34
34
  .rp-home-feature__item--span-3 {
35
- width: calc((100% - 3 * var(--rp-home-feature-gap)) / 4);
35
+ width: calc((100% - 3*var(--rp-home-feature-gap))/4);
36
36
  }
37
37
 
38
38
  .rp-home-feature__item--span-4 {
39
- width: calc((100% - 2 * var(--rp-home-feature-gap)) / 3);
39
+ width: calc((100% - 2*var(--rp-home-feature-gap))/3);
40
40
  }
41
41
 
42
42
  .rp-home-feature__item--span-6 {
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useFrontmatter } from "@rspress/core/runtime";
3
- import { SvgWrapper, renderHtmlOrText, useLinkNavigate } from "@theme";
3
+ import { SvgWrapper, renderHtmlOrText, useLinkNavigate } from "@rspress/core/theme";
4
4
  import "./index.css";
5
5
  import { useCardAnimation } from "./useCardAnimation.js";
6
6
  const getGridClass = (feature)=>{
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { useSite } from "@rspress/core/runtime";
3
- import { renderHtmlOrText } from "@theme";
3
+ import { renderHtmlOrText } from "@rspress/core/theme";
4
4
  import "./index.css";
5
5
  function HomeFooter() {
6
6
  const { site } = useSite();
@@ -5,5 +5,5 @@ interface HomeHeroProps {
5
5
  image?: React.ReactNode;
6
6
  }
7
7
  declare function HomeHero({ beforeHeroActions, afterHeroActions, image, }: HomeHeroProps): import("react/jsx-runtime").JSX.Element;
8
- export { HomeHero };
9
8
  export type { HomeHeroProps };
9
+ export { HomeHero };
@@ -1,6 +1,6 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { normalizeImagePath, useFrontmatter } from "@rspress/core/runtime";
3
- import { Button, Link, renderHtmlOrText } from "@theme";
3
+ import { Button, Link, renderHtmlOrText } from "@rspress/core/theme";
4
4
  import "./index.css";
5
5
  import clsx from "clsx";
6
6
  const DEFAULT_HERO = {
@@ -12,5 +12,5 @@ interface HoverGroupProps {
12
12
  activeMatcher?: (item: Items[number]) => boolean;
13
13
  }
14
14
  declare function HoverGroup({ items, customChildren, isOpen, position, activeMatcher, }: HoverGroupProps): import("react/jsx-runtime").JSX.Element;
15
- export { HoverGroup };
16
15
  export type { HoverGroupProps, Items };
16
+ export { HoverGroup };
@@ -1,6 +1,6 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { matchNavbar, useLocation } from "@rspress/core/runtime";
3
- import { Link, Tag } from "@theme";
3
+ import { Link, Tag } from "@rspress/core/theme";
4
4
  import clsx from "clsx";
5
5
  import "./index.css";
6
6
  function HoverGroupItem({ item, activeMatcher, depth = 0 }) {
@@ -17,6 +17,7 @@ function HoverGroupItem({ item, activeMatcher, depth = 0 }) {
17
17
  "data-depth": depth,
18
18
  children: /*#__PURE__*/ jsxs(Link, {
19
19
  href: item.link,
20
+ download: 'download' in item ? item.download : void 0,
20
21
  "aria-label": item.text,
21
22
  className: "rp-hover-group__item__link",
22
23
  lang: item.lang,
@@ -40,6 +41,7 @@ function HoverGroupItem({ item, activeMatcher, depth = 0 }) {
40
41
  }
41
42
  if ('link' in item) {
42
43
  const { text, link, lang, rel } = item;
44
+ const download = 'download' in item ? item.download : void 0;
43
45
  const isActiveItem = activeMatcher ? activeMatcher(item) : matchNavbar(item, pathname);
44
46
  return /*#__PURE__*/ jsx("li", {
45
47
  className: clsx('rp-hover-group__item', {
@@ -51,6 +53,7 @@ function HoverGroupItem({ item, activeMatcher, depth = 0 }) {
51
53
  "data-depth": depth,
52
54
  children: link ? /*#__PURE__*/ jsxs(Link, {
53
55
  href: link,
56
+ download: download,
54
57
  "aria-label": text,
55
58
  className: "rp-hover-group__item__link",
56
59
  lang: lang,
@@ -6,7 +6,7 @@ export declare function getHref(href: string): {
6
6
  linkType: LinkType;
7
7
  };
8
8
  /**
9
- * For import { Link } from '@theme';
9
+ * For import { Link } from '@rspress/core/theme';
10
10
  * useNavigate with preload logic
11
11
  */
12
12
  export declare function useLinkNavigate({ startTransition }?: {
@@ -1,11 +1,12 @@
1
- /*! For license information please see LlmsCopyButton.js.LICENSE.txt */
1
+ /*! LICENSE: LlmsCopyButton.js.LICENSE.txt */
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import { useI18n } from "@rspress/core/runtime";
4
- import { IconCopy, IconSuccess } from "@theme";
4
+ import { IconCopy, IconSuccess } from "@rspress/core/theme";
5
5
  import { useCallback, useRef, useState } from "react";
6
6
  import { SvgWrapper } from "../SvgWrapper/index.js";
7
7
  import "./index.css";
8
8
  import "./LlmsCopyButton.css";
9
+ import { copyToClipboard } from "./copy.js";
9
10
  import { useMdUrl } from "./useMdUrl.js";
10
11
  /**
11
12
  * Inspired from fumadocs docsite
@@ -25,7 +26,7 @@ function LlmsCopyButton(props) {
25
26
  try {
26
27
  const content = cache.get(url) ?? await fetch(url).then((res)=>res.text());
27
28
  cache.set(url, content);
28
- await navigator.clipboard.writeText(content);
29
+ await copyToClipboard(content);
29
30
  } finally{
30
31
  setLoading(false);
31
32
  setFinished(true);
@@ -1,7 +1,8 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useI18n } from "@rspress/core/runtime";
3
- import { IconCopy, IconSuccess, SvgWrapper } from "@theme";
3
+ import { IconCopy, IconSuccess, SvgWrapper } from "@rspress/core/theme";
4
4
  import { useCallback, useRef, useState } from "react";
5
+ import { copyToClipboard } from "./copy.js";
5
6
  import { useMdUrl } from "./useMdUrl.js";
6
7
  const cache = new Map();
7
8
  function LlmsCopyRow() {
@@ -16,7 +17,7 @@ function LlmsCopyRow() {
16
17
  try {
17
18
  const content = cache.get(pathname) ?? await fetch(pathname).then((res)=>res.text());
18
19
  cache.set(pathname, content);
19
- await navigator.clipboard.writeText(content);
20
+ await copyToClipboard(content);
20
21
  } finally{
21
22
  setLoading(false);
22
23
  setFinished(true);
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useI18n, useSite } from "@rspress/core/runtime";
3
- import { IconExternalLink, SvgWrapper } from "@theme";
3
+ import { IconExternalLink, SvgWrapper } from "@rspress/core/theme";
4
4
  import { useEffect, useMemo, useRef, useState } from "react";
5
5
  import "./LlmsOpenRow.css";
6
6
  import "./LlmsViewOptions.css";
@@ -1,11 +1,12 @@
1
- /*! For license information please see LlmsViewOptions.js.LICENSE.txt */
1
+ /*! LICENSE: LlmsViewOptions.js.LICENSE.txt */
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import { useI18n, useSite } from "@rspress/core/runtime";
4
- import { IconDown, IconExternalLink, IconLink } from "@theme";
4
+ import { IconDown, IconExternalLink, IconLink } from "@rspress/core/theme";
5
5
  import { useEffect, useMemo, useRef, useState } from "react";
6
6
  import { SvgWrapper } from "../SvgWrapper/index.js";
7
7
  import "./index.css";
8
8
  import "./LlmsViewOptions.css";
9
+ import { copyToClipboard } from "./copy.js";
9
10
  import { useMdUrl } from "./useMdUrl.js";
10
11
  /**
11
12
  * Inspired from fumadocs docsite
@@ -46,7 +47,7 @@ function LlmsViewOptions({ options: propsOptions }) {
46
47
  icon: IconLink
47
48
  }),
48
49
  onClick: ()=>{
49
- navigator.clipboard.writeText(fullMarkdownUrl);
50
+ copyToClipboard(fullMarkdownUrl);
50
51
  }
51
52
  },
52
53
  chatgpt: {
@@ -0,0 +1 @@
1
+ export declare function copyToClipboard(text: string): Promise<void>;
@@ -0,0 +1,9 @@
1
+ import copy_to_clipboard from "copy-to-clipboard";
2
+ async function copyToClipboard(text) {
3
+ if (navigator.clipboard?.writeText) try {
4
+ await navigator.clipboard.writeText(text);
5
+ return;
6
+ } catch {}
7
+ copy_to_clipboard(text);
8
+ }
9
+ export { copyToClipboard };
@@ -3,6 +3,7 @@
3
3
  background: var(--rp-c-bg);
4
4
  height: 36px;
5
5
  color: var(--rp-c-text-2);
6
+ -webkit-user-select: none;
6
7
  user-select: none;
7
8
  white-space: nowrap;
8
9
  cursor: pointer;
@@ -1,5 +1,4 @@
1
- import { LlmsContainer } from "./LlmsContainer.js";
2
- import { LlmsCopyButton } from "./LlmsCopyButton.js";
3
- import { LlmsViewOptions } from "./LlmsViewOptions.js";
4
- import { useMdUrl } from "./useMdUrl.js";
5
- export { LlmsContainer, LlmsCopyButton, LlmsViewOptions, useMdUrl };
1
+ export { LlmsContainer } from "./LlmsContainer.js";
2
+ export { LlmsCopyButton } from "./LlmsCopyButton.js";
3
+ export { LlmsViewOptions } from "./LlmsViewOptions.js";
4
+ export { useMdUrl } from "./useMdUrl.js";
@@ -1,5 +1,5 @@
1
1
  import type { NavItem, NavItemWithChildren, NavItemWithLink, NavItemWithLinkAndChildren } from '@rspress/core';
2
- import type { HoverGroupProps } from '@theme';
2
+ import type { HoverGroupProps } from '@rspress/core/theme';
3
3
  import { type ReactNode } from 'react';
4
4
  import './NavMenu.scss';
5
5
  export declare const SvgDown: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { matchNavbar, useLocation } from "@rspress/core/runtime";
3
- import { IconArrowDown, Link, SvgWrapper, Tag, useHoverGroup } from "@theme";
3
+ import { IconArrowDown, Link, SvgWrapper, Tag, useHoverGroup } from "@rspress/core/theme";
4
4
  import clsx from "clsx";
5
5
  import { useMemo } from "react";
6
6
  import { useLangsMenu, useVersionsMenu } from "./hooks.js";
@@ -13,6 +13,7 @@ function NavMenuItemInner({ menuItem, children }) {
13
13
  return /*#__PURE__*/ jsx(Fragment, {
14
14
  children: 'link' in menuItem && 'string' == typeof menuItem.link ? /*#__PURE__*/ jsxs(Link, {
15
15
  href: menuItem.link,
16
+ download: menuItem.download,
16
17
  className: "rp-nav-menu__item__container",
17
18
  hrefLang: menuItem.lang,
18
19
  lang: menuItem.lang,
@@ -19,7 +19,7 @@
19
19
 
20
20
  @media (width >= 1280px) {
21
21
  .rp-nav {
22
- --rp-nav-padding-x: max(calc(( 100vw - var(--rp-content-max-width) - var(--rp-sidebar-width) - var(--rp-outline-width)) / 2), 20px);
22
+ --rp-nav-padding-x: max(calc(( 100vw - var(--rp-content-max-width) - var(--rp-sidebar-width) - var(--rp-outline-width) ) / 2), 20px);
23
23
  padding: 0 var(--rp-nav-padding-x) 0 var(--rp-nav-padding-x);
24
24
  }
25
25
  }
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useNav, useSite } from "@rspress/core/runtime";
3
- import { NavHamburger, NavTitle, Search, SocialLinks, SwitchAppearance } from "@theme";
3
+ import { NavHamburger, NavTitle, Search, SocialLinks, SwitchAppearance } from "@rspress/core/theme";
4
4
  import "./index.css";
5
5
  import { NavLangs, NavMenu, NavMenuDivider, NavVersions } from "./NavMenu.js";
6
6
  function Nav(props) {
@@ -1,5 +1,5 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import { IconSmallMenu, SocialLinks, SvgWrapper, useHoverGroup } from "@theme";
2
+ import { IconSmallMenu, SocialLinks, SvgWrapper, useHoverGroup } from "@rspress/core/theme";
3
3
  import clsx from "clsx";
4
4
  import { createPortal } from "react-dom";
5
5
  import { NavVersions } from "../Nav/NavMenu.js";
@@ -1,6 +1,6 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { NoSSR, useI18n, useSite } from "@rspress/core/runtime";
3
- import { SwitchAppearance } from "@theme";
3
+ import { SwitchAppearance } from "@rspress/core/theme";
4
4
  import "./NavScreenAppearance.css";
5
5
  function NavScreenAppearance() {
6
6
  const { site } = useSite();
@@ -3,7 +3,7 @@ import { useState } from "react";
3
3
  import { useLangsMenu } from "../Nav/hooks.js";
4
4
  import "./NavScreenLangs.css";
5
5
  import { useI18n } from "@rspress/core/runtime";
6
- import { Link } from "@theme";
6
+ import { Link } from "@rspress/core/theme";
7
7
  import clsx from "clsx";
8
8
  import { SvgDown } from "./NavScreenMenuItem.js";
9
9
  function NavScreenLangs() {
@@ -5,13 +5,14 @@ interface NavScreenMenuItemWithLinkProps {
5
5
  menuItem: NavItemWithLink;
6
6
  }
7
7
  export declare const SvgDown: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
8
- export declare function NavScreenMenuItemRaw({ left, right, isOpen, isActive, onClick, href, }: {
8
+ export declare function NavScreenMenuItemRaw({ left, right, isOpen, isActive, onClick, href, download, }: {
9
9
  left: React.ReactNode;
10
10
  right: React.ReactNode;
11
11
  isOpen?: boolean;
12
12
  isActive?: boolean;
13
13
  onClick?: () => void;
14
14
  href?: string;
15
+ download?: boolean;
15
16
  }): import("react/jsx-runtime").JSX.Element;
16
17
  export declare function NavScreenMenuItemWithLink({ menuItem, }: NavScreenMenuItemWithLinkProps): import("react/jsx-runtime").JSX.Element;
17
18
  interface NavScreenMenuItemWithChildrenProps {
@@ -1,6 +1,6 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { matchNavbar, useLocation } from "@rspress/core/runtime";
3
- import { IconArrowDown, Link, SvgWrapper, Tag } from "@theme";
3
+ import { IconArrowDown, Link, SvgWrapper, Tag } from "@rspress/core/theme";
4
4
  import clsx from "clsx";
5
5
  import { useMemo, useState } from "react";
6
6
  import "./NavScreenMenuItem.css";
@@ -8,11 +8,12 @@ const SvgDown = (props)=>/*#__PURE__*/ jsx(SvgWrapper, {
8
8
  icon: IconArrowDown,
9
9
  ...props
10
10
  });
11
- function NavScreenMenuItemRaw({ left, right, isOpen, isActive, onClick, href }) {
11
+ function NavScreenMenuItemRaw({ left, right, isOpen, isActive, onClick, href, download }) {
12
12
  if (href) return /*#__PURE__*/ jsxs(Link, {
13
13
  href: href,
14
14
  className: clsx('rp-nav-screen-menu-item', isOpen && 'rp-nav-screen-menu-item--open', isActive && 'rp-nav-screen-menu-item--active'),
15
15
  onClick: onClick,
16
+ download: download,
16
17
  children: [
17
18
  /*#__PURE__*/ jsx("div", {
18
19
  className: "rp-nav-screen-menu-item__left",
@@ -56,6 +57,7 @@ function NavScreenMenuItemWithLink({ menuItem }) {
56
57
  }),
57
58
  right: null,
58
59
  href: menuItem.link,
60
+ download: menuItem.download,
59
61
  isActive: isActive
60
62
  });
61
63
  }
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { NoSSR, useSite } from "@rspress/core/runtime";
3
- import { SocialLinks, SwitchAppearance } from "@theme";
3
+ import { SocialLinks, SwitchAppearance } from "@rspress/core/theme";
4
4
  import "./index.css";
5
5
  import { NavScreenLangs } from "./NavScreenLangs.js";
6
6
  import { NavScreenVersions } from "./NavScreenVersions.js";
@@ -3,7 +3,7 @@ import { useState } from "react";
3
3
  import { useVersionsMenu } from "../Nav/hooks.js";
4
4
  import "./NavScreenVersions.css";
5
5
  import { useI18n } from "@rspress/core/runtime";
6
- import { Link } from "@theme";
6
+ import { Link } from "@rspress/core/theme";
7
7
  import clsx from "clsx";
8
8
  import { SvgDown } from "./NavScreenMenuItem.js";
9
9
  function NavScreenVersions() {
@@ -1,5 +1,5 @@
1
1
  .rp-nav-screen {
2
- top: calc(var(--rp-nav-height) + var(--rp-banner-height, 0px));
2
+ top: calc(var(--rp-nav-height) + var(--rp-banner-height, 0px));
3
3
  background-color: var(--rp-c-bg);
4
4
  width: 100%;
5
5
  z-index: var(--rp-z-index-nav-screen);
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useNav } from "@rspress/core/runtime";
3
- import { SocialLinks } from "@theme";
3
+ import { SocialLinks } from "@rspress/core/theme";
4
4
  import { clearAllBodyScrollLocks, disableBodyScroll } from "body-scroll-lock";
5
5
  import clsx from "clsx";
6
6
  import { useEffect, useRef } from "react";
@@ -1,6 +1,6 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { addLeadingSlash, addTrailingSlash, normalizeImagePath, useLang, useSite } from "@rspress/core/runtime";
3
- import { Link } from "@theme";
3
+ import { Link } from "@rspress/core/theme";
4
4
  import { useMemo } from "react";
5
5
  import "./index.css";
6
6
  const NavTitle = ()=>{
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useI18n } from "@rspress/core/runtime";
3
- import { IconScrollToTop, SvgWrapper, useReadPercent } from "@theme";
3
+ import { IconScrollToTop, SvgWrapper, useReadPercent } from "@rspress/core/theme";
4
4
  function ScrollToTop() {
5
5
  const scrollToTop = ()=>{
6
6
  window.scrollTo({
@@ -1,6 +1,6 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useI18n, useSite } from "@rspress/core/runtime";
3
- import { EditLink, LlmsCopyRow, LlmsOpenRow, ReadPercent, Toc, useDynamicToc } from "@theme";
3
+ import { EditLink, LlmsCopyRow, LlmsOpenRow, ReadPercent, Toc, useDynamicToc } from "@rspress/core/theme";
4
4
  import "./index.css";
5
5
  import { ScrollToTop } from "./ScrollToTop.js";
6
6
  function Outline() {
@@ -1,4 +1,4 @@
1
- import { type Group } from '@theme';
1
+ import { type Group } from '@rspress/core/theme';
2
2
  import './index.scss';
3
3
  export declare function Overview(props: {
4
4
  content?: React.ReactNode;
@@ -1,6 +1,6 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { isEqualPath, useI18n, usePageData, useSidebar } from "@rspress/core/runtime";
3
- import { FallbackHeading, OverviewGroup } from "@theme";
3
+ import { FallbackHeading, OverviewGroup } from "@rspress/core/theme";
4
4
  import { useEffect, useMemo, useRef, useState } from "react";
5
5
  import { isSidebarDivider, isSidebarSectionHeader, isSidebarSingleFile } from "../Sidebar/utils.js";
6
6
  import "./index.css";
@@ -14,4 +14,4 @@ const SvgPlugin = (props)=>/*#__PURE__*/ jsx("svg", {
14
14
  })
15
15
  });
16
16
  var icons_plugin = SvgPlugin;
17
- export { icons_plugin as default };
17
+ export default icons_plugin;
@@ -69,6 +69,7 @@
69
69
  }
70
70
 
71
71
  .rp-overview-group__item__title__icon {
72
+ -webkit-user-select: none;
72
73
  user-select: none;
73
74
  pointer-events: none;
74
75
  color: var(--rp-c-text-1);
@@ -1,5 +1,5 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import { FallbackHeading, Link, SvgWrapper, renderInlineMarkdown } from "@theme";
2
+ import { FallbackHeading, Link, SvgWrapper, renderInlineMarkdown } from "@rspress/core/theme";
3
3
  import "./index.css";
4
4
  import { routePathToMdPath } from "@rspress/core/runtime";
5
5
  import { useMemo } from "react";
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Tab, Tabs, getCustomMDXComponent } from "@theme";
2
+ import { Tab, Tabs, getCustomMDXComponent } from "@rspress/core/theme";
3
3
  import { useMemo } from "react";
4
4
  import { Bun } from "./icons/Bun.js";
5
5
  import { Deno } from "./icons/Deno.js";
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useI18n } from "@rspress/core/runtime";
3
- import { IconArrowRight, Link, SvgWrapper, renderInlineMarkdown, usePrevNextPage } from "@theme";
3
+ import { IconArrowRight, Link, SvgWrapper, renderInlineMarkdown, usePrevNextPage } from "@rspress/core/theme";
4
4
  import clsx from "clsx";
5
5
  import "./index.css";
6
6
  function PrevNextPage() {
@@ -21,7 +21,7 @@ export interface RootProps {
21
21
  * @example
22
22
  * Default usage (no customization needed):
23
23
  * ```tsx
24
- * import { Root } from '@theme';
24
+ * import { Root } from '@rspress/core/theme';
25
25
  *
26
26
  * function App() {
27
27
  * return (
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useI18n } from "@rspress/core/runtime";
3
- import { IconEmpty, SvgWrapper } from "@theme";
3
+ import { IconEmpty, SvgWrapper } from "@rspress/core/theme";
4
4
  import "./NoSearchResult.css";
5
5
  function NoSearchResult({ query }) {
6
6
  const t = useI18n();
@@ -1,6 +1,6 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useI18n } from "@rspress/core/runtime";
3
- import { IconSearch, SvgWrapper } from "@theme";
3
+ import { IconSearch, SvgWrapper } from "@rspress/core/theme";
4
4
  import { useEffect, useState } from "react";
5
5
  import "./SearchButton.css";
6
6
  function SearchButton({ setFocused }) {
@@ -1,15 +1,15 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useI18n, usePageData } from "@rspress/core/runtime";
3
- import { IconClose, IconLoading, IconSearch, SvgWrapper, Tab, Tabs, useLinkNavigate } from "@theme";
3
+ import { IconClose, IconLoading, IconSearch, SvgWrapper, Tab, Tabs, useLinkNavigate } from "@rspress/core/theme";
4
4
  import { debounce } from "lodash-es";
5
5
  import { useCallback, useEffect, useRef, useState } from "react";
6
6
  import { createPortal } from "react-dom";
7
+ import * as __rspack_external_virtual_search_hooks_9d01d01f from "virtual-search-hooks";
7
8
  import { PageSearcher } from "./logic/search.js";
8
9
  import { RenderType } from "./logic/types.js";
9
10
  import { NoSearchResult } from "./NoSearchResult.js";
10
11
  import "./SearchPanel.css";
11
12
  import { SuggestItem } from "./SuggestItem.js";
12
- import * as __rspack_external_virtual_search_hooks_9d01d01f from "virtual-search-hooks";
13
13
  const KEY_CODE = {
14
14
  ARROW_UP: 'ArrowUp',
15
15
  ARROW_DOWN: 'ArrowDown',
@@ -215,6 +215,7 @@ function SearchPanel({ focused, setFocused }) {
215
215
  }
216
216
  const currQuery = searchInputRef.current?.value;
217
217
  if (currQuery === newQuery) {
218
+ setCurrentSuggestionIndex(0);
218
219
  setSearchResult(searchResult || DEFAULT_RESULT);
219
220
  setIsSearching(false);
220
221
  }
@@ -1,5 +1,5 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import { IconFile, IconHeader, IconJump, IconTitle, Link, SvgWrapper } from "@theme";
2
+ import { IconFile, IconHeader, IconJump, IconTitle, Link, SvgWrapper } from "@rspress/core/theme";
3
3
  import { useRef } from "react";
4
4
  import "./SuggestItem.css";
5
5
  import { getSlicedStrByByteLength } from "./logic/util.js";
@@ -1,6 +1,6 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { NoSSR } from "@rspress/core/runtime";
3
- import { SearchButton, SearchPanel } from "@theme";
3
+ import { SearchButton, SearchPanel } from "@rspress/core/theme";
4
4
  import { useState } from "react";
5
5
  function Search() {
6
6
  const [focused, setFocused] = useState(false);