@rspress/core 2.0.2 → 2.0.4

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 (122) hide show
  1. package/dist/{0~7675.6e0caa9f.js → 0~7675.423f6a06.js} +2 -2
  2. package/dist/{5485.5f8db93a.js → 5485.7e481fde.js} +1 -1
  3. package/dist/cli/index.js +1 -1
  4. package/dist/config/loadConfigFile.js +1 -1
  5. package/dist/eject-theme/components/Badge/index.tsx +1 -1
  6. package/dist/eject-theme/components/Button/index.tsx +1 -1
  7. package/dist/eject-theme/components/CodeBlock/index.scss +5 -1
  8. package/dist/eject-theme/components/DocContent/docComponents/title.tsx +7 -2
  9. package/dist/eject-theme/components/EditLink/index.scss +10 -8
  10. package/dist/eject-theme/components/EditLink/index.tsx +13 -4
  11. package/dist/eject-theme/components/HoverGroup/index.tsx +8 -2
  12. package/dist/eject-theme/components/Llms/LlmsCopyRow.tsx +51 -0
  13. package/dist/eject-theme/components/Llms/LlmsOpenRow.scss +10 -0
  14. package/dist/eject-theme/components/Llms/LlmsOpenRow.tsx +170 -0
  15. package/dist/eject-theme/components/Nav/NavMenu.tsx +7 -1
  16. package/dist/eject-theme/components/Nav/hooks.tsx +2 -0
  17. package/dist/eject-theme/components/NavScreen/NavScreenLangs.tsx +8 -1
  18. package/dist/eject-theme/components/NavScreen/NavScreenMenuItem.scss +0 -1
  19. package/dist/eject-theme/components/Outline/ScrollToTop.tsx +12 -34
  20. package/dist/eject-theme/components/Outline/index.scss +41 -5
  21. package/dist/eject-theme/components/Outline/index.tsx +19 -2
  22. package/dist/eject-theme/components/OverviewGroup/index.scss +5 -11
  23. package/dist/eject-theme/components/PackageManagerTabs/index.tsx +10 -2
  24. package/dist/eject-theme/components/Search/SearchPanel.tsx +2 -1
  25. package/dist/eject-theme/components/Search/logic/providers/LocalProvider.ts +1 -1
  26. package/dist/eject-theme/components/Sidebar/SidebarItem.scss +0 -2
  27. package/dist/eject-theme/components/SidebarMenu/index.scss +25 -1
  28. package/dist/eject-theme/components/SidebarMenu/index.tsx +5 -2
  29. package/dist/eject-theme/components/SourceCode/index.tsx +1 -1
  30. package/dist/eject-theme/components/SvgWrapper/index.tsx +5 -2
  31. package/dist/eject-theme/components/Tabs/index.scss +1 -1
  32. package/dist/eject-theme/components/Tabs/index.tsx +1 -1
  33. package/dist/eject-theme/components/Tag/index.tsx +2 -0
  34. package/dist/index.js +1 -1
  35. package/dist/node/auto-nav-sidebar/index.js +1 -1
  36. package/dist/node/auto-nav-sidebar/normalize.js +30 -4
  37. package/dist/node/constants.js +1 -1
  38. package/dist/node/initRsbuild.js +11 -9
  39. package/dist/node/last-updated/index.js +1 -1
  40. package/dist/node/logger/hint.d.ts +0 -3
  41. package/dist/node/logger/hint.js +8 -4
  42. package/dist/node/mdx/rehypePlugins/transformers/add-line-numbers.js +3 -2
  43. package/dist/node/mdx/rehypePlugins/transformers/add-wrap-code.js +4 -3
  44. package/dist/node/route/RouteService.js +1 -1
  45. package/dist/node/route/extractPageData.js +23 -2
  46. package/dist/node/route/normalizeRoutePath.js +1 -1
  47. package/dist/node/runtimeModule/DEFAULT_I18N_TEXT.d.ts +4 -4
  48. package/dist/node/runtimeModule/DEFAULT_I18N_TEXT.js +4 -4
  49. package/dist/node/runtimeModule/i18n.js +1 -1
  50. package/dist/node/runtimeModule/pageData/createPageData.js +2 -2
  51. package/dist/node/runtimeModule/pageData/rsbuildPlugin.js +1 -1
  52. package/dist/node/serve.js +1 -1
  53. package/dist/node/ssg/renderPage.js +1 -1
  54. package/dist/node/ssg/renderPageWorker.js +1 -1
  55. package/dist/node/ssg/renderPages.js +2 -2
  56. package/dist/node/ssg-md/llms/emitLlmsTxt.js +1 -1
  57. package/dist/node/ssg-md/remarkSplitMdx.js +11 -1
  58. package/dist/node/ssg-md/renderPage.js +4 -3
  59. package/dist/node/ssg-md/renderPages.js +1 -1
  60. package/dist/node/utils/createHash.js +1 -1
  61. package/dist/node/utils/flattenMdxContent.js +1 -1
  62. package/dist/node/utils/reactAlias.d.ts +1 -0
  63. package/dist/node/utils/reactAlias.js +34 -2
  64. package/dist/runtime/ssrMdServerEntry.js +1 -1
  65. package/dist/theme/assets/copy.js +3 -3
  66. package/dist/theme/assets/edit.js +18 -0
  67. package/dist/theme/assets/scroll-to-top.js +36 -0
  68. package/dist/theme/assets/success.js +3 -2
  69. package/dist/theme/components/Badge/index.d.ts +1 -2
  70. package/dist/theme/components/Button/index.d.ts +1 -2
  71. package/dist/theme/components/CodeBlock/index.css +5 -1
  72. package/dist/theme/components/DocContent/docComponents/title.js +5 -2
  73. package/dist/theme/components/EditLink/index.css +2 -2
  74. package/dist/theme/components/EditLink/index.d.ts +3 -1
  75. package/dist/theme/components/EditLink/index.js +18 -4
  76. package/dist/theme/components/HoverGroup/index.js +8 -1
  77. package/dist/theme/components/Llms/LlmsCopyRow.d.ts +1 -0
  78. package/dist/theme/components/Llms/LlmsCopyRow.js +50 -0
  79. package/dist/theme/components/Llms/LlmsOpenRow.css +11 -0
  80. package/dist/theme/components/Llms/LlmsOpenRow.d.ts +3 -0
  81. package/dist/theme/components/Llms/LlmsOpenRow.js +168 -0
  82. package/dist/theme/components/Nav/NavMenu.js +3 -0
  83. package/dist/theme/components/Nav/hooks.d.ts +2 -0
  84. package/dist/theme/components/Nav/hooks.js +3 -1
  85. package/dist/theme/components/NavScreen/NavScreenLangs.js +3 -0
  86. package/dist/theme/components/NavScreen/NavScreenMenuItem.css +0 -1
  87. package/dist/theme/components/Outline/ScrollToTop.d.ts +1 -2
  88. package/dist/theme/components/Outline/ScrollToTop.js +7 -32
  89. package/dist/theme/components/Outline/index.css +39 -4
  90. package/dist/theme/components/Outline/index.js +16 -4
  91. package/dist/theme/components/OverviewGroup/index.css +2 -9
  92. package/dist/theme/components/PackageManagerTabs/index.js +10 -3
  93. package/dist/theme/components/Search/SearchPanel.js +1 -1
  94. package/dist/theme/components/Search/logic/providers/LocalProvider.js +1 -1
  95. package/dist/theme/components/Sidebar/SidebarItem.css +0 -2
  96. package/dist/theme/components/SidebarMenu/index.css +25 -1
  97. package/dist/theme/components/SidebarMenu/index.js +3 -1
  98. package/dist/theme/components/SourceCode/index.d.ts +1 -2
  99. package/dist/theme/components/SvgWrapper/index.d.ts +1 -2
  100. package/dist/theme/components/SvgWrapper/index.js +2 -1
  101. package/dist/theme/components/Tabs/index.css +1 -1
  102. package/dist/theme/components/Tabs/index.d.ts +1 -1
  103. package/dist/theme/components/Tag/index.js +4 -0
  104. package/dist/theme/icons.d.ts +2 -0
  105. package/dist/theme/icons.js +5 -1
  106. package/dist/theme/index.d.ts +8 -5
  107. package/dist/theme/index.js +4 -1
  108. package/dist/theme/layout/DocLayout/index.css +3 -3
  109. package/dist/theme/layout/Layout/index.js +10 -4
  110. package/dist/theme/styles/base.css +4 -0
  111. package/nav-json-schema.json +12 -0
  112. package/package.json +14 -16
  113. package/dist/_private/react/index.js +0 -2
  114. package/dist/_private/react/reconciler.js +0 -169
  115. package/dist/_private/react/render.js +0 -118
  116. package/dist/eject-theme/components/Outline/ScrollToTop.scss +0 -13
  117. package/dist/node/ssg-md/react/index.d.ts +0 -1
  118. package/dist/node/ssg-md/react/reconciler.d.ts +0 -18
  119. package/dist/node/ssg-md/react/render.d.ts +0 -1
  120. package/dist/node/ssg-md/react/render.test.d.ts +0 -1
  121. package/dist/theme/components/Outline/ScrollToTop.css +0 -14
  122. /package/dist/{2577.421b464f.js → 7744.421b464f.js} +0 -0
@@ -14,6 +14,9 @@ function NavMenuItemInner({ menuItem, children }) {
14
14
  children: 'link' in menuItem && 'string' == typeof menuItem.link ? /*#__PURE__*/ jsxs(Link, {
15
15
  href: menuItem.link,
16
16
  className: "rp-nav-menu__item__container",
17
+ hrefLang: menuItem.lang,
18
+ lang: menuItem.lang,
19
+ rel: menuItem.rel,
17
20
  children: [
18
21
  menuItem.text,
19
22
  menuItem.tag && /*#__PURE__*/ jsx(Tag, {
@@ -2,6 +2,8 @@ export declare function useLangsMenu(): {
2
2
  items: {
3
3
  text: string;
4
4
  link: string;
5
+ lang: string;
6
+ rel: string;
5
7
  }[];
6
8
  activeValue: string | undefined;
7
9
  } | {
@@ -41,7 +41,9 @@ function useLangsMenu() {
41
41
  }, {
42
42
  current: currentVersion,
43
43
  default: defaultVersion
44
- }, cleanUrls, '404' === pageType)
44
+ }, cleanUrls, '404' === pageType),
45
+ lang: item.lang,
46
+ rel: 'alternate'
45
47
  })),
46
48
  activeValue: localeLanguages.find((item)=>currentLang === item.lang)?.label
47
49
  } : {
@@ -51,6 +51,9 @@ function NavScreenLangs() {
51
51
  }, item.text) : /*#__PURE__*/ jsx(Link, {
52
52
  href: item.link,
53
53
  className: className,
54
+ hrefLang: item.lang,
55
+ lang: item.lang,
56
+ rel: "alternate",
54
57
  children: item.text
55
58
  }, item.text);
56
59
  })
@@ -54,6 +54,5 @@
54
54
  margin-left: .2em;
55
55
  margin-right: .1em;
56
56
  font-weight: 400;
57
- transform: translate(0, -.2em);
58
57
  }
59
58
 
@@ -1,2 +1 @@
1
- import './ScrollToTop.scss';
2
- export declare function ScrollToTop(): import("react/jsx-runtime").JSX.Element;
1
+ export declare function ScrollToTop(): import("react/jsx-runtime").JSX.Element | null;
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useI18n } from "@rspress/core/runtime";
3
- import "./ScrollToTop.css";
3
+ import { IconScrollToTop, SvgWrapper, useReadPercent } from "@theme";
4
4
  function ScrollToTop() {
5
5
  const scrollToTop = ()=>{
6
6
  window.scrollTo({
@@ -9,41 +9,16 @@ function ScrollToTop() {
9
9
  });
10
10
  };
11
11
  const t = useI18n();
12
+ const [, scrollTop] = useReadPercent();
13
+ if (scrollTop < 100) return null;
12
14
  return /*#__PURE__*/ jsxs("button", {
13
- className: "rp-outline__scroll-to-top",
15
+ className: "rp-outline__action-row rp-scroll-to-top",
14
16
  onClick: scrollToTop,
15
17
  children: [
16
- /*#__PURE__*/ jsxs("svg", {
18
+ /*#__PURE__*/ jsx(SvgWrapper, {
19
+ icon: IconScrollToTop,
17
20
  width: "16",
18
- height: "16",
19
- viewBox: "0 0 16 16",
20
- fill: "none",
21
- xmlns: "http://www.w3.org/2000/svg",
22
- children: [
23
- /*#__PURE__*/ jsx("path", {
24
- fillRule: "evenodd",
25
- clipRule: "evenodd",
26
- d: "M7.99967 14.6667C11.6816 14.6667 14.6663 11.6819 14.6663 8.00001C14.6663 4.31811 11.6816 1.33334 7.99967 1.33334C4.31777 1.33334 1.33301 4.31811 1.33301 8.00001C1.33301 11.6819 4.31777 14.6667 7.99967 14.6667Z",
27
- stroke: "currentColor",
28
- strokeOpacity: "0.8",
29
- strokeWidth: "1.33333"
30
- }),
31
- /*#__PURE__*/ jsx("path", {
32
- d: "M7.99967 14.6667C11.6816 14.6667 14.6663 11.6819 14.6663 8.00001C14.6663 4.31811 11.6816 1.33334 7.99967 1.33334C4.31777 1.33334 1.33301 4.31811 1.33301 8.00001C1.33301 11.6819 4.31777 14.6667 7.99967 14.6667Z",
33
- stroke: "currentColor",
34
- strokeOpacity: "0.8",
35
- strokeWidth: "1.33333",
36
- strokeLinejoin: "round"
37
- }),
38
- /*#__PURE__*/ jsx("path", {
39
- d: "M11 9L8 6L5 9",
40
- stroke: "currentColor",
41
- strokeOpacity: "0.8",
42
- strokeWidth: "1.33333",
43
- strokeLinecap: "round",
44
- strokeLinejoin: "round"
45
- })
46
- ]
21
+ height: "16"
47
22
  }),
48
23
  /*#__PURE__*/ jsx("span", {
49
24
  children: t('scrollToTopText')
@@ -13,9 +13,9 @@
13
13
  padding-right: var(--rp-outline-padding-x);
14
14
  height: 32px;
15
15
  color: var(--rp-c-text-1);
16
+ flex-shrink: 0;
16
17
  align-items: center;
17
18
  gap: 4px;
18
- margin-bottom: 4px;
19
19
  font-size: 14px;
20
20
  font-style: normal;
21
21
  font-weight: 700;
@@ -33,28 +33,63 @@
33
33
  margin-left: var(--rp-outline-padding-x);
34
34
  margin-right: var(--rp-outline-padding-x);
35
35
  background: var(--rp-c-divider-light);
36
+ flex-shrink: 0;
36
37
  height: 1px;
37
38
  margin-top: 16px;
38
39
  margin-bottom: 16px;
39
40
  }
40
41
 
41
42
  .rp-outline__toc {
42
- padding-left: var(--rp-outline-padding-x);
43
- padding-right: var(--rp-outline-padding-x);
43
+ padding: 4px var(--rp-outline-padding-x);
44
+ scrollbar-width: none;
44
45
  flex-direction: column;
45
46
  flex: 1;
47
+ min-height: 0;
48
+ max-height: 70vh;
46
49
  display: flex;
50
+ overflow: auto scroll;
51
+ mask-image: linear-gradient(#0000, #fff 12px calc(100% - 12px), #0000);
47
52
  }
48
53
 
49
54
  @media (width <= 1280px) {
50
55
  .rp-outline__toc {
51
56
  max-height: 60vh;
52
- overflow: auto scroll;
53
57
  }
54
58
  }
55
59
 
56
60
  .rp-outline__bottom {
57
61
  padding-left: var(--rp-outline-padding-x);
58
62
  padding-right: var(--rp-outline-padding-x);
63
+ flex-direction: column;
64
+ flex-shrink: 0;
65
+ gap: 10px;
66
+ display: flex;
67
+ }
68
+
69
+ .rp-outline__action-row {
70
+ cursor: pointer;
71
+ color: var(--rp-c-text-2);
72
+ background: none;
73
+ border: none;
74
+ align-items: center;
75
+ gap: 8px;
76
+ padding: 0;
77
+ font-size: .875rem;
78
+ font-style: normal;
79
+ font-weight: 400;
80
+ line-height: 20px;
81
+ text-decoration: none;
82
+ transition: color .2s;
83
+ display: flex;
84
+ }
85
+
86
+ .rp-outline__action-row:hover {
87
+ color: var(--rp-c-text-1);
88
+ }
89
+
90
+ .rp-outline__action-row svg {
91
+ flex-shrink: 0;
92
+ width: 16px;
93
+ height: 16px;
59
94
  }
60
95
 
@@ -1,13 +1,14 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useI18n, useSite } from "@rspress/core/runtime";
3
- import { ReadPercent, Toc, useDynamicToc } from "@theme";
3
+ import { EditLink, LlmsCopyRow, LlmsOpenRow, ReadPercent, Toc, useDynamicToc } from "@theme";
4
4
  import "./index.css";
5
5
  import { ScrollToTop } from "./ScrollToTop.js";
6
6
  function Outline() {
7
7
  const t = useI18n();
8
8
  const headers = useDynamicToc();
9
- const { site: { themeConfig: { enableScrollToTop = true } } } = useSite();
9
+ const { site: { themeConfig: { enableScrollToTop = true, llmsUI } } } = useSite();
10
10
  if (0 === headers.length) return /*#__PURE__*/ jsx(Fragment, {});
11
+ const placement = 'object' == typeof llmsUI ? llmsUI?.placement ?? 'title' : 'title';
11
12
  return /*#__PURE__*/ jsxs("div", {
12
13
  className: "rp-outline",
13
14
  children: [
@@ -28,9 +29,20 @@ function Outline() {
28
29
  /*#__PURE__*/ jsx("div", {
29
30
  className: "rp-outline__divider"
30
31
  }),
31
- /*#__PURE__*/ jsx("div", {
32
+ /*#__PURE__*/ jsxs("div", {
32
33
  className: "rp-outline__bottom",
33
- children: enableScrollToTop && /*#__PURE__*/ jsx(ScrollToTop, {})
34
+ children: [
35
+ /*#__PURE__*/ jsx(EditLink, {
36
+ isOutline: true
37
+ }),
38
+ process.env.ENABLE_LLMS_UI && 'outline' === placement && /*#__PURE__*/ jsxs(Fragment, {
39
+ children: [
40
+ /*#__PURE__*/ jsx(LlmsCopyRow, {}),
41
+ /*#__PURE__*/ jsx(LlmsOpenRow, {})
42
+ ]
43
+ }),
44
+ enableScrollToTop && /*#__PURE__*/ jsx(ScrollToTop, {})
45
+ ]
34
46
  })
35
47
  ]
36
48
  });
@@ -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) {
@@ -8,8 +8,15 @@ import { Pnpm } from "./icons/Pnpm.js";
8
8
  import { Yarn } from "./icons/Yarn.js";
9
9
  const transformDenoPositional = (cmd)=>{
10
10
  const parts = cmd.split(' ');
11
+ const subcommand = parts[1];
12
+ const isRun = 'run' === subcommand;
13
+ let transformedFirst = false;
11
14
  const transformed = parts.map((tok, idx)=>{
12
- if (idx >= 2 && !tok.startsWith('-') && !tok.includes(':') && !/^https?:/.test(tok)) return `npm:${tok}`;
15
+ if (idx >= 2 && !tok.startsWith('-') && !tok.includes(':') && !/^https?:/.test(tok)) {
16
+ if (isRun && transformedFirst) return tok;
17
+ transformedFirst = true;
18
+ return `npm:${tok}`;
19
+ }
13
20
  return tok;
14
21
  });
15
22
  return transformed.join(' ');
@@ -69,7 +76,7 @@ function PackageManagerTabs({ command, exec, dlx, additionalTabs = [] }) {
69
76
  case 'bun':
70
77
  return 'bunx';
71
78
  case 'deno':
72
- return 'deno run';
79
+ return 'deno run -A';
73
80
  default:
74
81
  return packageManager;
75
82
  }
@@ -84,7 +91,7 @@ function PackageManagerTabs({ command, exec, dlx, additionalTabs = [] }) {
84
91
  case 'bun':
85
92
  return 'bun';
86
93
  case 'deno':
87
- return 'deno run';
94
+ return 'deno run -A';
88
95
  default:
89
96
  return packageManager;
90
97
  }
@@ -58,7 +58,7 @@ function SearchPanel({ focused, setFocused }) {
58
58
  const t = useI18n();
59
59
  const navigate = useLinkNavigate();
60
60
  const { search, title: siteTitle } = siteData;
61
- const versionedSearch = 'boolean' != typeof search && search?.versioned;
61
+ const versionedSearch = 'boolean' != typeof search && (search?.versioned ?? true);
62
62
  const DEFAULT_RESULT = [
63
63
  {
64
64
  group: siteTitle,
@@ -41,7 +41,7 @@ class LocalProvider {
41
41
  async fetchSearchIndex(options) {
42
42
  if (this.#fetchPromise) return this.#fetchPromise;
43
43
  const { currentLang, currentVersion } = options;
44
- const versioned = options.versioned;
44
+ const versioned = options.versioned ?? true;
45
45
  this.#fetchPromise = this.#getPages(currentLang, versioned ? currentVersion : '');
46
46
  return this.#fetchPromise;
47
47
  }
@@ -33,9 +33,7 @@
33
33
  margin-right: .1em;
34
34
  font-size: 1em;
35
35
  font-weight: 400;
36
- transition: transform .2s;
37
36
  display: inline-block;
38
- transform: translate(0, -.2em);
39
37
  }
40
38
 
41
39
  .rp-sidebar-item--active {
@@ -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'
@@ -1,7 +1,6 @@
1
1
  import './index.scss';
2
- interface SourceCodeProps {
2
+ export interface SourceCodeProps {
3
3
  href: string;
4
4
  platform?: 'github' | 'gitlab';
5
5
  }
6
6
  export declare function SourceCode(props: SourceCodeProps): import("react/jsx-runtime").JSX.Element;
7
- export {};
@@ -1,4 +1,4 @@
1
- type SvgWrapperProps = {
1
+ export type SvgWrapperProps = {
2
2
  icon: string | React.FC<React.SVGProps<SVGSVGElement>>;
3
3
  } & React.SVGProps<SVGSVGElement>;
4
4
  /**
@@ -11,4 +11,3 @@ type SvgWrapperProps = {
11
11
  * @internal
12
12
  */
13
13
  export declare function SvgWrapper({ icon: Icon, ...rest }: SvgWrapperProps): import("react/jsx-runtime").JSX.Element | null;
14
- export {};
@@ -1,4 +1,5 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
+ import { normalizeImagePath } from "@rspress/core/runtime";
2
3
  import { renderHtmlOrText } from "@theme";
3
4
  function isUrlOrPath(str) {
4
5
  return str.startsWith('/') || str.startsWith('./') || str.startsWith('../') || str.startsWith('http://') || str.startsWith('https://') || str.startsWith('data:');
@@ -15,7 +16,7 @@ function SvgWrapper({ icon: Icon, ...rest }) {
15
16
  });
16
17
  if (isUrlOrPath(Icon)) return /*#__PURE__*/ jsx("img", {
17
18
  className: className,
18
- src: Icon,
19
+ src: normalizeImagePath(Icon),
19
20
  alt: ""
20
21
  });
21
22
  return /*#__PURE__*/ jsx("span", {
@@ -40,7 +40,7 @@
40
40
  box-sizing: border-box;
41
41
  user-select: none;
42
42
  cursor: pointer;
43
- border-radius: var(--rp-radius-small);
43
+ border-radius: calc(1.5 * var(--rp-radius-small));
44
44
  margin-right: 4px;
45
45
  padding: 4px 12px;
46
46
  font-size: .875rem;
@@ -5,7 +5,7 @@ type TabItem = {
5
5
  disabled?: boolean;
6
6
  content?: ReactNode;
7
7
  };
8
- interface TabsProps {
8
+ export interface TabsProps {
9
9
  values?: ReactNode[] | ReadonlyArray<ReactNode> | TabItem[];
10
10
  /**
11
11
  * @default 0
@@ -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]
@@ -6,6 +6,7 @@ export declare const IconArrowRight: Icon;
6
6
  export declare const IconClose: Icon;
7
7
  export declare const IconCopy: Icon;
8
8
  export declare const IconDown: Icon;
9
+ export declare const IconEdit: Icon;
9
10
  export declare const IconEmpty: Icon;
10
11
  export declare const IconFile: Icon;
11
12
  export declare const IconGithub: Icon;
@@ -15,6 +16,7 @@ export declare const IconJump: Icon;
15
16
  export declare const IconLoading: Icon;
16
17
  export declare const IconMenu: Icon;
17
18
  export declare const IconMoon: Icon;
19
+ export declare const IconScrollToTop: Icon;
18
20
  export declare const IconSearch: Icon;
19
21
  export declare const IconSmallMenu: Icon;
20
22
  export declare const IconSuccess: Icon;
@@ -4,6 +4,7 @@ import assets_close from "./assets/close.js";
4
4
  import copy from "./assets/copy.js";
5
5
  import deprecated from "./assets/deprecated.js";
6
6
  import down from "./assets/down.js";
7
+ import edit from "./assets/edit.js";
7
8
  import empty from "./assets/empty.js";
8
9
  import experimental from "./assets/experimental.js";
9
10
  import external_link from "./assets/external-link.js";
@@ -16,6 +17,7 @@ import assets_link from "./assets/link.js";
16
17
  import loading from "./assets/loading.js";
17
18
  import menu from "./assets/menu.js";
18
19
  import moon from "./assets/moon.js";
20
+ import scroll_to_top from "./assets/scroll-to-top.js";
19
21
  import search from "./assets/search.js";
20
22
  import small_menu from "./assets/small-menu.js";
21
23
  import success from "./assets/success.js";
@@ -30,6 +32,7 @@ const IconArrowRight = arrow_right;
30
32
  const IconClose = assets_close;
31
33
  const IconCopy = copy;
32
34
  const IconDown = down;
35
+ const IconEdit = edit;
33
36
  const IconEmpty = empty;
34
37
  const IconFile = file;
35
38
  const IconGithub = github;
@@ -39,6 +42,7 @@ const IconJump = jump;
39
42
  const IconLoading = loading;
40
43
  const IconMenu = menu;
41
44
  const IconMoon = moon;
45
+ const IconScrollToTop = scroll_to_top;
42
46
  const IconSearch = search;
43
47
  const IconSmallMenu = small_menu;
44
48
  const IconSuccess = success;
@@ -48,4 +52,4 @@ const IconWrap = wrap;
48
52
  const IconWrapped = wrapped;
49
53
  const IconExternalLink = external_link;
50
54
  const IconLink = assets_link;
51
- export { IconArrowDown, IconArrowRight, IconClose, IconCopy, IconDeprecated, IconDown, IconEmpty, IconExperimental, IconExternalLink, IconFile, IconGithub, IconGitlab, IconHeader, IconJump, IconLink, IconLoading, IconMenu, IconMoon, IconSearch, IconSmallMenu, IconSuccess, IconSun, IconTitle, IconWrap, IconWrapped };
55
+ export { IconArrowDown, IconArrowRight, IconClose, IconCopy, IconDeprecated, IconDown, IconEdit, IconEmpty, IconExperimental, IconExternalLink, IconFile, IconGithub, IconGitlab, IconHeader, IconJump, IconLink, IconLoading, IconMenu, IconMoon, IconScrollToTop, IconSearch, IconSmallMenu, IconSuccess, IconSun, IconTitle, IconWrap, IconWrapped };
@@ -1,6 +1,6 @@
1
- export { Badge } from './components/Badge/index.js';
1
+ export { Badge, type BadgeProps } from './components/Badge/index.js';
2
2
  export { Banner, type BannerProps } from './components/Banner/index.js';
3
- export { Button } from './components/Button/index.js';
3
+ export { Button, type ButtonProps } from './components/Button/index.js';
4
4
  export { Callout, type CalloutProps } from './components/Callout/index.js';
5
5
  export { CodeBlock, type CodeBlockProps } from './components/CodeBlock/index.js';
6
6
  export { CodeBlockRuntime, type CodeBlockRuntimeProps, } from './components/CodeBlockRuntime/index.js';
@@ -22,6 +22,8 @@ export { LastUpdated } from './components/LastUpdated/index.js';
22
22
  export { Link, type LinkProps } from './components/Link/index.js';
23
23
  export { useLinkNavigate } from './components/Link/useLinkNavigate.js';
24
24
  export { LlmsContainer, type LlmsContainerProps, LlmsCopyButton, type LlmsCopyButtonProps, LlmsViewOptions, type LlmsViewOptionsProps, useMdUrl, } from './components/Llms/index.js';
25
+ export { LlmsCopyRow } from './components/Llms/LlmsCopyRow.js';
26
+ export { LlmsOpenRow } from './components/Llms/LlmsOpenRow.js';
25
27
  export { Nav, type NavProps } from './components/Nav/index.js';
26
28
  export { NavHamburger } from './components/NavHamburger/index.js';
27
29
  export { NavTitle } from './components/NavTitle/index.js';
@@ -32,6 +34,7 @@ export { type PackageManagerTabProps, PackageManagerTabs, } from './components/P
32
34
  export { PageTab, type PageTabProps, PageTabs, type PageTabsProps, } from './components/PageTabs/index.js';
33
35
  export { PrevNextPage } from './components/PrevNextPage/index.js';
34
36
  export { ReadPercent } from './components/ReadPercent/index.js';
37
+ export { useReadPercent } from './components/ReadPercent/useReadPercent.js';
35
38
  export { Root, type RootProps } from './components/Root/index.js';
36
39
  export { Search } from './components/Search/index.js';
37
40
  export type { AfterSearch, BeforeSearch, CustomMatchResult, DefaultMatchResult, DefaultMatchResultItem, HighlightInfo, MatchResult, OnSearch, PageSearcherConfig, RenderSearchFunction, SearchOptions, UserMatchResultItem, } from './components/Search/logic/types.js';
@@ -40,11 +43,11 @@ export { SearchButton, type SearchButtonProps, } from './components/Search/Searc
40
43
  export { SearchPanel, type SearchPanelProps, } from './components/Search/SearchPanel.js';
41
44
  export { Sidebar, SidebarList } from './components/Sidebar/index.js';
42
45
  export { SocialLinks } from './components/SocialLinks/index.js';
43
- export { SourceCode } from './components/SourceCode/index.js';
46
+ export { SourceCode, type SourceCodeProps, } from './components/SourceCode/index.js';
44
47
  export { Steps } from './components/Steps/index.js';
45
- export { SvgWrapper } from './components/SvgWrapper/index.js';
48
+ export { SvgWrapper, type SvgWrapperProps, } from './components/SvgWrapper/index.js';
46
49
  export { SwitchAppearance } from './components/SwitchAppearance/index.js';
47
- export { Tab, Tabs } from './components/Tabs/index.js';
50
+ export { Tab, type TabProps, Tabs, type TabsProps, } from './components/Tabs/index.js';
48
51
  export { Tag } from './components/Tag/index.js';
49
52
  export { Toc } from './components/Toc/index.js';
50
53
  export { useActiveAnchor } from './hooks/useActiveAnchor.js';
@@ -21,6 +21,8 @@ import { LastUpdated } from "./components/LastUpdated/index.js";
21
21
  import { Link } from "./components/Link/index.js";
22
22
  import { useLinkNavigate } from "./components/Link/useLinkNavigate.js";
23
23
  import { LlmsContainer, LlmsCopyButton, LlmsViewOptions, useMdUrl } from "./components/Llms/index.js";
24
+ import { LlmsCopyRow } from "./components/Llms/LlmsCopyRow.js";
25
+ import { LlmsOpenRow } from "./components/Llms/LlmsOpenRow.js";
24
26
  import { Nav } from "./components/Nav/index.js";
25
27
  import { NavHamburger } from "./components/NavHamburger/index.js";
26
28
  import { NavTitle } from "./components/NavTitle/index.js";
@@ -31,6 +33,7 @@ import { PackageManagerTabs } from "./components/PackageManagerTabs/index.js";
31
33
  import { PageTab, PageTabs } from "./components/PageTabs/index.js";
32
34
  import { PrevNextPage } from "./components/PrevNextPage/index.js";
33
35
  import { ReadPercent } from "./components/ReadPercent/index.js";
36
+ import { useReadPercent } from "./components/ReadPercent/useReadPercent.js";
34
37
  import { Root } from "./components/Root/index.js";
35
38
  import { Search } from "./components/Search/index.js";
36
39
  import { RenderType } from "./components/Search/logic/types.js";
@@ -62,4 +65,4 @@ import { useStorageValue } from "./logic/useStorageValue.js";
62
65
  import { useThemeState } from "./logic/useThemeState.js";
63
66
  import { parseInlineMarkdownText, renderHtmlOrText, renderInlineMarkdown } from "./logic/utils.js";
64
67
  export * from "./icons.js";
65
- export { Badge, Banner, Button, Callout, CodeBlock, CodeBlockRuntime, CodeButtonGroup, DocContent, DocFooter, DocLayout, EditLink, FallbackHeading, HomeBackground, HomeFeature, HomeFooter, HomeHero, HomeLayout, HoverGroup, LastUpdated, Layout, Link, LlmsContainer, LlmsCopyButton, LlmsViewOptions, Nav, NavHamburger, NavTitle, NotFoundLayout, Outline, Overview, OverviewGroup, PackageManagerTabs, PageTab, PageTabs, PrevNextPage, ReadPercent, RenderType, Root, Search, SearchButton, SearchPanel, Sidebar, SidebarList, SocialLinks, SourceCode, Steps, SvgWrapper, SwitchAppearance, Tab, Tabs, Tag, Toc, getCustomMDXComponent, mergeRefs, parseInlineMarkdownText, renderHtmlOrText, renderInlineMarkdown, useActiveAnchor, useCodeButtonGroup, useDynamicToc, useEditLink, useFullTextSearch, useHoverGroup, useLinkNavigate, useMdUrl, usePrevNextPage, useRedirect4FirstVisit, useScrollAfterNav, useScrollReset, useSetup, useStorageValue, useThemeState, useWatchToc };
68
+ export { Badge, Banner, Button, Callout, CodeBlock, CodeBlockRuntime, CodeButtonGroup, DocContent, DocFooter, DocLayout, EditLink, FallbackHeading, HomeBackground, HomeFeature, HomeFooter, HomeHero, HomeLayout, HoverGroup, LastUpdated, Layout, Link, LlmsContainer, LlmsCopyButton, LlmsCopyRow, LlmsOpenRow, LlmsViewOptions, Nav, NavHamburger, NavTitle, NotFoundLayout, Outline, Overview, OverviewGroup, PackageManagerTabs, PageTab, PageTabs, PrevNextPage, ReadPercent, RenderType, Root, Search, SearchButton, SearchPanel, Sidebar, SidebarList, SocialLinks, SourceCode, Steps, SvgWrapper, SwitchAppearance, Tab, Tabs, Tag, Toc, getCustomMDXComponent, mergeRefs, parseInlineMarkdownText, renderHtmlOrText, renderInlineMarkdown, useActiveAnchor, useCodeButtonGroup, useDynamicToc, useEditLink, useFullTextSearch, useHoverGroup, useLinkNavigate, useMdUrl, usePrevNextPage, useReadPercent, useRedirect4FirstVisit, useScrollAfterNav, useScrollReset, useSetup, useStorageValue, useThemeState, useWatchToc };
@@ -77,12 +77,11 @@
77
77
  margin-top: var(--rp-sidebar-menu-height);
78
78
  z-index: var(--rp-z-index-aside);
79
79
  padding-top: var(--rp-content-padding-y);
80
- scrollbar-width: none;
81
- max-height: calc(100vh - var(--rp-nav-height) - var(--rp-banner-height, 0px));
80
+ height: calc(100vh - var(--rp-nav-height) - var(--rp-banner-height, 0px));
82
81
  box-shadow: var(--rp-shadow-1);
83
82
  position: sticky;
84
83
  right: 0;
85
- overflow: hidden scroll;
84
+ overflow: hidden;
86
85
  }
87
86
 
88
87
  .rp-doc-layout__menu {
@@ -142,6 +141,7 @@
142
141
  backdrop-filter: blur(25px);
143
142
  border-radius: var(--rp-radius-small);
144
143
  max-width: 100%;
144
+ height: auto;
145
145
  box-shadow: var(--rp-shadow-2);
146
146
  visibility: hidden;
147
147
  opacity: 0;
@@ -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, {
@@ -43,6 +43,10 @@ body {
43
43
  text-autospace: normal;
44
44
  }
45
45
 
46
+ pre {
47
+ text-autospace: no-autospace;
48
+ }
49
+
46
50
  :root #nprogress .bar {
47
51
  background: var(--rp-c-brand);
48
52
  }
@@ -42,6 +42,12 @@
42
42
  "left",
43
43
  "right"
44
44
  ]
45
+ },
46
+ "lang": {
47
+ "type": "string"
48
+ },
49
+ "rel": {
50
+ "type": "string"
45
51
  }
46
52
  },
47
53
  "required": [
@@ -105,6 +111,12 @@
105
111
  "left",
106
112
  "right"
107
113
  ]
114
+ },
115
+ "lang": {
116
+ "type": "string"
117
+ },
118
+ "rel": {
119
+ "type": "string"
108
120
  }
109
121
  },
110
122
  "required": [