@rspress/core 2.1.0-beta.1 → 2.1.0
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/cli/index.js +2 -2
- package/dist/config/loadConfigFile.js +1 -1
- package/dist/eject-theme/components/CdnTabs/index.test.tsx +71 -0
- package/dist/eject-theme/components/CdnTabs/index.tsx +175 -0
- package/dist/eject-theme/components/DocContent/index.tsx +0 -3
- package/dist/eject-theme/components/FallbackHeading/index.tsx +6 -1
- package/dist/eject-theme/components/Link/index.tsx +9 -18
- package/dist/eject-theme/components/Link/useLinkNavigate.ts +17 -3
- package/dist/eject-theme/components/NavTitle/index.test.tsx +78 -0
- package/dist/eject-theme/components/NavTitle/index.tsx +9 -5
- package/dist/eject-theme/components/PackageManagerTabs/index.test.tsx +79 -1
- package/dist/eject-theme/components/PackageManagerTabs/index.tsx +25 -12
- package/dist/eject-theme/components/Search/NoSearchResult.scss +1 -2
- package/dist/eject-theme/components/Search/SearchPanel.scss +75 -63
- package/dist/eject-theme/components/Search/SuggestItem.scss +28 -41
- package/dist/eject-theme/components/Sidebar/SidebarItem.scss +8 -0
- package/dist/eject-theme/components/Sidebar/SidebarSectionHeader.scss +3 -0
- package/dist/node/PluginDriver.d.ts +5 -0
- package/dist/node/PluginDriver.js +14 -5
- package/dist/node/auto-nav-sidebar/index.js +1 -1
- package/dist/node/auto-nav-sidebar/locales.js +1 -1
- package/dist/node/auto-nav-sidebar/normalize.js +1 -1
- package/dist/node/auto-nav-sidebar/utils.js +1 -1
- package/dist/node/auto-nav-sidebar/walk.js +1 -1
- package/dist/node/constants.js +1 -1
- package/dist/node/eject.js +1 -1
- package/dist/node/initRsbuild.js +12 -4
- package/dist/node/mdx/rehypePlugins/headerAnchor.js +1 -0
- package/dist/node/mdx/remarkPlugins/link.js +1 -1
- package/dist/node/route/RoutePage.js +1 -1
- package/dist/node/route/RouteService.js +1 -1
- package/dist/node/route/extractPageData.js +1 -1
- package/dist/node/route/normalizeRoutePath.js +1 -1
- package/dist/node/runtimeModule/{DEFAULT_I18N_TEXT.d.ts → i18n/DEFAULT_I18N_TEXT.d.ts} +34 -0
- package/dist/node/runtimeModule/{DEFAULT_I18N_TEXT.js → i18n/DEFAULT_I18N_TEXT.js} +68 -34
- package/dist/node/runtimeModule/i18n/getI18nData.d.ts +11 -0
- package/dist/node/runtimeModule/{i18n.js → i18n/getI18nData.js} +35 -22
- package/dist/node/runtimeModule/i18n/rsbuildPlugin.d.ts +5 -0
- package/dist/node/runtimeModule/i18n/rsbuildPlugin.js +21 -0
- package/dist/node/runtimeModule/pageData/createPageData.js +1 -1
- package/dist/node/runtimeModule/pageData/rsbuildPlugin.js +1 -1
- package/dist/node/runtimeModule/searchHooks.js +1 -1
- package/dist/node/runtimeModule/siteData/createSiteData.d.ts +2 -1
- package/dist/node/runtimeModule/siteData/createSiteData.js +3 -3
- package/dist/node/runtimeModule/siteData/normalizeThemeConfig.d.ts +2 -1
- package/dist/node/runtimeModule/siteData/normalizeThemeConfig.js +3 -4
- package/dist/node/runtimeModule/siteData/rsbuildPlugin.js +2 -2
- package/dist/node/serve.js +1 -1
- package/dist/node/sitemap.d.ts +7 -2
- package/dist/node/sitemap.js +40 -57
- package/dist/node/ssg/alternateLinks.js +1 -1
- package/dist/node/ssg/htmlFile.js +1 -1
- package/dist/node/ssg/renderHtmlTemplate.js +1 -1
- package/dist/node/ssg/renderPage.js +1 -1
- package/dist/node/ssg/renderPageWorker.js +1 -1
- package/dist/node/ssg/renderPages.js +2 -2
- package/dist/node/ssg/rsbuildPluginSSG.js +1 -1
- package/dist/node/ssg/ssgEnv.js +1 -1
- package/dist/node/ssg-md/llms/emitLlmsTxt.js +1 -1
- package/dist/node/ssg-md/llms/llmsTxt.js +1 -1
- package/dist/node/ssg-md/renderPage.js +1 -1
- package/dist/node/ssg-md/renderPages.js +2 -2
- package/dist/node/ssg-md/rsbuildPluginSSGMD.js +1 -1
- package/dist/node/utils/checkLanguageParity.js +1 -1
- package/dist/node/utils/createHash.js +1 -1
- package/dist/node/utils/flattenMdxContent.js +1 -1
- package/dist/node/utils/getPageKey.js +1 -1
- package/dist/node/utils/reactAlias.js +2 -2
- package/dist/{h~0.js → p~0.js} +6 -4
- package/dist/runtime/App.js +14 -10
- package/dist/runtime/BrowserOnly.d.ts +1 -1
- package/dist/runtime/BrowserOnly.js +53 -20
- package/dist/runtime/ClientApp.js +4 -0
- package/dist/runtime/NoSSR.d.ts +7 -3
- package/dist/runtime/NoSSR.js +30 -9
- package/dist/runtime/PageRoute.js +20 -8
- package/dist/runtime/index.d.ts +3 -2
- package/dist/runtime/index.js +3 -4
- package/dist/runtime/react.d.ts +5 -0
- package/dist/runtime/react.js +4 -0
- package/dist/runtime/reactDom.d.ts +6 -0
- package/dist/runtime/reactDom.js +2 -1
- package/dist/runtime/socialLinks.d.ts +1 -0
- package/dist/runtime/socialLinks.js +3 -0
- package/dist/theme/assets/bun.js +101 -0
- package/dist/theme/assets/deno.js +15 -0
- package/dist/theme/assets/jsdelivr.js +53 -0
- package/dist/theme/{components/PackageManagerTabs/icons/Npm.js → assets/npm.js} +4 -4
- package/dist/theme/{components/PackageManagerTabs/icons/Pnpm.js → assets/pnpm.js} +4 -4
- package/dist/theme/assets/unpkg.js +15 -0
- package/dist/theme/assets/yarn.js +22 -0
- package/dist/theme/components/CdnTabs/index.d.ts +10 -0
- package/dist/theme/components/CdnTabs/index.js +146 -0
- package/dist/theme/components/DocContent/index.js +1 -2
- package/dist/theme/components/FallbackHeading/index.js +1 -0
- package/dist/theme/components/Link/index.js +4 -13
- package/dist/theme/components/Link/useLinkNavigate.js +12 -4
- package/dist/theme/components/NavTitle/index.js +10 -5
- package/dist/theme/components/PackageManagerTabs/index.d.ts +2 -0
- package/dist/theme/components/PackageManagerTabs/index.js +22 -12
- package/dist/theme/components/Search/NoSearchResult.css +1 -2
- package/dist/theme/components/Search/SearchPanel.css +72 -51
- package/dist/theme/components/Search/SuggestItem.css +21 -34
- package/dist/theme/components/Sidebar/SidebarItem.css +5 -0
- package/dist/theme/components/Sidebar/SidebarSectionHeader.css +1 -0
- package/dist/theme/hooks/useDynamicToc.js +27 -34
- package/dist/theme/icons.d.ts +7 -0
- package/dist/theme/icons.js +15 -1
- package/dist/theme/index.d.ts +1 -2
- package/dist/theme/index.js +1 -2
- package/dist/theme/layout/Layout/index.js +1 -2
- package/dist/y~0.js +168 -0
- package/package.json +17 -17
- package/dist/b~0.js +0 -104
- package/dist/eject-theme/components/PackageManagerTabs/icons/Bun.tsx +0 -101
- package/dist/eject-theme/components/PackageManagerTabs/icons/Deno.tsx +0 -18
- package/dist/eject-theme/components/PackageManagerTabs/icons/Npm.tsx +0 -16
- package/dist/eject-theme/components/PackageManagerTabs/icons/Pnpm.tsx +0 -22
- package/dist/eject-theme/components/PackageManagerTabs/icons/Yarn.tsx +0 -18
- package/dist/node/runtimeModule/i18n.d.ts +0 -8
- package/dist/theme/components/PackageManagerTabs/icons/Bun.d.ts +0 -2
- package/dist/theme/components/PackageManagerTabs/icons/Bun.js +0 -137
- package/dist/theme/components/PackageManagerTabs/icons/Deno.d.ts +0 -2
- package/dist/theme/components/PackageManagerTabs/icons/Deno.js +0 -15
- package/dist/theme/components/PackageManagerTabs/icons/Npm.d.ts +0 -2
- package/dist/theme/components/PackageManagerTabs/icons/Pnpm.d.ts +0 -2
- package/dist/theme/components/PackageManagerTabs/icons/Yarn.d.ts +0 -2
- package/dist/theme/components/PackageManagerTabs/icons/Yarn.js +0 -22
- package/dist/theme/logic/useScrollAfterNav.d.ts +0 -5
- package/dist/theme/logic/useScrollAfterNav.js +0 -35
- package/dist/theme/logic/useScrollReset.d.ts +0 -5
- package/dist/theme/logic/useScrollReset.js +0 -12
- package/dist/tu~0.js +0 -3
package/dist/runtime/NoSSR.js
CHANGED
|
@@ -1,14 +1,35 @@
|
|
|
1
1
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
setIsMounted(true);
|
|
8
|
-
}, []);
|
|
9
|
-
if (!isMounted) return null;
|
|
2
|
+
import { Suspense, useSyncExternalStore } from "react";
|
|
3
|
+
import { safeBrowserOnly } from "./reactDom.js";
|
|
4
|
+
import { safeUse } from "./react.js";
|
|
5
|
+
function ModernNoSSR({ children }) {
|
|
6
|
+
safeUse(safeBrowserOnly('This content is only rendered in the browser.'));
|
|
10
7
|
return /*#__PURE__*/ jsx(Fragment, {
|
|
11
8
|
children: children
|
|
12
9
|
});
|
|
13
10
|
}
|
|
14
|
-
|
|
11
|
+
const emptySubscribe = ()=>()=>{};
|
|
12
|
+
const getSnapshot = ()=>true;
|
|
13
|
+
const getServerSnapshot = ()=>false;
|
|
14
|
+
function LegacyNoSSR({ children, fallback = null }) {
|
|
15
|
+
const isMounted = useSyncExternalStore(emptySubscribe, getSnapshot, getServerSnapshot);
|
|
16
|
+
return /*#__PURE__*/ jsx(Fragment, {
|
|
17
|
+
children: isMounted ? children : fallback
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function NoSSR(props) {
|
|
21
|
+
const { fallback = null } = props;
|
|
22
|
+
if (import.meta.env.SSG_MD) return /*#__PURE__*/ jsx(Fragment, {
|
|
23
|
+
children: fallback
|
|
24
|
+
});
|
|
25
|
+
if ('function' == typeof safeBrowserOnly) return /*#__PURE__*/ jsx(Suspense, {
|
|
26
|
+
fallback: fallback,
|
|
27
|
+
children: /*#__PURE__*/ jsx(ModernNoSSR, {
|
|
28
|
+
...props
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
return /*#__PURE__*/ jsx(LegacyNoSSR, {
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
export { LegacyNoSSR, NoSSR };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Fragment, jsx } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import nprogress from "nprogress";
|
|
3
3
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
4
|
-
import { useLoaderData, useNavigation } from "react-router-dom";
|
|
4
|
+
import { Outlet, ScrollRestoration, useLoaderData, useNavigation } from "react-router-dom";
|
|
5
5
|
import { App } from "./App.js";
|
|
6
6
|
import { ErrorRoute } from "./ErrorRoute.js";
|
|
7
7
|
import { PageContext } from "./hooks/usePage.js";
|
|
@@ -46,12 +46,24 @@ function PageRoute() {
|
|
|
46
46
|
function createPageRoutes() {
|
|
47
47
|
return [
|
|
48
48
|
{
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
hydrateFallbackElement: /*#__PURE__*/ jsx(Fragment, {}),
|
|
50
|
+
element: /*#__PURE__*/ jsxs(Fragment, {
|
|
51
|
+
children: [
|
|
52
|
+
/*#__PURE__*/ jsx(Outlet, {}),
|
|
53
|
+
/*#__PURE__*/ jsx(ScrollRestoration, {
|
|
54
|
+
storageKey: "rspress-scroll-positions"
|
|
55
|
+
})
|
|
56
|
+
]
|
|
57
|
+
}),
|
|
58
|
+
children: [
|
|
59
|
+
{
|
|
60
|
+
id: PAGE_ROUTE_ID,
|
|
61
|
+
path: '*',
|
|
62
|
+
loader: pageDataLoader,
|
|
63
|
+
element: /*#__PURE__*/ jsx(PageRoute, {}),
|
|
64
|
+
errorElement: /*#__PURE__*/ jsx(ErrorRoute, {})
|
|
65
|
+
}
|
|
66
|
+
]
|
|
55
67
|
}
|
|
56
68
|
];
|
|
57
69
|
}
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -21,8 +21,9 @@ export { useWebMcp, type WebMcpOptions, type WebMcpState, type WebMcpExecuteOpti
|
|
|
21
21
|
export { useWindowSize } from './hooks/useWindowSize.js';
|
|
22
22
|
export { initPageData } from './initPageData.js';
|
|
23
23
|
export { NoSSR } from './NoSSR.js';
|
|
24
|
-
export {
|
|
24
|
+
export { safeUse } from './react.js';
|
|
25
|
+
export { safePreconnect, safePreload, safeBrowserOnly } from './reactDom.js';
|
|
25
26
|
export { isActive, pathnameToRouteService, preloadLink } from './route.js';
|
|
26
27
|
export { addLeadingSlash, addTrailingSlash, cleanUrlByConfig, isEqualPath, isProduction, normalizeHrefInRuntime, normalizeImagePath, removeBase, removeTrailingSlash, routePathToMdPath, withBase, withSiteOrigin, } from './utils.js';
|
|
27
|
-
export
|
|
28
|
+
export { socialLinks } from './socialLinks.js';
|
|
28
29
|
export { useSearchHooks, type SearchHooks } from './hooks/useSearchHooks.js';
|
package/dist/runtime/index.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import virtual_social_links from "virtual-social-links";
|
|
2
1
|
export * from "react-router-dom";
|
|
3
|
-
const socialLinks = virtual_social_links;
|
|
4
2
|
export { isDataUrl, isExternalUrl, matchNavbar, matchSidebar, normalizeHref } from "@rspress/shared";
|
|
5
3
|
export { Head, useHead } from "@unhead/react";
|
|
6
4
|
export { BrowserOnly } from "./BrowserOnly.js";
|
|
@@ -23,8 +21,9 @@ export { useWebMcp } from "./hooks/useWebMcp.js";
|
|
|
23
21
|
export { useWindowSize } from "./hooks/useWindowSize.js";
|
|
24
22
|
export { initPageData } from "./initPageData.js";
|
|
25
23
|
export { NoSSR } from "./NoSSR.js";
|
|
26
|
-
export {
|
|
24
|
+
export { safeUse } from "./react.js";
|
|
25
|
+
export { safeBrowserOnly, safePreconnect, safePreload } from "./reactDom.js";
|
|
27
26
|
export { isActive, pathnameToRouteService, preloadLink } from "./route.js";
|
|
28
27
|
export { addLeadingSlash, addTrailingSlash, cleanUrlByConfig, isEqualPath, isProduction, normalizeHrefInRuntime, normalizeImagePath, removeBase, removeTrailingSlash, routePathToMdPath, withBase, withSiteOrigin } from "./utils.js";
|
|
28
|
+
export { socialLinks } from "./socialLinks.js";
|
|
29
29
|
export { useSearchHooks } from "./hooks/useSearchHooks.js";
|
|
30
|
-
export { socialLinks };
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
type CrossOrigin = '' | 'anonymous' | 'use-credentials';
|
|
2
|
+
declare const browserUsable: unique symbol;
|
|
3
|
+
export interface BrowserUsable {
|
|
4
|
+
readonly [browserUsable]: never;
|
|
5
|
+
}
|
|
6
|
+
type Browser = (reason?: string | (() => unknown)) => BrowserUsable;
|
|
2
7
|
type Preconnect = (href: string, options?: {
|
|
3
8
|
crossOrigin?: CrossOrigin;
|
|
4
9
|
}) => void;
|
|
@@ -14,6 +19,7 @@ type Preload = (href: string, options?: {
|
|
|
14
19
|
referrerPolicy?: ReferrerPolicy;
|
|
15
20
|
type?: string;
|
|
16
21
|
}) => void;
|
|
22
|
+
export declare const safeBrowserOnly: Browser | undefined;
|
|
17
23
|
export declare const safePreconnect: Preconnect | undefined;
|
|
18
24
|
export declare const safePreload: Preload | undefined;
|
|
19
25
|
export {};
|
package/dist/runtime/reactDom.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as __rspack_external_react_dom_20ef40a6 from "react-dom";
|
|
2
2
|
const reactDOM = __rspack_external_react_dom_20ef40a6;
|
|
3
|
+
const safeBrowserOnly = reactDOM.browser ?? reactDOM.default?.browser;
|
|
3
4
|
const safePreconnect = reactDOM.preconnect ?? reactDOM.default?.preconnect;
|
|
4
5
|
const safePreload = reactDOM.preload ?? reactDOM.default?.preload;
|
|
5
|
-
export { safePreconnect, safePreload };
|
|
6
|
+
export { safeBrowserOnly, safePreconnect, safePreload };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const socialLinks: Record<string, string>;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
const SvgBun = (props)=>/*#__PURE__*/ jsxs("svg", {
|
|
4
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5
|
+
width: "1.2em",
|
|
6
|
+
height: "1.2em",
|
|
7
|
+
viewBox: "0 0 80 70",
|
|
8
|
+
...props,
|
|
9
|
+
children: [
|
|
10
|
+
/*#__PURE__*/ jsx("path", {
|
|
11
|
+
d: "M71.09 20.74c-.16-.17-.33-.34-.5-.5s-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5A26.46 26.46 0 0 1 75.5 35.7c0 16.57-16.82 30.05-37.5 30.05-11.58 0-21.94-4.23-28.83-10.86l.5.5.5.5.5.5.5.5.5.5.5.5.5.5C19.55 65.3 30.14 69.75 42 69.75c20.68 0 37.5-13.48 37.5-30 0-7.06-3.04-13.75-8.41-19.01"
|
|
12
|
+
}),
|
|
13
|
+
/*#__PURE__*/ jsx("path", {
|
|
14
|
+
d: "M73 35.7c0 15.21-15.67 27.54-35 27.54S3 50.91 3 35.7C3 26.27 9 17.94 18.22 13S33.18 3 38 3s8.94 4.13 19.78 10C67 17.94 73 26.27 73 35.7",
|
|
15
|
+
style: {
|
|
16
|
+
fill: "#fbf0df"
|
|
17
|
+
}
|
|
18
|
+
}),
|
|
19
|
+
/*#__PURE__*/ jsx("path", {
|
|
20
|
+
d: "M73 35.7a21.7 21.7 0 0 0-.8-5.78c-2.73 33.3-43.35 34.9-59.32 24.94A40 40 0 0 0 38 63.24c19.3 0 35-12.35 35-27.54",
|
|
21
|
+
"data-name": "Bottom Shadow",
|
|
22
|
+
style: {
|
|
23
|
+
fill: "#f6dece"
|
|
24
|
+
}
|
|
25
|
+
}),
|
|
26
|
+
/*#__PURE__*/ jsx("path", {
|
|
27
|
+
d: "M24.53 11.17C29 8.49 34.94 3.46 40.78 3.45A9.3 9.3 0 0 0 38 3c-2.42 0-5 1.25-8.25 3.13-1.13.66-2.3 1.39-3.54 2.15-2.33 1.44-5 3.07-8 4.7C8.69 18.13 3 26.62 3 35.7v1.19c6.06-21.41 17.07-23.04 21.53-25.72",
|
|
28
|
+
"data-name": "Light Shine",
|
|
29
|
+
style: {
|
|
30
|
+
fill: "#fffefc"
|
|
31
|
+
}
|
|
32
|
+
}),
|
|
33
|
+
/*#__PURE__*/ jsx("path", {
|
|
34
|
+
d: "M35.12 5.53A16.41 16.41 0 0 1 29.49 18c-.28.25-.06.73.3.59 3.37-1.31 7.92-5.23 6-13.14-.08-.45-.67-.33-.67.08m2.27 0A16.24 16.24 0 0 1 39 19c-.12.35.31.65.55.36 2.19-2.8 4.1-8.36-1.62-14.36-.29-.26-.74.14-.54.49Zm2.76-.17A16.42 16.42 0 0 1 47 17.12a.33.33 0 0 0 .65.11c.92-3.49.4-9.44-7.17-12.53-.4-.16-.66.38-.33.62Zm-18.46 10.4a16.94 16.94 0 0 0 10.47-9c.18-.36.75-.22.66.18-1.73 8-7.52 9.67-11.12 9.45-.38.01-.37-.52-.01-.63",
|
|
35
|
+
style: {
|
|
36
|
+
fill: "#ccbea7",
|
|
37
|
+
fillRule: "evenodd"
|
|
38
|
+
}
|
|
39
|
+
}),
|
|
40
|
+
/*#__PURE__*/ jsx("path", {
|
|
41
|
+
d: "M38 65.75C17.32 65.75.5 52.27.5 35.7c0-10 6.18-19.33 16.53-24.92 3-1.6 5.57-3.21 7.86-4.62 1.26-.78 2.45-1.51 3.6-2.19C32 1.89 35 .5 38 .5s5.62 1.2 8.9 3.14c1 .57 2 1.19 3.07 1.87 2.49 1.54 5.3 3.28 9 5.27C69.32 16.37 75.5 25.69 75.5 35.7c0 16.57-16.82 30.05-37.5 30.05M38 3c-2.42 0-5 1.25-8.25 3.13-1.13.66-2.3 1.39-3.54 2.15-2.33 1.44-5 3.07-8 4.7C8.69 18.13 3 26.62 3 35.7c0 15.19 15.7 27.55 35 27.55S73 50.89 73 35.7c0-9.08-5.69-17.57-15.22-22.7-3.78-2-6.73-3.88-9.12-5.36-1.09-.67-2.09-1.29-3-1.84C42.63 4 40.42 3 38 3"
|
|
42
|
+
}),
|
|
43
|
+
/*#__PURE__*/ jsx("path", {
|
|
44
|
+
d: "M45.05 43a8.93 8.93 0 0 1-2.92 4.71 6.8 6.8 0 0 1-4 1.88A6.84 6.84 0 0 1 34 47.71 8.93 8.93 0 0 1 31.12 43a.72.72 0 0 1 .8-.81h12.34a.72.72 0 0 1 .79.81",
|
|
45
|
+
"data-name": "Background",
|
|
46
|
+
style: {
|
|
47
|
+
fill: "#b71422"
|
|
48
|
+
}
|
|
49
|
+
}),
|
|
50
|
+
/*#__PURE__*/ jsx("path", {
|
|
51
|
+
d: "M34 47.79a6.9 6.9 0 0 0 4.12 1.9 6.9 6.9 0 0 0 4.11-1.9 11 11 0 0 0 1-1.07 6.83 6.83 0 0 0-4.9-2.31 6.15 6.15 0 0 0-5 2.78c.23.21.43.41.67.6",
|
|
52
|
+
"data-name": "Background",
|
|
53
|
+
style: {
|
|
54
|
+
fill: "#ff6164"
|
|
55
|
+
}
|
|
56
|
+
}),
|
|
57
|
+
/*#__PURE__*/ jsx("path", {
|
|
58
|
+
d: "M34.16 47a5.36 5.36 0 0 1 4.19-2.08 6 6 0 0 1 4 1.69c.23-.25.45-.51.66-.77a7 7 0 0 0-4.71-1.93 6.36 6.36 0 0 0-4.89 2.36 10 10 0 0 0 .75.73",
|
|
59
|
+
"data-name": "Outline"
|
|
60
|
+
}),
|
|
61
|
+
/*#__PURE__*/ jsx("path", {
|
|
62
|
+
d: "M38.09 50.19a7.42 7.42 0 0 1-4.45-2 9.52 9.52 0 0 1-3.11-5.05 1.2 1.2 0 0 1 .26-1 1.41 1.41 0 0 1 1.13-.51h12.34a1.44 1.44 0 0 1 1.13.51 1.19 1.19 0 0 1 .25 1 9.52 9.52 0 0 1-3.11 5.05 7.42 7.42 0 0 1-4.44 2m-6.17-7.4c-.16 0-.2.07-.21.09a8.3 8.3 0 0 0 2.73 4.37A6.23 6.23 0 0 0 38.09 49a6.28 6.28 0 0 0 3.65-1.73 8.3 8.3 0 0 0 2.72-4.37.21.21 0 0 0-.2-.09Z",
|
|
63
|
+
"data-name": "Outline"
|
|
64
|
+
}),
|
|
65
|
+
/*#__PURE__*/ jsx("ellipse", {
|
|
66
|
+
cx: 53.22,
|
|
67
|
+
cy: 40.18,
|
|
68
|
+
"data-name": "Right Blush",
|
|
69
|
+
rx: 5.85,
|
|
70
|
+
ry: 3.44,
|
|
71
|
+
style: {
|
|
72
|
+
fill: "#febbd0"
|
|
73
|
+
}
|
|
74
|
+
}),
|
|
75
|
+
/*#__PURE__*/ jsx("ellipse", {
|
|
76
|
+
cx: 22.95,
|
|
77
|
+
cy: 40.18,
|
|
78
|
+
"data-name": "Left Bluch",
|
|
79
|
+
rx: 5.85,
|
|
80
|
+
ry: 3.44,
|
|
81
|
+
style: {
|
|
82
|
+
fill: "#febbd0"
|
|
83
|
+
}
|
|
84
|
+
}),
|
|
85
|
+
/*#__PURE__*/ jsx("path", {
|
|
86
|
+
d: "M25.7 38.8a5.51 5.51 0 1 0-5.5-5.51 5.51 5.51 0 0 0 5.5 5.51m24.77 0A5.51 5.51 0 1 0 45 33.29a5.5 5.5 0 0 0 5.47 5.51",
|
|
87
|
+
style: {
|
|
88
|
+
fillRule: "evenodd"
|
|
89
|
+
}
|
|
90
|
+
}),
|
|
91
|
+
/*#__PURE__*/ jsx("path", {
|
|
92
|
+
d: "M24 33.64a2.07 2.07 0 1 0-2.06-2.07A2.07 2.07 0 0 0 24 33.64m24.77 0a2.07 2.07 0 1 0-2.06-2.07 2.07 2.07 0 0 0 2.04 2.07Z",
|
|
93
|
+
style: {
|
|
94
|
+
fill: "#fff",
|
|
95
|
+
fillRule: "evenodd"
|
|
96
|
+
}
|
|
97
|
+
})
|
|
98
|
+
]
|
|
99
|
+
});
|
|
100
|
+
var bun = SvgBun;
|
|
101
|
+
export default bun;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
const SvgDeno = (props)=>/*#__PURE__*/ jsx("svg", {
|
|
4
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5
|
+
width: "1em",
|
|
6
|
+
height: "1em",
|
|
7
|
+
viewBox: "0 0 24 24",
|
|
8
|
+
...props,
|
|
9
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
10
|
+
fill: "currentColor",
|
|
11
|
+
d: "M1.105 18.02A11.9 11.9 0 0 1 0 12.985q0-.698.078-1.376a12 12 0 0 1 .231-1.34A12 12 0 0 1 4.025 4.02a12 12 0 0 1 5.46-2.771 12 12 0 0 1 3.428-.23c1.452.112 2.825.477 4.077 1.05a12 12 0 0 1 2.78 1.774 12.02 12.02 0 0 1 4.053 7.078A12 12 0 0 1 24 12.985q0 .454-.036.914a12 12 0 0 1-.728 3.305 12 12 0 0 1-2.38 3.875c-1.33 1.357-3.02 1.962-4.43 1.936a4.4 4.4 0 0 1-2.724-1.024c-.99-.853-1.391-1.83-1.53-2.919a5 5 0 0 1 .128-1.518c.105-.38.37-1.116.76-1.437-.455-.197-1.04-.624-1.226-.829-.045-.05-.04-.13 0-.183a.155.155 0 0 1 .177-.053c.392.134.869.267 1.372.35.66.111 1.484.25 2.317.292 2.03.1 4.153-.813 4.812-2.627s.403-3.609-1.96-4.685-3.454-2.356-5.363-3.128c-1.247-.505-2.636-.205-4.06.582-3.838 2.121-7.277 8.822-5.69 15.032a.191.191 0 0 1-.315.19 12 12 0 0 1-1.25-1.634 12 12 0 0 1-.769-1.404M11.57 6.087c.649-.051 1.214.501 1.31 1.236.13.979-.228 1.99-1.41 2.013-1.01.02-1.315-.997-1.248-1.614.066-.616.574-1.575 1.35-1.635"
|
|
12
|
+
})
|
|
13
|
+
});
|
|
14
|
+
var deno = SvgDeno;
|
|
15
|
+
export default deno;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
const SvgJsdelivr = (props)=>/*#__PURE__*/ jsxs("svg", {
|
|
4
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5
|
+
width: "1em",
|
|
6
|
+
height: "1em",
|
|
7
|
+
viewBox: "0 0 32 34",
|
|
8
|
+
...props,
|
|
9
|
+
children: [
|
|
10
|
+
/*#__PURE__*/ jsx("path", {
|
|
11
|
+
fill: "#BD483B",
|
|
12
|
+
d: "m15.817.338-3.106 11.038v11.143l3.106 11.143 3.195-11.143V11.376z"
|
|
13
|
+
}),
|
|
14
|
+
/*#__PURE__*/ jsx("path", {
|
|
15
|
+
fill: "#E64E3D",
|
|
16
|
+
d: "M15.817.338.432 5.88l2.186 20.492 13.199 7.29"
|
|
17
|
+
}),
|
|
18
|
+
/*#__PURE__*/ jsx("path", {
|
|
19
|
+
fill: "#BD483B",
|
|
20
|
+
d: "m15.817 33.662 13.269-7.365 2.482-20.49L15.817.338"
|
|
21
|
+
}),
|
|
22
|
+
/*#__PURE__*/ jsx("path", {
|
|
23
|
+
fill: "#FEC82F",
|
|
24
|
+
d: "M13.025 25.088a9.36 9.36 0 0 1-3.94-2.431l-.003-.002a9.342 9.342 0 0 1-2.238-3.814q.378.348.796.647.006.011.011.027-.005-.017-.011-.027a8.6 8.6 0 0 0 1.696.923q.267.105.542.195c.011.006.024.006.035.01q.049.018.097.033a1.7 1.7 0 0 0 1.39 1.504c.288 1.157.834 2.146 1.625 2.935M13.605 11.794c0 .324.088.627.243.883-1.25 1.753-2.108 3.656-2.479 5.539q-.062.314-.105.619c-.429.113-.79.393-1.016.762a.1.1 0 0 1-.035-.01c-.023-.006-.04-.014-.061-.021a7.157 7.157 0 0 1-2.796-1.715 7 7 0 0 1-.311-.332l-.041-.049-.115-.137-.047-.059q-.02-.026-.037-.045-.01-.014-.017-.023-.03-.035-.053-.068-.013-.018-.023-.029l-.004-.008c-.013-.014-.024-.033-.037-.049a4 4 0 0 1-.157-.225q-.015-.017-.025-.039l-.02-.027a9.338 9.338 0 0 1 2.227-6.703 9.36 9.36 0 0 1 4.299-2.847q.04.273.095.553c.192.967.513 1.942.949 2.898-.27.3-.434.698-.434 1.132M12.608 20.479a.89.89 0 0 1-.308.68.9.9 0 0 1-1.068.09.9.9 0 0 1-.342-.375.9.9 0 0 1-.089-.395.9.9 0 0 1 .377-.732.9.9 0 0 1 1.285.245.87.87 0 0 1 .145.487M16.209 11.794a.902.902 0 0 1-.902.905q-.066 0-.128-.006-.012-.004-.025-.006a.902.902 0 0 1 .153-1.794h.038a.907.907 0 0 1 .864.901"
|
|
25
|
+
}),
|
|
26
|
+
/*#__PURE__*/ jsx("path", {
|
|
27
|
+
fill: "#DF9C26",
|
|
28
|
+
d: "M25.183 16.143c0 .907-.129 1.782-.368 2.61a12.8 12.8 0 0 1-2.4-.914 1.7 1.7 0 0 0-.092-.975q.047-.044.095-.094a15 15 0 0 0 2.404-3.212 9.4 9.4 0 0 1 .361 2.585M24.313 12.196a11 11 0 0 1-.201.416 13.8 13.8 0 0 1-2.487 3.434 1.703 1.703 0 0 0-1.883.084 17 17 0 0 1-1.49-1.327 17 17 0 0 1-1.647-1.909 1.695 1.695 0 0 0 .168-1.964 16 16 0 0 1 3.917-2.788 9.4 9.4 0 0 1 3.623 4.054M21.649 17.503a.902.902 0 0 1-1.804.081q.017-.014.028-.022-.016-.01-.03-.023l-.001-.037a.907.907 0 0 1 1.165-.864.91.91 0 0 1 .642.865M21.884 18.767a1.7 1.7 0 0 1-2.088.151q-.059.039-.115.072a13.7 13.7 0 0 1-3.864 1.698v4.824a9.37 9.37 0 0 0 8.64-5.744 14 14 0 0 1-2.573-1.001"
|
|
29
|
+
}),
|
|
30
|
+
/*#__PURE__*/ jsx("path", {
|
|
31
|
+
fill: "#FEC82F",
|
|
32
|
+
d: "M15.817 20.688a11.7 11.7 0 0 1-2.385.367l-.128.008c-.151.41-.454.744-.839.94.245.909.688 1.698 1.319 2.327.524.524 1.162.92 1.891 1.18l.142.002z"
|
|
33
|
+
}),
|
|
34
|
+
/*#__PURE__*/ jsx("path", {
|
|
35
|
+
fill: "#DF9C26",
|
|
36
|
+
d: "M19.043 17.503q.001-.26.074-.498-.845-.66-1.625-1.442a18 18 0 0 1-1.675-1.934v5.946a12.9 12.9 0 0 0 3.321-1.511 1.7 1.7 0 0 1-.095-.561"
|
|
37
|
+
}),
|
|
38
|
+
/*#__PURE__*/ jsx("path", {
|
|
39
|
+
fill: "#FEC82F",
|
|
40
|
+
d: "M15.817 13.629c-.045-.059-.091-.113-.132-.174a1.716 1.716 0 0 1-1.015-.08c-1.134 1.606-1.912 3.341-2.25 5.049q-.048.243-.083.475c.477.195.848.596.996 1.092q.022-.005.046-.004c.809-.039 1.627-.18 2.438-.412z"
|
|
41
|
+
}),
|
|
42
|
+
/*#__PURE__*/ jsx("path", {
|
|
43
|
+
fill: "#DF9C26",
|
|
44
|
+
d: "M15.817 6.778v3.394q.073.023.145.055a17.2 17.2 0 0 1 3.573-2.681 9.3 9.3 0 0 0-3.718-.768"
|
|
45
|
+
}),
|
|
46
|
+
/*#__PURE__*/ jsx("path", {
|
|
47
|
+
fill: "#FEC82F",
|
|
48
|
+
d: "M15.817 6.778q-.914 0-1.773.168c.025.197.06.404.101.606.168.86.449 1.725.829 2.575q.16-.032.333-.033.266 0 .51.078z"
|
|
49
|
+
})
|
|
50
|
+
]
|
|
51
|
+
});
|
|
52
|
+
var jsdelivr = SvgJsdelivr;
|
|
53
|
+
export default jsdelivr;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import "react";
|
|
3
|
+
const SvgNpm = (props)=>/*#__PURE__*/ jsxs("svg", {
|
|
4
4
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5
5
|
width: "1em",
|
|
6
6
|
height: "1em",
|
|
@@ -17,5 +17,5 @@ function Npm(props) {
|
|
|
17
17
|
})
|
|
18
18
|
]
|
|
19
19
|
});
|
|
20
|
-
|
|
21
|
-
export
|
|
20
|
+
var npm = SvgNpm;
|
|
21
|
+
export default npm;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import "react";
|
|
3
|
+
const SvgPnpm = (props)=>/*#__PURE__*/ jsxs("svg", {
|
|
4
4
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5
5
|
width: "1em",
|
|
6
6
|
height: "1em",
|
|
@@ -17,5 +17,5 @@ function Pnpm(props) {
|
|
|
17
17
|
})
|
|
18
18
|
]
|
|
19
19
|
});
|
|
20
|
-
|
|
21
|
-
export
|
|
20
|
+
var pnpm = SvgPnpm;
|
|
21
|
+
export default pnpm;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
const SvgUnpkg = (props)=>/*#__PURE__*/ jsx("svg", {
|
|
4
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5
|
+
width: "1em",
|
|
6
|
+
height: "1em",
|
|
7
|
+
fill: "currentColor",
|
|
8
|
+
viewBox: "0 0 24 24",
|
|
9
|
+
...props,
|
|
10
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
11
|
+
d: "M0 0v24h24V0zm4.322 2.977 4.37.002a.043.043 0 0 1 .044.04 9543 9543 0 0 1 0 9.165q0 1.126.09 1.957.057.505.287 1.03.503 1.153 1.715 1.405.94.195 1.893-.008c1.166-.248 1.813-1.268 1.96-2.404q.1-.77.1-2.018-.002-4.724.002-9.119 0-.05.049-.05h4.338a.033.033 0 0 1 .033.033v9.869c0 1.465-.17 2.918-.746 4.234-.777 1.775-2.323 2.836-4.195 3.211q-2.55.513-5.07-.013c-2.226-.465-3.808-1.828-4.46-4.03a10.2 10.2 0 0 1-.416-2.586 65 65 0 0 1-.029-1.88q-.003-4.555 0-8.801 0-.037.035-.037"
|
|
12
|
+
})
|
|
13
|
+
});
|
|
14
|
+
var unpkg = SvgUnpkg;
|
|
15
|
+
export default unpkg;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
const SvgYarn = (props)=>/*#__PURE__*/ jsx("svg", {
|
|
4
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5
|
+
width: "1em",
|
|
6
|
+
height: "1em",
|
|
7
|
+
viewBox: "0 0 128 128",
|
|
8
|
+
...props,
|
|
9
|
+
children: /*#__PURE__*/ jsxs("g", {
|
|
10
|
+
fill: "#2c8ebb",
|
|
11
|
+
children: [
|
|
12
|
+
/*#__PURE__*/ jsx("path", {
|
|
13
|
+
d: "M99.24 80.71C94.9 80.76 91.1 83 87.89 85c-6 3.71-9 3.47-9 3.47l-.1-.17c-.41-.67 1.92-6.68-.69-13.84-2.82-7.83-7.3-9.72-6.94-10.32 1.53-2.59 5.36-6.7 6.89-14.36.91-4.64.67-12.28-1.39-16.28-.38-.74-3.78 1.24-3.78 1.24s-3.18-7.09-4.07-7.66c-2.87-1.84-6 7.61-6 7.61a14 14 0 0 0-11.71 4.5 9.64 9.64 0 0 1-3.85 2.27c-.41.14-.91.12-2.15 3.47-1.9 5.07 3.24 10.81 3.24 10.81s-6.13 4.33-8.4 9.72a24.8 24.8 0 0 0-1.75 11.68s-4.36 3.78-4.64 7.68a12.87 12.87 0 0 0 1.77 7.83 1.94 1.94 0 0 0 2.63.91s-2.9 3.38-.19 4.81c2.47 1.29 6.63 2 8.83-.19 1.6-1.6 1.92-5.17 2.51-6.63.14-.34.62.57 1.08 1a10 10 0 0 0 1.36 1s-3.9 1.68-2.3 5.51c.53 1.27 2.42 2.08 5.51 2.06 1.15 0 13.76-.72 17.12-1.53a4.33 4.33 0 0 0 2.61-1.46 63 63 0 0 0 15.49-7c4.74-3.09 6.68-3.93 10.51-4.84 3.16-.75 2.95-5.65-1.24-5.58"
|
|
14
|
+
}),
|
|
15
|
+
/*#__PURE__*/ jsx("path", {
|
|
16
|
+
d: "M64 2a62 62 0 1 0 62 62A62 62 0 0 0 64 2m37.3 87.83c-3.35.81-4.91 1.44-9.41 4.36a67 67 0 0 1-15.56 7.18 8.7 8.7 0 0 1-3.64 1.77c-3.81.93-16.88 1.63-17.91 1.63h-.24c-4 0-6.27-1.24-7.49-2.54-3.4 1.7-7.8 1-11-.69a5.55 5.55 0 0 1-3-3.9 6 6 0 0 1 0-2.06 6.7 6.7 0 0 1-.79-1A16.38 16.38 0 0 1 30 84.52c.29-3.73 2.87-7.06 4.55-8.83A28.6 28.6 0 0 1 36.61 64a26.8 26.8 0 0 1 6.82-9c-1.65-2.78-3.33-7.06-1.7-11.42 1.17-3.11 2.13-4.84 4.24-5.58a6.8 6.8 0 0 0 2.51-1.34A17.65 17.65 0 0 1 60.34 31c.19-.48.41-1 .65-1.46 1.6-3.4 3.3-5.31 5.29-6a4.88 4.88 0 0 1 4.4.5c.65.43 1.48 1 3.9 6a4.7 4.7 0 0 1 2.85-.1 3.8 3.8 0 0 1 2.39 1.94c2.47 4.74 2.8 13.19 1.72 18.62a33.8 33.8 0 0 1-5.84 13.31 25.7 25.7 0 0 1 5.77 9.43 25.4 25.4 0 0 1 1.41 10.41A29 29 0 0 0 86 81.91c3.06-1.89 7.68-4.74 13.19-4.81a6.62 6.62 0 0 1 7 5.7 6.35 6.35 0 0 1-4.89 7.03"
|
|
17
|
+
})
|
|
18
|
+
]
|
|
19
|
+
})
|
|
20
|
+
});
|
|
21
|
+
var yarn = SvgYarn;
|
|
22
|
+
export default yarn;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type CdnName = 'jsdelivr' | 'unpkg';
|
|
2
|
+
export type CdnTabsProps = {
|
|
3
|
+
/** Package name and version, e.g. `bootstrap@5`. */
|
|
4
|
+
package: string;
|
|
5
|
+
/** CSS and JavaScript asset paths within the package. */
|
|
6
|
+
files: ReadonlyArray<string>;
|
|
7
|
+
/** CDNs to display, in tab order. Defaults to jsDelivr and unpkg. */
|
|
8
|
+
cdns?: ReadonlyArray<CdnName>;
|
|
9
|
+
};
|
|
10
|
+
export declare function CdnTabs({ package: packageName, files, cdns, }: CdnTabsProps): string | import("react").JSX.Element;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { IconJsdelivr, IconUnpkg, SvgWrapper, Tab, Tabs, getCustomMDXComponent } from "@rspress/core/theme";
|
|
3
|
+
import { Fragment as external_react_Fragment, useMemo } from "react";
|
|
4
|
+
const DEFAULT_CDNS = [
|
|
5
|
+
'jsdelivr',
|
|
6
|
+
'unpkg'
|
|
7
|
+
];
|
|
8
|
+
const CDN_INFO = {
|
|
9
|
+
jsdelivr: {
|
|
10
|
+
label: 'jsDelivr',
|
|
11
|
+
baseUrl: 'https://cdn.jsdelivr.net/npm/'
|
|
12
|
+
},
|
|
13
|
+
unpkg: {
|
|
14
|
+
label: 'unpkg',
|
|
15
|
+
baseUrl: 'https://unpkg.com/'
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
function encodePath(path) {
|
|
19
|
+
return path.split('/').map((segment)=>encodeURIComponent(segment).replace(/%40/gi, '@')).join('/');
|
|
20
|
+
}
|
|
21
|
+
function getAssetUrl(cdn, packageName, file) {
|
|
22
|
+
return `${CDN_INFO[cdn].baseUrl}${encodePath(packageName)}/${encodePath(file)}`;
|
|
23
|
+
}
|
|
24
|
+
function getAssetTags(cdn, packageName, files) {
|
|
25
|
+
return files.flatMap((file)=>{
|
|
26
|
+
const url = getAssetUrl(cdn, packageName, file);
|
|
27
|
+
if (file.toLowerCase().endsWith('.css')) return [
|
|
28
|
+
{
|
|
29
|
+
tag: 'link',
|
|
30
|
+
attributes: {
|
|
31
|
+
rel: 'stylesheet',
|
|
32
|
+
href: url
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
];
|
|
36
|
+
if (file.toLowerCase().endsWith('.js')) return [
|
|
37
|
+
{
|
|
38
|
+
tag: "script",
|
|
39
|
+
attributes: {
|
|
40
|
+
src: url
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
];
|
|
44
|
+
return [];
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function getHtmlSnippet(tags) {
|
|
48
|
+
return tags.map(({ tag, attributes })=>{
|
|
49
|
+
const attrs = Object.entries(attributes).map(([name, value])=>`${name}="${value}"`).join(' ');
|
|
50
|
+
return 'link' === tag ? `<${tag} ${attrs} />` : `<${tag} ${attrs}></${tag}>`;
|
|
51
|
+
}).join('\n');
|
|
52
|
+
}
|
|
53
|
+
function CdnTabs({ package: packageName, files, cdns = DEFAULT_CDNS }) {
|
|
54
|
+
const Pre = useMemo(()=>getCustomMDXComponent().pre, [
|
|
55
|
+
getCustomMDXComponent
|
|
56
|
+
]);
|
|
57
|
+
const tabs = cdns.map((cdn)=>({
|
|
58
|
+
cdn,
|
|
59
|
+
label: CDN_INFO[cdn].label,
|
|
60
|
+
tags: getAssetTags(cdn, packageName, files)
|
|
61
|
+
}));
|
|
62
|
+
if (import.meta.env.SSG_MD) return tabs.map(({ label, tags })=>`\n\`\`\`html [${label}]\n${getHtmlSnippet(tags)}\n\`\`\`\n`).join('');
|
|
63
|
+
return /*#__PURE__*/ jsx(Tabs, {
|
|
64
|
+
groupId: "cdn",
|
|
65
|
+
children: tabs.map(({ cdn, label, tags })=>/*#__PURE__*/ jsx(Tab, {
|
|
66
|
+
value: cdn,
|
|
67
|
+
label: /*#__PURE__*/ jsxs("span", {
|
|
68
|
+
style: {
|
|
69
|
+
display: 'flex',
|
|
70
|
+
alignItems: 'center',
|
|
71
|
+
gap: 6
|
|
72
|
+
},
|
|
73
|
+
children: [
|
|
74
|
+
/*#__PURE__*/ jsx(SvgWrapper, {
|
|
75
|
+
icon: 'jsdelivr' === cdn ? IconJsdelivr : IconUnpkg,
|
|
76
|
+
width: "1em",
|
|
77
|
+
height: "1em",
|
|
78
|
+
"aria-hidden": "true"
|
|
79
|
+
}),
|
|
80
|
+
label
|
|
81
|
+
]
|
|
82
|
+
}),
|
|
83
|
+
children: /*#__PURE__*/ jsx(Pre, {
|
|
84
|
+
lang: "html",
|
|
85
|
+
className: "shiki css-variables",
|
|
86
|
+
style: {
|
|
87
|
+
backgroundColor: 'var(--shiki-background)',
|
|
88
|
+
color: 'var(--shiki-foreground)'
|
|
89
|
+
},
|
|
90
|
+
children: /*#__PURE__*/ jsx("code", {
|
|
91
|
+
style: {
|
|
92
|
+
whiteSpace: 'pre'
|
|
93
|
+
},
|
|
94
|
+
children: tags.map(({ tag, attributes }, index)=>/*#__PURE__*/ jsxs(external_react_Fragment, {
|
|
95
|
+
children: [
|
|
96
|
+
index > 0 ? '\n' : null,
|
|
97
|
+
/*#__PURE__*/ jsxs("span", {
|
|
98
|
+
className: "line",
|
|
99
|
+
children: [
|
|
100
|
+
'<',
|
|
101
|
+
/*#__PURE__*/ jsx("span", {
|
|
102
|
+
style: {
|
|
103
|
+
color: 'var(--shiki-token-keyword)'
|
|
104
|
+
},
|
|
105
|
+
children: tag
|
|
106
|
+
}),
|
|
107
|
+
Object.entries(attributes).map(([name, value])=>/*#__PURE__*/ jsxs(external_react_Fragment, {
|
|
108
|
+
children: [
|
|
109
|
+
' ',
|
|
110
|
+
/*#__PURE__*/ jsx("span", {
|
|
111
|
+
style: {
|
|
112
|
+
color: 'var(--shiki-token-function)'
|
|
113
|
+
},
|
|
114
|
+
children: name
|
|
115
|
+
}),
|
|
116
|
+
'=',
|
|
117
|
+
/*#__PURE__*/ jsx("span", {
|
|
118
|
+
style: {
|
|
119
|
+
color: 'var(--shiki-token-string-expression)'
|
|
120
|
+
},
|
|
121
|
+
children: `"${value}"`
|
|
122
|
+
})
|
|
123
|
+
]
|
|
124
|
+
}, name)),
|
|
125
|
+
'link' === tag ? ' />' : /*#__PURE__*/ jsxs(Fragment, {
|
|
126
|
+
children: [
|
|
127
|
+
'></',
|
|
128
|
+
/*#__PURE__*/ jsx("span", {
|
|
129
|
+
style: {
|
|
130
|
+
color: 'var(--shiki-token-keyword)'
|
|
131
|
+
},
|
|
132
|
+
children: tag
|
|
133
|
+
}),
|
|
134
|
+
'>'
|
|
135
|
+
]
|
|
136
|
+
})
|
|
137
|
+
]
|
|
138
|
+
})
|
|
139
|
+
]
|
|
140
|
+
}, index))
|
|
141
|
+
})
|
|
142
|
+
})
|
|
143
|
+
}, cdn))
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
export { CdnTabs };
|
|
@@ -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
|
|
4
|
+
import { Callout, FallbackHeading, getCustomMDXComponent } from "@rspress/core/theme";
|
|
5
5
|
import "./doc.css";
|
|
6
6
|
function FallbackTitle() {
|
|
7
7
|
const { site } = useSite();
|
|
@@ -13,7 +13,6 @@ function FallbackTitle() {
|
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
15
|
function DocContent({ components, isOverviewPage = false, afterDocContent, beforeDocContent }) {
|
|
16
|
-
useScrollAfterNav();
|
|
17
16
|
const mdxComponents = {
|
|
18
17
|
...getCustomMDXComponent(),
|
|
19
18
|
...components,
|
|
@@ -22,29 +22,20 @@ const Link = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
22
22
|
...otherProps,
|
|
23
23
|
children: children
|
|
24
24
|
});
|
|
25
|
-
if ('hashOnly' === linkType) return /*#__PURE__*/ jsx("a", {
|
|
26
|
-
ref: ref,
|
|
27
|
-
href: href,
|
|
28
|
-
className: clsx(className, 'rp-link'),
|
|
29
|
-
onClick: onClick,
|
|
30
|
-
onMouseEnter: onMouseEnter,
|
|
31
|
-
...otherProps,
|
|
32
|
-
children: children
|
|
33
|
-
});
|
|
34
|
-
if ('relative' === linkType) return /*#__PURE__*/ jsx("a", {
|
|
25
|
+
if ('hashOnly' === linkType || 'relative' === linkType) return /*#__PURE__*/ jsx("a", {
|
|
35
26
|
ref: ref,
|
|
36
27
|
href: href,
|
|
37
28
|
className: clsx(className, 'rp-link'),
|
|
38
29
|
onMouseEnter: (event)=>{
|
|
39
30
|
onMouseEnter?.(event);
|
|
40
|
-
preloadLink(routePath);
|
|
31
|
+
if ('relative' === linkType) preloadLink(routePath);
|
|
41
32
|
},
|
|
42
33
|
onTouchStart: ()=>{
|
|
43
|
-
preloadLink(routePath);
|
|
34
|
+
if ('relative' === linkType) preloadLink(routePath);
|
|
44
35
|
},
|
|
45
36
|
onClick: (e)=>{
|
|
46
37
|
onClick?.(e);
|
|
47
|
-
if (0 !== e.button || e.currentTarget.target && '_self' !== e.currentTarget.target || e.metaKey || e.shiftKey || e.altKey || e.ctrlKey) return;
|
|
38
|
+
if (e.defaultPrevented || e.currentTarget.hasAttribute('download') || 0 !== e.button || e.currentTarget.target && '_self' !== e.currentTarget.target || e.metaKey || e.shiftKey || e.altKey || e.ctrlKey) return;
|
|
48
39
|
e.preventDefault();
|
|
49
40
|
navigate(href);
|
|
50
41
|
},
|