@rspress/core 2.0.5 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/0~1402.js +1 -0
- package/dist/{0~7675.423f6a06.js → 0~execa.js} +6 -5
- package/dist/1361.js +5 -0
- package/dist/1965.js +7 -0
- package/dist/4454.js +8 -0
- package/dist/{7744.421b464f.js → 4524.js} +20 -5
- package/dist/7397.js +18 -0
- package/dist/{5485.0bb24594.js → 8311.js} +5 -2
- package/dist/8474.js +4 -0
- package/dist/8885.js +4 -0
- package/dist/cli/index.js +2 -3
- package/dist/config/loadConfigFile.js +1 -2
- package/dist/eject-theme/components/Banner/index.tsx +1 -1
- package/dist/eject-theme/components/Button/index.tsx +1 -1
- package/dist/eject-theme/components/CodeBlock/index.scss +54 -1
- package/dist/eject-theme/components/CodeBlock/index.tsx +77 -7
- package/dist/eject-theme/components/CodeBlockRuntime/index.tsx +12 -2
- package/dist/eject-theme/components/CodeButtonGroup/CopyCodeButton.tsx +1 -1
- package/dist/eject-theme/components/CodeButtonGroup/index.tsx +15 -15
- package/dist/eject-theme/components/DocContent/docComponents/a.tsx +1 -1
- package/dist/eject-theme/components/DocContent/docComponents/pre.tsx +5 -1
- package/dist/eject-theme/components/DocContent/docComponents/title.tsx +6 -1
- package/dist/eject-theme/components/DocContent/index.tsx +1 -1
- package/dist/eject-theme/components/DocFooter/index.tsx +1 -1
- package/dist/eject-theme/components/EditLink/index.tsx +1 -1
- package/dist/eject-theme/components/FallbackHeading/index.tsx +4 -1
- package/dist/eject-theme/components/HomeFeature/index.tsx +5 -1
- package/dist/eject-theme/components/HomeFooter/index.tsx +1 -1
- package/dist/eject-theme/components/HomeHero/index.tsx +2 -2
- package/dist/eject-theme/components/HoverGroup/index.tsx +5 -2
- package/dist/eject-theme/components/Link/useLinkNavigate.ts +1 -1
- package/dist/eject-theme/components/Llms/LlmsCopyButton.tsx +3 -2
- package/dist/eject-theme/components/Llms/LlmsCopyRow.tsx +3 -2
- package/dist/eject-theme/components/Llms/LlmsOpenRow.tsx +1 -1
- package/dist/eject-theme/components/Llms/LlmsViewOptions.tsx +3 -2
- package/dist/eject-theme/components/Llms/copy.ts +12 -0
- package/dist/eject-theme/components/Nav/NavMenu.tsx +9 -2
- package/dist/eject-theme/components/Nav/index.tsx +1 -1
- package/dist/eject-theme/components/NavHamburger/index.tsx +6 -1
- package/dist/eject-theme/components/NavScreen/NavScreenAppearance.tsx +1 -1
- package/dist/eject-theme/components/NavScreen/NavScreenLangs.tsx +1 -1
- package/dist/eject-theme/components/NavScreen/NavScreenMenuItem.tsx +5 -1
- package/dist/eject-theme/components/NavScreen/NavScreenMenuOthers.tsx +1 -1
- package/dist/eject-theme/components/NavScreen/NavScreenVersions.tsx +1 -1
- package/dist/eject-theme/components/NavScreen/index.tsx +1 -1
- package/dist/eject-theme/components/NavTitle/index.tsx +1 -1
- package/dist/eject-theme/components/Outline/ScrollToTop.tsx +5 -1
- package/dist/eject-theme/components/Outline/index.tsx +1 -1
- package/dist/eject-theme/components/Overview/index.tsx +1 -1
- package/dist/eject-theme/components/OverviewGroup/index.tsx +2 -2
- package/dist/eject-theme/components/PackageManagerTabs/index.tsx +1 -1
- package/dist/eject-theme/components/PrevNextPage/index.tsx +1 -1
- package/dist/eject-theme/components/Root/index.tsx +1 -1
- package/dist/eject-theme/components/Search/NoSearchResult.tsx +1 -1
- package/dist/eject-theme/components/Search/SearchButton.tsx +1 -1
- package/dist/eject-theme/components/Search/SearchPanel.tsx +3 -1
- package/dist/eject-theme/components/Search/SuggestItem.tsx +1 -1
- package/dist/eject-theme/components/Search/index.tsx +1 -1
- package/dist/eject-theme/components/Sidebar/SidebarGroup.tsx +5 -1
- package/dist/eject-theme/components/Sidebar/SidebarItem.scss +0 -4
- package/dist/eject-theme/components/Sidebar/SidebarItem.tsx +1 -1
- package/dist/eject-theme/components/Sidebar/SidebarSectionHeader.tsx +1 -1
- package/dist/eject-theme/components/SidebarMenu/index.tsx +1 -1
- package/dist/eject-theme/components/SocialLinks/index.tsx +1 -1
- package/dist/eject-theme/components/SourceCode/index.tsx +1 -1
- package/dist/eject-theme/components/SvgWrapper/index.tsx +1 -1
- package/dist/eject-theme/components/SwitchAppearance/index.tsx +1 -1
- package/dist/eject-theme/components/Tabs/index.scss +13 -15
- package/dist/eject-theme/components/Tabs/index.tsx +1 -1
- package/dist/eject-theme/components/Tag/index.tsx +1 -1
- package/dist/eject-theme/components/Toc/TocItem.tsx +5 -1
- package/dist/eject-theme/components/Toc/index.tsx +1 -1
- package/dist/index.js +1 -3
- package/dist/node/PluginDriver.js +3 -8
- package/dist/node/auto-nav-sidebar/index.js +1 -2
- package/dist/node/auto-nav-sidebar/locales.js +1 -1
- package/dist/node/auto-nav-sidebar/normalize.js +3 -2
- package/dist/node/auto-nav-sidebar/utils.js +1 -2
- package/dist/node/auto-nav-sidebar/walk.js +1 -2
- package/dist/node/constants.js +1 -2
- package/dist/node/eject.js +1 -1
- package/dist/node/initRsbuild.js +2 -4
- package/dist/node/last-updated/index.js +1 -1
- package/dist/node/logger/hint.js +4 -1
- package/dist/node/mdx/options.js +1 -3
- package/dist/node/mdx/processor.js +1 -2
- package/dist/node/mdx/rehypePlugins/codeMeta.js +1 -1
- package/dist/node/mdx/rehypePlugins/headerAnchor.js +1 -2
- package/dist/node/mdx/rehypePlugins/shiki.d.ts +1 -1
- package/dist/node/mdx/rehypePlugins/shiki.js +2 -1
- package/dist/node/mdx/rehypePlugins/transformers/add-fold.d.ts +6 -0
- package/dist/node/mdx/rehypePlugins/transformers/add-fold.js +38 -0
- package/dist/node/mdx/rehypePlugins/transformers/index.d.ts +1 -0
- package/dist/node/mdx/rehypePlugins/transformers/index.js +1 -0
- package/dist/node/mdx/rehypePlugins/transformers/meta-highlight.js +1 -1
- package/dist/node/mdx/remarkPlugins/builtin.js +1 -1
- package/dist/node/mdx/remarkPlugins/fileCodeBlock.js +1 -2
- package/dist/node/mdx/remarkPlugins/image.js +1 -1
- package/dist/node/mdx/remarkPlugins/link.js +1 -2
- package/dist/node/mdx/remarkPlugins/toc.js +1 -1
- package/dist/node/medium-zoom/index.js +1 -1
- package/dist/node/route/RoutePage.js +1 -1
- package/dist/node/route/RouteService.js +1 -3
- package/dist/node/route/extractPageData.js +1 -3
- package/dist/node/route/normalizeRoutePath.js +1 -2
- package/dist/node/runtimeModule/i18n.js +2 -3
- package/dist/node/runtimeModule/pageData/createPageData.js +1 -2
- package/dist/node/runtimeModule/pageData/rsbuildPlugin.js +1 -2
- package/dist/node/runtimeModule/searchHooks.js +1 -1
- package/dist/node/runtimeModule/siteData/createSiteData.js +1 -1
- package/dist/node/runtimeModule/siteData/normalizeThemeConfig.js +1 -1
- package/dist/node/runtimeModule/siteData/rsbuildPlugin.js +1 -1
- package/dist/node/serve.js +1 -1
- package/dist/node/ssg/renderPage.js +1 -2
- package/dist/node/ssg/renderPageWorker.js +2 -2
- package/dist/node/ssg/renderPages.js +3 -4
- package/dist/node/ssg/rsbuildPluginSSG.js +1 -2
- package/dist/node/ssg/ssgEnv.d.ts +1 -1
- package/dist/node/ssg/ssgEnv.js +2 -2
- package/dist/node/ssg-md/llms/emitLlmsTxt.js +5 -7
- package/dist/node/ssg-md/llms/llmsTxt.js +1 -2
- package/dist/node/ssg-md/remarkSplitMdx.js +1 -2
- package/dist/node/ssg-md/renderPage.js +1 -2
- package/dist/node/ssg-md/renderPages.js +2 -2
- package/dist/node/ssg-md/rsbuildPluginSSGMD.js +1 -2
- package/dist/node/utils/checkLanguageParity.js +1 -1
- package/dist/node/utils/createHash.js +1 -1
- package/dist/node/utils/error.js +1 -1
- package/dist/node/utils/flattenMdxContent.js +1 -3
- package/dist/node/utils/fs.js +1 -1
- package/dist/node/utils/getPageKey.js +1 -1
- package/dist/node/utils/normalizePath.js +1 -2
- package/dist/node/utils/reactAlias.js +15 -10
- package/dist/runtime/index.js +20 -21
- package/dist/runtime/ssrMdServerEntry.js +2 -2
- package/dist/runtime/ssrServerEntry.js +2 -2
- package/dist/runtime/utils.d.ts +1 -1
- package/dist/runtime/utils.js +1 -1
- package/dist/shiki-transformers.js +1 -0
- package/dist/theme/assets/arrow-down.js +1 -1
- package/dist/theme/assets/arrow-right.js +1 -1
- package/dist/theme/assets/close.js +1 -1
- package/dist/theme/assets/copy.js +1 -1
- package/dist/theme/assets/deprecated.js +1 -1
- package/dist/theme/assets/down.js +1 -1
- package/dist/theme/assets/edit.js +1 -1
- package/dist/theme/assets/empty.js +1 -1
- package/dist/theme/assets/experimental.js +1 -1
- package/dist/theme/assets/external-link.js +1 -1
- package/dist/theme/assets/file.js +1 -1
- package/dist/theme/assets/github.js +1 -1
- package/dist/theme/assets/gitlab.js +1 -1
- package/dist/theme/assets/header.js +1 -1
- package/dist/theme/assets/jump.js +1 -1
- package/dist/theme/assets/link.js +1 -1
- package/dist/theme/assets/loading.js +1 -1
- package/dist/theme/assets/menu.js +1 -1
- package/dist/theme/assets/moon.js +1 -1
- package/dist/theme/assets/scroll-to-top.js +1 -1
- package/dist/theme/assets/search.js +1 -1
- package/dist/theme/assets/small-menu.js +1 -1
- package/dist/theme/assets/success.js +1 -1
- package/dist/theme/assets/sun.js +1 -1
- package/dist/theme/assets/title.js +1 -1
- package/dist/theme/assets/wrap.js +1 -1
- package/dist/theme/assets/wrapped.js +1 -1
- package/dist/theme/components/Banner/index.js +1 -1
- package/dist/theme/components/Button/index.js +1 -1
- package/dist/theme/components/Callout/index.js +2 -1
- package/dist/theme/components/CodeBlock/index.css +49 -1
- package/dist/theme/components/CodeBlock/index.d.ts +11 -3
- package/dist/theme/components/CodeBlock/index.js +51 -6
- package/dist/theme/components/CodeBlockRuntime/index.d.ts +2 -2
- package/dist/theme/components/CodeBlockRuntime/index.js +10 -2
- package/dist/theme/components/CodeButtonGroup/CopyCodeButton.js +1 -1
- package/dist/theme/components/CodeButtonGroup/index.d.ts +6 -6
- package/dist/theme/components/CodeButtonGroup/index.js +10 -10
- package/dist/theme/components/DocContent/docComponents/a.js +1 -1
- package/dist/theme/components/DocContent/docComponents/pre.d.ts +2 -2
- package/dist/theme/components/DocContent/docComponents/pre.js +4 -2
- package/dist/theme/components/DocContent/docComponents/title.js +1 -1
- package/dist/theme/components/DocContent/index.js +1 -1
- package/dist/theme/components/DocFooter/index.js +1 -1
- package/dist/theme/components/EditLink/index.js +1 -1
- package/dist/theme/components/FallbackHeading/index.js +1 -1
- package/dist/theme/components/HomeBackground/index.css +1 -0
- package/dist/theme/components/HomeFeature/index.css +3 -3
- package/dist/theme/components/HomeFeature/index.js +1 -1
- package/dist/theme/components/HomeFooter/index.js +1 -1
- package/dist/theme/components/HomeHero/index.d.ts +1 -1
- package/dist/theme/components/HomeHero/index.js +1 -1
- package/dist/theme/components/HoverGroup/index.d.ts +1 -1
- package/dist/theme/components/HoverGroup/index.js +4 -1
- package/dist/theme/components/Link/useLinkNavigate.d.ts +1 -1
- package/dist/theme/components/Llms/LlmsCopyButton.js +4 -3
- package/dist/theme/components/Llms/LlmsCopyRow.js +3 -2
- package/dist/theme/components/Llms/LlmsOpenRow.js +1 -1
- package/dist/theme/components/Llms/LlmsViewOptions.js +4 -3
- package/dist/theme/components/Llms/copy.d.ts +1 -0
- package/dist/theme/components/Llms/copy.js +9 -0
- package/dist/theme/components/Llms/index.css +1 -0
- package/dist/theme/components/Llms/index.js +4 -5
- package/dist/theme/components/Nav/NavMenu.d.ts +1 -1
- package/dist/theme/components/Nav/NavMenu.js +2 -1
- package/dist/theme/components/Nav/index.css +1 -1
- package/dist/theme/components/Nav/index.js +1 -1
- package/dist/theme/components/NavHamburger/index.js +1 -1
- package/dist/theme/components/NavScreen/NavScreenAppearance.js +1 -1
- package/dist/theme/components/NavScreen/NavScreenLangs.js +1 -1
- package/dist/theme/components/NavScreen/NavScreenMenuItem.d.ts +2 -1
- package/dist/theme/components/NavScreen/NavScreenMenuItem.js +4 -2
- package/dist/theme/components/NavScreen/NavScreenMenuOthers.js +1 -1
- package/dist/theme/components/NavScreen/NavScreenVersions.js +1 -1
- package/dist/theme/components/NavScreen/index.css +1 -1
- package/dist/theme/components/NavScreen/index.js +1 -1
- package/dist/theme/components/NavTitle/index.js +1 -1
- package/dist/theme/components/Outline/ScrollToTop.js +1 -1
- package/dist/theme/components/Outline/index.js +1 -1
- package/dist/theme/components/Overview/index.d.ts +1 -1
- package/dist/theme/components/Overview/index.js +1 -1
- package/dist/theme/components/OverviewGroup/icons/plugin.js +1 -1
- package/dist/theme/components/OverviewGroup/index.css +1 -0
- package/dist/theme/components/OverviewGroup/index.js +1 -1
- package/dist/theme/components/PackageManagerTabs/index.js +1 -1
- package/dist/theme/components/PrevNextPage/index.js +1 -1
- package/dist/theme/components/Root/index.d.ts +1 -1
- package/dist/theme/components/Search/NoSearchResult.js +1 -1
- package/dist/theme/components/Search/SearchButton.js +1 -1
- package/dist/theme/components/Search/SearchPanel.js +3 -2
- package/dist/theme/components/Search/SuggestItem.js +1 -1
- package/dist/theme/components/Search/index.js +1 -1
- package/dist/theme/components/Search/logic/providers/LocalProvider.js +1 -1
- package/dist/theme/components/Sidebar/SidebarGroup.js +1 -1
- package/dist/theme/components/Sidebar/SidebarItem.css +0 -4
- package/dist/theme/components/Sidebar/SidebarItem.js +1 -1
- package/dist/theme/components/Sidebar/SidebarSectionHeader.js +1 -1
- package/dist/theme/components/SidebarMenu/index.js +1 -1
- package/dist/theme/components/SocialLinks/index.js +1 -1
- package/dist/theme/components/SourceCode/index.js +1 -1
- package/dist/theme/components/SvgWrapper/index.js +1 -1
- package/dist/theme/components/SwitchAppearance/index.js +1 -1
- package/dist/theme/components/Tabs/index.css +14 -8
- package/dist/theme/components/Tabs/index.js +1 -1
- package/dist/theme/components/Tag/index.js +1 -1
- package/dist/theme/components/Toc/TocItem.css +1 -1
- package/dist/theme/components/Toc/TocItem.js +1 -1
- package/dist/theme/components/Toc/index.js +1 -1
- package/dist/theme/index.js +66 -67
- package/dist/theme/layout/DocLayout/index.css +11 -11
- package/dist/theme/layout/DocLayout/index.js +1 -1
- package/dist/theme/layout/HomeLayout/index.js +1 -1
- package/dist/theme/layout/Layout/index.d.ts +2 -2
- package/dist/theme/layout/Layout/index.js +16 -6
- package/dist/theme/layout/NotFountLayout/index.js +1 -1
- package/dist/theme/styles/base.css +7 -4
- package/dist/theme/styles/preflight.css +2 -0
- package/dist/theme/styles/vars/home-vars.css +28 -4
- package/nav-json-schema.json +3 -0
- package/package.json +14 -14
- package/dist/6289.29817fb4.js +0 -4
- package/dist/9348.1beb3e25.js +0 -11
- package/dist/cli/index.44f3184c.js +0 -2
- package/dist/node/mdx/loader.15134034.js +0 -9
- /package/dist/{node/ssg/renderPageWorker.165b5d46.js → 9224.js} +0 -0
- /package/dist/{rslib-runtime.99091bf6.js → rslib-runtime.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { NavItemWithChildren } from '@rspress/core';
|
|
2
2
|
import { matchNavbar, useLocation } from '@rspress/core/runtime';
|
|
3
|
-
import { Link, Tag } from '@theme';
|
|
3
|
+
import { Link, Tag } from '@rspress/core/theme';
|
|
4
4
|
import cls from 'clsx';
|
|
5
5
|
|
|
6
6
|
import './index.scss';
|
|
@@ -44,6 +44,7 @@ function HoverGroupItem({
|
|
|
44
44
|
>
|
|
45
45
|
<Link
|
|
46
46
|
href={item.link}
|
|
47
|
+
download={'download' in item ? item.download : undefined}
|
|
47
48
|
aria-label={item.text}
|
|
48
49
|
className="rp-hover-group__item__link"
|
|
49
50
|
lang={item.lang}
|
|
@@ -69,6 +70,7 @@ function HoverGroupItem({
|
|
|
69
70
|
|
|
70
71
|
if ('link' in item) {
|
|
71
72
|
const { text, link, lang, rel } = item;
|
|
73
|
+
const download = 'download' in item ? item.download : undefined;
|
|
72
74
|
const isActiveItem = activeMatcher
|
|
73
75
|
? activeMatcher(item)
|
|
74
76
|
: matchNavbar(item, pathname);
|
|
@@ -85,6 +87,7 @@ function HoverGroupItem({
|
|
|
85
87
|
{link ? (
|
|
86
88
|
<Link
|
|
87
89
|
href={link}
|
|
90
|
+
download={download}
|
|
88
91
|
aria-label={text}
|
|
89
92
|
className="rp-hover-group__item__link"
|
|
90
93
|
lang={lang}
|
|
@@ -147,5 +150,5 @@ function HoverGroup({
|
|
|
147
150
|
);
|
|
148
151
|
}
|
|
149
152
|
|
|
150
|
-
export { HoverGroup };
|
|
151
153
|
export type { HoverGroupProps, Items };
|
|
154
|
+
export { HoverGroup };
|
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
6
|
import { useI18n } from '@rspress/core/runtime';
|
|
7
|
-
import { IconCopy, IconSuccess } from '@theme';
|
|
7
|
+
import { IconCopy, IconSuccess } from '@rspress/core/theme';
|
|
8
8
|
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
|
|
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
|
-
import { IconCopy, IconSuccess, SvgWrapper } from '@theme';
|
|
2
|
+
import { IconCopy, IconSuccess, SvgWrapper } from '@rspress/core/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
|
|
23
|
+
await copyToClipboard(content);
|
|
23
24
|
} finally {
|
|
24
25
|
setLoading(false);
|
|
25
26
|
setFinished(true);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useI18n, useSite } from '@rspress/core/runtime';
|
|
2
|
-
import { IconExternalLink, SvgWrapper } from '@theme';
|
|
2
|
+
import { IconExternalLink, SvgWrapper } from '@rspress/core/theme';
|
|
3
3
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
4
4
|
import './LlmsOpenRow.scss';
|
|
5
5
|
import './LlmsViewOptions.scss';
|
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
6
|
import { useI18n, useSite } from '@rspress/core/runtime';
|
|
7
|
-
import { IconDown, IconExternalLink, IconLink } from '@theme';
|
|
7
|
+
import { IconDown, IconExternalLink, IconLink } from '@rspress/core/theme';
|
|
8
8
|
import type React from 'react';
|
|
9
9
|
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
|
-
|
|
102
|
+
void copyToClipboard(fullMarkdownUrl);
|
|
102
103
|
},
|
|
103
104
|
},
|
|
104
105
|
chatgpt: {
|
|
@@ -5,8 +5,14 @@ import type {
|
|
|
5
5
|
NavItemWithLinkAndChildren,
|
|
6
6
|
} from '@rspress/core';
|
|
7
7
|
import { matchNavbar, useLocation } from '@rspress/core/runtime';
|
|
8
|
-
import type { HoverGroupProps } from '@theme';
|
|
9
|
-
import {
|
|
8
|
+
import type { HoverGroupProps } from '@rspress/core/theme';
|
|
9
|
+
import {
|
|
10
|
+
IconArrowDown,
|
|
11
|
+
Link,
|
|
12
|
+
SvgWrapper,
|
|
13
|
+
Tag,
|
|
14
|
+
useHoverGroup,
|
|
15
|
+
} from '@rspress/core/theme';
|
|
10
16
|
import cls from 'clsx';
|
|
11
17
|
import { type ReactNode, useMemo } from 'react';
|
|
12
18
|
import { useLangsMenu, useVersionsMenu } from './hooks';
|
|
@@ -29,6 +35,7 @@ export function NavMenuItemInner({
|
|
|
29
35
|
{'link' in menuItem && typeof menuItem.link === 'string' ? (
|
|
30
36
|
<Link
|
|
31
37
|
href={menuItem.link}
|
|
38
|
+
download={menuItem.download}
|
|
32
39
|
className="rp-nav-menu__item__container"
|
|
33
40
|
hrefLang={menuItem.lang}
|
|
34
41
|
lang={menuItem.lang}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
IconSmallMenu,
|
|
3
|
+
SocialLinks,
|
|
4
|
+
SvgWrapper,
|
|
5
|
+
useHoverGroup,
|
|
6
|
+
} from '@rspress/core/theme';
|
|
2
7
|
import clsx from 'clsx';
|
|
3
8
|
import { createPortal } from 'react-dom';
|
|
4
9
|
import { NavVersions } from '../Nav/NavMenu';
|
|
@@ -2,7 +2,7 @@ import { useState } from 'react';
|
|
|
2
2
|
import { useLangsMenu } from '../Nav/hooks';
|
|
3
3
|
import './NavScreenLangs.scss';
|
|
4
4
|
import { useI18n } from '@rspress/core/runtime';
|
|
5
|
-
import { Link } from '@theme';
|
|
5
|
+
import { Link } from '@rspress/core/theme';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { SvgDown } from './NavScreenMenuItem';
|
|
8
8
|
|
|
@@ -5,7 +5,7 @@ import type {
|
|
|
5
5
|
NavItemWithLinkAndChildren,
|
|
6
6
|
} from '@rspress/core';
|
|
7
7
|
import { matchNavbar, useLocation } from '@rspress/core/runtime';
|
|
8
|
-
import { IconArrowDown, Link, SvgWrapper, Tag } from '@theme';
|
|
8
|
+
import { IconArrowDown, Link, SvgWrapper, Tag } from '@rspress/core/theme';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
10
|
import type React from 'react';
|
|
11
11
|
import { useMemo, useState } from 'react';
|
|
@@ -26,6 +26,7 @@ export function NavScreenMenuItemRaw({
|
|
|
26
26
|
isActive,
|
|
27
27
|
onClick,
|
|
28
28
|
href,
|
|
29
|
+
download,
|
|
29
30
|
}: {
|
|
30
31
|
left: React.ReactNode;
|
|
31
32
|
right: React.ReactNode;
|
|
@@ -33,6 +34,7 @@ export function NavScreenMenuItemRaw({
|
|
|
33
34
|
isActive?: boolean;
|
|
34
35
|
onClick?: () => void;
|
|
35
36
|
href?: string;
|
|
37
|
+
download?: boolean;
|
|
36
38
|
}) {
|
|
37
39
|
if (href) {
|
|
38
40
|
return (
|
|
@@ -44,6 +46,7 @@ export function NavScreenMenuItemRaw({
|
|
|
44
46
|
isActive && 'rp-nav-screen-menu-item--active',
|
|
45
47
|
)}
|
|
46
48
|
onClick={onClick}
|
|
49
|
+
download={download}
|
|
47
50
|
>
|
|
48
51
|
<div className="rp-nav-screen-menu-item__left">{left}</div>
|
|
49
52
|
<div className="rp-nav-screen-menu-item__right">{right}</div>
|
|
@@ -84,6 +87,7 @@ export function NavScreenMenuItemWithLink({
|
|
|
84
87
|
}
|
|
85
88
|
right={null}
|
|
86
89
|
href={menuItem.link}
|
|
90
|
+
download={menuItem.download}
|
|
87
91
|
isActive={isActive}
|
|
88
92
|
/>
|
|
89
93
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NoSSR, useSite } from '@rspress/core/runtime';
|
|
2
|
-
import { SocialLinks, SwitchAppearance } from '@theme';
|
|
2
|
+
import { SocialLinks, SwitchAppearance } from '@rspress/core/theme';
|
|
3
3
|
import './index.scss';
|
|
4
4
|
import { NavScreenLangs } from './NavScreenLangs';
|
|
5
5
|
import { NavScreenVersions } from './NavScreenVersions';
|
|
@@ -2,7 +2,7 @@ import { useState } from 'react';
|
|
|
2
2
|
import { useVersionsMenu } from '../Nav/hooks';
|
|
3
3
|
import './NavScreenVersions.scss';
|
|
4
4
|
import { useI18n } from '@rspress/core/runtime';
|
|
5
|
-
import { Link } from '@theme';
|
|
5
|
+
import { Link } from '@rspress/core/theme';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { SvgDown } from './NavScreenMenuItem';
|
|
8
8
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useNav } from '@rspress/core/runtime';
|
|
2
|
-
import { SocialLinks } from '@theme';
|
|
2
|
+
import { SocialLinks } from '@rspress/core/theme';
|
|
3
3
|
import { clearAllBodyScrollLocks, disableBodyScroll } from 'body-scroll-lock';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import { useEffect, useRef } from 'react';
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { useI18n } from '@rspress/core/runtime';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
IconScrollToTop,
|
|
4
|
+
SvgWrapper,
|
|
5
|
+
useReadPercent,
|
|
6
|
+
} from '@rspress/core/theme';
|
|
3
7
|
|
|
4
8
|
export function ScrollToTop() {
|
|
5
9
|
const scrollToTop = () => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Link, renderInlineMarkdown } from '@theme';
|
|
1
|
+
import { Link, renderInlineMarkdown } from '@rspress/core/theme';
|
|
2
2
|
import './index.scss';
|
|
3
3
|
import type { Header } from '@rspress/core';
|
|
4
4
|
import { routePathToMdPath } from '@rspress/core/runtime';
|
|
5
|
-
import { FallbackHeading, SvgWrapper } from '@theme';
|
|
5
|
+
import { FallbackHeading, SvgWrapper } from '@rspress/core/theme';
|
|
6
6
|
import { useMemo } from 'react';
|
|
7
7
|
import IconPlugin from './icons/plugin.svg';
|
|
8
8
|
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
Tab,
|
|
8
8
|
Tabs,
|
|
9
9
|
useLinkNavigate,
|
|
10
|
-
} from '@theme';
|
|
10
|
+
} from '@rspress/core/theme';
|
|
11
11
|
import { debounce } from 'lodash-es';
|
|
12
12
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
13
13
|
import { createPortal } from 'react-dom';
|
|
@@ -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
|
}
|
|
@@ -5,7 +5,11 @@ import type {
|
|
|
5
5
|
SidebarSectionHeader as SidebarSectionHeaderType,
|
|
6
6
|
} from '@rspress/core';
|
|
7
7
|
import { useActiveMatcher } from '@rspress/core/runtime';
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
IconArrowRight,
|
|
10
|
+
SvgWrapper,
|
|
11
|
+
useLinkNavigate,
|
|
12
|
+
} from '@rspress/core/theme';
|
|
9
13
|
import clsx from 'clsx';
|
|
10
14
|
import type React from 'react';
|
|
11
15
|
import { SidebarDivider } from './SidebarDivider';
|
|
@@ -3,7 +3,7 @@ import type {
|
|
|
3
3
|
SidebarItem as SidebarItemType,
|
|
4
4
|
} from '@rspress/core';
|
|
5
5
|
import { useActiveMatcher } from '@rspress/core/runtime';
|
|
6
|
-
import { Link, renderInlineMarkdown, Tag } from '@theme';
|
|
6
|
+
import { Link, renderInlineMarkdown, Tag } from '@rspress/core/theme';
|
|
7
7
|
import clsx from 'clsx';
|
|
8
8
|
import type React from 'react';
|
|
9
9
|
import { useEffect, useRef, useTransition } from 'react';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SocialLink } from '@rspress/core';
|
|
2
2
|
import { useSite } from '@rspress/core/runtime';
|
|
3
|
-
import { IconArrowDown, SvgWrapper } from '@theme';
|
|
3
|
+
import { IconArrowDown, SvgWrapper } from '@rspress/core/theme';
|
|
4
4
|
import './index.scss';
|
|
5
5
|
import { useHoverGroup } from '../HoverGroup/useHoverGroup';
|
|
6
6
|
import { SocialLink as SocialLinkComp } from './SocialLink';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ThemeContext, useSite } from '@rspress/core/runtime';
|
|
2
|
-
import { IconMoon, IconSun, SvgWrapper } from '@theme';
|
|
2
|
+
import { IconMoon, IconSun, SvgWrapper } from '@rspress/core/theme';
|
|
3
3
|
import { type MouseEvent, useContext } from 'react';
|
|
4
4
|
import './global.scss';
|
|
5
5
|
import './index.scss';
|
|
@@ -5,21 +5,8 @@
|
|
|
5
5
|
border: var(--rp-code-block-border);
|
|
6
6
|
box-shadow: var(--rp-code-block-shadow);
|
|
7
7
|
|
|
8
|
-
|
|
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
|
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { Header } from '@rspress/core';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Link,
|
|
4
|
+
parseInlineMarkdownText,
|
|
5
|
+
renderInlineMarkdown,
|
|
6
|
+
} from '@rspress/core/theme';
|
|
3
7
|
import clsx from 'clsx';
|
|
4
8
|
import './TocItem.scss';
|
|
5
9
|
import { useEffect, useRef } from 'react';
|
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 "./
|
|
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 "../
|
|
2
|
-
import { addTrailingSlash, addLeadingSlash } from "../9348.1beb3e25.js";
|
|
1
|
+
import { addTrailingSlash, node_path, addLeadingSlash } from "../4524.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")
|
|
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")
|
|
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 "../../
|
|
2
|
-
import { DEFAULT_PAGE_EXTENSIONS } from "../../7744.421b464f.js";
|
|
1
|
+
import { DEFAULT_PAGE_EXTENSIONS, node_path } from "../../4524.js";
|
|
3
2
|
import { processLocales, combineWalkResult } from "./locales.js";
|
|
4
3
|
import { walk } from "./walk.js";
|
|
5
4
|
async function runAutoNavSide(config, metaFileSet, mdFileSet) {
|