@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,3 +1,3 @@
|
|
|
1
|
-
import { type CodeBlockProps } from '@theme';
|
|
1
|
+
import { type CodeBlockProps } from '@rspress/core/theme';
|
|
2
2
|
export type ShikiPreProps = CodeBlockProps & React.HTMLAttributes<HTMLPreElement>;
|
|
3
|
-
export declare function ShikiPre({ title, lang, wrapCode, lineNumbers, containerElementClassName, codeButtonGroupProps, ...otherProps }: ShikiPreProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function ShikiPre({ title, lang, wrapCode, lineNumbers, fold, height, containerElementClassName, codeButtonGroupProps, ...otherProps }: ShikiPreProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { CodeBlock } from "@theme";
|
|
3
|
-
function ShikiPre({ title, lang, wrapCode, lineNumbers, containerElementClassName, codeButtonGroupProps, ...otherProps }) {
|
|
2
|
+
import { CodeBlock } from "@rspress/core/theme";
|
|
3
|
+
function ShikiPre({ title, lang, wrapCode, lineNumbers, fold, height, containerElementClassName, codeButtonGroupProps, ...otherProps }) {
|
|
4
4
|
return /*#__PURE__*/ jsx(CodeBlock, {
|
|
5
5
|
title: title,
|
|
6
6
|
lang: lang,
|
|
7
7
|
wrapCode: wrapCode,
|
|
8
8
|
lineNumbers: lineNumbers,
|
|
9
|
+
fold: fold,
|
|
10
|
+
height: height,
|
|
9
11
|
containerElementClassName: containerElementClassName,
|
|
10
12
|
codeButtonGroupProps: codeButtonGroupProps,
|
|
11
13
|
children: /*#__PURE__*/ jsx("pre", {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useFrontmatter, useSite } from "@rspress/core/runtime";
|
|
3
|
-
import { LlmsContainer, LlmsCopyButton, LlmsViewOptions, Tag } from "@theme";
|
|
3
|
+
import { LlmsContainer, LlmsCopyButton, LlmsViewOptions, Tag } from "@rspress/core/theme";
|
|
4
4
|
import clsx from "clsx";
|
|
5
5
|
const H1 = (props)=>{
|
|
6
6
|
const { className, children, ...rest } = props;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { MDXProvider } from "@mdx-js/react";
|
|
3
3
|
import { Content, usePage, useSite } from "@rspress/core/runtime";
|
|
4
|
-
import { Callout, FallbackHeading, getCustomMDXComponent, useScrollAfterNav } from "@theme";
|
|
4
|
+
import { Callout, FallbackHeading, getCustomMDXComponent, useScrollAfterNav } from "@rspress/core/theme";
|
|
5
5
|
import "./doc.css";
|
|
6
6
|
function FallbackTitle() {
|
|
7
7
|
const { site } = useSite();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { EditLink, LastUpdated, PrevNextPage } from "@theme";
|
|
2
|
+
import { EditLink, LastUpdated, PrevNextPage } from "@rspress/core/theme";
|
|
3
3
|
import "./index.css";
|
|
4
4
|
function DocFooter() {
|
|
5
5
|
return /*#__PURE__*/ jsxs("footer", {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { IconEdit, Link, SvgWrapper } from "@theme";
|
|
2
|
+
import { IconEdit, Link, SvgWrapper } from "@rspress/core/theme";
|
|
3
3
|
import "./index.css";
|
|
4
4
|
import { useEditLink } from "./useEditLink.js";
|
|
5
5
|
function EditLink({ isOutline }) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { getCustomMDXComponent, renderInlineMarkdown } from "@theme";
|
|
2
|
+
import { getCustomMDXComponent, renderInlineMarkdown } from "@rspress/core/theme";
|
|
3
3
|
import { slug } from "github-slugger";
|
|
4
4
|
import { useMemo } from "react";
|
|
5
5
|
const getHeadingMap = ()=>{
|
|
@@ -26,17 +26,17 @@
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
.rp-home-feature__item--span-3, .rp-home-feature__item--span-6 {
|
|
29
|
-
width: calc((100% - 2
|
|
29
|
+
width: calc((100% - 2*var(--rp-home-feature-gap))/3);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
@media (width >= 960px) {
|
|
34
34
|
.rp-home-feature__item--span-3 {
|
|
35
|
-
width: calc((100% - 3
|
|
35
|
+
width: calc((100% - 3*var(--rp-home-feature-gap))/4);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
.rp-home-feature__item--span-4 {
|
|
39
|
-
width: calc((100% - 2
|
|
39
|
+
width: calc((100% - 2*var(--rp-home-feature-gap))/3);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
.rp-home-feature__item--span-6 {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useFrontmatter } from "@rspress/core/runtime";
|
|
3
|
-
import { SvgWrapper, renderHtmlOrText, useLinkNavigate } from "@theme";
|
|
3
|
+
import { SvgWrapper, renderHtmlOrText, useLinkNavigate } from "@rspress/core/theme";
|
|
4
4
|
import "./index.css";
|
|
5
5
|
import { useCardAnimation } from "./useCardAnimation.js";
|
|
6
6
|
const getGridClass = (feature)=>{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useSite } from "@rspress/core/runtime";
|
|
3
|
-
import { renderHtmlOrText } from "@theme";
|
|
3
|
+
import { renderHtmlOrText } from "@rspress/core/theme";
|
|
4
4
|
import "./index.css";
|
|
5
5
|
function HomeFooter() {
|
|
6
6
|
const { site } = useSite();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { normalizeImagePath, useFrontmatter } from "@rspress/core/runtime";
|
|
3
|
-
import { Button, Link, renderHtmlOrText } from "@theme";
|
|
3
|
+
import { Button, Link, renderHtmlOrText } from "@rspress/core/theme";
|
|
4
4
|
import "./index.css";
|
|
5
5
|
import clsx from "clsx";
|
|
6
6
|
const DEFAULT_HERO = {
|
|
@@ -12,5 +12,5 @@ interface HoverGroupProps {
|
|
|
12
12
|
activeMatcher?: (item: Items[number]) => boolean;
|
|
13
13
|
}
|
|
14
14
|
declare function HoverGroup({ items, customChildren, isOpen, position, activeMatcher, }: HoverGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
export { HoverGroup };
|
|
16
15
|
export type { HoverGroupProps, Items };
|
|
16
|
+
export { HoverGroup };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
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 clsx from "clsx";
|
|
5
5
|
import "./index.css";
|
|
6
6
|
function HoverGroupItem({ item, activeMatcher, depth = 0 }) {
|
|
@@ -17,6 +17,7 @@ function HoverGroupItem({ item, activeMatcher, depth = 0 }) {
|
|
|
17
17
|
"data-depth": depth,
|
|
18
18
|
children: /*#__PURE__*/ jsxs(Link, {
|
|
19
19
|
href: item.link,
|
|
20
|
+
download: 'download' in item ? item.download : void 0,
|
|
20
21
|
"aria-label": item.text,
|
|
21
22
|
className: "rp-hover-group__item__link",
|
|
22
23
|
lang: item.lang,
|
|
@@ -40,6 +41,7 @@ function HoverGroupItem({ item, activeMatcher, depth = 0 }) {
|
|
|
40
41
|
}
|
|
41
42
|
if ('link' in item) {
|
|
42
43
|
const { text, link, lang, rel } = item;
|
|
44
|
+
const download = 'download' in item ? item.download : void 0;
|
|
43
45
|
const isActiveItem = activeMatcher ? activeMatcher(item) : matchNavbar(item, pathname);
|
|
44
46
|
return /*#__PURE__*/ jsx("li", {
|
|
45
47
|
className: clsx('rp-hover-group__item', {
|
|
@@ -51,6 +53,7 @@ function HoverGroupItem({ item, activeMatcher, depth = 0 }) {
|
|
|
51
53
|
"data-depth": depth,
|
|
52
54
|
children: link ? /*#__PURE__*/ jsxs(Link, {
|
|
53
55
|
href: link,
|
|
56
|
+
download: download,
|
|
54
57
|
"aria-label": text,
|
|
55
58
|
className: "rp-hover-group__item__link",
|
|
56
59
|
lang: lang,
|
|
@@ -6,7 +6,7 @@ export declare function getHref(href: string): {
|
|
|
6
6
|
linkType: LinkType;
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
9
|
-
* For import { Link } from '@theme';
|
|
9
|
+
* For import { Link } from '@rspress/core/theme';
|
|
10
10
|
* useNavigate with preload logic
|
|
11
11
|
*/
|
|
12
12
|
export declare function useLinkNavigate({ startTransition }?: {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
/*!
|
|
1
|
+
/*! LICENSE: LlmsCopyButton.js.LICENSE.txt */
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useI18n } from "@rspress/core/runtime";
|
|
4
|
-
import { IconCopy, IconSuccess } from "@theme";
|
|
4
|
+
import { IconCopy, IconSuccess } from "@rspress/core/theme";
|
|
5
5
|
import { useCallback, useRef, useState } from "react";
|
|
6
6
|
import { SvgWrapper } from "../SvgWrapper/index.js";
|
|
7
7
|
import "./index.css";
|
|
8
8
|
import "./LlmsCopyButton.css";
|
|
9
|
+
import { copyToClipboard } from "./copy.js";
|
|
9
10
|
import { useMdUrl } from "./useMdUrl.js";
|
|
10
11
|
/**
|
|
11
12
|
* Inspired from fumadocs docsite
|
|
@@ -25,7 +26,7 @@ function LlmsCopyButton(props) {
|
|
|
25
26
|
try {
|
|
26
27
|
const content = cache.get(url) ?? await fetch(url).then((res)=>res.text());
|
|
27
28
|
cache.set(url, content);
|
|
28
|
-
await
|
|
29
|
+
await copyToClipboard(content);
|
|
29
30
|
} finally{
|
|
30
31
|
setLoading(false);
|
|
31
32
|
setFinished(true);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useI18n } from "@rspress/core/runtime";
|
|
3
|
-
import { IconCopy, IconSuccess, SvgWrapper } from "@theme";
|
|
3
|
+
import { IconCopy, IconSuccess, SvgWrapper } from "@rspress/core/theme";
|
|
4
4
|
import { useCallback, useRef, useState } from "react";
|
|
5
|
+
import { copyToClipboard } from "./copy.js";
|
|
5
6
|
import { useMdUrl } from "./useMdUrl.js";
|
|
6
7
|
const cache = new Map();
|
|
7
8
|
function LlmsCopyRow() {
|
|
@@ -16,7 +17,7 @@ function LlmsCopyRow() {
|
|
|
16
17
|
try {
|
|
17
18
|
const content = cache.get(pathname) ?? await fetch(pathname).then((res)=>res.text());
|
|
18
19
|
cache.set(pathname, content);
|
|
19
|
-
await
|
|
20
|
+
await copyToClipboard(content);
|
|
20
21
|
} finally{
|
|
21
22
|
setLoading(false);
|
|
22
23
|
setFinished(true);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useI18n, useSite } from "@rspress/core/runtime";
|
|
3
|
-
import { IconExternalLink, SvgWrapper } from "@theme";
|
|
3
|
+
import { IconExternalLink, SvgWrapper } from "@rspress/core/theme";
|
|
4
4
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
5
5
|
import "./LlmsOpenRow.css";
|
|
6
6
|
import "./LlmsViewOptions.css";
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
/*!
|
|
1
|
+
/*! LICENSE: LlmsViewOptions.js.LICENSE.txt */
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useI18n, useSite } from "@rspress/core/runtime";
|
|
4
|
-
import { IconDown, IconExternalLink, IconLink } from "@theme";
|
|
4
|
+
import { IconDown, IconExternalLink, IconLink } from "@rspress/core/theme";
|
|
5
5
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
6
6
|
import { SvgWrapper } from "../SvgWrapper/index.js";
|
|
7
7
|
import "./index.css";
|
|
8
8
|
import "./LlmsViewOptions.css";
|
|
9
|
+
import { copyToClipboard } from "./copy.js";
|
|
9
10
|
import { useMdUrl } from "./useMdUrl.js";
|
|
10
11
|
/**
|
|
11
12
|
* Inspired from fumadocs docsite
|
|
@@ -46,7 +47,7 @@ function LlmsViewOptions({ options: propsOptions }) {
|
|
|
46
47
|
icon: IconLink
|
|
47
48
|
}),
|
|
48
49
|
onClick: ()=>{
|
|
49
|
-
|
|
50
|
+
copyToClipboard(fullMarkdownUrl);
|
|
50
51
|
}
|
|
51
52
|
},
|
|
52
53
|
chatgpt: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function copyToClipboard(text: string): Promise<void>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import copy_to_clipboard from "copy-to-clipboard";
|
|
2
|
+
async function copyToClipboard(text) {
|
|
3
|
+
if (navigator.clipboard?.writeText) try {
|
|
4
|
+
await navigator.clipboard.writeText(text);
|
|
5
|
+
return;
|
|
6
|
+
} catch {}
|
|
7
|
+
copy_to_clipboard(text);
|
|
8
|
+
}
|
|
9
|
+
export { copyToClipboard };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export { LlmsContainer, LlmsCopyButton, LlmsViewOptions, useMdUrl };
|
|
1
|
+
export { LlmsContainer } from "./LlmsContainer.js";
|
|
2
|
+
export { LlmsCopyButton } from "./LlmsCopyButton.js";
|
|
3
|
+
export { LlmsViewOptions } from "./LlmsViewOptions.js";
|
|
4
|
+
export { useMdUrl } from "./useMdUrl.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { NavItem, NavItemWithChildren, NavItemWithLink, NavItemWithLinkAndChildren } from '@rspress/core';
|
|
2
|
-
import type { HoverGroupProps } from '@theme';
|
|
2
|
+
import type { HoverGroupProps } from '@rspress/core/theme';
|
|
3
3
|
import { type ReactNode } from 'react';
|
|
4
4
|
import './NavMenu.scss';
|
|
5
5
|
export declare const SvgDown: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { matchNavbar, useLocation } from "@rspress/core/runtime";
|
|
3
|
-
import { IconArrowDown, Link, SvgWrapper, Tag, useHoverGroup } from "@theme";
|
|
3
|
+
import { IconArrowDown, Link, SvgWrapper, Tag, useHoverGroup } from "@rspress/core/theme";
|
|
4
4
|
import clsx from "clsx";
|
|
5
5
|
import { useMemo } from "react";
|
|
6
6
|
import { useLangsMenu, useVersionsMenu } from "./hooks.js";
|
|
@@ -13,6 +13,7 @@ function NavMenuItemInner({ menuItem, children }) {
|
|
|
13
13
|
return /*#__PURE__*/ jsx(Fragment, {
|
|
14
14
|
children: 'link' in menuItem && 'string' == typeof menuItem.link ? /*#__PURE__*/ jsxs(Link, {
|
|
15
15
|
href: menuItem.link,
|
|
16
|
+
download: menuItem.download,
|
|
16
17
|
className: "rp-nav-menu__item__container",
|
|
17
18
|
hrefLang: menuItem.lang,
|
|
18
19
|
lang: menuItem.lang,
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
@media (width >= 1280px) {
|
|
21
21
|
.rp-nav {
|
|
22
|
-
--rp-nav-padding-x: max(calc(( 100vw - var(--rp-content-max-width)
|
|
22
|
+
--rp-nav-padding-x: max(calc(( 100vw - var(--rp-content-max-width) - var(--rp-sidebar-width) - var(--rp-outline-width) ) / 2), 20px);
|
|
23
23
|
padding: 0 var(--rp-nav-padding-x) 0 var(--rp-nav-padding-x);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useNav, useSite } from "@rspress/core/runtime";
|
|
3
|
-
import { NavHamburger, NavTitle, Search, SocialLinks, SwitchAppearance } from "@theme";
|
|
3
|
+
import { NavHamburger, NavTitle, Search, SocialLinks, SwitchAppearance } from "@rspress/core/theme";
|
|
4
4
|
import "./index.css";
|
|
5
5
|
import { NavLangs, NavMenu, NavMenuDivider, NavVersions } from "./NavMenu.js";
|
|
6
6
|
function Nav(props) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { IconSmallMenu, SocialLinks, SvgWrapper, useHoverGroup } from "@theme";
|
|
2
|
+
import { IconSmallMenu, SocialLinks, SvgWrapper, useHoverGroup } from "@rspress/core/theme";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import { createPortal } from "react-dom";
|
|
5
5
|
import { NavVersions } from "../Nav/NavMenu.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { NoSSR, useI18n, useSite } from "@rspress/core/runtime";
|
|
3
|
-
import { SwitchAppearance } from "@theme";
|
|
3
|
+
import { SwitchAppearance } from "@rspress/core/theme";
|
|
4
4
|
import "./NavScreenAppearance.css";
|
|
5
5
|
function NavScreenAppearance() {
|
|
6
6
|
const { site } = useSite();
|
|
@@ -3,7 +3,7 @@ import { useState } from "react";
|
|
|
3
3
|
import { useLangsMenu } from "../Nav/hooks.js";
|
|
4
4
|
import "./NavScreenLangs.css";
|
|
5
5
|
import { useI18n } from "@rspress/core/runtime";
|
|
6
|
-
import { Link } from "@theme";
|
|
6
|
+
import { Link } from "@rspress/core/theme";
|
|
7
7
|
import clsx from "clsx";
|
|
8
8
|
import { SvgDown } from "./NavScreenMenuItem.js";
|
|
9
9
|
function NavScreenLangs() {
|
|
@@ -5,13 +5,14 @@ interface NavScreenMenuItemWithLinkProps {
|
|
|
5
5
|
menuItem: NavItemWithLink;
|
|
6
6
|
}
|
|
7
7
|
export declare const SvgDown: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export declare function NavScreenMenuItemRaw({ left, right, isOpen, isActive, onClick, href, }: {
|
|
8
|
+
export declare function NavScreenMenuItemRaw({ left, right, isOpen, isActive, onClick, href, download, }: {
|
|
9
9
|
left: React.ReactNode;
|
|
10
10
|
right: React.ReactNode;
|
|
11
11
|
isOpen?: boolean;
|
|
12
12
|
isActive?: boolean;
|
|
13
13
|
onClick?: () => void;
|
|
14
14
|
href?: string;
|
|
15
|
+
download?: boolean;
|
|
15
16
|
}): import("react/jsx-runtime").JSX.Element;
|
|
16
17
|
export declare function NavScreenMenuItemWithLink({ menuItem, }: NavScreenMenuItemWithLinkProps): import("react/jsx-runtime").JSX.Element;
|
|
17
18
|
interface NavScreenMenuItemWithChildrenProps {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { matchNavbar, useLocation } from "@rspress/core/runtime";
|
|
3
|
-
import { IconArrowDown, Link, SvgWrapper, Tag } from "@theme";
|
|
3
|
+
import { IconArrowDown, Link, SvgWrapper, Tag } from "@rspress/core/theme";
|
|
4
4
|
import clsx from "clsx";
|
|
5
5
|
import { useMemo, useState } from "react";
|
|
6
6
|
import "./NavScreenMenuItem.css";
|
|
@@ -8,11 +8,12 @@ const SvgDown = (props)=>/*#__PURE__*/ jsx(SvgWrapper, {
|
|
|
8
8
|
icon: IconArrowDown,
|
|
9
9
|
...props
|
|
10
10
|
});
|
|
11
|
-
function NavScreenMenuItemRaw({ left, right, isOpen, isActive, onClick, href }) {
|
|
11
|
+
function NavScreenMenuItemRaw({ left, right, isOpen, isActive, onClick, href, download }) {
|
|
12
12
|
if (href) return /*#__PURE__*/ jsxs(Link, {
|
|
13
13
|
href: href,
|
|
14
14
|
className: clsx('rp-nav-screen-menu-item', isOpen && 'rp-nav-screen-menu-item--open', isActive && 'rp-nav-screen-menu-item--active'),
|
|
15
15
|
onClick: onClick,
|
|
16
|
+
download: download,
|
|
16
17
|
children: [
|
|
17
18
|
/*#__PURE__*/ jsx("div", {
|
|
18
19
|
className: "rp-nav-screen-menu-item__left",
|
|
@@ -56,6 +57,7 @@ function NavScreenMenuItemWithLink({ menuItem }) {
|
|
|
56
57
|
}),
|
|
57
58
|
right: null,
|
|
58
59
|
href: menuItem.link,
|
|
60
|
+
download: menuItem.download,
|
|
59
61
|
isActive: isActive
|
|
60
62
|
});
|
|
61
63
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { NoSSR, useSite } from "@rspress/core/runtime";
|
|
3
|
-
import { SocialLinks, SwitchAppearance } from "@theme";
|
|
3
|
+
import { SocialLinks, SwitchAppearance } from "@rspress/core/theme";
|
|
4
4
|
import "./index.css";
|
|
5
5
|
import { NavScreenLangs } from "./NavScreenLangs.js";
|
|
6
6
|
import { NavScreenVersions } from "./NavScreenVersions.js";
|
|
@@ -3,7 +3,7 @@ import { useState } from "react";
|
|
|
3
3
|
import { useVersionsMenu } from "../Nav/hooks.js";
|
|
4
4
|
import "./NavScreenVersions.css";
|
|
5
5
|
import { useI18n } from "@rspress/core/runtime";
|
|
6
|
-
import { Link } from "@theme";
|
|
6
|
+
import { Link } from "@rspress/core/theme";
|
|
7
7
|
import clsx from "clsx";
|
|
8
8
|
import { SvgDown } from "./NavScreenMenuItem.js";
|
|
9
9
|
function NavScreenVersions() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useNav } from "@rspress/core/runtime";
|
|
3
|
-
import { SocialLinks } from "@theme";
|
|
3
|
+
import { SocialLinks } from "@rspress/core/theme";
|
|
4
4
|
import { clearAllBodyScrollLocks, disableBodyScroll } from "body-scroll-lock";
|
|
5
5
|
import clsx from "clsx";
|
|
6
6
|
import { useEffect, useRef } from "react";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { addLeadingSlash, addTrailingSlash, normalizeImagePath, useLang, useSite } from "@rspress/core/runtime";
|
|
3
|
-
import { Link } from "@theme";
|
|
3
|
+
import { Link } from "@rspress/core/theme";
|
|
4
4
|
import { useMemo } from "react";
|
|
5
5
|
import "./index.css";
|
|
6
6
|
const NavTitle = ()=>{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useI18n } from "@rspress/core/runtime";
|
|
3
|
-
import { IconScrollToTop, SvgWrapper, useReadPercent } from "@theme";
|
|
3
|
+
import { IconScrollToTop, SvgWrapper, useReadPercent } from "@rspress/core/theme";
|
|
4
4
|
function ScrollToTop() {
|
|
5
5
|
const scrollToTop = ()=>{
|
|
6
6
|
window.scrollTo({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useI18n, useSite } from "@rspress/core/runtime";
|
|
3
|
-
import { EditLink, LlmsCopyRow, LlmsOpenRow, ReadPercent, Toc, useDynamicToc } from "@theme";
|
|
3
|
+
import { EditLink, LlmsCopyRow, LlmsOpenRow, ReadPercent, Toc, useDynamicToc } from "@rspress/core/theme";
|
|
4
4
|
import "./index.css";
|
|
5
5
|
import { ScrollToTop } from "./ScrollToTop.js";
|
|
6
6
|
function Outline() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { isEqualPath, useI18n, usePageData, useSidebar } from "@rspress/core/runtime";
|
|
3
|
-
import { FallbackHeading, OverviewGroup } from "@theme";
|
|
3
|
+
import { FallbackHeading, OverviewGroup } from "@rspress/core/theme";
|
|
4
4
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
5
5
|
import { isSidebarDivider, isSidebarSectionHeader, isSidebarSingleFile } from "../Sidebar/utils.js";
|
|
6
6
|
import "./index.css";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { FallbackHeading, Link, SvgWrapper, renderInlineMarkdown } from "@theme";
|
|
2
|
+
import { FallbackHeading, Link, SvgWrapper, renderInlineMarkdown } from "@rspress/core/theme";
|
|
3
3
|
import "./index.css";
|
|
4
4
|
import { routePathToMdPath } from "@rspress/core/runtime";
|
|
5
5
|
import { useMemo } from "react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Tab, Tabs, getCustomMDXComponent } from "@theme";
|
|
2
|
+
import { Tab, Tabs, getCustomMDXComponent } from "@rspress/core/theme";
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
import { Bun } from "./icons/Bun.js";
|
|
5
5
|
import { Deno } from "./icons/Deno.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useI18n } from "@rspress/core/runtime";
|
|
3
|
-
import { IconArrowRight, Link, SvgWrapper, renderInlineMarkdown, usePrevNextPage } from "@theme";
|
|
3
|
+
import { IconArrowRight, Link, SvgWrapper, renderInlineMarkdown, usePrevNextPage } from "@rspress/core/theme";
|
|
4
4
|
import clsx from "clsx";
|
|
5
5
|
import "./index.css";
|
|
6
6
|
function PrevNextPage() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useI18n } from "@rspress/core/runtime";
|
|
3
|
-
import { IconEmpty, SvgWrapper } from "@theme";
|
|
3
|
+
import { IconEmpty, SvgWrapper } from "@rspress/core/theme";
|
|
4
4
|
import "./NoSearchResult.css";
|
|
5
5
|
function NoSearchResult({ query }) {
|
|
6
6
|
const t = useI18n();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useI18n } from "@rspress/core/runtime";
|
|
3
|
-
import { IconSearch, SvgWrapper } from "@theme";
|
|
3
|
+
import { IconSearch, SvgWrapper } from "@rspress/core/theme";
|
|
4
4
|
import { useEffect, useState } from "react";
|
|
5
5
|
import "./SearchButton.css";
|
|
6
6
|
function SearchButton({ setFocused }) {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useI18n, usePageData } from "@rspress/core/runtime";
|
|
3
|
-
import { IconClose, IconLoading, IconSearch, SvgWrapper, Tab, Tabs, useLinkNavigate } from "@theme";
|
|
3
|
+
import { IconClose, IconLoading, IconSearch, SvgWrapper, Tab, Tabs, useLinkNavigate } from "@rspress/core/theme";
|
|
4
4
|
import { debounce } from "lodash-es";
|
|
5
5
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
6
6
|
import { createPortal } from "react-dom";
|
|
7
|
+
import * as __rspack_external_virtual_search_hooks_9d01d01f from "virtual-search-hooks";
|
|
7
8
|
import { PageSearcher } from "./logic/search.js";
|
|
8
9
|
import { RenderType } from "./logic/types.js";
|
|
9
10
|
import { NoSearchResult } from "./NoSearchResult.js";
|
|
10
11
|
import "./SearchPanel.css";
|
|
11
12
|
import { SuggestItem } from "./SuggestItem.js";
|
|
12
|
-
import * as __rspack_external_virtual_search_hooks_9d01d01f from "virtual-search-hooks";
|
|
13
13
|
const KEY_CODE = {
|
|
14
14
|
ARROW_UP: 'ArrowUp',
|
|
15
15
|
ARROW_DOWN: 'ArrowDown',
|
|
@@ -215,6 +215,7 @@ function SearchPanel({ focused, setFocused }) {
|
|
|
215
215
|
}
|
|
216
216
|
const currQuery = searchInputRef.current?.value;
|
|
217
217
|
if (currQuery === newQuery) {
|
|
218
|
+
setCurrentSuggestionIndex(0);
|
|
218
219
|
setSearchResult(searchResult || DEFAULT_RESULT);
|
|
219
220
|
setIsSearching(false);
|
|
220
221
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { IconFile, IconHeader, IconJump, IconTitle, Link, SvgWrapper } from "@theme";
|
|
2
|
+
import { IconFile, IconHeader, IconJump, IconTitle, Link, SvgWrapper } from "@rspress/core/theme";
|
|
3
3
|
import { useRef } from "react";
|
|
4
4
|
import "./SuggestItem.css";
|
|
5
5
|
import { getSlicedStrByByteLength } from "./logic/util.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { NoSSR } from "@rspress/core/runtime";
|
|
3
|
-
import { SearchButton, SearchPanel } from "@theme";
|
|
3
|
+
import { SearchButton, SearchPanel } from "@rspress/core/theme";
|
|
4
4
|
import { useState } from "react";
|
|
5
5
|
function Search() {
|
|
6
6
|
const [focused, setFocused] = useState(false);
|