@rspress/core 2.0.1 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/{0~7675.ad8fe23f.js → 0~7675.872de9ba.js} +2 -2
  2. package/dist/{5485.d1bd4aec.js → 5485.888e77db.js} +1 -1
  3. package/dist/_private/react/render.js +58 -8
  4. package/dist/cli/index.js +1 -1
  5. package/dist/config/loadConfigFile.js +1 -1
  6. package/dist/eject-theme/components/OverviewGroup/index.scss +6 -11
  7. package/dist/eject-theme/components/SidebarMenu/index.scss +25 -1
  8. package/dist/eject-theme/components/SidebarMenu/index.tsx +5 -2
  9. package/dist/eject-theme/components/Tag/index.tsx +2 -0
  10. package/dist/index.js +1 -1
  11. package/dist/node/auto-nav-sidebar/index.js +1 -1
  12. package/dist/node/constants.js +1 -1
  13. package/dist/node/initRsbuild.js +2 -2
  14. package/dist/node/last-updated/index.js +1 -1
  15. package/dist/node/logger/hint.js +1 -3
  16. package/dist/node/route/RouteService.js +1 -1
  17. package/dist/node/route/extractPageData.js +1 -1
  18. package/dist/node/route/normalizeRoutePath.js +1 -1
  19. package/dist/node/runtimeModule/i18n.js +1 -1
  20. package/dist/node/runtimeModule/pageData/createPageData.js +1 -1
  21. package/dist/node/runtimeModule/pageData/rsbuildPlugin.js +1 -1
  22. package/dist/node/serve.js +1 -1
  23. package/dist/node/ssg/renderPage.js +1 -1
  24. package/dist/node/ssg/renderPageWorker.js +1 -1
  25. package/dist/node/ssg/renderPages.js +2 -2
  26. package/dist/node/ssg-md/llms/emitLlmsTxt.js +1 -1
  27. package/dist/node/ssg-md/react/render.d.ts +1 -0
  28. package/dist/node/ssg-md/renderPage.js +4 -3
  29. package/dist/node/ssg-md/renderPages.js +1 -1
  30. package/dist/node/utils/createHash.js +1 -1
  31. package/dist/node/utils/flattenMdxContent.js +1 -1
  32. package/dist/node/utils/reactAlias.js +1 -1
  33. package/dist/theme/components/OverviewGroup/index.css +3 -9
  34. package/dist/theme/components/SidebarMenu/index.css +25 -1
  35. package/dist/theme/components/SidebarMenu/index.js +3 -1
  36. package/dist/theme/components/Tag/index.js +4 -0
  37. package/dist/theme/layout/Layout/index.js +10 -4
  38. package/package.json +10 -10
  39. /package/dist/{6576.421b464f.js → 8995.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.d1bd4aec.js";
13
- import { createWriteStream, createReadStream, readFileSync } from "./6576.421b464f.js";
12
+ import { node_url } from "./5485.888e77db.js";
13
+ import { createWriteStream, createReadStream, readFileSync } from "./8995.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");
@@ -1,5 +1,5 @@
1
1
  var package_namespaceObject = {
2
- rE: "2.0.1"
2
+ rE: "2.0.3"
3
3
  };
4
4
  async function pMap(iterable, mapper, { concurrency = 1 / 0, stopOnError = true, signal } = {}) {
5
5
  return new Promise((resolve_, reject_)=>{
@@ -1,4 +1,49 @@
1
+ import react from "react";
1
2
  import { MarkdownNode, TextNode, reconciler } from "./reconciler.js";
3
+ const ReactSharedInternals = react.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
4
+ function noop() {}
5
+ let interceptorRefCount = 0;
6
+ let originalDescriptor;
7
+ let realH = null;
8
+ let cachedTarget = null;
9
+ let cachedProxy = null;
10
+ function installEffectInterceptor() {
11
+ if (!ReactSharedInternals) return noop;
12
+ interceptorRefCount++;
13
+ if (1 === interceptorRefCount) {
14
+ originalDescriptor = Object.getOwnPropertyDescriptor(ReactSharedInternals, 'H');
15
+ realH = ReactSharedInternals.H;
16
+ cachedTarget = null;
17
+ cachedProxy = null;
18
+ Object.defineProperty(ReactSharedInternals, 'H', {
19
+ get () {
20
+ if (null == realH) return realH;
21
+ if (cachedTarget !== realH) {
22
+ cachedTarget = realH;
23
+ cachedProxy = new Proxy(realH, {
24
+ get (target, prop, receiver) {
25
+ if ('useEffect' === prop || 'useLayoutEffect' === prop || 'useInsertionEffect' === prop) return noop;
26
+ return Reflect.get(target, prop, receiver);
27
+ }
28
+ });
29
+ }
30
+ return cachedProxy;
31
+ },
32
+ set (value) {
33
+ realH = value;
34
+ },
35
+ configurable: true
36
+ });
37
+ }
38
+ return ()=>{
39
+ interceptorRefCount--;
40
+ if (0 === interceptorRefCount) if (originalDescriptor) Object.defineProperty(ReactSharedInternals, 'H', originalDescriptor);
41
+ else {
42
+ delete ReactSharedInternals.H;
43
+ ReactSharedInternals.H = realH;
44
+ }
45
+ };
46
+ }
2
47
  function toMarkdown(root) {
3
48
  const { type, props, children } = root;
4
49
  const childrenMd = children.map((child)=>{
@@ -106,13 +151,18 @@ async function renderToMarkdownString(element) {
106
151
  }, ()=>{}, (...args)=>{
107
152
  if (process.env.DEBUG) console.log('Reconciler onRecoverable Error:', ...args);
108
153
  }, ()=>{}, null);
109
- let resolveCommit = null;
110
- const commitPromise = new Promise((resolve)=>{
111
- resolveCommit = resolve;
112
- });
113
- reconciler.updateContainer(element, root, null, ()=>{
114
- if (resolveCommit) resolveCommit(toMarkdown(container));
115
- });
116
- return commitPromise;
154
+ const removeInterceptor = installEffectInterceptor();
155
+ try {
156
+ let resolveCommit = null;
157
+ const commitPromise = new Promise((resolve)=>{
158
+ resolveCommit = resolve;
159
+ });
160
+ reconciler.updateContainer(element, root, null, ()=>{
161
+ if (resolveCommit) resolveCommit(toMarkdown(container));
162
+ });
163
+ return await commitPromise;
164
+ } finally{
165
+ removeInterceptor();
166
+ }
117
167
  }
118
168
  export { renderToMarkdownString };
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.d1bd4aec.js";
3
+ import { package_namespaceObject } from "../5485.888e77db.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 "../6576.421b464f.js";
1
+ import { node_fs, DEFAULT_CONFIG_EXTENSIONS, DEFAULT_CONFIG_NAME } from "../8995.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) {
@@ -95,16 +95,10 @@
95
95
  &__item {
96
96
  width: 200px;
97
97
  flex: 0 0 200px;
98
- min-width: 25%; // 4 columns
99
- max-width: 25%; // 4 columns
98
+ min-width: 33.33%; // 3 columns
99
+ max-width: 33.33%; // 3 columns
100
100
  word-break: break-all;
101
101
 
102
- @media (min-width: 769px) and (max-width: 1280px) {
103
- // 3 columns
104
- min-width: 33%;
105
- max-width: 33%;
106
- }
107
-
108
102
  @media (max-width: 768px) {
109
103
  // 2 columns or 1 columns
110
104
  min-width: 50%;
@@ -118,6 +112,7 @@
118
112
  font-size: 14px;
119
113
  color: var(--rp-c-text-2);
120
114
  text-decoration: none;
115
+ word-break: normal;
121
116
  transition:
122
117
  color 0.2s ease,
123
118
  background-color 0.2s ease;
@@ -134,16 +129,16 @@
134
129
  // Grid layout for items without content (no headers/items)
135
130
  &__grid {
136
131
  display: grid;
137
- grid-template-columns: repeat(4, 1fr);
132
+ grid-template-columns: repeat(4, 1fr); // 4 columns by default
138
133
  gap: 20px;
139
134
  width: 100%;
140
135
 
141
136
  @media (max-width: 1280px) {
142
- grid-template-columns: repeat(3, 1fr);
137
+ grid-template-columns: repeat(3, 1fr); // 3 columns for medium screens
143
138
  }
144
139
 
145
140
  @media (max-width: 768px) {
146
- grid-template-columns: repeat(2, 1fr);
141
+ grid-template-columns: repeat(2, 1fr); // 2 columns for small screens
147
142
  }
148
143
 
149
144
  @media (max-width: 480px) {
@@ -15,13 +15,37 @@
15
15
  font-style: normal;
16
16
  font-weight: 600;
17
17
 
18
- &__left,
18
+ &__left {
19
+ display: flex;
20
+ gap: 8px;
21
+ align-items: center;
22
+ height: 100%;
23
+ background: transparent;
24
+ flex-shrink: 0;
25
+ }
26
+
19
27
  &__right {
20
28
  display: flex;
21
29
  gap: 8px;
22
30
  align-items: center;
23
31
  height: 100%;
24
32
  background: transparent;
33
+ min-width: 0;
34
+ overflow: hidden;
35
+
36
+ &__text {
37
+ overflow: hidden;
38
+ display: -webkit-box;
39
+ line-clamp: 2;
40
+ -webkit-line-clamp: 2;
41
+ -webkit-box-orient: vertical;
42
+ text-overflow: ellipsis;
43
+ }
44
+
45
+ &__icon,
46
+ .rp-progress-circle {
47
+ flex-shrink: 0;
48
+ }
25
49
  }
26
50
 
27
51
  @media (min-width: 1280px) {
@@ -104,17 +104,20 @@ export const SidebarMenu = forwardRef(
104
104
  >
105
105
  {scrolledHeader?.text ? (
106
106
  <span
107
- className="rp-doc"
107
+ className="rp-sidebar-menu__right__text rp-doc"
108
108
  {...renderInlineMarkdown(scrolledHeader.text)}
109
109
  />
110
110
  ) : (
111
- <span>{t('outlineTitle')}</span>
111
+ <span className="rp-sidebar-menu__right__text">
112
+ {t('outlineTitle')}
113
+ </span>
112
114
  )}
113
115
  <ReadPercent size={14} strokeWidth={2} />
114
116
  {/* TODO: discussion */}
115
117
  {headers.length !== 0 && (
116
118
  <SvgWrapper
117
119
  icon={IconArrowRight}
120
+ className="rp-sidebar-menu__right__icon"
118
121
  style={{
119
122
  transform: isOutlineOpen ? 'rotate(90deg)' : 'rotate(0deg)',
120
123
  transition: 'transform 0.2s ease-out',
@@ -91,6 +91,8 @@ export const Tag = ({ tag }: { tag?: string }) => {
91
91
  <span>deprecated</span>
92
92
  </Badge>
93
93
  );
94
+ } else if (normalizedTag === 'new') {
95
+ return <Badge text="new" type="tip" />;
94
96
  }
95
97
 
96
98
  if (BADGE_TAGS[normalizedTag as keyof typeof BADGE_TAGS]) {
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 "./6576.421b464f.js";
8
+ export { matchPath } from "./8995.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 "../../6576.421b464f.js";
2
+ import { DEFAULT_PAGE_EXTENSIONS } from "../../8995.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) {
@@ -1,4 +1,4 @@
1
- import { createRequire, package_namespaceObject } from "../5485.d1bd4aec.js";
1
+ import { createRequire, package_namespaceObject } from "../5485.888e77db.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;
@@ -1,7 +1,7 @@
1
- import { createRequire, fileURLToPath, package_namespaceObject } from "../5485.d1bd4aec.js";
1
+ import { createRequire, fileURLToPath, package_namespaceObject } from "../5485.888e77db.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 "../6576.421b464f.js";
4
+ import { PLUGIN_REACT_NAME, pluginReact, pluginVirtualModule } from "../8995.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";
@@ -1,4 +1,4 @@
1
- import { execa } from "../../0~7675.ad8fe23f.js";
1
+ import { execa } from "../../0~7675.872de9ba.js";
2
2
  function transform(timestamp, lang) {
3
3
  return new Date(timestamp).toLocaleString(lang || 'zh');
4
4
  }
@@ -57,9 +57,7 @@ ${picocolors.greenBright(` builderConfig: {
57
57
  }
58
58
  }
59
59
  function hintSSGFailed() {
60
- logger.info(`[Rspress v2] \`ssg: true\` requires the source code to support SSR. If the code is not compatible to SSR, the build process will fail. You can try:
61
- 1. Fix code to make it SSR-compatible.
62
- 2. Set \`ssg: false\` if the code in node_modules may be difficult to fix, but the SSG feature will be lost.`);
60
+ logger.info("[Rspress v2] `ssg: true` requires the source code to support SSR. If the code is not compatible to SSR, the build process will fail. You can try:\n 1. Fix code to make it SSR-compatible.\n 2. Set `ssg: false` if the code in node_modules may be difficult to fix, but the SSG feature will be lost.");
63
61
  }
64
62
  function hintSSGFalse() {
65
63
  logger.info('`ssg: false` detected, SSG will be disabled.');
@@ -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 "../../6576.421b464f.js";
3
+ import { DEFAULT_PAGE_EXTENSIONS, glob } from "../../8995.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 "../../6576.421b464f.js";
3
+ import { remove, remark_parse } from "../../8995.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 "../../6576.421b464f.js";
2
+ import { DEFAULT_PAGE_EXTENSIONS } from "../../8995.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.d1bd4aec.js";
1
+ import { createRequire } from "../../5485.888e77db.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 "../../../6576.421b464f.js";
2
+ import { groupBy } from "../../../8995.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 "../../../6576.421b464f.js";
2
+ import { pluginVirtualModule } from "../../../8995.421b464f.js";
3
3
  import { createPageData } from "./createPageData.js";
4
4
  const rsbuildPluginDocVM = async ({ config, userDocRoot, routeService, pluginDriver })=>{
5
5
  const ref = {
@@ -1,4 +1,4 @@
1
- import { mergeRsbuildConfig } from "../6576.421b464f.js";
1
+ import { mergeRsbuildConfig } from "../8995.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.d1bd4aec.js";
1
+ import { transformHtmlTemplate, pathToFileURL, createHead } from "../../5485.888e77db.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.d1bd4aec.js";
3
+ import { pMap } from "../../5485.888e77db.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 "../../6576.421b464f.js";
3
+ import { chunk } from "../../8995.421b464f.js";
4
4
  import { SSGWorkerThreadTaskSize, getNumberOfThreads, SSGWorkerThreadRecyclerMaxMemory, SSGConcurrency } from "./ssgEnv.js";
5
- import { pMap } from "../../5485.d1bd4aec.js";
5
+ import { pMap } from "../../5485.888e77db.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 "../../../6576.421b464f.js";
2
+ import { matchPath } from "../../../8995.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 +1,2 @@
1
+ import React from 'react';
1
2
  export declare function renderToMarkdownString(element: React.ReactElement): Promise<string>;
@@ -1,11 +1,12 @@
1
- import { pathToFileURL, createHead } from "../../5485.d1bd4aec.js";
1
+ import { pathToFileURL, createHead } from "../../5485.888e77db.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) {
5
5
  let render;
6
6
  try {
7
- const { default: ssrExports } = await import(pathToFileURL(ssrBundlePath).toString());
8
- render = await ssrExports.render;
7
+ let { default: ssrExports } = await import(pathToFileURL(ssrBundlePath).toString());
8
+ if (ssrExports instanceof Promise) ssrExports = await ssrExports;
9
+ render = ssrExports.render;
9
10
  } catch (e) {
10
11
  if (e instanceof Error) {
11
12
  logger.error(`Failed to load SSG bundle: ${picocolors.yellow(ssrBundlePath)}: ${e.message}`);
@@ -1,5 +1,5 @@
1
1
  import { logger, picocolors } from "../../6289.29817fb4.js";
2
- import { pMap } from "../../5485.d1bd4aec.js";
2
+ import { pMap } from "../../5485.888e77db.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 "../../6576.421b464f.js";
1
+ import { createHash as external_node_crypto_createHash } from "../../8995.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 "../../6576.421b464f.js";
1
+ import { node_fs, core_rspack } from "../../8995.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 "../../6576.421b464f.js";
2
+ import { core_rspack } from "../../8995.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";
@@ -91,15 +91,8 @@
91
91
  word-break: break-all;
92
92
  flex: 0 0 200px;
93
93
  width: 200px;
94
- min-width: 25%;
95
- max-width: 25%;
96
- }
97
-
98
- @media (width >= 769px) and (width <= 1280px) {
99
- .rp-overview-group__item__content__item {
100
- min-width: 33%;
101
- max-width: 33%;
102
- }
94
+ min-width: 33.33%;
95
+ max-width: 33.33%;
103
96
  }
104
97
 
105
98
  @media (width <= 768px) {
@@ -112,6 +105,7 @@
112
105
 
113
106
  .rp-overview-group__item__content__item__link {
114
107
  color: var(--rp-c-text-2);
108
+ word-break: normal;
115
109
  padding: 4px 8px;
116
110
  font-size: 14px;
117
111
  text-decoration: none;
@@ -12,14 +12,38 @@
12
12
  display: flex;
13
13
  }
14
14
 
15
- .rp-sidebar-menu__left, .rp-sidebar-menu__right {
15
+ .rp-sidebar-menu__left {
16
16
  background: none;
17
+ flex-shrink: 0;
17
18
  align-items: center;
18
19
  gap: 8px;
19
20
  height: 100%;
20
21
  display: flex;
21
22
  }
22
23
 
24
+ .rp-sidebar-menu__right {
25
+ background: none;
26
+ align-items: center;
27
+ gap: 8px;
28
+ min-width: 0;
29
+ height: 100%;
30
+ display: flex;
31
+ overflow: hidden;
32
+ }
33
+
34
+ .rp-sidebar-menu__right__text {
35
+ line-clamp: 2;
36
+ -webkit-line-clamp: 2;
37
+ text-overflow: ellipsis;
38
+ -webkit-box-orient: vertical;
39
+ display: -webkit-box;
40
+ overflow: hidden;
41
+ }
42
+
43
+ .rp-sidebar-menu__right__icon, .rp-sidebar-menu__right .rp-progress-circle {
44
+ flex-shrink: 0;
45
+ }
46
+
23
47
  @media (width >= 1280px) {
24
48
  .rp-sidebar-menu {
25
49
  display: none;
@@ -69,9 +69,10 @@ const SidebarMenu = /*#__PURE__*/ forwardRef(({ isSidebarOpen, onIsSidebarOpenCh
69
69
  className: "rp-sidebar-menu__right",
70
70
  children: [
71
71
  scrolledHeader?.text ? /*#__PURE__*/ jsx("span", {
72
- className: "rp-doc",
72
+ className: "rp-sidebar-menu__right__text rp-doc",
73
73
  ...renderInlineMarkdown(scrolledHeader.text)
74
74
  }) : /*#__PURE__*/ jsx("span", {
75
+ className: "rp-sidebar-menu__right__text",
75
76
  children: t('outlineTitle')
76
77
  }),
77
78
  /*#__PURE__*/ jsx(ReadPercent, {
@@ -80,6 +81,7 @@ const SidebarMenu = /*#__PURE__*/ forwardRef(({ isSidebarOpen, onIsSidebarOpenCh
80
81
  }),
81
82
  0 !== headers.length && /*#__PURE__*/ jsx(SvgWrapper, {
82
83
  icon: IconArrowRight,
84
+ className: "rp-sidebar-menu__right__icon",
83
85
  style: {
84
86
  transform: isOutlineOpen ? 'rotate(90deg)' : 'rotate(0deg)',
85
87
  transition: 'transform 0.2s ease-out'
@@ -69,6 +69,10 @@ const Tag_Tag = ({ tag })=>{
69
69
  })
70
70
  ]
71
71
  });
72
+ if ('new' === normalizedTag) return /*#__PURE__*/ jsx(Badge, {
73
+ text: "new",
74
+ type: "tip"
75
+ });
72
76
  if (BADGE_TAGS[normalizedTag]) return /*#__PURE__*/ jsx(Badge, {
73
77
  text: normalizedTag,
74
78
  type: BADGE_TAGS[normalizedTag]
@@ -32,10 +32,16 @@ const HeadTags = /*#__PURE__*/ memo((props)=>{
32
32
  property: 'og:title',
33
33
  content: title
34
34
  } : void 0,
35
- description ? {
36
- name: "description",
37
- content: description
38
- } : void 0
35
+ ...description ? [
36
+ {
37
+ name: "description",
38
+ content: description
39
+ },
40
+ {
41
+ property: "og:description",
42
+ content: description
43
+ }
44
+ ] : []
39
45
  ]
40
46
  });
41
47
  return /*#__PURE__*/ jsx(Head, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/core",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "The Rspress Documentation Framework",
5
5
  "bugs": "https://github.com/web-infra-dev/rspress/issues",
6
6
  "repository": {
@@ -63,11 +63,11 @@
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-beta.0",
67
- "@rsbuild/plugin-react": "~1.4.4",
66
+ "@rsbuild/core": "2.0.0-beta.3",
67
+ "@rsbuild/plugin-react": "~1.4.5",
68
68
  "@shikijs/rehype": "^3.21.0",
69
69
  "@types/unist": "^3.0.3",
70
- "@unhead/react": "^2.1.2",
70
+ "@unhead/react": "^2.1.4",
71
71
  "body-scroll-lock": "4.0.0-beta.0",
72
72
  "cac": "^6.7.14",
73
73
  "chokidar": "^3.6.0",
@@ -87,7 +87,7 @@
87
87
  "react-dom": "^19.2.4",
88
88
  "react-lazy-with-preload": "^2.2.1",
89
89
  "react-reconciler": "0.33.0",
90
- "react-router-dom": "^7.12.0",
90
+ "react-router-dom": "^7.13.0",
91
91
  "rehype-external-links": "^3.0.0",
92
92
  "rehype-raw": "^7.0.0",
93
93
  "remark-gfm": "^4.0.1",
@@ -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.1"
105
+ "@rspress/shared": "2.0.3"
106
106
  },
107
107
  "devDependencies": {
108
- "@microsoft/api-extractor": "^7.55.2",
108
+ "@microsoft/api-extractor": "^7.56.3",
109
109
  "@rsbuild/plugin-sass": "~1.5.0",
110
110
  "@rsbuild/plugin-svgr": "^1.3.0",
111
- "@rslib/core": "0.19.3",
111
+ "@rslib/core": "0.19.5",
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.10",
118
+ "@types/react": "^19.2.13",
119
119
  "@types/react-dom": "^19.2.3",
120
120
  "@types/react-reconciler": "^0.32.3",
121
- "@types/web": "^0.0.323",
121
+ "@types/web": "^0.0.330",
122
122
  "execa": "8.0.1",
123
123
  "mdast-util-directive": "^3.1.0",
124
124
  "mdast-util-mdx-expression": "^2.0.1",
File without changes