@rspress/core 2.0.0-rc.2 → 2.0.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{0~7675.989ee664.js → 0~7675.723d12b2.js} +17 -14
- package/dist/{5313.6594aba0.js → 3521.56e42d70.js} +0 -7
- package/dist/{5485.2a0273cf.js → 5485.077f14ff.js} +1 -1
- package/dist/{7805.cadab34e.js → 9643.f109822d.js} +2 -1
- package/dist/_private/react/render.js +17 -4
- package/dist/cli/config/loadConfigFile.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/eject-theme/components/Badge/index.scss +1 -0
- package/dist/eject-theme/components/Banner/index.tsx +3 -1
- package/dist/eject-theme/components/Callout/index.tsx +8 -2
- package/dist/eject-theme/components/CodeBlock/index.scss +8 -6
- package/dist/eject-theme/components/CodeBlock/index.tsx +4 -0
- package/dist/eject-theme/components/CodeBlockRuntime/index.tsx +50 -11
- package/dist/eject-theme/components/DocContent/doc.scss +1 -1
- package/dist/eject-theme/components/DocContent/docComponents/pre.tsx +2 -1
- package/dist/eject-theme/components/DocContent/index.tsx +21 -4
- package/dist/eject-theme/components/DocFooter/index.tsx +1 -6
- package/dist/eject-theme/components/HoverGroup/index.scss +1 -1
- package/dist/eject-theme/components/LastUpdated/index.tsx +8 -1
- package/dist/eject-theme/components/Link/index.tsx +9 -2
- package/dist/eject-theme/components/NavScreen/NavScreenLangs.scss +6 -0
- package/dist/eject-theme/components/NavScreen/NavScreenLangs.tsx +23 -9
- package/dist/eject-theme/components/NavScreen/NavScreenVersions.scss +6 -0
- package/dist/eject-theme/components/NavScreen/NavScreenVersions.tsx +22 -9
- package/dist/eject-theme/components/Overview/index.tsx +1 -6
- package/dist/eject-theme/components/{Overview/OverviewGroup.scss → OverviewGroup/index.scss} +66 -12
- package/dist/eject-theme/components/{Overview/OverviewGroup.tsx → OverviewGroup/index.tsx} +50 -3
- package/dist/eject-theme/components/Search/logic/util.test.ts +1 -1
- package/dist/eject-theme/components/Tabs/index.scss +12 -4
- package/dist/eject-theme/components/Tabs/index.tsx +16 -0
- package/dist/eject-theme/components/Tag/index.tsx +84 -5
- package/dist/index.js +2 -2
- package/dist/node/PluginDriver.js +3 -4
- package/dist/node/auto-nav-sidebar/index.js +1 -1
- package/dist/node/auto-nav-sidebar/normalize.js +11 -9
- package/dist/node/auto-nav-sidebar/utils.js +1 -1
- package/dist/node/constants.d.ts +1 -0
- package/dist/node/constants.js +3 -2
- package/dist/node/eject.js +5 -5
- package/dist/node/initRsbuild.js +14 -6
- package/dist/node/last-updated/index.js +1 -1
- package/dist/node/mdx/loader.js +2 -1
- package/dist/node/mdx/options.js +7 -4
- package/dist/node/mdx/processor.js +1 -1
- package/dist/node/mdx/rehypePlugins/headerAnchor.js +1 -1
- package/dist/node/mdx/remarkPlugins/fileCodeBlock.js +1 -1
- package/dist/node/mdx/remarkPlugins/image.js +1 -1
- package/dist/node/mdx/remarkPlugins/toc.js +1 -1
- package/dist/node/route/RouteService.js +1 -1
- package/dist/node/route/extractPageData.js +2 -2
- package/dist/node/route/normalizeRoutePath.js +1 -1
- package/dist/node/runtimeModule/i18n.js +1 -1
- package/dist/node/runtimeModule/pageData/createPageData.js +1 -1
- package/dist/node/runtimeModule/pageData/rsbuildPlugin.js +1 -1
- package/dist/node/runtimeModule/siteData/createSiteData.js +1 -1
- package/dist/node/serve.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/ssgEnv.js +1 -1
- package/dist/node/ssg-md/llms/emitLlmsTxt.js +6 -2
- package/dist/node/ssg-md/remarkSplitMdx.js +140 -98
- package/dist/node/ssg-md/renderPage.js +1 -1
- package/dist/node/ssg-md/renderPages.js +1 -1
- package/dist/node/utils/createHash.js +1 -1
- package/dist/node/utils/error.js +2 -1
- package/dist/node/utils/flattenMdxContent.js +2 -2
- package/dist/node/utils/normalizePath.js +1 -1
- package/dist/node/utils/reactAlias.js +1 -1
- package/dist/runtime/initPageData.js +1 -1
- package/dist/theme/assets/deprecated.js +18 -0
- package/dist/theme/assets/experimental.js +21 -0
- package/dist/theme/components/Badge/index.css +1 -0
- package/dist/theme/components/Banner/index.js +2 -2
- package/dist/theme/components/Callout/index.js +5 -2
- package/dist/theme/components/CodeBlock/index.css +7 -6
- package/dist/theme/components/CodeBlock/index.js +4 -1
- package/dist/theme/components/CodeBlockRuntime/index.d.ts +1 -1
- package/dist/theme/components/CodeBlockRuntime/index.js +38 -8
- package/dist/theme/components/DocContent/doc.css +1 -1
- package/dist/theme/components/DocContent/docComponents/pre.js +3 -1
- package/dist/theme/components/DocContent/index.d.ts +11 -2
- package/dist/theme/components/DocContent/index.js +6 -5
- package/dist/theme/components/DocFooter/index.js +1 -5
- package/dist/theme/components/HoverGroup/index.css +3 -3
- package/dist/theme/components/LastUpdated/index.d.ts +1 -1
- package/dist/theme/components/LastUpdated/index.js +5 -1
- package/dist/theme/components/Link/index.d.ts +1 -1
- package/dist/theme/components/Link/index.js +8 -2
- package/dist/theme/components/NavScreen/NavScreenLangs.css +6 -0
- package/dist/theme/components/NavScreen/NavScreenLangs.js +13 -3
- package/dist/theme/components/NavScreen/NavScreenVersions.css +6 -0
- package/dist/theme/components/NavScreen/NavScreenVersions.js +12 -3
- package/dist/theme/components/Overview/index.d.ts +0 -1
- package/dist/theme/components/Overview/index.js +1 -1
- package/dist/theme/components/{Overview/OverviewGroup.css → OverviewGroup/index.css} +60 -8
- package/dist/theme/components/{Overview/OverviewGroup.d.ts → OverviewGroup/index.d.ts} +1 -1
- package/dist/theme/components/OverviewGroup/index.js +88 -0
- package/dist/theme/components/Search/logic/util.test.js +1 -1
- package/dist/theme/components/Tabs/index.css +6 -5
- package/dist/theme/components/Tabs/index.js +9 -0
- package/dist/theme/components/Tag/index.d.ts +3 -0
- package/dist/theme/components/Tag/index.js +63 -8
- package/dist/theme/hooks/useActiveAnchor.js +1 -1
- package/dist/theme/icons.d.ts +26 -24
- package/dist/theme/icons.js +5 -1
- package/dist/theme/index.d.ts +3 -1
- package/dist/theme/index.js +4 -2
- package/dist/theme/layout/DocLayout/index.css +0 -2
- package/dist/theme/layout/Layout/index.js +1 -2
- package/dist/theme/layout/NotFountLayout/index.js +1 -1
- package/dist/theme/logic/useAppearance.js +1 -1
- package/dist/theme/logic/useMediaQuery.js +1 -1
- package/dist/theme/styles/base.css +1 -0
- package/dist/theme/styles/shiki.css +9 -3
- package/dist/theme/styles/vars/base-vars.css +2 -2
- package/dist/theme/styles/vars/code-vars.css +2 -0
- package/package.json +14 -14
- package/dist/1218.3869bad6.js +0 -2
- package/dist/theme/components/Overview/OverviewGroup.js +0 -57
- /package/dist/eject-theme/components/{Overview → OverviewGroup}/icons/plugin.svg +0 -0
- /package/dist/theme/components/{Overview → OverviewGroup}/icons/plugin.js +0 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { FallbackHeading, Link, SvgWrapper, renderInlineMarkdown } from "@theme";
|
|
3
|
+
import "./index.css";
|
|
4
|
+
import { useMemo } from "react";
|
|
5
|
+
import icons_plugin from "./icons/plugin.js";
|
|
6
|
+
const OverviewGroup = ({ group })=>{
|
|
7
|
+
const { itemsWithContent, itemsWithoutContent } = useMemo(()=>{
|
|
8
|
+
const itemsWithContent = group.items.filter((item)=>item.headers && item.headers.length > 0 || item.items && item.items.length > 0);
|
|
9
|
+
const itemsWithoutContent = group.items.filter((item)=>!(item.headers && item.headers.length > 0) && !(item.items && item.items.length > 0));
|
|
10
|
+
return {
|
|
11
|
+
itemsWithContent,
|
|
12
|
+
itemsWithoutContent
|
|
13
|
+
};
|
|
14
|
+
}, [
|
|
15
|
+
group
|
|
16
|
+
]);
|
|
17
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
18
|
+
children: [
|
|
19
|
+
/*#__PURE__*/ jsx(FallbackHeading, {
|
|
20
|
+
level: 2,
|
|
21
|
+
title: group.name
|
|
22
|
+
}),
|
|
23
|
+
/*#__PURE__*/ jsxs("div", {
|
|
24
|
+
className: "rp-overview-group rp-not-doc",
|
|
25
|
+
children: [
|
|
26
|
+
itemsWithContent.map((item)=>/*#__PURE__*/ jsxs("div", {
|
|
27
|
+
className: "rp-overview-group__item",
|
|
28
|
+
children: [
|
|
29
|
+
/*#__PURE__*/ jsxs("div", {
|
|
30
|
+
className: "rp-overview-group__item__title",
|
|
31
|
+
children: [
|
|
32
|
+
item.link ? /*#__PURE__*/ jsx(Link, {
|
|
33
|
+
href: item.link,
|
|
34
|
+
className: "rp-overview-group__item__title__link",
|
|
35
|
+
...renderInlineMarkdown(item.text)
|
|
36
|
+
}) : /*#__PURE__*/ jsx("span", {
|
|
37
|
+
className: "rp-overview-group__item__title__text",
|
|
38
|
+
...renderInlineMarkdown(item.text)
|
|
39
|
+
}),
|
|
40
|
+
/*#__PURE__*/ jsx(SvgWrapper, {
|
|
41
|
+
icon: icons_plugin,
|
|
42
|
+
className: "rp-overview-group__item__title__icon"
|
|
43
|
+
})
|
|
44
|
+
]
|
|
45
|
+
}),
|
|
46
|
+
/*#__PURE__*/ jsxs("ul", {
|
|
47
|
+
className: "rp-overview-group__item__content",
|
|
48
|
+
children: [
|
|
49
|
+
item.headers?.map((header)=>/*#__PURE__*/ jsx("li", {
|
|
50
|
+
className: "rp-overview-group__item__content__item",
|
|
51
|
+
children: /*#__PURE__*/ jsx(Link, {
|
|
52
|
+
className: "rp-overview-group__item__content__item__link",
|
|
53
|
+
href: `${item.link}#${header.id}`,
|
|
54
|
+
...renderInlineMarkdown(header.text)
|
|
55
|
+
})
|
|
56
|
+
}, header.id)),
|
|
57
|
+
item.items?.map(({ link, text })=>/*#__PURE__*/ jsx("li", {
|
|
58
|
+
className: "rp-overview-group__item__content__item",
|
|
59
|
+
children: /*#__PURE__*/ jsx(Link, {
|
|
60
|
+
className: "rp-overview-group__item__content__item__link",
|
|
61
|
+
href: link,
|
|
62
|
+
...renderInlineMarkdown(text)
|
|
63
|
+
})
|
|
64
|
+
}, link))
|
|
65
|
+
]
|
|
66
|
+
})
|
|
67
|
+
]
|
|
68
|
+
}, item.link)),
|
|
69
|
+
itemsWithoutContent.length > 0 && /*#__PURE__*/ jsx("div", {
|
|
70
|
+
className: "rp-overview-group__grid",
|
|
71
|
+
children: itemsWithoutContent.map((item)=>/*#__PURE__*/ jsx("div", {
|
|
72
|
+
className: "rp-overview-group__grid-item rp-overview-group__item__title",
|
|
73
|
+
children: item.link ? /*#__PURE__*/ jsx(Link, {
|
|
74
|
+
href: item.link,
|
|
75
|
+
className: "rp-overview-group__item__title__link",
|
|
76
|
+
...renderInlineMarkdown(item.text)
|
|
77
|
+
}) : /*#__PURE__*/ jsx("span", {
|
|
78
|
+
className: "rp-overview-group__item__title__text",
|
|
79
|
+
...renderInlineMarkdown(item.text)
|
|
80
|
+
})
|
|
81
|
+
}, item.link))
|
|
82
|
+
})
|
|
83
|
+
]
|
|
84
|
+
})
|
|
85
|
+
]
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
export { OverviewGroup };
|
|
@@ -2,17 +2,18 @@
|
|
|
2
2
|
contain: content;
|
|
3
3
|
border-radius: var(--rp-radius);
|
|
4
4
|
border: var(--rp-code-block-border);
|
|
5
|
+
box-shadow: var(--rp-code-block-shadow);
|
|
5
6
|
margin: 1rem 0;
|
|
6
7
|
}
|
|
7
8
|
|
|
8
|
-
.rp-tabs .rp-codeblock {
|
|
9
|
-
border: none
|
|
10
|
-
border-radius: 0
|
|
11
|
-
margin: 0
|
|
9
|
+
.rp-tabs .rp-tabs, .rp-tabs .rp-codeblock {
|
|
10
|
+
border: none;
|
|
11
|
+
border-radius: 0;
|
|
12
|
+
margin: 0;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
.rp-tabs .rp-codeblock .rp-codeblock__title {
|
|
15
|
-
padding: 8px
|
|
16
|
+
padding: 8px 12px;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
.rp-tabs__label {
|
|
@@ -35,6 +35,15 @@ const Tabs = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
35
35
|
values,
|
|
36
36
|
children
|
|
37
37
|
]);
|
|
38
|
+
if (process.env.__SSR_MD__) return /*#__PURE__*/ jsx(Fragment, {
|
|
39
|
+
children: tabValues.map(({ label, content })=>/*#__PURE__*/ jsxs(Fragment, {
|
|
40
|
+
children: [
|
|
41
|
+
`\n**${label}**\n\n`,
|
|
42
|
+
content,
|
|
43
|
+
`\n`
|
|
44
|
+
]
|
|
45
|
+
}))
|
|
46
|
+
});
|
|
38
47
|
const [activeIndex, setActiveIndex] = useState(defaultIndex ?? 0);
|
|
39
48
|
const [storageIndex, setStorageIndex] = useStorageValue(`${groupIdPrefix}${groupId}`, activeIndex.toString());
|
|
40
49
|
const currentIndex = groupId ? Number(storageIndex) : activeIndex;
|
|
@@ -1,11 +1,40 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { isDataUrl, isExternalUrl } from "@rspress/core/runtime";
|
|
3
|
-
import { Badge } from "
|
|
4
|
-
|
|
3
|
+
import { Badge, IconDeprecated, IconExperimental, SvgWrapper, Tag } from "@theme";
|
|
4
|
+
import { useMemo } from "react";
|
|
5
|
+
const BADGE_TAGS = {
|
|
6
|
+
tip: 'tip',
|
|
7
|
+
info: 'info',
|
|
8
|
+
warning: 'warning',
|
|
9
|
+
danger: 'danger'
|
|
10
|
+
};
|
|
11
|
+
function parseCommonTagsArrayStr(tagStr) {
|
|
12
|
+
const tags = tagStr.split(',').map((tag)=>tag.trim()).filter((tag)=>tag.length > 0);
|
|
13
|
+
return tags;
|
|
14
|
+
}
|
|
15
|
+
const getTagType = (tag)=>{
|
|
16
|
+
const normalizedTag = tag.trim();
|
|
17
|
+
const isSvgTagString = normalizedTag.startsWith('<svg');
|
|
18
|
+
const isPic = isExternalUrl(normalizedTag) || isDataUrl(normalizedTag);
|
|
19
|
+
const tagsArray = parseCommonTagsArrayStr(normalizedTag);
|
|
20
|
+
return {
|
|
21
|
+
isSvgTagString,
|
|
22
|
+
isPic,
|
|
23
|
+
isTagsArray: tagsArray && tagsArray?.length > 1,
|
|
24
|
+
tagsArray,
|
|
25
|
+
normalizedTag
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
const Tag_Tag = ({ tag })=>{
|
|
5
29
|
if (!tag) return null;
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
30
|
+
const { isPic, isTagsArray, isSvgTagString, normalizedTag, tagsArray } = useMemo(()=>getTagType(tag), [
|
|
31
|
+
tag
|
|
32
|
+
]);
|
|
33
|
+
if (isTagsArray) return /*#__PURE__*/ jsx(Fragment, {
|
|
34
|
+
children: tagsArray?.map((tag, index)=>/*#__PURE__*/ jsx(Tag, {
|
|
35
|
+
tag: tag
|
|
36
|
+
}, `${tag}-${index}`))
|
|
37
|
+
});
|
|
9
38
|
if (isSvgTagString) return /*#__PURE__*/ jsx("div", {
|
|
10
39
|
dangerouslySetInnerHTML: {
|
|
11
40
|
__html: tag
|
|
@@ -18,9 +47,35 @@ const Tag = ({ tag })=>{
|
|
|
18
47
|
if (isPic) return /*#__PURE__*/ jsx("img", {
|
|
19
48
|
src: tag
|
|
20
49
|
});
|
|
50
|
+
if ('experimental' === normalizedTag) return /*#__PURE__*/ jsxs(Badge, {
|
|
51
|
+
type: "warning",
|
|
52
|
+
children: [
|
|
53
|
+
/*#__PURE__*/ jsx(SvgWrapper, {
|
|
54
|
+
icon: IconExperimental
|
|
55
|
+
}),
|
|
56
|
+
/*#__PURE__*/ jsx("span", {
|
|
57
|
+
children: "experimental"
|
|
58
|
+
})
|
|
59
|
+
]
|
|
60
|
+
});
|
|
61
|
+
if ('deprecated' === normalizedTag) return /*#__PURE__*/ jsxs(Badge, {
|
|
62
|
+
type: "danger",
|
|
63
|
+
children: [
|
|
64
|
+
/*#__PURE__*/ jsx(SvgWrapper, {
|
|
65
|
+
icon: IconDeprecated
|
|
66
|
+
}),
|
|
67
|
+
/*#__PURE__*/ jsx("span", {
|
|
68
|
+
children: "deprecated"
|
|
69
|
+
})
|
|
70
|
+
]
|
|
71
|
+
});
|
|
72
|
+
if (BADGE_TAGS[normalizedTag]) return /*#__PURE__*/ jsx(Badge, {
|
|
73
|
+
text: normalizedTag,
|
|
74
|
+
type: BADGE_TAGS[normalizedTag]
|
|
75
|
+
});
|
|
21
76
|
return /*#__PURE__*/ jsx(Badge, {
|
|
22
|
-
text:
|
|
77
|
+
text: normalizedTag,
|
|
23
78
|
type: "info"
|
|
24
79
|
});
|
|
25
80
|
};
|
|
26
|
-
export { Tag };
|
|
81
|
+
export { Tag_Tag as Tag };
|
|
@@ -11,7 +11,7 @@ const useActiveAnchor = (headers)=>{
|
|
|
11
11
|
const [scrolledHeader, setScrolledHeader] = useState();
|
|
12
12
|
const { hash } = useLocation();
|
|
13
13
|
useEffect(()=>{
|
|
14
|
-
if (
|
|
14
|
+
if ("u" < typeof window) return;
|
|
15
15
|
const handleScroll = ()=>{
|
|
16
16
|
const scrollPaddingTop = parseCSSLength(window.getComputedStyle(document.documentElement).getPropertyValue('scroll-padding-top'));
|
|
17
17
|
const topOffset = scrollPaddingTop - 5;
|
package/dist/theme/icons.d.ts
CHANGED
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
type Icon = React.FC<React.SVGProps<SVGSVGElement>> | string;
|
|
2
|
-
declare const
|
|
3
|
-
declare const
|
|
4
|
-
declare const
|
|
5
|
-
declare const
|
|
6
|
-
declare const
|
|
7
|
-
declare const
|
|
8
|
-
declare const
|
|
9
|
-
declare const
|
|
10
|
-
declare const
|
|
11
|
-
declare const
|
|
12
|
-
declare const
|
|
13
|
-
declare const
|
|
14
|
-
declare const
|
|
15
|
-
declare const
|
|
16
|
-
declare const
|
|
17
|
-
declare const
|
|
18
|
-
declare const
|
|
19
|
-
declare const
|
|
20
|
-
declare const
|
|
21
|
-
declare const
|
|
22
|
-
declare const
|
|
23
|
-
declare const
|
|
24
|
-
declare const
|
|
25
|
-
export
|
|
2
|
+
export declare const IconDeprecated: Icon;
|
|
3
|
+
export declare const IconExperimental: Icon;
|
|
4
|
+
export declare const IconArrowDown: Icon;
|
|
5
|
+
export declare const IconArrowRight: Icon;
|
|
6
|
+
export declare const IconClose: Icon;
|
|
7
|
+
export declare const IconCopy: Icon;
|
|
8
|
+
export declare const IconDown: Icon;
|
|
9
|
+
export declare const IconEmpty: Icon;
|
|
10
|
+
export declare const IconFile: Icon;
|
|
11
|
+
export declare const IconGithub: Icon;
|
|
12
|
+
export declare const IconGitlab: Icon;
|
|
13
|
+
export declare const IconHeader: Icon;
|
|
14
|
+
export declare const IconJump: Icon;
|
|
15
|
+
export declare const IconLoading: Icon;
|
|
16
|
+
export declare const IconMenu: Icon;
|
|
17
|
+
export declare const IconMoon: Icon;
|
|
18
|
+
export declare const IconRight: Icon;
|
|
19
|
+
export declare const IconSearch: Icon;
|
|
20
|
+
export declare const IconSmallMenu: Icon;
|
|
21
|
+
export declare const IconSuccess: Icon;
|
|
22
|
+
export declare const IconSun: Icon;
|
|
23
|
+
export declare const IconTitle: Icon;
|
|
24
|
+
export declare const IconTranslator: Icon;
|
|
25
|
+
export declare const IconWrap: Icon;
|
|
26
|
+
export declare const IconWrapped: Icon;
|
|
27
|
+
export {};
|
package/dist/theme/icons.js
CHANGED
|
@@ -2,8 +2,10 @@ import arrow_down from "./assets/arrow-down.js";
|
|
|
2
2
|
import arrow_right from "./assets/arrow-right.js";
|
|
3
3
|
import assets_close from "./assets/close.js";
|
|
4
4
|
import copy from "./assets/copy.js";
|
|
5
|
+
import deprecated from "./assets/deprecated.js";
|
|
5
6
|
import down from "./assets/down.js";
|
|
6
7
|
import empty from "./assets/empty.js";
|
|
8
|
+
import experimental from "./assets/experimental.js";
|
|
7
9
|
import file from "./assets/file.js";
|
|
8
10
|
import github from "./assets/github.js";
|
|
9
11
|
import gitlab from "./assets/gitlab.js";
|
|
@@ -21,6 +23,8 @@ import title from "./assets/title.js";
|
|
|
21
23
|
import translator from "./assets/translator.js";
|
|
22
24
|
import wrap from "./assets/wrap.js";
|
|
23
25
|
import wrapped from "./assets/wrapped.js";
|
|
26
|
+
const IconDeprecated = deprecated;
|
|
27
|
+
const IconExperimental = experimental;
|
|
24
28
|
const IconArrowDown = arrow_down;
|
|
25
29
|
const IconArrowRight = arrow_right;
|
|
26
30
|
const IconClose = assets_close;
|
|
@@ -44,4 +48,4 @@ const IconTitle = title;
|
|
|
44
48
|
const IconTranslator = translator;
|
|
45
49
|
const IconWrap = wrap;
|
|
46
50
|
const IconWrapped = wrapped;
|
|
47
|
-
export { IconArrowDown, IconArrowRight, IconClose, IconCopy, IconDown, IconEmpty, IconFile, IconGithub, IconGitlab, IconHeader, IconJump, IconLoading, IconMenu, IconMoon, IconRight, IconSearch, IconSmallMenu, IconSuccess, IconSun, IconTitle, IconTranslator, IconWrap, IconWrapped };
|
|
51
|
+
export { IconArrowDown, IconArrowRight, IconClose, IconCopy, IconDeprecated, IconDown, IconEmpty, IconExperimental, IconFile, IconGithub, IconGitlab, IconHeader, IconJump, IconLoading, IconMenu, IconMoon, IconRight, IconSearch, IconSmallMenu, IconSuccess, IconSun, IconTitle, IconTranslator, IconWrap, IconWrapped };
|
package/dist/theme/index.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export { Nav, type NavProps } from './components/Nav/index.js';
|
|
|
25
25
|
export { NavHamburger } from './components/NavHamburger/index.js';
|
|
26
26
|
export { Outline } from './components/Outline/index.js';
|
|
27
27
|
export { Overview } from './components/Overview/index.js';
|
|
28
|
-
export { type Group, type GroupItem, OverviewGroup, } from './components/
|
|
28
|
+
export { type Group, type GroupItem, OverviewGroup, } from './components/OverviewGroup/index.js';
|
|
29
29
|
export { type PackageManagerTabProps, PackageManagerTabs, } from './components/PackageManagerTabs/index.js';
|
|
30
30
|
export { PageTab, type PageTabProps, PageTabs, type PageTabsProps, } from './components/PageTabs/index.js';
|
|
31
31
|
export { PrevNextPage } from './components/PrevNextPage/index.js';
|
|
@@ -57,6 +57,8 @@ export { useThemeState } from './logic/useAppearance.js';
|
|
|
57
57
|
export { useFullTextSearch } from './logic/useFullTextSearch.js';
|
|
58
58
|
export { usePrevNextPage } from './logic/usePrevNextPage.js';
|
|
59
59
|
export { useRedirect4FirstVisit } from './logic/useRedirect4FirstVisit.js';
|
|
60
|
+
export { useScrollAfterNav } from './logic/useScrollAfterNav.js';
|
|
61
|
+
export { useScrollReset } from './logic/useScrollReset.js';
|
|
60
62
|
export { useSetup } from './logic/useSetup.js';
|
|
61
63
|
export { useStorageValue } from './logic/useStorageValue.js';
|
|
62
64
|
export { parseInlineMarkdownText, renderHtmlOrText, renderInlineMarkdown, } from './logic/utils.js';
|
package/dist/theme/index.js
CHANGED
|
@@ -24,7 +24,7 @@ import { Nav } from "./components/Nav/index.js";
|
|
|
24
24
|
import { NavHamburger } from "./components/NavHamburger/index.js";
|
|
25
25
|
import { Outline } from "./components/Outline/index.js";
|
|
26
26
|
import { Overview } from "./components/Overview/index.js";
|
|
27
|
-
import { OverviewGroup } from "./components/
|
|
27
|
+
import { OverviewGroup } from "./components/OverviewGroup/index.js";
|
|
28
28
|
import { PackageManagerTabs } from "./components/PackageManagerTabs/index.js";
|
|
29
29
|
import { PageTab, PageTabs } from "./components/PageTabs/index.js";
|
|
30
30
|
import { PrevNextPage } from "./components/PrevNextPage/index.js";
|
|
@@ -54,8 +54,10 @@ import { useThemeState } from "./logic/useAppearance.js";
|
|
|
54
54
|
import { useFullTextSearch } from "./logic/useFullTextSearch.js";
|
|
55
55
|
import { usePrevNextPage } from "./logic/usePrevNextPage.js";
|
|
56
56
|
import { useRedirect4FirstVisit } from "./logic/useRedirect4FirstVisit.js";
|
|
57
|
+
import { useScrollAfterNav } from "./logic/useScrollAfterNav.js";
|
|
58
|
+
import { useScrollReset } from "./logic/useScrollReset.js";
|
|
57
59
|
import { useSetup } from "./logic/useSetup.js";
|
|
58
60
|
import { useStorageValue } from "./logic/useStorageValue.js";
|
|
59
61
|
import { parseInlineMarkdownText, renderHtmlOrText, renderInlineMarkdown } from "./logic/utils.js";
|
|
60
62
|
export * from "./icons.js";
|
|
61
|
-
export { Badge, Banner, Button, Callout, CodeBlock, CodeBlockRuntime, CodeButtonGroup, DocContent, DocFooter, DocLayout, EditLink, FallbackHeading, HomeBackground, HomeFeature, HomeFooter, HomeHero, HomeLayout, HoverGroup, LastUpdated, Layout, Link, Nav, NavHamburger, NotFoundLayout, Outline, Overview, OverviewGroup, PackageManagerTabs, PageTab, PageTabs, PrevNextPage, ReadPercent, RenderType, Root, Search, SearchButton, SearchPanel, Sidebar, SidebarList, SocialLinks, SourceCode, Steps, SvgWrapper, SwitchAppearance, Tab, Tabs, Tag, Toc, getCustomMDXComponent, mergeRefs, parseInlineMarkdownText, renderHtmlOrText, renderInlineMarkdown, useActiveAnchor, useCodeButtonGroup, useDynamicToc, useEditLink, useFullTextSearch, useHoverGroup, useLinkNavigate, usePrevNextPage, useRedirect4FirstVisit, useSetup, useStorageValue, useThemeState, useWatchToc };
|
|
63
|
+
export { Badge, Banner, Button, Callout, CodeBlock, CodeBlockRuntime, CodeButtonGroup, DocContent, DocFooter, DocLayout, EditLink, FallbackHeading, HomeBackground, HomeFeature, HomeFooter, HomeHero, HomeLayout, HoverGroup, LastUpdated, Layout, Link, Nav, NavHamburger, NotFoundLayout, Outline, Overview, OverviewGroup, PackageManagerTabs, PageTab, PageTabs, PrevNextPage, ReadPercent, RenderType, Root, Search, SearchButton, SearchPanel, Sidebar, SidebarList, SocialLinks, SourceCode, Steps, SvgWrapper, SwitchAppearance, Tab, Tabs, Tag, Toc, getCustomMDXComponent, mergeRefs, parseInlineMarkdownText, renderHtmlOrText, renderInlineMarkdown, useActiveAnchor, useCodeButtonGroup, useDynamicToc, useEditLink, useFullTextSearch, useHoverGroup, useLinkNavigate, usePrevNextPage, useRedirect4FirstVisit, useScrollAfterNav, useScrollReset, useSetup, useStorageValue, useThemeState, useWatchToc };
|
|
@@ -44,7 +44,6 @@
|
|
|
44
44
|
.rp-doc-layout__overview {
|
|
45
45
|
width: 100%;
|
|
46
46
|
max-width: min(100%, 1280px);
|
|
47
|
-
min-height: 60vh;
|
|
48
47
|
padding: var(--rp-content-padding-y) var(--rp-content-padding-x);
|
|
49
48
|
position: relative;
|
|
50
49
|
overflow-x: auto;
|
|
@@ -69,7 +68,6 @@
|
|
|
69
68
|
}
|
|
70
69
|
|
|
71
70
|
.rp-doc-layout__doc-container {
|
|
72
|
-
min-height: 60vh;
|
|
73
71
|
padding: var(--rp-content-padding-y) var(--rp-content-padding-x);
|
|
74
72
|
}
|
|
75
73
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Content, useFrontmatter, useLocaleSiteData, usePageData, useSite } from "@rspress/core/runtime";
|
|
3
|
-
import { DocLayout, HomeLayout as external_theme_HomeLayout, Nav, NotFoundLayout as external_theme_NotFoundLayout, useRedirect4FirstVisit, useSetup } from "@theme";
|
|
3
|
+
import { DocLayout, HomeLayout as external_theme_HomeLayout, Nav, NotFoundLayout as external_theme_NotFoundLayout, useRedirect4FirstVisit, useScrollReset, useSetup } from "@theme";
|
|
4
4
|
import { Head, useHead } from "@unhead/react";
|
|
5
5
|
import react, { memo, useMemo } from "react";
|
|
6
|
-
import { useScrollReset } from "../../logic/useScrollReset.js";
|
|
7
6
|
const concatTitle = (title, suffix)=>{
|
|
8
7
|
if (!suffix) return title;
|
|
9
8
|
title = title.trim();
|
|
@@ -7,7 +7,7 @@ function NotFoundLayout() {
|
|
|
7
7
|
const defaultLang = siteData.lang;
|
|
8
8
|
const defaultVersion = siteData.multiVersion.default;
|
|
9
9
|
const t = useI18n();
|
|
10
|
-
if (defaultLang &&
|
|
10
|
+
if (defaultLang && "u" > typeof window) {
|
|
11
11
|
const regexp = new RegExp(`/${defaultLang}(\\/|$)`);
|
|
12
12
|
if (regexp.test(location.pathname)) {
|
|
13
13
|
const redirectUrl = location.pathname.replace(regexp, '/');
|
|
@@ -20,7 +20,7 @@ const useThemeState = ()=>{
|
|
|
20
20
|
return 'auto' === sanitized ? matchesDark ? 'dark' : 'light' : sanitized;
|
|
21
21
|
});
|
|
22
22
|
const [theme, setThemeInternal] = useState(()=>{
|
|
23
|
-
if (
|
|
23
|
+
if ("u" < typeof window) return 'light';
|
|
24
24
|
const defaultTheme = window.RSPRESS_THEME ?? window.MODERN_THEME;
|
|
25
25
|
if (defaultTheme) return 'dark' === defaultTheme ? 'dark' : 'light';
|
|
26
26
|
return getPreferredTheme();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect, useState } from "react";
|
|
2
2
|
const useMediaQuery = (query)=>{
|
|
3
|
-
const [matches, setMatches] = useState(()=>
|
|
3
|
+
const [matches, setMatches] = useState(()=>"u" > typeof window ? window.matchMedia(query).matches : false);
|
|
4
4
|
useEffect(()=>{
|
|
5
5
|
const mediaQueryList = window.matchMedia(query);
|
|
6
6
|
const listener = (e)=>setMatches(e.matches);
|
|
@@ -40,6 +40,7 @@ body {
|
|
|
40
40
|
:root {
|
|
41
41
|
--rp-font-family-base: "Inter var experimental", "Inter var", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
|
|
42
42
|
--rp-font-family-mono: Menlo, Monaco, Consolas, "Courier New", monospace;
|
|
43
|
+
text-autospace: normal;
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
:root #nprogress .bar {
|
|
@@ -42,18 +42,24 @@
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
.shiki.has-highlighted .line.highlighted {
|
|
45
|
-
background-color: #0063c71a;
|
|
46
45
|
width: 100%;
|
|
47
46
|
display: inline-block;
|
|
48
47
|
position: static;
|
|
49
48
|
}
|
|
50
49
|
|
|
50
|
+
.shiki.has-highlighted .line.highlighted:not(.error):not(.warning) {
|
|
51
|
+
background-color: #3b82f61a;
|
|
52
|
+
box-shadow: inset 2px 0 #3b82f6;
|
|
53
|
+
}
|
|
54
|
+
|
|
51
55
|
.shiki.has-highlighted .line.highlighted.error {
|
|
52
|
-
background-color: #
|
|
56
|
+
background-color: #ed3c501a;
|
|
57
|
+
box-shadow: inset 2px 0 #ed3c50;
|
|
53
58
|
}
|
|
54
59
|
|
|
55
60
|
.shiki.has-highlighted .line.highlighted.warning {
|
|
56
|
-
background-color: #
|
|
61
|
+
background-color: #ffc5171a;
|
|
62
|
+
box-shadow: inset 2px 0 #ffc517;
|
|
57
63
|
}
|
|
58
64
|
|
|
59
65
|
.shiki.has-focused .line:not(.focused) {
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
--rp-c-gray-light-3: #d1d1d1;
|
|
42
42
|
--rp-c-gray-light-4: #e5e5e5;
|
|
43
43
|
--rp-c-gray-light-5: #f2f2f2;
|
|
44
|
-
--rp-shadow-1: 0 1px
|
|
45
|
-
--rp-shadow-2: 0 3px 12px #
|
|
44
|
+
--rp-shadow-1: 0 1px 2px #00000005, 0 1px 0 #0000000f;
|
|
45
|
+
--rp-shadow-2: 0 3px 12px #0000000f, 0 1px 4px #00000012;
|
|
46
46
|
--rp-shadow-3: 0 12px 32px #0000001a, 0 2px 6px #00000014;
|
|
47
47
|
--rp-shadow-4: 0 14px 44px #0000001f, 0 3px 9px #0000001f;
|
|
48
48
|
--rp-shadow-5: 0 18px 56px #00000029, 0 4px 12px #00000029;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
--rp-code-block-color: #2e3440;
|
|
5
5
|
--rp-code-block-bg: var(--rp-c-bg);
|
|
6
6
|
--rp-code-block-border: 1px solid var(--rp-c-divider-light);
|
|
7
|
+
--rp-code-block-shadow: var(--rp-shadow-1);
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
:where(html.rp-dark) {
|
|
@@ -12,5 +13,6 @@
|
|
|
12
13
|
--rp-code-block-color: #e5e7eb;
|
|
13
14
|
--rp-code-block-bg: var(--rp-c-bg);
|
|
14
15
|
--rp-code-block-border: 1px solid var(--rp-c-divider-light);
|
|
16
|
+
--rp-code-block-shadow: var(--rp-shadow-1);
|
|
15
17
|
}
|
|
16
18
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspress/core",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.3",
|
|
4
4
|
"description": "The Rspress Documentation Framework",
|
|
5
5
|
"bugs": "https://github.com/web-infra-dev/rspress/issues",
|
|
6
6
|
"repository": {
|
|
@@ -63,10 +63,10 @@
|
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@mdx-js/mdx": "^3.1.1",
|
|
65
65
|
"@mdx-js/react": "^3.1.1",
|
|
66
|
-
"@rsbuild/core": "~1.6.
|
|
66
|
+
"@rsbuild/core": "~1.6.15",
|
|
67
67
|
"@rsbuild/plugin-react": "~1.4.2",
|
|
68
68
|
"@rspress/mdx-rs": "0.6.6",
|
|
69
|
-
"@shikijs/rehype": "^3.
|
|
69
|
+
"@shikijs/rehype": "^3.20.0",
|
|
70
70
|
"@types/unist": "^3.0.3",
|
|
71
71
|
"@unhead/react": "^2.0.19",
|
|
72
72
|
"body-scroll-lock": "4.0.0-beta.0",
|
|
@@ -79,37 +79,37 @@
|
|
|
79
79
|
"hast-util-heading-rank": "^3.0.0",
|
|
80
80
|
"hast-util-to-jsx-runtime": "^2.3.6",
|
|
81
81
|
"html-to-text": "^9.0.5",
|
|
82
|
-
"lodash-es": "^4.17.
|
|
82
|
+
"lodash-es": "^4.17.22",
|
|
83
83
|
"mdast-util-mdx": "^3.0.0",
|
|
84
84
|
"mdast-util-mdxjs-esm": "^2.0.1",
|
|
85
85
|
"medium-zoom": "1.1.0",
|
|
86
86
|
"nprogress": "^0.2.0",
|
|
87
87
|
"picocolors": "^1.1.1",
|
|
88
|
-
"react": "^19.2.
|
|
89
|
-
"react-dom": "^19.2.
|
|
88
|
+
"react": "^19.2.3",
|
|
89
|
+
"react-dom": "^19.2.3",
|
|
90
90
|
"react-lazy-with-preload": "^2.2.1",
|
|
91
91
|
"react-reconciler": "0.33.0",
|
|
92
|
-
"react-router-dom": "^7.
|
|
92
|
+
"react-router-dom": "^7.11.0",
|
|
93
93
|
"rehype-external-links": "^3.0.0",
|
|
94
94
|
"rehype-raw": "^7.0.0",
|
|
95
95
|
"remark-gfm": "^4.0.1",
|
|
96
96
|
"remark-mdx": "^3.1.1",
|
|
97
97
|
"remark-stringify": "^11.0.0",
|
|
98
98
|
"scroll-into-view-if-needed": "^3.1.0",
|
|
99
|
-
"shiki": "^3.
|
|
99
|
+
"shiki": "^3.20.0",
|
|
100
100
|
"tinyglobby": "^0.2.15",
|
|
101
101
|
"tinypool": "^1.1.1",
|
|
102
102
|
"unified": "^11.0.5",
|
|
103
103
|
"unist-util-visit": "^5.0.0",
|
|
104
104
|
"unist-util-visit-children": "^3.0.0",
|
|
105
|
-
"@rspress/runtime": "2.0.0-rc.
|
|
106
|
-
"@rspress/shared": "2.0.0-rc.
|
|
105
|
+
"@rspress/runtime": "2.0.0-rc.3",
|
|
106
|
+
"@rspress/shared": "2.0.0-rc.3"
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
109
|
"@microsoft/api-extractor": "^7.55.2",
|
|
110
110
|
"@rsbuild/plugin-sass": "~1.4.0",
|
|
111
|
-
"@rsbuild/plugin-svgr": "^1.2.
|
|
112
|
-
"@rslib/core": "0.18.
|
|
111
|
+
"@rsbuild/plugin-svgr": "^1.2.3",
|
|
112
|
+
"@rslib/core": "0.18.5",
|
|
113
113
|
"@types/body-scroll-lock": "^3.1.2",
|
|
114
114
|
"@types/hast": "^3.0.4",
|
|
115
115
|
"@types/html-to-text": "^9.0.4",
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"@types/react": "^19.2.7",
|
|
121
121
|
"@types/react-dom": "^19.2.3",
|
|
122
122
|
"@types/react-reconciler": "^0.32.3",
|
|
123
|
-
"@types/web": "^0.0.
|
|
123
|
+
"@types/web": "^0.0.306",
|
|
124
124
|
"execa": "8.0.1",
|
|
125
125
|
"mdast-util-directive": "^3.1.0",
|
|
126
126
|
"mdast-util-mdx-expression": "^2.0.1",
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
"remark-directive": "^4.0.0",
|
|
131
131
|
"rsbuild-plugin-publint": "^0.3.3",
|
|
132
132
|
"rsbuild-plugin-virtual-module": "0.4.1",
|
|
133
|
-
"tailwindcss": "^3.4.
|
|
133
|
+
"tailwindcss": "^3.4.19",
|
|
134
134
|
"ts-json-schema-generator": "^2.4.0",
|
|
135
135
|
"typescript": "^5.8.2",
|
|
136
136
|
"vfile": "^6.0.3",
|
package/dist/1218.3869bad6.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { FallbackHeading, Link, SvgWrapper, renderInlineMarkdown } from "@theme";
|
|
3
|
-
import "./OverviewGroup.css";
|
|
4
|
-
import icons_plugin from "./icons/plugin.js";
|
|
5
|
-
const OverviewGroup = ({ group })=>/*#__PURE__*/ jsxs(Fragment, {
|
|
6
|
-
children: [
|
|
7
|
-
/*#__PURE__*/ jsx(FallbackHeading, {
|
|
8
|
-
level: 2,
|
|
9
|
-
title: group.name
|
|
10
|
-
}),
|
|
11
|
-
/*#__PURE__*/ jsx("div", {
|
|
12
|
-
className: "rp-overview-group rp-not-doc",
|
|
13
|
-
children: group.items.map((item)=>/*#__PURE__*/ jsxs("div", {
|
|
14
|
-
className: "rp-overview-group__item",
|
|
15
|
-
children: [
|
|
16
|
-
/*#__PURE__*/ jsxs("div", {
|
|
17
|
-
className: "rp-overview-group__item__title",
|
|
18
|
-
children: [
|
|
19
|
-
item.link ? /*#__PURE__*/ jsx(Link, {
|
|
20
|
-
href: item.link,
|
|
21
|
-
...renderInlineMarkdown(item.text)
|
|
22
|
-
}) : /*#__PURE__*/ jsx("span", {
|
|
23
|
-
...renderInlineMarkdown(item.text)
|
|
24
|
-
}),
|
|
25
|
-
/*#__PURE__*/ jsx(SvgWrapper, {
|
|
26
|
-
icon: icons_plugin,
|
|
27
|
-
className: "rp-overview-group__item__title__icon"
|
|
28
|
-
})
|
|
29
|
-
]
|
|
30
|
-
}),
|
|
31
|
-
/*#__PURE__*/ jsxs("ul", {
|
|
32
|
-
className: "rp-overview-group__item__content",
|
|
33
|
-
children: [
|
|
34
|
-
item.headers?.map((header)=>/*#__PURE__*/ jsx("li", {
|
|
35
|
-
className: "rp-overview-group__item__content__item",
|
|
36
|
-
children: /*#__PURE__*/ jsx(Link, {
|
|
37
|
-
className: "rp-overview-group__item__content__item__link",
|
|
38
|
-
href: `${item.link}#${header.id}`,
|
|
39
|
-
...renderInlineMarkdown(header.text)
|
|
40
|
-
})
|
|
41
|
-
}, header.id)),
|
|
42
|
-
item.items?.map(({ link, text })=>/*#__PURE__*/ jsx("li", {
|
|
43
|
-
className: "rp-overview-group__item__content__item",
|
|
44
|
-
children: /*#__PURE__*/ jsx(Link, {
|
|
45
|
-
className: "rp-overview-group__item__content__item__link",
|
|
46
|
-
href: link,
|
|
47
|
-
...renderInlineMarkdown(text)
|
|
48
|
-
})
|
|
49
|
-
}, link))
|
|
50
|
-
]
|
|
51
|
-
})
|
|
52
|
-
]
|
|
53
|
-
}, item.link))
|
|
54
|
-
})
|
|
55
|
-
]
|
|
56
|
-
});
|
|
57
|
-
export { OverviewGroup };
|
|
File without changes
|