@rspress/core 2.0.0-rc.0 → 2.0.0-rc.2
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/bin/rspress.js +1 -1
- package/dist/0~7675.989ee664.js +1791 -0
- package/dist/1218.3869bad6.js +2 -0
- package/dist/4669.12208c6a.js +2 -0
- package/dist/5313.6594aba0.js +63 -0
- package/dist/5485.2a0273cf.js +98 -0
- package/dist/6289.c67fe0d5.js +5 -0
- package/dist/7805.cadab34e.js +4 -0
- package/dist/8813.9da1f210.js +2 -0
- package/dist/cli/config/index.js +4 -0
- package/dist/cli/config/loadConfigFile.js +30 -0
- package/dist/cli/index.cb89dbd1.js +3 -0
- package/dist/cli/index.js +122 -0
- package/dist/eject-theme/components/Banner/index.tsx +3 -4
- package/dist/eject-theme/components/Button/index.scss +1 -6
- package/dist/eject-theme/components/Callout/index.scss +0 -2
- package/dist/eject-theme/components/CodeBlock/index.scss +4 -12
- package/dist/eject-theme/components/CodeBlock/index.tsx +6 -1
- package/dist/eject-theme/components/CodeButtonGroup/CopyCodeButton.tsx +1 -3
- package/dist/eject-theme/components/CodeButtonGroup/index.scss +5 -1
- package/dist/eject-theme/components/CodeButtonGroup/index.tsx +1 -3
- package/dist/eject-theme/components/DocContent/doc.scss +30 -9
- package/dist/eject-theme/components/DocContent/docComponents/table.tsx +10 -4
- package/dist/eject-theme/components/DocContent/index.tsx +5 -2
- package/dist/eject-theme/components/{DocContent/FallbackHeading.tsx → FallbackHeading/index.tsx} +20 -11
- package/dist/eject-theme/components/HoverGroup/index.scss +5 -1
- package/dist/eject-theme/components/HoverGroup/index.tsx +5 -1
- package/dist/eject-theme/components/Link/index.tsx +43 -9
- package/dist/eject-theme/components/Link/useLinkNavigate.ts +32 -16
- package/dist/eject-theme/components/Nav/NavMenu.scss +1 -0
- package/dist/eject-theme/components/Nav/NavMenu.tsx +2 -3
- package/dist/eject-theme/components/Nav/NavTitle.scss +11 -0
- package/dist/eject-theme/components/Nav/NavTitle.tsx +1 -0
- package/dist/eject-theme/components/Nav/index.scss +0 -8
- package/dist/eject-theme/components/NavHamburger/index.tsx +3 -4
- package/dist/eject-theme/components/NavScreen/NavScreenMenuItem.scss +14 -0
- package/dist/eject-theme/components/NavScreen/NavScreenMenuItem.tsx +2 -3
- package/dist/eject-theme/components/Outline/index.scss +0 -1
- package/dist/eject-theme/components/Overview/OverviewGroup.tsx +1 -2
- package/dist/eject-theme/components/Overview/index.tsx +6 -2
- package/dist/eject-theme/components/PackageManagerTabs/index.tsx +12 -0
- package/dist/eject-theme/components/PrevNextPage/index.tsx +6 -3
- package/dist/eject-theme/components/Root/index.tsx +58 -0
- package/dist/eject-theme/components/Search/NoSearchResult.tsx +2 -3
- package/dist/eject-theme/components/Search/SearchButton.tsx +3 -4
- package/dist/eject-theme/components/Search/SearchPanel.tsx +14 -9
- package/dist/eject-theme/components/Search/SuggestItem.tsx +15 -12
- package/dist/eject-theme/components/Sidebar/SidebarGroup.tsx +2 -3
- package/dist/eject-theme/components/Sidebar/SidebarItem.scss +12 -8
- package/dist/eject-theme/components/Sidebar/SidebarItem.tsx +6 -4
- package/dist/eject-theme/components/Sidebar/SidebarSectionHeader.scss +1 -1
- package/dist/eject-theme/components/SidebarMenu/index.tsx +4 -4
- package/dist/eject-theme/components/SocialLinks/index.tsx +2 -3
- package/dist/eject-theme/components/SourceCode/index.scss +2 -1
- package/dist/eject-theme/components/SourceCode/index.tsx +6 -4
- package/dist/eject-theme/components/SwitchAppearance/index.tsx +3 -5
- package/dist/eject-theme/components/Tabs/index.scss +19 -22
- package/dist/eject-theme/components/Toc/TocItem.scss +8 -4
- package/dist/eject-theme/components/Toc/TocItem.tsx +1 -0
- package/dist/index.d.ts +6 -6
- package/dist/index.js +16 -3134
- package/dist/node/PluginDriver.d.ts +1 -1
- package/dist/node/PluginDriver.js +143 -0
- package/dist/node/auto-nav-sidebar/index.js +44 -0
- package/dist/node/auto-nav-sidebar/locales.js +26 -0
- package/dist/node/auto-nav-sidebar/normalize.js +228 -0
- package/dist/node/auto-nav-sidebar/utils.js +68 -0
- package/dist/node/auto-nav-sidebar/walk.js +67 -0
- package/dist/node/build.js +31 -0
- package/dist/node/constants.d.ts +1 -0
- package/dist/node/constants.js +33 -0
- package/dist/node/dev.js +32 -0
- package/dist/node/eject.js +111 -0
- package/dist/node/index.d.ts +5 -5
- package/dist/node/initRsbuild.d.ts +2 -2
- package/dist/node/initRsbuild.js +338 -0
- package/dist/node/last-updated/index.js +28 -0
- package/dist/node/logger/hint.d.ts +1 -1
- package/dist/node/logger/hint.js +85 -0
- package/dist/node/mdx/loader.d.ts +1 -1
- package/dist/node/mdx/loader.e1578c62.js +13 -0
- package/dist/{loader.js → node/mdx/loader.js} +2 -2
- package/dist/node/mdx/options.d.ts +2 -2
- package/dist/node/mdx/options.js +100 -0
- package/dist/node/mdx/processor.d.ts +2 -2
- package/dist/node/mdx/processor.js +71 -0
- package/dist/node/mdx/rehypePlugins/codeMeta.js +10 -0
- package/dist/node/mdx/rehypePlugins/headerAnchor.js +53 -0
- package/dist/node/mdx/rehypePlugins/shiki.js +34 -0
- package/dist/node/mdx/rehypePlugins/transformers/add-lang.js +15 -0
- package/dist/node/mdx/rehypePlugins/transformers/add-line-numbers.js +22 -0
- package/dist/node/mdx/rehypePlugins/transformers/add-title.js +24 -0
- package/dist/node/mdx/rehypePlugins/transformers/add-wrap-code.js +22 -0
- package/dist/node/mdx/rehypePlugins/transformers/index.d.ts +5 -5
- package/dist/node/mdx/rehypePlugins/transformers/index.js +5 -0
- package/dist/node/mdx/rehypePlugins/transformers/meta-highlight.js +41 -0
- package/dist/node/mdx/remarkPlugins/builtin.js +11 -0
- package/dist/node/mdx/remarkPlugins/containerSyntax.js +190 -0
- package/dist/node/mdx/remarkPlugins/fileCodeBlock.js +66 -0
- package/dist/node/mdx/remarkPlugins/image.js +67 -0
- package/dist/node/mdx/remarkPlugins/link.d.ts +1 -1
- package/dist/node/mdx/remarkPlugins/link.js +99 -0
- package/dist/node/mdx/remarkPlugins/toc.js +50 -0
- package/dist/node/mdx/types.d.ts +3 -3
- package/dist/node/medium-zoom/index.d.ts +1 -1
- package/dist/node/medium-zoom/index.js +14 -0
- package/dist/node/route/RoutePage.d.ts +1 -1
- package/dist/node/route/RoutePage.js +61 -0
- package/dist/node/route/RouteService.d.ts +1 -1
- package/dist/node/route/RouteService.js +177 -0
- package/dist/node/route/extractPageData.d.ts +1 -1
- package/dist/node/route/extractPageData.js +112 -0
- package/dist/node/route/normalizeRoutePath.js +54 -0
- package/dist/node/runtimeModule/DEFAULT_I18N_TEXT.d.ts +21 -0
- package/dist/node/runtimeModule/DEFAULT_I18N_TEXT.js +150 -0
- package/dist/node/runtimeModule/globalStyles.d.ts +1 -1
- package/dist/node/runtimeModule/globalStyles.js +12 -0
- package/dist/node/runtimeModule/globalUIComponents.d.ts +1 -1
- package/dist/node/runtimeModule/globalUIComponents.js +25 -0
- package/dist/node/runtimeModule/i18n.d.ts +2 -2
- package/dist/node/runtimeModule/i18n.js +83 -0
- package/dist/node/runtimeModule/pageData/createPageData.d.ts +1 -1
- package/dist/node/runtimeModule/pageData/createPageData.js +64 -0
- package/dist/node/runtimeModule/pageData/rsbuildPlugin.d.ts +1 -1
- package/dist/node/runtimeModule/pageData/rsbuildPlugin.js +51 -0
- package/dist/node/runtimeModule/routeList.d.ts +1 -1
- package/dist/node/runtimeModule/routeList.js +7 -0
- package/dist/node/runtimeModule/searchHooks.d.ts +1 -1
- package/dist/node/runtimeModule/searchHooks.js +11 -0
- package/dist/node/runtimeModule/siteData/createSiteData.js +34 -0
- package/dist/node/runtimeModule/siteData/normalizeThemeConfig.js +94 -0
- package/dist/node/runtimeModule/siteData/rsbuildPlugin.d.ts +1 -1
- package/dist/node/runtimeModule/siteData/rsbuildPlugin.js +24 -0
- package/dist/node/runtimeModule/socialLinks.d.ts +1 -1
- package/dist/node/runtimeModule/socialLinks.js +8 -0
- package/dist/node/runtimeModule/types.d.ts +2 -2
- package/dist/node/serve.js +23 -0
- package/dist/node/ssg/renderHtmlTemplate.js +33 -0
- package/dist/node/ssg/renderPage.js +34 -0
- package/dist/node/ssg/renderPageWorker.474f9f73.js +2 -0
- package/dist/node/ssg/renderPageWorker.js +15 -0
- package/dist/node/ssg/renderPages.d.ts +1 -1
- package/dist/node/ssg/renderPages.js +105 -0
- package/dist/node/ssg/renderPages.js.LICENSE.txt +4 -0
- package/dist/node/ssg/rsbuildPluginCSR.d.ts +1 -1
- package/dist/node/ssg/rsbuildPluginCSR.js +27 -0
- package/dist/node/ssg/rsbuildPluginSSG.d.ts +1 -1
- package/dist/node/ssg/rsbuildPluginSSG.js +72 -0
- package/dist/node/ssg/ssgEnv.js +33 -0
- package/dist/node/ssg/ssgEnv.js.LICENSE.txt +5 -0
- package/dist/node/ssg-md/llms/emitLlmsTxt.d.ts +1 -1
- package/dist/node/ssg-md/llms/emitLlmsTxt.js +80 -0
- package/dist/node/ssg-md/llms/llmsTxt.d.ts +1 -1
- package/dist/node/ssg-md/llms/llmsTxt.js +66 -0
- package/dist/node/ssg-md/react/index.d.ts +1 -1
- package/dist/node/ssg-md/remarkSplitMdx.js +202 -0
- package/dist/node/ssg-md/renderPage.js +31 -0
- package/dist/node/ssg-md/renderPages.d.ts +1 -1
- package/dist/node/ssg-md/renderPages.js +27 -0
- package/dist/node/ssg-md/rsbuildPluginSSGMD.d.ts +1 -1
- package/dist/node/ssg-md/rsbuildPluginSSGMD.js +47 -0
- package/dist/node/utils/applyReplaceRules.js +6 -0
- package/dist/node/utils/checkLanguageParity.js +77 -0
- package/dist/node/utils/createHash.js +5 -0
- package/dist/node/utils/error.d.ts +9 -0
- package/dist/node/utils/error.js +9 -0
- package/dist/node/utils/escapeHeadingIds.js +5 -0
- package/dist/node/utils/flattenMdxContent.js +74 -0
- package/dist/node/utils/fs.js +14 -0
- package/dist/node/utils/getImportAstNode.js +63 -0
- package/dist/node/utils/getPageKey.js +6 -0
- package/dist/node/utils/getSocialIcons.js +32 -0
- package/dist/node/utils/index.d.ts +10 -9
- package/dist/node/utils/normalizePath.js +10 -0
- package/dist/node/utils/reactAlias.d.ts +2 -0
- package/dist/node/utils/reactAlias.js +83 -0
- package/dist/rslib-runtime.99091bf6.js +18 -0
- package/dist/runtime/App.js +2 -2
- package/dist/runtime/ClientApp.d.ts +1 -1
- package/dist/runtime/ClientApp.js +0 -4
- package/dist/runtime/ssrMdServerEntry.js +1 -1
- package/dist/runtime/ssrServerEntry.js +2 -1
- package/dist/runtime.72d450ac.js +1 -0
- package/dist/runtime.js +3 -2
- package/dist/shiki-transformers.d.ts +1 -1
- package/dist/shiki-transformers.js +6 -120
- package/dist/theme/assets/moon.js +9 -26
- package/dist/theme/components/Banner/index.d.ts +1 -1
- package/dist/theme/components/Banner/index.js +2 -3
- package/dist/theme/components/Button/index.css +1 -1
- package/dist/theme/components/Callout/index.css +0 -2
- package/dist/theme/components/CodeBlock/index.css +4 -15
- package/dist/theme/components/CodeBlock/index.js +1 -0
- package/dist/theme/components/CodeButtonGroup/CopyCodeButton.js +3 -5
- package/dist/theme/components/CodeButtonGroup/index.css +5 -1
- package/dist/theme/components/CodeButtonGroup/index.js +3 -5
- package/dist/theme/components/DocContent/doc.css +30 -8
- package/dist/theme/components/DocContent/docComponents/index.d.ts +3 -3
- package/dist/theme/components/DocContent/docComponents/table.d.ts +2 -2
- package/dist/theme/components/DocContent/docComponents/table.js +8 -3
- package/dist/theme/components/DocContent/index.js +3 -2
- package/dist/theme/components/{DocContent/FallbackHeading.js → FallbackHeading/index.js} +19 -11
- package/dist/theme/components/HoverGroup/index.css +5 -1
- package/dist/theme/components/HoverGroup/index.js +1 -0
- package/dist/theme/components/HoverGroup/useHoverGroup.d.ts +1 -1
- package/dist/theme/components/Link/index.d.ts +18 -1
- package/dist/theme/components/Link/index.js +14 -8
- package/dist/theme/components/Link/useLinkNavigate.d.ts +4 -1
- package/dist/theme/components/Link/useLinkNavigate.js +23 -17
- package/dist/theme/components/Nav/NavMenu.css +1 -0
- package/dist/theme/components/Nav/NavMenu.js +2 -3
- package/dist/theme/components/Nav/NavTitle.css +12 -0
- package/dist/theme/components/Nav/NavTitle.d.ts +1 -0
- package/dist/theme/components/Nav/NavTitle.js +1 -0
- package/dist/theme/components/Nav/index.css +0 -8
- package/dist/theme/components/NavHamburger/index.js +3 -4
- package/dist/theme/components/NavScreen/NavScreenMenuItem.css +9 -0
- package/dist/theme/components/NavScreen/NavScreenMenuItem.js +2 -3
- package/dist/theme/components/Outline/index.css +0 -1
- package/dist/theme/components/Overview/OverviewGroup.js +1 -2
- package/dist/theme/components/Overview/index.js +1 -2
- package/dist/theme/components/PackageManagerTabs/index.d.ts +1 -1
- package/dist/theme/components/PackageManagerTabs/index.js +4 -0
- package/dist/theme/components/PrevNextPage/index.js +3 -4
- package/dist/theme/components/Root/index.d.ts +54 -0
- package/dist/theme/components/Root/index.js +7 -0
- package/dist/theme/components/Search/NoSearchResult.js +2 -3
- package/dist/theme/components/Search/SearchButton.js +3 -4
- package/dist/theme/components/Search/SearchPanel.js +13 -16
- package/dist/theme/components/Search/SuggestItem.d.ts +1 -1
- package/dist/theme/components/Search/SuggestItem.js +7 -11
- package/dist/theme/components/Search/logic/Provider.d.ts +1 -1
- package/dist/theme/components/Search/logic/providers/LocalProvider.d.ts +2 -2
- package/dist/theme/components/Search/logic/search.d.ts +1 -1
- package/dist/theme/components/Sidebar/SidebarGroup.js +2 -3
- package/dist/theme/components/Sidebar/SidebarItem.css +11 -3
- package/dist/theme/components/Sidebar/SidebarItem.js +6 -3
- package/dist/theme/components/Sidebar/SidebarSectionHeader.css +1 -1
- package/dist/theme/components/SidebarMenu/index.js +3 -5
- package/dist/theme/components/SocialLinks/index.js +2 -3
- package/dist/theme/components/SourceCode/index.css +5 -0
- package/dist/theme/components/SourceCode/index.js +2 -4
- package/dist/theme/components/SwitchAppearance/index.js +3 -5
- package/dist/theme/components/Tabs/index.css +13 -22
- package/dist/theme/components/Toc/TocItem.css +7 -4
- package/dist/theme/components/Toc/TocItem.js +1 -0
- package/dist/theme/icons.d.ts +25 -0
- package/dist/theme/icons.js +47 -0
- package/dist/theme/index.d.ts +62 -59
- package/dist/theme/index.js +5 -2
- package/dist/theme/layout/DocLayout/index.css +2 -2
- package/dist/theme/layout/DocLayout/index.js +1 -4
- package/dist/theme/layout/Layout/index.d.ts +1 -1
- package/dist/theme/layout/Layout/index.js +3 -3
- package/dist/theme/logic/useFullTextSearch.d.ts +1 -1
- package/dist/theme/logic/useScrollAfterNav.d.ts +5 -0
- package/dist/theme/logic/{sideEffects.js → useScrollAfterNav.js} +5 -6
- package/dist/theme/logic/useScrollReset.d.ts +5 -0
- package/dist/theme/logic/useScrollReset.js +12 -0
- package/dist/theme/logic/useSetup.js +2 -0
- package/dist/theme/styles/base.css +1 -10
- package/dist/theme/styles/index.d.ts +1 -1
- package/dist/theme/styles/index.js +1 -1
- package/dist/theme/styles/scrollbar.css +1 -0
- package/dist/theme/styles/vars/base-vars.css +5 -3
- package/dist/theme/styles/vars/home-vars.css +4 -2
- package/package.json +19 -20
- package/dist/3~101.js +0 -1786
- package/dist/3~335.js +0 -26
- package/dist/3~395.js +0 -74
- package/dist/cli.js +0 -259
- package/dist/index.js.LICENSE.txt +0 -10
- package/dist/node/auto-nav-sidebar/fixtures/docs/guide/c.d.ts +0 -2
- package/dist/node/auto-nav-sidebar/fixtures/docs-locales/en/guide/c.d.ts +0 -2
- package/dist/node/auto-nav-sidebar/fixtures/docs-locales/zh/guide/c.d.ts +0 -2
- package/dist/node/auto-nav-sidebar/locales.test.d.ts +0 -1
- package/dist/node/auto-nav-sidebar/walk.test.d.ts +0 -1
- package/dist/node/mdx/rehypePlugins/headerAnchor.test.d.ts +0 -1
- package/dist/node/mdx/remarkPlugins/containerSyntax.test.d.ts +0 -1
- package/dist/node/mdx/remarkPlugins/fileCodeBlock.test.d.ts +0 -1
- package/dist/node/mdx/remarkPlugins/image.test.d.ts +0 -1
- package/dist/node/mdx/remarkPlugins/link.test.d.ts +0 -1
- package/dist/node/route/RouteService.test.d.ts +0 -1
- package/dist/node/route/extractPageData.test.d.ts +0 -1
- package/dist/node/route/fixtures/basic/guide/c.d.ts +0 -2
- package/dist/node/route/normalizeRoutePath.test.d.ts +0 -1
- package/dist/node/runtimeModule/i18n.test.d.ts +0 -1
- package/dist/node/ssg-md/remarkSplitMdx.test.d.ts +0 -4
- package/dist/node/utils/checkLanguageParity.test.d.ts +0 -1
- package/dist/node/utils/detectCustomIcon.d.ts +0 -1
- package/dist/node/utils/detectReactVersion.d.ts +0 -3
- package/dist/processor.js +0 -4539
- package/dist/renderPageWorker.js +0 -196
- package/dist/theme/components/Search/logic/util.test.d.ts +0 -1
- /package/dist/cli/{config.d.ts → config/index.d.ts} +0 -0
- /package/dist/{shiki-transformers.js.LICENSE.txt → node/mdx/rehypePlugins/transformers/meta-highlight.js.LICENSE.txt} +0 -0
- /package/dist/theme/components/{DocContent/FallbackHeading.d.ts → FallbackHeading/index.d.ts} +0 -0
- /package/dist/theme/logic/{sideEffects.d.ts → useSetup.d.ts} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { preloadLink } from '@rspress/core/runtime';
|
|
2
|
+
import clsx from 'clsx';
|
|
2
3
|
import nprogress from 'nprogress';
|
|
3
4
|
import type React from 'react';
|
|
4
|
-
import type { ComponentProps } from 'react';
|
|
5
|
-
import { getHref, useLinkNavigate } from './useLinkNavigate';
|
|
5
|
+
import type { ComponentProps, TransitionStartFunction } from 'react';
|
|
6
6
|
import './index.scss';
|
|
7
|
-
import
|
|
7
|
+
import { getHref, useLinkNavigate } from './useLinkNavigate';
|
|
8
8
|
|
|
9
9
|
export interface LinkProps extends ComponentProps<'a'> {
|
|
10
10
|
href?: string;
|
|
@@ -13,6 +13,24 @@ export interface LinkProps extends ComponentProps<'a'> {
|
|
|
13
13
|
onMouseEnter?: (
|
|
14
14
|
event: React.MouseEvent<HTMLAnchorElement, MouseEvent>,
|
|
15
15
|
) => void;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Get isPending state of Link navigation
|
|
19
|
+
*
|
|
20
|
+
* ```tsx
|
|
21
|
+
* const [isPending, startTransition] = useTransition();
|
|
22
|
+
* <Link
|
|
23
|
+
* href="/some-path"
|
|
24
|
+
* startTransition={startTransition}
|
|
25
|
+
* >
|
|
26
|
+
* Some Link
|
|
27
|
+
* </Link>
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @private
|
|
31
|
+
* @unstable
|
|
32
|
+
*/
|
|
33
|
+
startTransition?: TransitionStartFunction;
|
|
16
34
|
}
|
|
17
35
|
|
|
18
36
|
nprogress.configure({ showSpinner: false });
|
|
@@ -26,19 +44,29 @@ nprogress.configure({ showSpinner: false });
|
|
|
26
44
|
* 4. Link is styled.
|
|
27
45
|
*/
|
|
28
46
|
export function Link(props: LinkProps) {
|
|
29
|
-
const {
|
|
47
|
+
const {
|
|
48
|
+
href = '/',
|
|
49
|
+
children,
|
|
50
|
+
className = '',
|
|
51
|
+
onClick,
|
|
52
|
+
onMouseEnter,
|
|
53
|
+
startTransition,
|
|
54
|
+
...otherProps
|
|
55
|
+
} = props;
|
|
30
56
|
|
|
31
57
|
const { linkType, removeBaseHref, withBaseHref } = getHref(href);
|
|
32
|
-
const navigate = useLinkNavigate();
|
|
58
|
+
const navigate = useLinkNavigate({ startTransition });
|
|
33
59
|
|
|
34
60
|
if (linkType === 'external') {
|
|
35
61
|
return (
|
|
36
62
|
<a
|
|
37
|
-
{...props}
|
|
38
63
|
href={href}
|
|
39
64
|
target="_blank"
|
|
40
65
|
rel="noopener noreferrer"
|
|
41
66
|
className={clsx(className, 'rp-link')}
|
|
67
|
+
onClick={onClick}
|
|
68
|
+
onMouseEnter={onMouseEnter}
|
|
69
|
+
{...otherProps}
|
|
42
70
|
>
|
|
43
71
|
{children}
|
|
44
72
|
</a>
|
|
@@ -47,7 +75,13 @@ export function Link(props: LinkProps) {
|
|
|
47
75
|
|
|
48
76
|
if (linkType === 'hashOnly') {
|
|
49
77
|
return (
|
|
50
|
-
<a
|
|
78
|
+
<a
|
|
79
|
+
href={href}
|
|
80
|
+
className={clsx(className, 'rp-link')}
|
|
81
|
+
onClick={onClick}
|
|
82
|
+
onMouseEnter={onMouseEnter}
|
|
83
|
+
{...otherProps}
|
|
84
|
+
>
|
|
51
85
|
{children}
|
|
52
86
|
</a>
|
|
53
87
|
);
|
|
@@ -56,7 +90,6 @@ export function Link(props: LinkProps) {
|
|
|
56
90
|
if (linkType === 'relative') {
|
|
57
91
|
return (
|
|
58
92
|
<a
|
|
59
|
-
{...props}
|
|
60
93
|
href={href}
|
|
61
94
|
className={clsx(className, 'rp-link')}
|
|
62
95
|
onMouseEnter={event => {
|
|
@@ -81,6 +114,7 @@ export function Link(props: LinkProps) {
|
|
|
81
114
|
e.preventDefault();
|
|
82
115
|
navigate(href);
|
|
83
116
|
}}
|
|
117
|
+
{...otherProps}
|
|
84
118
|
>
|
|
85
119
|
{children}
|
|
86
120
|
</a>
|
|
@@ -89,7 +123,6 @@ export function Link(props: LinkProps) {
|
|
|
89
123
|
|
|
90
124
|
return (
|
|
91
125
|
<a
|
|
92
|
-
{...props}
|
|
93
126
|
href={withBaseHref}
|
|
94
127
|
className={clsx(className, 'rp-link')}
|
|
95
128
|
onMouseEnter={event => {
|
|
@@ -114,6 +147,7 @@ export function Link(props: LinkProps) {
|
|
|
114
147
|
e.preventDefault();
|
|
115
148
|
navigate(removeBaseHref);
|
|
116
149
|
}}
|
|
150
|
+
{...otherProps}
|
|
117
151
|
>
|
|
118
152
|
{children}
|
|
119
153
|
</a>
|
|
@@ -9,7 +9,11 @@ import {
|
|
|
9
9
|
withBase,
|
|
10
10
|
} from '@rspress/core/runtime';
|
|
11
11
|
import nprogress from 'nprogress';
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
startTransition as reactStartTransition,
|
|
14
|
+
type TransitionStartFunction,
|
|
15
|
+
useCallback,
|
|
16
|
+
} from 'react';
|
|
13
17
|
|
|
14
18
|
nprogress.configure({ showSpinner: false });
|
|
15
19
|
|
|
@@ -60,7 +64,11 @@ export function getHref(href: string): {
|
|
|
60
64
|
* For import { Link } from '@theme';
|
|
61
65
|
* useNavigate with preload logic
|
|
62
66
|
*/
|
|
63
|
-
export function useLinkNavigate(
|
|
67
|
+
export function useLinkNavigate(
|
|
68
|
+
{ startTransition }: { startTransition?: TransitionStartFunction } = {
|
|
69
|
+
startTransition: reactStartTransition,
|
|
70
|
+
},
|
|
71
|
+
): (href: string) => Promise<void> {
|
|
64
72
|
const { pathname: currPagePathname } = useLocation();
|
|
65
73
|
const navigate = useNavigateInner();
|
|
66
74
|
|
|
@@ -72,22 +80,30 @@ export function useLinkNavigate(): (href: string) => Promise<void> {
|
|
|
72
80
|
return;
|
|
73
81
|
}
|
|
74
82
|
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
83
|
+
const preloadChunkThenNavigate = async () => {
|
|
84
|
+
const inCurrPage = isActive(removeBaseHref, currPagePathname);
|
|
85
|
+
if (!process.env.__SSR__ && !inCurrPage) {
|
|
86
|
+
const matchedRoute = pathnameToRouteService(removeBaseHref);
|
|
87
|
+
if (matchedRoute) {
|
|
88
|
+
const timer = setTimeout(() => {
|
|
89
|
+
nprogress.start();
|
|
90
|
+
}, 200);
|
|
91
|
+
await matchedRoute.preload();
|
|
92
|
+
clearTimeout(timer);
|
|
93
|
+
nprogress.done();
|
|
94
|
+
} else {
|
|
95
|
+
window.location.assign(withBaseHref);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
88
98
|
}
|
|
99
|
+
navigate(removeBaseHref, { replace: false });
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
if (startTransition) {
|
|
103
|
+
startTransition(preloadChunkThenNavigate);
|
|
104
|
+
} else {
|
|
105
|
+
preloadChunkThenNavigate();
|
|
89
106
|
}
|
|
90
|
-
navigate(removeBaseHref, { replace: false });
|
|
91
107
|
},
|
|
92
108
|
[currPagePathname, navigate],
|
|
93
109
|
);
|
|
@@ -6,8 +6,7 @@ import type {
|
|
|
6
6
|
} from '@rspress/core';
|
|
7
7
|
import { matchNavbar, useLocation } from '@rspress/core/runtime';
|
|
8
8
|
import type { HoverGroupProps } from '@theme';
|
|
9
|
-
import { Link, SvgWrapper, Tag, useHoverGroup } from '@theme';
|
|
10
|
-
import ArrowDown from '@theme-assets/arrow-down';
|
|
9
|
+
import { IconArrowDown, Link, SvgWrapper, Tag, useHoverGroup } from '@theme';
|
|
11
10
|
import cls from 'clsx';
|
|
12
11
|
import { useMemo } from 'react';
|
|
13
12
|
import { useLangsMenu, useVersionsMenu } from './hooks';
|
|
@@ -15,7 +14,7 @@ import './NavMenu.scss';
|
|
|
15
14
|
import clsx from 'clsx';
|
|
16
15
|
|
|
17
16
|
export const SvgDown = (props: React.SVGProps<SVGSVGElement>) => {
|
|
18
|
-
return <SvgWrapper icon={
|
|
17
|
+
return <SvgWrapper icon={IconArrowDown} {...props} />;
|
|
19
18
|
};
|
|
20
19
|
|
|
21
20
|
export function NavMenuItemWithChildren({
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { SocialLinks, SvgWrapper, useHoverGroup } from '@theme';
|
|
2
|
-
import SmallMenu from '@theme-assets/small-menu';
|
|
1
|
+
import { IconSmallMenu, SocialLinks, SvgWrapper, useHoverGroup } from '@theme';
|
|
3
2
|
import clsx from 'clsx';
|
|
4
3
|
import { createPortal } from 'react-dom';
|
|
5
4
|
import { NavVersions } from '../Nav/NavMenu';
|
|
@@ -43,7 +42,7 @@ export function NavHamburger() {
|
|
|
43
42
|
'rp-nav-hamburger--active': isScreenOpen,
|
|
44
43
|
})}
|
|
45
44
|
>
|
|
46
|
-
<SvgWrapper icon={
|
|
45
|
+
<SvgWrapper icon={IconSmallMenu} />
|
|
47
46
|
</button>
|
|
48
47
|
|
|
49
48
|
<button
|
|
@@ -55,7 +54,7 @@ export function NavHamburger() {
|
|
|
55
54
|
onMouseEnter={handleMouseEnter}
|
|
56
55
|
onMouseLeave={handleMouseLeave}
|
|
57
56
|
>
|
|
58
|
-
<SvgWrapper icon={
|
|
57
|
+
<SvgWrapper icon={IconSmallMenu} />
|
|
59
58
|
{hoverGroup}
|
|
60
59
|
</button>
|
|
61
60
|
</>
|
|
@@ -56,4 +56,18 @@
|
|
|
56
56
|
gap: 2px;
|
|
57
57
|
margin-left: 8px;
|
|
58
58
|
}
|
|
59
|
+
|
|
60
|
+
// external link
|
|
61
|
+
&.rp-link[target='_blank'] {
|
|
62
|
+
.rp-nav-screen-menu-item__left {
|
|
63
|
+
&::after {
|
|
64
|
+
content: '↗';
|
|
65
|
+
font-weight: 400;
|
|
66
|
+
color: var(--rp-c-text-3);
|
|
67
|
+
transform: translate(0, -0.2em);
|
|
68
|
+
margin-left: 0.2em;
|
|
69
|
+
margin-right: 0.1em;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
59
73
|
}
|
|
@@ -5,8 +5,7 @@ import type {
|
|
|
5
5
|
NavItemWithLinkAndChildren,
|
|
6
6
|
} from '@rspress/core';
|
|
7
7
|
import { matchNavbar, useLocation } from '@rspress/core/runtime';
|
|
8
|
-
import { Link, SvgWrapper, Tag } from '@theme';
|
|
9
|
-
import ArrowDown from '@theme-assets/arrow-down';
|
|
8
|
+
import { IconArrowDown, Link, SvgWrapper, Tag } from '@theme';
|
|
10
9
|
import clsx from 'clsx';
|
|
11
10
|
import type React from 'react';
|
|
12
11
|
import { useMemo, useState } from 'react';
|
|
@@ -17,7 +16,7 @@ interface NavScreenMenuItemWithLinkProps {
|
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
export const SvgDown = (props: React.SVGProps<SVGSVGElement>) => {
|
|
20
|
-
return <SvgWrapper icon={
|
|
19
|
+
return <SvgWrapper icon={IconArrowDown} {...props} />;
|
|
21
20
|
};
|
|
22
21
|
|
|
23
22
|
export function NavScreenMenuItemRaw({
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Link, renderInlineMarkdown } from '@theme';
|
|
2
2
|
import './OverviewGroup.scss';
|
|
3
3
|
import type { Header } from '@rspress/core';
|
|
4
|
-
import { SvgWrapper } from '@theme';
|
|
5
|
-
import { FallbackHeading } from '../DocContent/FallbackHeading';
|
|
4
|
+
import { FallbackHeading, SvgWrapper } from '@theme';
|
|
6
5
|
import IconPlugin from './icons/plugin.svg';
|
|
7
6
|
|
|
8
7
|
export interface GroupItem {
|
|
@@ -10,9 +10,13 @@ import {
|
|
|
10
10
|
usePageData,
|
|
11
11
|
useSidebar,
|
|
12
12
|
} from '@rspress/core/runtime';
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
FallbackHeading,
|
|
15
|
+
type Group,
|
|
16
|
+
type GroupItem,
|
|
17
|
+
OverviewGroup,
|
|
18
|
+
} from '@theme';
|
|
14
19
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
15
|
-
import { FallbackHeading } from '../DocContent/FallbackHeading';
|
|
16
20
|
import {
|
|
17
21
|
isSidebarDivider,
|
|
18
22
|
isSidebarSectionHeader,
|
|
@@ -210,6 +210,18 @@ export function PackageManagerTabs({
|
|
|
210
210
|
commandInfo = command;
|
|
211
211
|
}
|
|
212
212
|
|
|
213
|
+
if (process.env.__SSR_MD__) {
|
|
214
|
+
return Object.values(commandInfo).reduce((previous, current) => {
|
|
215
|
+
const [packageManager, command] = splitTo2Parts(current);
|
|
216
|
+
return (
|
|
217
|
+
previous +
|
|
218
|
+
`\n\`\`\`sh [${packageManager}]\n` +
|
|
219
|
+
`${packageManager}${command}\n` +
|
|
220
|
+
`\`\`\`\n`
|
|
221
|
+
);
|
|
222
|
+
}, '');
|
|
223
|
+
}
|
|
224
|
+
|
|
213
225
|
return (
|
|
214
226
|
<Tabs
|
|
215
227
|
groupId="package.manager"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useI18n } from '@rspress/core/runtime';
|
|
2
2
|
import {
|
|
3
|
+
IconArrowRight,
|
|
3
4
|
Link,
|
|
4
5
|
renderInlineMarkdown,
|
|
5
6
|
SvgWrapper,
|
|
6
7
|
usePrevNextPage,
|
|
7
8
|
} from '@theme';
|
|
8
|
-
import ArrowRight from '@theme-assets/arrow-right';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
10
|
import './index.scss';
|
|
11
11
|
|
|
@@ -25,7 +25,7 @@ export function PrevNextPage() {
|
|
|
25
25
|
</span>
|
|
26
26
|
<span className="rp-prev-next-page__item__title">
|
|
27
27
|
<SvgWrapper
|
|
28
|
-
icon={
|
|
28
|
+
icon={IconArrowRight}
|
|
29
29
|
className="rp-prev-next-page__icon rp-prev-next-page__rotate_180"
|
|
30
30
|
/>
|
|
31
31
|
<span {...renderInlineMarkdown(prevPage.text)} />
|
|
@@ -44,7 +44,10 @@ export function PrevNextPage() {
|
|
|
44
44
|
</span>
|
|
45
45
|
<span className="rp-prev-next-page__item__title">
|
|
46
46
|
<span {...renderInlineMarkdown(nextPage.text)} />
|
|
47
|
-
<SvgWrapper
|
|
47
|
+
<SvgWrapper
|
|
48
|
+
icon={IconArrowRight}
|
|
49
|
+
className="rp-prev-next-page__icon"
|
|
50
|
+
/>
|
|
48
51
|
</span>
|
|
49
52
|
</Link>
|
|
50
53
|
) : (
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface RootProps {
|
|
4
|
+
/**
|
|
5
|
+
* The children elements to render inside the Root component.
|
|
6
|
+
*/
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A wrapper component for the entire application.
|
|
12
|
+
*
|
|
13
|
+
* The Root component wraps all content in the application, including the Layout
|
|
14
|
+
* and global UI components. By default, it simply renders its children without
|
|
15
|
+
* any additional markup or styling.
|
|
16
|
+
*
|
|
17
|
+
* You can eject and customize this component to add global wrappers, providers,
|
|
18
|
+
* or any other elements that should wrap your entire application.
|
|
19
|
+
*
|
|
20
|
+
* @param {RootProps} props - The properties for the Root component.
|
|
21
|
+
* @returns {JSX.Element} The children elements wrapped by the Root component.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* Default usage (no customization needed):
|
|
25
|
+
* ```tsx
|
|
26
|
+
* import { Root } from '@theme';
|
|
27
|
+
*
|
|
28
|
+
* function App() {
|
|
29
|
+
* return (
|
|
30
|
+
* <Root>
|
|
31
|
+
* <YourContent />
|
|
32
|
+
* </Root>
|
|
33
|
+
* );
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* Ejected and customized:
|
|
39
|
+
* ```tsx
|
|
40
|
+
* // In your ejected theme/components/Root/index.tsx
|
|
41
|
+
* import type { ReactNode } from 'react';
|
|
42
|
+
*
|
|
43
|
+
* export interface RootProps {
|
|
44
|
+
* children: ReactNode;
|
|
45
|
+
* }
|
|
46
|
+
*
|
|
47
|
+
* export function Root({ children }: RootProps) {
|
|
48
|
+
* return (
|
|
49
|
+
* <div className="my-custom-root">
|
|
50
|
+
* {children}
|
|
51
|
+
* </div>
|
|
52
|
+
* );
|
|
53
|
+
* }
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export function Root({ children }: RootProps) {
|
|
57
|
+
return <>{children}</>;
|
|
58
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useI18n } from '@rspress/core/runtime';
|
|
2
|
-
import { SvgWrapper } from '@theme';
|
|
3
|
-
import Empty from '@theme-assets/empty';
|
|
2
|
+
import { IconEmpty, SvgWrapper } from '@theme';
|
|
4
3
|
import './NoSearchResult.scss';
|
|
5
4
|
|
|
6
5
|
export function NoSearchResult({ query }: { query: string }) {
|
|
@@ -8,7 +7,7 @@ export function NoSearchResult({ query }: { query: string }) {
|
|
|
8
7
|
|
|
9
8
|
return (
|
|
10
9
|
<div className="rp-no-search-result">
|
|
11
|
-
<SvgWrapper icon={
|
|
10
|
+
<SvgWrapper icon={IconEmpty} className="rp-no-search-result__icon" />
|
|
12
11
|
<p className="rp-no-search-result__text">
|
|
13
12
|
{t('searchNoResultsText')} <b>"{query}"</b>
|
|
14
13
|
</p>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useI18n } from '@rspress/core/runtime';
|
|
2
|
-
import { SvgWrapper } from '@theme';
|
|
3
|
-
import SearchSvg from '@theme-assets/search';
|
|
2
|
+
import { IconSearch, SvgWrapper } from '@theme';
|
|
4
3
|
import { useEffect, useState } from 'react';
|
|
5
4
|
import './SearchButton.scss';
|
|
6
5
|
|
|
@@ -20,7 +19,7 @@ export function SearchButton({ setFocused }: SearchButtonProps) {
|
|
|
20
19
|
<>
|
|
21
20
|
<button className="rp-search-button" onClick={() => setFocused(true)}>
|
|
22
21
|
<div className="rp-search-button__content">
|
|
23
|
-
<SvgWrapper icon={
|
|
22
|
+
<SvgWrapper icon={IconSearch} className="rp-search-button__icon" />
|
|
24
23
|
<span className="rp-search-button__word">
|
|
25
24
|
{t('searchPlaceholderText')}
|
|
26
25
|
</span>
|
|
@@ -37,7 +36,7 @@ export function SearchButton({ setFocused }: SearchButtonProps) {
|
|
|
37
36
|
className="rp-search-button--mobile"
|
|
38
37
|
onClick={() => setFocused(true)}
|
|
39
38
|
>
|
|
40
|
-
<SvgWrapper icon={
|
|
39
|
+
<SvgWrapper icon={IconSearch} />
|
|
41
40
|
</div>
|
|
42
41
|
</>
|
|
43
42
|
);
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { useI18n, usePageData } from '@rspress/core/runtime';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import {
|
|
3
|
+
IconClose,
|
|
4
|
+
IconLoading,
|
|
5
|
+
IconSearch,
|
|
6
|
+
SvgWrapper,
|
|
7
|
+
Tab,
|
|
8
|
+
Tabs,
|
|
9
|
+
useLinkNavigate,
|
|
10
|
+
} from '@theme';
|
|
6
11
|
import { debounce } from 'lodash-es';
|
|
7
12
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
8
13
|
import { createPortal } from 'react-dom';
|
|
@@ -232,8 +237,8 @@ export function SearchPanel({ focused, setFocused }: SearchPanelProps) {
|
|
|
232
237
|
currentRenderType === RenderType.Default
|
|
233
238
|
) {
|
|
234
239
|
// the ResultItem has been normalized to display
|
|
235
|
-
const flatSuggestions =
|
|
236
|
-
normalizeSuggestions(currentSuggestions),
|
|
240
|
+
const flatSuggestions = Array.from(
|
|
241
|
+
normalizeSuggestions(currentSuggestions).values(),
|
|
237
242
|
).flat();
|
|
238
243
|
const suggestion = flatSuggestions[currentSuggestionIndex];
|
|
239
244
|
navigate(suggestion.link);
|
|
@@ -418,7 +423,7 @@ export function SearchPanel({ focused, setFocused }: SearchPanelProps) {
|
|
|
418
423
|
if (isSearching) {
|
|
419
424
|
return (
|
|
420
425
|
<div className="rp-search-panel__loading">
|
|
421
|
-
<SvgWrapper icon={
|
|
426
|
+
<SvgWrapper icon={IconLoading} />
|
|
422
427
|
</div>
|
|
423
428
|
);
|
|
424
429
|
}
|
|
@@ -499,7 +504,7 @@ export function SearchPanel({ focused, setFocused }: SearchPanelProps) {
|
|
|
499
504
|
<div className="rp-search-panel__header">
|
|
500
505
|
<div className="rp-search-panel__input-form">
|
|
501
506
|
<label>
|
|
502
|
-
<SvgWrapper icon={
|
|
507
|
+
<SvgWrapper icon={IconSearch} />
|
|
503
508
|
</label>
|
|
504
509
|
<input
|
|
505
510
|
className="rp-search-panel__input"
|
|
@@ -512,7 +517,7 @@ export function SearchPanel({ focused, setFocused }: SearchPanelProps) {
|
|
|
512
517
|
/>
|
|
513
518
|
<label>
|
|
514
519
|
<SvgWrapper
|
|
515
|
-
icon={
|
|
520
|
+
icon={IconClose}
|
|
516
521
|
className="rp-search-panel__close"
|
|
517
522
|
onClick={e => {
|
|
518
523
|
if (searchInputRef.current) {
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import {
|
|
2
|
+
IconFile,
|
|
3
|
+
IconHeader,
|
|
4
|
+
IconJump,
|
|
5
|
+
IconTitle,
|
|
6
|
+
Link,
|
|
7
|
+
SvgWrapper,
|
|
8
|
+
} from '@theme';
|
|
6
9
|
import { useRef } from 'react';
|
|
7
10
|
import './SuggestItem.scss';
|
|
8
11
|
import type { DefaultMatchResultItem, HighlightInfo } from './logic/types';
|
|
9
12
|
import { getSlicedStrByByteLength } from './logic/util';
|
|
10
13
|
|
|
11
|
-
const ICON_MAP = {
|
|
12
|
-
title: TitleSvg,
|
|
13
|
-
header: HeaderSvg,
|
|
14
|
-
content: FileSvg,
|
|
15
|
-
};
|
|
16
|
-
|
|
17
14
|
export function SuggestItem({
|
|
18
15
|
suggestion,
|
|
19
16
|
closeSearch,
|
|
@@ -32,6 +29,12 @@ export function SuggestItem({
|
|
|
32
29
|
inCurrentDocIndex: boolean;
|
|
33
30
|
scrollTo: (top: number, height: number) => void;
|
|
34
31
|
}) {
|
|
32
|
+
const ICON_MAP = {
|
|
33
|
+
title: IconTitle,
|
|
34
|
+
header: IconHeader,
|
|
35
|
+
content: IconFile,
|
|
36
|
+
};
|
|
37
|
+
|
|
35
38
|
const HitIcon = ICON_MAP[suggestion.type];
|
|
36
39
|
const selfRef = useRef<HTMLLIElement>(null);
|
|
37
40
|
if (isCurrent && selfRef.current?.offsetTop) {
|
|
@@ -135,7 +138,7 @@ export function SuggestItem({
|
|
|
135
138
|
<span>{hitContent}</span>
|
|
136
139
|
</div>
|
|
137
140
|
<div className="rp-suggest-item__action-icon">
|
|
138
|
-
<SvgWrapper icon={
|
|
141
|
+
<SvgWrapper icon={IconJump} />
|
|
139
142
|
</div>
|
|
140
143
|
</div>
|
|
141
144
|
</Link>
|
|
@@ -5,8 +5,7 @@ import type {
|
|
|
5
5
|
SidebarSectionHeader as SidebarSectionHeaderType,
|
|
6
6
|
} from '@rspress/core';
|
|
7
7
|
import { useActiveMatcher } from '@rspress/core/runtime';
|
|
8
|
-
import { SvgWrapper, useLinkNavigate } from '@theme';
|
|
9
|
-
import ArrowRight from '@theme-assets/arrow-right';
|
|
8
|
+
import { IconArrowRight, SvgWrapper, useLinkNavigate } from '@theme';
|
|
10
9
|
import clsx from 'clsx';
|
|
11
10
|
import type React from 'react';
|
|
12
11
|
import { SidebarDivider } from './SidebarDivider';
|
|
@@ -27,7 +26,7 @@ const CollapsibleIcon = ({ collapsed }: { collapsed: boolean }) => (
|
|
|
27
26
|
transform: collapsed ? 'rotate(0deg)' : 'rotate(90deg)',
|
|
28
27
|
}}
|
|
29
28
|
>
|
|
30
|
-
<SvgWrapper icon={
|
|
29
|
+
<SvgWrapper icon={IconArrowRight} />
|
|
31
30
|
</div>
|
|
32
31
|
);
|
|
33
32
|
|