@rspress/core 2.0.16 → 2.0.18
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 +6 -1
- package/dist/0~execa.js +1 -1
- package/dist/{9882.js → 102.js} +1 -1
- package/dist/{9958.js → 3553.js} +2 -2
- package/dist/{5580.js → 5871.js} +2455 -6
- package/dist/cli/index.d.ts +8 -1
- package/dist/cli/index.js +105 -102
- package/dist/config/loadConfigFile.js +1 -1
- package/dist/eject-theme/components/DocContent/docComponents/title.tsx +1 -1
- package/dist/eject-theme/components/HomeFeature/index.scss +1 -0
- package/dist/eject-theme/components/HomeFeature/index.tsx +1 -1
- package/dist/eject-theme/components/HoverGroup/index.scss +9 -0
- package/dist/eject-theme/components/Link/index.tsx +1 -1
- package/dist/eject-theme/components/Link/useLinkNavigate.ts +17 -4
- package/dist/eject-theme/components/Llms/LlmsHiddenHint.test.tsx +23 -0
- package/dist/eject-theme/components/Llms/LlmsHiddenHint.tsx +15 -0
- package/dist/eject-theme/components/Llms/LlmsOpenRow.tsx +51 -64
- package/dist/eject-theme/components/Llms/LlmsViewOptions.tsx +65 -51
- package/dist/eject-theme/components/Llms/index.tsx +6 -1
- package/dist/eject-theme/components/Outline/index.tsx +1 -1
- package/dist/eject-theme/components/SocialLinks/GithubStars.test.tsx +48 -0
- package/dist/eject-theme/components/SocialLinks/GithubStars.tsx +35 -20
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2 -1
- package/dist/node/PluginDriver.js +1 -1
- 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 +2 -2
- 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 +2 -2
- package/dist/node/initRsbuild.js +19 -8
- package/dist/node/llms.d.ts +3 -0
- package/dist/node/llms.js +8 -0
- package/dist/node/logger/hint.js +1 -1
- package/dist/node/mdx/options.js +1 -1
- package/dist/node/mdx/processor.js +1 -1
- package/dist/node/mdx/rehypePlugins/codeMeta.js +1 -1
- package/dist/node/mdx/rehypePlugins/headerAnchor.js +1 -1
- package/dist/node/mdx/rehypePlugins/shiki.js +1 -1
- package/dist/node/mdx/remarkPlugins/builtin.js +1 -1
- package/dist/node/mdx/remarkPlugins/fileCodeBlock.js +2 -2
- package/dist/node/mdx/remarkPlugins/image.js +2 -2
- package/dist/node/mdx/remarkPlugins/link.js +2 -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 +5 -3
- package/dist/node/route/RouteService.js +8 -3
- package/dist/node/route/extractPageData.js +1 -1
- package/dist/node/route/normalizeRoutePath.js +1 -1
- package/dist/node/route/routeChunkAssets.d.ts +15 -0
- package/dist/node/route/routeChunkAssets.js +56 -0
- package/dist/node/runtimeModule/i18n.js +3 -3
- 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.js +6 -2
- 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/alternateLinks.d.ts +7 -0
- package/dist/node/ssg/alternateLinks.js +40 -0
- package/dist/node/ssg/htmlFile.js +1 -1
- package/dist/node/ssg/renderHtmlTemplate.d.ts +3 -1
- package/dist/node/ssg/renderHtmlTemplate.js +25 -3
- package/dist/node/ssg/renderPage.d.ts +3 -1
- package/dist/node/ssg/renderPage.js +4 -4
- package/dist/node/ssg/renderPageWorker.js +5 -5
- package/dist/node/ssg/renderPages.d.ts +3 -2
- package/dist/node/ssg/renderPages.js +16 -11
- package/dist/node/ssg/rsbuildPluginCSR.d.ts +3 -1
- package/dist/node/ssg/rsbuildPluginCSR.js +2 -2
- package/dist/node/ssg/rsbuildPluginSSG.d.ts +3 -1
- package/dist/node/ssg/rsbuildPluginSSG.js +3 -3
- package/dist/node/ssg/ssgEnv.js +1 -1
- package/dist/node/ssg-md/llms/emitLlmsTxt.js +3 -3
- package/dist/node/ssg-md/llms/llmsTxt.d.ts +4 -4
- package/dist/node/ssg-md/llms/llmsTxt.js +54 -40
- package/dist/node/ssg-md/remarkSplitMdx.js +1 -1
- package/dist/node/ssg-md/renderPage.js +2 -2
- package/dist/node/ssg-md/renderPages.js +3 -3
- package/dist/node/ssg-md/rsbuildPluginSSGMD.js +1 -1
- package/dist/node/utils/checkLanguageParity.js +1 -1
- package/dist/node/utils/createHash.d.ts +1 -1
- package/dist/node/utils/createHash.js +3 -3
- package/dist/node/utils/error.js +1 -1
- package/dist/node/utils/flattenMdxContent.js +1 -1
- package/dist/node/utils/fs.js +1 -1
- package/dist/node/utils/getPageKey.js +1 -1
- package/dist/node/utils/normalizePath.js +1 -1
- package/dist/node/utils/reactAlias.js +2 -2
- package/dist/runtime/App.js +2 -0
- package/dist/runtime/ClientApp.js +3 -2
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.js +1 -1
- package/dist/runtime/route.js +2 -0
- package/dist/runtime/utils.d.ts +2 -1
- package/dist/runtime/utils.js +5 -2
- package/dist/theme/assets/anthropic.js +15 -0
- package/dist/theme/assets/open-in-chat.js +19 -0
- package/dist/theme/assets/openai.js +15 -0
- package/dist/theme/components/DocContent/docComponents/index.d.ts +25 -18
- package/dist/theme/components/DocContent/docComponents/title.js +1 -1
- package/dist/theme/components/HomeFeature/index.css +1 -0
- package/dist/theme/components/HomeFeature/index.js +32 -34
- package/dist/theme/components/HoverGroup/index.css +7 -0
- package/dist/theme/components/Link/index.d.ts +1 -1
- package/dist/theme/components/Link/useLinkNavigate.d.ts +1 -1
- package/dist/theme/components/Link/useLinkNavigate.js +13 -5
- package/dist/theme/components/Llms/LlmsHiddenHint.d.ts +1 -0
- package/dist/theme/components/Llms/LlmsHiddenHint.js +18 -0
- package/dist/theme/components/Llms/LlmsOpenRow.js +31 -57
- package/dist/theme/components/Llms/LlmsViewOptions.d.ts +6 -4
- package/dist/theme/components/Llms/LlmsViewOptions.js +28 -45
- package/dist/theme/components/Llms/index.d.ts +2 -1
- package/dist/theme/components/Llms/index.js +1 -0
- package/dist/theme/components/Outline/index.js +1 -1
- package/dist/theme/components/Search/SearchPanel.js +8 -8
- package/dist/theme/components/SocialLinks/GithubStars.js +27 -17
- package/dist/theme/icons.d.ts +4 -1
- package/dist/theme/icons.js +8 -2
- package/dist/theme/index.d.ts +1 -1
- package/dist/theme/index.js +1 -1
- package/dist/theme/logic/getCopyableText.js +1 -0
- package/package.json +11 -11
- package/dist/6010.js +0 -2461
- package/dist/{0~8787.js → 0~8016.js} +0 -0
- package/dist/{7986.js → 4538.js} +0 -0
- package/dist/{3358.js → 5357.js} +0 -0
- package/dist/{5580.js.LICENSE.txt → 5871.js.LICENSE.txt} +0 -0
- package/dist/{8005.js → 7748.js} +2 -2
- /package/dist/{6646.js → 9857.js} +0 -0
- /package/dist/{9283.js → 9940.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cleanUrlByConfig, initPageData, isActive, isExternalUrl, pathnameToRouteService, removeBase, useLocation, useNavigate, warmPageData, withBase } from "@rspress/core/runtime";
|
|
1
|
+
import { cleanUrlByConfig, initPageData, isActive, isExternalUrl, pathnameToRouteService, removeBase, useLocation, useNavigate, useSite, warmPageData, withBase } from "@rspress/core/runtime";
|
|
2
2
|
import nprogress from "nprogress";
|
|
3
3
|
import { startTransition as external_react_startTransition, useCallback } from "react";
|
|
4
4
|
nprogress.configure({
|
|
@@ -29,14 +29,17 @@ function getHref(href) {
|
|
|
29
29
|
linkType
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
function useLinkNavigate({ startTransition } = {
|
|
32
|
+
function useLinkNavigate({ startTransition = external_react_startTransition } = {
|
|
33
33
|
startTransition: external_react_startTransition
|
|
34
34
|
}) {
|
|
35
35
|
const { pathname: currPagePathname } = useLocation();
|
|
36
36
|
const navigate = useNavigate();
|
|
37
|
+
const { site } = useSite();
|
|
38
|
+
const useTransitions = site?.route?.useTransitions;
|
|
37
39
|
return useCallback(async (href)=>{
|
|
38
40
|
const { linkType, removeBaseHref, withBaseHref } = getHref(href);
|
|
39
41
|
if ('external' === linkType || 'hashOnly' === linkType) return void window.location.assign(href);
|
|
42
|
+
const isTransitionable = !!(useTransitions && startTransition);
|
|
40
43
|
const preloadChunkThenNavigate = async ()=>{
|
|
41
44
|
const inCurrPage = isActive(removeBaseHref, currPagePathname);
|
|
42
45
|
if (!import.meta.env.SSR && !inCurrPage) {
|
|
@@ -52,15 +55,20 @@ function useLinkNavigate({ startTransition } = {
|
|
|
52
55
|
nprogress.done();
|
|
53
56
|
}
|
|
54
57
|
}
|
|
55
|
-
|
|
58
|
+
if (isTransitionable) startTransition(()=>navigate(removeBaseHref, {
|
|
59
|
+
replace: false
|
|
60
|
+
}));
|
|
61
|
+
else navigate(removeBaseHref, {
|
|
56
62
|
replace: false
|
|
57
63
|
});
|
|
58
64
|
};
|
|
59
|
-
if (
|
|
65
|
+
if (isTransitionable) startTransition(preloadChunkThenNavigate);
|
|
60
66
|
else preloadChunkThenNavigate();
|
|
61
67
|
}, [
|
|
68
|
+
useTransitions,
|
|
62
69
|
currPagePathname,
|
|
63
|
-
navigate
|
|
70
|
+
navigate,
|
|
71
|
+
startTransition
|
|
64
72
|
]);
|
|
65
73
|
}
|
|
66
74
|
export { getHref, useLinkNavigate };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function LlmsHiddenHint(): import("react").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { withBase, withSiteOrigin } from "@rspress/core/runtime";
|
|
3
|
+
import { useMdUrl } from "./useMdUrl.js";
|
|
4
|
+
function LlmsHiddenHint() {
|
|
5
|
+
const { pathname } = useMdUrl();
|
|
6
|
+
const llmsTxtUrl = withSiteOrigin(withBase('/llms.txt'));
|
|
7
|
+
const llmsFullTxtUrl = withSiteOrigin(withBase('/llms-full.txt'));
|
|
8
|
+
const pageMdUrl = withSiteOrigin(pathname);
|
|
9
|
+
return /*#__PURE__*/ jsx("div", {
|
|
10
|
+
style: {
|
|
11
|
+
display: 'none'
|
|
12
|
+
},
|
|
13
|
+
hidden: true,
|
|
14
|
+
"aria-hidden": "true",
|
|
15
|
+
children: `Are you an LLM? View ${llmsTxtUrl} for optimized Markdown documentation, or ${llmsFullTxtUrl} for full documentation bundle. This page is also available as Markdown at ${pageMdUrl}`
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
export { LlmsHiddenHint };
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useI18n, useSite } from "@rspress/core/runtime";
|
|
3
|
-
import { IconExternalLink, SvgWrapper } from "@rspress/core/theme";
|
|
3
|
+
import { IconAnthropic, IconExternalLink, IconLink, IconOpenAI, IconOpenInChat, SvgWrapper, copyToClipboard } from "@rspress/core/theme";
|
|
4
4
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
5
5
|
import "./LlmsOpenRow.css";
|
|
6
6
|
import "./LlmsViewOptions.css";
|
|
7
7
|
import { useMdUrl } from "./useMdUrl.js";
|
|
8
|
+
const DEFAULT_OPTIONS = [
|
|
9
|
+
'markdownLink',
|
|
10
|
+
'chatgpt',
|
|
11
|
+
'claude'
|
|
12
|
+
];
|
|
8
13
|
function LlmsOpenRow() {
|
|
9
14
|
const t = useI18n();
|
|
10
15
|
const { pathname } = useMdUrl();
|
|
@@ -12,10 +17,7 @@ function LlmsOpenRow() {
|
|
|
12
17
|
const llmsUI = site?.themeConfig?.llmsUI;
|
|
13
18
|
const [isOpen, setIsOpen] = useState(false);
|
|
14
19
|
const containerRef = useRef(null);
|
|
15
|
-
const options = 'object' == typeof llmsUI
|
|
16
|
-
'chatgpt',
|
|
17
|
-
'claude'
|
|
18
|
-
];
|
|
20
|
+
const options = 'object' == typeof llmsUI ? false === llmsUI.viewOptions ? [] : llmsUI.viewOptions ?? DEFAULT_OPTIONS : DEFAULT_OPTIONS;
|
|
19
21
|
useEffect(()=>{
|
|
20
22
|
const handleClickOutside = (event)=>{
|
|
21
23
|
if (containerRef.current && event.target && !containerRef.current.contains(event.target)) setIsOpen(false);
|
|
@@ -30,6 +32,15 @@ function LlmsOpenRow() {
|
|
|
30
32
|
]);
|
|
31
33
|
const q = `Read ${fullMarkdownUrl}, I want to ask questions about it.`;
|
|
32
34
|
const builtinItems = useMemo(()=>({
|
|
35
|
+
markdownLink: {
|
|
36
|
+
title: t('copyMarkdownLinkText'),
|
|
37
|
+
icon: /*#__PURE__*/ jsx(SvgWrapper, {
|
|
38
|
+
icon: IconLink
|
|
39
|
+
}),
|
|
40
|
+
onClick: ()=>{
|
|
41
|
+
copyToClipboard(fullMarkdownUrl);
|
|
42
|
+
}
|
|
43
|
+
},
|
|
33
44
|
chatgpt: {
|
|
34
45
|
title: t('openInText', {
|
|
35
46
|
name: 'ChatGPT'
|
|
@@ -38,16 +49,8 @@ function LlmsOpenRow() {
|
|
|
38
49
|
hints: 'search',
|
|
39
50
|
q
|
|
40
51
|
})}`,
|
|
41
|
-
icon: /*#__PURE__*/ jsx(
|
|
42
|
-
|
|
43
|
-
viewBox: "0 0 24 24",
|
|
44
|
-
fill: "currentColor",
|
|
45
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
46
|
-
width: "16",
|
|
47
|
-
height: "16",
|
|
48
|
-
children: /*#__PURE__*/ jsx("path", {
|
|
49
|
-
d: "M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z"
|
|
50
|
-
})
|
|
52
|
+
icon: /*#__PURE__*/ jsx(SvgWrapper, {
|
|
53
|
+
icon: IconOpenAI
|
|
51
54
|
})
|
|
52
55
|
},
|
|
53
56
|
claude: {
|
|
@@ -57,23 +60,20 @@ function LlmsOpenRow() {
|
|
|
57
60
|
href: `https://claude.ai/new?${new URLSearchParams({
|
|
58
61
|
q
|
|
59
62
|
})}`,
|
|
60
|
-
icon: /*#__PURE__*/ jsx(
|
|
61
|
-
|
|
62
|
-
role: "img",
|
|
63
|
-
viewBox: "0 0 24 24",
|
|
64
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
65
|
-
width: "16",
|
|
66
|
-
height: "16",
|
|
67
|
-
children: /*#__PURE__*/ jsx("path", {
|
|
68
|
-
d: "M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z"
|
|
69
|
-
})
|
|
63
|
+
icon: /*#__PURE__*/ jsx(SvgWrapper, {
|
|
64
|
+
icon: IconAnthropic
|
|
70
65
|
})
|
|
71
66
|
}
|
|
72
67
|
}), [
|
|
68
|
+
fullMarkdownUrl,
|
|
73
69
|
t,
|
|
74
70
|
q
|
|
75
71
|
]);
|
|
76
|
-
|
|
72
|
+
const renderableItems = useMemo(()=>options.map((option)=>builtinItems[option] ?? null).filter((item)=>null !== item), [
|
|
73
|
+
options,
|
|
74
|
+
builtinItems
|
|
75
|
+
]);
|
|
76
|
+
if (!pathname || 0 === renderableItems.length) return null;
|
|
77
77
|
return /*#__PURE__*/ jsxs("div", {
|
|
78
78
|
ref: containerRef,
|
|
79
79
|
className: "rp-outline__open-in-wrapper",
|
|
@@ -82,29 +82,8 @@ function LlmsOpenRow() {
|
|
|
82
82
|
className: "rp-outline__action-row",
|
|
83
83
|
onClick: ()=>setIsOpen(!isOpen),
|
|
84
84
|
children: [
|
|
85
|
-
/*#__PURE__*/
|
|
86
|
-
|
|
87
|
-
height: "16",
|
|
88
|
-
viewBox: "0 0 24 24",
|
|
89
|
-
fill: "none",
|
|
90
|
-
stroke: "currentColor",
|
|
91
|
-
strokeWidth: "2",
|
|
92
|
-
strokeLinecap: "round",
|
|
93
|
-
strokeLinejoin: "round",
|
|
94
|
-
children: [
|
|
95
|
-
/*#__PURE__*/ jsx("path", {
|
|
96
|
-
d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"
|
|
97
|
-
}),
|
|
98
|
-
/*#__PURE__*/ jsx("polyline", {
|
|
99
|
-
points: "15 3 21 3 21 9"
|
|
100
|
-
}),
|
|
101
|
-
/*#__PURE__*/ jsx("line", {
|
|
102
|
-
x1: "10",
|
|
103
|
-
y1: "14",
|
|
104
|
-
x2: "21",
|
|
105
|
-
y2: "3"
|
|
106
|
-
})
|
|
107
|
-
]
|
|
85
|
+
/*#__PURE__*/ jsx(SvgWrapper, {
|
|
86
|
+
icon: IconOpenInChat
|
|
108
87
|
}),
|
|
109
88
|
/*#__PURE__*/ jsx("span", {
|
|
110
89
|
children: t('openInText', {
|
|
@@ -115,13 +94,7 @@ function LlmsOpenRow() {
|
|
|
115
94
|
}),
|
|
116
95
|
isOpen && /*#__PURE__*/ jsx("div", {
|
|
117
96
|
className: "rp-llms-view-options__menu",
|
|
118
|
-
children:
|
|
119
|
-
let item;
|
|
120
|
-
if ('string' == typeof option && builtinItems[option]) item = builtinItems[option];
|
|
121
|
-
else {
|
|
122
|
-
if ('object' != typeof option || !('title' in option)) return null;
|
|
123
|
-
item = option;
|
|
124
|
-
}
|
|
97
|
+
children: renderableItems.map((item)=>{
|
|
125
98
|
if (item.href) return /*#__PURE__*/ jsxs("a", {
|
|
126
99
|
className: "rp-llms-view-options__menu-item",
|
|
127
100
|
href: item.href,
|
|
@@ -144,7 +117,8 @@ function LlmsOpenRow() {
|
|
|
144
117
|
})
|
|
145
118
|
]
|
|
146
119
|
}, item.title);
|
|
147
|
-
return /*#__PURE__*/ jsxs("
|
|
120
|
+
return /*#__PURE__*/ jsxs("button", {
|
|
121
|
+
type: "button",
|
|
148
122
|
className: "rp-llms-view-options__menu-item",
|
|
149
123
|
onClick: ()=>{
|
|
150
124
|
item.onClick?.();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import './index.scss';
|
|
3
3
|
import './LlmsViewOptions.scss';
|
|
4
|
-
type
|
|
4
|
+
export type LlmsViewOptionsItem = {
|
|
5
5
|
title: string;
|
|
6
6
|
icon?: React.ReactNode;
|
|
7
7
|
onClick?: () => void;
|
|
@@ -16,8 +16,11 @@ export interface LlmsViewOptionsProps extends React.ButtonHTMLAttributes<HTMLBut
|
|
|
16
16
|
* @default ['markdownLink', 'chatgpt', 'claude']
|
|
17
17
|
* - 'chatgpt': Open in ChatGPT
|
|
18
18
|
* - 'claude': Open in Claude
|
|
19
|
+
*
|
|
20
|
+
* Unlike `themeConfig.llmsUI.viewOptions`, component options can use
|
|
21
|
+
* ReactNode icons and onClick callbacks.
|
|
19
22
|
*/
|
|
20
|
-
options?:
|
|
23
|
+
options?: LlmsViewOptionsItem[];
|
|
21
24
|
/**
|
|
22
25
|
* Button text by language, used with `useLang`.
|
|
23
26
|
* @default en: 'Open', zh: '\u6253\u5f00'
|
|
@@ -30,5 +33,4 @@ export interface LlmsViewOptionsProps extends React.ButtonHTMLAttributes<HTMLBut
|
|
|
30
33
|
*/
|
|
31
34
|
text?: string;
|
|
32
35
|
}
|
|
33
|
-
export declare function LlmsViewOptions({ options: propsOptions, }: LlmsViewOptionsProps): React.JSX.Element;
|
|
34
|
-
export {};
|
|
36
|
+
export declare function LlmsViewOptions({ options: propsOptions, }: LlmsViewOptionsProps): React.JSX.Element | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
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, SvgWrapper, copyToClipboard } from "@rspress/core/theme";
|
|
4
|
+
import { IconAnthropic, IconDown, IconExternalLink, IconLink, IconOpenAI, SvgWrapper, copyToClipboard } from "@rspress/core/theme";
|
|
5
5
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
6
6
|
import "./index.css";
|
|
7
7
|
import "./LlmsViewOptions.css";
|
|
@@ -18,7 +18,8 @@ import { useMdUrl } from "./useMdUrl.js";
|
|
|
18
18
|
function LlmsViewOptions({ options: propsOptions }) {
|
|
19
19
|
const { site } = useSite();
|
|
20
20
|
const llmsUI = site?.themeConfig?.llmsUI;
|
|
21
|
-
const
|
|
21
|
+
const configuredOptions = 'object' == typeof llmsUI ? llmsUI?.viewOptions : propsOptions;
|
|
22
|
+
const options = false === configuredOptions ? [] : configuredOptions ?? DEFAULT_OPTIONS;
|
|
22
23
|
const [isOpen, setIsOpen] = useState(false);
|
|
23
24
|
const dropdownRef = useRef(null);
|
|
24
25
|
useEffect(()=>{
|
|
@@ -56,22 +57,8 @@ function LlmsViewOptions({ options: propsOptions }) {
|
|
|
56
57
|
hints: 'search',
|
|
57
58
|
q
|
|
58
59
|
})}`,
|
|
59
|
-
icon: /*#__PURE__*/
|
|
60
|
-
|
|
61
|
-
viewBox: "0 0 24 24",
|
|
62
|
-
fill: "currentColor",
|
|
63
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
64
|
-
children: [
|
|
65
|
-
/*#__PURE__*/ jsx("title", {
|
|
66
|
-
children: "OpenAI"
|
|
67
|
-
}),
|
|
68
|
-
/*#__PURE__*/ jsx("path", {
|
|
69
|
-
d: "M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z"
|
|
70
|
-
}),
|
|
71
|
-
/*#__PURE__*/ jsx("path", {
|
|
72
|
-
d: "M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z"
|
|
73
|
-
})
|
|
74
|
-
]
|
|
60
|
+
icon: /*#__PURE__*/ jsx(SvgWrapper, {
|
|
61
|
+
icon: IconOpenAI
|
|
75
62
|
})
|
|
76
63
|
},
|
|
77
64
|
claude: {
|
|
@@ -81,19 +68,8 @@ function LlmsViewOptions({ options: propsOptions }) {
|
|
|
81
68
|
href: `https://claude.ai/new?${new URLSearchParams({
|
|
82
69
|
q
|
|
83
70
|
})}`,
|
|
84
|
-
icon: /*#__PURE__*/
|
|
85
|
-
|
|
86
|
-
role: "img",
|
|
87
|
-
viewBox: "0 0 24 24",
|
|
88
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
89
|
-
children: [
|
|
90
|
-
/*#__PURE__*/ jsx("title", {
|
|
91
|
-
children: "Anthropic"
|
|
92
|
-
}),
|
|
93
|
-
/*#__PURE__*/ jsx("path", {
|
|
94
|
-
d: "M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z"
|
|
95
|
-
})
|
|
96
|
-
]
|
|
71
|
+
icon: /*#__PURE__*/ jsx(SvgWrapper, {
|
|
72
|
+
icon: IconAnthropic
|
|
97
73
|
})
|
|
98
74
|
}
|
|
99
75
|
};
|
|
@@ -101,6 +77,17 @@ function LlmsViewOptions({ options: propsOptions }) {
|
|
|
101
77
|
pathname,
|
|
102
78
|
t
|
|
103
79
|
]);
|
|
80
|
+
const renderableItems = useMemo(()=>options.map((option)=>{
|
|
81
|
+
if ('markdownLink' === option) return items.markdownLink;
|
|
82
|
+
if ('chatgpt' === option) return items.chatgpt;
|
|
83
|
+
if ('claude' === option) return items.claude;
|
|
84
|
+
if ('object' == typeof option && 'title' in option && 'string' == typeof option.title && ('href' in option || 'onClick' in option)) return option;
|
|
85
|
+
return null;
|
|
86
|
+
}).filter((item)=>null !== item), [
|
|
87
|
+
items,
|
|
88
|
+
options
|
|
89
|
+
]);
|
|
90
|
+
if (0 === renderableItems.length) return null;
|
|
104
91
|
return /*#__PURE__*/ jsx(Fragment, {
|
|
105
92
|
children: /*#__PURE__*/ jsxs("button", {
|
|
106
93
|
ref: dropdownRef,
|
|
@@ -113,23 +100,19 @@ function LlmsViewOptions({ options: propsOptions }) {
|
|
|
113
100
|
}),
|
|
114
101
|
isOpen && /*#__PURE__*/ jsx("div", {
|
|
115
102
|
className: "rp-llms-view-options__menu",
|
|
116
|
-
children:
|
|
117
|
-
|
|
118
|
-
if ('markdownLink' === item) displayItem = items.markdownLink;
|
|
119
|
-
else if ('chatgpt' === item) displayItem = items.chatgpt;
|
|
120
|
-
else if ('claude' === item) displayItem = items.claude;
|
|
121
|
-
if (displayItem.href) return /*#__PURE__*/ jsxs("a", {
|
|
103
|
+
children: renderableItems.map((item)=>{
|
|
104
|
+
if (item.href) return /*#__PURE__*/ jsxs("a", {
|
|
122
105
|
className: "rp-llms-view-options__menu-item",
|
|
123
|
-
href:
|
|
106
|
+
href: item.href,
|
|
124
107
|
target: "_blank",
|
|
125
108
|
rel: "noopener noreferrer",
|
|
126
109
|
children: [
|
|
127
110
|
/*#__PURE__*/ jsx("span", {
|
|
128
111
|
className: "rp-llms-view-options__item-icon",
|
|
129
|
-
children:
|
|
112
|
+
children: item.icon
|
|
130
113
|
}),
|
|
131
114
|
/*#__PURE__*/ jsx("span", {
|
|
132
|
-
children:
|
|
115
|
+
children: item.title
|
|
133
116
|
}),
|
|
134
117
|
/*#__PURE__*/ jsx("span", {
|
|
135
118
|
className: "rp-llms-view-options__external-icon",
|
|
@@ -138,20 +121,20 @@ function LlmsViewOptions({ options: propsOptions }) {
|
|
|
138
121
|
})
|
|
139
122
|
})
|
|
140
123
|
]
|
|
141
|
-
},
|
|
124
|
+
}, item.title);
|
|
142
125
|
return /*#__PURE__*/ jsxs("div", {
|
|
143
126
|
className: "rp-llms-view-options__menu-item",
|
|
144
|
-
onClick:
|
|
127
|
+
onClick: item.onClick,
|
|
145
128
|
children: [
|
|
146
129
|
/*#__PURE__*/ jsx("span", {
|
|
147
130
|
className: "rp-llms-view-options__item-icon",
|
|
148
|
-
children:
|
|
131
|
+
children: item.icon
|
|
149
132
|
}),
|
|
150
133
|
/*#__PURE__*/ jsx("span", {
|
|
151
|
-
children:
|
|
134
|
+
children: item.title
|
|
152
135
|
})
|
|
153
136
|
]
|
|
154
|
-
},
|
|
137
|
+
}, item.title);
|
|
155
138
|
})
|
|
156
139
|
})
|
|
157
140
|
]
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { LlmsContainer, type LlmsContainerProps } from './LlmsContainer.js';
|
|
2
2
|
export { LlmsCopyButton, type LlmsCopyButtonProps } from './LlmsCopyButton.js';
|
|
3
|
-
export {
|
|
3
|
+
export { LlmsHiddenHint } from './LlmsHiddenHint.js';
|
|
4
|
+
export { LlmsViewOptions, type LlmsViewOptionsItem, type LlmsViewOptionsProps, } from './LlmsViewOptions.js';
|
|
4
5
|
export { useMdUrl } from './useMdUrl.js';
|
|
@@ -33,7 +33,7 @@ function Outline() {
|
|
|
33
33
|
/*#__PURE__*/ jsx(EditLink, {
|
|
34
34
|
isOutline: true
|
|
35
35
|
}),
|
|
36
|
-
|
|
36
|
+
import.meta.env.ENABLE_LLMS_UI && 'outline' === placement && /*#__PURE__*/ jsxs(Fragment, {
|
|
37
37
|
children: [
|
|
38
38
|
/*#__PURE__*/ jsx(LlmsCopyRow, {}),
|
|
39
39
|
/*#__PURE__*/ jsx(LlmsOpenRow, {})
|
|
@@ -4,7 +4,7 @@ import { IconClose, IconLoading, IconSearch, SvgWrapper, Tab, Tabs, useLinkNavig
|
|
|
4
4
|
import { debounce } from "@rspress/shared/lodash-es";
|
|
5
5
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
6
6
|
import { createPortal } from "react-dom";
|
|
7
|
-
import * as
|
|
7
|
+
import * as __rspack_external_virtual_search_hooks_705b6e40 from "virtual-search-hooks";
|
|
8
8
|
import { PageSearcher } from "./logic/search.js";
|
|
9
9
|
import { RenderType } from "./logic/types.js";
|
|
10
10
|
import { NoSearchResult } from "./NoSearchResult.js";
|
|
@@ -204,24 +204,24 @@ function SearchPanel({ focused, setFocused }) {
|
|
|
204
204
|
setQuery(newQuery);
|
|
205
205
|
if (newQuery) {
|
|
206
206
|
const searchResult = [];
|
|
207
|
-
if ("beforeSearch" in
|
|
207
|
+
if ("beforeSearch" in __rspack_external_virtual_search_hooks_705b6e40) {
|
|
208
208
|
const key = 'beforeSearch';
|
|
209
|
-
const transformedQuery = await
|
|
209
|
+
const transformedQuery = await __rspack_external_virtual_search_hooks_705b6e40[key](newQuery);
|
|
210
210
|
if (transformedQuery) newQuery = transformedQuery;
|
|
211
211
|
}
|
|
212
212
|
const defaultSearchResult = await pageSearcherRef.current?.match(newQuery);
|
|
213
213
|
if (defaultSearchResult) searchResult.push(...defaultSearchResult);
|
|
214
|
-
if ("onSearch" in
|
|
214
|
+
if ("onSearch" in __rspack_external_virtual_search_hooks_705b6e40) {
|
|
215
215
|
const key = 'onSearch';
|
|
216
|
-
const customSearchResult = await
|
|
216
|
+
const customSearchResult = await __rspack_external_virtual_search_hooks_705b6e40[key](newQuery, searchResult);
|
|
217
217
|
if (customSearchResult) searchResult.push(...customSearchResult.map((item)=>({
|
|
218
218
|
renderType: RenderType.Custom,
|
|
219
219
|
...item
|
|
220
220
|
})));
|
|
221
221
|
}
|
|
222
|
-
if ("afterSearch" in
|
|
222
|
+
if ("afterSearch" in __rspack_external_virtual_search_hooks_705b6e40) {
|
|
223
223
|
const key = 'afterSearch';
|
|
224
|
-
await
|
|
224
|
+
await __rspack_external_virtual_search_hooks_705b6e40[key](newQuery, searchResult);
|
|
225
225
|
}
|
|
226
226
|
const currQuery = searchInputRef.current?.value;
|
|
227
227
|
if (currQuery === newQuery) {
|
|
@@ -256,7 +256,7 @@ function SearchPanel({ focused, setFocused }) {
|
|
|
256
256
|
label: item.group,
|
|
257
257
|
children: [
|
|
258
258
|
item.renderType === RenderType.Default && renderSearchResultItem(item.result, query, isSearching),
|
|
259
|
-
item.renderType === RenderType.Custom &&
|
|
259
|
+
item.renderType === RenderType.Custom && __rspack_external_virtual_search_hooks_705b6e40[renderKey](item.result)
|
|
260
260
|
]
|
|
261
261
|
}, item.group))
|
|
262
262
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
|
+
import { useStorageValue } from "../../logic/useStorageValue.js";
|
|
3
4
|
const TTL_MS = 3600000;
|
|
4
5
|
function storageKey(repo) {
|
|
5
6
|
return `rp-github-stars:${repo}`;
|
|
@@ -16,10 +17,8 @@ function parseRepo(content) {
|
|
|
16
17
|
return null;
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
-
if ("u" < typeof localStorage) return null;
|
|
20
|
+
function parseCache(raw) {
|
|
21
21
|
try {
|
|
22
|
-
const raw = localStorage.getItem(storageKey(repo));
|
|
23
22
|
if (!raw) return null;
|
|
24
23
|
const parsed = JSON.parse(raw);
|
|
25
24
|
if ('number' != typeof parsed?.count || 'number' != typeof parsed?.fetchedAt) return null;
|
|
@@ -28,14 +27,11 @@ function readCache(repo) {
|
|
|
28
27
|
return null;
|
|
29
28
|
}
|
|
30
29
|
}
|
|
31
|
-
function
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
fetchedAt: Date.now()
|
|
37
|
-
}));
|
|
38
|
-
} catch {}
|
|
30
|
+
function createCacheValue(count) {
|
|
31
|
+
return JSON.stringify({
|
|
32
|
+
count,
|
|
33
|
+
fetchedAt: Date.now()
|
|
34
|
+
});
|
|
39
35
|
}
|
|
40
36
|
function formatCount(count) {
|
|
41
37
|
if (count >= 1000000) return `${(count / 1000000).toFixed(1)}M`;
|
|
@@ -45,24 +41,38 @@ function formatCount(count) {
|
|
|
45
41
|
const GithubStars = (props)=>{
|
|
46
42
|
const { content, icon } = props;
|
|
47
43
|
const repo = parseRepo(content);
|
|
48
|
-
const [
|
|
44
|
+
const [rawCache, setRawCache] = useStorageValue(repo ? storageKey(repo) : '', null);
|
|
45
|
+
const [isMounted, setIsMounted] = useState(false);
|
|
46
|
+
const [count, setCount] = useState(null);
|
|
47
|
+
useEffect(()=>{
|
|
48
|
+
setIsMounted(true);
|
|
49
|
+
}, []);
|
|
49
50
|
useEffect(()=>{
|
|
50
|
-
if (!repo) return;
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
if (!repo) return void setCount(null);
|
|
52
|
+
if (!isMounted) return;
|
|
53
|
+
const cached = parseCache(rawCache);
|
|
54
|
+
if (cached) {
|
|
55
|
+
setCount(cached.count);
|
|
56
|
+
if (Date.now() - cached.fetchedAt < TTL_MS) return;
|
|
57
|
+
} else setCount(null);
|
|
53
58
|
let cancelled = false;
|
|
54
59
|
fetch(`https://api.github.com/repos/${repo}`).then((res)=>res.ok ? res.json() : Promise.reject(res.status)).then((data)=>{
|
|
55
60
|
if (cancelled) return;
|
|
56
61
|
if ('number' == typeof data?.stargazers_count) {
|
|
57
62
|
setCount(data.stargazers_count);
|
|
58
|
-
|
|
63
|
+
try {
|
|
64
|
+
setRawCache(createCacheValue(data.stargazers_count));
|
|
65
|
+
} catch {}
|
|
59
66
|
}
|
|
60
67
|
}).catch(()=>{});
|
|
61
68
|
return ()=>{
|
|
62
69
|
cancelled = true;
|
|
63
70
|
};
|
|
64
71
|
}, [
|
|
65
|
-
|
|
72
|
+
isMounted,
|
|
73
|
+
rawCache,
|
|
74
|
+
repo,
|
|
75
|
+
setRawCache
|
|
66
76
|
]);
|
|
67
77
|
return /*#__PURE__*/ jsxs("a", {
|
|
68
78
|
href: content,
|
package/dist/theme/icons.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
type Icon = React.FC<React.SVGProps<SVGSVGElement>> | string;
|
|
2
2
|
export declare const IconDeprecated: Icon;
|
|
3
3
|
export declare const IconExperimental: Icon;
|
|
4
|
+
export declare const IconExternalLink: Icon;
|
|
5
|
+
export declare const IconOpenInChat: Icon;
|
|
4
6
|
export declare const IconArrowDown: Icon;
|
|
5
7
|
export declare const IconArrowRight: Icon;
|
|
8
|
+
export declare const IconAnthropic: Icon;
|
|
6
9
|
export declare const IconClose: Icon;
|
|
7
10
|
export declare const IconCopy: Icon;
|
|
8
11
|
export declare const IconDown: Icon;
|
|
@@ -16,6 +19,7 @@ export declare const IconJump: Icon;
|
|
|
16
19
|
export declare const IconLoading: Icon;
|
|
17
20
|
export declare const IconMenu: Icon;
|
|
18
21
|
export declare const IconMoon: Icon;
|
|
22
|
+
export declare const IconOpenAI: Icon;
|
|
19
23
|
export declare const IconScrollToTop: Icon;
|
|
20
24
|
export declare const IconSearch: Icon;
|
|
21
25
|
export declare const IconSmallMenu: Icon;
|
|
@@ -24,6 +28,5 @@ export declare const IconSun: Icon;
|
|
|
24
28
|
export declare const IconTitle: Icon;
|
|
25
29
|
export declare const IconWrap: Icon;
|
|
26
30
|
export declare const IconWrapped: Icon;
|
|
27
|
-
export declare const IconExternalLink: Icon;
|
|
28
31
|
export declare const IconLink: Icon;
|
|
29
32
|
export {};
|
package/dist/theme/icons.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import arrow_down from "./assets/arrow-down.js";
|
|
2
2
|
import arrow_right from "./assets/arrow-right.js";
|
|
3
|
+
import anthropic from "./assets/anthropic.js";
|
|
3
4
|
import assets_close from "./assets/close.js";
|
|
4
5
|
import copy from "./assets/copy.js";
|
|
5
6
|
import deprecated from "./assets/deprecated.js";
|
|
@@ -8,6 +9,7 @@ import edit from "./assets/edit.js";
|
|
|
8
9
|
import empty from "./assets/empty.js";
|
|
9
10
|
import experimental from "./assets/experimental.js";
|
|
10
11
|
import external_link from "./assets/external-link.js";
|
|
12
|
+
import open_in_chat from "./assets/open-in-chat.js";
|
|
11
13
|
import file from "./assets/file.js";
|
|
12
14
|
import github from "./assets/github.js";
|
|
13
15
|
import gitlab from "./assets/gitlab.js";
|
|
@@ -17,6 +19,7 @@ import assets_link from "./assets/link.js";
|
|
|
17
19
|
import loading from "./assets/loading.js";
|
|
18
20
|
import menu from "./assets/menu.js";
|
|
19
21
|
import moon from "./assets/moon.js";
|
|
22
|
+
import openai from "./assets/openai.js";
|
|
20
23
|
import scroll_to_top from "./assets/scroll-to-top.js";
|
|
21
24
|
import search from "./assets/search.js";
|
|
22
25
|
import small_menu from "./assets/small-menu.js";
|
|
@@ -27,8 +30,11 @@ import wrap from "./assets/wrap.js";
|
|
|
27
30
|
import wrapped from "./assets/wrapped.js";
|
|
28
31
|
const IconDeprecated = deprecated;
|
|
29
32
|
const IconExperimental = experimental;
|
|
33
|
+
const IconExternalLink = external_link;
|
|
34
|
+
const IconOpenInChat = open_in_chat;
|
|
30
35
|
const IconArrowDown = arrow_down;
|
|
31
36
|
const IconArrowRight = arrow_right;
|
|
37
|
+
const IconAnthropic = anthropic;
|
|
32
38
|
const IconClose = assets_close;
|
|
33
39
|
const IconCopy = copy;
|
|
34
40
|
const IconDown = down;
|
|
@@ -42,6 +48,7 @@ const IconJump = jump;
|
|
|
42
48
|
const IconLoading = loading;
|
|
43
49
|
const IconMenu = menu;
|
|
44
50
|
const IconMoon = moon;
|
|
51
|
+
const IconOpenAI = openai;
|
|
45
52
|
const IconScrollToTop = scroll_to_top;
|
|
46
53
|
const IconSearch = search;
|
|
47
54
|
const IconSmallMenu = small_menu;
|
|
@@ -50,6 +57,5 @@ const IconSun = sun;
|
|
|
50
57
|
const IconTitle = title;
|
|
51
58
|
const IconWrap = wrap;
|
|
52
59
|
const IconWrapped = wrapped;
|
|
53
|
-
const IconExternalLink = external_link;
|
|
54
60
|
const IconLink = assets_link;
|
|
55
|
-
export { IconArrowDown, IconArrowRight, IconClose, IconCopy, IconDeprecated, IconDown, IconEdit, IconEmpty, IconExperimental, IconExternalLink, IconFile, IconGithub, IconGitlab, IconHeader, IconJump, IconLink, IconLoading, IconMenu, IconMoon, IconScrollToTop, IconSearch, IconSmallMenu, IconSuccess, IconSun, IconTitle, IconWrap, IconWrapped };
|
|
61
|
+
export { IconAnthropic, IconArrowDown, IconArrowRight, IconClose, IconCopy, IconDeprecated, IconDown, IconEdit, IconEmpty, IconExperimental, IconExternalLink, IconFile, IconGithub, IconGitlab, IconHeader, IconJump, IconLink, IconLoading, IconMenu, IconMoon, IconOpenAI, IconOpenInChat, IconScrollToTop, IconSearch, IconSmallMenu, IconSuccess, IconSun, IconTitle, IconWrap, IconWrapped };
|
package/dist/theme/index.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export { useHoverGroup } from './components/HoverGroup/useHoverGroup.js';
|
|
|
21
21
|
export { LastUpdated } from './components/LastUpdated/index.js';
|
|
22
22
|
export { Link, type LinkProps } from './components/Link/index.js';
|
|
23
23
|
export { useLinkNavigate } from './components/Link/useLinkNavigate.js';
|
|
24
|
-
export { LlmsContainer, type LlmsContainerProps, LlmsCopyButton, type LlmsCopyButtonProps, LlmsViewOptions, type LlmsViewOptionsProps, useMdUrl, } from './components/Llms/index.js';
|
|
24
|
+
export { LlmsContainer, type LlmsContainerProps, LlmsCopyButton, type LlmsCopyButtonProps, LlmsHiddenHint, LlmsViewOptions, type LlmsViewOptionsItem, type LlmsViewOptionsProps, useMdUrl, } from './components/Llms/index.js';
|
|
25
25
|
export { LlmsCopyRow } from './components/Llms/LlmsCopyRow.js';
|
|
26
26
|
export { LlmsOpenRow } from './components/Llms/LlmsOpenRow.js';
|
|
27
27
|
export { Nav, type NavProps } from './components/Nav/index.js';
|