@rspress/core 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/index.js +53 -40
- package/dist/index.js.map +1 -1
- package/dist/loader.d.ts +1 -1
- package/dist/loader.js.map +1 -1
- package/dist/runtime/App.js +8 -4
- package/dist/runtime/clientEntry.js +7 -4
- package/dist/runtime/ssrEntry.js +2 -2
- package/package.json +19 -15
- package/runtime.ts +1 -1
- package/src/runtime/App.tsx +8 -4
- package/src/runtime/clientEntry.tsx +7 -4
- package/src/runtime/ssrEntry.tsx +2 -2
- package/theme.ts +2 -2
- package/dist/runtime/Content.d.ts +0 -6
- package/dist/runtime/Content.js +0 -33
- package/dist/runtime/NoSSR.d.ts +0 -4
- package/dist/runtime/NoSSR.js +0 -17
- package/dist/runtime/hooks.d.ts +0 -39
- package/dist/runtime/hooks.js +0 -54
- package/dist/runtime/index.d.ts +0 -6
- package/dist/runtime/index.js +0 -34
- package/dist/runtime/utils.d.ts +0 -8
- package/dist/runtime/utils.js +0 -45
- package/dist/theme/bundle.css +0 -2691
- package/dist/theme/bundle.d.ts +0 -176
- package/dist/theme/bundle.js +0 -4433
- package/dist/theme/bundle.js.map +0 -1
- package/dist/theme/index.js +0 -6
- package/src/runtime/Content.tsx +0 -43
- package/src/runtime/NoSSR.tsx +0 -16
- package/src/runtime/hooks.ts +0 -110
- package/src/runtime/index.ts +0 -17
- package/src/runtime/utils.ts +0 -46
- package/src/theme-default/assets/arrow-down.svg +0 -1
- package/src/theme-default/assets/arrow-right.svg +0 -1
- package/src/theme-default/assets/copy.svg +0 -1
- package/src/theme-default/assets/down.svg +0 -1
- package/src/theme-default/assets/github.svg +0 -1
- package/src/theme-default/assets/loading.svg +0 -1
- package/src/theme-default/assets/menu.svg +0 -1
- package/src/theme-default/assets/moon.svg +0 -3
- package/src/theme-default/assets/right.svg +0 -1
- package/src/theme-default/assets/small-menu.svg +0 -1
- package/src/theme-default/assets/success.svg +0 -1
- package/src/theme-default/assets/sun.svg +0 -11
- package/src/theme-default/assets/translator.svg +0 -1
- package/src/theme-default/components/Aside/index.css +0 -22
- package/src/theme-default/components/Aside/index.tsx +0 -75
- package/src/theme-default/components/BackDrop/index.module.scss +0 -14
- package/src/theme-default/components/BackDrop/index.tsx +0 -13
- package/src/theme-default/components/Button/index.module.scss +0 -68
- package/src/theme-default/components/Button/index.tsx +0 -40
- package/src/theme-default/components/DocFooter/index.module.scss +0 -60
- package/src/theme-default/components/DocFooter/index.tsx +0 -66
- package/src/theme-default/components/EditLink/index.module.scss +0 -11
- package/src/theme-default/components/EditLink/index.tsx +0 -18
- package/src/theme-default/components/HomeFeatures/index.module.scss +0 -50
- package/src/theme-default/components/HomeFeatures/index.tsx +0 -65
- package/src/theme-default/components/HomeFooter/index.tsx +0 -15
- package/src/theme-default/components/HomeHero/index.module.scss +0 -42
- package/src/theme-default/components/HomeHero/index.tsx +0 -75
- package/src/theme-default/components/Link/index.module.scss +0 -9
- package/src/theme-default/components/Link/index.tsx +0 -90
- package/src/theme-default/components/LocalSideBar/index.scss +0 -40
- package/src/theme-default/components/LocalSideBar/index.tsx +0 -39
- package/src/theme-default/components/Nav/NavBarTitle.tsx +0 -43
- package/src/theme-default/components/Nav/NavMenuGroup.tsx +0 -156
- package/src/theme-default/components/Nav/NavMenuSingleItem.tsx +0 -40
- package/src/theme-default/components/Nav/NavTranslations.tsx +0 -16
- package/src/theme-default/components/Nav/NavVersions.tsx +0 -16
- package/src/theme-default/components/Nav/index.module.scss +0 -115
- package/src/theme-default/components/Nav/index.tsx +0 -150
- package/src/theme-default/components/Nav/menuDataHooks.tsx +0 -75
- package/src/theme-default/components/NavHambmger/index.module.scss +0 -81
- package/src/theme-default/components/NavHambmger/index.tsx +0 -39
- package/src/theme-default/components/NavScreen/NavScreenMenuGroup.tsx +0 -95
- package/src/theme-default/components/NavScreen/index.module.scss +0 -88
- package/src/theme-default/components/NavScreen/index.tsx +0 -123
- package/src/theme-default/components/Overview/index.module.scss +0 -154
- package/src/theme-default/components/Overview/index.tsx +0 -136
- package/src/theme-default/components/PackageManagerTabs/icons/Bun.tsx +0 -101
- package/src/theme-default/components/PackageManagerTabs/icons/Npm.tsx +0 -16
- package/src/theme-default/components/PackageManagerTabs/icons/Pnpm.tsx +0 -22
- package/src/theme-default/components/PackageManagerTabs/icons/Yarn.tsx +0 -18
- package/src/theme-default/components/PackageManagerTabs/index.scss +0 -5
- package/src/theme-default/components/PackageManagerTabs/index.tsx +0 -110
- package/src/theme-default/components/Search/NoSearchResult.tsx +0 -13
- package/src/theme-default/components/Search/SearchPanel.tsx +0 -340
- package/src/theme-default/components/Search/SuggestItem.tsx +0 -135
- package/src/theme-default/components/Search/assets/close.svg +0 -1
- package/src/theme-default/components/Search/assets/file.svg +0 -1
- package/src/theme-default/components/Search/assets/header.svg +0 -1
- package/src/theme-default/components/Search/assets/jump.svg +0 -1
- package/src/theme-default/components/Search/assets/loading.svg +0 -1
- package/src/theme-default/components/Search/assets/search.svg +0 -1
- package/src/theme-default/components/Search/assets/title.svg +0 -1
- package/src/theme-default/components/Search/empty.svg +0 -4
- package/src/theme-default/components/Search/index.module.scss +0 -236
- package/src/theme-default/components/Search/index.tsx +0 -39
- package/src/theme-default/components/Search/logic/Provider.ts +0 -35
- package/src/theme-default/components/Search/logic/providers/LocalProvider.ts +0 -102
- package/src/theme-default/components/Search/logic/providers/RemoteProvider.ts +0 -40
- package/src/theme-default/components/Search/logic/search.ts +0 -341
- package/src/theme-default/components/Search/logic/util.test.ts +0 -21
- package/src/theme-default/components/Search/logic/util.ts +0 -127
- package/src/theme-default/components/Sidebar/SidebarGroup.tsx +0 -180
- package/src/theme-default/components/Sidebar/SidebarItem.tsx +0 -61
- package/src/theme-default/components/Sidebar/index.module.scss +0 -142
- package/src/theme-default/components/Sidebar/index.tsx +0 -156
- package/src/theme-default/components/SocialLinks/HiddenLinks.tsx +0 -30
- package/src/theme-default/components/SocialLinks/LinkContent.tsx +0 -90
- package/src/theme-default/components/SocialLinks/ShownLinks.tsx +0 -32
- package/src/theme-default/components/SocialLinks/index.module.scss +0 -18
- package/src/theme-default/components/SocialLinks/index.tsx +0 -36
- package/src/theme-default/components/SocialLinks/presetIcons.tsx +0 -165
- package/src/theme-default/components/SwitchAppearance/index.module.scss +0 -15
- package/src/theme-default/components/SwitchAppearance/index.tsx +0 -35
- package/src/theme-default/components/Tabs/index.module.scss +0 -46
- package/src/theme-default/components/Tabs/index.tsx +0 -123
- package/src/theme-default/components/Tag/index.tsx +0 -18
- package/src/theme-default/components/Toc/index.css +0 -18
- package/src/theme-default/components/Toc/index.tsx +0 -42
- package/src/theme-default/index.ts +0 -26
- package/src/theme-default/layout/DocLayout/docComponents/code.tsx +0 -112
- package/src/theme-default/layout/DocLayout/docComponents/hr.tsx +0 -10
- package/src/theme-default/layout/DocLayout/docComponents/index.module.scss +0 -69
- package/src/theme-default/layout/DocLayout/docComponents/index.tsx +0 -33
- package/src/theme-default/layout/DocLayout/docComponents/link.tsx +0 -22
- package/src/theme-default/layout/DocLayout/docComponents/list.tsx +0 -13
- package/src/theme-default/layout/DocLayout/docComponents/paragraph.tsx +0 -19
- package/src/theme-default/layout/DocLayout/docComponents/pre.tsx +0 -37
- package/src/theme-default/layout/DocLayout/docComponents/prisim-theme.ts +0 -73
- package/src/theme-default/layout/DocLayout/docComponents/table.tsx +0 -37
- package/src/theme-default/layout/DocLayout/docComponents/title.tsx +0 -40
- package/src/theme-default/layout/DocLayout/index.module.scss +0 -138
- package/src/theme-default/layout/DocLayout/index.tsx +0 -125
- package/src/theme-default/layout/HomeLayout/index.css +0 -18
- package/src/theme-default/layout/HomeLayout/index.tsx +0 -39
- package/src/theme-default/layout/Layout/index.tsx +0 -176
- package/src/theme-default/layout/NotFountLayout/index.tsx +0 -40
- package/src/theme-default/logic/TabDataContext.ts +0 -14
- package/src/theme-default/logic/index.ts +0 -8
- package/src/theme-default/logic/sideEffects.ts +0 -174
- package/src/theme-default/logic/useAppearance.ts +0 -57
- package/src/theme-default/logic/useEditLink.ts +0 -33
- package/src/theme-default/logic/useHiddenNav.ts +0 -58
- package/src/theme-default/logic/useLocaleSiteData.ts +0 -26
- package/src/theme-default/logic/useNav.ts +0 -36
- package/src/theme-default/logic/usePathUtils.ts +0 -73
- package/src/theme-default/logic/usePrevNextPage.ts +0 -40
- package/src/theme-default/logic/useSidebarData.ts +0 -73
- package/src/theme-default/logic/utils.ts +0 -38
- package/src/theme-default/styles/base.css +0 -102
- package/src/theme-default/styles/code.css +0 -177
- package/src/theme-default/styles/index.ts +0 -7
- package/src/theme-default/styles/scrollbar.css +0 -28
- package/src/theme-default/styles/vars.css +0 -81
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
.title {
|
|
2
|
-
position: relative;
|
|
3
|
-
font-weight: 600;
|
|
4
|
-
outline: none;
|
|
5
|
-
:global(.header-anchor) {
|
|
6
|
-
float: left;
|
|
7
|
-
margin-left: -0.87em;
|
|
8
|
-
padding-right: 0.23em;
|
|
9
|
-
font-weight: 500;
|
|
10
|
-
opacity: 0;
|
|
11
|
-
font-size: inherit;
|
|
12
|
-
transition: color 0.25s, opacity 0.25s;
|
|
13
|
-
}
|
|
14
|
-
&:hover {
|
|
15
|
-
:global(.header-anchor) {
|
|
16
|
-
opacity: 1;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
& :global(.header-anchor:focus) {
|
|
20
|
-
opacity: 1;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.blockquote,
|
|
25
|
-
:global(summary) .blockquote {
|
|
26
|
-
:global(p) {
|
|
27
|
-
margin: 0;
|
|
28
|
-
font-size: 16px;
|
|
29
|
-
color: var(--rp-c-text-2);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.link,
|
|
34
|
-
:global(summary) .link,
|
|
35
|
-
:global(summary a) {
|
|
36
|
-
&:not(:global(.header-anchor)) {
|
|
37
|
-
font-weight: 500;
|
|
38
|
-
border-bottom: 1px dashed var(--rp-c-brand);
|
|
39
|
-
transition: color 0.25s;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
&:global(.header-anchor) {
|
|
43
|
-
color: var(--rp-c-brand);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
&:hover {
|
|
47
|
-
color: var(--rp-c-brand-dark);
|
|
48
|
-
border-style: solid;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
:global(.rspress-doc details) {
|
|
53
|
-
margin: 16px 0;
|
|
54
|
-
padding: 8px;
|
|
55
|
-
font-size: normal;
|
|
56
|
-
cursor: pointer;
|
|
57
|
-
transition: all 0.3s;
|
|
58
|
-
p {
|
|
59
|
-
margin: 8px 0;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
:global(.rspress-doc details:hover) {
|
|
64
|
-
background-color: var(--rp-c-bg-mute);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.inline-link {
|
|
68
|
-
display: inline;
|
|
69
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { H1, H2, H3, H4, H5, H6 } from './title';
|
|
2
|
-
import { Ul, Ol, Li } from './list';
|
|
3
|
-
import { Table, Td, Th, Tr } from './table';
|
|
4
|
-
import { Hr } from './hr';
|
|
5
|
-
import { A } from './link';
|
|
6
|
-
import { P, Strong, Blockquote } from './paragraph';
|
|
7
|
-
import { Code } from './code';
|
|
8
|
-
import { Pre } from './pre';
|
|
9
|
-
|
|
10
|
-
export function getCustomMDXComponent() {
|
|
11
|
-
return {
|
|
12
|
-
h1: H1,
|
|
13
|
-
h2: H2,
|
|
14
|
-
h3: H3,
|
|
15
|
-
h4: H4,
|
|
16
|
-
h5: H5,
|
|
17
|
-
h6: H6,
|
|
18
|
-
ul: Ul,
|
|
19
|
-
ol: Ol,
|
|
20
|
-
li: Li,
|
|
21
|
-
table: Table,
|
|
22
|
-
td: Td,
|
|
23
|
-
th: Th,
|
|
24
|
-
tr: Tr,
|
|
25
|
-
hr: Hr,
|
|
26
|
-
p: P,
|
|
27
|
-
blockquote: Blockquote,
|
|
28
|
-
strong: Strong,
|
|
29
|
-
a: A,
|
|
30
|
-
code: Code,
|
|
31
|
-
pre: Pre,
|
|
32
|
-
};
|
|
33
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ComponentProps } from 'react';
|
|
2
|
-
import styles from './index.module.scss';
|
|
3
|
-
import { usePathUtils } from '@/theme-default/logic';
|
|
4
|
-
import { Link } from '@/theme-default/components/Link';
|
|
5
|
-
|
|
6
|
-
export const A = (props: ComponentProps<'a'>) => {
|
|
7
|
-
const { href = '', className = '' } = props;
|
|
8
|
-
const { normalizeLinkHref } = usePathUtils();
|
|
9
|
-
const hasHeaderAnchor = className.includes('header-anchor');
|
|
10
|
-
|
|
11
|
-
if (hasHeaderAnchor || href.startsWith('#')) {
|
|
12
|
-
return <a {...props} className={`${styles.link} ${className}`} />;
|
|
13
|
-
} else {
|
|
14
|
-
return (
|
|
15
|
-
<Link
|
|
16
|
-
{...props}
|
|
17
|
-
className={`${className} ${styles.link} ${styles['inline-link']}`}
|
|
18
|
-
href={normalizeLinkHref(href)}
|
|
19
|
-
/>
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ComponentProps } from 'react';
|
|
2
|
-
|
|
3
|
-
export const Ol = (props: ComponentProps<'ol'>) => {
|
|
4
|
-
return <ol {...props} className="list-decimal pl-5 my-4 leading-7" />;
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
export const Ul = (props: ComponentProps<'ul'>) => {
|
|
8
|
-
return <ul {...props} className="list-disc pl-5 my-4 leading-7" />;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export const Li = (props: ComponentProps<'li'>) => {
|
|
12
|
-
return <li {...props} className="[&:not(:first-child)]:mt-2" />;
|
|
13
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ComponentProps } from 'react';
|
|
2
|
-
import styles from './index.module.scss';
|
|
3
|
-
|
|
4
|
-
export const P = (props: ComponentProps<'p'>) => {
|
|
5
|
-
return <p {...props} className="my-4 leading-7" />;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export const Blockquote = (props: ComponentProps<'blockquote'>) => {
|
|
9
|
-
return (
|
|
10
|
-
<blockquote
|
|
11
|
-
{...props}
|
|
12
|
-
className={`border-l-2 border-solid border-divider pl-4 my-6 transition-colors duration-500 ${styles.blockquote}`}
|
|
13
|
-
/>
|
|
14
|
-
);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export const Strong = (props: ComponentProps<'strong'>) => {
|
|
18
|
-
return <strong {...props} className="font-semibold" />;
|
|
19
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { CodeProps } from './code';
|
|
2
|
-
|
|
3
|
-
const DEFAULT_LANGUAGE_CLASS = 'language-bash';
|
|
4
|
-
|
|
5
|
-
export function parseTitleFromMeta(meta: string): string {
|
|
6
|
-
if (!meta) {
|
|
7
|
-
return '';
|
|
8
|
-
}
|
|
9
|
-
let result = meta;
|
|
10
|
-
const highlightReg = /{[\d,-]*}/i;
|
|
11
|
-
const highlightMeta = highlightReg.exec(meta)?.[0];
|
|
12
|
-
if (highlightMeta) {
|
|
13
|
-
result = meta.replace(highlightReg, '').trim();
|
|
14
|
-
}
|
|
15
|
-
result = result.split('=')[1] ?? '';
|
|
16
|
-
return result?.replace(/["'`]/g, '');
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function Pre({
|
|
20
|
-
children,
|
|
21
|
-
}: {
|
|
22
|
-
children: React.ReactElement[] | React.ReactElement;
|
|
23
|
-
}) {
|
|
24
|
-
if (Array.isArray(children)) {
|
|
25
|
-
return <pre>{children}</pre>;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const { className, meta } = children.props as CodeProps;
|
|
29
|
-
|
|
30
|
-
const codeTitle = parseTitleFromMeta(meta);
|
|
31
|
-
return (
|
|
32
|
-
<div className={className || DEFAULT_LANGUAGE_CLASS}>
|
|
33
|
-
{codeTitle && <div className="rspress-code-title">{codeTitle}</div>}
|
|
34
|
-
<div className="rspress-code-content rspress-scrollbar">{children}</div>
|
|
35
|
-
</div>
|
|
36
|
-
);
|
|
37
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
doctype: {
|
|
3
|
-
color: 'var(--code-token-text)',
|
|
4
|
-
fontStyle: 'italic',
|
|
5
|
-
},
|
|
6
|
-
token: {
|
|
7
|
-
color: 'var(--code-token-text)',
|
|
8
|
-
},
|
|
9
|
-
comment: {
|
|
10
|
-
color: 'var(--code-token-comment)',
|
|
11
|
-
},
|
|
12
|
-
punctuation: {
|
|
13
|
-
color: 'var(--code-token-punctuation)',
|
|
14
|
-
},
|
|
15
|
-
property: {
|
|
16
|
-
color: 'var(--code-token-parameter)',
|
|
17
|
-
},
|
|
18
|
-
constant: {
|
|
19
|
-
color: 'var(--code-token-constant)',
|
|
20
|
-
},
|
|
21
|
-
string: {
|
|
22
|
-
color: 'var(--code-token-string)',
|
|
23
|
-
},
|
|
24
|
-
symbol: {
|
|
25
|
-
color: 'var(--code-token-symbol)',
|
|
26
|
-
},
|
|
27
|
-
variable: {
|
|
28
|
-
color: 'var(--code-token-variable)',
|
|
29
|
-
},
|
|
30
|
-
'attr-name': {
|
|
31
|
-
color: 'var(--code-token-symbol)',
|
|
32
|
-
},
|
|
33
|
-
'attr-value': {
|
|
34
|
-
color: 'var(--code-token-string-expression)',
|
|
35
|
-
},
|
|
36
|
-
builtin: {
|
|
37
|
-
color: 'var(--code-token-symbol)',
|
|
38
|
-
},
|
|
39
|
-
function: {
|
|
40
|
-
color: 'var(--code-token-function)',
|
|
41
|
-
},
|
|
42
|
-
keyword: {
|
|
43
|
-
color: 'var(--code-token-keyword)',
|
|
44
|
-
},
|
|
45
|
-
tag: {
|
|
46
|
-
color: 'var(--code-token-function)',
|
|
47
|
-
},
|
|
48
|
-
inserted: {
|
|
49
|
-
color: '#22863a',
|
|
50
|
-
},
|
|
51
|
-
deleted: {
|
|
52
|
-
color: '#b31d28',
|
|
53
|
-
},
|
|
54
|
-
regex: {
|
|
55
|
-
color: 'var(--code-token-keyword)',
|
|
56
|
-
},
|
|
57
|
-
key: {
|
|
58
|
-
color: 'var(--code-token-variable)',
|
|
59
|
-
},
|
|
60
|
-
title: {
|
|
61
|
-
color: 'var(--code-token-keyword)',
|
|
62
|
-
},
|
|
63
|
-
important: {
|
|
64
|
-
color: '#EBCB8B',
|
|
65
|
-
fontWeight: 'bold',
|
|
66
|
-
},
|
|
67
|
-
bold: {
|
|
68
|
-
fontWeight: 'bold',
|
|
69
|
-
},
|
|
70
|
-
italic: {
|
|
71
|
-
fontStyle: 'italic',
|
|
72
|
-
},
|
|
73
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { ComponentProps } from 'react';
|
|
2
|
-
|
|
3
|
-
export const Table = (props: ComponentProps<'table'>) => {
|
|
4
|
-
return (
|
|
5
|
-
<table
|
|
6
|
-
{...props}
|
|
7
|
-
className="table border-collapse text-base my-5 overflow-x-auto leading-7 border-gray-light-2"
|
|
8
|
-
/>
|
|
9
|
-
);
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const Tr = (props: ComponentProps<'tr'>) => {
|
|
13
|
-
return (
|
|
14
|
-
<tr
|
|
15
|
-
{...props}
|
|
16
|
-
className="border border-solid transition-colors duration-500 even:bg-soft border-gray-light-2"
|
|
17
|
-
/>
|
|
18
|
-
);
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export const Td = (props: ComponentProps<'td'>) => {
|
|
22
|
-
return (
|
|
23
|
-
<td
|
|
24
|
-
{...props}
|
|
25
|
-
className="border border-solid px-4 py-2 border-gray-light-2"
|
|
26
|
-
/>
|
|
27
|
-
);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export const Th = (props: ComponentProps<'th'>) => {
|
|
31
|
-
return (
|
|
32
|
-
<th
|
|
33
|
-
{...props}
|
|
34
|
-
className="border border-solid px-4 py-2 text-text-1 text-base font-semibold border-gray-light-2"
|
|
35
|
-
/>
|
|
36
|
-
);
|
|
37
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { ComponentProps } from 'react';
|
|
2
|
-
import styles from './index.module.scss';
|
|
3
|
-
|
|
4
|
-
export const H1 = (props: ComponentProps<'h1'>) => {
|
|
5
|
-
return (
|
|
6
|
-
<h1
|
|
7
|
-
{...props}
|
|
8
|
-
className={`text-3xl mb-10 leading-10 tracking-tight ${styles.title}`}
|
|
9
|
-
/>
|
|
10
|
-
);
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const H2 = (props: ComponentProps<'h2'>) => {
|
|
14
|
-
return (
|
|
15
|
-
<h2
|
|
16
|
-
{...props}
|
|
17
|
-
className={`mt-14 mb-6 text-2xl tracking-tight ${styles.title}`}
|
|
18
|
-
/>
|
|
19
|
-
);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export const H3 = (props: ComponentProps<'h3'>) => {
|
|
23
|
-
return (
|
|
24
|
-
<h3 {...props} className={`mt-10 mb-2 leading-7 text-xl ${styles.title}`} />
|
|
25
|
-
);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export const H4 = (props: ComponentProps<'h4'>) => {
|
|
29
|
-
return (
|
|
30
|
-
<h4 {...props} className={`mt-8 leading-6 text-base ${styles.title}`} />
|
|
31
|
-
);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export const H5 = (props: ComponentProps<'h5'>) => {
|
|
35
|
-
return <h5 {...props} className={styles.title} />;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export const H6 = (props: ComponentProps<'h6'>) => {
|
|
39
|
-
return <h6 {...props} className={styles.title} />;
|
|
40
|
-
};
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
.aside-container {
|
|
2
|
-
position: sticky;
|
|
3
|
-
display: none;
|
|
4
|
-
top: 0;
|
|
5
|
-
margin-top: calc(var(--rp-nav-height) * -1 - 32px);
|
|
6
|
-
padding-top: calc(var(--rp-nav-height) + 32px);
|
|
7
|
-
overflow-x: hidden;
|
|
8
|
-
overflow-y: auto;
|
|
9
|
-
scrollbar-width: none;
|
|
10
|
-
width: 0;
|
|
11
|
-
max-height: calc(100vh - (var(--rp-nav-height) + 32px));
|
|
12
|
-
overflow: 'scroll';
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.aside-container::-webkit-scrollbar {
|
|
16
|
-
display: none;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
:global(.rspress-doc) {
|
|
20
|
-
min-height: 60vh;
|
|
21
|
-
view-transition-name: flip;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
:global(*) {
|
|
25
|
-
view-transition-name: none;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@keyframes fade-out {
|
|
29
|
-
from {
|
|
30
|
-
opacity: 1;
|
|
31
|
-
}
|
|
32
|
-
to {
|
|
33
|
-
opacity: 0;
|
|
34
|
-
transform: translateY(20px);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
@keyframes fade-in {
|
|
39
|
-
from {
|
|
40
|
-
opacity: 0;
|
|
41
|
-
transform: translateY(20px);
|
|
42
|
-
}
|
|
43
|
-
to {
|
|
44
|
-
opacity: 1;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
::view-transition-old(flip),
|
|
49
|
-
::view-transition-new(flip) {
|
|
50
|
-
animation-time: 250ms;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
::view-transition-old(flip) {
|
|
54
|
-
animation-name: fade-out;
|
|
55
|
-
transition-timing-function: cubic-bezier(0, 0, 0.58, 1);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
::view-transition-new(flip) {
|
|
59
|
-
animation-name: fade-in;
|
|
60
|
-
animation-delay: 180ms;
|
|
61
|
-
transition-timing-function: cubic-bezier(0.42, 0, 1, 1);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
@media (max-width: 960px) {
|
|
65
|
-
.docLayout {
|
|
66
|
-
position: relative;
|
|
67
|
-
}
|
|
68
|
-
.content {
|
|
69
|
-
padding: 36px 24px 72px 24px;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
:global(.rspress-doc) {
|
|
73
|
-
view-transition-name: none;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
@media (min-width: 960px) {
|
|
78
|
-
.docLayout {
|
|
79
|
-
width: 100%;
|
|
80
|
-
display: flex;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.content {
|
|
84
|
-
width: calc(100% - var(--rp-sidebar-width));
|
|
85
|
-
padding: 48px 48px 72px 0;
|
|
86
|
-
|
|
87
|
-
:global(.rspress-doc),
|
|
88
|
-
:global(.rspress-doc-footer) {
|
|
89
|
-
width: 100%;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.aside-container {
|
|
94
|
-
width: var(--rp-aside-width);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
@media (min-width: 1280px) {
|
|
99
|
-
.aside-container {
|
|
100
|
-
display: block;
|
|
101
|
-
width: var(--rp-aside-width);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.content {
|
|
105
|
-
padding: 48px 0 72px 0;
|
|
106
|
-
:global(.rspress-doc),
|
|
107
|
-
:global(.rspress-doc-footer) {
|
|
108
|
-
padding: 0 48px;
|
|
109
|
-
box-sizing: content-box;
|
|
110
|
-
width: calc(100vw - var(--rp-aside-width) - var(--rp-sidebar-width));
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
@media (min-width: 1440px) {
|
|
116
|
-
.docLayout {
|
|
117
|
-
width: 100%;
|
|
118
|
-
margin-left: 0;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.content {
|
|
122
|
-
:global(.rspress-doc),
|
|
123
|
-
:global(.rspress-doc-footer) {
|
|
124
|
-
box-sizing: content-box;
|
|
125
|
-
width: calc(100vw - var(--rp-sidebar-width) - var(--rp-aside-width));
|
|
126
|
-
padding: 0
|
|
127
|
-
max(
|
|
128
|
-
48px,
|
|
129
|
-
calc(
|
|
130
|
-
(100vw - var(--rp-sidebar-width) - var(--rp-aside-width) - 960px) /
|
|
131
|
-
2
|
|
132
|
-
)
|
|
133
|
-
);
|
|
134
|
-
max-width: 960px;
|
|
135
|
-
margin: auto;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
2
|
-
import { MDXProvider } from '@mdx-js/react';
|
|
3
|
-
import { getCustomMDXComponent } from '@theme';
|
|
4
|
-
import { Aside } from '../../components/Aside';
|
|
5
|
-
import { DocFooter } from '../../components/DocFooter';
|
|
6
|
-
import { useDisableNav, useLocaleSiteData } from '../../logic';
|
|
7
|
-
import { SideMenu } from '../../components/LocalSideBar';
|
|
8
|
-
import { Overview } from '../../components/Overview';
|
|
9
|
-
import { TabDataContext } from '../../logic/TabDataContext';
|
|
10
|
-
import { QueryStatus } from '../Layout';
|
|
11
|
-
import styles from './index.module.scss';
|
|
12
|
-
import { Content, useLocation, usePageData } from '@/runtime';
|
|
13
|
-
|
|
14
|
-
export interface DocLayoutProps {
|
|
15
|
-
beforeDocFooter?: React.ReactNode;
|
|
16
|
-
beforeDoc?: React.ReactNode;
|
|
17
|
-
afterDoc?: React.ReactNode;
|
|
18
|
-
beforeOutline?: React.ReactNode;
|
|
19
|
-
afterOutline?: React.ReactNode;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function DocLayout(props: DocLayoutProps) {
|
|
23
|
-
const { beforeDocFooter, beforeDoc, afterDoc, beforeOutline, afterOutline } =
|
|
24
|
-
props;
|
|
25
|
-
const { siteData, page } = usePageData();
|
|
26
|
-
const { toc = [], frontmatter } = page;
|
|
27
|
-
const [tabData, setTabData] = useState({});
|
|
28
|
-
const headers = toc;
|
|
29
|
-
const { themeConfig } = siteData;
|
|
30
|
-
const localesData = useLocaleSiteData();
|
|
31
|
-
const sidebar = localesData.sidebar || {};
|
|
32
|
-
const [disableNavbar] = useDisableNav();
|
|
33
|
-
// siderbar Priority
|
|
34
|
-
// 1. frontmatter.sidebar
|
|
35
|
-
// 2. themeConfig.locales.sidebar
|
|
36
|
-
// 3. themeConfig.sidebar
|
|
37
|
-
const hasSidebar =
|
|
38
|
-
frontmatter?.sidebar !== false && Object.keys(sidebar).length > 0;
|
|
39
|
-
|
|
40
|
-
const outlineTitle =
|
|
41
|
-
localesData?.outlineTitle || themeConfig?.outlineTitle || 'ON THIS PAGE';
|
|
42
|
-
const isOverviewPage = frontmatter?.overview ?? false;
|
|
43
|
-
const [hasFooter, setHasFooter] = useState(frontmatter?.footer ?? true);
|
|
44
|
-
const location = useLocation();
|
|
45
|
-
|
|
46
|
-
const getHasAside = () => {
|
|
47
|
-
// if in iframe, default value is false
|
|
48
|
-
const defaultHasAside =
|
|
49
|
-
typeof window === 'undefined' ? true : window.top === window.self;
|
|
50
|
-
return frontmatter?.outline ?? themeConfig?.outline ?? defaultHasAside;
|
|
51
|
-
};
|
|
52
|
-
const [hasAside, setHasAside] = useState(getHasAside());
|
|
53
|
-
|
|
54
|
-
useEffect(() => {
|
|
55
|
-
setHasAside(getHasAside());
|
|
56
|
-
}, [page, siteData]);
|
|
57
|
-
|
|
58
|
-
useEffect(() => {
|
|
59
|
-
const query = new URLSearchParams(location.search);
|
|
60
|
-
const footer = query.get('footer');
|
|
61
|
-
if (footer === QueryStatus.Hide) {
|
|
62
|
-
setHasFooter(false);
|
|
63
|
-
}
|
|
64
|
-
}, []);
|
|
65
|
-
|
|
66
|
-
const docContent = (
|
|
67
|
-
<TabDataContext.Provider value={{ tabData, setTabData }}>
|
|
68
|
-
<MDXProvider components={getCustomMDXComponent()}>
|
|
69
|
-
<Content />
|
|
70
|
-
</MDXProvider>
|
|
71
|
-
</TabDataContext.Provider>
|
|
72
|
-
);
|
|
73
|
-
|
|
74
|
-
return (
|
|
75
|
-
<div
|
|
76
|
-
className={`${styles.docLayout} pt-0`}
|
|
77
|
-
style={{
|
|
78
|
-
...(disableNavbar ? { marginTop: 0 } : {}),
|
|
79
|
-
}}
|
|
80
|
-
>
|
|
81
|
-
{beforeDoc}
|
|
82
|
-
{hasSidebar ? <SideMenu /> : null}
|
|
83
|
-
<div
|
|
84
|
-
className={`${styles.content} rspress-doc-container flex flex-shrink-0 mx-auto`}
|
|
85
|
-
>
|
|
86
|
-
<div className="w-full">
|
|
87
|
-
{isOverviewPage ? (
|
|
88
|
-
<div className="rspress-doc">
|
|
89
|
-
<Overview content={docContent} />
|
|
90
|
-
</div>
|
|
91
|
-
) : (
|
|
92
|
-
<div>
|
|
93
|
-
<div className="rspress-doc">{docContent}</div>
|
|
94
|
-
<div className="rspress-doc-footer">
|
|
95
|
-
{beforeDocFooter}
|
|
96
|
-
{hasFooter && <DocFooter />}
|
|
97
|
-
</div>
|
|
98
|
-
</div>
|
|
99
|
-
)}
|
|
100
|
-
</div>
|
|
101
|
-
|
|
102
|
-
{hasAside ? (
|
|
103
|
-
<div
|
|
104
|
-
className={styles.asideContainer}
|
|
105
|
-
style={{
|
|
106
|
-
...(disableNavbar
|
|
107
|
-
? {
|
|
108
|
-
marginTop: 0,
|
|
109
|
-
paddingTop: '32px',
|
|
110
|
-
}
|
|
111
|
-
: {}),
|
|
112
|
-
}}
|
|
113
|
-
>
|
|
114
|
-
<div>
|
|
115
|
-
{beforeOutline}
|
|
116
|
-
<Aside headers={headers} outlineTitle={outlineTitle} />
|
|
117
|
-
{afterOutline}
|
|
118
|
-
</div>
|
|
119
|
-
</div>
|
|
120
|
-
) : null}
|
|
121
|
-
</div>
|
|
122
|
-
{afterDoc}
|
|
123
|
-
</div>
|
|
124
|
-
);
|
|
125
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--rp-home-hero-name-color: transparent;
|
|
3
|
-
--rp-home-hero-name-background: -webkit-linear-gradient(
|
|
4
|
-
120deg,
|
|
5
|
-
var(--rp-c-brand) 30%,
|
|
6
|
-
#42d392
|
|
7
|
-
);
|
|
8
|
-
--rp-home-hero-image-background-image: none;
|
|
9
|
-
--rp-home-hero-image-filter: none;
|
|
10
|
-
--rp-home-feature-bg: #f9f9f9;
|
|
11
|
-
--rp-home-feature-hover-bg: linear-gradient(to bottom, #ededed, #f9f9f9);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.dark {
|
|
15
|
-
--rp-home-bg: #000;
|
|
16
|
-
--rp-home-feature-bg: #242424;
|
|
17
|
-
--rp-home-feature-hover-bg: #2f2f2f;
|
|
18
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { HomeFooter } from '@theme';
|
|
2
|
-
import { HomeHero } from '../../components/HomeHero';
|
|
3
|
-
import { HomeFeature } from '../../components/HomeFeatures';
|
|
4
|
-
import './index.css';
|
|
5
|
-
import { usePageData } from '@/runtime';
|
|
6
|
-
|
|
7
|
-
export interface HomeLayoutProps {
|
|
8
|
-
beforeHero?: React.ReactNode;
|
|
9
|
-
afterHero?: React.ReactNode;
|
|
10
|
-
beforeFeatures?: React.ReactNode;
|
|
11
|
-
afterFeatures?: React.ReactNode;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function HomeLayout(props: HomeLayoutProps) {
|
|
15
|
-
const { beforeHero, afterHero, beforeFeatures, afterFeatures } = props;
|
|
16
|
-
const {
|
|
17
|
-
page: { frontmatter },
|
|
18
|
-
} = usePageData();
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<div
|
|
22
|
-
className="relative"
|
|
23
|
-
style={{
|
|
24
|
-
minHeight: 'calc(100vh - var(--rp-nav-height))',
|
|
25
|
-
paddingBottom: '80px',
|
|
26
|
-
}}
|
|
27
|
-
>
|
|
28
|
-
<div className="pb-12">
|
|
29
|
-
{beforeHero}
|
|
30
|
-
<HomeHero frontmatter={frontmatter} />
|
|
31
|
-
{afterHero}
|
|
32
|
-
{beforeFeatures}
|
|
33
|
-
<HomeFeature frontmatter={frontmatter} />
|
|
34
|
-
{afterFeatures}
|
|
35
|
-
</div>
|
|
36
|
-
<HomeFooter />
|
|
37
|
-
</div>
|
|
38
|
-
);
|
|
39
|
-
}
|