@rspress/core 2.0.17 → 2.0.19
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/{4538.js → 4538~0.js} +1 -1
- package/dist/6305~0.js +3007 -0
- package/dist/{7448.js → 8472~0.js} +3 -3
- package/dist/{0~execa.js → 864~0.js} +11 -11
- package/dist/cli/index.js +13 -40
- package/dist/config/defineConfig.d.ts +15 -15
- 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 +25 -0
- package/dist/eject-theme/components/HoverGroup/index.tsx +22 -1
- package/dist/eject-theme/components/Llms/LlmsCopyButton.tsx +2 -6
- package/dist/eject-theme/components/Llms/LlmsCopyRow.tsx +2 -5
- package/dist/eject-theme/components/Llms/LlmsHint.test.tsx +104 -0
- package/dist/eject-theme/components/Llms/LlmsHint.tsx +70 -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/getLlmsCopyContent.test.ts +21 -0
- package/dist/eject-theme/components/Llms/getLlmsCopyContent.ts +20 -0
- package/dist/eject-theme/components/Llms/index.tsx +6 -1
- package/dist/eject-theme/components/Nav/NavMenu.scss +16 -0
- package/dist/eject-theme/components/Nav/NavMenu.tsx +12 -0
- package/dist/eject-theme/components/NavScreen/NavScreenMenuItem.scss +18 -2
- package/dist/eject-theme/components/NavScreen/NavScreenMenuItem.tsx +27 -19
- package/dist/eject-theme/components/NavScreen/index.scss +4 -0
- package/dist/eject-theme/components/Outline/index.scss +4 -0
- package/dist/eject-theme/components/Outline/index.tsx +1 -1
- package/dist/eject-theme/components/Sidebar/SidebarGroup.tsx +3 -0
- package/dist/eject-theme/components/Sidebar/SidebarItem.scss +16 -0
- package/dist/eject-theme/components/Sidebar/SidebarItem.test.tsx +51 -0
- package/dist/eject-theme/components/Sidebar/SidebarItem.tsx +10 -1
- package/dist/eject-theme/components/Sidebar/SidebarSectionHeader.scss +15 -0
- package/dist/eject-theme/components/Sidebar/SidebarSectionHeader.tsx +6 -1
- package/dist/eject-theme/components/Sidebar/index.tsx +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -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 +39 -10
- package/dist/node/auto-nav-sidebar/type.d.ts +7 -0
- package/dist/node/auto-nav-sidebar/utils.d.ts +1 -0
- package/dist/node/auto-nav-sidebar/utils.js +2 -1
- package/dist/node/auto-nav-sidebar/walk.js +1 -1
- package/dist/node/constants.d.ts +2 -1
- package/dist/node/constants.js +50 -2
- package/dist/node/dev.d.ts +2 -1
- package/dist/node/dev.js +7 -2
- package/dist/node/eject.js +3 -3
- package/dist/node/initRsbuild.d.ts +6 -2
- package/dist/node/initRsbuild.js +49 -14
- package/dist/node/last-updated/index.js +112 -15
- package/dist/node/llms.d.ts +3 -0
- package/dist/node/llms.js +8 -0
- package/dist/node/logger/hint.js +2 -2
- 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 +3 -3
- package/dist/node/mdx/remarkPlugins/image.js +3 -3
- package/dist/node/mdx/remarkPlugins/link.js +3 -3
- 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 +3 -15
- 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 +1 -1
- package/dist/node/runtimeModule/siteData/normalizeThemeConfig.js +1 -1
- package/dist/node/runtimeModule/siteData/rsbuildPlugin.js +1 -1
- package/dist/node/serve.js +1 -1
- package/dist/node/ssg/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 +5 -5
- package/dist/node/ssg/renderPageWorker.js +5 -5
- package/dist/node/ssg/renderPages.d.ts +3 -2
- package/dist/node/ssg/renderPages.js +18 -13
- 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 +2 -2
- package/dist/node/ssg-md/llms/llmsTxt.d.ts +2 -2
- package/dist/node/ssg-md/llms/llmsTxt.js +49 -35
- package/dist/node/ssg-md/remarkSplitMdx.js +8 -10
- package/dist/node/ssg-md/renderPage.js +3 -3
- package/dist/node/ssg-md/renderPages.js +4 -4
- 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 +2 -2
- 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 +3 -3
- package/dist/runtime/App.js +7 -2
- package/dist/runtime/index.d.ts +2 -1
- package/dist/runtime/index.js +2 -1
- package/dist/runtime/reactDom.d.ts +19 -0
- package/dist/runtime/reactDom.js +5 -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/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 +22 -0
- package/dist/theme/components/HoverGroup/index.js +17 -1
- package/dist/theme/components/Llms/LlmsCopyButton.js +3 -4
- package/dist/theme/components/Llms/LlmsCopyRow.js +2 -3
- package/dist/theme/components/Llms/LlmsHint.d.ts +2 -0
- package/dist/theme/components/Llms/LlmsHint.js +40 -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/getLlmsCopyContent.d.ts +1 -0
- package/dist/theme/components/Llms/getLlmsCopyContent.js +14 -0
- package/dist/theme/components/Llms/index.d.ts +2 -1
- package/dist/theme/components/Llms/index.js +1 -0
- package/dist/theme/components/Nav/NavMenu.css +15 -0
- package/dist/theme/components/Nav/NavMenu.js +8 -0
- package/dist/theme/components/NavScreen/NavScreenMenuItem.css +17 -2
- package/dist/theme/components/NavScreen/NavScreenMenuItem.js +21 -22
- package/dist/theme/components/NavScreen/index.css +4 -0
- package/dist/theme/components/Outline/index.css +4 -0
- package/dist/theme/components/Outline/index.js +1 -1
- package/dist/theme/components/Sidebar/SidebarGroup.js +4 -1
- package/dist/theme/components/Sidebar/SidebarItem.css +15 -0
- package/dist/theme/components/Sidebar/SidebarItem.d.ts +2 -1
- package/dist/theme/components/Sidebar/SidebarItem.js +7 -2
- package/dist/theme/components/Sidebar/SidebarSectionHeader.css +14 -0
- package/dist/theme/components/Sidebar/SidebarSectionHeader.d.ts +2 -1
- package/dist/theme/components/Sidebar/SidebarSectionHeader.js +12 -6
- package/dist/theme/components/Sidebar/index.js +1 -0
- package/dist/theme/icons.d.ts +4 -1
- package/dist/theme/icons.js +8 -2
- 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/meta-json-schema.json +33 -3
- package/nav-json-schema.json +9 -0
- package/package.json +16 -21
- package/dist/8629.js +0 -7275
- package/dist/8629.js.LICENSE.txt +0 -41
- package/dist/theme/logic/useRedirect4FirstVisit.d.ts +0 -5
- package/dist/theme/logic/useRedirect4FirstVisit.js +0 -31
- /package/dist/{102.js → 102~0.js} +0 -0
- /package/dist/{5357.js → 5357~0.js} +0 -0
- /package/dist/{7748.js → 7748~0.js} +0 -0
- /package/dist/{0~8016.js → 8016~0.js} +0 -0
- /package/dist/{9857.js → 9857~0.js} +0 -0
- /package/dist/{9940.js → 9940~0.js} +0 -0
- /package/dist/{0~rslib-runtime.js → rslib-runtime~0.js} +0 -0
- /package/dist/{0~tinypool.js → tinypool~0.js} +0 -0
|
@@ -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
|
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getLlmsCopyContent(url: string): Promise<string>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const cache = new Map();
|
|
2
|
+
const DEV_COPY_WARNING = 'Warning: Markdown content is unavailable in development mode; run `rspress build` to use this feature.';
|
|
3
|
+
async function getLlmsCopyContent(url) {
|
|
4
|
+
if (import.meta.env.DEV) {
|
|
5
|
+
console.warn(DEV_COPY_WARNING);
|
|
6
|
+
return DEV_COPY_WARNING;
|
|
7
|
+
}
|
|
8
|
+
const cachedContent = cache.get(url);
|
|
9
|
+
if (void 0 !== cachedContent) return cachedContent;
|
|
10
|
+
const content = await fetch(url).then((response)=>response.text());
|
|
11
|
+
cache.set(url, content);
|
|
12
|
+
return content;
|
|
13
|
+
}
|
|
14
|
+
export { getLlmsCopyContent };
|
|
@@ -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 { LlmsHint } from './LlmsHint.js';
|
|
4
|
+
export { LlmsViewOptions, type LlmsViewOptionsItem, type LlmsViewOptionsProps, } from './LlmsViewOptions.js';
|
|
4
5
|
export { useMdUrl } from './useMdUrl.js';
|
|
@@ -48,6 +48,21 @@
|
|
|
48
48
|
display: flex;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
.rp-nav-menu__item__leading-icon {
|
|
52
|
+
object-fit: contain;
|
|
53
|
+
flex: 0 0 16px;
|
|
54
|
+
width: 16px;
|
|
55
|
+
height: 16px;
|
|
56
|
+
font-size: 16px;
|
|
57
|
+
line-height: 16px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.rp-nav-menu__item__leading-icon > svg, .rp-nav-menu__item__leading-icon > img {
|
|
61
|
+
object-fit: contain;
|
|
62
|
+
width: 100%;
|
|
63
|
+
height: 100%;
|
|
64
|
+
}
|
|
65
|
+
|
|
51
66
|
.rp-nav-menu__item:hover .rp-nav-menu__item__container {
|
|
52
67
|
color: var(--rp-c-brand);
|
|
53
68
|
text-align: center;
|
|
@@ -19,6 +19,10 @@ function NavMenuItemInner({ menuItem, children }) {
|
|
|
19
19
|
lang: menuItem.lang,
|
|
20
20
|
rel: menuItem.rel,
|
|
21
21
|
children: [
|
|
22
|
+
menuItem.icon && /*#__PURE__*/ jsx(SvgWrapper, {
|
|
23
|
+
icon: menuItem.icon,
|
|
24
|
+
className: "rp-nav-menu__item__leading-icon"
|
|
25
|
+
}),
|
|
22
26
|
menuItem.text,
|
|
23
27
|
menuItem.tag && /*#__PURE__*/ jsx(Tag, {
|
|
24
28
|
tag: menuItem.tag
|
|
@@ -28,6 +32,10 @@ function NavMenuItemInner({ menuItem, children }) {
|
|
|
28
32
|
}) : /*#__PURE__*/ jsxs("div", {
|
|
29
33
|
className: "rp-nav-menu__item__container",
|
|
30
34
|
children: [
|
|
35
|
+
menuItem.icon && /*#__PURE__*/ jsx(SvgWrapper, {
|
|
36
|
+
icon: menuItem.icon,
|
|
37
|
+
className: "rp-nav-menu__item__leading-icon"
|
|
38
|
+
}),
|
|
31
39
|
menuItem.text,
|
|
32
40
|
menuItem.tag && /*#__PURE__*/ jsx(Tag, {
|
|
33
41
|
tag: menuItem.tag
|
|
@@ -35,12 +35,27 @@
|
|
|
35
35
|
line-height: 22px;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
.rp-nav-screen-menu-
|
|
38
|
+
.rp-nav-screen-menu-item__arrow {
|
|
39
39
|
transition: transform .25s ease-in;
|
|
40
40
|
transform: rotate(-90deg);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
.rp-nav-screen-menu-
|
|
43
|
+
.rp-nav-screen-menu-item__icon {
|
|
44
|
+
object-fit: contain;
|
|
45
|
+
flex: 0 0 16px;
|
|
46
|
+
width: 16px;
|
|
47
|
+
height: 16px;
|
|
48
|
+
font-size: 16px;
|
|
49
|
+
line-height: 16px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.rp-nav-screen-menu-item__icon > svg, .rp-nav-screen-menu-item__icon > img {
|
|
53
|
+
object-fit: contain;
|
|
54
|
+
width: 100%;
|
|
55
|
+
height: 100%;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.rp-nav-screen-menu-item--open .rp-nav-screen-menu-item__arrow {
|
|
44
59
|
transform: rotate(0);
|
|
45
60
|
}
|
|
46
61
|
|
|
@@ -8,6 +8,20 @@ const SvgDown = (props)=>/*#__PURE__*/ jsx(SvgWrapper, {
|
|
|
8
8
|
icon: IconArrowDown,
|
|
9
9
|
...props
|
|
10
10
|
});
|
|
11
|
+
function NavScreenMenuItemContent({ menuItem }) {
|
|
12
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
13
|
+
children: [
|
|
14
|
+
menuItem.icon && /*#__PURE__*/ jsx(SvgWrapper, {
|
|
15
|
+
icon: menuItem.icon,
|
|
16
|
+
className: "rp-nav-screen-menu-item__icon"
|
|
17
|
+
}),
|
|
18
|
+
menuItem.text,
|
|
19
|
+
menuItem.tag && /*#__PURE__*/ jsx(Tag, {
|
|
20
|
+
tag: menuItem.tag
|
|
21
|
+
})
|
|
22
|
+
]
|
|
23
|
+
});
|
|
24
|
+
}
|
|
11
25
|
function NavScreenMenuItemRaw({ left, right, isOpen, isActive, onClick, href, download }) {
|
|
12
26
|
if (href) return /*#__PURE__*/ jsxs(Link, {
|
|
13
27
|
href: href,
|
|
@@ -47,13 +61,8 @@ function NavScreenMenuItemWithLink({ menuItem }) {
|
|
|
47
61
|
pathname
|
|
48
62
|
]);
|
|
49
63
|
return /*#__PURE__*/ jsx(NavScreenMenuItemRaw, {
|
|
50
|
-
left: /*#__PURE__*/
|
|
51
|
-
|
|
52
|
-
menuItem.text,
|
|
53
|
-
menuItem.tag && /*#__PURE__*/ jsx(Tag, {
|
|
54
|
-
tag: menuItem.tag
|
|
55
|
-
})
|
|
56
|
-
]
|
|
64
|
+
left: /*#__PURE__*/ jsx(NavScreenMenuItemContent, {
|
|
65
|
+
menuItem: menuItem
|
|
57
66
|
}),
|
|
58
67
|
right: null,
|
|
59
68
|
href: menuItem.link,
|
|
@@ -66,16 +75,11 @@ function NavScreenMenuItemWithChildren({ menuItem }) {
|
|
|
66
75
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
67
76
|
children: [
|
|
68
77
|
/*#__PURE__*/ jsx(NavScreenMenuItemRaw, {
|
|
69
|
-
left: /*#__PURE__*/
|
|
70
|
-
|
|
71
|
-
menuItem.text,
|
|
72
|
-
menuItem.tag && /*#__PURE__*/ jsx(Tag, {
|
|
73
|
-
tag: menuItem.tag
|
|
74
|
-
})
|
|
75
|
-
]
|
|
78
|
+
left: /*#__PURE__*/ jsx(NavScreenMenuItemContent, {
|
|
79
|
+
menuItem: menuItem
|
|
76
80
|
}),
|
|
77
81
|
right: /*#__PURE__*/ jsx(SvgDown, {
|
|
78
|
-
className: "rp-nav-screen-menu-
|
|
82
|
+
className: "rp-nav-screen-menu-item__arrow"
|
|
79
83
|
}),
|
|
80
84
|
isOpen: isOpen,
|
|
81
85
|
onClick: ()=>setIsOpen(!isOpen),
|
|
@@ -107,13 +111,8 @@ function NavScreenMenuItem({ menuItem }) {
|
|
|
107
111
|
menuItem: menuItem
|
|
108
112
|
});
|
|
109
113
|
return /*#__PURE__*/ jsx(NavScreenMenuItemRaw, {
|
|
110
|
-
left: /*#__PURE__*/
|
|
111
|
-
|
|
112
|
-
menuItem.text,
|
|
113
|
-
menuItem.tag && /*#__PURE__*/ jsx(Tag, {
|
|
114
|
-
tag: menuItem.tag
|
|
115
|
-
})
|
|
116
|
-
]
|
|
114
|
+
left: /*#__PURE__*/ jsx(NavScreenMenuItemContent, {
|
|
115
|
+
menuItem: menuItem
|
|
117
116
|
}),
|
|
118
117
|
right: null
|
|
119
118
|
});
|
|
@@ -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, {})
|
|
@@ -42,6 +42,7 @@ function SidebarGroup(props) {
|
|
|
42
42
|
/*#__PURE__*/ jsx(SidebarItemRaw, {
|
|
43
43
|
active: Boolean(active),
|
|
44
44
|
link: item.link,
|
|
45
|
+
icon: item.icon,
|
|
45
46
|
tag: item.tag,
|
|
46
47
|
text: item.text,
|
|
47
48
|
context: item.context,
|
|
@@ -83,7 +84,9 @@ function SidebarGroup(props) {
|
|
|
83
84
|
depth: depth + 1,
|
|
84
85
|
dividerType: item.dividerType
|
|
85
86
|
}, index) : isSidebarSectionHeader(item) ? /*#__PURE__*/ jsx(SidebarSectionHeader, {
|
|
86
|
-
|
|
87
|
+
icon: item.icon,
|
|
88
|
+
sectionHeaderText: item.sectionHeaderText,
|
|
89
|
+
tag: item.tag
|
|
87
90
|
}, index) : /*#__PURE__*/ jsx(SidebarItem, {
|
|
88
91
|
item: item,
|
|
89
92
|
depth: depth + 1,
|
|
@@ -70,6 +70,21 @@
|
|
|
70
70
|
display: flex;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
.rp-sidebar-item__icon {
|
|
74
|
+
object-fit: contain;
|
|
75
|
+
flex: 0 0 16px;
|
|
76
|
+
width: 16px;
|
|
77
|
+
height: 16px;
|
|
78
|
+
font-size: 16px;
|
|
79
|
+
line-height: 16px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.rp-sidebar-item__icon > svg, .rp-sidebar-item__icon > img {
|
|
83
|
+
object-fit: contain;
|
|
84
|
+
width: 100%;
|
|
85
|
+
height: 100%;
|
|
86
|
+
}
|
|
87
|
+
|
|
73
88
|
.rp-sidebar-item__right {
|
|
74
89
|
align-items: center;
|
|
75
90
|
display: flex;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { NormalizedSidebarGroup, SidebarItem as SidebarItemType } from '@rspress/core';
|
|
2
2
|
import type React from 'react';
|
|
3
3
|
import './SidebarItem.scss';
|
|
4
|
-
export declare function SidebarItemRaw({ active, text, tag, link, context, className, left, right, onClick, depth, }: {
|
|
4
|
+
export declare function SidebarItemRaw({ active, text, icon, tag, link, context, className, left, right, onClick, depth, }: {
|
|
5
5
|
className?: string;
|
|
6
6
|
active: boolean;
|
|
7
7
|
text: string;
|
|
8
|
+
icon: SidebarItemType['icon'];
|
|
8
9
|
tag: SidebarItemType['tag'];
|
|
9
10
|
link: string | undefined;
|
|
10
11
|
depth: number;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useActiveMatcher } from "@rspress/core/runtime";
|
|
3
|
-
import { Link, Tag, renderInlineMarkdown } from "@rspress/core/theme";
|
|
3
|
+
import { Link, SvgWrapper, Tag, renderInlineMarkdown } from "@rspress/core/theme";
|
|
4
4
|
import clsx from "clsx";
|
|
5
5
|
import { useEffect, useRef, useTransition } from "react";
|
|
6
6
|
import "./SidebarItem.css";
|
|
7
7
|
import scroll_into_view_if_needed from "scroll-into-view-if-needed";
|
|
8
|
-
function SidebarItemRaw({ active, text, tag, link, context, className, left, right, onClick, depth }) {
|
|
8
|
+
function SidebarItemRaw({ active, text, icon, tag, link, context, className, left, right, onClick, depth }) {
|
|
9
9
|
const ref = useRef(null);
|
|
10
10
|
const [isPending, startTransition] = useTransition();
|
|
11
11
|
useEffect(()=>{
|
|
@@ -27,6 +27,10 @@ function SidebarItemRaw({ active, text, tag, link, context, className, left, rig
|
|
|
27
27
|
className: "rp-sidebar-item__left",
|
|
28
28
|
ref: ref,
|
|
29
29
|
children: [
|
|
30
|
+
icon && /*#__PURE__*/ jsx(SvgWrapper, {
|
|
31
|
+
icon: icon,
|
|
32
|
+
className: "rp-sidebar-item__icon"
|
|
33
|
+
}),
|
|
30
34
|
/*#__PURE__*/ jsx("span", {
|
|
31
35
|
className: "rp-doc",
|
|
32
36
|
...renderInlineMarkdown(text)
|
|
@@ -86,6 +90,7 @@ function SidebarItem(props) {
|
|
|
86
90
|
className: className,
|
|
87
91
|
active: active,
|
|
88
92
|
link: item.link,
|
|
93
|
+
icon: item.icon,
|
|
89
94
|
tag: item.tag,
|
|
90
95
|
text: item.text,
|
|
91
96
|
context: item.context,
|
|
@@ -13,11 +13,25 @@
|
|
|
13
13
|
.rp-sidebar-section-header__left {
|
|
14
14
|
color: var(--rp-c-text-1);
|
|
15
15
|
align-items: center;
|
|
16
|
+
gap: 4px;
|
|
16
17
|
font-size: 14px;
|
|
17
18
|
font-weight: 600;
|
|
18
19
|
display: flex;
|
|
19
20
|
}
|
|
20
21
|
|
|
22
|
+
.rp-sidebar-section-header__icon {
|
|
23
|
+
object-fit: contain;
|
|
24
|
+
flex: 0 0 16px;
|
|
25
|
+
width: 16px;
|
|
26
|
+
height: 16px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.rp-sidebar-section-header__icon > svg, .rp-sidebar-section-header__icon > img {
|
|
30
|
+
object-fit: contain;
|
|
31
|
+
width: 100%;
|
|
32
|
+
height: 100%;
|
|
33
|
+
}
|
|
34
|
+
|
|
21
35
|
.rp-sidebar-section-header__right {
|
|
22
36
|
align-items: center;
|
|
23
37
|
display: flex;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import './SidebarSectionHeader.scss';
|
|
2
|
-
export declare function SidebarSectionHeader({ sectionHeaderText, tag, }: {
|
|
2
|
+
export declare function SidebarSectionHeader({ icon, sectionHeaderText, tag, }: {
|
|
3
|
+
icon?: string;
|
|
3
4
|
sectionHeaderText: string;
|
|
4
5
|
tag?: string;
|
|
5
6
|
}): import("react").JSX.Element;
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Tag, renderInlineMarkdown } from "@rspress/core/theme";
|
|
2
|
+
import { SvgWrapper, Tag, renderInlineMarkdown } from "@rspress/core/theme";
|
|
3
3
|
import "./SidebarSectionHeader.css";
|
|
4
|
-
function SidebarSectionHeader({ sectionHeaderText, tag }) {
|
|
4
|
+
function SidebarSectionHeader({ icon, sectionHeaderText, tag }) {
|
|
5
5
|
return /*#__PURE__*/ jsxs("div", {
|
|
6
6
|
className: "rp-sidebar-section-header",
|
|
7
7
|
children: [
|
|
8
|
-
/*#__PURE__*/
|
|
8
|
+
/*#__PURE__*/ jsxs("div", {
|
|
9
9
|
className: "rp-sidebar-section-header__left",
|
|
10
|
-
children:
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
children: [
|
|
11
|
+
icon && /*#__PURE__*/ jsx(SvgWrapper, {
|
|
12
|
+
icon: icon,
|
|
13
|
+
className: "rp-sidebar-section-header__icon"
|
|
14
|
+
}),
|
|
15
|
+
/*#__PURE__*/ jsx("span", {
|
|
16
|
+
...renderInlineMarkdown(sectionHeaderText)
|
|
17
|
+
})
|
|
18
|
+
]
|
|
13
19
|
}),
|
|
14
20
|
/*#__PURE__*/ jsx("div", {
|
|
15
21
|
className: "rp-sidebar-section-header__right",
|
|
@@ -28,6 +28,7 @@ function SidebarListItem(props) {
|
|
|
28
28
|
dividerType: item.dividerType
|
|
29
29
|
}, index);
|
|
30
30
|
if (isSidebarSectionHeader(item)) return /*#__PURE__*/ jsx(SidebarSectionHeader, {
|
|
31
|
+
icon: item.icon,
|
|
31
32
|
sectionHeaderText: item.sectionHeaderText,
|
|
32
33
|
tag: item.tag
|
|
33
34
|
}, index);
|
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, LlmsHint, 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';
|
|
@@ -63,7 +63,6 @@ export { getCopyableText } from './logic/getCopyableText.js';
|
|
|
63
63
|
export { mergeRefs } from './logic/mergeRefs.js';
|
|
64
64
|
export { useFullTextSearch } from './logic/useFullTextSearch.js';
|
|
65
65
|
export { usePrevNextPage } from './logic/usePrevNextPage.js';
|
|
66
|
-
export { useRedirect4FirstVisit } from './logic/useRedirect4FirstVisit.js';
|
|
67
66
|
export { useScrollAfterNav } from './logic/useScrollAfterNav.js';
|
|
68
67
|
export { useScrollReset } from './logic/useScrollReset.js';
|
|
69
68
|
export { useSetup } from './logic/useSetup.js';
|
package/dist/theme/index.js
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 } from "./components/Link/index.js";
|
|
23
23
|
export { useLinkNavigate } from "./components/Link/useLinkNavigate.js";
|
|
24
|
-
export { LlmsContainer, LlmsCopyButton, LlmsViewOptions, useMdUrl } from "./components/Llms/index.js";
|
|
24
|
+
export { LlmsContainer, LlmsCopyButton, LlmsHint, LlmsViewOptions, 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 } from "./components/Nav/index.js";
|
|
@@ -61,7 +61,6 @@ export { getCopyableText } from "./logic/getCopyableText.js";
|
|
|
61
61
|
export { mergeRefs } from "./logic/mergeRefs.js";
|
|
62
62
|
export { useFullTextSearch } from "./logic/useFullTextSearch.js";
|
|
63
63
|
export { usePrevNextPage } from "./logic/usePrevNextPage.js";
|
|
64
|
-
export { useRedirect4FirstVisit } from "./logic/useRedirect4FirstVisit.js";
|
|
65
64
|
export { useScrollAfterNav } from "./logic/useScrollAfterNav.js";
|
|
66
65
|
export { useScrollReset } from "./logic/useScrollReset.js";
|
|
67
66
|
export { useSetup } from "./logic/useSetup.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Content, useFrontmatter, useLocaleSiteData, usePage, useSite } from "@rspress/core/runtime";
|
|
3
|
-
import { DocLayout, HomeLayout as theme_HomeLayout, Nav, NotFoundLayout as theme_NotFoundLayout,
|
|
3
|
+
import { DocLayout, HomeLayout as theme_HomeLayout, Nav, NotFoundLayout as theme_NotFoundLayout, useScrollReset, useSetup } from "@rspress/core/theme";
|
|
4
4
|
import { Head, useHead } from "@unhead/react";
|
|
5
5
|
import react, { memo, useMemo } from "react";
|
|
6
6
|
const concatTitle = (title, suffix)=>{
|
|
@@ -116,7 +116,6 @@ function Layout(props) {
|
|
|
116
116
|
});
|
|
117
117
|
useSetup();
|
|
118
118
|
useScrollReset();
|
|
119
|
-
useRedirect4FirstVisit();
|
|
120
119
|
const { frontmatter: { navbar: showNavbar = true } } = useFrontmatter();
|
|
121
120
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
122
121
|
children: [
|