@rspress/core 2.0.5 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/0~1402.js +1 -0
- package/dist/{0~7675.423f6a06.js → 0~execa.js} +6 -5
- package/dist/1361.js +5 -0
- package/dist/1965.js +7 -0
- package/dist/4454.js +8 -0
- package/dist/{7744.421b464f.js → 4524.js} +20 -5
- package/dist/7397.js +18 -0
- package/dist/{5485.0bb24594.js → 8311.js} +5 -2
- package/dist/8474.js +4 -0
- package/dist/8885.js +4 -0
- package/dist/cli/index.js +2 -3
- package/dist/config/loadConfigFile.js +1 -2
- package/dist/eject-theme/components/Banner/index.tsx +1 -1
- package/dist/eject-theme/components/Button/index.tsx +1 -1
- package/dist/eject-theme/components/CodeBlock/index.scss +54 -1
- package/dist/eject-theme/components/CodeBlock/index.tsx +77 -7
- package/dist/eject-theme/components/CodeBlockRuntime/index.tsx +12 -2
- package/dist/eject-theme/components/CodeButtonGroup/CopyCodeButton.tsx +1 -1
- package/dist/eject-theme/components/CodeButtonGroup/index.tsx +15 -15
- package/dist/eject-theme/components/DocContent/docComponents/a.tsx +1 -1
- package/dist/eject-theme/components/DocContent/docComponents/pre.tsx +5 -1
- package/dist/eject-theme/components/DocContent/docComponents/title.tsx +6 -1
- package/dist/eject-theme/components/DocContent/index.tsx +1 -1
- package/dist/eject-theme/components/DocFooter/index.tsx +1 -1
- package/dist/eject-theme/components/EditLink/index.tsx +1 -1
- package/dist/eject-theme/components/FallbackHeading/index.tsx +4 -1
- package/dist/eject-theme/components/HomeFeature/index.tsx +5 -1
- package/dist/eject-theme/components/HomeFooter/index.tsx +1 -1
- package/dist/eject-theme/components/HomeHero/index.tsx +2 -2
- package/dist/eject-theme/components/HoverGroup/index.tsx +5 -2
- package/dist/eject-theme/components/Link/useLinkNavigate.ts +1 -1
- package/dist/eject-theme/components/Llms/LlmsCopyButton.tsx +3 -2
- package/dist/eject-theme/components/Llms/LlmsCopyRow.tsx +3 -2
- package/dist/eject-theme/components/Llms/LlmsOpenRow.tsx +1 -1
- package/dist/eject-theme/components/Llms/LlmsViewOptions.tsx +3 -2
- package/dist/eject-theme/components/Llms/copy.ts +12 -0
- package/dist/eject-theme/components/Nav/NavMenu.tsx +9 -2
- package/dist/eject-theme/components/Nav/index.tsx +1 -1
- package/dist/eject-theme/components/NavHamburger/index.tsx +6 -1
- package/dist/eject-theme/components/NavScreen/NavScreenAppearance.tsx +1 -1
- package/dist/eject-theme/components/NavScreen/NavScreenLangs.tsx +1 -1
- package/dist/eject-theme/components/NavScreen/NavScreenMenuItem.tsx +5 -1
- package/dist/eject-theme/components/NavScreen/NavScreenMenuOthers.tsx +1 -1
- package/dist/eject-theme/components/NavScreen/NavScreenVersions.tsx +1 -1
- package/dist/eject-theme/components/NavScreen/index.tsx +1 -1
- package/dist/eject-theme/components/NavTitle/index.tsx +1 -1
- package/dist/eject-theme/components/Outline/ScrollToTop.tsx +5 -1
- package/dist/eject-theme/components/Outline/index.tsx +1 -1
- package/dist/eject-theme/components/Overview/index.tsx +1 -1
- package/dist/eject-theme/components/OverviewGroup/index.tsx +2 -2
- package/dist/eject-theme/components/PackageManagerTabs/index.tsx +1 -1
- package/dist/eject-theme/components/PrevNextPage/index.tsx +1 -1
- package/dist/eject-theme/components/Root/index.tsx +1 -1
- package/dist/eject-theme/components/Search/NoSearchResult.tsx +1 -1
- package/dist/eject-theme/components/Search/SearchButton.tsx +1 -1
- package/dist/eject-theme/components/Search/SearchPanel.tsx +3 -1
- package/dist/eject-theme/components/Search/SuggestItem.tsx +1 -1
- package/dist/eject-theme/components/Search/index.tsx +1 -1
- package/dist/eject-theme/components/Sidebar/SidebarGroup.tsx +5 -1
- package/dist/eject-theme/components/Sidebar/SidebarItem.scss +0 -4
- package/dist/eject-theme/components/Sidebar/SidebarItem.tsx +1 -1
- package/dist/eject-theme/components/Sidebar/SidebarSectionHeader.tsx +1 -1
- package/dist/eject-theme/components/SidebarMenu/index.tsx +1 -1
- package/dist/eject-theme/components/SocialLinks/index.tsx +1 -1
- package/dist/eject-theme/components/SourceCode/index.tsx +1 -1
- package/dist/eject-theme/components/SvgWrapper/index.tsx +1 -1
- package/dist/eject-theme/components/SwitchAppearance/index.tsx +1 -1
- package/dist/eject-theme/components/Tabs/index.scss +13 -15
- package/dist/eject-theme/components/Tabs/index.tsx +1 -1
- package/dist/eject-theme/components/Tag/index.tsx +1 -1
- package/dist/eject-theme/components/Toc/TocItem.tsx +5 -1
- package/dist/eject-theme/components/Toc/index.tsx +1 -1
- package/dist/index.js +1 -3
- package/dist/node/PluginDriver.js +3 -8
- package/dist/node/auto-nav-sidebar/index.js +1 -2
- package/dist/node/auto-nav-sidebar/locales.js +1 -1
- package/dist/node/auto-nav-sidebar/normalize.js +3 -2
- package/dist/node/auto-nav-sidebar/utils.js +1 -2
- package/dist/node/auto-nav-sidebar/walk.js +1 -2
- package/dist/node/constants.js +1 -2
- package/dist/node/eject.js +1 -1
- package/dist/node/initRsbuild.js +2 -4
- package/dist/node/last-updated/index.js +1 -1
- package/dist/node/logger/hint.js +4 -1
- package/dist/node/mdx/options.js +1 -3
- package/dist/node/mdx/processor.js +1 -2
- package/dist/node/mdx/rehypePlugins/codeMeta.js +1 -1
- package/dist/node/mdx/rehypePlugins/headerAnchor.js +1 -2
- package/dist/node/mdx/rehypePlugins/shiki.d.ts +1 -1
- package/dist/node/mdx/rehypePlugins/shiki.js +2 -1
- package/dist/node/mdx/rehypePlugins/transformers/add-fold.d.ts +6 -0
- package/dist/node/mdx/rehypePlugins/transformers/add-fold.js +38 -0
- package/dist/node/mdx/rehypePlugins/transformers/index.d.ts +1 -0
- package/dist/node/mdx/rehypePlugins/transformers/index.js +1 -0
- package/dist/node/mdx/rehypePlugins/transformers/meta-highlight.js +1 -1
- package/dist/node/mdx/remarkPlugins/builtin.js +1 -1
- package/dist/node/mdx/remarkPlugins/fileCodeBlock.js +1 -2
- package/dist/node/mdx/remarkPlugins/image.js +1 -1
- package/dist/node/mdx/remarkPlugins/link.js +1 -2
- package/dist/node/mdx/remarkPlugins/toc.js +1 -1
- package/dist/node/medium-zoom/index.js +1 -1
- package/dist/node/route/RoutePage.js +1 -1
- package/dist/node/route/RouteService.js +1 -3
- package/dist/node/route/extractPageData.js +1 -3
- package/dist/node/route/normalizeRoutePath.js +1 -2
- package/dist/node/runtimeModule/i18n.js +2 -3
- package/dist/node/runtimeModule/pageData/createPageData.js +1 -2
- package/dist/node/runtimeModule/pageData/rsbuildPlugin.js +1 -2
- package/dist/node/runtimeModule/searchHooks.js +1 -1
- package/dist/node/runtimeModule/siteData/createSiteData.js +1 -1
- package/dist/node/runtimeModule/siteData/normalizeThemeConfig.js +1 -1
- package/dist/node/runtimeModule/siteData/rsbuildPlugin.js +1 -1
- package/dist/node/serve.js +1 -1
- package/dist/node/ssg/renderPage.js +1 -2
- package/dist/node/ssg/renderPageWorker.js +2 -2
- package/dist/node/ssg/renderPages.js +3 -4
- package/dist/node/ssg/rsbuildPluginSSG.js +1 -2
- package/dist/node/ssg/ssgEnv.d.ts +1 -1
- package/dist/node/ssg/ssgEnv.js +2 -2
- package/dist/node/ssg-md/llms/emitLlmsTxt.js +5 -7
- package/dist/node/ssg-md/llms/llmsTxt.js +1 -2
- package/dist/node/ssg-md/remarkSplitMdx.js +1 -2
- package/dist/node/ssg-md/renderPage.js +1 -2
- package/dist/node/ssg-md/renderPages.js +2 -2
- package/dist/node/ssg-md/rsbuildPluginSSGMD.js +1 -2
- package/dist/node/utils/checkLanguageParity.js +1 -1
- package/dist/node/utils/createHash.js +1 -1
- package/dist/node/utils/error.js +1 -1
- package/dist/node/utils/flattenMdxContent.js +1 -3
- package/dist/node/utils/fs.js +1 -1
- package/dist/node/utils/getPageKey.js +1 -1
- package/dist/node/utils/normalizePath.js +1 -2
- package/dist/node/utils/reactAlias.js +15 -10
- package/dist/runtime/index.js +20 -21
- package/dist/runtime/ssrMdServerEntry.js +2 -2
- package/dist/runtime/ssrServerEntry.js +2 -2
- package/dist/runtime/utils.d.ts +1 -1
- package/dist/runtime/utils.js +1 -1
- package/dist/shiki-transformers.js +1 -0
- package/dist/theme/assets/arrow-down.js +1 -1
- package/dist/theme/assets/arrow-right.js +1 -1
- package/dist/theme/assets/close.js +1 -1
- package/dist/theme/assets/copy.js +1 -1
- package/dist/theme/assets/deprecated.js +1 -1
- package/dist/theme/assets/down.js +1 -1
- package/dist/theme/assets/edit.js +1 -1
- package/dist/theme/assets/empty.js +1 -1
- package/dist/theme/assets/experimental.js +1 -1
- package/dist/theme/assets/external-link.js +1 -1
- package/dist/theme/assets/file.js +1 -1
- package/dist/theme/assets/github.js +1 -1
- package/dist/theme/assets/gitlab.js +1 -1
- package/dist/theme/assets/header.js +1 -1
- package/dist/theme/assets/jump.js +1 -1
- package/dist/theme/assets/link.js +1 -1
- package/dist/theme/assets/loading.js +1 -1
- package/dist/theme/assets/menu.js +1 -1
- package/dist/theme/assets/moon.js +1 -1
- package/dist/theme/assets/scroll-to-top.js +1 -1
- package/dist/theme/assets/search.js +1 -1
- package/dist/theme/assets/small-menu.js +1 -1
- package/dist/theme/assets/success.js +1 -1
- package/dist/theme/assets/sun.js +1 -1
- package/dist/theme/assets/title.js +1 -1
- package/dist/theme/assets/wrap.js +1 -1
- package/dist/theme/assets/wrapped.js +1 -1
- package/dist/theme/components/Banner/index.js +1 -1
- package/dist/theme/components/Button/index.js +1 -1
- package/dist/theme/components/Callout/index.js +2 -1
- package/dist/theme/components/CodeBlock/index.css +49 -1
- package/dist/theme/components/CodeBlock/index.d.ts +11 -3
- package/dist/theme/components/CodeBlock/index.js +51 -6
- package/dist/theme/components/CodeBlockRuntime/index.d.ts +2 -2
- package/dist/theme/components/CodeBlockRuntime/index.js +10 -2
- package/dist/theme/components/CodeButtonGroup/CopyCodeButton.js +1 -1
- package/dist/theme/components/CodeButtonGroup/index.d.ts +6 -6
- package/dist/theme/components/CodeButtonGroup/index.js +10 -10
- package/dist/theme/components/DocContent/docComponents/a.js +1 -1
- package/dist/theme/components/DocContent/docComponents/pre.d.ts +2 -2
- package/dist/theme/components/DocContent/docComponents/pre.js +4 -2
- package/dist/theme/components/DocContent/docComponents/title.js +1 -1
- package/dist/theme/components/DocContent/index.js +1 -1
- package/dist/theme/components/DocFooter/index.js +1 -1
- package/dist/theme/components/EditLink/index.js +1 -1
- package/dist/theme/components/FallbackHeading/index.js +1 -1
- package/dist/theme/components/HomeBackground/index.css +1 -0
- package/dist/theme/components/HomeFeature/index.css +3 -3
- package/dist/theme/components/HomeFeature/index.js +1 -1
- package/dist/theme/components/HomeFooter/index.js +1 -1
- package/dist/theme/components/HomeHero/index.d.ts +1 -1
- package/dist/theme/components/HomeHero/index.js +1 -1
- package/dist/theme/components/HoverGroup/index.d.ts +1 -1
- package/dist/theme/components/HoverGroup/index.js +4 -1
- package/dist/theme/components/Link/useLinkNavigate.d.ts +1 -1
- package/dist/theme/components/Llms/LlmsCopyButton.js +4 -3
- package/dist/theme/components/Llms/LlmsCopyRow.js +3 -2
- package/dist/theme/components/Llms/LlmsOpenRow.js +1 -1
- package/dist/theme/components/Llms/LlmsViewOptions.js +4 -3
- package/dist/theme/components/Llms/copy.d.ts +1 -0
- package/dist/theme/components/Llms/copy.js +9 -0
- package/dist/theme/components/Llms/index.css +1 -0
- package/dist/theme/components/Llms/index.js +4 -5
- package/dist/theme/components/Nav/NavMenu.d.ts +1 -1
- package/dist/theme/components/Nav/NavMenu.js +2 -1
- package/dist/theme/components/Nav/index.css +1 -1
- package/dist/theme/components/Nav/index.js +1 -1
- package/dist/theme/components/NavHamburger/index.js +1 -1
- package/dist/theme/components/NavScreen/NavScreenAppearance.js +1 -1
- package/dist/theme/components/NavScreen/NavScreenLangs.js +1 -1
- package/dist/theme/components/NavScreen/NavScreenMenuItem.d.ts +2 -1
- package/dist/theme/components/NavScreen/NavScreenMenuItem.js +4 -2
- package/dist/theme/components/NavScreen/NavScreenMenuOthers.js +1 -1
- package/dist/theme/components/NavScreen/NavScreenVersions.js +1 -1
- package/dist/theme/components/NavScreen/index.css +1 -1
- package/dist/theme/components/NavScreen/index.js +1 -1
- package/dist/theme/components/NavTitle/index.js +1 -1
- package/dist/theme/components/Outline/ScrollToTop.js +1 -1
- package/dist/theme/components/Outline/index.js +1 -1
- package/dist/theme/components/Overview/index.d.ts +1 -1
- package/dist/theme/components/Overview/index.js +1 -1
- package/dist/theme/components/OverviewGroup/icons/plugin.js +1 -1
- package/dist/theme/components/OverviewGroup/index.css +1 -0
- package/dist/theme/components/OverviewGroup/index.js +1 -1
- package/dist/theme/components/PackageManagerTabs/index.js +1 -1
- package/dist/theme/components/PrevNextPage/index.js +1 -1
- package/dist/theme/components/Root/index.d.ts +1 -1
- package/dist/theme/components/Search/NoSearchResult.js +1 -1
- package/dist/theme/components/Search/SearchButton.js +1 -1
- package/dist/theme/components/Search/SearchPanel.js +3 -2
- package/dist/theme/components/Search/SuggestItem.js +1 -1
- package/dist/theme/components/Search/index.js +1 -1
- package/dist/theme/components/Search/logic/providers/LocalProvider.js +1 -1
- package/dist/theme/components/Sidebar/SidebarGroup.js +1 -1
- package/dist/theme/components/Sidebar/SidebarItem.css +0 -4
- package/dist/theme/components/Sidebar/SidebarItem.js +1 -1
- package/dist/theme/components/Sidebar/SidebarSectionHeader.js +1 -1
- package/dist/theme/components/SidebarMenu/index.js +1 -1
- package/dist/theme/components/SocialLinks/index.js +1 -1
- package/dist/theme/components/SourceCode/index.js +1 -1
- package/dist/theme/components/SvgWrapper/index.js +1 -1
- package/dist/theme/components/SwitchAppearance/index.js +1 -1
- package/dist/theme/components/Tabs/index.css +14 -8
- package/dist/theme/components/Tabs/index.js +1 -1
- package/dist/theme/components/Tag/index.js +1 -1
- package/dist/theme/components/Toc/TocItem.css +1 -1
- package/dist/theme/components/Toc/TocItem.js +1 -1
- package/dist/theme/components/Toc/index.js +1 -1
- package/dist/theme/index.js +66 -67
- package/dist/theme/layout/DocLayout/index.css +11 -11
- package/dist/theme/layout/DocLayout/index.js +1 -1
- package/dist/theme/layout/HomeLayout/index.js +1 -1
- package/dist/theme/layout/Layout/index.d.ts +2 -2
- package/dist/theme/layout/Layout/index.js +16 -6
- package/dist/theme/layout/NotFountLayout/index.js +1 -1
- package/dist/theme/styles/base.css +7 -4
- package/dist/theme/styles/preflight.css +2 -0
- package/dist/theme/styles/vars/home-vars.css +28 -4
- package/nav-json-schema.json +3 -0
- package/package.json +14 -14
- package/dist/6289.29817fb4.js +0 -4
- package/dist/9348.1beb3e25.js +0 -11
- package/dist/cli/index.44f3184c.js +0 -2
- package/dist/node/mdx/loader.15134034.js +0 -9
- /package/dist/{node/ssg/renderPageWorker.165b5d46.js → 9224.js} +0 -0
- /package/dist/{rslib-runtime.99091bf6.js → rslib-runtime.js} +0 -0
package/dist/0~1402.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as node_path } from "node:path";
|
|
@@ -2,15 +2,16 @@ import * as __rspack_external_child_process from "child_process";
|
|
|
2
2
|
import * as __rspack_external_fs from "fs";
|
|
3
3
|
import * as __rspack_external_path from "path";
|
|
4
4
|
import * as __rspack_external_stream from "stream";
|
|
5
|
-
import { __webpack_require__ } from "./rslib-runtime.
|
|
5
|
+
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
6
6
|
import { Buffer } from "node:buffer";
|
|
7
|
+
import node_path from "node:path";
|
|
7
8
|
import node_child_process, { ChildProcess } from "node:child_process";
|
|
9
|
+
import node_process from "node:process";
|
|
10
|
+
import node_url from "node:url";
|
|
11
|
+
import node_os, { constants } from "node:os";
|
|
12
|
+
import { createReadStream, createWriteStream, readFileSync } from "node:fs";
|
|
8
13
|
import { setTimeout as promises_setTimeout } from "node:timers/promises";
|
|
9
14
|
import { debuglog } from "node:util";
|
|
10
|
-
import { node_process, node_os, constants } from "./9348.1beb3e25.js";
|
|
11
|
-
import { node_path } from "./6289.29817fb4.js";
|
|
12
|
-
import { node_url } from "./5485.0bb24594.js";
|
|
13
|
-
import { createWriteStream, createReadStream, readFileSync } from "./7744.421b464f.js";
|
|
14
15
|
__webpack_require__.add({
|
|
15
16
|
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
16
17
|
const cp = __webpack_require__("child_process");
|
package/dist/1361.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as node_os } from "node:os";
|
|
2
|
+
export { default as node_path } from "node:path";
|
|
3
|
+
export { extractTextAndId } from "@rspress/shared/node-utils";
|
|
4
|
+
export { default as github_slugger } from "github-slugger";
|
|
5
|
+
export { visitChildren } from "unist-util-visit-children";
|
package/dist/1965.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { readFile } from "node:fs/promises";
|
|
2
|
+
export { default as node_path } from "node:path";
|
|
3
|
+
export { cwd } from "node:process";
|
|
4
|
+
export { logger } from "@rspress/shared/logger";
|
|
5
|
+
export { default as picocolors } from "picocolors";
|
|
6
|
+
export { visit } from "unist-util-visit";
|
|
7
|
+
export { addLeadingSlash, isExternalUrl, isProduction, normalizeHref, parseUrl, withBase } from "@rspress/shared";
|
package/dist/4454.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as node_path, join } from "node:path";
|
|
2
|
+
export { logger } from "@rspress/shared/logger";
|
|
3
|
+
export { cac } from "cac";
|
|
4
|
+
export { default as chokidar } from "chokidar";
|
|
5
|
+
export { default as picocolors } from "picocolors";
|
|
6
|
+
export { default as node_fs } from "node:fs";
|
|
7
|
+
export { DEFAULT_CONFIG_EXTENSIONS, DEFAULT_CONFIG_NAME } from "@rspress/shared/constants";
|
|
8
|
+
export { default as promises } from "node:fs/promises";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { extname, join } from "
|
|
1
|
+
import node_path, { extname, join, relative } from "node:path";
|
|
2
2
|
const PLUGIN_VIRTUAL_MODULE_NAME = 'rsbuild:virtual-module';
|
|
3
3
|
const pluginVirtualModule = (pluginOptions = {})=>({
|
|
4
4
|
name: PLUGIN_VIRTUAL_MODULE_NAME,
|
|
@@ -43,14 +43,29 @@ const pluginVirtualModule = (pluginOptions = {})=>({
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
|
-
export {
|
|
47
|
-
export {
|
|
46
|
+
export { DEFAULT_PAGE_EXTENSIONS } from "@rspress/shared/constants";
|
|
47
|
+
export { default as promises, mkdir, readdir, rm, stat, writeFile } from "node:fs/promises";
|
|
48
|
+
export { MDX_OR_MD_REGEXP, RSPRESS_TEMP_DIR, SEARCH_INDEX_NAME, addLeadingSlash, addTrailingSlash, getSidebarDataGroup, isDebugMode, isExternalUrl, normalizeHref, removeLeadingSlash, removeTrailingSlash, slash, withBase } from "@rspress/shared";
|
|
48
49
|
export { glob } from "tinyglobby";
|
|
50
|
+
export { logger } from "@rspress/shared/logger";
|
|
51
|
+
export { default as picocolors } from "picocolors";
|
|
52
|
+
export { extractTextAndId, getIconUrlPath, loadFrontMatter } from "@rspress/shared/node-utils";
|
|
53
|
+
export { createRequire } from "node:module";
|
|
54
|
+
export { cwd } from "node:process";
|
|
55
|
+
export { fileURLToPath, pathToFileURL } from "node:url";
|
|
49
56
|
export { PLUGIN_REACT_NAME, pluginReact } from "@rsbuild/plugin-react";
|
|
50
57
|
export { chunk, groupBy } from "lodash-es";
|
|
58
|
+
export { default as remark_gfm } from "remark-gfm";
|
|
51
59
|
export { default as remark_parse } from "remark-parse";
|
|
60
|
+
export { default as remark_stringify } from "remark-stringify";
|
|
61
|
+
export { unified } from "unified";
|
|
52
62
|
export { remove } from "unist-util-remove";
|
|
53
|
-
export {
|
|
63
|
+
export { visit } from "unist-util-visit";
|
|
64
|
+
export { default as node_fs } from "node:fs";
|
|
65
|
+
export { createProcessor } from "@mdx-js/mdx";
|
|
54
66
|
export { mergeRsbuildConfig, rspack as core_rspack } from "@rsbuild/core";
|
|
55
67
|
export { createHash } from "node:crypto";
|
|
56
|
-
export {
|
|
68
|
+
export { default as node_os } from "node:os";
|
|
69
|
+
export { matchPath } from "react-router-dom";
|
|
70
|
+
export { createHead } from "@unhead/react/server";
|
|
71
|
+
export { extname, join, node_path, pluginVirtualModule, relative };
|
package/dist/7397.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { default as node_path } from "node:path";
|
|
2
|
+
export { createProcessor, nodeTypes } from "@mdx-js/mdx";
|
|
3
|
+
export { extractTextAndId, getNodeAttribute, loadFrontMatter } from "@rspress/shared/node-utils";
|
|
4
|
+
export { default as rehype } from "@shikijs/rehype";
|
|
5
|
+
export { default as rehype_external_links } from "rehype-external-links";
|
|
6
|
+
export { default as rehype_raw } from "rehype-raw";
|
|
7
|
+
export { default as remark_cjk_friendly } from "remark-cjk-friendly";
|
|
8
|
+
export { default as remark_cjk_friendly_gfm_strikethrough } from "remark-cjk-friendly-gfm-strikethrough";
|
|
9
|
+
export { default as remark_gfm } from "remark-gfm";
|
|
10
|
+
export { default as remark_mdx } from "remark-mdx";
|
|
11
|
+
export { default as remark_stringify } from "remark-stringify";
|
|
12
|
+
export { unified } from "unified";
|
|
13
|
+
export { visit } from "unist-util-visit";
|
|
14
|
+
export { default as github_slugger } from "github-slugger";
|
|
15
|
+
export { headingRank } from "hast-util-heading-rank";
|
|
16
|
+
export { transformerAddFold, transformerAddLang, transformerAddLineNumbers, transformerAddTitle, transformerAddWrapCode } from "@rspress/core/shiki-transformers";
|
|
17
|
+
export { createCssVariablesTheme } from "shiki";
|
|
18
|
+
export { isExternalUrl } from "@rspress/shared";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var package_namespaceObject = {
|
|
2
|
-
rE: "2.0.
|
|
2
|
+
rE: "2.0.7"
|
|
3
3
|
};
|
|
4
4
|
async function pMap(iterable, mapper, { concurrency = 1 / 0, stopOnError = true, signal } = {}) {
|
|
5
5
|
return new Promise((resolve_, reject_)=>{
|
|
@@ -93,6 +93,9 @@ async function pMap(iterable, mapper, { concurrency = 1 / 0, stopOnError = true,
|
|
|
93
93
|
}
|
|
94
94
|
const pMapSkip = Symbol('skip');
|
|
95
95
|
export { createRequire } from "node:module";
|
|
96
|
-
export { default as
|
|
96
|
+
export { default as node_path } from "node:path";
|
|
97
|
+
export { pathToFileURL } from "node:url";
|
|
98
|
+
export { logger } from "@rspress/shared/logger";
|
|
97
99
|
export { createHead, transformHtmlTemplate } from "@unhead/react/server";
|
|
100
|
+
export { default as picocolors } from "picocolors";
|
|
98
101
|
export { pMap, package_namespaceObject };
|
package/dist/8474.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { RSPRESS_TEMP_DIR, getSidebarDataGroup, normalizeHref, normalizePosixPath, removeTrailingSlash, withBase } from "@rspress/shared";
|
|
2
|
+
export { logger } from "@rspress/shared/logger";
|
|
3
|
+
export { getIconUrlPath, getNodeAttribute, mergeDocConfig } from "@rspress/shared/node-utils";
|
|
4
|
+
export { matchPath } from "react-router-dom";
|
package/dist/8885.js
ADDED
package/dist/cli/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { node_path, logger, join,
|
|
2
|
-
import {
|
|
3
|
-
import { package_namespaceObject } from "../5485.0bb24594.js";
|
|
1
|
+
import { chokidar, node_path, logger, picocolors, join, cac } from "../4454.js";
|
|
2
|
+
import { package_namespaceObject } from "../8311.js";
|
|
4
3
|
import { loadConfigFile, resolveDocRoot } from "../config/loadConfigFile.js";
|
|
5
4
|
import { dev } from "../node/dev.js";
|
|
6
5
|
import { PUBLIC_DIR } from "../node/constants.js";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { node_fs,
|
|
2
|
-
import { node_path, logger } from "../6289.29817fb4.js";
|
|
1
|
+
import { node_fs, node_path, logger, DEFAULT_CONFIG_NAME, DEFAULT_CONFIG_EXTENSIONS } from "../4454.js";
|
|
3
2
|
const findConfig = (basePath)=>DEFAULT_CONFIG_EXTENSIONS.map((ext)=>basePath + ext).find(node_fs.existsSync);
|
|
4
3
|
async function loadConfigFile(customConfigFile) {
|
|
5
4
|
const baseDir = process.cwd();
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
line-height: 1.7;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
&--code
|
|
68
|
+
&--wrap-code code {
|
|
69
69
|
white-space: pre-wrap !important;
|
|
70
70
|
word-break: break-all !important;
|
|
71
71
|
}
|
|
@@ -87,4 +87,57 @@
|
|
|
87
87
|
width: 3ch;
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
+
|
|
91
|
+
&--fold {
|
|
92
|
+
overflow: hidden;
|
|
93
|
+
position: relative;
|
|
94
|
+
|
|
95
|
+
&::after {
|
|
96
|
+
content: '';
|
|
97
|
+
position: absolute;
|
|
98
|
+
bottom: 0;
|
|
99
|
+
left: 0;
|
|
100
|
+
right: 0;
|
|
101
|
+
height: 48px;
|
|
102
|
+
background: linear-gradient(
|
|
103
|
+
to bottom,
|
|
104
|
+
transparent,
|
|
105
|
+
var(--rp-code-block-bg)
|
|
106
|
+
);
|
|
107
|
+
pointer-events: none;
|
|
108
|
+
z-index: 2;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.rp-codeblock__fold-btn {
|
|
114
|
+
display: flex;
|
|
115
|
+
align-items: center;
|
|
116
|
+
justify-content: center;
|
|
117
|
+
width: 100%;
|
|
118
|
+
padding: 4px 0;
|
|
119
|
+
border: none;
|
|
120
|
+
background-color: var(--rp-code-block-bg);
|
|
121
|
+
color: var(--rp-c-text-3);
|
|
122
|
+
cursor: pointer;
|
|
123
|
+
transition:
|
|
124
|
+
color 0.2s ease,
|
|
125
|
+
background-color 0.2s ease;
|
|
126
|
+
user-select: none;
|
|
127
|
+
border-radius: 0 0 var(--rp-radius) var(--rp-radius);
|
|
128
|
+
|
|
129
|
+
&:hover {
|
|
130
|
+
color: var(--rp-c-text-1);
|
|
131
|
+
background-color: var(--rp-code-title-bg);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
&__icon {
|
|
135
|
+
width: 18px;
|
|
136
|
+
height: 18px;
|
|
137
|
+
transition: transform 0.3s ease;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&--expanded &__icon {
|
|
141
|
+
transform: rotate(180deg);
|
|
142
|
+
}
|
|
90
143
|
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CodeButtonGroup,
|
|
3
3
|
type CodeButtonGroupProps,
|
|
4
|
+
IconArrowDown,
|
|
5
|
+
SvgWrapper,
|
|
4
6
|
useCodeButtonGroup,
|
|
5
|
-
} from '@theme';
|
|
7
|
+
} from '@rspress/core/theme';
|
|
6
8
|
import clsx from 'clsx';
|
|
9
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
7
10
|
import './index.scss';
|
|
8
11
|
|
|
9
12
|
export type CodeBlockProps = {
|
|
@@ -17,10 +20,18 @@ export type CodeBlockProps = {
|
|
|
17
20
|
* @default false
|
|
18
21
|
*/
|
|
19
22
|
lineNumbers?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
fold?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* @default 300
|
|
29
|
+
*/
|
|
30
|
+
height?: number;
|
|
20
31
|
containerElementClassName?: string;
|
|
21
32
|
codeButtonGroupProps?: Omit<
|
|
22
33
|
CodeButtonGroupProps,
|
|
23
|
-
'preElementRef' | '
|
|
34
|
+
'preElementRef' | 'wrapCode' | 'toggleWrapCode'
|
|
24
35
|
>;
|
|
25
36
|
children?: React.ReactNode;
|
|
26
37
|
};
|
|
@@ -66,6 +77,8 @@ export function CodeBlock({
|
|
|
66
77
|
lang = 'txt',
|
|
67
78
|
wrapCode: wrapCodeProp = false,
|
|
68
79
|
lineNumbers: lineNumbersProp = false,
|
|
80
|
+
fold = false,
|
|
81
|
+
height = 300,
|
|
69
82
|
codeButtonGroupProps,
|
|
70
83
|
children,
|
|
71
84
|
}: CodeBlockProps) {
|
|
@@ -73,8 +86,44 @@ export function CodeBlock({
|
|
|
73
86
|
return <>{children}</>;
|
|
74
87
|
}
|
|
75
88
|
|
|
76
|
-
const {
|
|
77
|
-
|
|
89
|
+
const {
|
|
90
|
+
wrapCode: wrapCodeState,
|
|
91
|
+
toggleWrapCode,
|
|
92
|
+
copyElementRef,
|
|
93
|
+
} = useCodeButtonGroup(wrapCodeProp);
|
|
94
|
+
const [expanded, setExpanded] = useState(false);
|
|
95
|
+
const [needFold, setNeedFold] = useState(false);
|
|
96
|
+
const codeBlockRef = useRef<HTMLDivElement>(null);
|
|
97
|
+
const contentRef = useRef<HTMLDivElement>(null);
|
|
98
|
+
|
|
99
|
+
useEffect(() => {
|
|
100
|
+
if (!fold || !contentRef.current) {
|
|
101
|
+
setNeedFold(false);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
const realHeight = contentRef.current.scrollHeight;
|
|
105
|
+
setNeedFold(realHeight > height);
|
|
106
|
+
}, [fold, height]);
|
|
107
|
+
|
|
108
|
+
const handleFoldToggle = useCallback(() => {
|
|
109
|
+
if (expanded) {
|
|
110
|
+
setExpanded(false);
|
|
111
|
+
requestAnimationFrame(() => {
|
|
112
|
+
if (codeBlockRef.current) {
|
|
113
|
+
const rect = codeBlockRef.current.getBoundingClientRect();
|
|
114
|
+
if (rect.top < 0) {
|
|
115
|
+
window.scrollBy({
|
|
116
|
+
top: rect.top - 16,
|
|
117
|
+
behavior: 'smooth',
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
} else {
|
|
123
|
+
setExpanded(true);
|
|
124
|
+
}
|
|
125
|
+
}, [expanded]);
|
|
126
|
+
|
|
78
127
|
return (
|
|
79
128
|
<div
|
|
80
129
|
className={clsx(
|
|
@@ -82,14 +131,18 @@ export function CodeBlock({
|
|
|
82
131
|
`language-${lang}`,
|
|
83
132
|
containerElementClassName,
|
|
84
133
|
)}
|
|
134
|
+
ref={codeBlockRef}
|
|
85
135
|
>
|
|
86
136
|
{title && <div className="rp-codeblock__title">{title}</div>}
|
|
87
137
|
<div
|
|
88
138
|
className={clsx(
|
|
89
139
|
'rp-codeblock__content',
|
|
90
|
-
|
|
140
|
+
wrapCodeState && 'rp-codeblock__content--wrap-code',
|
|
91
141
|
lineNumbersProp && 'rp-codeblock__content--line-numbers',
|
|
142
|
+
needFold && !expanded && 'rp-codeblock__content--fold',
|
|
92
143
|
)}
|
|
144
|
+
style={needFold && !expanded ? { maxHeight: `${height}px` } : undefined}
|
|
145
|
+
ref={contentRef}
|
|
93
146
|
>
|
|
94
147
|
<div
|
|
95
148
|
className="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"
|
|
@@ -100,10 +153,27 @@ export function CodeBlock({
|
|
|
100
153
|
<CodeButtonGroup
|
|
101
154
|
{...codeButtonGroupProps}
|
|
102
155
|
copyElementRef={copyElementRef}
|
|
103
|
-
|
|
104
|
-
|
|
156
|
+
wrapCode={wrapCodeState}
|
|
157
|
+
toggleWrapCode={toggleWrapCode}
|
|
105
158
|
/>
|
|
106
159
|
</div>
|
|
160
|
+
{needFold && (
|
|
161
|
+
<button
|
|
162
|
+
type="button"
|
|
163
|
+
className={clsx(
|
|
164
|
+
'rp-codeblock__fold-btn',
|
|
165
|
+
expanded && 'rp-codeblock__fold-btn--expanded',
|
|
166
|
+
)}
|
|
167
|
+
onClick={handleFoldToggle}
|
|
168
|
+
aria-label={expanded ? 'Collapse code' : 'Expand code'}
|
|
169
|
+
aria-expanded={expanded}
|
|
170
|
+
>
|
|
171
|
+
<SvgWrapper
|
|
172
|
+
icon={IconArrowDown}
|
|
173
|
+
className="rp-codeblock__fold-btn__icon"
|
|
174
|
+
/>
|
|
175
|
+
</button>
|
|
176
|
+
)}
|
|
107
177
|
</div>
|
|
108
178
|
);
|
|
109
179
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CodeBlockProps } from '@theme';
|
|
2
|
-
import { getCustomMDXComponent } from '@theme';
|
|
1
|
+
import type { CodeBlockProps } from '@rspress/core/theme';
|
|
2
|
+
import { getCustomMDXComponent } from '@rspress/core/theme';
|
|
3
3
|
import { toJsxRuntime } from 'hast-util-to-jsx-runtime';
|
|
4
4
|
import {
|
|
5
5
|
Fragment,
|
|
@@ -56,6 +56,8 @@ export function CodeBlockRuntime({
|
|
|
56
56
|
onRendered,
|
|
57
57
|
wrapCode,
|
|
58
58
|
lineNumbers,
|
|
59
|
+
fold,
|
|
60
|
+
height,
|
|
59
61
|
}: CodeBlockRuntimeProps) {
|
|
60
62
|
// getCustomMDXComponent is stable for theme rendering
|
|
61
63
|
const mdxComponents = useMemo(() => getCustomMDXComponent(), []);
|
|
@@ -67,6 +69,8 @@ export function CodeBlockRuntime({
|
|
|
67
69
|
lang={lang}
|
|
68
70
|
wrapCode={wrapCode}
|
|
69
71
|
lineNumbers={lineNumbers}
|
|
72
|
+
fold={fold}
|
|
73
|
+
height={height}
|
|
70
74
|
containerElementClassName={containerElementClassName}
|
|
71
75
|
codeButtonGroupProps={codeButtonGroupProps}
|
|
72
76
|
className="shiki css-variables"
|
|
@@ -79,6 +83,8 @@ export function CodeBlockRuntime({
|
|
|
79
83
|
lang,
|
|
80
84
|
wrapCode,
|
|
81
85
|
lineNumbers,
|
|
86
|
+
fold,
|
|
87
|
+
height,
|
|
82
88
|
containerElementClassName,
|
|
83
89
|
codeButtonGroupProps,
|
|
84
90
|
code,
|
|
@@ -115,6 +121,8 @@ export function CodeBlockRuntime({
|
|
|
115
121
|
codeButtonGroupProps={codeButtonGroupProps}
|
|
116
122
|
wrapCode={wrapCode}
|
|
117
123
|
lineNumbers={lineNumbers}
|
|
124
|
+
fold={fold}
|
|
125
|
+
height={height}
|
|
118
126
|
{...props}
|
|
119
127
|
/>
|
|
120
128
|
),
|
|
@@ -132,6 +140,8 @@ export function CodeBlockRuntime({
|
|
|
132
140
|
containerElementClassName,
|
|
133
141
|
lang,
|
|
134
142
|
lineNumbers,
|
|
143
|
+
fold,
|
|
144
|
+
height,
|
|
135
145
|
shikiOptions,
|
|
136
146
|
title,
|
|
137
147
|
wrapCode,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useSite } from '@rspress/core/runtime';
|
|
2
|
-
import { IconWrap, IconWrapped, SvgWrapper } from '@theme';
|
|
2
|
+
import { IconWrap, IconWrapped, SvgWrapper } from '@rspress/core/theme';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { useRef, useState } from 'react';
|
|
5
5
|
import './index.scss';
|
|
@@ -7,12 +7,12 @@ import { CopyCodeButton } from './CopyCodeButton';
|
|
|
7
7
|
|
|
8
8
|
export interface CodeButtonGroupProps {
|
|
9
9
|
copyElementRef: React.RefObject<HTMLDivElement | null>;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
wrapCode: boolean;
|
|
11
|
+
toggleWrapCode: () => void;
|
|
12
12
|
/**
|
|
13
13
|
* @default true
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
showWrapCodeButton?: boolean;
|
|
16
16
|
/**
|
|
17
17
|
* @default true
|
|
18
18
|
*/
|
|
@@ -22,38 +22,38 @@ export interface CodeButtonGroupProps {
|
|
|
22
22
|
export const useCodeButtonGroup = (initialWrapCode?: boolean) => {
|
|
23
23
|
const { site } = useSite();
|
|
24
24
|
const { defaultWrapCode } = site.markdown;
|
|
25
|
-
const [
|
|
25
|
+
const [wrapCode, setWrapCode] = useState(initialWrapCode ?? defaultWrapCode);
|
|
26
26
|
const copyElementRef = useRef<HTMLDivElement>(null);
|
|
27
27
|
|
|
28
|
-
const
|
|
29
|
-
|
|
28
|
+
const toggleWrapCode = () => {
|
|
29
|
+
setWrapCode(!wrapCode);
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
return {
|
|
33
33
|
copyElementRef,
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
wrapCode,
|
|
35
|
+
toggleWrapCode,
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
export function CodeButtonGroup({
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
wrapCode,
|
|
41
|
+
toggleWrapCode,
|
|
42
42
|
copyElementRef,
|
|
43
|
-
|
|
43
|
+
showWrapCodeButton = true,
|
|
44
44
|
showCopyButton = true,
|
|
45
45
|
}: CodeButtonGroupProps) {
|
|
46
46
|
return (
|
|
47
47
|
<>
|
|
48
48
|
<div className="rp-code-button-group">
|
|
49
|
-
{
|
|
49
|
+
{showWrapCodeButton && (
|
|
50
50
|
<button
|
|
51
51
|
className={clsx(
|
|
52
52
|
'rp-code-button-group__button',
|
|
53
53
|
'rp-code-wrap-button',
|
|
54
|
-
|
|
54
|
+
wrapCode && 'rp-code-wrap-button--wrapped',
|
|
55
55
|
)}
|
|
56
|
-
onClick={() =>
|
|
56
|
+
onClick={() => toggleWrapCode()}
|
|
57
57
|
title="Toggle code wrap"
|
|
58
58
|
>
|
|
59
59
|
<SvgWrapper
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CodeBlock, type CodeBlockProps } from '@theme';
|
|
1
|
+
import { CodeBlock, type CodeBlockProps } from '@rspress/core/theme';
|
|
2
2
|
|
|
3
3
|
export type ShikiPreProps = CodeBlockProps &
|
|
4
4
|
React.HTMLAttributes<HTMLPreElement>;
|
|
@@ -8,6 +8,8 @@ export function ShikiPre({
|
|
|
8
8
|
lang,
|
|
9
9
|
wrapCode,
|
|
10
10
|
lineNumbers,
|
|
11
|
+
fold,
|
|
12
|
+
height,
|
|
11
13
|
containerElementClassName,
|
|
12
14
|
codeButtonGroupProps,
|
|
13
15
|
...otherProps
|
|
@@ -18,6 +20,8 @@ export function ShikiPre({
|
|
|
18
20
|
lang={lang}
|
|
19
21
|
wrapCode={wrapCode}
|
|
20
22
|
lineNumbers={lineNumbers}
|
|
23
|
+
fold={fold}
|
|
24
|
+
height={height}
|
|
21
25
|
containerElementClassName={containerElementClassName}
|
|
22
26
|
codeButtonGroupProps={codeButtonGroupProps}
|
|
23
27
|
>
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { useFrontmatter, useSite } from '@rspress/core/runtime';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
LlmsContainer,
|
|
4
|
+
LlmsCopyButton,
|
|
5
|
+
LlmsViewOptions,
|
|
6
|
+
Tag,
|
|
7
|
+
} from '@rspress/core/theme';
|
|
3
8
|
import clsx from 'clsx';
|
|
4
9
|
import type React from 'react';
|
|
5
10
|
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { Feature } from '@rspress/core';
|
|
2
2
|
import { useFrontmatter } from '@rspress/core/runtime';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
renderHtmlOrText,
|
|
5
|
+
SvgWrapper,
|
|
6
|
+
useLinkNavigate,
|
|
7
|
+
} from '@rspress/core/theme';
|
|
4
8
|
import type { JSX } from 'react';
|
|
5
9
|
import './index.scss';
|
|
6
10
|
import { useCardAnimation } from './useCardAnimation';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FrontMatterMeta } from '@rspress/core';
|
|
2
2
|
import { normalizeImagePath, useFrontmatter } from '@rspress/core/runtime';
|
|
3
|
-
import { Button, Link, renderHtmlOrText } from '@theme';
|
|
3
|
+
import { Button, Link, renderHtmlOrText } from '@rspress/core/theme';
|
|
4
4
|
|
|
5
5
|
import './index.scss';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -130,5 +130,5 @@ function normalizeSrcsetAndSizes(
|
|
|
130
130
|
return r || undefined;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
export { HomeHero };
|
|
134
133
|
export type { HomeHeroProps };
|
|
134
|
+
export { HomeHero };
|