@rspress/core 2.0.4 → 2.0.6

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 (144) hide show
  1. package/dist/0~1402.js +1 -0
  2. package/dist/{0~7675.423f6a06.js → 0~execa.js} +6 -5
  3. package/dist/1361.js +5 -0
  4. package/dist/1965.js +7 -0
  5. package/dist/4454.js +8 -0
  6. package/dist/{7744.421b464f.js → 675.js} +20 -5
  7. package/dist/7397.js +18 -0
  8. package/dist/{5485.7e481fde.js → 8311.js} +5 -2
  9. package/dist/8474.js +4 -0
  10. package/dist/8885.js +4 -0
  11. package/dist/cli/index.js +2 -3
  12. package/dist/config/loadConfigFile.js +1 -2
  13. package/dist/eject-theme/components/HomeHero/index.tsx +1 -1
  14. package/dist/eject-theme/components/HoverGroup/index.tsx +1 -1
  15. package/dist/eject-theme/components/Llms/LlmsCopyButton.tsx +2 -1
  16. package/dist/eject-theme/components/Llms/LlmsCopyRow.tsx +2 -1
  17. package/dist/eject-theme/components/Llms/LlmsViewOptions.tsx +2 -1
  18. package/dist/eject-theme/components/Llms/copy.ts +12 -0
  19. package/dist/eject-theme/components/Search/SearchPanel.tsx +2 -0
  20. package/dist/eject-theme/components/Sidebar/SidebarItem.scss +0 -4
  21. package/dist/eject-theme/components/Tabs/index.scss +13 -15
  22. package/dist/index.js +1 -3
  23. package/dist/node/PluginDriver.js +3 -8
  24. package/dist/node/auto-nav-sidebar/index.js +1 -2
  25. package/dist/node/auto-nav-sidebar/locales.js +1 -1
  26. package/dist/node/auto-nav-sidebar/normalize.js +3 -2
  27. package/dist/node/auto-nav-sidebar/utils.js +1 -2
  28. package/dist/node/auto-nav-sidebar/walk.js +1 -2
  29. package/dist/node/constants.js +1 -2
  30. package/dist/node/eject.js +1 -1
  31. package/dist/node/initRsbuild.js +2 -4
  32. package/dist/node/last-updated/index.js +1 -1
  33. package/dist/node/logger/hint.js +4 -1
  34. package/dist/node/mdx/options.js +4 -4
  35. package/dist/node/mdx/processor.js +1 -2
  36. package/dist/node/mdx/rehypePlugins/codeMeta.js +1 -1
  37. package/dist/node/mdx/rehypePlugins/headerAnchor.js +1 -2
  38. package/dist/node/mdx/rehypePlugins/shiki.d.ts +1 -1
  39. package/dist/node/mdx/rehypePlugins/shiki.js +1 -1
  40. package/dist/node/mdx/rehypePlugins/transformers/meta-highlight.js +1 -1
  41. package/dist/node/mdx/remarkPlugins/builtin.js +1 -1
  42. package/dist/node/mdx/remarkPlugins/fileCodeBlock.js +1 -2
  43. package/dist/node/mdx/remarkPlugins/image.js +1 -1
  44. package/dist/node/mdx/remarkPlugins/link.js +1 -2
  45. package/dist/node/mdx/remarkPlugins/toc.js +1 -1
  46. package/dist/node/medium-zoom/index.js +1 -1
  47. package/dist/node/route/RoutePage.js +2 -2
  48. package/dist/node/route/RouteService.js +1 -3
  49. package/dist/node/route/extractPageData.js +1 -3
  50. package/dist/node/route/normalizeRoutePath.js +1 -2
  51. package/dist/node/runtimeModule/i18n.js +1 -2
  52. package/dist/node/runtimeModule/pageData/createPageData.js +1 -2
  53. package/dist/node/runtimeModule/pageData/rsbuildPlugin.js +1 -2
  54. package/dist/node/runtimeModule/searchHooks.js +1 -1
  55. package/dist/node/runtimeModule/siteData/createSiteData.js +1 -1
  56. package/dist/node/runtimeModule/siteData/normalizeThemeConfig.js +1 -1
  57. package/dist/node/runtimeModule/siteData/rsbuildPlugin.js +1 -1
  58. package/dist/node/serve.js +1 -1
  59. package/dist/node/ssg/renderPage.js +1 -2
  60. package/dist/node/ssg/renderPageWorker.js +2 -2
  61. package/dist/node/ssg/renderPages.js +3 -4
  62. package/dist/node/ssg/rsbuildPluginSSG.js +1 -2
  63. package/dist/node/ssg/ssgEnv.d.ts +1 -1
  64. package/dist/node/ssg/ssgEnv.js +2 -2
  65. package/dist/node/ssg-md/llms/emitLlmsTxt.js +5 -7
  66. package/dist/node/ssg-md/llms/llmsTxt.js +5 -3
  67. package/dist/node/ssg-md/remarkSplitMdx.js +1 -2
  68. package/dist/node/ssg-md/renderPage.js +1 -2
  69. package/dist/node/ssg-md/renderPages.js +2 -2
  70. package/dist/node/ssg-md/rsbuildPluginSSGMD.js +1 -2
  71. package/dist/node/utils/checkLanguageParity.js +1 -1
  72. package/dist/node/utils/createHash.js +1 -1
  73. package/dist/node/utils/error.js +1 -1
  74. package/dist/node/utils/flattenMdxContent.js +1 -3
  75. package/dist/node/utils/fs.js +1 -1
  76. package/dist/node/utils/getPageKey.js +1 -1
  77. package/dist/node/utils/normalizePath.js +1 -2
  78. package/dist/node/utils/reactAlias.js +15 -10
  79. package/dist/runtime/index.js +20 -21
  80. package/dist/runtime/ssrMdServerEntry.js +2 -2
  81. package/dist/runtime/ssrServerEntry.js +2 -2
  82. package/dist/runtime/utils.d.ts +1 -1
  83. package/dist/runtime/utils.js +1 -1
  84. package/dist/theme/assets/arrow-down.js +1 -1
  85. package/dist/theme/assets/arrow-right.js +1 -1
  86. package/dist/theme/assets/close.js +1 -1
  87. package/dist/theme/assets/copy.js +1 -1
  88. package/dist/theme/assets/deprecated.js +1 -1
  89. package/dist/theme/assets/down.js +1 -1
  90. package/dist/theme/assets/edit.js +1 -1
  91. package/dist/theme/assets/empty.js +1 -1
  92. package/dist/theme/assets/experimental.js +1 -1
  93. package/dist/theme/assets/external-link.js +1 -1
  94. package/dist/theme/assets/file.js +1 -1
  95. package/dist/theme/assets/github.js +1 -1
  96. package/dist/theme/assets/gitlab.js +1 -1
  97. package/dist/theme/assets/header.js +1 -1
  98. package/dist/theme/assets/jump.js +1 -1
  99. package/dist/theme/assets/link.js +1 -1
  100. package/dist/theme/assets/loading.js +1 -1
  101. package/dist/theme/assets/menu.js +1 -1
  102. package/dist/theme/assets/moon.js +1 -1
  103. package/dist/theme/assets/scroll-to-top.js +1 -1
  104. package/dist/theme/assets/search.js +1 -1
  105. package/dist/theme/assets/small-menu.js +1 -1
  106. package/dist/theme/assets/success.js +1 -1
  107. package/dist/theme/assets/sun.js +1 -1
  108. package/dist/theme/assets/title.js +1 -1
  109. package/dist/theme/assets/wrap.js +1 -1
  110. package/dist/theme/assets/wrapped.js +1 -1
  111. package/dist/theme/components/Callout/index.js +2 -1
  112. package/dist/theme/components/HomeBackground/index.css +1 -0
  113. package/dist/theme/components/HomeFeature/index.css +3 -3
  114. package/dist/theme/components/HomeHero/index.d.ts +1 -1
  115. package/dist/theme/components/HoverGroup/index.d.ts +1 -1
  116. package/dist/theme/components/Llms/LlmsCopyButton.js +3 -2
  117. package/dist/theme/components/Llms/LlmsCopyRow.js +2 -1
  118. package/dist/theme/components/Llms/LlmsViewOptions.js +3 -2
  119. package/dist/theme/components/Llms/copy.d.ts +1 -0
  120. package/dist/theme/components/Llms/copy.js +9 -0
  121. package/dist/theme/components/Llms/index.css +1 -0
  122. package/dist/theme/components/Llms/index.js +4 -5
  123. package/dist/theme/components/Nav/index.css +1 -1
  124. package/dist/theme/components/NavScreen/index.css +1 -1
  125. package/dist/theme/components/OverviewGroup/icons/plugin.js +1 -1
  126. package/dist/theme/components/OverviewGroup/index.css +1 -0
  127. package/dist/theme/components/Search/SearchPanel.js +2 -1
  128. package/dist/theme/components/Search/logic/providers/LocalProvider.js +1 -1
  129. package/dist/theme/components/Sidebar/SidebarItem.css +0 -4
  130. package/dist/theme/components/Tabs/index.css +14 -8
  131. package/dist/theme/components/Toc/TocItem.css +1 -1
  132. package/dist/theme/index.js +66 -67
  133. package/dist/theme/layout/DocLayout/index.css +11 -11
  134. package/dist/theme/layout/Layout/index.js +14 -4
  135. package/dist/theme/styles/base.css +6 -3
  136. package/dist/theme/styles/preflight.css +2 -0
  137. package/dist/theme/styles/vars/home-vars.css +28 -4
  138. package/package.json +9 -7
  139. package/dist/6289.29817fb4.js +0 -4
  140. package/dist/9348.1beb3e25.js +0 -11
  141. package/dist/cli/index.44f3184c.js +0 -2
  142. package/dist/node/mdx/loader.15e0b2d2.js +0 -7
  143. /package/dist/{node/ssg/renderPageWorker.165b5d46.js → 9224.js} +0 -0
  144. /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.99091bf6.js";
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.7e481fde.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 "./6289.29817fb4.js";
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 { matchPath } from "react-router-dom";
47
- export { DEFAULT_CONFIG_EXTENSIONS, DEFAULT_CONFIG_NAME, DEFAULT_PAGE_EXTENSIONS } from "@rspress/shared/constants";
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 { createReadStream, createWriteStream, default as node_fs, readFileSync } from "node:fs";
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 { pluginVirtualModule };
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 { 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.4"
2
+ rE: "2.0.6"
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 node_url, fileURLToPath, pathToFileURL } from "node:url";
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
@@ -0,0 +1,4 @@
1
+ export { default as promises, readFile } from "node:fs/promises";
2
+ export { join, relative } from "node:path";
3
+ export { logger } from "@rspress/shared/logger";
4
+ export { default as picocolors } from "picocolors";
package/dist/cli/index.js CHANGED
@@ -1,6 +1,5 @@
1
- import { node_path, logger, join, picocolors } from "../6289.29817fb4.js";
2
- import { chokidar, cac } from "./index.44f3184c.js";
3
- import { package_namespaceObject } from "../5485.7e481fde.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, DEFAULT_CONFIG_EXTENSIONS, DEFAULT_CONFIG_NAME } from "../7744.421b464f.js";
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();
@@ -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 };
@@ -147,5 +147,5 @@ function HoverGroup({
147
147
  );
148
148
  }
149
149
 
150
- export { HoverGroup };
151
150
  export type { HoverGroupProps, Items };
151
+ export { HoverGroup };
@@ -9,6 +9,7 @@ import { useCallback, useRef, useState } from 'react';
9
9
  import { SvgWrapper } from '../SvgWrapper';
10
10
  import './index.scss';
11
11
  import './LlmsCopyButton.scss';
12
+ import { copyToClipboard } from './copy';
12
13
  import { useMdUrl } from './useMdUrl';
13
14
 
14
15
  export interface LlmsCopyButtonProps
@@ -51,7 +52,7 @@ export function LlmsCopyButton(props: LlmsCopyButtonProps) {
51
52
  cache.get(url) ?? (await fetch(url).then(res => res.text()));
52
53
 
53
54
  cache.set(url, content);
54
- await navigator.clipboard.writeText(content);
55
+ await copyToClipboard(content);
55
56
  } finally {
56
57
  setLoading(false);
57
58
  setFinished(true);
@@ -1,6 +1,7 @@
1
1
  import { useI18n } from '@rspress/core/runtime';
2
2
  import { IconCopy, IconSuccess, SvgWrapper } from '@theme';
3
3
  import { useCallback, useRef, useState } from 'react';
4
+ import { copyToClipboard } from './copy';
4
5
  import { useMdUrl } from './useMdUrl';
5
6
 
6
7
  const cache = new Map<string, string>();
@@ -19,7 +20,7 @@ export function LlmsCopyRow() {
19
20
  const content: string =
20
21
  cache.get(pathname) ?? (await fetch(pathname).then(res => res.text()));
21
22
  cache.set(pathname, content);
22
- await navigator.clipboard.writeText(content);
23
+ await copyToClipboard(content);
23
24
  } finally {
24
25
  setLoading(false);
25
26
  setFinished(true);
@@ -10,6 +10,7 @@ import { useEffect, useMemo, useRef, useState } from 'react';
10
10
  import { SvgWrapper } from '../SvgWrapper';
11
11
  import './index.scss';
12
12
  import './LlmsViewOptions.scss';
13
+ import { copyToClipboard } from './copy';
13
14
  import { useMdUrl } from './useMdUrl';
14
15
 
15
16
  type Option =
@@ -98,7 +99,7 @@ export function LlmsViewOptions({
98
99
  title: t('copyMarkdownLinkText'),
99
100
  icon: <SvgWrapper icon={IconLink} />,
100
101
  onClick: () => {
101
- navigator.clipboard.writeText(fullMarkdownUrl);
102
+ void copyToClipboard(fullMarkdownUrl);
102
103
  },
103
104
  },
104
105
  chatgpt: {
@@ -0,0 +1,12 @@
1
+ import copy from 'copy-to-clipboard';
2
+
3
+ export async function copyToClipboard(text: string) {
4
+ if (navigator.clipboard?.writeText) {
5
+ try {
6
+ await navigator.clipboard.writeText(text);
7
+ return;
8
+ } catch {}
9
+ }
10
+
11
+ copy(text);
12
+ }
@@ -348,6 +348,8 @@ export function SearchPanel({ focused, setFocused }: SearchPanelProps) {
348
348
  // only setSearchResult when query is current query value
349
349
  const currQuery = searchInputRef.current?.value;
350
350
  if (currQuery === newQuery) {
351
+ // Reset current suggestion index to 0 when search query changes
352
+ setCurrentSuggestionIndex(0);
351
353
  setSearchResult(searchResult || DEFAULT_RESULT);
352
354
  setIsSearching(false);
353
355
  }
@@ -15,10 +15,6 @@
15
15
  color 0.15s,
16
16
  background-color 0.15s;
17
17
 
18
- &:first-child {
19
- margin-top: 0;
20
- }
21
-
22
18
  &:hover,
23
19
  &--pending {
24
20
  color: var(--rp-c-text-1);
@@ -5,21 +5,8 @@
5
5
  border: var(--rp-code-block-border);
6
6
  box-shadow: var(--rp-code-block-shadow);
7
7
 
8
- // nested
9
- & & {
10
- border-radius: 0;
11
- margin: 0;
12
- border: none;
13
- }
14
-
15
- .rp-codeblock {
16
- margin: 0;
17
- border-radius: 0;
18
- border: none;
19
-
20
- .rp-codeblock__title {
21
- padding: 8px 12px;
22
- }
8
+ .rp-codeblock__title {
9
+ padding: 8px 12px;
23
10
  }
24
11
 
25
12
  &__label {
@@ -76,6 +63,17 @@
76
63
 
77
64
  &__content {
78
65
  &__item {
66
+ padding: 0 1rem;
67
+
68
+ // nested rp-tabs and codeblock
69
+ & > .rp-codeblock:only-child,
70
+ & > .rp-tabs:only-child {
71
+ margin: 0 -1rem;
72
+ border-radius: 0;
73
+ border: none;
74
+ box-shadow: none;
75
+ }
76
+
79
77
  &--active {
80
78
  display: block;
81
79
  }
package/dist/index.js CHANGED
@@ -1,11 +1,9 @@
1
1
  export { PluginDriver } from "./node/PluginDriver.js";
2
- export { RSPRESS_TEMP_DIR, getIconUrlPath, getNodeAttribute, getSidebarDataGroup, mergeDocConfig, normalizeHref, normalizePosixPath, removeTrailingSlash, withBase } from "./9348.1beb3e25.js";
2
+ export { RSPRESS_TEMP_DIR, getIconUrlPath, getNodeAttribute, getSidebarDataGroup, logger, matchPath, mergeDocConfig, normalizeHref, normalizePosixPath, removeTrailingSlash, withBase } from "./8474.js";
3
3
  export { RouteService } from "./node/route/RouteService.js";
4
4
  export { build } from "./node/build.js";
5
5
  export { defineConfig } from "./config/defineConfig.js";
6
6
  export { dev } from "./node/dev.js";
7
- export { logger } from "./6289.29817fb4.js";
8
- export { matchPath } from "./7744.421b464f.js";
9
7
  export { remarkFileCodeBlock } from "./node/mdx/remarkPlugins/fileCodeBlock.js";
10
8
  export { remarkLink } from "./node/mdx/remarkPlugins/link.js";
11
9
  export { serve } from "./node/serve.js";
@@ -1,5 +1,4 @@
1
- import { node_path } from "../6289.29817fb4.js";
2
- import { addTrailingSlash, addLeadingSlash } from "../9348.1beb3e25.js";
1
+ import { addTrailingSlash, node_path, addLeadingSlash } from "../675.js";
3
2
  import { createError } from "./utils/error.js";
4
3
  import { auto_nav_sidebar_haveNavSidebarConfig } from "./auto-nav-sidebar/index.js";
5
4
  class PluginDriver {
@@ -29,15 +28,11 @@ class PluginDriver {
29
28
  const enableLastUpdated = themeConfig?.lastUpdated;
30
29
  const mediumZoomConfig = config?.mediumZoom ?? true;
31
30
  if (enableLastUpdated) {
32
- const { pluginLastUpdated } = await import("./last-updated/index.js").then((mod)=>({
33
- pluginLastUpdated: mod.pluginLastUpdated
34
- }));
31
+ const { pluginLastUpdated } = await import("./last-updated/index.js");
35
32
  this.addPlugin(pluginLastUpdated());
36
33
  }
37
34
  if (mediumZoomConfig) {
38
- const { pluginMediumZoom } = await import("./medium-zoom/index.js").then((mod)=>({
39
- pluginMediumZoom: mod.pluginMediumZoom
40
- }));
35
+ const { pluginMediumZoom } = await import("./medium-zoom/index.js");
41
36
  this.addPlugin(pluginMediumZoom('object' == typeof mediumZoomConfig ? mediumZoomConfig : void 0));
42
37
  }
43
38
  (config.plugins || []).forEach((plugin)=>{
@@ -1,5 +1,4 @@
1
- import { node_path } from "../../6289.29817fb4.js";
2
- import { DEFAULT_PAGE_EXTENSIONS } from "../../7744.421b464f.js";
1
+ import { DEFAULT_PAGE_EXTENSIONS, node_path } from "../../675.js";
3
2
  import { processLocales, combineWalkResult } from "./locales.js";
4
3
  import { walk } from "./walk.js";
5
4
  async function runAutoNavSide(config, metaFileSet, mdFileSet) {
@@ -1,4 +1,4 @@
1
- import { node_path } from "../../6289.29817fb4.js";
1
+ import { node_path } from "../../675.js";
2
2
  import { walk } from "./walk.js";
3
3
  function combineWalkResult(walks, versions) {
4
4
  return walks.reduce((acc, cur, curIndex)=>({
@@ -1,5 +1,4 @@
1
- import { readdir, extname, stat as promises_stat, relative, logger, join, picocolors } from "../../6289.29817fb4.js";
2
- import { isExternalUrl, slash } from "../../9348.1beb3e25.js";
1
+ import { extname, stat as promises_stat, logger, picocolors, readdir, isExternalUrl, relative, slash, join } from "../../675.js";
3
2
  import { createError } from "../utils/error.js";
4
3
  import { PUBLIC_DIR } from "../constants.js";
5
4
  import { pathExists, extractInfoFromFrontmatterWithAbsolutePath, readJson } from "./utils.js";
@@ -152,6 +151,7 @@ async function metaDirItemToSidebarItem(metaItem, workDir, docsDir, extensions,
152
151
  collapsible,
153
152
  collapsed,
154
153
  items: await getItems(),
154
+ tag: metaJsonTag,
155
155
  overviewHeaders: metaJsonOverviewHeaders,
156
156
  context: metaJsonContext,
157
157
  _fileKey: getFileKey(dirAbsolutePath, docsDir)
@@ -163,6 +163,7 @@ async function metaDirItemToSidebarItem(metaItem, workDir, docsDir, extensions,
163
163
  collapsible,
164
164
  collapsed,
165
165
  items: await getItems(),
166
+ tag: metaJsonTag,
166
167
  overviewHeaders: metaJsonOverviewHeaders,
167
168
  context: metaJsonContext,
168
169
  _fileKey: getFileKey(dirAbsolutePath, docsDir)
@@ -1,5 +1,4 @@
1
- import { node_path, promises } from "../../6289.29817fb4.js";
2
- import { loadFrontMatter, extractTextAndId } from "../../9348.1beb3e25.js";
1
+ import { node_path, extractTextAndId, promises, loadFrontMatter } from "../../675.js";
3
2
  async function pathExists(path) {
4
3
  try {
5
4
  await promises.access(path);
@@ -1,5 +1,4 @@
1
- import { node_path, promises } from "../../6289.29817fb4.js";
2
- import { isExternalUrl } from "../../9348.1beb3e25.js";
1
+ import { isExternalUrl, node_path, promises } from "../../675.js";
3
2
  import { pathExists } from "../utils/fs.js";
4
3
  import { readJson } from "./utils.js";
5
4
  import { createError } from "../utils/error.js";
@@ -1,5 +1,4 @@
1
- import { createRequire, package_namespaceObject } from "../5485.7e481fde.js";
2
- import { node_path } from "../6289.29817fb4.js";
1
+ import { createRequire, node_path, package_namespaceObject } from "../8311.js";
3
2
  const constants_require = createRequire(import.meta.url);
4
3
  const RSPRESS_VERSION = package_namespaceObject.rE;
5
4
  const APPEARANCE_KEY = 'rspress-theme-appearance';
@@ -1,4 +1,4 @@
1
- import { node_path, logger, promises, picocolors } from "../6289.29817fb4.js";
1
+ import { node_path, logger, promises, picocolors } from "../4454.js";
2
2
  import { EJECTED_THEME } from "./constants.js";
3
3
  let _themeComponentsPathOverride;
4
4
  function getThemeComponentsPath() {
@@ -1,7 +1,4 @@
1
- import { createRequire, fileURLToPath, package_namespaceObject } from "../5485.7e481fde.js";
2
- import { node_path } from "../6289.29817fb4.js";
3
- import { addTrailingSlash, removeTrailingSlash, cwd, MDX_OR_MD_REGEXP } from "../9348.1beb3e25.js";
4
- import { PLUGIN_REACT_NAME, pluginReact, pluginVirtualModule } from "../7744.421b464f.js";
1
+ import { addTrailingSlash, node_path, fileURLToPath, cwd, PLUGIN_REACT_NAME, removeTrailingSlash, pluginVirtualModule, pluginReact, createRequire, MDX_OR_MD_REGEXP } from "../675.js";
5
2
  import { createError } from "./utils/error.js";
6
3
  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
4
  import { hintBuilderPluginsBreakingChange, hintThemeBreakingChange } from "./logger/hint.js";
@@ -17,6 +14,7 @@ import { siteDataVMPlugin } from "./runtimeModule/siteData/rsbuildPlugin.js";
17
14
  import { rsbuildPluginSSG } from "./ssg/rsbuildPluginSSG.js";
18
15
  import { rsbuildPluginCSR } from "./ssg/rsbuildPluginCSR.js";
19
16
  import { rsbuildPluginSSGMD } from "./ssg-md/rsbuildPluginSSGMD.js";
17
+ import { package_namespaceObject } from "../8311.js";
20
18
  function isPluginIncluded(config, pluginName) {
21
19
  return Boolean(config.builderConfig?.plugins?.some((plugin)=>plugin && plugin.name === pluginName));
22
20
  }
@@ -1,4 +1,4 @@
1
- import { execa } from "../../0~7675.423f6a06.js";
1
+ import { execa } from "../../0~execa.js";
2
2
  function transform(timestamp, lang) {
3
3
  return new Date(timestamp).toLocaleString(lang || 'zh');
4
4
  }
@@ -1,4 +1,4 @@
1
- import { picocolors, relative, logger, join, readFile } from "../../6289.29817fb4.js";
1
+ import { picocolors, relative, logger, join, readFile } from "../../8885.js";
2
2
  import { pathExists } from "../utils/fs.js";
3
3
  const THEME_DEFAULT_EXPORT_PATTERN = /export\s+default\s+\{/;
4
4
  const THEME_OLD_IMPORT_0 = /from\s+['"]rspress\/theme['"]/;
@@ -65,7 +65,10 @@ function hintSSGFailed() {
65
65
  function hintSSGFalse() {
66
66
  logger.info('`ssg: false` detected, SSG will be disabled.');
67
67
  }
68
+ let reactVersionLogged = false;
68
69
  function hintReactVersion() {
70
+ if (reactVersionLogged) return;
71
+ reactVersionLogged = true;
69
72
  logger.info('[Rspress v2] Rspress support React 18 and 19, please confirm that both react and react-dom are installed in package.json with the same version. ');
70
73
  }
71
74
  function hintNavJsonChangeThenPanic(metaJson, metaJsonDir, docsDir) {
@@ -1,6 +1,4 @@
1
- import { node_path } from "../../6289.29817fb4.js";
2
- import { remark_gfm, nodeTypes } from "../../9348.1beb3e25.js";
3
- import { rehype, rehype_external_links, rehype_raw } from "./loader.15e0b2d2.js";
1
+ import { node_path, rehype_external_links, rehype_raw, remark_cjk_friendly, nodeTypes, remark_gfm, rehype, remark_cjk_friendly_gfm_strikethrough } from "../../7397.js";
4
2
  import { remarkToc } from "./remarkPlugins/toc.js";
5
3
  import { remarkContainerSyntax } from "./remarkPlugins/containerSyntax.js";
6
4
  import { remarkFileCodeBlock } from "./remarkPlugins/fileCodeBlock.js";
@@ -15,7 +13,7 @@ async function createMDXOptions(options) {
15
13
  const { docDirectory, config, routeService, filepath, pluginDriver, addDependency, isSsgMd = false } = options;
16
14
  const remarkLinkOptions = config?.markdown?.link;
17
15
  const format = node_path.extname(filepath).slice(1);
18
- const { remarkPlugins: remarkPluginsFromConfig = [], rehypePlugins: rehypePluginsFromConfig = [], globalComponents: globalComponentsFromConfig = [], showLineNumbers = false, defaultWrapCode = false, shiki } = config?.markdown || {};
16
+ const { remarkPlugins: remarkPluginsFromConfig = [], rehypePlugins: rehypePluginsFromConfig = [], globalComponents: globalComponentsFromConfig = [], showLineNumbers = false, defaultWrapCode = false, shiki, cjkFriendlyEmphasis = true } = config?.markdown || {};
19
17
  const rspressPlugins = pluginDriver?.getPlugins() ?? [];
20
18
  const remarkPluginsFromPlugins = rspressPlugins.flatMap((plugin)=>plugin.markdown?.remarkPlugins || []);
21
19
  const rehypePluginsFromPlugins = rspressPlugins.flatMap((plugin)=>plugin.markdown?.rehypePlugins || []);
@@ -28,6 +26,8 @@ async function createMDXOptions(options) {
28
26
  format,
29
27
  remarkPlugins: [
30
28
  remark_gfm,
29
+ cjkFriendlyEmphasis && remark_cjk_friendly,
30
+ cjkFriendlyEmphasis && remark_cjk_friendly_gfm_strikethrough,
31
31
  remarkToc,
32
32
  !isSsgMd && remarkContainerSyntax,
33
33
  [
@@ -1,5 +1,4 @@
1
- import { node_path } from "../../6289.29817fb4.js";
2
- import { createProcessor, loadFrontMatter, extractTextAndId } from "../../9348.1beb3e25.js";
1
+ import { node_path, extractTextAndId, createProcessor, loadFrontMatter } from "../../7397.js";
3
2
  import { createMDXOptions } from "./options.js";
4
3
  import { applyReplaceRules } from "../utils/applyReplaceRules.js";
5
4
  import { escapeMarkdownHeadingIds } from "../utils/escapeHeadingIds.js";
@@ -1,4 +1,4 @@
1
- import { visit } from "../../../9348.1beb3e25.js";
1
+ import { visit } from "../../../7397.js";
2
2
  const rehypeCodeMeta = ()=>(tree)=>{
3
3
  visit(tree, 'element', (node)=>{
4
4
  if ('pre' === node.tagName && node.children[0]?.type === 'element' && 'code' === node.children[0].tagName) {
@@ -1,5 +1,4 @@
1
- import { visit, github_slugger, extractTextAndId } from "../../../9348.1beb3e25.js";
2
- import { headingRank } from "../loader.15e0b2d2.js";
1
+ import { visit, extractTextAndId, github_slugger, headingRank } from "../../../7397.js";
3
2
  const rehypeHeaderAnchor = ()=>{
4
3
  const slugger = new github_slugger();
5
4
  return (tree)=>{
@@ -1,4 +1,4 @@
1
1
  import type { RehypeShikiOptions } from '@shikijs/rehype';
2
2
  import rehypeShiki from '@shikijs/rehype';
3
3
  declare function createRehypeShikiOptions(showLineNumbers: boolean, defaultWrapCode: boolean, options?: Partial<RehypeShikiOptions>): RehypeShikiOptions;
4
- export { rehypeShiki, createRehypeShikiOptions };
4
+ export { createRehypeShikiOptions, rehypeShiki };
@@ -1,4 +1,4 @@
1
- import { transformerAddLang, transformerAddLineNumbers, transformerAddTitle, createCssVariablesTheme, transformerAddWrapCode } from "../loader.15e0b2d2.js";
1
+ import { transformerAddLang, transformerAddLineNumbers, transformerAddTitle, createCssVariablesTheme, transformerAddWrapCode } from "../../../7397.js";
2
2
  const cssVariablesTheme = createCssVariablesTheme({
3
3
  name: 'css-variables',
4
4
  variablePrefix: '--shiki-',
@@ -1,4 +1,4 @@
1
- /*! For license information please see meta-highlight.js.LICENSE.txt */
1
+ /*! LICENSE: meta-highlight.js.LICENSE.txt */
2
2
  /**
3
3
  * these codes are copied from @shiki/transformers, transformerMetaHighlight
4
4
  * @source https://github.com/shikijs/shiki/blob/f5cf06f55a0b4643d7b02f15ee2c5033be6f1245/packages/transformers/src/transformers/meta-highlight.ts#L56
@@ -1,4 +1,4 @@
1
- import { node_path } from "../../../6289.29817fb4.js";
1
+ import { node_path } from "../../../7397.js";
2
2
  import { getDefaultImportAstNode } from "../../utils/getImportAstNode.js";
3
3
  const remarkBuiltin = ({ globalComponents })=>(tree)=>{
4
4
  const demos = globalComponents.map((componentPath)=>{
@@ -1,5 +1,4 @@
1
- import { node_path, logger, picocolors, readFile } from "../../../6289.29817fb4.js";
2
- import { visit, cwd } from "../../../9348.1beb3e25.js";
1
+ import { visit, node_path, logger, cwd, picocolors, readFile } from "../../../1965.js";
3
2
  import { createError } from "../../utils/error.js";
4
3
  const ERROR_PREFIX = '[remarkFileCodeBlock]';
5
4
  function parseFileFromMeta(meta) {
@@ -1,4 +1,4 @@
1
- import { isExternalUrl, getNodeAttribute, visit } from "../../../9348.1beb3e25.js";
1
+ import { isExternalUrl, getNodeAttribute, visit } from "../../../7397.js";
2
2
  import { getDefaultImportAstNode } from "../../utils/getImportAstNode.js";
3
3
  const normalizeImageUrl = (imageUrl)=>{
4
4
  if (isExternalUrl(imageUrl) || imageUrl.startsWith('/')) return '';
@@ -1,5 +1,4 @@
1
- import { node_path, logger, picocolors } from "../../../6289.29817fb4.js";
2
- import { isExternalUrl, isProduction, addLeadingSlash, parseUrl, normalizeHref, visit, withBase } from "../../../9348.1beb3e25.js";
1
+ import { normalizeHref, node_path, addLeadingSlash, logger, visit, picocolors, isExternalUrl, isProduction, parseUrl, withBase } from "../../../1965.js";
3
2
  import { hintRelativeMarkdownLink } from "../../logger/hint.js";
4
3
  import { createError } from "../../utils/error.js";
5
4
  function link_checkDeadLinks(checkDeadLinks, internalLinks, file, lint) {
@@ -1,4 +1,4 @@
1
- import { github_slugger, visitChildren, extractTextAndId } from "../../../9348.1beb3e25.js";
1
+ import { github_slugger, visitChildren, extractTextAndId } from "../../../1361.js";
2
2
  const extractChildText = (child)=>{
3
3
  if ('link' === child.type) return child.children?.map(extractChildText).join('') ?? '';
4
4
  if ('strong' === child.type) return `**${child.children?.map(extractChildText).join('') ?? ''}**`;
@@ -1,4 +1,4 @@
1
- import { node_path } from "../../6289.29817fb4.js";
1
+ import { node_path } from "../../0~1402.js";
2
2
  import { PACKAGE_ROOT } from "../constants.js";
3
3
  function pluginMediumZoom(options = {}) {
4
4
  return {
@@ -1,4 +1,4 @@
1
- import { node_path } from "../../6289.29817fb4.js";
1
+ import { node_path } from "../../675.js";
2
2
  import { RouteService } from "./RouteService.js";
3
3
  import { normalizePath, slash } from "../utils/normalizePath.js";
4
4
  import { getPageKey } from "../utils/getPageKey.js";
@@ -53,7 +53,7 @@ function absolutePathToRoutePath(absolutePath, docsDir, routeService = RouteServ
53
53
  return absolutePathToRouteMeta(absolutePath, docsDir, routeService).routePath;
54
54
  }
55
55
  function absolutePathToRoutePrefix(absolutePath, docsDir) {
56
- const relativePath = slash(node_path.relative(docsDir, absolutePath.replace(node_path.extname(absolutePath), '')));
56
+ const relativePath = slash(node_path.relative(docsDir, absolutePath));
57
57
  const routeService = RouteService.getInstance();
58
58
  const [versionPrefix, langPrefix] = routeService.getRoutePathParts(relativePath);
59
59
  return `${versionPrefix ? `/${versionPrefix}` : ''}${langPrefix ? `/${langPrefix}` : ''}`;
@@ -1,6 +1,4 @@
1
- import { node_path, promises } from "../../6289.29817fb4.js";
2
- import { RSPRESS_TEMP_DIR, removeTrailingSlash, addTrailingSlash } from "../../9348.1beb3e25.js";
3
- import { DEFAULT_PAGE_EXTENSIONS, glob } from "../../7744.421b464f.js";
1
+ import { RSPRESS_TEMP_DIR, node_path, removeTrailingSlash, promises, addTrailingSlash, DEFAULT_PAGE_EXTENSIONS, glob } from "../../675.js";
4
2
  import { PUBLIC_DIR } from "../constants.js";
5
3
  import { RoutePage, absolutePathToRoutePath, absolutePathToRelativePath } from "./RoutePage.js";
6
4
  import { createError } from "../utils/error.js";
@@ -1,6 +1,4 @@
1
- import { node_path, promises } from "../../6289.29817fb4.js";
2
- import { unified, visit, remark_gfm, loadFrontMatter, remark_stringify, MDX_OR_MD_REGEXP } from "../../9348.1beb3e25.js";
3
- import { remove, remark_parse } from "../../7744.421b464f.js";
1
+ import { unified, node_path, visit, promises, loadFrontMatter, remark_stringify, remove, remark_gfm, MDX_OR_MD_REGEXP, remark_parse } from "../../675.js";
4
2
  import { applyReplaceRules } from "../utils/applyReplaceRules.js";
5
3
  import { flattenMdxContent } from "../utils/flattenMdxContent.js";
6
4
  import { importStatementRegex } from "../constants.js";