@rspress/core 2.0.0-rc.1 → 2.0.0-rc.3

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 (307) hide show
  1. package/bin/rspress.js +1 -1
  2. package/dist/0~7675.723d12b2.js +1794 -0
  3. package/dist/3521.56e42d70.js +56 -0
  4. package/dist/4669.12208c6a.js +2 -0
  5. package/dist/5485.077f14ff.js +98 -0
  6. package/dist/6289.c67fe0d5.js +5 -0
  7. package/dist/8813.9da1f210.js +2 -0
  8. package/dist/9643.f109822d.js +5 -0
  9. package/dist/_private/react/render.js +17 -4
  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/Badge/index.scss +1 -0
  15. package/dist/eject-theme/components/Banner/index.tsx +6 -5
  16. package/dist/eject-theme/components/Callout/index.scss +0 -2
  17. package/dist/eject-theme/components/Callout/index.tsx +8 -2
  18. package/dist/eject-theme/components/CodeBlock/index.scss +12 -18
  19. package/dist/eject-theme/components/CodeBlock/index.tsx +10 -1
  20. package/dist/eject-theme/components/CodeBlockRuntime/index.tsx +50 -11
  21. package/dist/eject-theme/components/CodeButtonGroup/CopyCodeButton.tsx +1 -3
  22. package/dist/eject-theme/components/CodeButtonGroup/index.scss +5 -1
  23. package/dist/eject-theme/components/CodeButtonGroup/index.tsx +1 -3
  24. package/dist/eject-theme/components/DocContent/doc.scss +27 -7
  25. package/dist/eject-theme/components/DocContent/docComponents/pre.tsx +2 -1
  26. package/dist/eject-theme/components/DocContent/docComponents/table.tsx +10 -4
  27. package/dist/eject-theme/components/DocContent/index.tsx +21 -4
  28. package/dist/eject-theme/components/DocFooter/index.tsx +1 -6
  29. package/dist/eject-theme/components/{DocContent/FallbackHeading.tsx → FallbackHeading/index.tsx} +20 -11
  30. package/dist/eject-theme/components/HoverGroup/index.scss +1 -1
  31. package/dist/eject-theme/components/LastUpdated/index.tsx +8 -1
  32. package/dist/eject-theme/components/Link/index.tsx +22 -6
  33. package/dist/eject-theme/components/Nav/NavMenu.tsx +2 -3
  34. package/dist/eject-theme/components/NavHamburger/index.tsx +3 -4
  35. package/dist/eject-theme/components/NavScreen/NavScreenLangs.scss +6 -0
  36. package/dist/eject-theme/components/NavScreen/NavScreenLangs.tsx +23 -9
  37. package/dist/eject-theme/components/NavScreen/NavScreenMenuItem.tsx +2 -3
  38. package/dist/eject-theme/components/NavScreen/NavScreenVersions.scss +6 -0
  39. package/dist/eject-theme/components/NavScreen/NavScreenVersions.tsx +22 -9
  40. package/dist/eject-theme/components/Overview/index.tsx +7 -8
  41. package/dist/eject-theme/components/{Overview/OverviewGroup.scss → OverviewGroup/index.scss} +66 -12
  42. package/dist/eject-theme/components/{Overview/OverviewGroup.tsx → OverviewGroup/index.tsx} +51 -5
  43. package/dist/eject-theme/components/PackageManagerTabs/index.tsx +12 -0
  44. package/dist/eject-theme/components/PrevNextPage/index.tsx +6 -3
  45. package/dist/eject-theme/components/Root/index.tsx +58 -0
  46. package/dist/eject-theme/components/Search/NoSearchResult.tsx +2 -3
  47. package/dist/eject-theme/components/Search/SearchButton.tsx +3 -4
  48. package/dist/eject-theme/components/Search/SearchPanel.tsx +12 -7
  49. package/dist/eject-theme/components/Search/SuggestItem.tsx +15 -12
  50. package/dist/eject-theme/components/Search/logic/util.test.ts +1 -1
  51. package/dist/eject-theme/components/Sidebar/SidebarGroup.tsx +2 -3
  52. package/dist/eject-theme/components/Sidebar/SidebarItem.tsx +1 -0
  53. package/dist/eject-theme/components/SidebarMenu/index.tsx +4 -4
  54. package/dist/eject-theme/components/SocialLinks/index.tsx +2 -3
  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 +31 -26
  58. package/dist/eject-theme/components/Tabs/index.tsx +16 -0
  59. package/dist/eject-theme/components/Tag/index.tsx +84 -5
  60. package/dist/eject-theme/components/Toc/TocItem.scss +3 -3
  61. package/dist/eject-theme/components/Toc/TocItem.tsx +1 -0
  62. package/dist/index.d.ts +6 -6
  63. package/dist/index.js +16 -3134
  64. package/dist/node/PluginDriver.d.ts +1 -1
  65. package/dist/node/PluginDriver.js +142 -0
  66. package/dist/node/auto-nav-sidebar/index.js +44 -0
  67. package/dist/node/auto-nav-sidebar/locales.js +26 -0
  68. package/dist/node/auto-nav-sidebar/normalize.js +230 -0
  69. package/dist/node/auto-nav-sidebar/utils.js +68 -0
  70. package/dist/node/auto-nav-sidebar/walk.js +67 -0
  71. package/dist/node/build.js +31 -0
  72. package/dist/node/constants.d.ts +2 -0
  73. package/dist/node/constants.js +34 -0
  74. package/dist/node/dev.js +32 -0
  75. package/dist/node/eject.js +111 -0
  76. package/dist/node/index.d.ts +5 -5
  77. package/dist/node/initRsbuild.d.ts +2 -2
  78. package/dist/node/initRsbuild.js +346 -0
  79. package/dist/node/last-updated/index.js +28 -0
  80. package/dist/node/logger/hint.d.ts +1 -1
  81. package/dist/node/logger/hint.js +85 -0
  82. package/dist/node/mdx/loader.d.ts +1 -1
  83. package/dist/node/mdx/loader.e1578c62.js +13 -0
  84. package/dist/{loader.js → node/mdx/loader.js} +4 -3
  85. package/dist/node/mdx/options.d.ts +2 -2
  86. package/dist/node/mdx/options.js +103 -0
  87. package/dist/node/mdx/processor.d.ts +2 -2
  88. package/dist/node/mdx/processor.js +71 -0
  89. package/dist/node/mdx/rehypePlugins/codeMeta.js +10 -0
  90. package/dist/node/mdx/rehypePlugins/headerAnchor.js +53 -0
  91. package/dist/node/mdx/rehypePlugins/shiki.js +34 -0
  92. package/dist/node/mdx/rehypePlugins/transformers/add-lang.js +15 -0
  93. package/dist/node/mdx/rehypePlugins/transformers/add-line-numbers.js +22 -0
  94. package/dist/node/mdx/rehypePlugins/transformers/add-title.js +24 -0
  95. package/dist/node/mdx/rehypePlugins/transformers/add-wrap-code.js +22 -0
  96. package/dist/node/mdx/rehypePlugins/transformers/index.d.ts +5 -5
  97. package/dist/node/mdx/rehypePlugins/transformers/index.js +5 -0
  98. package/dist/node/mdx/rehypePlugins/transformers/meta-highlight.js +41 -0
  99. package/dist/node/mdx/remarkPlugins/builtin.js +11 -0
  100. package/dist/node/mdx/remarkPlugins/containerSyntax.js +190 -0
  101. package/dist/node/mdx/remarkPlugins/fileCodeBlock.js +66 -0
  102. package/dist/node/mdx/remarkPlugins/image.js +67 -0
  103. package/dist/node/mdx/remarkPlugins/link.d.ts +1 -1
  104. package/dist/node/mdx/remarkPlugins/link.js +99 -0
  105. package/dist/node/mdx/remarkPlugins/toc.js +50 -0
  106. package/dist/node/mdx/types.d.ts +3 -3
  107. package/dist/node/medium-zoom/index.d.ts +1 -1
  108. package/dist/node/medium-zoom/index.js +14 -0
  109. package/dist/node/route/RoutePage.d.ts +1 -1
  110. package/dist/node/route/RoutePage.js +61 -0
  111. package/dist/node/route/RouteService.d.ts +1 -1
  112. package/dist/node/route/RouteService.js +177 -0
  113. package/dist/node/route/extractPageData.d.ts +1 -1
  114. package/dist/node/route/extractPageData.js +112 -0
  115. package/dist/node/route/normalizeRoutePath.js +54 -0
  116. package/dist/node/runtimeModule/DEFAULT_I18N_TEXT.d.ts +21 -0
  117. package/dist/node/runtimeModule/DEFAULT_I18N_TEXT.js +150 -0
  118. package/dist/node/runtimeModule/globalStyles.d.ts +1 -1
  119. package/dist/node/runtimeModule/globalStyles.js +12 -0
  120. package/dist/node/runtimeModule/globalUIComponents.d.ts +1 -1
  121. package/dist/node/runtimeModule/globalUIComponents.js +25 -0
  122. package/dist/node/runtimeModule/i18n.d.ts +2 -2
  123. package/dist/node/runtimeModule/i18n.js +83 -0
  124. package/dist/node/runtimeModule/pageData/createPageData.d.ts +1 -1
  125. package/dist/node/runtimeModule/pageData/createPageData.js +64 -0
  126. package/dist/node/runtimeModule/pageData/rsbuildPlugin.d.ts +1 -1
  127. package/dist/node/runtimeModule/pageData/rsbuildPlugin.js +51 -0
  128. package/dist/node/runtimeModule/routeList.d.ts +1 -1
  129. package/dist/node/runtimeModule/routeList.js +7 -0
  130. package/dist/node/runtimeModule/searchHooks.d.ts +1 -1
  131. package/dist/node/runtimeModule/searchHooks.js +11 -0
  132. package/dist/node/runtimeModule/siteData/createSiteData.js +34 -0
  133. package/dist/node/runtimeModule/siteData/normalizeThemeConfig.js +94 -0
  134. package/dist/node/runtimeModule/siteData/rsbuildPlugin.d.ts +1 -1
  135. package/dist/node/runtimeModule/siteData/rsbuildPlugin.js +24 -0
  136. package/dist/node/runtimeModule/socialLinks.d.ts +1 -1
  137. package/dist/node/runtimeModule/socialLinks.js +8 -0
  138. package/dist/node/runtimeModule/types.d.ts +2 -2
  139. package/dist/node/serve.js +23 -0
  140. package/dist/node/ssg/renderHtmlTemplate.js +33 -0
  141. package/dist/node/ssg/renderPage.js +34 -0
  142. package/dist/node/ssg/renderPageWorker.474f9f73.js +2 -0
  143. package/dist/node/ssg/renderPageWorker.js +15 -0
  144. package/dist/node/ssg/renderPages.d.ts +1 -1
  145. package/dist/node/ssg/renderPages.js +105 -0
  146. package/dist/node/ssg/renderPages.js.LICENSE.txt +4 -0
  147. package/dist/node/ssg/rsbuildPluginCSR.d.ts +1 -1
  148. package/dist/node/ssg/rsbuildPluginCSR.js +27 -0
  149. package/dist/node/ssg/rsbuildPluginSSG.d.ts +1 -1
  150. package/dist/node/ssg/rsbuildPluginSSG.js +72 -0
  151. package/dist/node/ssg/ssgEnv.js +33 -0
  152. package/dist/node/ssg/ssgEnv.js.LICENSE.txt +5 -0
  153. package/dist/node/ssg-md/llms/emitLlmsTxt.d.ts +1 -1
  154. package/dist/node/ssg-md/llms/emitLlmsTxt.js +84 -0
  155. package/dist/node/ssg-md/llms/llmsTxt.d.ts +1 -1
  156. package/dist/node/ssg-md/llms/llmsTxt.js +66 -0
  157. package/dist/node/ssg-md/react/index.d.ts +1 -1
  158. package/dist/node/ssg-md/remarkSplitMdx.js +244 -0
  159. package/dist/node/ssg-md/renderPage.js +31 -0
  160. package/dist/node/ssg-md/renderPages.d.ts +1 -1
  161. package/dist/node/ssg-md/renderPages.js +27 -0
  162. package/dist/node/ssg-md/rsbuildPluginSSGMD.d.ts +1 -1
  163. package/dist/node/ssg-md/rsbuildPluginSSGMD.js +47 -0
  164. package/dist/node/utils/applyReplaceRules.js +6 -0
  165. package/dist/node/utils/checkLanguageParity.js +77 -0
  166. package/dist/node/utils/createHash.js +5 -0
  167. package/dist/node/utils/error.d.ts +9 -0
  168. package/dist/node/utils/error.js +10 -0
  169. package/dist/node/utils/escapeHeadingIds.js +5 -0
  170. package/dist/node/utils/flattenMdxContent.js +74 -0
  171. package/dist/node/utils/fs.js +14 -0
  172. package/dist/node/utils/getImportAstNode.js +63 -0
  173. package/dist/node/utils/getPageKey.js +6 -0
  174. package/dist/node/utils/getSocialIcons.js +32 -0
  175. package/dist/node/utils/index.d.ts +10 -9
  176. package/dist/node/utils/normalizePath.js +10 -0
  177. package/dist/node/utils/reactAlias.d.ts +2 -0
  178. package/dist/node/utils/reactAlias.js +83 -0
  179. package/dist/rslib-runtime.99091bf6.js +18 -0
  180. package/dist/runtime/App.js +2 -2
  181. package/dist/runtime/ClientApp.d.ts +1 -1
  182. package/dist/runtime/ClientApp.js +0 -4
  183. package/dist/runtime/initPageData.js +1 -1
  184. package/dist/runtime/ssrMdServerEntry.js +1 -1
  185. package/dist/runtime/ssrServerEntry.js +2 -1
  186. package/dist/runtime.72d450ac.js +1 -0
  187. package/dist/runtime.js +3 -2
  188. package/dist/shiki-transformers.d.ts +1 -1
  189. package/dist/shiki-transformers.js +6 -120
  190. package/dist/theme/assets/deprecated.js +18 -0
  191. package/dist/theme/assets/experimental.js +21 -0
  192. package/dist/theme/components/Badge/index.css +1 -0
  193. package/dist/theme/components/Banner/index.d.ts +1 -1
  194. package/dist/theme/components/Banner/index.js +4 -5
  195. package/dist/theme/components/Callout/index.css +0 -2
  196. package/dist/theme/components/Callout/index.js +5 -2
  197. package/dist/theme/components/CodeBlock/index.css +11 -21
  198. package/dist/theme/components/CodeBlock/index.js +5 -1
  199. package/dist/theme/components/CodeBlockRuntime/index.d.ts +1 -1
  200. package/dist/theme/components/CodeBlockRuntime/index.js +38 -8
  201. package/dist/theme/components/CodeButtonGroup/CopyCodeButton.js +3 -5
  202. package/dist/theme/components/CodeButtonGroup/index.css +5 -1
  203. package/dist/theme/components/CodeButtonGroup/index.js +3 -5
  204. package/dist/theme/components/DocContent/doc.css +28 -7
  205. package/dist/theme/components/DocContent/docComponents/index.d.ts +3 -3
  206. package/dist/theme/components/DocContent/docComponents/pre.js +3 -1
  207. package/dist/theme/components/DocContent/docComponents/table.d.ts +2 -2
  208. package/dist/theme/components/DocContent/docComponents/table.js +8 -3
  209. package/dist/theme/components/DocContent/index.d.ts +11 -2
  210. package/dist/theme/components/DocContent/index.js +6 -6
  211. package/dist/theme/components/DocFooter/index.js +1 -5
  212. package/dist/theme/components/{DocContent/FallbackHeading.js → FallbackHeading/index.js} +19 -11
  213. package/dist/theme/components/HoverGroup/index.css +3 -3
  214. package/dist/theme/components/HoverGroup/useHoverGroup.d.ts +1 -1
  215. package/dist/theme/components/LastUpdated/index.d.ts +1 -1
  216. package/dist/theme/components/LastUpdated/index.js +5 -1
  217. package/dist/theme/components/Link/index.d.ts +1 -1
  218. package/dist/theme/components/Link/index.js +17 -7
  219. package/dist/theme/components/Nav/NavMenu.js +2 -3
  220. package/dist/theme/components/NavHamburger/index.js +3 -4
  221. package/dist/theme/components/NavScreen/NavScreenLangs.css +6 -0
  222. package/dist/theme/components/NavScreen/NavScreenLangs.js +13 -3
  223. package/dist/theme/components/NavScreen/NavScreenMenuItem.js +2 -3
  224. package/dist/theme/components/NavScreen/NavScreenVersions.css +6 -0
  225. package/dist/theme/components/NavScreen/NavScreenVersions.js +12 -3
  226. package/dist/theme/components/Overview/index.d.ts +0 -1
  227. package/dist/theme/components/Overview/index.js +2 -3
  228. package/dist/theme/components/{Overview/OverviewGroup.css → OverviewGroup/index.css} +60 -8
  229. package/dist/theme/components/{Overview/OverviewGroup.d.ts → OverviewGroup/index.d.ts} +1 -1
  230. package/dist/theme/components/OverviewGroup/index.js +88 -0
  231. package/dist/theme/components/PackageManagerTabs/index.d.ts +1 -1
  232. package/dist/theme/components/PackageManagerTabs/index.js +4 -0
  233. package/dist/theme/components/PrevNextPage/index.js +3 -4
  234. package/dist/theme/components/Root/index.d.ts +54 -0
  235. package/dist/theme/components/Root/index.js +7 -0
  236. package/dist/theme/components/Search/NoSearchResult.js +2 -3
  237. package/dist/theme/components/Search/SearchButton.js +3 -4
  238. package/dist/theme/components/Search/SearchPanel.js +12 -15
  239. package/dist/theme/components/Search/SuggestItem.d.ts +1 -1
  240. package/dist/theme/components/Search/SuggestItem.js +7 -11
  241. package/dist/theme/components/Search/logic/Provider.d.ts +1 -1
  242. package/dist/theme/components/Search/logic/providers/LocalProvider.d.ts +2 -2
  243. package/dist/theme/components/Search/logic/search.d.ts +1 -1
  244. package/dist/theme/components/Search/logic/util.test.js +1 -1
  245. package/dist/theme/components/Sidebar/SidebarGroup.js +2 -3
  246. package/dist/theme/components/Sidebar/SidebarItem.js +1 -0
  247. package/dist/theme/components/SidebarMenu/index.js +3 -5
  248. package/dist/theme/components/SocialLinks/index.js +2 -3
  249. package/dist/theme/components/SourceCode/index.js +2 -4
  250. package/dist/theme/components/SwitchAppearance/index.js +3 -5
  251. package/dist/theme/components/Tabs/index.css +19 -27
  252. package/dist/theme/components/Tabs/index.js +9 -0
  253. package/dist/theme/components/Tag/index.d.ts +3 -0
  254. package/dist/theme/components/Tag/index.js +63 -8
  255. package/dist/theme/components/Toc/TocItem.css +2 -3
  256. package/dist/theme/components/Toc/TocItem.js +1 -0
  257. package/dist/theme/hooks/useActiveAnchor.js +1 -1
  258. package/dist/theme/icons.d.ts +27 -0
  259. package/dist/theme/icons.js +51 -0
  260. package/dist/theme/index.d.ts +64 -59
  261. package/dist/theme/index.js +7 -2
  262. package/dist/theme/layout/DocLayout/index.css +2 -4
  263. package/dist/theme/layout/Layout/index.js +1 -2
  264. package/dist/theme/layout/NotFountLayout/index.js +1 -1
  265. package/dist/theme/logic/useAppearance.js +1 -1
  266. package/dist/theme/logic/useFullTextSearch.d.ts +1 -1
  267. package/dist/theme/logic/useMediaQuery.js +1 -1
  268. package/dist/theme/styles/base.css +1 -0
  269. package/dist/theme/styles/scrollbar.css +1 -0
  270. package/dist/theme/styles/shiki.css +9 -3
  271. package/dist/theme/styles/vars/base-vars.css +7 -5
  272. package/dist/theme/styles/vars/code-vars.css +2 -0
  273. package/dist/theme/styles/vars/home-vars.css +2 -1
  274. package/package.json +22 -23
  275. package/dist/3~128.js +0 -74
  276. package/dist/3~517.js +0 -1786
  277. package/dist/3~894.js +0 -26
  278. package/dist/cli.js +0 -259
  279. package/dist/index.js.LICENSE.txt +0 -10
  280. package/dist/node/auto-nav-sidebar/fixtures/docs/guide/c.d.ts +0 -2
  281. package/dist/node/auto-nav-sidebar/fixtures/docs-locales/en/guide/c.d.ts +0 -2
  282. package/dist/node/auto-nav-sidebar/fixtures/docs-locales/zh/guide/c.d.ts +0 -2
  283. package/dist/node/auto-nav-sidebar/locales.test.d.ts +0 -1
  284. package/dist/node/auto-nav-sidebar/walk.test.d.ts +0 -1
  285. package/dist/node/mdx/rehypePlugins/headerAnchor.test.d.ts +0 -1
  286. package/dist/node/mdx/remarkPlugins/containerSyntax.test.d.ts +0 -1
  287. package/dist/node/mdx/remarkPlugins/fileCodeBlock.test.d.ts +0 -1
  288. package/dist/node/mdx/remarkPlugins/image.test.d.ts +0 -1
  289. package/dist/node/mdx/remarkPlugins/link.test.d.ts +0 -1
  290. package/dist/node/route/RouteService.test.d.ts +0 -1
  291. package/dist/node/route/extractPageData.test.d.ts +0 -1
  292. package/dist/node/route/fixtures/basic/guide/c.d.ts +0 -2
  293. package/dist/node/route/normalizeRoutePath.test.d.ts +0 -1
  294. package/dist/node/runtimeModule/i18n.test.d.ts +0 -1
  295. package/dist/node/ssg-md/remarkSplitMdx.test.d.ts +0 -4
  296. package/dist/node/utils/checkLanguageParity.test.d.ts +0 -1
  297. package/dist/node/utils/detectCustomIcon.d.ts +0 -1
  298. package/dist/node/utils/detectReactVersion.d.ts +0 -3
  299. package/dist/processor.js +0 -4539
  300. package/dist/renderPageWorker.js +0 -196
  301. package/dist/theme/components/Overview/OverviewGroup.js +0 -58
  302. package/dist/theme/components/Search/logic/util.test.d.ts +0 -1
  303. /package/dist/cli/{config.d.ts → config/index.d.ts} +0 -0
  304. /package/dist/eject-theme/components/{Overview → OverviewGroup}/icons/plugin.svg +0 -0
  305. /package/dist/{shiki-transformers.js.LICENSE.txt → node/mdx/rehypePlugins/transformers/meta-highlight.js.LICENSE.txt} +0 -0
  306. /package/dist/theme/components/{DocContent/FallbackHeading.d.ts → FallbackHeading/index.d.ts} +0 -0
  307. /package/dist/theme/components/{Overview → OverviewGroup}/icons/plugin.js +0 -0
@@ -1,3 +1,13 @@
1
+ :root {
2
+ --rp-c-overview-group-bg: var(--rp-c-bg-soft);
3
+ --rp-c-overview-group-bg-hover: color-mix(
4
+ in srgb,
5
+ var(--rp-c-brand-lighter) 30%,
6
+ transparent
7
+ );
8
+ --rp-c-overview-group-border: 1px solid var(--rp-c-divider-light);
9
+ }
10
+
1
11
  .rp-overview-group {
2
12
  width: 100%;
3
13
  display: flex;
@@ -9,7 +19,7 @@
9
19
  width: 100%;
10
20
  flex-direction: row;
11
21
 
12
- border: 1px solid var(--rp-c-divider-light);
22
+ border: var(--rp-c-overview-group-border);
13
23
  border-radius: var(--rp-radius);
14
24
  overflow: hidden;
15
25
  transition:
@@ -20,11 +30,7 @@
20
30
  border-color: var(--rp-c-brand-light);
21
31
  box-shadow: 0 4px 6px 0 rgba(0, 0, 0, 0.04);
22
32
  .rp-overview-group__item__title {
23
- background-color: color-mix(
24
- in srgb,
25
- var(--rp-c-brand-lighter) 30%,
26
- transparent
27
- ) !important;
33
+ background-color: var(--rp-c-overview-group-bg-hover);
28
34
  .rp-overview-group__item__title__icon {
29
35
  color: var(--rp-c-brand-dark);
30
36
  }
@@ -40,22 +46,25 @@
40
46
  }
41
47
 
42
48
  &__title {
43
- width: 20%;
44
- flex: 0 0 20%;
45
- word-break: break-all;
49
+ width: 25%;
50
+ flex: 0 0 25%;
46
51
 
47
52
  padding: 16px 20px;
53
+
54
+ word-break: break-all;
48
55
  font-size: 18px;
49
56
  font-weight: 600;
50
- background-color: var(--rp-c-bg-soft);
51
57
  color: var(--rp-c-text-1);
52
58
 
59
+ background-color: var(--rp-c-overview-group-bg);
60
+
53
61
  overflow: hidden;
54
62
  position: relative;
55
63
 
56
64
  transition: background-color 0.2s ease;
57
65
 
58
- a {
66
+ &__link,
67
+ &__text {
59
68
  color: inherit;
60
69
  text-decoration: none;
61
70
 
@@ -121,10 +130,55 @@
121
130
  }
122
131
  }
123
132
  }
133
+
134
+ // Grid layout for items without content (no headers/items)
135
+ &__grid {
136
+ display: grid;
137
+ grid-template-columns: repeat(4, 1fr);
138
+ gap: 20px;
139
+ width: 100%;
140
+
141
+ @media (max-width: 1280px) {
142
+ grid-template-columns: repeat(3, 1fr);
143
+ }
144
+
145
+ @media (max-width: 768px) {
146
+ grid-template-columns: repeat(2, 1fr);
147
+ }
148
+
149
+ @media (max-width: 480px) {
150
+ grid-template-columns: 1fr;
151
+ }
152
+ }
153
+
154
+ &__grid-item {
155
+ border: 1px solid var(--rp-c-divider-light);
156
+ border-radius: var(--rp-radius);
157
+ transition:
158
+ border-color 0.2s ease,
159
+ box-shadow 0.2s ease,
160
+ background-color 0.2s ease;
161
+
162
+ &.rp-overview-group__item__title {
163
+ width: 100%;
164
+ flex: none;
165
+ }
166
+
167
+ &:hover {
168
+ border-color: var(--rp-c-brand-light);
169
+ box-shadow: 0 4px 6px 0 rgba(0, 0, 0, 0.04);
170
+ background-color: var(--rp-c-overview-group-bg-hover);
171
+
172
+ .rp-overview-group__item__title__icon {
173
+ color: var(--rp-c-brand-dark);
174
+ }
175
+ }
176
+ }
124
177
  }
125
178
 
126
179
  html.rp-dark {
127
- .rp-overview-group__item:hover {
180
+ .rp-overview-group__item:hover,
181
+ .rp-overview-group__grid-item:hover {
128
182
  .rp-overview-group__item__title__icon {
129
183
  color: white;
130
184
  }
@@ -1,8 +1,8 @@
1
1
  import { Link, renderInlineMarkdown } from '@theme';
2
- import './OverviewGroup.scss';
2
+ import './index.scss';
3
3
  import type { Header } from '@rspress/core';
4
- import { SvgWrapper } from '@theme';
5
- import { FallbackHeading } from '../DocContent/FallbackHeading';
4
+ import { FallbackHeading, SvgWrapper } from '@theme';
5
+ import { useMemo } from 'react';
6
6
  import IconPlugin from './icons/plugin.svg';
7
7
 
8
8
  export interface GroupItem {
@@ -20,20 +20,41 @@ export interface Group {
20
20
  }
21
21
 
22
22
  export const OverviewGroup = ({ group }: { group: Group }) => {
23
+ const { itemsWithContent, itemsWithoutContent } = useMemo(() => {
24
+ // Separate items into those with content and those without
25
+ const itemsWithContent = group.items.filter(
26
+ item =>
27
+ (item.headers && item.headers.length > 0) ||
28
+ (item.items && item.items.length > 0),
29
+ );
30
+ const itemsWithoutContent = group.items.filter(
31
+ item =>
32
+ !(item.headers && item.headers.length > 0) &&
33
+ !(item.items && item.items.length > 0),
34
+ );
35
+
36
+ return { itemsWithContent, itemsWithoutContent };
37
+ }, [group]);
38
+
23
39
  return (
24
40
  <>
25
41
  <FallbackHeading level={2} title={group.name} />
26
42
  <div className="rp-overview-group rp-not-doc">
27
- {group.items.map(item => (
43
+ {/* Render items with content in the standard split layout */}
44
+ {itemsWithContent.map(item => (
28
45
  <div className="rp-overview-group__item" key={item.link}>
29
46
  <div className="rp-overview-group__item__title">
30
47
  {item.link ? (
31
48
  <Link
32
49
  href={item.link}
50
+ className="rp-overview-group__item__title__link"
33
51
  {...renderInlineMarkdown(item.text)}
34
52
  ></Link>
35
53
  ) : (
36
- <span {...renderInlineMarkdown(item.text)} />
54
+ <span
55
+ className="rp-overview-group__item__title__text"
56
+ {...renderInlineMarkdown(item.text)}
57
+ />
37
58
  )}
38
59
  <SvgWrapper
39
60
  icon={IconPlugin}
@@ -70,6 +91,31 @@ export const OverviewGroup = ({ group }: { group: Group }) => {
70
91
  </ul>
71
92
  </div>
72
93
  ))}
94
+
95
+ {/* Render items without content in a grid layout */}
96
+ {itemsWithoutContent.length > 0 && (
97
+ <div className="rp-overview-group__grid">
98
+ {itemsWithoutContent.map(item => (
99
+ <div
100
+ className="rp-overview-group__grid-item rp-overview-group__item__title"
101
+ key={item.link}
102
+ >
103
+ {item.link ? (
104
+ <Link
105
+ href={item.link}
106
+ className="rp-overview-group__item__title__link"
107
+ {...renderInlineMarkdown(item.text)}
108
+ ></Link>
109
+ ) : (
110
+ <span
111
+ className="rp-overview-group__item__title__text"
112
+ {...renderInlineMarkdown(item.text)}
113
+ />
114
+ )}
115
+ </div>
116
+ ))}
117
+ </div>
118
+ )}
73
119
  </div>
74
120
  </>
75
121
  );
@@ -210,6 +210,18 @@ export function PackageManagerTabs({
210
210
  commandInfo = command;
211
211
  }
212
212
 
213
+ if (process.env.__SSR_MD__) {
214
+ return Object.values(commandInfo).reduce((previous, current) => {
215
+ const [packageManager, command] = splitTo2Parts(current);
216
+ return (
217
+ previous +
218
+ `\n\`\`\`sh [${packageManager}]\n` +
219
+ `${packageManager}${command}\n` +
220
+ `\`\`\`\n`
221
+ );
222
+ }, '');
223
+ }
224
+
213
225
  return (
214
226
  <Tabs
215
227
  groupId="package.manager"
@@ -1,11 +1,11 @@
1
1
  import { useI18n } from '@rspress/core/runtime';
2
2
  import {
3
+ IconArrowRight,
3
4
  Link,
4
5
  renderInlineMarkdown,
5
6
  SvgWrapper,
6
7
  usePrevNextPage,
7
8
  } from '@theme';
8
- import ArrowRight from '@theme-assets/arrow-right';
9
9
  import clsx from 'clsx';
10
10
  import './index.scss';
11
11
 
@@ -25,7 +25,7 @@ export function PrevNextPage() {
25
25
  </span>
26
26
  <span className="rp-prev-next-page__item__title">
27
27
  <SvgWrapper
28
- icon={ArrowRight}
28
+ icon={IconArrowRight}
29
29
  className="rp-prev-next-page__icon rp-prev-next-page__rotate_180"
30
30
  />
31
31
  <span {...renderInlineMarkdown(prevPage.text)} />
@@ -44,7 +44,10 @@ export function PrevNextPage() {
44
44
  </span>
45
45
  <span className="rp-prev-next-page__item__title">
46
46
  <span {...renderInlineMarkdown(nextPage.text)} />
47
- <SvgWrapper icon={ArrowRight} className="rp-prev-next-page__icon" />
47
+ <SvgWrapper
48
+ icon={IconArrowRight}
49
+ className="rp-prev-next-page__icon"
50
+ />
48
51
  </span>
49
52
  </Link>
50
53
  ) : (
@@ -0,0 +1,58 @@
1
+ import type { ReactNode } from 'react';
2
+
3
+ export interface RootProps {
4
+ /**
5
+ * The children elements to render inside the Root component.
6
+ */
7
+ children: ReactNode;
8
+ }
9
+
10
+ /**
11
+ * A wrapper component for the entire application.
12
+ *
13
+ * The Root component wraps all content in the application, including the Layout
14
+ * and global UI components. By default, it simply renders its children without
15
+ * any additional markup or styling.
16
+ *
17
+ * You can eject and customize this component to add global wrappers, providers,
18
+ * or any other elements that should wrap your entire application.
19
+ *
20
+ * @param {RootProps} props - The properties for the Root component.
21
+ * @returns {JSX.Element} The children elements wrapped by the Root component.
22
+ *
23
+ * @example
24
+ * Default usage (no customization needed):
25
+ * ```tsx
26
+ * import { Root } from '@theme';
27
+ *
28
+ * function App() {
29
+ * return (
30
+ * <Root>
31
+ * <YourContent />
32
+ * </Root>
33
+ * );
34
+ * }
35
+ * ```
36
+ *
37
+ * @example
38
+ * Ejected and customized:
39
+ * ```tsx
40
+ * // In your ejected theme/components/Root/index.tsx
41
+ * import type { ReactNode } from 'react';
42
+ *
43
+ * export interface RootProps {
44
+ * children: ReactNode;
45
+ * }
46
+ *
47
+ * export function Root({ children }: RootProps) {
48
+ * return (
49
+ * <div className="my-custom-root">
50
+ * {children}
51
+ * </div>
52
+ * );
53
+ * }
54
+ * ```
55
+ */
56
+ export function Root({ children }: RootProps) {
57
+ return <>{children}</>;
58
+ }
@@ -1,6 +1,5 @@
1
1
  import { useI18n } from '@rspress/core/runtime';
2
- import { SvgWrapper } from '@theme';
3
- import Empty from '@theme-assets/empty';
2
+ import { IconEmpty, SvgWrapper } from '@theme';
4
3
  import './NoSearchResult.scss';
5
4
 
6
5
  export function NoSearchResult({ query }: { query: string }) {
@@ -8,7 +7,7 @@ export function NoSearchResult({ query }: { query: string }) {
8
7
 
9
8
  return (
10
9
  <div className="rp-no-search-result">
11
- <SvgWrapper icon={Empty} className="rp-no-search-result__icon" />
10
+ <SvgWrapper icon={IconEmpty} className="rp-no-search-result__icon" />
12
11
  <p className="rp-no-search-result__text">
13
12
  {t('searchNoResultsText')} <b>&quot;{query}&quot;</b>
14
13
  </p>
@@ -1,6 +1,5 @@
1
1
  import { useI18n } from '@rspress/core/runtime';
2
- import { SvgWrapper } from '@theme';
3
- import SearchSvg from '@theme-assets/search';
2
+ import { IconSearch, SvgWrapper } from '@theme';
4
3
  import { useEffect, useState } from 'react';
5
4
  import './SearchButton.scss';
6
5
 
@@ -20,7 +19,7 @@ export function SearchButton({ setFocused }: SearchButtonProps) {
20
19
  <>
21
20
  <button className="rp-search-button" onClick={() => setFocused(true)}>
22
21
  <div className="rp-search-button__content">
23
- <SvgWrapper icon={SearchSvg} className="rp-search-button__icon" />
22
+ <SvgWrapper icon={IconSearch} className="rp-search-button__icon" />
24
23
  <span className="rp-search-button__word">
25
24
  {t('searchPlaceholderText')}
26
25
  </span>
@@ -37,7 +36,7 @@ export function SearchButton({ setFocused }: SearchButtonProps) {
37
36
  className="rp-search-button--mobile"
38
37
  onClick={() => setFocused(true)}
39
38
  >
40
- <SvgWrapper icon={SearchSvg} />
39
+ <SvgWrapper icon={IconSearch} />
41
40
  </div>
42
41
  </>
43
42
  );
@@ -1,8 +1,13 @@
1
1
  import { useI18n, usePageData } from '@rspress/core/runtime';
2
- import { SvgWrapper, Tab, Tabs, useLinkNavigate } from '@theme';
3
- import CloseSvg from '@theme-assets/close';
4
- import LoadingSvg from '@theme-assets/loading';
5
- import SearchSvg from '@theme-assets/search';
2
+ import {
3
+ IconClose,
4
+ IconLoading,
5
+ IconSearch,
6
+ SvgWrapper,
7
+ Tab,
8
+ Tabs,
9
+ useLinkNavigate,
10
+ } from '@theme';
6
11
  import { debounce } from 'lodash-es';
7
12
  import { useCallback, useEffect, useRef, useState } from 'react';
8
13
  import { createPortal } from 'react-dom';
@@ -418,7 +423,7 @@ export function SearchPanel({ focused, setFocused }: SearchPanelProps) {
418
423
  if (isSearching) {
419
424
  return (
420
425
  <div className="rp-search-panel__loading">
421
- <SvgWrapper icon={LoadingSvg} />
426
+ <SvgWrapper icon={IconLoading} />
422
427
  </div>
423
428
  );
424
429
  }
@@ -499,7 +504,7 @@ export function SearchPanel({ focused, setFocused }: SearchPanelProps) {
499
504
  <div className="rp-search-panel__header">
500
505
  <div className="rp-search-panel__input-form">
501
506
  <label>
502
- <SvgWrapper icon={SearchSvg} />
507
+ <SvgWrapper icon={IconSearch} />
503
508
  </label>
504
509
  <input
505
510
  className="rp-search-panel__input"
@@ -512,7 +517,7 @@ export function SearchPanel({ focused, setFocused }: SearchPanelProps) {
512
517
  />
513
518
  <label>
514
519
  <SvgWrapper
515
- icon={CloseSvg}
520
+ icon={IconClose}
516
521
  className="rp-search-panel__close"
517
522
  onClick={e => {
518
523
  if (searchInputRef.current) {
@@ -1,19 +1,16 @@
1
- import { Link, SvgWrapper } from '@theme';
2
- import FileSvg from '@theme-assets/file';
3
- import HeaderSvg from '@theme-assets/header';
4
- import JumpSvg from '@theme-assets/jump';
5
- import TitleSvg from '@theme-assets/title';
1
+ import {
2
+ IconFile,
3
+ IconHeader,
4
+ IconJump,
5
+ IconTitle,
6
+ Link,
7
+ SvgWrapper,
8
+ } from '@theme';
6
9
  import { useRef } from 'react';
7
10
  import './SuggestItem.scss';
8
11
  import type { DefaultMatchResultItem, HighlightInfo } from './logic/types';
9
12
  import { getSlicedStrByByteLength } from './logic/util';
10
13
 
11
- const ICON_MAP = {
12
- title: TitleSvg,
13
- header: HeaderSvg,
14
- content: FileSvg,
15
- };
16
-
17
14
  export function SuggestItem({
18
15
  suggestion,
19
16
  closeSearch,
@@ -32,6 +29,12 @@ export function SuggestItem({
32
29
  inCurrentDocIndex: boolean;
33
30
  scrollTo: (top: number, height: number) => void;
34
31
  }) {
32
+ const ICON_MAP = {
33
+ title: IconTitle,
34
+ header: IconHeader,
35
+ content: IconFile,
36
+ };
37
+
35
38
  const HitIcon = ICON_MAP[suggestion.type];
36
39
  const selfRef = useRef<HTMLLIElement>(null);
37
40
  if (isCurrent && selfRef.current?.offsetTop) {
@@ -135,7 +138,7 @@ export function SuggestItem({
135
138
  <span>{hitContent}</span>
136
139
  </div>
137
140
  <div className="rp-suggest-item__action-icon">
138
- <SvgWrapper icon={JumpSvg} />
141
+ <SvgWrapper icon={IconJump} />
139
142
  </div>
140
143
  </div>
141
144
  </Link>
@@ -1,5 +1,5 @@
1
1
  import type { Header } from '@rspress/core';
2
- import { describe, expect, test } from 'vitest';
2
+ import { describe, expect, test } from '@rstest/core';
3
3
  import { backTrackHeaders } from './util';
4
4
 
5
5
  describe('utils logic', () => {
@@ -5,8 +5,7 @@ import type {
5
5
  SidebarSectionHeader as SidebarSectionHeaderType,
6
6
  } from '@rspress/core';
7
7
  import { useActiveMatcher } from '@rspress/core/runtime';
8
- import { SvgWrapper, useLinkNavigate } from '@theme';
9
- import ArrowRight from '@theme-assets/arrow-right';
8
+ import { IconArrowRight, SvgWrapper, useLinkNavigate } from '@theme';
10
9
  import clsx from 'clsx';
11
10
  import type React from 'react';
12
11
  import { SidebarDivider } from './SidebarDivider';
@@ -27,7 +26,7 @@ const CollapsibleIcon = ({ collapsed }: { collapsed: boolean }) => (
27
26
  transform: collapsed ? 'rotate(0deg)' : 'rotate(90deg)',
28
27
  }}
29
28
  >
30
- <SvgWrapper icon={ArrowRight} />
29
+ <SvgWrapper icon={IconArrowRight} />
31
30
  </div>
32
31
  );
33
32
 
@@ -76,6 +76,7 @@ export function SidebarItemRaw({
76
76
  }}
77
77
  {...{ 'data-depth': depth }}
78
78
  {...(context ? { 'data-context': context } : {})}
79
+ onClick={onClick}
79
80
  >
80
81
  {innerContent}
81
82
  </Link>
@@ -1,13 +1,13 @@
1
1
  import { useFrontmatter, useI18n, useLocation } from '@rspress/core/runtime';
2
2
  import {
3
+ IconArrowRight,
4
+ IconMenu,
3
5
  ReadPercent,
4
6
  renderInlineMarkdown,
5
7
  SvgWrapper,
6
8
  useActiveAnchor,
7
9
  useDynamicToc,
8
10
  } from '@theme';
9
- import ArrowRight from '@theme-assets/arrow-right';
10
- import MenuIcon from '@theme-assets/menu';
11
11
  import { forwardRef, useEffect, useRef } from 'react';
12
12
  import { createPortal } from 'react-dom';
13
13
  import './index.scss';
@@ -85,7 +85,7 @@ export const SidebarMenu = forwardRef(
85
85
  onClick={openSidebar}
86
86
  className="rp-sidebar-menu__left"
87
87
  >
88
- <SvgWrapper icon={MenuIcon} />
88
+ <SvgWrapper icon={IconMenu} />
89
89
  <span>{t('menuTitle')}</span>
90
90
  </button>
91
91
  ) : (
@@ -114,7 +114,7 @@ export const SidebarMenu = forwardRef(
114
114
  {/* TODO: discussion */}
115
115
  {headers.length !== 0 && (
116
116
  <SvgWrapper
117
- icon={ArrowRight}
117
+ icon={IconArrowRight}
118
118
  style={{
119
119
  transform: isOutlineOpen ? 'rotate(90deg)' : 'rotate(0deg)',
120
120
  transition: 'transform 0.2s ease-out',
@@ -1,7 +1,6 @@
1
1
  import type { SocialLink } from '@rspress/core';
2
2
  import { useSite } from '@rspress/core/runtime';
3
- import { SvgWrapper } from '@theme';
4
- import ArrowDown from '@theme-assets/arrow-down';
3
+ import { IconArrowDown, SvgWrapper } from '@theme';
5
4
  import './index.scss';
6
5
  import { useHoverGroup } from '../HoverGroup/useHoverGroup';
7
6
  import { SocialLink as SocialLinkComp } from './SocialLink';
@@ -56,7 +55,7 @@ export const SocialLinks = ({
56
55
  ))}
57
56
  {isMore ? (
58
57
  <SvgWrapper
59
- icon={ArrowDown}
58
+ icon={IconArrowDown}
60
59
  onMouseEnter={handleMouseEnter}
61
60
  fontSize={20}
62
61
  />
@@ -1,7 +1,5 @@
1
1
  import { useI18n } from '@rspress/core/runtime';
2
- import { SvgWrapper } from '@theme';
3
- import Github from '@theme-assets/github';
4
- import Gitlab from '@theme-assets/gitlab';
2
+ import { IconGithub, IconGitlab, SvgWrapper } from '@theme';
5
3
  import './index.scss';
6
4
 
7
5
  interface SourceCodeProps {
@@ -16,7 +14,11 @@ export function SourceCode(props: SourceCodeProps) {
16
14
  <div className="rp-not-doc rp-source-code">
17
15
  <a href={href} target="_blank" className="rp-source-code__link">
18
16
  <span className="rp-source-code__icon">
19
- {<SvgWrapper icon={platform === 'gitlab' ? Gitlab : Github} />}
17
+ {
18
+ <SvgWrapper
19
+ icon={platform === 'gitlab' ? IconGitlab : IconGithub}
20
+ />
21
+ }
20
22
  </span>
21
23
  <span className="rp-source-code__text">{t('sourceCodeText')}</span>
22
24
  </a>
@@ -1,7 +1,5 @@
1
1
  import { ThemeContext, useSite } from '@rspress/core/runtime';
2
- import { SvgWrapper } from '@theme';
3
- import MoonSvg from '@theme-assets/moon';
4
- import SunSvg from '@theme-assets/sun';
2
+ import { IconMoon, IconSun, SvgWrapper } from '@theme';
5
3
  import { type MouseEvent, useContext } from 'react';
6
4
  import './global.scss';
7
5
  import './index.scss';
@@ -90,12 +88,12 @@ export function SwitchAppearance({ onClick }: { onClick?: () => void }) {
90
88
  <div onClick={handleClick} className="rp-switch-appearance">
91
89
  <SvgWrapper
92
90
  className="rp-switch-appearance__icon rp-switch-appearance__icon--sun"
93
- icon={SunSvg}
91
+ icon={IconSun}
94
92
  fill="currentColor"
95
93
  />
96
94
  <SvgWrapper
97
95
  className="rp-switch-appearance__icon rp-switch-appearance__icon--moon"
98
- icon={MoonSvg}
96
+ icon={IconMoon}
99
97
  fill="currentColor"
100
98
  />
101
99
  </div>