@rspress/core 2.0.0-rc.1 → 2.0.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/rspress.js +1 -1
- package/dist/0~7675.723d12b2.js +1794 -0
- package/dist/3521.56e42d70.js +56 -0
- package/dist/4669.12208c6a.js +2 -0
- package/dist/5485.077f14ff.js +98 -0
- package/dist/6289.c67fe0d5.js +5 -0
- package/dist/8813.9da1f210.js +2 -0
- package/dist/9643.f109822d.js +5 -0
- package/dist/_private/react/render.js +17 -4
- 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/Badge/index.scss +1 -0
- package/dist/eject-theme/components/Banner/index.tsx +6 -5
- package/dist/eject-theme/components/Callout/index.scss +0 -2
- package/dist/eject-theme/components/Callout/index.tsx +8 -2
- package/dist/eject-theme/components/CodeBlock/index.scss +12 -18
- package/dist/eject-theme/components/CodeBlock/index.tsx +10 -1
- package/dist/eject-theme/components/CodeBlockRuntime/index.tsx +50 -11
- 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 +27 -7
- package/dist/eject-theme/components/DocContent/docComponents/pre.tsx +2 -1
- package/dist/eject-theme/components/DocContent/docComponents/table.tsx +10 -4
- package/dist/eject-theme/components/DocContent/index.tsx +21 -4
- package/dist/eject-theme/components/DocFooter/index.tsx +1 -6
- package/dist/eject-theme/components/{DocContent/FallbackHeading.tsx → FallbackHeading/index.tsx} +20 -11
- package/dist/eject-theme/components/HoverGroup/index.scss +1 -1
- package/dist/eject-theme/components/LastUpdated/index.tsx +8 -1
- package/dist/eject-theme/components/Link/index.tsx +22 -6
- package/dist/eject-theme/components/Nav/NavMenu.tsx +2 -3
- package/dist/eject-theme/components/NavHamburger/index.tsx +3 -4
- package/dist/eject-theme/components/NavScreen/NavScreenLangs.scss +6 -0
- package/dist/eject-theme/components/NavScreen/NavScreenLangs.tsx +23 -9
- package/dist/eject-theme/components/NavScreen/NavScreenMenuItem.tsx +2 -3
- package/dist/eject-theme/components/NavScreen/NavScreenVersions.scss +6 -0
- package/dist/eject-theme/components/NavScreen/NavScreenVersions.tsx +22 -9
- package/dist/eject-theme/components/Overview/index.tsx +7 -8
- package/dist/eject-theme/components/{Overview/OverviewGroup.scss → OverviewGroup/index.scss} +66 -12
- package/dist/eject-theme/components/{Overview/OverviewGroup.tsx → OverviewGroup/index.tsx} +51 -5
- 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 +12 -7
- package/dist/eject-theme/components/Search/SuggestItem.tsx +15 -12
- package/dist/eject-theme/components/Search/logic/util.test.ts +1 -1
- package/dist/eject-theme/components/Sidebar/SidebarGroup.tsx +2 -3
- package/dist/eject-theme/components/Sidebar/SidebarItem.tsx +1 -0
- 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.tsx +6 -4
- package/dist/eject-theme/components/SwitchAppearance/index.tsx +3 -5
- package/dist/eject-theme/components/Tabs/index.scss +31 -26
- package/dist/eject-theme/components/Tabs/index.tsx +16 -0
- package/dist/eject-theme/components/Tag/index.tsx +84 -5
- package/dist/eject-theme/components/Toc/TocItem.scss +3 -3
- 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 +142 -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 +230 -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 +2 -0
- package/dist/node/constants.js +34 -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 +346 -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} +4 -3
- package/dist/node/mdx/options.d.ts +2 -2
- package/dist/node/mdx/options.js +103 -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 +84 -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 +244 -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 +10 -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/initPageData.js +1 -1
- 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/deprecated.js +18 -0
- package/dist/theme/assets/experimental.js +21 -0
- package/dist/theme/components/Badge/index.css +1 -0
- package/dist/theme/components/Banner/index.d.ts +1 -1
- package/dist/theme/components/Banner/index.js +4 -5
- package/dist/theme/components/Callout/index.css +0 -2
- package/dist/theme/components/Callout/index.js +5 -2
- package/dist/theme/components/CodeBlock/index.css +11 -21
- package/dist/theme/components/CodeBlock/index.js +5 -1
- package/dist/theme/components/CodeBlockRuntime/index.d.ts +1 -1
- package/dist/theme/components/CodeBlockRuntime/index.js +38 -8
- 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 +28 -7
- package/dist/theme/components/DocContent/docComponents/index.d.ts +3 -3
- package/dist/theme/components/DocContent/docComponents/pre.js +3 -1
- 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.d.ts +11 -2
- package/dist/theme/components/DocContent/index.js +6 -6
- package/dist/theme/components/DocFooter/index.js +1 -5
- package/dist/theme/components/{DocContent/FallbackHeading.js → FallbackHeading/index.js} +19 -11
- package/dist/theme/components/HoverGroup/index.css +3 -3
- package/dist/theme/components/HoverGroup/useHoverGroup.d.ts +1 -1
- package/dist/theme/components/LastUpdated/index.d.ts +1 -1
- package/dist/theme/components/LastUpdated/index.js +5 -1
- package/dist/theme/components/Link/index.d.ts +1 -1
- package/dist/theme/components/Link/index.js +17 -7
- package/dist/theme/components/Nav/NavMenu.js +2 -3
- package/dist/theme/components/NavHamburger/index.js +3 -4
- package/dist/theme/components/NavScreen/NavScreenLangs.css +6 -0
- package/dist/theme/components/NavScreen/NavScreenLangs.js +13 -3
- package/dist/theme/components/NavScreen/NavScreenMenuItem.js +2 -3
- package/dist/theme/components/NavScreen/NavScreenVersions.css +6 -0
- package/dist/theme/components/NavScreen/NavScreenVersions.js +12 -3
- package/dist/theme/components/Overview/index.d.ts +0 -1
- package/dist/theme/components/Overview/index.js +2 -3
- package/dist/theme/components/{Overview/OverviewGroup.css → OverviewGroup/index.css} +60 -8
- package/dist/theme/components/{Overview/OverviewGroup.d.ts → OverviewGroup/index.d.ts} +1 -1
- package/dist/theme/components/OverviewGroup/index.js +88 -0
- 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 +12 -15
- 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/Search/logic/util.test.js +1 -1
- package/dist/theme/components/Sidebar/SidebarGroup.js +2 -3
- package/dist/theme/components/Sidebar/SidebarItem.js +1 -0
- package/dist/theme/components/SidebarMenu/index.js +3 -5
- package/dist/theme/components/SocialLinks/index.js +2 -3
- 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 +19 -27
- package/dist/theme/components/Tabs/index.js +9 -0
- package/dist/theme/components/Tag/index.d.ts +3 -0
- package/dist/theme/components/Tag/index.js +63 -8
- package/dist/theme/components/Toc/TocItem.css +2 -3
- package/dist/theme/components/Toc/TocItem.js +1 -0
- package/dist/theme/hooks/useActiveAnchor.js +1 -1
- package/dist/theme/icons.d.ts +27 -0
- package/dist/theme/icons.js +51 -0
- package/dist/theme/index.d.ts +64 -59
- package/dist/theme/index.js +7 -2
- package/dist/theme/layout/DocLayout/index.css +2 -4
- package/dist/theme/layout/Layout/index.js +1 -2
- package/dist/theme/layout/NotFountLayout/index.js +1 -1
- package/dist/theme/logic/useAppearance.js +1 -1
- package/dist/theme/logic/useFullTextSearch.d.ts +1 -1
- package/dist/theme/logic/useMediaQuery.js +1 -1
- package/dist/theme/styles/base.css +1 -0
- package/dist/theme/styles/scrollbar.css +1 -0
- package/dist/theme/styles/shiki.css +9 -3
- package/dist/theme/styles/vars/base-vars.css +7 -5
- package/dist/theme/styles/vars/code-vars.css +2 -0
- package/dist/theme/styles/vars/home-vars.css +2 -1
- package/package.json +22 -23
- package/dist/3~128.js +0 -74
- package/dist/3~517.js +0 -1786
- package/dist/3~894.js +0 -26
- 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/Overview/OverviewGroup.js +0 -58
- 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/eject-theme/components/{Overview → OverviewGroup}/icons/plugin.svg +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/components/{Overview → OverviewGroup}/icons/plugin.js +0 -0
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useI18n, usePageData } from "@rspress/core/runtime";
|
|
3
|
-
import { SvgWrapper, Tab, Tabs, useLinkNavigate } from "@theme";
|
|
4
|
-
import _theme_assets_close from "@theme-assets/close";
|
|
5
|
-
import loading from "@theme-assets/loading";
|
|
6
|
-
import _theme_assets_search from "@theme-assets/search";
|
|
3
|
+
import { IconClose, IconLoading, IconSearch, SvgWrapper, Tab, Tabs, useLinkNavigate } from "@theme";
|
|
7
4
|
import { debounce } from "lodash-es";
|
|
8
5
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
9
6
|
import { createPortal } from "react-dom";
|
|
@@ -12,7 +9,7 @@ import { RenderType } from "./logic/types.js";
|
|
|
12
9
|
import { NoSearchResult } from "./NoSearchResult.js";
|
|
13
10
|
import "./SearchPanel.css";
|
|
14
11
|
import { SuggestItem } from "./SuggestItem.js";
|
|
15
|
-
import * as
|
|
12
|
+
import * as __rspack_external_virtual_search_hooks_9d01d01f from "virtual-search-hooks";
|
|
16
13
|
const KEY_CODE = {
|
|
17
14
|
ARROW_UP: 'ArrowUp',
|
|
18
15
|
ARROW_DOWN: 'ArrowDown',
|
|
@@ -197,24 +194,24 @@ function SearchPanel({ focused, setFocused }) {
|
|
|
197
194
|
setQuery(newQuery);
|
|
198
195
|
if (newQuery) {
|
|
199
196
|
const searchResult = [];
|
|
200
|
-
if ("beforeSearch" in
|
|
197
|
+
if ("beforeSearch" in __rspack_external_virtual_search_hooks_9d01d01f) {
|
|
201
198
|
const key = 'beforeSearch';
|
|
202
|
-
const transformedQuery = await
|
|
199
|
+
const transformedQuery = await __rspack_external_virtual_search_hooks_9d01d01f[key](newQuery);
|
|
203
200
|
if (transformedQuery) newQuery = transformedQuery;
|
|
204
201
|
}
|
|
205
202
|
const defaultSearchResult = await pageSearcherRef.current?.match(newQuery);
|
|
206
203
|
if (defaultSearchResult) searchResult.push(...defaultSearchResult);
|
|
207
|
-
if ("onSearch" in
|
|
204
|
+
if ("onSearch" in __rspack_external_virtual_search_hooks_9d01d01f) {
|
|
208
205
|
const key = 'onSearch';
|
|
209
|
-
const customSearchResult = await
|
|
206
|
+
const customSearchResult = await __rspack_external_virtual_search_hooks_9d01d01f[key](newQuery, searchResult);
|
|
210
207
|
if (customSearchResult) searchResult.push(...customSearchResult.map((item)=>({
|
|
211
208
|
renderType: RenderType.Custom,
|
|
212
209
|
...item
|
|
213
210
|
})));
|
|
214
211
|
}
|
|
215
|
-
if ("afterSearch" in
|
|
212
|
+
if ("afterSearch" in __rspack_external_virtual_search_hooks_9d01d01f) {
|
|
216
213
|
const key = 'afterSearch';
|
|
217
|
-
await
|
|
214
|
+
await __rspack_external_virtual_search_hooks_9d01d01f[key](newQuery, searchResult);
|
|
218
215
|
}
|
|
219
216
|
const currQuery = searchInputRef.current?.value;
|
|
220
217
|
if (currQuery === newQuery) {
|
|
@@ -255,7 +252,7 @@ function SearchPanel({ focused, setFocused }) {
|
|
|
255
252
|
children: result.map((item)=>/*#__PURE__*/ jsxs(Tab, {
|
|
256
253
|
children: [
|
|
257
254
|
item.renderType === RenderType.Default && renderSearchResultItem(item.result, query, isSearching),
|
|
258
|
-
item.renderType === RenderType.Custom &&
|
|
255
|
+
item.renderType === RenderType.Custom && __rspack_external_virtual_search_hooks_9d01d01f[renderKey](item.result)
|
|
259
256
|
]
|
|
260
257
|
}, item.group))
|
|
261
258
|
});
|
|
@@ -264,7 +261,7 @@ function SearchPanel({ focused, setFocused }) {
|
|
|
264
261
|
if (isSearching) return /*#__PURE__*/ jsx("div", {
|
|
265
262
|
className: "rp-search-panel__loading",
|
|
266
263
|
children: /*#__PURE__*/ jsx(SvgWrapper, {
|
|
267
|
-
icon:
|
|
264
|
+
icon: IconLoading
|
|
268
265
|
})
|
|
269
266
|
});
|
|
270
267
|
if (0 === suggestionList.length && 'inited' === initStatus) return /*#__PURE__*/ jsx(NoSearchResult, {
|
|
@@ -328,7 +325,7 @@ function SearchPanel({ focused, setFocused }) {
|
|
|
328
325
|
children: [
|
|
329
326
|
/*#__PURE__*/ jsx("label", {
|
|
330
327
|
children: /*#__PURE__*/ jsx(SvgWrapper, {
|
|
331
|
-
icon:
|
|
328
|
+
icon: IconSearch
|
|
332
329
|
})
|
|
333
330
|
}),
|
|
334
331
|
/*#__PURE__*/ jsx("input", {
|
|
@@ -342,7 +339,7 @@ function SearchPanel({ focused, setFocused }) {
|
|
|
342
339
|
}),
|
|
343
340
|
/*#__PURE__*/ jsx("label", {
|
|
344
341
|
children: /*#__PURE__*/ jsx(SvgWrapper, {
|
|
345
|
-
icon:
|
|
342
|
+
icon: IconClose,
|
|
346
343
|
className: "rp-search-panel__close",
|
|
347
344
|
onClick: (e)=>{
|
|
348
345
|
if (searchInputRef.current) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './SuggestItem.scss';
|
|
2
|
-
import type { DefaultMatchResultItem } from './logic/types';
|
|
2
|
+
import type { DefaultMatchResultItem } from './logic/types.js';
|
|
3
3
|
export declare function SuggestItem({ suggestion, closeSearch, isCurrent, setCurrentSuggestionIndex, scrollTo, onMouseMove, }: {
|
|
4
4
|
suggestion: DefaultMatchResultItem;
|
|
5
5
|
closeSearch: () => void;
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Link, SvgWrapper } from "@theme";
|
|
3
|
-
import file from "@theme-assets/file";
|
|
4
|
-
import _theme_assets_header from "@theme-assets/header";
|
|
5
|
-
import jump from "@theme-assets/jump";
|
|
6
|
-
import title from "@theme-assets/title";
|
|
2
|
+
import { IconFile, IconHeader, IconJump, IconTitle, Link, SvgWrapper } from "@theme";
|
|
7
3
|
import { useRef } from "react";
|
|
8
4
|
import "./SuggestItem.css";
|
|
9
5
|
import { getSlicedStrByByteLength } from "./logic/util.js";
|
|
10
|
-
const ICON_MAP = {
|
|
11
|
-
title: title,
|
|
12
|
-
header: _theme_assets_header,
|
|
13
|
-
content: file
|
|
14
|
-
};
|
|
15
6
|
function SuggestItem({ suggestion, closeSearch, isCurrent, setCurrentSuggestionIndex, scrollTo, onMouseMove }) {
|
|
7
|
+
const ICON_MAP = {
|
|
8
|
+
title: IconTitle,
|
|
9
|
+
header: IconHeader,
|
|
10
|
+
content: IconFile
|
|
11
|
+
};
|
|
16
12
|
const HitIcon = ICON_MAP[suggestion.type];
|
|
17
13
|
const selfRef = useRef(null);
|
|
18
14
|
if (isCurrent && selfRef.current?.offsetTop) scrollTo(selfRef.current?.offsetTop, selfRef.current?.offsetHeight);
|
|
@@ -104,7 +100,7 @@ function SuggestItem({ suggestion, closeSearch, isCurrent, setCurrentSuggestionI
|
|
|
104
100
|
/*#__PURE__*/ jsx("div", {
|
|
105
101
|
className: "rp-suggest-item__action-icon",
|
|
106
102
|
children: /*#__PURE__*/ jsx(SvgWrapper, {
|
|
107
|
-
icon:
|
|
103
|
+
icon: IconJump
|
|
108
104
|
})
|
|
109
105
|
})
|
|
110
106
|
]
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Powered by FlexSearch. https://github.com/nextapps-de/flexsearch
|
|
4
4
|
*/
|
|
5
5
|
import { type PageIndexInfo } from '@rspress/shared';
|
|
6
|
-
import { type Provider, type SearchQuery } from '../Provider';
|
|
7
|
-
import type { SearchOptions } from '../types';
|
|
6
|
+
import { type Provider, type SearchQuery } from '../Provider.js';
|
|
7
|
+
import type { SearchOptions } from '../types.js';
|
|
8
8
|
export declare class LocalProvider implements Provider {
|
|
9
9
|
#private;
|
|
10
10
|
fetchSearchIndex(options: SearchOptions): Promise<PageIndexInfo[]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PageIndexInfo } from '@rspress/core';
|
|
2
|
-
import { type MatchResult, type SearchOptions } from './types';
|
|
2
|
+
import { type MatchResult, type SearchOptions } from './types.js';
|
|
3
3
|
export declare class PageSearcher {
|
|
4
4
|
#private;
|
|
5
5
|
constructor(options: SearchOptions & {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useActiveMatcher } from "@rspress/core/runtime";
|
|
3
|
-
import { SvgWrapper, useLinkNavigate } from "@theme";
|
|
4
|
-
import arrow_right from "@theme-assets/arrow-right";
|
|
3
|
+
import { IconArrowRight, SvgWrapper, useLinkNavigate } from "@theme";
|
|
5
4
|
import clsx from "clsx";
|
|
6
5
|
import { SidebarDivider } from "./SidebarDivider.js";
|
|
7
6
|
import "./SidebarGroup.css";
|
|
@@ -15,7 +14,7 @@ const CollapsibleIcon = ({ collapsed })=>/*#__PURE__*/ jsx("div", {
|
|
|
15
14
|
transform: collapsed ? 'rotate(0deg)' : 'rotate(90deg)'
|
|
16
15
|
},
|
|
17
16
|
children: /*#__PURE__*/ jsx(SvgWrapper, {
|
|
18
|
-
icon:
|
|
17
|
+
icon: IconArrowRight
|
|
19
18
|
})
|
|
20
19
|
});
|
|
21
20
|
function SidebarGroup(props) {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useFrontmatter, useI18n, useLocation } from "@rspress/core/runtime";
|
|
3
|
-
import { ReadPercent, SvgWrapper, renderInlineMarkdown, useActiveAnchor, useDynamicToc } from "@theme";
|
|
4
|
-
import arrow_right from "@theme-assets/arrow-right";
|
|
5
|
-
import menu from "@theme-assets/menu";
|
|
3
|
+
import { IconArrowRight, IconMenu, ReadPercent, SvgWrapper, renderInlineMarkdown, useActiveAnchor, useDynamicToc } from "@theme";
|
|
6
4
|
import { forwardRef, useEffect, useRef } from "react";
|
|
7
5
|
import { createPortal } from "react-dom";
|
|
8
6
|
import "./index.css";
|
|
@@ -51,7 +49,7 @@ const SidebarMenu = /*#__PURE__*/ forwardRef(({ isSidebarOpen, onIsSidebarOpenCh
|
|
|
51
49
|
className: "rp-sidebar-menu__left",
|
|
52
50
|
children: [
|
|
53
51
|
/*#__PURE__*/ jsx(SvgWrapper, {
|
|
54
|
-
icon:
|
|
52
|
+
icon: IconMenu
|
|
55
53
|
}),
|
|
56
54
|
/*#__PURE__*/ jsx("span", {
|
|
57
55
|
children: t('menuTitle')
|
|
@@ -81,7 +79,7 @@ const SidebarMenu = /*#__PURE__*/ forwardRef(({ isSidebarOpen, onIsSidebarOpenCh
|
|
|
81
79
|
strokeWidth: 2
|
|
82
80
|
}),
|
|
83
81
|
0 !== headers.length && /*#__PURE__*/ jsx(SvgWrapper, {
|
|
84
|
-
icon:
|
|
82
|
+
icon: IconArrowRight,
|
|
85
83
|
style: {
|
|
86
84
|
transform: isOutlineOpen ? 'rotate(90deg)' : 'rotate(0deg)',
|
|
87
85
|
transition: 'transform 0.2s ease-out'
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useSite } from "@rspress/core/runtime";
|
|
3
|
-
import { SvgWrapper } from "@theme";
|
|
4
|
-
import arrow_down from "@theme-assets/arrow-down";
|
|
3
|
+
import { IconArrowDown, SvgWrapper } from "@theme";
|
|
5
4
|
import "./index.css";
|
|
6
5
|
import { useHoverGroup } from "../HoverGroup/useHoverGroup.js";
|
|
7
6
|
import { SocialLink } from "./SocialLink.js";
|
|
@@ -32,7 +31,7 @@ const SocialLinks = ({ socialLinks: socialLinksFromProps })=>{
|
|
|
32
31
|
hoverGroupPosition: index === shownLinks.length - 1 ? 'right' : 'center'
|
|
33
32
|
}, item.content)),
|
|
34
33
|
isMore ? /*#__PURE__*/ jsx(SvgWrapper, {
|
|
35
|
-
icon:
|
|
34
|
+
icon: IconArrowDown,
|
|
36
35
|
onMouseEnter: handleMouseEnter,
|
|
37
36
|
fontSize: 20
|
|
38
37
|
}) : null,
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useI18n } from "@rspress/core/runtime";
|
|
3
|
-
import { SvgWrapper } from "@theme";
|
|
4
|
-
import github from "@theme-assets/github";
|
|
5
|
-
import gitlab from "@theme-assets/gitlab";
|
|
3
|
+
import { IconGithub, IconGitlab, SvgWrapper } from "@theme";
|
|
6
4
|
import "./index.css";
|
|
7
5
|
function SourceCode(props) {
|
|
8
6
|
const { href, platform = 'github' } = props;
|
|
@@ -17,7 +15,7 @@ function SourceCode(props) {
|
|
|
17
15
|
/*#__PURE__*/ jsx("span", {
|
|
18
16
|
className: "rp-source-code__icon",
|
|
19
17
|
children: /*#__PURE__*/ jsx(SvgWrapper, {
|
|
20
|
-
icon: 'gitlab' === platform ?
|
|
18
|
+
icon: 'gitlab' === platform ? IconGitlab : IconGithub
|
|
21
19
|
})
|
|
22
20
|
}),
|
|
23
21
|
/*#__PURE__*/ jsx("span", {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ThemeContext, useSite } from "@rspress/core/runtime";
|
|
3
|
-
import { SvgWrapper } from "@theme";
|
|
4
|
-
import moon from "@theme-assets/moon";
|
|
5
|
-
import sun from "@theme-assets/sun";
|
|
3
|
+
import { IconMoon, IconSun, SvgWrapper } from "@theme";
|
|
6
4
|
import { useContext } from "react";
|
|
7
5
|
import "./global.css";
|
|
8
6
|
import "./index.css";
|
|
@@ -68,12 +66,12 @@ function SwitchAppearance({ onClick }) {
|
|
|
68
66
|
children: [
|
|
69
67
|
/*#__PURE__*/ jsx(SvgWrapper, {
|
|
70
68
|
className: "rp-switch-appearance__icon rp-switch-appearance__icon--sun",
|
|
71
|
-
icon:
|
|
69
|
+
icon: IconSun,
|
|
72
70
|
fill: "currentColor"
|
|
73
71
|
}),
|
|
74
72
|
/*#__PURE__*/ jsx(SvgWrapper, {
|
|
75
73
|
className: "rp-switch-appearance__icon rp-switch-appearance__icon--moon",
|
|
76
|
-
icon:
|
|
74
|
+
icon: IconMoon,
|
|
77
75
|
fill: "currentColor"
|
|
78
76
|
})
|
|
79
77
|
]
|
|
@@ -2,17 +2,18 @@
|
|
|
2
2
|
contain: content;
|
|
3
3
|
border-radius: var(--rp-radius);
|
|
4
4
|
border: var(--rp-code-block-border);
|
|
5
|
+
box-shadow: var(--rp-code-block-shadow);
|
|
5
6
|
margin: 1rem 0;
|
|
6
7
|
}
|
|
7
8
|
|
|
8
|
-
.rp-tabs .rp-codeblock {
|
|
9
|
-
border: none
|
|
10
|
-
border-radius: 0
|
|
11
|
-
margin: 0
|
|
9
|
+
.rp-tabs .rp-tabs, .rp-tabs .rp-codeblock {
|
|
10
|
+
border: none;
|
|
11
|
+
border-radius: 0;
|
|
12
|
+
margin: 0;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
.rp-tabs .rp-codeblock .rp-codeblock__title {
|
|
15
|
-
padding: 8px
|
|
16
|
+
padding: 8px 12px;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
.rp-tabs__label {
|
|
@@ -20,8 +21,7 @@
|
|
|
20
21
|
border-bottom: var(--rp-code-block-border);
|
|
21
22
|
flex-wrap: wrap;
|
|
22
23
|
min-width: 100%;
|
|
23
|
-
padding
|
|
24
|
-
padding-left: 8px;
|
|
24
|
+
padding: 4px 12px;
|
|
25
25
|
display: flex;
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -40,9 +40,11 @@
|
|
|
40
40
|
box-sizing: border-box;
|
|
41
41
|
user-select: none;
|
|
42
42
|
cursor: pointer;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
border-radius: var(--rp-radius-small);
|
|
44
|
+
margin-right: 4px;
|
|
45
|
+
padding: 4px 12px;
|
|
46
|
+
font-size: .875rem;
|
|
47
|
+
transition: color .2s ease-out, background-color .2s ease-out;
|
|
46
48
|
position: relative;
|
|
47
49
|
}
|
|
48
50
|
|
|
@@ -50,28 +52,14 @@
|
|
|
50
52
|
margin-right: 0;
|
|
51
53
|
}
|
|
52
54
|
|
|
53
|
-
.rp-tabs__label__item:after {
|
|
54
|
-
content: "";
|
|
55
|
-
background-color: #0000;
|
|
56
|
-
width: 90%;
|
|
57
|
-
height: 1px;
|
|
58
|
-
transition: background-color .3s ease-out;
|
|
59
|
-
position: absolute;
|
|
60
|
-
bottom: 0;
|
|
61
|
-
left: 5%;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
55
|
.rp-tabs__label__item--not-selected:hover {
|
|
65
|
-
color: var(--rp-c-
|
|
66
|
-
opacity: .8;
|
|
56
|
+
background-color: var(--rp-c-bg-mute);
|
|
67
57
|
}
|
|
68
58
|
|
|
69
59
|
.rp-tabs__label__item--selected {
|
|
70
60
|
color: var(--rp-c-text-0);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
.rp-tabs__label__item--selected:after {
|
|
74
|
-
background-color: currentColor;
|
|
61
|
+
background-color: var(--rp-c-bg);
|
|
62
|
+
box-shadow: 0px 0px 3px 0px var(--rp-c-divider);
|
|
75
63
|
}
|
|
76
64
|
|
|
77
65
|
.rp-tabs__content__item--active {
|
|
@@ -82,3 +70,7 @@
|
|
|
82
70
|
display: none;
|
|
83
71
|
}
|
|
84
72
|
|
|
73
|
+
.dark .rp-tabs__label__item--selected {
|
|
74
|
+
background-color: var(--rp-c-bg-soft);
|
|
75
|
+
}
|
|
76
|
+
|
|
@@ -35,6 +35,15 @@ const Tabs = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
35
35
|
values,
|
|
36
36
|
children
|
|
37
37
|
]);
|
|
38
|
+
if (process.env.__SSR_MD__) return /*#__PURE__*/ jsx(Fragment, {
|
|
39
|
+
children: tabValues.map(({ label, content })=>/*#__PURE__*/ jsxs(Fragment, {
|
|
40
|
+
children: [
|
|
41
|
+
`\n**${label}**\n\n`,
|
|
42
|
+
content,
|
|
43
|
+
`\n`
|
|
44
|
+
]
|
|
45
|
+
}))
|
|
46
|
+
});
|
|
38
47
|
const [activeIndex, setActiveIndex] = useState(defaultIndex ?? 0);
|
|
39
48
|
const [storageIndex, setStorageIndex] = useStorageValue(`${groupIdPrefix}${groupId}`, activeIndex.toString());
|
|
40
49
|
const currentIndex = groupId ? Number(storageIndex) : activeIndex;
|
|
@@ -1,11 +1,40 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { isDataUrl, isExternalUrl } from "@rspress/core/runtime";
|
|
3
|
-
import { Badge } from "
|
|
4
|
-
|
|
3
|
+
import { Badge, IconDeprecated, IconExperimental, SvgWrapper, Tag } from "@theme";
|
|
4
|
+
import { useMemo } from "react";
|
|
5
|
+
const BADGE_TAGS = {
|
|
6
|
+
tip: 'tip',
|
|
7
|
+
info: 'info',
|
|
8
|
+
warning: 'warning',
|
|
9
|
+
danger: 'danger'
|
|
10
|
+
};
|
|
11
|
+
function parseCommonTagsArrayStr(tagStr) {
|
|
12
|
+
const tags = tagStr.split(',').map((tag)=>tag.trim()).filter((tag)=>tag.length > 0);
|
|
13
|
+
return tags;
|
|
14
|
+
}
|
|
15
|
+
const getTagType = (tag)=>{
|
|
16
|
+
const normalizedTag = tag.trim();
|
|
17
|
+
const isSvgTagString = normalizedTag.startsWith('<svg');
|
|
18
|
+
const isPic = isExternalUrl(normalizedTag) || isDataUrl(normalizedTag);
|
|
19
|
+
const tagsArray = parseCommonTagsArrayStr(normalizedTag);
|
|
20
|
+
return {
|
|
21
|
+
isSvgTagString,
|
|
22
|
+
isPic,
|
|
23
|
+
isTagsArray: tagsArray && tagsArray?.length > 1,
|
|
24
|
+
tagsArray,
|
|
25
|
+
normalizedTag
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
const Tag_Tag = ({ tag })=>{
|
|
5
29
|
if (!tag) return null;
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
30
|
+
const { isPic, isTagsArray, isSvgTagString, normalizedTag, tagsArray } = useMemo(()=>getTagType(tag), [
|
|
31
|
+
tag
|
|
32
|
+
]);
|
|
33
|
+
if (isTagsArray) return /*#__PURE__*/ jsx(Fragment, {
|
|
34
|
+
children: tagsArray?.map((tag, index)=>/*#__PURE__*/ jsx(Tag, {
|
|
35
|
+
tag: tag
|
|
36
|
+
}, `${tag}-${index}`))
|
|
37
|
+
});
|
|
9
38
|
if (isSvgTagString) return /*#__PURE__*/ jsx("div", {
|
|
10
39
|
dangerouslySetInnerHTML: {
|
|
11
40
|
__html: tag
|
|
@@ -18,9 +47,35 @@ const Tag = ({ tag })=>{
|
|
|
18
47
|
if (isPic) return /*#__PURE__*/ jsx("img", {
|
|
19
48
|
src: tag
|
|
20
49
|
});
|
|
50
|
+
if ('experimental' === normalizedTag) return /*#__PURE__*/ jsxs(Badge, {
|
|
51
|
+
type: "warning",
|
|
52
|
+
children: [
|
|
53
|
+
/*#__PURE__*/ jsx(SvgWrapper, {
|
|
54
|
+
icon: IconExperimental
|
|
55
|
+
}),
|
|
56
|
+
/*#__PURE__*/ jsx("span", {
|
|
57
|
+
children: "experimental"
|
|
58
|
+
})
|
|
59
|
+
]
|
|
60
|
+
});
|
|
61
|
+
if ('deprecated' === normalizedTag) return /*#__PURE__*/ jsxs(Badge, {
|
|
62
|
+
type: "danger",
|
|
63
|
+
children: [
|
|
64
|
+
/*#__PURE__*/ jsx(SvgWrapper, {
|
|
65
|
+
icon: IconDeprecated
|
|
66
|
+
}),
|
|
67
|
+
/*#__PURE__*/ jsx("span", {
|
|
68
|
+
children: "deprecated"
|
|
69
|
+
})
|
|
70
|
+
]
|
|
71
|
+
});
|
|
72
|
+
if (BADGE_TAGS[normalizedTag]) return /*#__PURE__*/ jsx(Badge, {
|
|
73
|
+
text: normalizedTag,
|
|
74
|
+
type: BADGE_TAGS[normalizedTag]
|
|
75
|
+
});
|
|
21
76
|
return /*#__PURE__*/ jsx(Badge, {
|
|
22
|
-
text:
|
|
77
|
+
text: normalizedTag,
|
|
23
78
|
type: "info"
|
|
24
79
|
});
|
|
25
80
|
};
|
|
26
|
-
export { Tag };
|
|
81
|
+
export { Tag_Tag as Tag };
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
justify-content: flex-start;
|
|
3
3
|
align-self: stretch;
|
|
4
4
|
align-items: flex-start;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
margin-top: 10px;
|
|
6
|
+
line-height: 1.4;
|
|
7
7
|
display: block;
|
|
8
8
|
position: relative;
|
|
9
9
|
}
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
overflow-wrap: break-word;
|
|
18
18
|
font-size: 14px;
|
|
19
19
|
font-weight: 400;
|
|
20
|
-
line-height: 1;
|
|
21
20
|
}
|
|
22
21
|
|
|
23
22
|
.rp-toc-item--active .rp-toc-item__text, .rp-toc-item--active .rp-toc-item__text code {
|
|
@@ -29,6 +29,7 @@ const TocItem = ({ header, baseHeaderLevel, active })=>{
|
|
|
29
29
|
style: {
|
|
30
30
|
paddingLeft: (header.depth - baseHeaderLevel) * 12
|
|
31
31
|
},
|
|
32
|
+
'data-depth': header.depth - baseHeaderLevel,
|
|
32
33
|
children: /*#__PURE__*/ jsx("span", {
|
|
33
34
|
className: "rp-toc-item__text rp-doc",
|
|
34
35
|
...renderInlineMarkdown(header.text)
|
|
@@ -11,7 +11,7 @@ const useActiveAnchor = (headers)=>{
|
|
|
11
11
|
const [scrolledHeader, setScrolledHeader] = useState();
|
|
12
12
|
const { hash } = useLocation();
|
|
13
13
|
useEffect(()=>{
|
|
14
|
-
if (
|
|
14
|
+
if ("u" < typeof window) return;
|
|
15
15
|
const handleScroll = ()=>{
|
|
16
16
|
const scrollPaddingTop = parseCSSLength(window.getComputedStyle(document.documentElement).getPropertyValue('scroll-padding-top'));
|
|
17
17
|
const topOffset = scrollPaddingTop - 5;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
type Icon = React.FC<React.SVGProps<SVGSVGElement>> | string;
|
|
2
|
+
export declare const IconDeprecated: Icon;
|
|
3
|
+
export declare const IconExperimental: Icon;
|
|
4
|
+
export declare const IconArrowDown: Icon;
|
|
5
|
+
export declare const IconArrowRight: Icon;
|
|
6
|
+
export declare const IconClose: Icon;
|
|
7
|
+
export declare const IconCopy: Icon;
|
|
8
|
+
export declare const IconDown: Icon;
|
|
9
|
+
export declare const IconEmpty: Icon;
|
|
10
|
+
export declare const IconFile: Icon;
|
|
11
|
+
export declare const IconGithub: Icon;
|
|
12
|
+
export declare const IconGitlab: Icon;
|
|
13
|
+
export declare const IconHeader: Icon;
|
|
14
|
+
export declare const IconJump: Icon;
|
|
15
|
+
export declare const IconLoading: Icon;
|
|
16
|
+
export declare const IconMenu: Icon;
|
|
17
|
+
export declare const IconMoon: Icon;
|
|
18
|
+
export declare const IconRight: Icon;
|
|
19
|
+
export declare const IconSearch: Icon;
|
|
20
|
+
export declare const IconSmallMenu: Icon;
|
|
21
|
+
export declare const IconSuccess: Icon;
|
|
22
|
+
export declare const IconSun: Icon;
|
|
23
|
+
export declare const IconTitle: Icon;
|
|
24
|
+
export declare const IconTranslator: Icon;
|
|
25
|
+
export declare const IconWrap: Icon;
|
|
26
|
+
export declare const IconWrapped: Icon;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import arrow_down from "./assets/arrow-down.js";
|
|
2
|
+
import arrow_right from "./assets/arrow-right.js";
|
|
3
|
+
import assets_close from "./assets/close.js";
|
|
4
|
+
import copy from "./assets/copy.js";
|
|
5
|
+
import deprecated from "./assets/deprecated.js";
|
|
6
|
+
import down from "./assets/down.js";
|
|
7
|
+
import empty from "./assets/empty.js";
|
|
8
|
+
import experimental from "./assets/experimental.js";
|
|
9
|
+
import file from "./assets/file.js";
|
|
10
|
+
import github from "./assets/github.js";
|
|
11
|
+
import gitlab from "./assets/gitlab.js";
|
|
12
|
+
import header from "./assets/header.js";
|
|
13
|
+
import jump from "./assets/jump.js";
|
|
14
|
+
import loading from "./assets/loading.js";
|
|
15
|
+
import menu from "./assets/menu.js";
|
|
16
|
+
import moon from "./assets/moon.js";
|
|
17
|
+
import right from "./assets/right.js";
|
|
18
|
+
import search from "./assets/search.js";
|
|
19
|
+
import small_menu from "./assets/small-menu.js";
|
|
20
|
+
import success from "./assets/success.js";
|
|
21
|
+
import sun from "./assets/sun.js";
|
|
22
|
+
import title from "./assets/title.js";
|
|
23
|
+
import translator from "./assets/translator.js";
|
|
24
|
+
import wrap from "./assets/wrap.js";
|
|
25
|
+
import wrapped from "./assets/wrapped.js";
|
|
26
|
+
const IconDeprecated = deprecated;
|
|
27
|
+
const IconExperimental = experimental;
|
|
28
|
+
const IconArrowDown = arrow_down;
|
|
29
|
+
const IconArrowRight = arrow_right;
|
|
30
|
+
const IconClose = assets_close;
|
|
31
|
+
const IconCopy = copy;
|
|
32
|
+
const IconDown = down;
|
|
33
|
+
const IconEmpty = empty;
|
|
34
|
+
const IconFile = file;
|
|
35
|
+
const IconGithub = github;
|
|
36
|
+
const IconGitlab = gitlab;
|
|
37
|
+
const IconHeader = header;
|
|
38
|
+
const IconJump = jump;
|
|
39
|
+
const IconLoading = loading;
|
|
40
|
+
const IconMenu = menu;
|
|
41
|
+
const IconMoon = moon;
|
|
42
|
+
const IconRight = right;
|
|
43
|
+
const IconSearch = search;
|
|
44
|
+
const IconSmallMenu = small_menu;
|
|
45
|
+
const IconSuccess = success;
|
|
46
|
+
const IconSun = sun;
|
|
47
|
+
const IconTitle = title;
|
|
48
|
+
const IconTranslator = translator;
|
|
49
|
+
const IconWrap = wrap;
|
|
50
|
+
const IconWrapped = wrapped;
|
|
51
|
+
export { IconArrowDown, IconArrowRight, IconClose, IconCopy, IconDeprecated, IconDown, IconEmpty, IconExperimental, IconFile, IconGithub, IconGitlab, IconHeader, IconJump, IconLoading, IconMenu, IconMoon, IconRight, IconSearch, IconSmallMenu, IconSuccess, IconSun, IconTitle, IconTranslator, IconWrap, IconWrapped };
|