@rspress/core 2.0.0-rc.7 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{0~7675.efbf8813.js → 0~7675.58d06f93.js} +2 -2
- package/dist/{5485.e8bfcd99.js → 5485.c50a566c.js} +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/config/loadConfigFile.js +1 -1
- package/dist/eject-theme/components/HomeFeature/index.scss +1 -1
- package/dist/eject-theme/components/HomeHero/index.tsx +10 -3
- package/dist/eject-theme/components/HoverGroup/index.scss +4 -0
- package/dist/eject-theme/components/Nav/NavMenu.tsx +0 -4
- package/dist/eject-theme/components/Nav/index.tsx +4 -2
- package/dist/index.js +1 -1
- package/dist/node/auto-nav-sidebar/index.js +1 -1
- package/dist/node/constants.js +1 -1
- package/dist/node/initRsbuild.js +3 -3
- package/dist/node/last-updated/index.js +1 -1
- package/dist/node/route/RouteService.js +1 -1
- package/dist/node/route/extractPageData.js +1 -1
- package/dist/node/route/normalizeRoutePath.js +1 -1
- package/dist/node/runtimeModule/i18n.js +1 -1
- package/dist/node/runtimeModule/pageData/createPageData.js +1 -1
- package/dist/node/runtimeModule/pageData/rsbuildPlugin.js +1 -1
- package/dist/node/serve.js +1 -1
- package/dist/node/ssg/renderPage.js +1 -1
- package/dist/node/ssg/renderPageWorker.js +1 -1
- package/dist/node/ssg/renderPages.js +2 -2
- package/dist/node/ssg-md/llms/emitLlmsTxt.js +1 -1
- package/dist/node/ssg-md/renderPage.js +1 -1
- package/dist/node/ssg-md/renderPages.js +1 -1
- package/dist/node/utils/createHash.js +1 -1
- package/dist/node/utils/flattenMdxContent.js +1 -1
- package/dist/node/utils/reactAlias.js +1 -1
- package/dist/theme/components/HomeFeature/index.css +1 -1
- package/dist/theme/components/HomeHero/index.d.ts +2 -1
- package/dist/theme/components/HomeHero/index.js +6 -3
- package/dist/theme/components/HoverGroup/index.css +2 -0
- package/dist/theme/components/Nav/NavMenu.js +1 -1
- package/dist/theme/components/Nav/index.js +4 -2
- package/package.json +12 -12
- /package/dist/{9446.421b464f.js → 2016.421b464f.js} +0 -0
|
@@ -9,8 +9,8 @@ import { setTimeout as promises_setTimeout } from "node:timers/promises";
|
|
|
9
9
|
import { debuglog } from "node:util";
|
|
10
10
|
import { node_process, node_os, constants } from "./9348.1beb3e25.js";
|
|
11
11
|
import { node_path } from "./6289.29817fb4.js";
|
|
12
|
-
import { node_url } from "./5485.
|
|
13
|
-
import { createWriteStream, createReadStream, readFileSync } from "./
|
|
12
|
+
import { node_url } from "./5485.c50a566c.js";
|
|
13
|
+
import { createWriteStream, createReadStream, readFileSync } from "./2016.421b464f.js";
|
|
14
14
|
__webpack_require__.add({
|
|
15
15
|
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
16
16
|
const cp = __webpack_require__("child_process");
|
package/dist/cli/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { node_path, logger, join, picocolors } from "../6289.29817fb4.js";
|
|
2
2
|
import { chokidar, cac } from "./index.44f3184c.js";
|
|
3
|
-
import { package_namespaceObject } from "../5485.
|
|
3
|
+
import { package_namespaceObject } from "../5485.c50a566c.js";
|
|
4
4
|
import { loadConfigFile, resolveDocRoot } from "../config/loadConfigFile.js";
|
|
5
5
|
import { dev } from "../node/dev.js";
|
|
6
6
|
import { PUBLIC_DIR } from "../node/constants.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { node_fs, DEFAULT_CONFIG_EXTENSIONS, DEFAULT_CONFIG_NAME } from "../
|
|
1
|
+
import { node_fs, DEFAULT_CONFIG_EXTENSIONS, DEFAULT_CONFIG_NAME } from "../2016.421b464f.js";
|
|
2
2
|
import { node_path, logger } from "../6289.29817fb4.js";
|
|
3
3
|
const findConfig = (basePath)=>DEFAULT_CONFIG_EXTENSIONS.map((ext)=>basePath + ext).find(node_fs.existsSync);
|
|
4
4
|
async function loadConfigFile(customConfigFile) {
|
|
@@ -17,12 +17,17 @@ const DEFAULT_HERO = {
|
|
|
17
17
|
interface HomeHeroProps {
|
|
18
18
|
beforeHeroActions?: React.ReactNode;
|
|
19
19
|
afterHeroActions?: React.ReactNode;
|
|
20
|
+
image?: React.ReactNode;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
function HomeHero({
|
|
23
|
+
function HomeHero({
|
|
24
|
+
beforeHeroActions,
|
|
25
|
+
afterHeroActions,
|
|
26
|
+
image,
|
|
27
|
+
}: HomeHeroProps) {
|
|
23
28
|
const { frontmatter } = useFrontmatter();
|
|
24
29
|
const hero = frontmatter?.hero || DEFAULT_HERO;
|
|
25
|
-
const hasImage = hero.image !== undefined;
|
|
30
|
+
const hasImage = hero.image !== undefined || image !== undefined;
|
|
26
31
|
const multiHeroText = hero.text
|
|
27
32
|
? hero.text
|
|
28
33
|
.toString()
|
|
@@ -90,7 +95,9 @@ function HomeHero({ beforeHeroActions, afterHeroActions }: HomeHeroProps) {
|
|
|
90
95
|
{afterHeroActions}
|
|
91
96
|
</>
|
|
92
97
|
</div>
|
|
93
|
-
{
|
|
98
|
+
{image ? (
|
|
99
|
+
<div className="rp-home-hero__image">{image}</div>
|
|
100
|
+
) : hero.image ? (
|
|
94
101
|
<div className="rp-home-hero__image">
|
|
95
102
|
<img
|
|
96
103
|
src={normalizeImagePath(imageSrc.light)}
|
|
@@ -87,10 +87,6 @@ export function NavMenuItemWithLink({
|
|
|
87
87
|
className={cls(
|
|
88
88
|
'rp-nav-menu__item',
|
|
89
89
|
isActive ? 'rp-nav-menu__item--active' : '',
|
|
90
|
-
|
|
91
|
-
// For algolia crawler compatibility
|
|
92
|
-
'rspress-nav-menu-item',
|
|
93
|
-
isActive ? 'rspress-nav-menu-item-active' : '',
|
|
94
90
|
)}
|
|
95
91
|
>
|
|
96
92
|
<NavMenuItemInner menuItem={menuItem} />
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useNav } from '@rspress/core/runtime';
|
|
1
|
+
import { useNav, useSite } from '@rspress/core/runtime';
|
|
2
2
|
import {
|
|
3
3
|
NavHamburger,
|
|
4
4
|
NavTitle,
|
|
@@ -27,6 +27,8 @@ export function Nav(props: NavProps) {
|
|
|
27
27
|
navTitle,
|
|
28
28
|
} = props;
|
|
29
29
|
const navList = useNav();
|
|
30
|
+
const { site } = useSite();
|
|
31
|
+
const hasAppearanceSwitch = site.themeConfig.darkMode !== false;
|
|
30
32
|
|
|
31
33
|
return (
|
|
32
34
|
<header className="rp-nav">
|
|
@@ -48,7 +50,7 @@ export function Nav(props: NavProps) {
|
|
|
48
50
|
<NavMenuDivider />
|
|
49
51
|
<NavLangs />
|
|
50
52
|
<NavVersions />
|
|
51
|
-
<SwitchAppearance />
|
|
53
|
+
{hasAppearanceSwitch && <SwitchAppearance />}
|
|
52
54
|
<SocialLinks />
|
|
53
55
|
</div>
|
|
54
56
|
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ export { build } from "./node/build.js";
|
|
|
5
5
|
export { defineConfig } from "./config/defineConfig.js";
|
|
6
6
|
export { dev } from "./node/dev.js";
|
|
7
7
|
export { logger } from "./6289.29817fb4.js";
|
|
8
|
-
export { matchPath } from "./
|
|
8
|
+
export { matchPath } from "./2016.421b464f.js";
|
|
9
9
|
export { remarkFileCodeBlock } from "./node/mdx/remarkPlugins/fileCodeBlock.js";
|
|
10
10
|
export { remarkLink } from "./node/mdx/remarkPlugins/link.js";
|
|
11
11
|
export { serve } from "./node/serve.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { node_path } from "../../6289.29817fb4.js";
|
|
2
|
-
import { DEFAULT_PAGE_EXTENSIONS } from "../../
|
|
2
|
+
import { DEFAULT_PAGE_EXTENSIONS } from "../../2016.421b464f.js";
|
|
3
3
|
import { processLocales, combineWalkResult } from "./locales.js";
|
|
4
4
|
import { walk } from "./walk.js";
|
|
5
5
|
async function runAutoNavSide(config, metaFileSet, mdFileSet) {
|
package/dist/node/constants.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createRequire, package_namespaceObject } from "../5485.
|
|
1
|
+
import { createRequire, package_namespaceObject } from "../5485.c50a566c.js";
|
|
2
2
|
import { node_path } from "../6289.29817fb4.js";
|
|
3
3
|
const constants_require = createRequire(import.meta.url);
|
|
4
4
|
const RSPRESS_VERSION = package_namespaceObject.rE;
|
package/dist/node/initRsbuild.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { createRequire, fileURLToPath, package_namespaceObject } from "../5485.
|
|
1
|
+
import { createRequire, fileURLToPath, package_namespaceObject } from "../5485.c50a566c.js";
|
|
2
2
|
import { node_path } from "../6289.29817fb4.js";
|
|
3
3
|
import { removeTrailingSlash, MDX_OR_MD_REGEXP, cwd } from "../9348.1beb3e25.js";
|
|
4
|
-
import { PLUGIN_REACT_NAME, pluginReact, pluginVirtualModule } from "../
|
|
4
|
+
import { PLUGIN_REACT_NAME, pluginReact, pluginVirtualModule } from "../2016.421b464f.js";
|
|
5
5
|
import { createError } from "./utils/error.js";
|
|
6
6
|
import { PUBLIC_DIR, CSR_CLIENT_ENTRY, SSR_CLIENT_ENTRY, OUTPUT_DIR, SSG_MD_SERVER_ENTRY, inlineThemeScript, NODE_SSG_BUNDLE_FOLDER, isProduction, PACKAGE_ROOT, SSR_SERVER_ENTRY, TEMPLATE_PATH, NODE_SSG_MD_BUNDLE_FOLDER, DEFAULT_THEME, NODE_SSG_MD_BUNDLE_NAME, DEFAULT_TITLE, NODE_SSG_BUNDLE_NAME } from "./constants.js";
|
|
7
7
|
import { hintBuilderPluginsBreakingChange, hintThemeBreakingChange } from "./logger/hint.js";
|
|
@@ -200,7 +200,7 @@ async function createInternalBuildConfig(userDocRoot, config, enableSSG, routeSe
|
|
|
200
200
|
bundlerChain (chain, { CHAIN_ID, environment }) {
|
|
201
201
|
const isSsg = 'node' === environment.name;
|
|
202
202
|
const isSsgMd = 'node_md' === environment.name;
|
|
203
|
-
const jsModuleRule = chain.module.rule(CHAIN_ID.RULE.JS);
|
|
203
|
+
const jsModuleRule = chain.module.rule(CHAIN_ID.RULE.JS).oneOfs.get(CHAIN_ID.ONE_OF.JS_MAIN);
|
|
204
204
|
const swcLoaderOptions = jsModuleRule.use(CHAIN_ID.USE.SWC).get('options');
|
|
205
205
|
chain.module.rule('MDX').type("javascript/auto").test(MDX_OR_MD_REGEXP).resolve.merge({
|
|
206
206
|
conditionNames: jsModuleRule.resolve.conditionNames.values(),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { node_path, promises } from "../../6289.29817fb4.js";
|
|
2
2
|
import { RSPRESS_TEMP_DIR, removeTrailingSlash, addTrailingSlash } from "../../9348.1beb3e25.js";
|
|
3
|
-
import { DEFAULT_PAGE_EXTENSIONS, glob } from "../../
|
|
3
|
+
import { DEFAULT_PAGE_EXTENSIONS, glob } from "../../2016.421b464f.js";
|
|
4
4
|
import { PUBLIC_DIR } from "../constants.js";
|
|
5
5
|
import { RoutePage, absolutePathToRoutePath, absolutePathToRelativePath } from "./RoutePage.js";
|
|
6
6
|
import { createError } from "../utils/error.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { node_path, promises } from "../../6289.29817fb4.js";
|
|
2
2
|
import { unified, visit, remark_gfm, loadFrontMatter, remark_stringify, MDX_OR_MD_REGEXP } from "../../9348.1beb3e25.js";
|
|
3
|
-
import { remove, remark_parse } from "../../
|
|
3
|
+
import { remove, remark_parse } from "../../2016.421b464f.js";
|
|
4
4
|
import { applyReplaceRules } from "../utils/applyReplaceRules.js";
|
|
5
5
|
import { flattenMdxContent } from "../utils/flattenMdxContent.js";
|
|
6
6
|
import { importStatementRegex } from "../constants.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { addTrailingSlash, addLeadingSlash } from "../../9348.1beb3e25.js";
|
|
2
|
-
import { DEFAULT_PAGE_EXTENSIONS } from "../../
|
|
2
|
+
import { DEFAULT_PAGE_EXTENSIONS } from "../../2016.421b464f.js";
|
|
3
3
|
const getRoutePathParts = (relativePath, lang, version, langs, versions)=>{
|
|
4
4
|
const [versionPart, langPart, purePath] = splitRoutePathParts(relativePath, lang, version, langs, versions);
|
|
5
5
|
return [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createRequire } from "../../5485.
|
|
1
|
+
import { createRequire } from "../../5485.c50a566c.js";
|
|
2
2
|
import { picocolors, join, logger } from "../../6289.29817fb4.js";
|
|
3
3
|
import { DEFAULT_I18N_TEXT } from "./DEFAULT_I18N_TEXT.js";
|
|
4
4
|
import { createError } from "../utils/error.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SEARCH_INDEX_NAME } from "../../../9348.1beb3e25.js";
|
|
2
|
-
import { groupBy } from "../../../
|
|
2
|
+
import { groupBy } from "../../../2016.421b464f.js";
|
|
3
3
|
import { extractPageData } from "../../route/extractPageData.js";
|
|
4
4
|
import { createHash } from "../../utils/createHash.js";
|
|
5
5
|
function deletePrivateField(obj) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { logger } from "../../../6289.29817fb4.js";
|
|
2
|
-
import { pluginVirtualModule } from "../../../
|
|
2
|
+
import { pluginVirtualModule } from "../../../2016.421b464f.js";
|
|
3
3
|
import { createPageData } from "./createPageData.js";
|
|
4
4
|
const rsbuildPluginDocVM = async ({ config, userDocRoot, routeService, pluginDriver })=>{
|
|
5
5
|
const ref = {
|
package/dist/node/serve.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { mergeRsbuildConfig } from "../
|
|
1
|
+
import { mergeRsbuildConfig } from "../2016.421b464f.js";
|
|
2
2
|
import { PluginDriver } from "./PluginDriver.js";
|
|
3
3
|
import { initRsbuild } from "./initRsbuild.js";
|
|
4
4
|
import { RouteService } from "./route/RouteService.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { transformHtmlTemplate, pathToFileURL, createHead } from "../../5485.
|
|
1
|
+
import { transformHtmlTemplate, pathToFileURL, createHead } from "../../5485.c50a566c.js";
|
|
2
2
|
import { logger, picocolors } from "../../6289.29817fb4.js";
|
|
3
3
|
import { hintSSGFailed } from "../logger/hint.js";
|
|
4
4
|
import { renderHtmlTemplate } from "./renderHtmlTemplate.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { workerData } from "./renderPageWorker.165b5d46.js";
|
|
2
2
|
import { createError } from "../utils/error.js";
|
|
3
|
-
import { pMap } from "../../5485.
|
|
3
|
+
import { pMap } from "../../5485.c50a566c.js";
|
|
4
4
|
import { renderPage } from "./renderPage.js";
|
|
5
5
|
const params = workerData?.[1]?.params;
|
|
6
6
|
if (!params) throw createError('SSG Worker Thread workerData params missing');
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*! For license information please see renderPages.js.LICENSE.txt */
|
|
2
2
|
import { logger, picocolors } from "../../6289.29817fb4.js";
|
|
3
|
-
import { chunk } from "../../
|
|
3
|
+
import { chunk } from "../../2016.421b464f.js";
|
|
4
4
|
import { SSGWorkerThreadTaskSize, getNumberOfThreads, SSGWorkerThreadRecyclerMaxMemory, SSGConcurrency } from "./ssgEnv.js";
|
|
5
|
-
import { pMap } from "../../5485.
|
|
5
|
+
import { pMap } from "../../5485.c50a566c.js";
|
|
6
6
|
import { renderPage } from "./renderPage.js";
|
|
7
7
|
import { hintSSGFailed } from "../logger/hint.js";
|
|
8
8
|
import { renderHtmlTemplate } from "./renderHtmlTemplate.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getSidebarDataGroup } from "../../../9348.1beb3e25.js";
|
|
2
|
-
import { matchPath } from "../../../
|
|
2
|
+
import { matchPath } from "../../../2016.421b464f.js";
|
|
3
3
|
import { generateLlmsTxt, generateLlmsFullTxt } from "./llmsTxt.js";
|
|
4
4
|
async function emitLlmsTxt(config, routeService, emitAsset, mdContents) {
|
|
5
5
|
const base = config.base ?? '/';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { pathToFileURL, createHead } from "../../5485.
|
|
1
|
+
import { pathToFileURL, createHead } from "../../5485.c50a566c.js";
|
|
2
2
|
import { logger, picocolors } from "../../6289.29817fb4.js";
|
|
3
3
|
import { hintSSGFailed } from "../logger/hint.js";
|
|
4
4
|
async function renderPage(route, ssrBundlePath) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { logger, picocolors } from "../../6289.29817fb4.js";
|
|
2
|
-
import { pMap } from "../../5485.
|
|
2
|
+
import { pMap } from "../../5485.c50a566c.js";
|
|
3
3
|
import { renderPage } from "./renderPage.js";
|
|
4
4
|
import { SSGConcurrency } from "../ssg/ssgEnv.js";
|
|
5
5
|
const routePage2MdFilename = (routePath)=>{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createHash as external_node_crypto_createHash } from "../../
|
|
1
|
+
import { createHash as external_node_crypto_createHash } from "../../2016.421b464f.js";
|
|
2
2
|
function createHash(str) {
|
|
3
3
|
return external_node_crypto_createHash('sha256').update(str).digest('hex').slice(0, 8);
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { node_fs, core_rspack } from "../../
|
|
1
|
+
import { node_fs, core_rspack } from "../../2016.421b464f.js";
|
|
2
2
|
import { node_path, logger } from "../../6289.29817fb4.js";
|
|
3
3
|
import { createProcessor, MDX_OR_MD_REGEXP } from "../../9348.1beb3e25.js";
|
|
4
4
|
import { createError } from "./error.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { node_path, logger, picocolors } from "../../6289.29817fb4.js";
|
|
2
|
-
import { core_rspack } from "../../
|
|
2
|
+
import { core_rspack } from "../../2016.421b464f.js";
|
|
3
3
|
import { pathExists, readJson } from "./fs.js";
|
|
4
4
|
import { PACKAGE_ROOT } from "../constants.js";
|
|
5
5
|
import { hintReactVersion } from "../logger/hint.js";
|
|
@@ -2,7 +2,8 @@ import './index.scss';
|
|
|
2
2
|
interface HomeHeroProps {
|
|
3
3
|
beforeHeroActions?: React.ReactNode;
|
|
4
4
|
afterHeroActions?: React.ReactNode;
|
|
5
|
+
image?: React.ReactNode;
|
|
5
6
|
}
|
|
6
|
-
declare function HomeHero({ beforeHeroActions, afterHeroActions }: HomeHeroProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function HomeHero({ beforeHeroActions, afterHeroActions, image, }: HomeHeroProps): import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export { HomeHero };
|
|
8
9
|
export type { HomeHeroProps };
|
|
@@ -11,10 +11,10 @@ const DEFAULT_HERO = {
|
|
|
11
11
|
actions: [],
|
|
12
12
|
image: void 0
|
|
13
13
|
};
|
|
14
|
-
function HomeHero({ beforeHeroActions, afterHeroActions }) {
|
|
14
|
+
function HomeHero({ beforeHeroActions, afterHeroActions, image }) {
|
|
15
15
|
const { frontmatter } = useFrontmatter();
|
|
16
16
|
const hero = frontmatter?.hero || DEFAULT_HERO;
|
|
17
|
-
const hasImage = void 0 !== hero.image;
|
|
17
|
+
const hasImage = void 0 !== hero.image || void 0 !== image;
|
|
18
18
|
const multiHeroText = hero.text ? hero.text.toString().split(/\n/g).filter((text)=>'' !== text) : [];
|
|
19
19
|
const imageSrc = 'string' == typeof hero.image?.src ? {
|
|
20
20
|
light: hero.image.src,
|
|
@@ -80,7 +80,10 @@ function HomeHero({ beforeHeroActions, afterHeroActions }) {
|
|
|
80
80
|
})
|
|
81
81
|
]
|
|
82
82
|
}),
|
|
83
|
-
|
|
83
|
+
image ? /*#__PURE__*/ jsx("div", {
|
|
84
|
+
className: "rp-home-hero__image",
|
|
85
|
+
children: image
|
|
86
|
+
}) : hero.image ? /*#__PURE__*/ jsxs("div", {
|
|
84
87
|
className: "rp-home-hero__image",
|
|
85
88
|
children: [
|
|
86
89
|
/*#__PURE__*/ jsx("img", {
|
|
@@ -62,7 +62,7 @@ function NavMenuItemWithLink({ menuItem }) {
|
|
|
62
62
|
pathname
|
|
63
63
|
]);
|
|
64
64
|
return /*#__PURE__*/ jsx("li", {
|
|
65
|
-
className: clsx('rp-nav-menu__item', isActive ? 'rp-nav-menu__item--active' : ''
|
|
65
|
+
className: clsx('rp-nav-menu__item', isActive ? 'rp-nav-menu__item--active' : ''),
|
|
66
66
|
children: /*#__PURE__*/ jsx(NavMenuItemInner, {
|
|
67
67
|
menuItem: menuItem
|
|
68
68
|
})
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useNav } from "@rspress/core/runtime";
|
|
2
|
+
import { useNav, useSite } from "@rspress/core/runtime";
|
|
3
3
|
import { NavHamburger, NavTitle, Search, SocialLinks, SwitchAppearance } from "@theme";
|
|
4
4
|
import "./index.css";
|
|
5
5
|
import { NavLangs, NavMenu, NavMenuDivider, NavVersions } from "./NavMenu.js";
|
|
6
6
|
function Nav(props) {
|
|
7
7
|
const { beforeNavTitle, afterNavTitle, beforeNavMenu, afterNavMenu, navTitle } = props;
|
|
8
8
|
const navList = useNav();
|
|
9
|
+
const { site } = useSite();
|
|
10
|
+
const hasAppearanceSwitch = false !== site.themeConfig.darkMode;
|
|
9
11
|
return /*#__PURE__*/ jsxs("header", {
|
|
10
12
|
className: "rp-nav",
|
|
11
13
|
children: [
|
|
@@ -36,7 +38,7 @@ function Nav(props) {
|
|
|
36
38
|
/*#__PURE__*/ jsx(NavMenuDivider, {}),
|
|
37
39
|
/*#__PURE__*/ jsx(NavLangs, {}),
|
|
38
40
|
/*#__PURE__*/ jsx(NavVersions, {}),
|
|
39
|
-
/*#__PURE__*/ jsx(SwitchAppearance, {}),
|
|
41
|
+
hasAppearanceSwitch && /*#__PURE__*/ jsx(SwitchAppearance, {}),
|
|
40
42
|
/*#__PURE__*/ jsx(SocialLinks, {})
|
|
41
43
|
]
|
|
42
44
|
}),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspress/core",
|
|
3
|
-
"version": "2.0.0
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "The Rspress Documentation Framework",
|
|
5
5
|
"bugs": "https://github.com/web-infra-dev/rspress/issues",
|
|
6
6
|
"repository": {
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@mdx-js/mdx": "^3.1.1",
|
|
65
65
|
"@mdx-js/react": "^3.1.1",
|
|
66
|
-
"@rsbuild/core": "2.0.0-alpha.
|
|
66
|
+
"@rsbuild/core": "2.0.0-alpha.4",
|
|
67
67
|
"@rsbuild/plugin-react": "~1.4.3",
|
|
68
68
|
"@shikijs/rehype": "^3.21.0",
|
|
69
69
|
"@types/unist": "^3.0.3",
|
|
@@ -77,14 +77,14 @@
|
|
|
77
77
|
"github-slugger": "^2.0.0",
|
|
78
78
|
"hast-util-heading-rank": "^3.0.0",
|
|
79
79
|
"hast-util-to-jsx-runtime": "^2.3.6",
|
|
80
|
-
"lodash-es": "^4.17.
|
|
80
|
+
"lodash-es": "^4.17.23",
|
|
81
81
|
"mdast-util-mdx": "^3.0.0",
|
|
82
82
|
"mdast-util-mdxjs-esm": "^2.0.1",
|
|
83
83
|
"medium-zoom": "1.1.0",
|
|
84
84
|
"nprogress": "^0.2.0",
|
|
85
85
|
"picocolors": "^1.1.1",
|
|
86
|
-
"react": "^19.2.
|
|
87
|
-
"react-dom": "^19.2.
|
|
86
|
+
"react": "^19.2.4",
|
|
87
|
+
"react-dom": "^19.2.4",
|
|
88
88
|
"react-lazy-with-preload": "^2.2.1",
|
|
89
89
|
"react-reconciler": "0.33.0",
|
|
90
90
|
"react-router-dom": "^7.12.0",
|
|
@@ -102,23 +102,23 @@
|
|
|
102
102
|
"unist-util-remove": "^4.0.0",
|
|
103
103
|
"unist-util-visit": "^5.0.0",
|
|
104
104
|
"unist-util-visit-children": "^3.0.0",
|
|
105
|
-
"@rspress/shared": "2.0.0
|
|
105
|
+
"@rspress/shared": "2.0.0"
|
|
106
106
|
},
|
|
107
107
|
"devDependencies": {
|
|
108
108
|
"@microsoft/api-extractor": "^7.55.2",
|
|
109
|
-
"@rsbuild/plugin-sass": "~1.
|
|
110
|
-
"@rsbuild/plugin-svgr": "^1.
|
|
111
|
-
"@rslib/core": "0.19.
|
|
109
|
+
"@rsbuild/plugin-sass": "~1.5.0",
|
|
110
|
+
"@rsbuild/plugin-svgr": "^1.3.0",
|
|
111
|
+
"@rslib/core": "0.19.3",
|
|
112
112
|
"@types/body-scroll-lock": "^3.1.2",
|
|
113
113
|
"@types/hast": "^3.0.4",
|
|
114
114
|
"@types/lodash-es": "^4.17.12",
|
|
115
115
|
"@types/mdast": "^4.0.4",
|
|
116
116
|
"@types/node": "^22.8.1",
|
|
117
117
|
"@types/nprogress": "^0.2.3",
|
|
118
|
-
"@types/react": "^19.2.
|
|
118
|
+
"@types/react": "^19.2.10",
|
|
119
119
|
"@types/react-dom": "^19.2.3",
|
|
120
120
|
"@types/react-reconciler": "^0.32.3",
|
|
121
|
-
"@types/web": "^0.0.
|
|
121
|
+
"@types/web": "^0.0.323",
|
|
122
122
|
"execa": "8.0.1",
|
|
123
123
|
"mdast-util-directive": "^3.1.0",
|
|
124
124
|
"mdast-util-mdx-expression": "^2.0.1",
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
"p-map": "^7.0.4",
|
|
127
127
|
"postcss": "8.5.6",
|
|
128
128
|
"remark-directive": "^4.0.0",
|
|
129
|
-
"rsbuild-plugin-publint": "^0.3.
|
|
129
|
+
"rsbuild-plugin-publint": "^0.3.4",
|
|
130
130
|
"rsbuild-plugin-virtual-module": "0.4.1",
|
|
131
131
|
"tailwindcss": "^3.4.19",
|
|
132
132
|
"ts-json-schema-generator": "^2.4.0",
|
|
File without changes
|