@rspress/core 2.0.0-rc.0 → 2.0.0-rc.2

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 (298) hide show
  1. package/bin/rspress.js +1 -1
  2. package/dist/0~7675.989ee664.js +1791 -0
  3. package/dist/1218.3869bad6.js +2 -0
  4. package/dist/4669.12208c6a.js +2 -0
  5. package/dist/5313.6594aba0.js +63 -0
  6. package/dist/5485.2a0273cf.js +98 -0
  7. package/dist/6289.c67fe0d5.js +5 -0
  8. package/dist/7805.cadab34e.js +4 -0
  9. package/dist/8813.9da1f210.js +2 -0
  10. package/dist/cli/config/index.js +4 -0
  11. package/dist/cli/config/loadConfigFile.js +30 -0
  12. package/dist/cli/index.cb89dbd1.js +3 -0
  13. package/dist/cli/index.js +122 -0
  14. package/dist/eject-theme/components/Banner/index.tsx +3 -4
  15. package/dist/eject-theme/components/Button/index.scss +1 -6
  16. package/dist/eject-theme/components/Callout/index.scss +0 -2
  17. package/dist/eject-theme/components/CodeBlock/index.scss +4 -12
  18. package/dist/eject-theme/components/CodeBlock/index.tsx +6 -1
  19. package/dist/eject-theme/components/CodeButtonGroup/CopyCodeButton.tsx +1 -3
  20. package/dist/eject-theme/components/CodeButtonGroup/index.scss +5 -1
  21. package/dist/eject-theme/components/CodeButtonGroup/index.tsx +1 -3
  22. package/dist/eject-theme/components/DocContent/doc.scss +30 -9
  23. package/dist/eject-theme/components/DocContent/docComponents/table.tsx +10 -4
  24. package/dist/eject-theme/components/DocContent/index.tsx +5 -2
  25. package/dist/eject-theme/components/{DocContent/FallbackHeading.tsx → FallbackHeading/index.tsx} +20 -11
  26. package/dist/eject-theme/components/HoverGroup/index.scss +5 -1
  27. package/dist/eject-theme/components/HoverGroup/index.tsx +5 -1
  28. package/dist/eject-theme/components/Link/index.tsx +43 -9
  29. package/dist/eject-theme/components/Link/useLinkNavigate.ts +32 -16
  30. package/dist/eject-theme/components/Nav/NavMenu.scss +1 -0
  31. package/dist/eject-theme/components/Nav/NavMenu.tsx +2 -3
  32. package/dist/eject-theme/components/Nav/NavTitle.scss +11 -0
  33. package/dist/eject-theme/components/Nav/NavTitle.tsx +1 -0
  34. package/dist/eject-theme/components/Nav/index.scss +0 -8
  35. package/dist/eject-theme/components/NavHamburger/index.tsx +3 -4
  36. package/dist/eject-theme/components/NavScreen/NavScreenMenuItem.scss +14 -0
  37. package/dist/eject-theme/components/NavScreen/NavScreenMenuItem.tsx +2 -3
  38. package/dist/eject-theme/components/Outline/index.scss +0 -1
  39. package/dist/eject-theme/components/Overview/OverviewGroup.tsx +1 -2
  40. package/dist/eject-theme/components/Overview/index.tsx +6 -2
  41. package/dist/eject-theme/components/PackageManagerTabs/index.tsx +12 -0
  42. package/dist/eject-theme/components/PrevNextPage/index.tsx +6 -3
  43. package/dist/eject-theme/components/Root/index.tsx +58 -0
  44. package/dist/eject-theme/components/Search/NoSearchResult.tsx +2 -3
  45. package/dist/eject-theme/components/Search/SearchButton.tsx +3 -4
  46. package/dist/eject-theme/components/Search/SearchPanel.tsx +14 -9
  47. package/dist/eject-theme/components/Search/SuggestItem.tsx +15 -12
  48. package/dist/eject-theme/components/Sidebar/SidebarGroup.tsx +2 -3
  49. package/dist/eject-theme/components/Sidebar/SidebarItem.scss +12 -8
  50. package/dist/eject-theme/components/Sidebar/SidebarItem.tsx +6 -4
  51. package/dist/eject-theme/components/Sidebar/SidebarSectionHeader.scss +1 -1
  52. package/dist/eject-theme/components/SidebarMenu/index.tsx +4 -4
  53. package/dist/eject-theme/components/SocialLinks/index.tsx +2 -3
  54. package/dist/eject-theme/components/SourceCode/index.scss +2 -1
  55. package/dist/eject-theme/components/SourceCode/index.tsx +6 -4
  56. package/dist/eject-theme/components/SwitchAppearance/index.tsx +3 -5
  57. package/dist/eject-theme/components/Tabs/index.scss +19 -22
  58. package/dist/eject-theme/components/Toc/TocItem.scss +8 -4
  59. package/dist/eject-theme/components/Toc/TocItem.tsx +1 -0
  60. package/dist/index.d.ts +6 -6
  61. package/dist/index.js +16 -3134
  62. package/dist/node/PluginDriver.d.ts +1 -1
  63. package/dist/node/PluginDriver.js +143 -0
  64. package/dist/node/auto-nav-sidebar/index.js +44 -0
  65. package/dist/node/auto-nav-sidebar/locales.js +26 -0
  66. package/dist/node/auto-nav-sidebar/normalize.js +228 -0
  67. package/dist/node/auto-nav-sidebar/utils.js +68 -0
  68. package/dist/node/auto-nav-sidebar/walk.js +67 -0
  69. package/dist/node/build.js +31 -0
  70. package/dist/node/constants.d.ts +1 -0
  71. package/dist/node/constants.js +33 -0
  72. package/dist/node/dev.js +32 -0
  73. package/dist/node/eject.js +111 -0
  74. package/dist/node/index.d.ts +5 -5
  75. package/dist/node/initRsbuild.d.ts +2 -2
  76. package/dist/node/initRsbuild.js +338 -0
  77. package/dist/node/last-updated/index.js +28 -0
  78. package/dist/node/logger/hint.d.ts +1 -1
  79. package/dist/node/logger/hint.js +85 -0
  80. package/dist/node/mdx/loader.d.ts +1 -1
  81. package/dist/node/mdx/loader.e1578c62.js +13 -0
  82. package/dist/{loader.js → node/mdx/loader.js} +2 -2
  83. package/dist/node/mdx/options.d.ts +2 -2
  84. package/dist/node/mdx/options.js +100 -0
  85. package/dist/node/mdx/processor.d.ts +2 -2
  86. package/dist/node/mdx/processor.js +71 -0
  87. package/dist/node/mdx/rehypePlugins/codeMeta.js +10 -0
  88. package/dist/node/mdx/rehypePlugins/headerAnchor.js +53 -0
  89. package/dist/node/mdx/rehypePlugins/shiki.js +34 -0
  90. package/dist/node/mdx/rehypePlugins/transformers/add-lang.js +15 -0
  91. package/dist/node/mdx/rehypePlugins/transformers/add-line-numbers.js +22 -0
  92. package/dist/node/mdx/rehypePlugins/transformers/add-title.js +24 -0
  93. package/dist/node/mdx/rehypePlugins/transformers/add-wrap-code.js +22 -0
  94. package/dist/node/mdx/rehypePlugins/transformers/index.d.ts +5 -5
  95. package/dist/node/mdx/rehypePlugins/transformers/index.js +5 -0
  96. package/dist/node/mdx/rehypePlugins/transformers/meta-highlight.js +41 -0
  97. package/dist/node/mdx/remarkPlugins/builtin.js +11 -0
  98. package/dist/node/mdx/remarkPlugins/containerSyntax.js +190 -0
  99. package/dist/node/mdx/remarkPlugins/fileCodeBlock.js +66 -0
  100. package/dist/node/mdx/remarkPlugins/image.js +67 -0
  101. package/dist/node/mdx/remarkPlugins/link.d.ts +1 -1
  102. package/dist/node/mdx/remarkPlugins/link.js +99 -0
  103. package/dist/node/mdx/remarkPlugins/toc.js +50 -0
  104. package/dist/node/mdx/types.d.ts +3 -3
  105. package/dist/node/medium-zoom/index.d.ts +1 -1
  106. package/dist/node/medium-zoom/index.js +14 -0
  107. package/dist/node/route/RoutePage.d.ts +1 -1
  108. package/dist/node/route/RoutePage.js +61 -0
  109. package/dist/node/route/RouteService.d.ts +1 -1
  110. package/dist/node/route/RouteService.js +177 -0
  111. package/dist/node/route/extractPageData.d.ts +1 -1
  112. package/dist/node/route/extractPageData.js +112 -0
  113. package/dist/node/route/normalizeRoutePath.js +54 -0
  114. package/dist/node/runtimeModule/DEFAULT_I18N_TEXT.d.ts +21 -0
  115. package/dist/node/runtimeModule/DEFAULT_I18N_TEXT.js +150 -0
  116. package/dist/node/runtimeModule/globalStyles.d.ts +1 -1
  117. package/dist/node/runtimeModule/globalStyles.js +12 -0
  118. package/dist/node/runtimeModule/globalUIComponents.d.ts +1 -1
  119. package/dist/node/runtimeModule/globalUIComponents.js +25 -0
  120. package/dist/node/runtimeModule/i18n.d.ts +2 -2
  121. package/dist/node/runtimeModule/i18n.js +83 -0
  122. package/dist/node/runtimeModule/pageData/createPageData.d.ts +1 -1
  123. package/dist/node/runtimeModule/pageData/createPageData.js +64 -0
  124. package/dist/node/runtimeModule/pageData/rsbuildPlugin.d.ts +1 -1
  125. package/dist/node/runtimeModule/pageData/rsbuildPlugin.js +51 -0
  126. package/dist/node/runtimeModule/routeList.d.ts +1 -1
  127. package/dist/node/runtimeModule/routeList.js +7 -0
  128. package/dist/node/runtimeModule/searchHooks.d.ts +1 -1
  129. package/dist/node/runtimeModule/searchHooks.js +11 -0
  130. package/dist/node/runtimeModule/siteData/createSiteData.js +34 -0
  131. package/dist/node/runtimeModule/siteData/normalizeThemeConfig.js +94 -0
  132. package/dist/node/runtimeModule/siteData/rsbuildPlugin.d.ts +1 -1
  133. package/dist/node/runtimeModule/siteData/rsbuildPlugin.js +24 -0
  134. package/dist/node/runtimeModule/socialLinks.d.ts +1 -1
  135. package/dist/node/runtimeModule/socialLinks.js +8 -0
  136. package/dist/node/runtimeModule/types.d.ts +2 -2
  137. package/dist/node/serve.js +23 -0
  138. package/dist/node/ssg/renderHtmlTemplate.js +33 -0
  139. package/dist/node/ssg/renderPage.js +34 -0
  140. package/dist/node/ssg/renderPageWorker.474f9f73.js +2 -0
  141. package/dist/node/ssg/renderPageWorker.js +15 -0
  142. package/dist/node/ssg/renderPages.d.ts +1 -1
  143. package/dist/node/ssg/renderPages.js +105 -0
  144. package/dist/node/ssg/renderPages.js.LICENSE.txt +4 -0
  145. package/dist/node/ssg/rsbuildPluginCSR.d.ts +1 -1
  146. package/dist/node/ssg/rsbuildPluginCSR.js +27 -0
  147. package/dist/node/ssg/rsbuildPluginSSG.d.ts +1 -1
  148. package/dist/node/ssg/rsbuildPluginSSG.js +72 -0
  149. package/dist/node/ssg/ssgEnv.js +33 -0
  150. package/dist/node/ssg/ssgEnv.js.LICENSE.txt +5 -0
  151. package/dist/node/ssg-md/llms/emitLlmsTxt.d.ts +1 -1
  152. package/dist/node/ssg-md/llms/emitLlmsTxt.js +80 -0
  153. package/dist/node/ssg-md/llms/llmsTxt.d.ts +1 -1
  154. package/dist/node/ssg-md/llms/llmsTxt.js +66 -0
  155. package/dist/node/ssg-md/react/index.d.ts +1 -1
  156. package/dist/node/ssg-md/remarkSplitMdx.js +202 -0
  157. package/dist/node/ssg-md/renderPage.js +31 -0
  158. package/dist/node/ssg-md/renderPages.d.ts +1 -1
  159. package/dist/node/ssg-md/renderPages.js +27 -0
  160. package/dist/node/ssg-md/rsbuildPluginSSGMD.d.ts +1 -1
  161. package/dist/node/ssg-md/rsbuildPluginSSGMD.js +47 -0
  162. package/dist/node/utils/applyReplaceRules.js +6 -0
  163. package/dist/node/utils/checkLanguageParity.js +77 -0
  164. package/dist/node/utils/createHash.js +5 -0
  165. package/dist/node/utils/error.d.ts +9 -0
  166. package/dist/node/utils/error.js +9 -0
  167. package/dist/node/utils/escapeHeadingIds.js +5 -0
  168. package/dist/node/utils/flattenMdxContent.js +74 -0
  169. package/dist/node/utils/fs.js +14 -0
  170. package/dist/node/utils/getImportAstNode.js +63 -0
  171. package/dist/node/utils/getPageKey.js +6 -0
  172. package/dist/node/utils/getSocialIcons.js +32 -0
  173. package/dist/node/utils/index.d.ts +10 -9
  174. package/dist/node/utils/normalizePath.js +10 -0
  175. package/dist/node/utils/reactAlias.d.ts +2 -0
  176. package/dist/node/utils/reactAlias.js +83 -0
  177. package/dist/rslib-runtime.99091bf6.js +18 -0
  178. package/dist/runtime/App.js +2 -2
  179. package/dist/runtime/ClientApp.d.ts +1 -1
  180. package/dist/runtime/ClientApp.js +0 -4
  181. package/dist/runtime/ssrMdServerEntry.js +1 -1
  182. package/dist/runtime/ssrServerEntry.js +2 -1
  183. package/dist/runtime.72d450ac.js +1 -0
  184. package/dist/runtime.js +3 -2
  185. package/dist/shiki-transformers.d.ts +1 -1
  186. package/dist/shiki-transformers.js +6 -120
  187. package/dist/theme/assets/moon.js +9 -26
  188. package/dist/theme/components/Banner/index.d.ts +1 -1
  189. package/dist/theme/components/Banner/index.js +2 -3
  190. package/dist/theme/components/Button/index.css +1 -1
  191. package/dist/theme/components/Callout/index.css +0 -2
  192. package/dist/theme/components/CodeBlock/index.css +4 -15
  193. package/dist/theme/components/CodeBlock/index.js +1 -0
  194. package/dist/theme/components/CodeButtonGroup/CopyCodeButton.js +3 -5
  195. package/dist/theme/components/CodeButtonGroup/index.css +5 -1
  196. package/dist/theme/components/CodeButtonGroup/index.js +3 -5
  197. package/dist/theme/components/DocContent/doc.css +30 -8
  198. package/dist/theme/components/DocContent/docComponents/index.d.ts +3 -3
  199. package/dist/theme/components/DocContent/docComponents/table.d.ts +2 -2
  200. package/dist/theme/components/DocContent/docComponents/table.js +8 -3
  201. package/dist/theme/components/DocContent/index.js +3 -2
  202. package/dist/theme/components/{DocContent/FallbackHeading.js → FallbackHeading/index.js} +19 -11
  203. package/dist/theme/components/HoverGroup/index.css +5 -1
  204. package/dist/theme/components/HoverGroup/index.js +1 -0
  205. package/dist/theme/components/HoverGroup/useHoverGroup.d.ts +1 -1
  206. package/dist/theme/components/Link/index.d.ts +18 -1
  207. package/dist/theme/components/Link/index.js +14 -8
  208. package/dist/theme/components/Link/useLinkNavigate.d.ts +4 -1
  209. package/dist/theme/components/Link/useLinkNavigate.js +23 -17
  210. package/dist/theme/components/Nav/NavMenu.css +1 -0
  211. package/dist/theme/components/Nav/NavMenu.js +2 -3
  212. package/dist/theme/components/Nav/NavTitle.css +12 -0
  213. package/dist/theme/components/Nav/NavTitle.d.ts +1 -0
  214. package/dist/theme/components/Nav/NavTitle.js +1 -0
  215. package/dist/theme/components/Nav/index.css +0 -8
  216. package/dist/theme/components/NavHamburger/index.js +3 -4
  217. package/dist/theme/components/NavScreen/NavScreenMenuItem.css +9 -0
  218. package/dist/theme/components/NavScreen/NavScreenMenuItem.js +2 -3
  219. package/dist/theme/components/Outline/index.css +0 -1
  220. package/dist/theme/components/Overview/OverviewGroup.js +1 -2
  221. package/dist/theme/components/Overview/index.js +1 -2
  222. package/dist/theme/components/PackageManagerTabs/index.d.ts +1 -1
  223. package/dist/theme/components/PackageManagerTabs/index.js +4 -0
  224. package/dist/theme/components/PrevNextPage/index.js +3 -4
  225. package/dist/theme/components/Root/index.d.ts +54 -0
  226. package/dist/theme/components/Root/index.js +7 -0
  227. package/dist/theme/components/Search/NoSearchResult.js +2 -3
  228. package/dist/theme/components/Search/SearchButton.js +3 -4
  229. package/dist/theme/components/Search/SearchPanel.js +13 -16
  230. package/dist/theme/components/Search/SuggestItem.d.ts +1 -1
  231. package/dist/theme/components/Search/SuggestItem.js +7 -11
  232. package/dist/theme/components/Search/logic/Provider.d.ts +1 -1
  233. package/dist/theme/components/Search/logic/providers/LocalProvider.d.ts +2 -2
  234. package/dist/theme/components/Search/logic/search.d.ts +1 -1
  235. package/dist/theme/components/Sidebar/SidebarGroup.js +2 -3
  236. package/dist/theme/components/Sidebar/SidebarItem.css +11 -3
  237. package/dist/theme/components/Sidebar/SidebarItem.js +6 -3
  238. package/dist/theme/components/Sidebar/SidebarSectionHeader.css +1 -1
  239. package/dist/theme/components/SidebarMenu/index.js +3 -5
  240. package/dist/theme/components/SocialLinks/index.js +2 -3
  241. package/dist/theme/components/SourceCode/index.css +5 -0
  242. package/dist/theme/components/SourceCode/index.js +2 -4
  243. package/dist/theme/components/SwitchAppearance/index.js +3 -5
  244. package/dist/theme/components/Tabs/index.css +13 -22
  245. package/dist/theme/components/Toc/TocItem.css +7 -4
  246. package/dist/theme/components/Toc/TocItem.js +1 -0
  247. package/dist/theme/icons.d.ts +25 -0
  248. package/dist/theme/icons.js +47 -0
  249. package/dist/theme/index.d.ts +62 -59
  250. package/dist/theme/index.js +5 -2
  251. package/dist/theme/layout/DocLayout/index.css +2 -2
  252. package/dist/theme/layout/DocLayout/index.js +1 -4
  253. package/dist/theme/layout/Layout/index.d.ts +1 -1
  254. package/dist/theme/layout/Layout/index.js +3 -3
  255. package/dist/theme/logic/useFullTextSearch.d.ts +1 -1
  256. package/dist/theme/logic/useScrollAfterNav.d.ts +5 -0
  257. package/dist/theme/logic/{sideEffects.js → useScrollAfterNav.js} +5 -6
  258. package/dist/theme/logic/useScrollReset.d.ts +5 -0
  259. package/dist/theme/logic/useScrollReset.js +12 -0
  260. package/dist/theme/logic/useSetup.js +2 -0
  261. package/dist/theme/styles/base.css +1 -10
  262. package/dist/theme/styles/index.d.ts +1 -1
  263. package/dist/theme/styles/index.js +1 -1
  264. package/dist/theme/styles/scrollbar.css +1 -0
  265. package/dist/theme/styles/vars/base-vars.css +5 -3
  266. package/dist/theme/styles/vars/home-vars.css +4 -2
  267. package/package.json +19 -20
  268. package/dist/3~101.js +0 -1786
  269. package/dist/3~335.js +0 -26
  270. package/dist/3~395.js +0 -74
  271. package/dist/cli.js +0 -259
  272. package/dist/index.js.LICENSE.txt +0 -10
  273. package/dist/node/auto-nav-sidebar/fixtures/docs/guide/c.d.ts +0 -2
  274. package/dist/node/auto-nav-sidebar/fixtures/docs-locales/en/guide/c.d.ts +0 -2
  275. package/dist/node/auto-nav-sidebar/fixtures/docs-locales/zh/guide/c.d.ts +0 -2
  276. package/dist/node/auto-nav-sidebar/locales.test.d.ts +0 -1
  277. package/dist/node/auto-nav-sidebar/walk.test.d.ts +0 -1
  278. package/dist/node/mdx/rehypePlugins/headerAnchor.test.d.ts +0 -1
  279. package/dist/node/mdx/remarkPlugins/containerSyntax.test.d.ts +0 -1
  280. package/dist/node/mdx/remarkPlugins/fileCodeBlock.test.d.ts +0 -1
  281. package/dist/node/mdx/remarkPlugins/image.test.d.ts +0 -1
  282. package/dist/node/mdx/remarkPlugins/link.test.d.ts +0 -1
  283. package/dist/node/route/RouteService.test.d.ts +0 -1
  284. package/dist/node/route/extractPageData.test.d.ts +0 -1
  285. package/dist/node/route/fixtures/basic/guide/c.d.ts +0 -2
  286. package/dist/node/route/normalizeRoutePath.test.d.ts +0 -1
  287. package/dist/node/runtimeModule/i18n.test.d.ts +0 -1
  288. package/dist/node/ssg-md/remarkSplitMdx.test.d.ts +0 -4
  289. package/dist/node/utils/checkLanguageParity.test.d.ts +0 -1
  290. package/dist/node/utils/detectCustomIcon.d.ts +0 -1
  291. package/dist/node/utils/detectReactVersion.d.ts +0 -3
  292. package/dist/processor.js +0 -4539
  293. package/dist/renderPageWorker.js +0 -196
  294. package/dist/theme/components/Search/logic/util.test.d.ts +0 -1
  295. /package/dist/cli/{config.d.ts → config/index.d.ts} +0 -0
  296. /package/dist/{shiki-transformers.js.LICENSE.txt → node/mdx/rehypePlugins/transformers/meta-highlight.js.LICENSE.txt} +0 -0
  297. /package/dist/theme/components/{DocContent/FallbackHeading.d.ts → FallbackHeading/index.d.ts} +0 -0
  298. /package/dist/theme/logic/{sideEffects.d.ts → useSetup.d.ts} +0 -0
@@ -1,7 +1,6 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import { Link, SvgWrapper, renderInlineMarkdown } from "@theme";
2
+ import { FallbackHeading, Link, SvgWrapper, renderInlineMarkdown } from "@theme";
3
3
  import "./OverviewGroup.css";
4
- import { FallbackHeading } from "../DocContent/FallbackHeading.js";
5
4
  import icons_plugin from "./icons/plugin.js";
6
5
  const OverviewGroup = ({ group })=>/*#__PURE__*/ jsxs(Fragment, {
7
6
  children: [
@@ -1,8 +1,7 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { isEqualPath, useI18n, usePageData, useSidebar } from "@rspress/core/runtime";
3
- import { OverviewGroup } from "@theme";
3
+ import { FallbackHeading, OverviewGroup } from "@theme";
4
4
  import { useEffect, useMemo, useRef, useState } from "react";
5
- import { FallbackHeading } from "../DocContent/FallbackHeading.js";
6
5
  import { isSidebarDivider, isSidebarSectionHeader, isSidebarSingleFile } from "../Sidebar/utils.js";
7
6
  import "./index.css";
8
7
  import { findItemByRoutePath } from "./utils.js";
@@ -28,4 +28,4 @@ export type PackageManagerTabProps = ({
28
28
  icon?: ReactNode;
29
29
  }[];
30
30
  };
31
- export declare function PackageManagerTabs({ command, exec, dlx, additionalTabs, }: PackageManagerTabProps): import("react/jsx-runtime").JSX.Element;
31
+ export declare function PackageManagerTabs({ command, exec, dlx, additionalTabs, }: PackageManagerTabProps): string | import("react/jsx-runtime").JSX.Element;
@@ -104,6 +104,10 @@ function PackageManagerTabs({ command, exec, dlx, additionalTabs = [] }) {
104
104
  commandInfo.bun = normalizeCommand(commandInfo.bun);
105
105
  commandInfo.deno = normalizeCommand(commandInfo.deno);
106
106
  } else commandInfo = command;
107
+ if (process.env.__SSR_MD__) return Object.values(commandInfo).reduce((previous, current)=>{
108
+ const [packageManager, command] = splitTo2Parts(current);
109
+ return previous + `\n\`\`\`sh [${packageManager}]\n` + `${packageManager}${command}\n` + "```\n";
110
+ }, '');
107
111
  return /*#__PURE__*/ jsx(Tabs, {
108
112
  groupId: "package.manager",
109
113
  values: Object.entries(commandInfo).map(([key])=>/*#__PURE__*/ jsxs("div", {
@@ -1,7 +1,6 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useI18n } from "@rspress/core/runtime";
3
- import { Link, SvgWrapper, renderInlineMarkdown, usePrevNextPage } from "@theme";
4
- import arrow_right from "@theme-assets/arrow-right";
3
+ import { IconArrowRight, Link, SvgWrapper, renderInlineMarkdown, usePrevNextPage } from "@theme";
5
4
  import clsx from "clsx";
6
5
  import "./index.css";
7
6
  function PrevNextPage() {
@@ -22,7 +21,7 @@ function PrevNextPage() {
22
21
  className: "rp-prev-next-page__item__title",
23
22
  children: [
24
23
  /*#__PURE__*/ jsx(SvgWrapper, {
25
- icon: arrow_right,
24
+ icon: IconArrowRight,
26
25
  className: "rp-prev-next-page__icon rp-prev-next-page__rotate_180"
27
26
  }),
28
27
  /*#__PURE__*/ jsx("span", {
@@ -49,7 +48,7 @@ function PrevNextPage() {
49
48
  ...renderInlineMarkdown(nextPage.text)
50
49
  }),
51
50
  /*#__PURE__*/ jsx(SvgWrapper, {
52
- icon: arrow_right,
51
+ icon: IconArrowRight,
53
52
  className: "rp-prev-next-page__icon"
54
53
  })
55
54
  ]
@@ -0,0 +1,54 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface RootProps {
3
+ /**
4
+ * The children elements to render inside the Root component.
5
+ */
6
+ children: ReactNode;
7
+ }
8
+ /**
9
+ * A wrapper component for the entire application.
10
+ *
11
+ * The Root component wraps all content in the application, including the Layout
12
+ * and global UI components. By default, it simply renders its children without
13
+ * any additional markup or styling.
14
+ *
15
+ * You can eject and customize this component to add global wrappers, providers,
16
+ * or any other elements that should wrap your entire application.
17
+ *
18
+ * @param {RootProps} props - The properties for the Root component.
19
+ * @returns {JSX.Element} The children elements wrapped by the Root component.
20
+ *
21
+ * @example
22
+ * Default usage (no customization needed):
23
+ * ```tsx
24
+ * import { Root } from '@theme';
25
+ *
26
+ * function App() {
27
+ * return (
28
+ * <Root>
29
+ * <YourContent />
30
+ * </Root>
31
+ * );
32
+ * }
33
+ * ```
34
+ *
35
+ * @example
36
+ * Ejected and customized:
37
+ * ```tsx
38
+ * // In your ejected theme/components/Root/index.tsx
39
+ * import type { ReactNode } from 'react';
40
+ *
41
+ * export interface RootProps {
42
+ * children: ReactNode;
43
+ * }
44
+ *
45
+ * export function Root({ children }: RootProps) {
46
+ * return (
47
+ * <div className="my-custom-root">
48
+ * {children}
49
+ * </div>
50
+ * );
51
+ * }
52
+ * ```
53
+ */
54
+ export declare function Root({ children }: RootProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { Fragment, jsx } from "react/jsx-runtime";
2
+ function Root({ children }) {
3
+ return /*#__PURE__*/ jsx(Fragment, {
4
+ children: children
5
+ });
6
+ }
7
+ export { Root };
@@ -1,7 +1,6 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useI18n } from "@rspress/core/runtime";
3
- import { SvgWrapper } from "@theme";
4
- import empty from "@theme-assets/empty";
3
+ import { IconEmpty, SvgWrapper } from "@theme";
5
4
  import "./NoSearchResult.css";
6
5
  function NoSearchResult({ query }) {
7
6
  const t = useI18n();
@@ -9,7 +8,7 @@ function NoSearchResult({ query }) {
9
8
  className: "rp-no-search-result",
10
9
  children: [
11
10
  /*#__PURE__*/ jsx(SvgWrapper, {
12
- icon: empty,
11
+ icon: IconEmpty,
13
12
  className: "rp-no-search-result__icon"
14
13
  }),
15
14
  /*#__PURE__*/ jsxs("p", {
@@ -1,7 +1,6 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useI18n } from "@rspress/core/runtime";
3
- import { SvgWrapper } from "@theme";
4
- import search from "@theme-assets/search";
3
+ import { IconSearch, SvgWrapper } from "@theme";
5
4
  import { useEffect, useState } from "react";
6
5
  import "./SearchButton.css";
7
6
  function SearchButton({ setFocused }) {
@@ -20,7 +19,7 @@ function SearchButton({ setFocused }) {
20
19
  className: "rp-search-button__content",
21
20
  children: [
22
21
  /*#__PURE__*/ jsx(SvgWrapper, {
23
- icon: search,
22
+ icon: IconSearch,
24
23
  className: "rp-search-button__icon"
25
24
  }),
26
25
  /*#__PURE__*/ jsx("span", {
@@ -49,7 +48,7 @@ function SearchButton({ setFocused }) {
49
48
  className: "rp-search-button--mobile",
50
49
  onClick: ()=>setFocused(true),
51
50
  children: /*#__PURE__*/ jsx(SvgWrapper, {
52
- icon: search
51
+ icon: IconSearch
53
52
  })
54
53
  })
55
54
  ]
@@ -1,9 +1,6 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useI18n, usePageData } from "@rspress/core/runtime";
3
- import { SvgWrapper, Tab, Tabs, useLinkNavigate } from "@theme";
4
- import _theme_assets_close from "@theme-assets/close";
5
- import loading from "@theme-assets/loading";
6
- import _theme_assets_search from "@theme-assets/search";
3
+ import { IconClose, IconLoading, IconSearch, SvgWrapper, Tab, Tabs, useLinkNavigate } from "@theme";
7
4
  import { debounce } from "lodash-es";
8
5
  import { useCallback, useEffect, useRef, useState } from "react";
9
6
  import { createPortal } from "react-dom";
@@ -12,7 +9,7 @@ import { RenderType } from "./logic/types.js";
12
9
  import { NoSearchResult } from "./NoSearchResult.js";
13
10
  import "./SearchPanel.css";
14
11
  import { SuggestItem } from "./SuggestItem.js";
15
- import * as __WEBPACK_EXTERNAL_MODULE_virtual_search_hooks_9d01d01f__ from "virtual-search-hooks";
12
+ import * as __rspack_external_virtual_search_hooks_9d01d01f from "virtual-search-hooks";
16
13
  const KEY_CODE = {
17
14
  ARROW_UP: 'ArrowUp',
18
15
  ARROW_DOWN: 'ArrowDown',
@@ -138,7 +135,7 @@ function SearchPanel({ focused, setFocused }) {
138
135
  case KEY_CODE.ENTER:
139
136
  if (e.isComposing) return;
140
137
  if (currentSuggestionIndex >= 0 && currentRenderType === RenderType.Default) {
141
- const flatSuggestions = Object.values(normalizeSuggestions(currentSuggestions)).flat();
138
+ const flatSuggestions = Array.from(normalizeSuggestions(currentSuggestions).values()).flat();
142
139
  const suggestion = flatSuggestions[currentSuggestionIndex];
143
140
  navigate(suggestion.link);
144
141
  clearSearchState();
@@ -197,24 +194,24 @@ function SearchPanel({ focused, setFocused }) {
197
194
  setQuery(newQuery);
198
195
  if (newQuery) {
199
196
  const searchResult = [];
200
- if ("beforeSearch" in __WEBPACK_EXTERNAL_MODULE_virtual_search_hooks_9d01d01f__) {
197
+ if ("beforeSearch" in __rspack_external_virtual_search_hooks_9d01d01f) {
201
198
  const key = 'beforeSearch';
202
- const transformedQuery = await __WEBPACK_EXTERNAL_MODULE_virtual_search_hooks_9d01d01f__[key](newQuery);
199
+ const transformedQuery = await __rspack_external_virtual_search_hooks_9d01d01f[key](newQuery);
203
200
  if (transformedQuery) newQuery = transformedQuery;
204
201
  }
205
202
  const defaultSearchResult = await pageSearcherRef.current?.match(newQuery);
206
203
  if (defaultSearchResult) searchResult.push(...defaultSearchResult);
207
- if ("onSearch" in __WEBPACK_EXTERNAL_MODULE_virtual_search_hooks_9d01d01f__) {
204
+ if ("onSearch" in __rspack_external_virtual_search_hooks_9d01d01f) {
208
205
  const key = 'onSearch';
209
- const customSearchResult = await __WEBPACK_EXTERNAL_MODULE_virtual_search_hooks_9d01d01f__[key](newQuery, searchResult);
206
+ const customSearchResult = await __rspack_external_virtual_search_hooks_9d01d01f[key](newQuery, searchResult);
210
207
  if (customSearchResult) searchResult.push(...customSearchResult.map((item)=>({
211
208
  renderType: RenderType.Custom,
212
209
  ...item
213
210
  })));
214
211
  }
215
- if ("afterSearch" in __WEBPACK_EXTERNAL_MODULE_virtual_search_hooks_9d01d01f__) {
212
+ if ("afterSearch" in __rspack_external_virtual_search_hooks_9d01d01f) {
216
213
  const key = 'afterSearch';
217
- await __WEBPACK_EXTERNAL_MODULE_virtual_search_hooks_9d01d01f__[key](newQuery, searchResult);
214
+ await __rspack_external_virtual_search_hooks_9d01d01f[key](newQuery, searchResult);
218
215
  }
219
216
  const currQuery = searchInputRef.current?.value;
220
217
  if (currQuery === newQuery) {
@@ -255,7 +252,7 @@ function SearchPanel({ focused, setFocused }) {
255
252
  children: result.map((item)=>/*#__PURE__*/ jsxs(Tab, {
256
253
  children: [
257
254
  item.renderType === RenderType.Default && renderSearchResultItem(item.result, query, isSearching),
258
- item.renderType === RenderType.Custom && __WEBPACK_EXTERNAL_MODULE_virtual_search_hooks_9d01d01f__[renderKey](item.result)
255
+ item.renderType === RenderType.Custom && __rspack_external_virtual_search_hooks_9d01d01f[renderKey](item.result)
259
256
  ]
260
257
  }, item.group))
261
258
  });
@@ -264,7 +261,7 @@ function SearchPanel({ focused, setFocused }) {
264
261
  if (isSearching) return /*#__PURE__*/ jsx("div", {
265
262
  className: "rp-search-panel__loading",
266
263
  children: /*#__PURE__*/ jsx(SvgWrapper, {
267
- icon: loading
264
+ icon: IconLoading
268
265
  })
269
266
  });
270
267
  if (0 === suggestionList.length && 'inited' === initStatus) return /*#__PURE__*/ jsx(NoSearchResult, {
@@ -328,7 +325,7 @@ function SearchPanel({ focused, setFocused }) {
328
325
  children: [
329
326
  /*#__PURE__*/ jsx("label", {
330
327
  children: /*#__PURE__*/ jsx(SvgWrapper, {
331
- icon: _theme_assets_search
328
+ icon: IconSearch
332
329
  })
333
330
  }),
334
331
  /*#__PURE__*/ jsx("input", {
@@ -342,7 +339,7 @@ function SearchPanel({ focused, setFocused }) {
342
339
  }),
343
340
  /*#__PURE__*/ jsx("label", {
344
341
  children: /*#__PURE__*/ jsx(SvgWrapper, {
345
- icon: _theme_assets_close,
342
+ icon: IconClose,
346
343
  className: "rp-search-panel__close",
347
344
  onClick: (e)=>{
348
345
  if (searchInputRef.current) {
@@ -1,5 +1,5 @@
1
1
  import './SuggestItem.scss';
2
- import type { DefaultMatchResultItem } from './logic/types';
2
+ import type { DefaultMatchResultItem } from './logic/types.js';
3
3
  export declare function SuggestItem({ suggestion, closeSearch, isCurrent, setCurrentSuggestionIndex, scrollTo, onMouseMove, }: {
4
4
  suggestion: DefaultMatchResultItem;
5
5
  closeSearch: () => void;
@@ -1,18 +1,14 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import { Link, SvgWrapper } from "@theme";
3
- import file from "@theme-assets/file";
4
- import _theme_assets_header from "@theme-assets/header";
5
- import jump from "@theme-assets/jump";
6
- import title from "@theme-assets/title";
2
+ import { IconFile, IconHeader, IconJump, IconTitle, Link, SvgWrapper } from "@theme";
7
3
  import { useRef } from "react";
8
4
  import "./SuggestItem.css";
9
5
  import { getSlicedStrByByteLength } from "./logic/util.js";
10
- const ICON_MAP = {
11
- title: title,
12
- header: _theme_assets_header,
13
- content: file
14
- };
15
6
  function SuggestItem({ suggestion, closeSearch, isCurrent, setCurrentSuggestionIndex, scrollTo, onMouseMove }) {
7
+ const ICON_MAP = {
8
+ title: IconTitle,
9
+ header: IconHeader,
10
+ content: IconFile
11
+ };
16
12
  const HitIcon = ICON_MAP[suggestion.type];
17
13
  const selfRef = useRef(null);
18
14
  if (isCurrent && selfRef.current?.offsetTop) scrollTo(selfRef.current?.offsetTop, selfRef.current?.offsetHeight);
@@ -104,7 +100,7 @@ function SuggestItem({ suggestion, closeSearch, isCurrent, setCurrentSuggestionI
104
100
  /*#__PURE__*/ jsx("div", {
105
101
  className: "rp-suggest-item__action-icon",
106
102
  children: /*#__PURE__*/ jsx(SvgWrapper, {
107
- icon: jump
103
+ icon: IconJump
108
104
  })
109
105
  })
110
106
  ]
@@ -1,5 +1,5 @@
1
1
  import type { PageIndexInfo } from '@rspress/core';
2
- import type { SearchOptions } from './types';
2
+ import type { SearchOptions } from './types.js';
3
3
  export interface SearchQuery {
4
4
  keyword: string;
5
5
  limit: number;
@@ -3,8 +3,8 @@
3
3
  * Powered by FlexSearch. https://github.com/nextapps-de/flexsearch
4
4
  */
5
5
  import { type PageIndexInfo } from '@rspress/shared';
6
- import { type Provider, type SearchQuery } from '../Provider';
7
- import type { SearchOptions } from '../types';
6
+ import { type Provider, type SearchQuery } from '../Provider.js';
7
+ import type { SearchOptions } from '../types.js';
8
8
  export declare class LocalProvider implements Provider {
9
9
  #private;
10
10
  fetchSearchIndex(options: SearchOptions): Promise<PageIndexInfo[]>;
@@ -1,5 +1,5 @@
1
1
  import type { PageIndexInfo } from '@rspress/core';
2
- import { type MatchResult, type SearchOptions } from './types';
2
+ import { type MatchResult, type SearchOptions } from './types.js';
3
3
  export declare class PageSearcher {
4
4
  #private;
5
5
  constructor(options: SearchOptions & {
@@ -1,7 +1,6 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useActiveMatcher } from "@rspress/core/runtime";
3
- import { SvgWrapper, useLinkNavigate } from "@theme";
4
- import arrow_right from "@theme-assets/arrow-right";
3
+ import { IconArrowRight, SvgWrapper, useLinkNavigate } from "@theme";
5
4
  import clsx from "clsx";
6
5
  import { SidebarDivider } from "./SidebarDivider.js";
7
6
  import "./SidebarGroup.css";
@@ -15,7 +14,7 @@ const CollapsibleIcon = ({ collapsed })=>/*#__PURE__*/ jsx("div", {
15
14
  transform: collapsed ? 'rotate(0deg)' : 'rotate(90deg)'
16
15
  },
17
16
  children: /*#__PURE__*/ jsx(SvgWrapper, {
18
- icon: arrow_right
17
+ icon: IconArrowRight
19
18
  })
20
19
  });
21
20
  function SidebarGroup(props) {
@@ -5,20 +5,28 @@
5
5
  justify-content: space-between;
6
6
  align-items: center;
7
7
  margin-top: 2px;
8
- padding: 2px 12px;
8
+ padding: 6px 12px;
9
9
  font-size: 14px;
10
10
  font-weight: 400;
11
- line-height: 32px;
11
+ line-height: 24px;
12
12
  transition: color .15s, background-color .15s;
13
13
  display: flex;
14
14
  position: relative;
15
15
  }
16
16
 
17
- .rp-sidebar-item:hover {
17
+ .rp-sidebar-item:first-child {
18
+ margin-top: 0;
19
+ }
20
+
21
+ .rp-sidebar-item:hover, .rp-sidebar-item--pending {
18
22
  color: var(--rp-c-text-1);
19
23
  background-color: var(--rp-c-bg-mute);
20
24
  }
21
25
 
26
+ .rp-sidebar-item--pending {
27
+ opacity: .8;
28
+ }
29
+
22
30
  .rp-sidebar-item.rp-link[target="_blank"]:after {
23
31
  content: "↗";
24
32
  margin-left: .2em;
@@ -2,11 +2,12 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useActiveMatcher } from "@rspress/core/runtime";
3
3
  import { Link, Tag, renderInlineMarkdown } from "@theme";
4
4
  import clsx from "clsx";
5
- import { useEffect, useRef } from "react";
5
+ import { useEffect, useRef, useTransition } from "react";
6
6
  import "./SidebarItem.css";
7
7
  import scroll_into_view_if_needed from "scroll-into-view-if-needed";
8
8
  function SidebarItemRaw({ active, text, tag, link, context, className, left, right, onClick, depth }) {
9
9
  const ref = useRef(null);
10
+ const [isPending, startTransition] = useTransition();
10
11
  useEffect(()=>{
11
12
  if (active && ref.current) scroll_into_view_if_needed(ref.current, {
12
13
  scrollMode: 'if-needed'
@@ -39,9 +40,10 @@ function SidebarItemRaw({ active, text, tag, link, context, className, left, rig
39
40
  });
40
41
  if (link) return /*#__PURE__*/ jsx(Link, {
41
42
  href: link,
42
- onClick: onClick,
43
+ startTransition: startTransition,
43
44
  className: clsx('rp-sidebar-item', {
44
- 'rp-sidebar-item--active': active
45
+ 'rp-sidebar-item--active': active,
46
+ 'rp-sidebar-item--pending': isPending
45
47
  }, className),
46
48
  style: {
47
49
  paddingLeft: 0 === depth ? '12px' : `calc(12px * ${depth} + 12px)`
@@ -50,6 +52,7 @@ function SidebarItemRaw({ active, text, tag, link, context, className, left, rig
50
52
  ...context ? {
51
53
  'data-context': context
52
54
  } : {},
55
+ onClick: onClick,
53
56
  children: innerContent
54
57
  });
55
58
  return /*#__PURE__*/ jsx("div", {
@@ -6,7 +6,7 @@
6
6
  display: flex;
7
7
  }
8
8
 
9
- .rp-sidebar-section-header:first-of-type {
9
+ .rp-sidebar-section-header:first-child {
10
10
  margin-top: 0;
11
11
  }
12
12
 
@@ -1,8 +1,6 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useFrontmatter, useI18n, useLocation } from "@rspress/core/runtime";
3
- import { ReadPercent, SvgWrapper, renderInlineMarkdown, useActiveAnchor, useDynamicToc } from "@theme";
4
- import arrow_right from "@theme-assets/arrow-right";
5
- import menu from "@theme-assets/menu";
3
+ import { IconArrowRight, IconMenu, ReadPercent, SvgWrapper, renderInlineMarkdown, useActiveAnchor, useDynamicToc } from "@theme";
6
4
  import { forwardRef, useEffect, useRef } from "react";
7
5
  import { createPortal } from "react-dom";
8
6
  import "./index.css";
@@ -51,7 +49,7 @@ const SidebarMenu = /*#__PURE__*/ forwardRef(({ isSidebarOpen, onIsSidebarOpenCh
51
49
  className: "rp-sidebar-menu__left",
52
50
  children: [
53
51
  /*#__PURE__*/ jsx(SvgWrapper, {
54
- icon: menu
52
+ icon: IconMenu
55
53
  }),
56
54
  /*#__PURE__*/ jsx("span", {
57
55
  children: t('menuTitle')
@@ -81,7 +79,7 @@ const SidebarMenu = /*#__PURE__*/ forwardRef(({ isSidebarOpen, onIsSidebarOpenCh
81
79
  strokeWidth: 2
82
80
  }),
83
81
  0 !== headers.length && /*#__PURE__*/ jsx(SvgWrapper, {
84
- icon: arrow_right,
82
+ icon: IconArrowRight,
85
83
  style: {
86
84
  transform: isOutlineOpen ? 'rotate(90deg)' : 'rotate(0deg)',
87
85
  transition: 'transform 0.2s ease-out'
@@ -1,7 +1,6 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useSite } from "@rspress/core/runtime";
3
- import { SvgWrapper } from "@theme";
4
- import arrow_down from "@theme-assets/arrow-down";
3
+ import { IconArrowDown, SvgWrapper } from "@theme";
5
4
  import "./index.css";
6
5
  import { useHoverGroup } from "../HoverGroup/useHoverGroup.js";
7
6
  import { SocialLink } from "./SocialLink.js";
@@ -32,7 +31,7 @@ const SocialLinks = ({ socialLinks: socialLinksFromProps })=>{
32
31
  hoverGroupPosition: index === shownLinks.length - 1 ? 'right' : 'center'
33
32
  }, item.content)),
34
33
  isMore ? /*#__PURE__*/ jsx(SvgWrapper, {
35
- icon: arrow_down,
34
+ icon: IconArrowDown,
36
35
  onMouseEnter: handleMouseEnter,
37
36
  fontSize: 20
38
37
  }) : null,
@@ -29,3 +29,8 @@
29
29
  display: inline-flex;
30
30
  }
31
31
 
32
+ .rp-source-code__text {
33
+ font-weight: 600;
34
+ line-height: 1.5em;
35
+ }
36
+
@@ -1,8 +1,6 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useI18n } from "@rspress/core/runtime";
3
- import { SvgWrapper } from "@theme";
4
- import github from "@theme-assets/github";
5
- import gitlab from "@theme-assets/gitlab";
3
+ import { IconGithub, IconGitlab, SvgWrapper } from "@theme";
6
4
  import "./index.css";
7
5
  function SourceCode(props) {
8
6
  const { href, platform = 'github' } = props;
@@ -17,7 +15,7 @@ function SourceCode(props) {
17
15
  /*#__PURE__*/ jsx("span", {
18
16
  className: "rp-source-code__icon",
19
17
  children: /*#__PURE__*/ jsx(SvgWrapper, {
20
- icon: 'gitlab' === platform ? gitlab : github
18
+ icon: 'gitlab' === platform ? IconGitlab : IconGithub
21
19
  })
22
20
  }),
23
21
  /*#__PURE__*/ jsx("span", {
@@ -1,8 +1,6 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { ThemeContext, useSite } from "@rspress/core/runtime";
3
- import { SvgWrapper } from "@theme";
4
- import moon from "@theme-assets/moon";
5
- import sun from "@theme-assets/sun";
3
+ import { IconMoon, IconSun, SvgWrapper } from "@theme";
6
4
  import { useContext } from "react";
7
5
  import "./global.css";
8
6
  import "./index.css";
@@ -68,12 +66,12 @@ function SwitchAppearance({ onClick }) {
68
66
  children: [
69
67
  /*#__PURE__*/ jsx(SvgWrapper, {
70
68
  className: "rp-switch-appearance__icon rp-switch-appearance__icon--sun",
71
- icon: sun,
69
+ icon: IconSun,
72
70
  fill: "currentColor"
73
71
  }),
74
72
  /*#__PURE__*/ jsx(SvgWrapper, {
75
73
  className: "rp-switch-appearance__icon rp-switch-appearance__icon--moon",
76
- icon: moon,
74
+ icon: IconMoon,
77
75
  fill: "currentColor"
78
76
  })
79
77
  ]
@@ -20,8 +20,7 @@
20
20
  border-bottom: var(--rp-code-block-border);
21
21
  flex-wrap: wrap;
22
22
  min-width: 100%;
23
- padding-top: 4px;
24
- padding-left: 8px;
23
+ padding: 4px 12px;
25
24
  display: flex;
26
25
  }
27
26
 
@@ -40,9 +39,11 @@
40
39
  box-sizing: border-box;
41
40
  user-select: none;
42
41
  cursor: pointer;
43
- margin-right: 10px;
44
- padding: 6px 12px;
45
- transition: all .2s ease-in-out;
42
+ border-radius: var(--rp-radius-small);
43
+ margin-right: 4px;
44
+ padding: 4px 12px;
45
+ font-size: .875rem;
46
+ transition: color .2s ease-out, background-color .2s ease-out;
46
47
  position: relative;
47
48
  }
48
49
 
@@ -50,28 +51,14 @@
50
51
  margin-right: 0;
51
52
  }
52
53
 
53
- .rp-tabs__label__item:after {
54
- content: "";
55
- background-color: #0000;
56
- width: 90%;
57
- height: 1px;
58
- transition: background-color .3s ease-out;
59
- position: absolute;
60
- bottom: 0;
61
- left: 5%;
62
- }
63
-
64
54
  .rp-tabs__label__item--not-selected:hover {
65
- color: var(--rp-c-text-0);
66
- opacity: .8;
55
+ background-color: var(--rp-c-bg-mute);
67
56
  }
68
57
 
69
58
  .rp-tabs__label__item--selected {
70
59
  color: var(--rp-c-text-0);
71
- }
72
-
73
- .rp-tabs__label__item--selected:after {
74
- background-color: currentColor;
60
+ background-color: var(--rp-c-bg);
61
+ box-shadow: 0px 0px 3px 0px var(--rp-c-divider);
75
62
  }
76
63
 
77
64
  .rp-tabs__content__item--active {
@@ -82,3 +69,7 @@
82
69
  display: none;
83
70
  }
84
71
 
72
+ .dark .rp-tabs__label__item--selected {
73
+ background-color: var(--rp-c-bg-soft);
74
+ }
75
+
@@ -1,22 +1,25 @@
1
1
  .rp-toc-item {
2
- border-radius: 6px;
3
2
  justify-content: flex-start;
4
3
  align-self: stretch;
5
4
  align-items: flex-start;
6
- gap: 10px;
5
+ margin-top: 10px;
6
+ line-height: 1.4;
7
7
  display: block;
8
8
  position: relative;
9
9
  }
10
10
 
11
+ .rp-toc-item:first-child {
12
+ margin-top: 0;
13
+ }
14
+
11
15
  .rp-toc-item__text {
12
16
  color: var(--rp-c-text-2);
13
17
  overflow-wrap: break-word;
14
18
  font-size: 14px;
15
19
  font-weight: 400;
16
- line-height: 24px;
17
20
  }
18
21
 
19
- .rp-toc-item--active .rp-toc-item__text, .rp-toc-item--active .rp-toc-item__text * {
22
+ .rp-toc-item--active .rp-toc-item__text, .rp-toc-item--active .rp-toc-item__text code {
20
23
  color: var(--rp-c-link);
21
24
  }
22
25
 
@@ -29,6 +29,7 @@ const TocItem = ({ header, baseHeaderLevel, active })=>{
29
29
  style: {
30
30
  paddingLeft: (header.depth - baseHeaderLevel) * 12
31
31
  },
32
+ 'data-depth': header.depth - baseHeaderLevel,
32
33
  children: /*#__PURE__*/ jsx("span", {
33
34
  className: "rp-toc-item__text rp-doc",
34
35
  ...renderInlineMarkdown(header.text)