@rspress/core 2.0.0-rc.3 → 2.0.0-rc.5
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.723d12b2.js → 0~7675.4468968d.js} +4 -4
- package/dist/1820.985588a0.js +5 -0
- package/dist/{3521.56e42d70.js → 5341.9eb6b114.js} +12 -12
- package/dist/{5485.077f14ff.js → 5485.b9ce9bdf.js} +5 -5
- package/dist/6289.29817fb4.js +4 -0
- package/dist/8813.4b28f4bb.js +1 -0
- package/dist/_private/react/render.js +1 -1
- package/dist/cli/config/loadConfigFile.js +2 -2
- package/dist/cli/index.44f3184c.js +2 -0
- package/dist/cli/index.js +3 -3
- package/dist/eject-theme/components/CodeBlock/index.tsx +1 -1
- package/dist/eject-theme/components/FallbackHeading/index.tsx +4 -0
- package/dist/eject-theme/components/HomeBackground/useNavTransparent.tsx +2 -1
- package/dist/eject-theme/components/HomeHero/index.scss +8 -0
- package/dist/eject-theme/components/HomeHero/index.tsx +11 -2
- package/dist/eject-theme/components/HoverGroup/index.scss +3 -2
- package/dist/eject-theme/components/HoverGroup/index.tsx +104 -22
- package/dist/eject-theme/components/Nav/NavMenu.scss +1 -1
- package/dist/eject-theme/components/Nav/NavMenu.tsx +50 -28
- package/dist/eject-theme/components/NavScreen/NavScreenMenuItem.tsx +26 -11
- package/dist/eject-theme/components/Overview/index.tsx +11 -0
- package/dist/eject-theme/components/OverviewGroup/index.tsx +46 -0
- package/dist/eject-theme/components/Steps/index.scss +1 -0
- package/dist/index.js +6 -11
- package/dist/node/PluginDriver.js +3 -3
- package/dist/node/auto-nav-sidebar/index.js +3 -3
- 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 +2 -2
- package/dist/node/auto-nav-sidebar/walk.js +13 -9
- package/dist/node/constants.js +2 -2
- package/dist/node/eject.js +2 -5
- package/dist/node/initRsbuild.js +14 -9
- package/dist/node/last-updated/index.js +1 -1
- package/dist/node/logger/hint.js +1 -1
- package/dist/node/mdx/loader.7c249a26.js +12 -0
- package/dist/node/mdx/options.js +3 -3
- package/dist/node/mdx/processor.js +2 -2
- package/dist/node/mdx/rehypePlugins/codeMeta.js +1 -1
- package/dist/node/mdx/rehypePlugins/headerAnchor.js +4 -4
- package/dist/node/mdx/rehypePlugins/shiki.js +1 -1
- package/dist/node/mdx/rehypePlugins/transformers/index.js +5 -5
- package/dist/node/mdx/remarkPlugins/builtin.js +1 -1
- package/dist/node/mdx/remarkPlugins/containerSyntax.js +1 -1
- package/dist/node/mdx/remarkPlugins/fileCodeBlock.js +3 -3
- package/dist/node/mdx/remarkPlugins/image.js +2 -3
- package/dist/node/mdx/remarkPlugins/link.js +3 -3
- package/dist/node/mdx/remarkPlugins/toc.js +3 -3
- package/dist/node/medium-zoom/index.js +1 -1
- package/dist/node/route/RoutePage.js +1 -1
- package/dist/node/route/RouteService.js +3 -3
- package/dist/node/route/extractPageData.js +4 -5
- package/dist/node/route/normalizeRoutePath.js +2 -2
- package/dist/node/runtimeModule/i18n.js +2 -2
- package/dist/node/runtimeModule/pageData/createPageData.js +2 -2
- 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/renderPage.js +2 -2
- package/dist/node/ssg/renderPageWorker.165b5d46.js +1 -0
- package/dist/node/ssg/renderPageWorker.js +2 -2
- package/dist/node/ssg/renderPages.js +3 -3
- package/dist/node/ssg/rsbuildPluginSSG.js +2 -2
- package/dist/node/ssg/ssgEnv.js +1 -1
- package/dist/node/ssg-md/llms/emitLlmsTxt.js +9 -7
- package/dist/node/ssg-md/llms/llmsTxt.js +2 -2
- package/dist/node/ssg-md/remarkSplitMdx.js +2 -2
- package/dist/node/ssg-md/renderPage.js +2 -2
- package/dist/node/ssg-md/renderPages.js +2 -2
- package/dist/node/ssg-md/rsbuildPluginSSGMD.js +2 -2
- package/dist/node/utils/checkLanguageParity.js +1 -1
- package/dist/node/utils/createHash.js +1 -1
- package/dist/node/utils/error.js +1 -1
- package/dist/node/utils/flattenMdxContent.js +4 -5
- package/dist/node/utils/fs.js +1 -1
- package/dist/node/utils/getPageKey.js +1 -1
- package/dist/node/utils/normalizePath.js +3 -3
- package/dist/node/utils/reactAlias.js +2 -2
- package/dist/runtime/App.js +4 -2
- package/dist/runtime/Content.d.ts +4 -0
- package/dist/runtime/Content.js +18 -0
- package/dist/runtime/NoSSR.d.ts +3 -0
- package/dist/runtime/NoSSR.js +14 -0
- package/dist/runtime/getSidebarDataGroup.test.js +68 -0
- package/dist/runtime/hooks/useActiveMatcher.d.ts +1 -0
- package/dist/runtime/hooks/useActiveMatcher.js +14 -0
- package/dist/runtime/hooks/useDark.d.ts +7 -0
- package/dist/runtime/hooks/useDark.js +7 -0
- package/dist/runtime/hooks/useFrontmatter.d.ts +4 -0
- package/dist/runtime/hooks/useFrontmatter.js +9 -0
- package/dist/runtime/hooks/useI18n.d.ts +2 -0
- package/dist/runtime/hooks/useI18n.js +14 -0
- package/dist/runtime/hooks/useLang.d.ts +1 -0
- package/dist/runtime/hooks/useLang.js +6 -0
- package/dist/runtime/hooks/useLocaleSiteData.d.ts +18 -0
- package/dist/runtime/hooks/useLocaleSiteData.js +20 -0
- package/dist/runtime/hooks/useNav.d.ts +1 -0
- package/dist/runtime/hooks/useNav.js +12 -0
- package/dist/runtime/hooks/usePage.d.ts +10 -0
- package/dist/runtime/hooks/usePage.js +9 -0
- package/dist/runtime/hooks/usePageData.d.ts +5 -0
- package/dist/runtime/hooks/usePageData.js +16 -0
- package/dist/runtime/hooks/usePages.d.ts +4 -0
- package/dist/runtime/hooks/usePages.js +7 -0
- package/dist/runtime/hooks/useSidebar.d.ts +16 -0
- package/dist/runtime/hooks/useSidebar.js +67 -0
- package/dist/runtime/hooks/useSite.d.ts +4 -0
- package/dist/runtime/hooks/useSite.js +7 -0
- package/dist/runtime/hooks/useVersion.d.ts +1 -0
- package/dist/runtime/hooks/useVersion.js +6 -0
- package/dist/runtime/hooks/useWindowSize.d.ts +9 -0
- package/dist/runtime/hooks/useWindowSize.js +31 -0
- package/dist/runtime/hooks/useWindowSize.test.js +36 -0
- package/dist/runtime/index.d.ts +21 -0
- package/dist/runtime/index.js +22 -0
- package/dist/runtime/route.d.ts +36 -0
- package/dist/runtime/route.js +53 -0
- package/dist/runtime/route.test.js +154 -0
- package/dist/runtime/ssrMdServerEntry.js +1 -1
- package/dist/runtime/utils.d.ts +12 -0
- package/dist/runtime/utils.js +34 -0
- package/dist/runtime/utils.test.js +34 -0
- package/dist/shiki-transformers.js +2 -2
- package/dist/theme/components/CodeBlock/index.js +1 -1
- package/dist/theme/components/FallbackHeading/index.js +4 -1
- package/dist/theme/components/HomeBackground/useNavTransparent.js +1 -1
- package/dist/theme/components/HomeHero/index.css +6 -0
- package/dist/theme/components/HomeHero/index.js +10 -3
- package/dist/theme/components/HoverGroup/index.css +3 -2
- package/dist/theme/components/HoverGroup/index.js +88 -17
- package/dist/theme/components/Nav/NavMenu.css +1 -1
- package/dist/theme/components/Nav/NavMenu.d.ts +6 -1
- package/dist/theme/components/Nav/NavMenu.js +47 -45
- package/dist/theme/components/NavScreen/NavScreenMenuItem.d.ts +1 -1
- package/dist/theme/components/NavScreen/NavScreenMenuItem.js +21 -11
- package/dist/theme/components/Overview/index.js +12 -1
- package/dist/theme/components/OverviewGroup/index.js +33 -0
- package/dist/theme/components/Steps/index.css +1 -0
- package/dist/theme/index.d.ts +1 -1
- package/dist/theme/index.js +1 -1
- package/dist/theme/layout/DocLayout/index.js +10 -0
- package/dist/theme/layout/HomeLayout/index.js +40 -0
- package/dist/theme/layout/Layout/index.js +10 -6
- package/dist/theme/logic/useScrollAfterNav.js +2 -2
- package/dist/theme/logic/useScrollReset.js +2 -2
- package/dist/theme/logic/useStorageValue.js +6 -3
- package/dist/theme/logic/{useAppearance.d.ts → useThemeState.d.ts} +4 -1
- package/dist/theme/logic/useThemeState.js +50 -0
- package/dist/theme/styles/scrollbar.css +14 -2
- package/dist/theme/styles/vars/base-vars.css +2 -2
- package/dist/theme/styles/vars/code-vars.css +2 -2
- package/nav-json-schema.json +2 -2
- package/package.json +10 -11
- package/static/MediumZoom.tsx +1 -1
- package/dist/4669.12208c6a.js +0 -2
- package/dist/6289.c67fe0d5.js +0 -5
- package/dist/8813.9da1f210.js +0 -2
- package/dist/9643.f109822d.js +0 -5
- package/dist/cli/index.cb89dbd1.js +0 -3
- package/dist/node/mdx/loader.e1578c62.js +0 -13
- package/dist/node/ssg/renderPageWorker.474f9f73.js +0 -2
- package/dist/runtime.72d450ac.js +0 -1
- package/dist/runtime.d.ts +0 -2
- package/dist/runtime.js +0 -4
- package/dist/theme/logic/useAppearance.js +0 -64
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { matchNavbar, useLocation } from "@rspress/core/runtime";
|
|
3
3
|
import { IconArrowDown, Link, SvgWrapper, Tag, useHoverGroup } from "@theme";
|
|
4
4
|
import clsx from "clsx";
|
|
@@ -9,47 +9,50 @@ const SvgDown = (props)=>/*#__PURE__*/ jsx(SvgWrapper, {
|
|
|
9
9
|
icon: IconArrowDown,
|
|
10
10
|
...props
|
|
11
11
|
});
|
|
12
|
+
function NavMenuItemInner({ menuItem, children }) {
|
|
13
|
+
return /*#__PURE__*/ jsx(Fragment, {
|
|
14
|
+
children: 'link' in menuItem && 'string' == typeof menuItem.link ? /*#__PURE__*/ jsxs(Link, {
|
|
15
|
+
href: menuItem.link,
|
|
16
|
+
className: "rp-nav-menu__item__container",
|
|
17
|
+
children: [
|
|
18
|
+
menuItem.text,
|
|
19
|
+
menuItem.tag && /*#__PURE__*/ jsx(Tag, {
|
|
20
|
+
tag: menuItem.tag
|
|
21
|
+
}),
|
|
22
|
+
children
|
|
23
|
+
]
|
|
24
|
+
}) : /*#__PURE__*/ jsxs("div", {
|
|
25
|
+
className: "rp-nav-menu__item__container",
|
|
26
|
+
children: [
|
|
27
|
+
menuItem.text,
|
|
28
|
+
menuItem.tag && /*#__PURE__*/ jsx(Tag, {
|
|
29
|
+
tag: menuItem.tag
|
|
30
|
+
}),
|
|
31
|
+
children
|
|
32
|
+
]
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
}
|
|
12
36
|
function NavMenuItemWithChildren({ menuItem, activeMatcher }) {
|
|
13
37
|
const { handleMouseEnter, handleMouseLeave, hoverGroup } = useHoverGroup({
|
|
14
38
|
items: menuItem.items,
|
|
15
39
|
activeMatcher
|
|
16
40
|
});
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
className: "rp-nav-menu__item__container",
|
|
20
|
-
children: [
|
|
21
|
-
menuItem.text,
|
|
22
|
-
menuItem.tag && /*#__PURE__*/ jsx(Tag, {
|
|
23
|
-
tag: menuItem.tag
|
|
24
|
-
}),
|
|
25
|
-
/*#__PURE__*/ jsx(SvgDown, {
|
|
26
|
-
className: "rp-nav-menu__item__icon"
|
|
27
|
-
})
|
|
28
|
-
]
|
|
29
|
-
}) : /*#__PURE__*/ jsxs("div", {
|
|
30
|
-
className: "rp-nav-menu__item__container",
|
|
31
|
-
children: [
|
|
32
|
-
menuItem.text,
|
|
33
|
-
menuItem.tag && /*#__PURE__*/ jsx(Tag, {
|
|
34
|
-
tag: menuItem.tag
|
|
35
|
-
}),
|
|
36
|
-
/*#__PURE__*/ jsx(SvgDown, {
|
|
37
|
-
className: "rp-nav-menu__item__icon"
|
|
38
|
-
})
|
|
39
|
-
]
|
|
40
|
-
});
|
|
41
|
-
return menuItem.items.length > 0 ? /*#__PURE__*/ jsxs("li", {
|
|
41
|
+
const hasItems = menuItem.items.length > 0;
|
|
42
|
+
return /*#__PURE__*/ jsxs("li", {
|
|
42
43
|
className: "rp-nav-menu__item",
|
|
43
44
|
onMouseEnter: handleMouseEnter,
|
|
44
45
|
onMouseLeave: handleMouseLeave,
|
|
45
46
|
onClick: handleMouseEnter,
|
|
46
47
|
children: [
|
|
47
|
-
|
|
48
|
+
/*#__PURE__*/ jsx(NavMenuItemInner, {
|
|
49
|
+
menuItem: menuItem,
|
|
50
|
+
children: hasItems && /*#__PURE__*/ jsx(SvgDown, {
|
|
51
|
+
className: "rp-nav-menu__item__icon"
|
|
52
|
+
})
|
|
53
|
+
}),
|
|
48
54
|
hoverGroup
|
|
49
55
|
]
|
|
50
|
-
}) : /*#__PURE__*/ jsx("li", {
|
|
51
|
-
className: "rp-nav-menu__item",
|
|
52
|
-
children: inner
|
|
53
56
|
});
|
|
54
57
|
}
|
|
55
58
|
function NavMenuItemWithLink({ menuItem }) {
|
|
@@ -60,24 +63,23 @@ function NavMenuItemWithLink({ menuItem }) {
|
|
|
60
63
|
]);
|
|
61
64
|
return /*#__PURE__*/ jsx("li", {
|
|
62
65
|
className: clsx('rp-nav-menu__item', isActive ? 'rp-nav-menu__item--active' : '', 'rspress-nav-menu-item', isActive ? 'rspress-nav-menu-item-active' : ''),
|
|
63
|
-
children: /*#__PURE__*/
|
|
64
|
-
|
|
65
|
-
className: "rp-nav-menu__item__container",
|
|
66
|
-
children: [
|
|
67
|
-
menuItem.text,
|
|
68
|
-
menuItem.tag && /*#__PURE__*/ jsx(Tag, {
|
|
69
|
-
tag: menuItem.tag
|
|
70
|
-
})
|
|
71
|
-
]
|
|
66
|
+
children: /*#__PURE__*/ jsx(NavMenuItemInner, {
|
|
67
|
+
menuItem: menuItem
|
|
72
68
|
})
|
|
73
69
|
});
|
|
74
70
|
}
|
|
75
|
-
function NavMenuItem({ menuItem
|
|
76
|
-
if ('items' in
|
|
77
|
-
menuItem:
|
|
71
|
+
function NavMenuItem({ menuItem }) {
|
|
72
|
+
if ('items' in menuItem && Array.isArray(menuItem.items) && menuItem.items.length > 0) return /*#__PURE__*/ jsx(NavMenuItemWithChildren, {
|
|
73
|
+
menuItem: menuItem
|
|
78
74
|
});
|
|
79
|
-
return /*#__PURE__*/ jsx(NavMenuItemWithLink, {
|
|
80
|
-
menuItem:
|
|
75
|
+
if ('link' in menuItem && menuItem.link.length > 0) return /*#__PURE__*/ jsx(NavMenuItemWithLink, {
|
|
76
|
+
menuItem: menuItem
|
|
77
|
+
});
|
|
78
|
+
return /*#__PURE__*/ jsx("li", {
|
|
79
|
+
className: "rp-nav-menu__item",
|
|
80
|
+
children: /*#__PURE__*/ jsx(NavMenuItemInner, {
|
|
81
|
+
menuItem: menuItem
|
|
82
|
+
})
|
|
81
83
|
});
|
|
82
84
|
}
|
|
83
85
|
function NavMenuDivider() {
|
|
@@ -118,4 +120,4 @@ function NavMenu({ menuItems, position }) {
|
|
|
118
120
|
}, index))
|
|
119
121
|
});
|
|
120
122
|
}
|
|
121
|
-
export { NavLangs, NavMenu, NavMenuDivider, NavMenuItem, NavMenuItemWithChildren, NavMenuItemWithLink, NavVersions, SvgDown };
|
|
123
|
+
export { NavLangs, NavMenu, NavMenuDivider, NavMenuItem, NavMenuItemInner, NavMenuItemWithChildren, NavMenuItemWithLink, NavVersions, SvgDown };
|
|
@@ -21,5 +21,5 @@ export declare function NavScreenMenuItemWithChildren({ menuItem, }: NavScreenMe
|
|
|
21
21
|
interface NavScreenMenuItemProps {
|
|
22
22
|
menuItem: NavItem;
|
|
23
23
|
}
|
|
24
|
-
export declare function NavScreenMenuItem({ menuItem
|
|
24
|
+
export declare function NavScreenMenuItem({ menuItem }: NavScreenMenuItemProps): import("react/jsx-runtime").JSX.Element;
|
|
25
25
|
export {};
|
|
@@ -11,7 +11,7 @@ const SvgDown = (props)=>/*#__PURE__*/ jsx(SvgWrapper, {
|
|
|
11
11
|
function NavScreenMenuItemRaw({ left, right, isOpen, isActive, onClick, href }) {
|
|
12
12
|
if (href) return /*#__PURE__*/ jsxs(Link, {
|
|
13
13
|
href: href,
|
|
14
|
-
className: clsx('rp-nav-screen-menu-item', isActive && 'rp-nav-screen-menu-item--active'),
|
|
14
|
+
className: clsx('rp-nav-screen-menu-item', isOpen && 'rp-nav-screen-menu-item--open', isActive && 'rp-nav-screen-menu-item--active'),
|
|
15
15
|
onClick: onClick,
|
|
16
16
|
children: [
|
|
17
17
|
/*#__PURE__*/ jsx("div", {
|
|
@@ -61,7 +61,7 @@ function NavScreenMenuItemWithLink({ menuItem }) {
|
|
|
61
61
|
}
|
|
62
62
|
function NavScreenMenuItemWithChildren({ menuItem }) {
|
|
63
63
|
const [isOpen, setIsOpen] = useState(false);
|
|
64
|
-
return
|
|
64
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
65
65
|
children: [
|
|
66
66
|
/*#__PURE__*/ jsx(NavScreenMenuItemRaw, {
|
|
67
67
|
left: /*#__PURE__*/ jsxs(Fragment, {
|
|
@@ -76,7 +76,8 @@ function NavScreenMenuItemWithChildren({ menuItem }) {
|
|
|
76
76
|
className: "rp-nav-screen-menu-item__icon"
|
|
77
77
|
}),
|
|
78
78
|
isOpen: isOpen,
|
|
79
|
-
onClick: ()=>setIsOpen(!isOpen)
|
|
79
|
+
onClick: ()=>setIsOpen(!isOpen),
|
|
80
|
+
href: 'link' in menuItem ? menuItem.link : void 0
|
|
80
81
|
}),
|
|
81
82
|
/*#__PURE__*/ jsx("div", {
|
|
82
83
|
className: "rp-nav-screen-menu-item__group",
|
|
@@ -88,22 +89,31 @@ function NavScreenMenuItemWithChildren({ menuItem }) {
|
|
|
88
89
|
},
|
|
89
90
|
children: /*#__PURE__*/ jsx("div", {
|
|
90
91
|
className: "rp-nav-screen-menu-item__group-inner",
|
|
91
|
-
children: menuItem.items.map((item)=>/*#__PURE__*/ jsx(
|
|
92
|
+
children: menuItem.items.map((item)=>/*#__PURE__*/ jsx(NavScreenMenuItem, {
|
|
92
93
|
menuItem: item
|
|
93
94
|
}, item.text))
|
|
94
95
|
})
|
|
95
96
|
})
|
|
96
97
|
]
|
|
97
|
-
}) : /*#__PURE__*/ jsx(NavScreenMenuItemWithLink, {
|
|
98
|
-
menuItem: menuItem
|
|
99
98
|
});
|
|
100
99
|
}
|
|
101
|
-
function NavScreenMenuItem({ menuItem
|
|
102
|
-
if ('items' in
|
|
103
|
-
menuItem:
|
|
100
|
+
function NavScreenMenuItem({ menuItem }) {
|
|
101
|
+
if ('items' in menuItem && Array.isArray(menuItem.items) && menuItem.items.length > 0) return /*#__PURE__*/ jsx(NavScreenMenuItemWithChildren, {
|
|
102
|
+
menuItem: menuItem
|
|
104
103
|
});
|
|
105
|
-
return /*#__PURE__*/ jsx(NavScreenMenuItemWithLink, {
|
|
106
|
-
menuItem:
|
|
104
|
+
if ('link' in menuItem && 'string' == typeof menuItem.link) return /*#__PURE__*/ jsx(NavScreenMenuItemWithLink, {
|
|
105
|
+
menuItem: menuItem
|
|
106
|
+
});
|
|
107
|
+
return /*#__PURE__*/ jsx(NavScreenMenuItemRaw, {
|
|
108
|
+
left: /*#__PURE__*/ jsxs(Fragment, {
|
|
109
|
+
children: [
|
|
110
|
+
menuItem.text,
|
|
111
|
+
menuItem.tag && /*#__PURE__*/ jsx(Tag, {
|
|
112
|
+
tag: menuItem.tag
|
|
113
|
+
})
|
|
114
|
+
]
|
|
115
|
+
}),
|
|
116
|
+
right: null
|
|
107
117
|
});
|
|
108
118
|
}
|
|
109
119
|
export { NavScreenMenuItem, NavScreenMenuItemRaw, NavScreenMenuItemWithChildren, NavScreenMenuItemWithLink, SvgDown };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { isEqualPath, useI18n, usePageData, useSidebar } from "@rspress/core/runtime";
|
|
3
3
|
import { FallbackHeading, OverviewGroup } from "@theme";
|
|
4
4
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
@@ -115,6 +115,17 @@ function Overview(props) {
|
|
|
115
115
|
query
|
|
116
116
|
]);
|
|
117
117
|
const overviewTitle = title || 'Overview';
|
|
118
|
+
if (process.env.__SSR_MD__) return /*#__PURE__*/ jsxs(Fragment, {
|
|
119
|
+
children: [
|
|
120
|
+
/*#__PURE__*/ jsx(FallbackHeading, {
|
|
121
|
+
level: 1,
|
|
122
|
+
title: overviewTitle
|
|
123
|
+
}),
|
|
124
|
+
groups.map((group)=>/*#__PURE__*/ jsx(OverviewGroup, {
|
|
125
|
+
group: group
|
|
126
|
+
}, group?.name))
|
|
127
|
+
]
|
|
128
|
+
});
|
|
118
129
|
return /*#__PURE__*/ jsxs("div", {
|
|
119
130
|
className: "rspress-doc rp-doc rspress-overview rp-overview",
|
|
120
131
|
children: [
|
|
@@ -1,9 +1,42 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { FallbackHeading, Link, SvgWrapper, renderInlineMarkdown } from "@theme";
|
|
3
3
|
import "./index.css";
|
|
4
|
+
import { routePathToMdPath } from "@rspress/core/runtime";
|
|
4
5
|
import { useMemo } from "react";
|
|
5
6
|
import icons_plugin from "./icons/plugin.js";
|
|
7
|
+
function OverviewGroupMarkdown({ group }) {
|
|
8
|
+
const lines = [];
|
|
9
|
+
if (group.name) {
|
|
10
|
+
lines.push(`## ${group.name}`);
|
|
11
|
+
lines.push('');
|
|
12
|
+
}
|
|
13
|
+
for (const item of group.items){
|
|
14
|
+
const itemTitle = item.link ? `[${item.text}](${routePathToMdPath(item.link)})` : `**${item.text}**`;
|
|
15
|
+
lines.push(`### ${itemTitle}`);
|
|
16
|
+
lines.push('');
|
|
17
|
+
if (item.headers && item.headers.length > 0) {
|
|
18
|
+
for (const header of item.headers){
|
|
19
|
+
const headerLink = item.link ? `[${header.text}](${routePathToMdPath(item.link)}#${header.id})` : header.text;
|
|
20
|
+
lines.push(`- ${headerLink}`);
|
|
21
|
+
}
|
|
22
|
+
lines.push('');
|
|
23
|
+
}
|
|
24
|
+
if (item.items && item.items.length > 0) {
|
|
25
|
+
for (const subItem of item.items){
|
|
26
|
+
const subItemLink = subItem.link ? `[${subItem.text}](${routePathToMdPath(subItem.link)})` : subItem.text;
|
|
27
|
+
lines.push(`- ${subItemLink}`);
|
|
28
|
+
}
|
|
29
|
+
lines.push('');
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return /*#__PURE__*/ jsx(Fragment, {
|
|
33
|
+
children: lines.join('\n')
|
|
34
|
+
});
|
|
35
|
+
}
|
|
6
36
|
const OverviewGroup = ({ group })=>{
|
|
37
|
+
if (process.env.__SSR_MD__) return /*#__PURE__*/ jsx(OverviewGroupMarkdown, {
|
|
38
|
+
group: group
|
|
39
|
+
});
|
|
7
40
|
const { itemsWithContent, itemsWithoutContent } = useMemo(()=>{
|
|
8
41
|
const itemsWithContent = group.items.filter((item)=>item.headers && item.headers.length > 0 || item.items && item.items.length > 0);
|
|
9
42
|
const itemsWithoutContent = group.items.filter((item)=>!(item.headers && item.headers.length > 0) && !(item.items && item.items.length > 0));
|
package/dist/theme/index.d.ts
CHANGED
|
@@ -53,7 +53,6 @@ export { HomeLayout, type HomeLayoutProps } from './layout/HomeLayout/index.js';
|
|
|
53
53
|
export { Layout, type LayoutProps } from './layout/Layout/index.js';
|
|
54
54
|
export { NotFoundLayout } from './layout/NotFountLayout/index.js';
|
|
55
55
|
export { mergeRefs } from './logic/mergeRefs.js';
|
|
56
|
-
export { useThemeState } from './logic/useAppearance.js';
|
|
57
56
|
export { useFullTextSearch } from './logic/useFullTextSearch.js';
|
|
58
57
|
export { usePrevNextPage } from './logic/usePrevNextPage.js';
|
|
59
58
|
export { useRedirect4FirstVisit } from './logic/useRedirect4FirstVisit.js';
|
|
@@ -61,4 +60,5 @@ export { useScrollAfterNav } from './logic/useScrollAfterNav.js';
|
|
|
61
60
|
export { useScrollReset } from './logic/useScrollReset.js';
|
|
62
61
|
export { useSetup } from './logic/useSetup.js';
|
|
63
62
|
export { useStorageValue } from './logic/useStorageValue.js';
|
|
63
|
+
export { useThemeState } from './logic/useThemeState.js';
|
|
64
64
|
export { parseInlineMarkdownText, renderHtmlOrText, renderInlineMarkdown, } from './logic/utils.js';
|
package/dist/theme/index.js
CHANGED
|
@@ -50,7 +50,6 @@ import { HomeLayout } from "./layout/HomeLayout/index.js";
|
|
|
50
50
|
import { Layout } from "./layout/Layout/index.js";
|
|
51
51
|
import { NotFoundLayout } from "./layout/NotFountLayout/index.js";
|
|
52
52
|
import { mergeRefs } from "./logic/mergeRefs.js";
|
|
53
|
-
import { useThemeState } from "./logic/useAppearance.js";
|
|
54
53
|
import { useFullTextSearch } from "./logic/useFullTextSearch.js";
|
|
55
54
|
import { usePrevNextPage } from "./logic/usePrevNextPage.js";
|
|
56
55
|
import { useRedirect4FirstVisit } from "./logic/useRedirect4FirstVisit.js";
|
|
@@ -58,6 +57,7 @@ import { useScrollAfterNav } from "./logic/useScrollAfterNav.js";
|
|
|
58
57
|
import { useScrollReset } from "./logic/useScrollReset.js";
|
|
59
58
|
import { useSetup } from "./logic/useSetup.js";
|
|
60
59
|
import { useStorageValue } from "./logic/useStorageValue.js";
|
|
60
|
+
import { useThemeState } from "./logic/useThemeState.js";
|
|
61
61
|
import { parseInlineMarkdownText, renderHtmlOrText, renderInlineMarkdown } from "./logic/utils.js";
|
|
62
62
|
export * from "./icons.js";
|
|
63
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 };
|
|
@@ -9,6 +9,16 @@ function DocLayout(props) {
|
|
|
9
9
|
const { frontmatter } = useFrontmatter();
|
|
10
10
|
const isOverviewPage = frontmatter?.overview ?? false;
|
|
11
11
|
const { sidebar: showSidebar = true, outline: showOutline = true, footer: showDocFooter = true, pageType } = frontmatter;
|
|
12
|
+
if (process.env.__SSR_MD__) return /*#__PURE__*/ jsx(Fragment, {
|
|
13
|
+
children: isOverviewPage ? /*#__PURE__*/ jsx(Overview, {
|
|
14
|
+
content: /*#__PURE__*/ jsx(DocContent, {
|
|
15
|
+
components: components,
|
|
16
|
+
isOverviewPage: true
|
|
17
|
+
})
|
|
18
|
+
}) : /*#__PURE__*/ jsx(DocContent, {
|
|
19
|
+
components: components
|
|
20
|
+
})
|
|
21
|
+
});
|
|
12
22
|
const isDocWide = 'doc-wide' === pageType;
|
|
13
23
|
const { isOutlineOpen, isSidebarOpen, sidebarMenu, asideLayoutRef, sidebarLayoutRef } = useSidebarMenu();
|
|
14
24
|
const { rspressDocRef } = useWatchToc();
|
|
@@ -1,6 +1,46 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useFrontmatter } from "@rspress/core/runtime";
|
|
2
3
|
import { HomeBackground, HomeFeature, HomeFooter, HomeHero } from "@theme";
|
|
4
|
+
function HomeLayoutMarkdown() {
|
|
5
|
+
const { frontmatter } = useFrontmatter();
|
|
6
|
+
const hero = frontmatter?.hero;
|
|
7
|
+
const features = frontmatter?.features;
|
|
8
|
+
const lines = [];
|
|
9
|
+
if (hero) {
|
|
10
|
+
if (hero.name) {
|
|
11
|
+
lines.push(`# ${hero.name}`);
|
|
12
|
+
lines.push('');
|
|
13
|
+
}
|
|
14
|
+
if (hero.text) {
|
|
15
|
+
lines.push(hero.text);
|
|
16
|
+
lines.push('');
|
|
17
|
+
}
|
|
18
|
+
if (hero.tagline) {
|
|
19
|
+
lines.push(`> ${hero.tagline}`);
|
|
20
|
+
lines.push('');
|
|
21
|
+
}
|
|
22
|
+
if (hero.actions && hero.actions.length > 0) {
|
|
23
|
+
const actionLinks = hero.actions.map((action)=>`[${action.text}](${action.link})`).join(' | ');
|
|
24
|
+
lines.push(actionLinks);
|
|
25
|
+
lines.push('');
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (features && features.length > 0) {
|
|
29
|
+
lines.push('## Features');
|
|
30
|
+
lines.push('');
|
|
31
|
+
for (const feature of features){
|
|
32
|
+
const icon = feature.icon ? `${feature.icon} ` : '';
|
|
33
|
+
const title = feature.link ? `[${icon}**${feature.title}**](${feature.link})` : `${icon}**${feature.title}**`;
|
|
34
|
+
lines.push(`- ${title}: ${feature.details}`);
|
|
35
|
+
}
|
|
36
|
+
lines.push('');
|
|
37
|
+
}
|
|
38
|
+
return /*#__PURE__*/ jsx(Fragment, {
|
|
39
|
+
children: lines.join('\n')
|
|
40
|
+
});
|
|
41
|
+
}
|
|
3
42
|
function HomeLayout(props) {
|
|
43
|
+
if (process.env.__SSR_MD__) return /*#__PURE__*/ jsx(HomeLayoutMarkdown, {});
|
|
4
44
|
const { beforeHero, afterHero, beforeFeatures, afterFeatures, beforeHeroActions, afterHeroActions } = props;
|
|
5
45
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
6
46
|
children: [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Content, useFrontmatter, useLocaleSiteData,
|
|
2
|
+
import { Content, useFrontmatter, useLocaleSiteData, usePage, useSite } from "@rspress/core/runtime";
|
|
3
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";
|
|
@@ -43,7 +43,7 @@ const HeadTags = /*#__PURE__*/ memo((props)=>{
|
|
|
43
43
|
});
|
|
44
44
|
});
|
|
45
45
|
function Layout(props) {
|
|
46
|
-
const { top, bottom, beforeDocFooter, afterDocFooter, beforeDoc, afterDoc, beforeDocContent, afterDocContent, beforeSidebar, afterSidebar, beforeOutline, afterOutline, beforeNavTitle, afterNavTitle, navTitle, beforeNav, afterNav, beforeHero, afterHero, beforeFeatures, afterFeatures, afterNavMenu, components, HomeLayout = external_theme_HomeLayout, NotFoundLayout = external_theme_NotFoundLayout } = props;
|
|
46
|
+
const { top, bottom, beforeDocFooter, afterDocFooter, beforeDoc, afterDoc, beforeDocContent, afterDocContent, beforeSidebar, afterSidebar, beforeOutline, afterOutline, beforeNavTitle, afterNavTitle, navTitle, beforeNav, afterNav, beforeHero, afterHero, beforeFeatures, afterFeatures, beforeNavMenu, afterNavMenu, components, HomeLayout = external_theme_HomeLayout, NotFoundLayout = external_theme_NotFoundLayout } = props;
|
|
47
47
|
const docProps = {
|
|
48
48
|
beforeDocFooter,
|
|
49
49
|
afterDocFooter,
|
|
@@ -63,14 +63,11 @@ function Layout(props) {
|
|
|
63
63
|
beforeFeatures,
|
|
64
64
|
afterFeatures
|
|
65
65
|
};
|
|
66
|
-
const { page } =
|
|
66
|
+
const { page } = usePage();
|
|
67
67
|
const { site } = useSite();
|
|
68
68
|
const { frontmatter } = useFrontmatter();
|
|
69
69
|
const { pageType, lang: currentLang, title: articleTitle } = page;
|
|
70
70
|
const localesData = useLocaleSiteData();
|
|
71
|
-
useSetup();
|
|
72
|
-
useScrollReset();
|
|
73
|
-
useRedirect4FirstVisit();
|
|
74
71
|
let title = frontmatter.title ?? articleTitle;
|
|
75
72
|
const mainTitle = site.title || localesData.title || '';
|
|
76
73
|
title = title && ('doc' === pageType || 'doc-wide' === pageType) ? concatTitle(title, frontmatter.titleSuffix || mainTitle) : 'home' === pageType ? concatTitle(mainTitle, frontmatter.titleSuffix) : '404' === pageType ? concatTitle('404', mainTitle) : mainTitle;
|
|
@@ -98,6 +95,12 @@ function Layout(props) {
|
|
|
98
95
|
});
|
|
99
96
|
}
|
|
100
97
|
};
|
|
98
|
+
if (process.env.__SSR_MD__) return /*#__PURE__*/ jsx(Fragment, {
|
|
99
|
+
children: getContentLayout()
|
|
100
|
+
});
|
|
101
|
+
useSetup();
|
|
102
|
+
useScrollReset();
|
|
103
|
+
useRedirect4FirstVisit();
|
|
101
104
|
const { frontmatter: { navbar: showNavbar = true } } = useFrontmatter();
|
|
102
105
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
103
106
|
children: [
|
|
@@ -115,6 +118,7 @@ function Layout(props) {
|
|
|
115
118
|
beforeNavTitle: beforeNavTitle,
|
|
116
119
|
afterNavTitle: afterNavTitle,
|
|
117
120
|
navTitle: navTitle,
|
|
121
|
+
beforeNavMenu: beforeNavMenu,
|
|
118
122
|
afterNavMenu: afterNavMenu
|
|
119
123
|
}),
|
|
120
124
|
afterNav
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useLocation } from "@rspress/core/runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useLayoutEffect } from "react";
|
|
3
3
|
function parseCSSLength(value) {
|
|
4
4
|
if (!value || 'auto' === value || 'none' === value) return 0;
|
|
5
5
|
const numValue = Number.parseFloat(value);
|
|
@@ -20,7 +20,7 @@ function scrollToTarget(target) {
|
|
|
20
20
|
}
|
|
21
21
|
function useScrollAfterNav() {
|
|
22
22
|
const location = useLocation();
|
|
23
|
-
|
|
23
|
+
useLayoutEffect(()=>{
|
|
24
24
|
const decodedHash = decodeURIComponent(window.location.hash);
|
|
25
25
|
if (decodedHash.length > 0) {
|
|
26
26
|
const target = document.getElementById(decodedHash.slice(1));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useLayoutEffect } from "react";
|
|
2
2
|
import { useLocation } from "react-router-dom";
|
|
3
3
|
function useScrollReset() {
|
|
4
4
|
const { pathname } = useLocation();
|
|
5
|
-
|
|
5
|
+
useLayoutEffect(()=>{
|
|
6
6
|
const decodedHash = decodeURIComponent(window.location.hash);
|
|
7
7
|
if (0 === decodedHash.length) window.scrollTo(0, 0);
|
|
8
8
|
}, [
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { useCallback, useEffect,
|
|
1
|
+
import { useCallback, useEffect, useState } from "react";
|
|
2
2
|
const SYNC_STORAGE_EVENT_NAME = 'RSPRESS_SYNC_STORAGE_EVENT_NAME';
|
|
3
3
|
const useStorageValue = (key, defaultValue)=>{
|
|
4
4
|
const [value, setValueInternal] = useState(defaultValue);
|
|
5
|
-
|
|
5
|
+
useEffect(()=>{
|
|
6
|
+
if ("u" < typeof window) return;
|
|
6
7
|
const storedValue = localStorage.getItem(key);
|
|
7
8
|
if (null != storedValue) setValueInternal(storedValue);
|
|
8
|
-
}, [
|
|
9
|
+
}, [
|
|
10
|
+
key
|
|
11
|
+
]);
|
|
9
12
|
const setValue = useCallback((value)=>{
|
|
10
13
|
const next = value;
|
|
11
14
|
if (null == next) localStorage.removeItem(key);
|
|
@@ -4,10 +4,13 @@ declare global {
|
|
|
4
4
|
RSPRESS_THEME?: string;
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
|
+
/** Resolved theme value used in the app */
|
|
7
8
|
type ThemeValue = 'light' | 'dark';
|
|
9
|
+
/** Theme config value stored in localStorage */
|
|
8
10
|
type ThemeConfigValue = ThemeValue | 'auto';
|
|
9
11
|
/**
|
|
10
12
|
* State provider for theme context.
|
|
13
|
+
* @internal
|
|
11
14
|
*/
|
|
12
|
-
export declare
|
|
15
|
+
export declare function useThemeState(): readonly [ThemeValue, (value: ThemeValue, storeValue?: ThemeConfigValue) => void];
|
|
13
16
|
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { useSite } from "@rspress/core/runtime";
|
|
2
|
+
import { useCallback, useLayoutEffect, useMemo } from "react";
|
|
3
|
+
import { useMediaQuery } from "./useMediaQuery.js";
|
|
4
|
+
import { useStorageValue } from "./useStorageValue.js";
|
|
5
|
+
const APPEARANCE_KEY = 'rspress-theme-appearance';
|
|
6
|
+
const MEDIA_QUERY = '(prefers-color-scheme: dark)';
|
|
7
|
+
const applyThemeToDOM = (theme)=>{
|
|
8
|
+
if (!document || !document.documentElement) return;
|
|
9
|
+
const root = document.documentElement;
|
|
10
|
+
root.classList.toggle('dark', 'dark' === theme);
|
|
11
|
+
root.classList.toggle('rp-dark', 'dark' === theme);
|
|
12
|
+
root.style.colorScheme = theme;
|
|
13
|
+
};
|
|
14
|
+
function useThemeState() {
|
|
15
|
+
const { site } = useSite();
|
|
16
|
+
const disableDarkMode = false === site.themeConfig.darkMode;
|
|
17
|
+
const prefersDark = useMediaQuery(MEDIA_QUERY);
|
|
18
|
+
const [storedConfig, setStoredConfig] = useStorageValue(APPEARANCE_KEY, 'auto');
|
|
19
|
+
const resolvedTheme = useMemo(()=>{
|
|
20
|
+
if ("u" < typeof window) return 'light';
|
|
21
|
+
if (disableDarkMode) return 'light';
|
|
22
|
+
const defaultTheme = window.RSPRESS_THEME;
|
|
23
|
+
if (defaultTheme) return 'dark' === defaultTheme ? 'dark' : 'light';
|
|
24
|
+
return 'auto' === storedConfig ? prefersDark ? 'dark' : 'light' : storedConfig;
|
|
25
|
+
}, [
|
|
26
|
+
disableDarkMode,
|
|
27
|
+
prefersDark,
|
|
28
|
+
storedConfig
|
|
29
|
+
]);
|
|
30
|
+
const setTheme = useCallback((value, storeValue = value)=>{
|
|
31
|
+
if (disableDarkMode) return;
|
|
32
|
+
setStoredConfig(storeValue);
|
|
33
|
+
applyThemeToDOM(value);
|
|
34
|
+
}, [
|
|
35
|
+
disableDarkMode,
|
|
36
|
+
setStoredConfig
|
|
37
|
+
]);
|
|
38
|
+
useLayoutEffect(()=>{
|
|
39
|
+
if (disableDarkMode) return;
|
|
40
|
+
applyThemeToDOM(resolvedTheme);
|
|
41
|
+
}, [
|
|
42
|
+
disableDarkMode,
|
|
43
|
+
resolvedTheme
|
|
44
|
+
]);
|
|
45
|
+
return [
|
|
46
|
+
resolvedTheme,
|
|
47
|
+
setTheme
|
|
48
|
+
];
|
|
49
|
+
}
|
|
50
|
+
export { useThemeState };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
.rp-scrollbar {
|
|
2
2
|
scrollbar-gutter: stable;
|
|
3
|
+
scrollbar-width: thin;
|
|
4
|
+
scrollbar-color: #0000000d #0000;
|
|
3
5
|
}
|
|
4
6
|
|
|
5
7
|
.rp-scrollbar::-webkit-scrollbar {
|
|
@@ -17,7 +19,7 @@
|
|
|
17
19
|
transition: background .2s;
|
|
18
20
|
}
|
|
19
21
|
|
|
20
|
-
.rp-scrollbar
|
|
22
|
+
.rp-scrollbar::-webkit-scrollbar-thumb:hover {
|
|
21
23
|
background: #0000001a;
|
|
22
24
|
}
|
|
23
25
|
|
|
@@ -25,11 +27,21 @@
|
|
|
25
27
|
background: none;
|
|
26
28
|
}
|
|
27
29
|
|
|
30
|
+
.rp-dark .rp-scrollbar {
|
|
31
|
+
scrollbar-color: #ffffff1a #0000;
|
|
32
|
+
}
|
|
33
|
+
|
|
28
34
|
.rp-dark .rp-scrollbar::-webkit-scrollbar-thumb {
|
|
29
35
|
background: #ffffff1a;
|
|
30
36
|
}
|
|
31
37
|
|
|
32
|
-
.rp-dark .rp-scrollbar
|
|
38
|
+
.rp-dark .rp-scrollbar::-webkit-scrollbar-thumb:hover {
|
|
33
39
|
background: #fff3;
|
|
34
40
|
}
|
|
35
41
|
|
|
42
|
+
.rp-scrollbar--always {
|
|
43
|
+
scrollbar-gutter: stable;
|
|
44
|
+
scrollbar-width: unset;
|
|
45
|
+
scrollbar-color: unset;
|
|
46
|
+
}
|
|
47
|
+
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
--rp-c-bg-soft: #f8f8f9;
|
|
4
4
|
--rp-c-bg-mute: #f1f1f1;
|
|
5
5
|
--rp-c-bg-alt: #fff;
|
|
6
|
-
--rp-c-divider: #
|
|
7
|
-
--rp-c-divider-light: #
|
|
6
|
+
--rp-c-divider: #00000040;
|
|
7
|
+
--rp-c-divider-light: #0000001f;
|
|
8
8
|
--rp-c-text-0: #000;
|
|
9
9
|
--rp-c-text-1: #242424;
|
|
10
10
|
--rp-c-text-2: #000000b3;
|
|
@@ -4,7 +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:
|
|
7
|
+
--rp-code-block-shadow: none;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
:where(html.rp-dark) {
|
|
@@ -13,6 +13,6 @@
|
|
|
13
13
|
--rp-code-block-color: #e5e7eb;
|
|
14
14
|
--rp-code-block-bg: var(--rp-c-bg);
|
|
15
15
|
--rp-code-block-border: 1px solid var(--rp-c-divider-light);
|
|
16
|
-
--rp-code-block-shadow:
|
|
16
|
+
--rp-code-block-shadow: none;
|
|
17
17
|
}
|
|
18
18
|
|
package/nav-json-schema.json
CHANGED
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"items": {
|
|
63
63
|
"type": "array",
|
|
64
64
|
"items": {
|
|
65
|
-
"$ref": "#/definitions/
|
|
65
|
+
"$ref": "#/definitions/NavItem"
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
68
|
"position": {
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"items": {
|
|
91
91
|
"type": "array",
|
|
92
92
|
"items": {
|
|
93
|
-
"$ref": "#/definitions/
|
|
93
|
+
"$ref": "#/definitions/NavItem"
|
|
94
94
|
}
|
|
95
95
|
},
|
|
96
96
|
"tag": {
|