@docusaurus/theme-classic 2.0.0-beta.14 → 2.0.0-beta.15
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/README.md +1 -1
- package/lib/index.js +7 -16
- package/lib/theme-classic.d.ts +89 -182
- package/lib/validateThemeConfig.js +13 -1
- package/lib-next/theme/BackToTopButton/styles.module.css +1 -1
- package/lib-next/theme/BlogListPaginator/index.js +12 -12
- package/lib-next/theme/BlogPostAuthor/index.js +1 -1
- package/lib-next/theme/BlogPostAuthors/index.js +12 -2
- package/lib-next/theme/BlogPostAuthors/styles.module.css +10 -0
- package/lib-next/theme/BlogPostItem/index.js +12 -15
- package/lib-next/theme/BlogPostPage/index.js +10 -7
- package/lib-next/theme/BlogPostPaginator/index.js +11 -15
- package/lib-next/theme/BlogSidebar/styles.module.css +2 -0
- package/lib-next/theme/CodeBlock/index.js +44 -9
- package/lib-next/theme/CodeBlock/styles.module.css +12 -7
- package/lib-next/theme/DocCard/styles.module.css +3 -3
- package/lib-next/theme/DocCategoryGeneratedIndexPage/index.js +6 -3
- package/lib-next/theme/DocItem/index.js +9 -6
- package/lib-next/theme/DocItem/styles.module.css +2 -2
- package/lib-next/theme/DocPage/index.js +7 -3
- package/lib-next/theme/DocPage/styles.module.css +1 -0
- package/lib-next/theme/DocPaginator/index.js +26 -4
- package/lib-next/theme/DocSidebar/index.js +2 -2
- package/lib-next/theme/DocSidebar/styles.module.css +1 -0
- package/lib-next/theme/DocSidebarItem/index.js +43 -21
- package/lib-next/theme/DocSidebarItem/styles.module.css +1 -0
- package/lib-next/theme/DocSidebarItems/index.js +28 -0
- package/{src/theme/hooks/styles.css → lib-next/theme/DocSidebarItems/styles.module.css} +12 -2
- package/lib-next/theme/DocVersionBanner/index.js +4 -1
- package/lib-next/theme/Footer/styles.module.css +2 -1
- package/lib-next/theme/Heading/index.js +39 -42
- package/lib-next/theme/Heading/styles.css +1 -1
- package/lib-next/theme/Layout/index.js +1 -2
- package/lib-next/theme/LayoutHead/index.js +5 -9
- package/lib-next/theme/LayoutProviders/index.js +6 -6
- package/lib-next/theme/MDXComponents/index.js +18 -31
- package/lib-next/theme/MDXComponents/styles.css +4 -0
- package/lib-next/theme/MDXPage/index.js +3 -10
- package/lib-next/theme/Navbar/index.js +6 -6
- package/lib-next/theme/NavbarItem/DefaultNavbarItem.js +4 -66
- package/lib-next/theme/NavbarItem/DocNavbarItem.js +5 -2
- package/lib-next/theme/NavbarItem/DocSidebarNavbarItem.js +73 -0
- package/lib-next/theme/NavbarItem/DocsVersionDropdownNavbarItem.js +5 -3
- package/lib-next/theme/NavbarItem/DocsVersionNavbarItem.js +4 -1
- package/lib-next/theme/NavbarItem/DropdownNavbarItem.js +5 -5
- package/lib-next/theme/NavbarItem/NavbarNavLink.js +70 -0
- package/lib-next/theme/NavbarItem/index.js +1 -2
- package/lib-next/theme/{hooks/styles.css → NavbarItem/utils.js} +3 -4
- package/lib-next/theme/PaginatorNavLink/index.js +20 -0
- package/lib-next/theme/SkipToContent/index.js +1 -1
- package/lib-next/theme/SkipToContent/styles.module.css +7 -0
- package/lib-next/theme/TOCCollapsible/styles.module.css +2 -2
- package/lib-next/theme/Tabs/__tests__/index.test.js +8 -6
- package/lib-next/theme/Tabs/index.js +6 -3
- package/lib-next/theme/Tag/styles.module.css +4 -4
- package/lib-next/theme/ThemedImage/index.js +2 -2
- package/lib-next/theme/Toggle/styles.module.css +16 -15
- package/lib-next/theme/prism-include-languages.js +10 -3
- package/package.json +16 -17
- package/src/index.ts +10 -21
- package/src/theme/Admonition/index.tsx +1 -1
- package/src/theme/BackToTopButton/styles.module.css +1 -1
- package/src/theme/BlogListPaginator/index.tsx +12 -12
- package/src/theme/BlogPostAuthor/index.tsx +1 -1
- package/src/theme/BlogPostAuthors/index.tsx +12 -2
- package/src/theme/BlogPostAuthors/styles.module.css +10 -0
- package/src/theme/BlogPostItem/index.tsx +13 -15
- package/src/theme/BlogPostPage/index.tsx +10 -7
- package/src/theme/BlogPostPaginator/index.tsx +11 -15
- package/src/theme/BlogSidebar/styles.module.css +2 -0
- package/src/theme/CodeBlock/index.tsx +45 -10
- package/src/theme/CodeBlock/styles.module.css +12 -7
- package/src/theme/DocCard/index.tsx +2 -2
- package/src/theme/DocCard/styles.module.css +3 -3
- package/src/theme/DocCardList/index.tsx +1 -1
- package/src/theme/DocCategoryGeneratedIndexPage/index.tsx +7 -3
- package/src/theme/DocItem/index.tsx +9 -6
- package/src/theme/DocItem/styles.module.css +2 -2
- package/src/theme/DocItemFooter/index.tsx +1 -1
- package/src/theme/DocPage/index.tsx +8 -4
- package/src/theme/DocPage/styles.module.css +1 -0
- package/src/theme/DocPaginator/index.tsx +26 -4
- package/src/theme/DocSidebar/index.tsx +3 -3
- package/src/theme/DocSidebar/styles.module.css +1 -0
- package/src/theme/DocSidebarItem/index.tsx +34 -23
- package/src/theme/DocSidebarItem/styles.module.css +1 -0
- package/src/theme/DocSidebarItems/index.tsx +32 -0
- package/src/theme/{UserPreferencesContext.ts → DocSidebarItems/styles.module.css} +11 -3
- package/src/theme/DocVersionBanner/index.tsx +3 -3
- package/src/theme/Footer/index.tsx +4 -4
- package/src/theme/Footer/styles.module.css +2 -1
- package/src/theme/Heading/index.tsx +39 -46
- package/src/theme/Heading/styles.css +1 -1
- package/src/theme/Layout/index.tsx +1 -2
- package/src/theme/LayoutHead/index.tsx +4 -8
- package/src/theme/LayoutProviders/index.tsx +6 -6
- package/src/theme/MDXComponents/index.tsx +26 -37
- package/src/theme/MDXComponents/styles.css +4 -0
- package/src/theme/MDXPage/index.tsx +3 -11
- package/src/theme/Navbar/index.tsx +7 -7
- package/src/theme/NavbarItem/DefaultNavbarItem.tsx +6 -62
- package/src/theme/NavbarItem/DocNavbarItem.tsx +8 -5
- package/src/theme/NavbarItem/DocSidebarNavbarItem.tsx +84 -0
- package/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx +9 -6
- package/src/theme/NavbarItem/DocsVersionNavbarItem.tsx +2 -2
- package/src/theme/NavbarItem/DropdownNavbarItem.tsx +5 -5
- package/src/theme/NavbarItem/NavbarNavLink.tsx +68 -0
- package/src/theme/NavbarItem/index.tsx +3 -5
- package/{lib-next/theme/UserPreferencesContext.js → src/theme/NavbarItem/utils.ts} +4 -3
- package/src/theme/PaginatorNavLink/index.tsx +22 -0
- package/src/theme/SkipToContent/index.tsx +1 -1
- package/src/theme/SkipToContent/styles.module.css +7 -0
- package/src/theme/TOCCollapsible/styles.module.css +2 -2
- package/src/theme/TOCItems/index.tsx +2 -2
- package/src/theme/Tabs/index.tsx +7 -4
- package/src/theme/Tag/styles.module.css +4 -4
- package/src/theme/TagsListByLetter/index.tsx +1 -1
- package/src/theme/ThemedImage/index.tsx +2 -2
- package/src/theme/Toggle/index.tsx +1 -1
- package/src/theme/Toggle/styles.module.css +16 -15
- package/src/theme/prism-include-languages.ts +10 -3
- package/src/theme-classic.d.ts +89 -182
- package/src/translations.ts +2 -2
- package/src/validateThemeConfig.ts +16 -0
- package/lib-next/theme/DocPaginatorNavLink/index.js +0 -36
- package/lib-next/theme/ThemeContext.js +0 -9
- package/lib-next/theme/ThemeProvider/index.js +0 -28
- package/lib-next/theme/UserPreferencesProvider/index.js +0 -27
- package/lib-next/theme/hooks/useDocs.js +0 -10
- package/lib-next/theme/hooks/useHideableNavbar.js +0 -66
- package/lib-next/theme/hooks/useKeyboardNavigation.js +0 -35
- package/lib-next/theme/hooks/useLockBodyScroll.js +0 -18
- package/lib-next/theme/hooks/usePrismTheme.js +0 -20
- package/lib-next/theme/hooks/useTabGroupChoice.js +0 -39
- package/lib-next/theme/hooks/useTheme.js +0 -81
- package/lib-next/theme/hooks/useThemeContext.js +0 -22
- package/lib-next/theme/hooks/useUserPreferencesContext.js +0 -22
- package/lib-next/theme/hooks/useWindowSize.js +0 -59
- package/src/theme/DocPaginatorNavLink/index.tsx +0 -38
- package/src/theme/ThemeContext.ts +0 -15
- package/src/theme/ThemeProvider/index.tsx +0 -28
- package/src/theme/UserPreferencesProvider/index.tsx +0 -30
- package/src/theme/hooks/useDocs.ts +0 -11
- package/src/theme/hooks/useHideableNavbar.ts +0 -72
- package/src/theme/hooks/useKeyboardNavigation.ts +0 -39
- package/src/theme/hooks/useLockBodyScroll.ts +0 -20
- package/src/theme/hooks/usePrismTheme.ts +0 -22
- package/src/theme/hooks/useTabGroupChoice.ts +0 -46
- package/src/theme/hooks/useTheme.ts +0 -91
- package/src/theme/hooks/useThemeContext.ts +0 -23
- package/src/theme/hooks/useUserPreferencesContext.ts +0 -25
- package/src/theme/hooks/useWindowSize.ts +0 -69
|
@@ -12,6 +12,7 @@ import Translate, {translate} from '@docusaurus/Translate';
|
|
|
12
12
|
import Link from '@docusaurus/Link';
|
|
13
13
|
import {useBaseUrlUtils} from '@docusaurus/useBaseUrl';
|
|
14
14
|
import {usePluralForm} from '@docusaurus/theme-common';
|
|
15
|
+
import {blogPostContainerID} from '@docusaurus/utils-common';
|
|
15
16
|
import MDXComponents from '@theme/MDXComponents';
|
|
16
17
|
import EditThisPage from '@theme/EditThisPage';
|
|
17
18
|
import type {Props} from '@theme/BlogPostItem';
|
|
@@ -65,11 +66,14 @@ function BlogPostItem(props: Props): JSX.Element {
|
|
|
65
66
|
const image = assets.image ?? frontMatter.image;
|
|
66
67
|
const truncatedPost = !isBlogPostPage && truncated;
|
|
67
68
|
const tagsExists = tags.length > 0;
|
|
69
|
+
const TitleHeading = isBlogPostPage ? 'h1' : 'h2';
|
|
68
70
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
return (
|
|
72
|
+
<article
|
|
73
|
+
className={!isBlogPostPage ? 'margin-bottom--xl' : undefined}
|
|
74
|
+
itemProp="blogPost"
|
|
75
|
+
itemScope
|
|
76
|
+
itemType="http://schema.org/BlogPosting">
|
|
73
77
|
<header>
|
|
74
78
|
<TitleHeading className={styles.blogPostTitle} itemProp="headline">
|
|
75
79
|
{isBlogPostPage ? (
|
|
@@ -94,22 +98,16 @@ function BlogPostItem(props: Props): JSX.Element {
|
|
|
94
98
|
</div>
|
|
95
99
|
<BlogPostAuthors authors={authors} assets={assets} />
|
|
96
100
|
</header>
|
|
97
|
-
);
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
return (
|
|
101
|
-
<article
|
|
102
|
-
className={!isBlogPostPage ? 'margin-bottom--xl' : undefined}
|
|
103
|
-
itemProp="blogPost"
|
|
104
|
-
itemScope
|
|
105
|
-
itemType="http://schema.org/BlogPosting">
|
|
106
|
-
{renderPostHeader()}
|
|
107
101
|
|
|
108
102
|
{image && (
|
|
109
103
|
<meta itemProp="image" content={withBaseUrl(image, {absolute: true})} />
|
|
110
104
|
)}
|
|
111
105
|
|
|
112
|
-
<div
|
|
106
|
+
<div
|
|
107
|
+
// This ID is used for the feed generation to locate the main content
|
|
108
|
+
id={isBlogPostPage ? blogPostContainerID : undefined}
|
|
109
|
+
className="markdown"
|
|
110
|
+
itemProp="articleBody">
|
|
113
111
|
<MDXProvider components={MDXComponents}>{children}</MDXProvider>
|
|
114
112
|
</div>
|
|
115
113
|
|
|
@@ -16,14 +16,17 @@ import TOC from '@theme/TOC';
|
|
|
16
16
|
|
|
17
17
|
function BlogPostPage(props: Props): JSX.Element {
|
|
18
18
|
const {content: BlogPostContents, sidebar} = props;
|
|
19
|
+
const {assets, metadata} = BlogPostContents;
|
|
19
20
|
const {
|
|
20
|
-
|
|
21
|
+
title,
|
|
22
|
+
description,
|
|
23
|
+
nextItem,
|
|
24
|
+
prevItem,
|
|
25
|
+
date,
|
|
26
|
+
tags,
|
|
27
|
+
authors,
|
|
21
28
|
frontMatter,
|
|
22
|
-
|
|
23
|
-
metadata,
|
|
24
|
-
} = BlogPostContents;
|
|
25
|
-
const {title, description, nextItem, prevItem, date, tags, authors} =
|
|
26
|
-
metadata;
|
|
29
|
+
} = metadata;
|
|
27
30
|
const {
|
|
28
31
|
hide_table_of_contents: hideTableOfContents,
|
|
29
32
|
keywords,
|
|
@@ -59,7 +62,7 @@ function BlogPostPage(props: Props): JSX.Element {
|
|
|
59
62
|
<meta property="og:type" content="article" />
|
|
60
63
|
<meta property="article:published_time" content={date} />
|
|
61
64
|
|
|
62
|
-
{/* TODO double check those article
|
|
65
|
+
{/* TODO double check those article meta array syntaxes, see https://ogp.me/#array */}
|
|
63
66
|
{authors.some((author) => author.url) && (
|
|
64
67
|
<meta
|
|
65
68
|
property="article:author"
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import Translate, {translate} from '@docusaurus/Translate';
|
|
10
|
-
import
|
|
10
|
+
import PaginatorNavLink from '@theme/PaginatorNavLink';
|
|
11
11
|
import type {Props} from '@theme/BlogPostPaginator';
|
|
12
12
|
|
|
13
13
|
function BlogPostPaginator(props: Props): JSX.Element {
|
|
@@ -23,34 +23,30 @@ function BlogPostPaginator(props: Props): JSX.Element {
|
|
|
23
23
|
})}>
|
|
24
24
|
<div className="pagination-nav__item">
|
|
25
25
|
{prevItem && (
|
|
26
|
-
<
|
|
27
|
-
|
|
26
|
+
<PaginatorNavLink
|
|
27
|
+
{...prevItem}
|
|
28
|
+
subLabel={
|
|
28
29
|
<Translate
|
|
29
30
|
id="theme.blog.post.paginator.newerPost"
|
|
30
31
|
description="The blog post button label to navigate to the newer/previous post">
|
|
31
32
|
Newer Post
|
|
32
33
|
</Translate>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
« {prevItem.title}
|
|
36
|
-
</div>
|
|
37
|
-
</Link>
|
|
34
|
+
}
|
|
35
|
+
/>
|
|
38
36
|
)}
|
|
39
37
|
</div>
|
|
40
38
|
<div className="pagination-nav__item pagination-nav__item--next">
|
|
41
39
|
{nextItem && (
|
|
42
|
-
<
|
|
43
|
-
|
|
40
|
+
<PaginatorNavLink
|
|
41
|
+
{...nextItem}
|
|
42
|
+
subLabel={
|
|
44
43
|
<Translate
|
|
45
44
|
id="theme.blog.post.paginator.olderPost"
|
|
46
45
|
description="The blog post button label to navigate to the older/next post">
|
|
47
46
|
Older Post
|
|
48
47
|
</Translate>
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
{nextItem.title} »
|
|
52
|
-
</div>
|
|
53
|
-
</Link>
|
|
48
|
+
}
|
|
49
|
+
/>
|
|
54
50
|
)}
|
|
55
51
|
</div>
|
|
56
52
|
</nav>
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import React, {useEffect, useState} from 'react';
|
|
8
|
+
import React, {isValidElement, useEffect, useState} from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
-
import Highlight, {defaultProps, Language} from 'prism-react-renderer';
|
|
10
|
+
import Highlight, {defaultProps, type Language} from 'prism-react-renderer';
|
|
11
11
|
import copy from 'copy-text-to-clipboard';
|
|
12
12
|
import Translate, {translate} from '@docusaurus/Translate';
|
|
13
13
|
import {
|
|
@@ -16,17 +16,18 @@ import {
|
|
|
16
16
|
parseLanguage,
|
|
17
17
|
parseLines,
|
|
18
18
|
ThemeClassNames,
|
|
19
|
+
usePrismTheme,
|
|
19
20
|
} from '@docusaurus/theme-common';
|
|
20
|
-
import usePrismTheme from '@theme/hooks/usePrismTheme';
|
|
21
21
|
import type {Props} from '@theme/CodeBlock';
|
|
22
22
|
|
|
23
23
|
import styles from './styles.module.css';
|
|
24
24
|
|
|
25
25
|
export default function CodeBlock({
|
|
26
26
|
children,
|
|
27
|
-
className: blockClassName,
|
|
27
|
+
className: blockClassName = '',
|
|
28
28
|
metastring,
|
|
29
29
|
title,
|
|
30
|
+
language: languageProp,
|
|
30
31
|
}: Props): JSX.Element {
|
|
31
32
|
const {prism} = useThemeConfig();
|
|
32
33
|
|
|
@@ -43,19 +44,49 @@ export default function CodeBlock({
|
|
|
43
44
|
setMounted(true);
|
|
44
45
|
}, []);
|
|
45
46
|
|
|
46
|
-
//
|
|
47
|
-
//
|
|
48
|
-
//
|
|
47
|
+
// We still parse the metastring in case we want to support more syntax in the
|
|
48
|
+
// future. Note that MDX doesn't strip quotes when parsing metastring:
|
|
49
|
+
// "title=\"xyz\"" => title: "\"xyz\""
|
|
49
50
|
const codeBlockTitle = parseCodeBlockTitle(metastring) || title;
|
|
50
51
|
const prismTheme = usePrismTheme();
|
|
51
52
|
|
|
52
|
-
//
|
|
53
|
+
// <pre> tags in markdown map to CodeBlocks and they may contain JSX children.
|
|
54
|
+
// When the children is not a simple string, we just return a styled block without actually highlighting.
|
|
55
|
+
if (React.Children.toArray(children).some((el) => isValidElement(el))) {
|
|
56
|
+
return (
|
|
57
|
+
<Highlight
|
|
58
|
+
{...defaultProps}
|
|
59
|
+
key={String(mounted)}
|
|
60
|
+
theme={prismTheme}
|
|
61
|
+
code=""
|
|
62
|
+
language={'text' as Language}>
|
|
63
|
+
{({className, style}) => (
|
|
64
|
+
<pre
|
|
65
|
+
/* eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex */
|
|
66
|
+
tabIndex={0}
|
|
67
|
+
className={clsx(
|
|
68
|
+
className,
|
|
69
|
+
styles.codeBlockStandalone,
|
|
70
|
+
'thin-scrollbar',
|
|
71
|
+
styles.codeBlockContainer,
|
|
72
|
+
blockClassName,
|
|
73
|
+
ThemeClassNames.common.codeBlock,
|
|
74
|
+
)}
|
|
75
|
+
style={style}>
|
|
76
|
+
<code className={styles.codeBlockLines}>{children}</code>
|
|
77
|
+
</pre>
|
|
78
|
+
)}
|
|
79
|
+
</Highlight>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// The children is now guaranteed to be one/more plain strings
|
|
53
84
|
const content = Array.isArray(children)
|
|
54
85
|
? children.join('')
|
|
55
86
|
: (children as string);
|
|
56
87
|
|
|
57
88
|
const language =
|
|
58
|
-
parseLanguage(blockClassName) ??
|
|
89
|
+
languageProp ?? parseLanguage(blockClassName) ?? prism.defaultLanguage;
|
|
59
90
|
const {highlightLines, code} = parseLines(content, metastring, language);
|
|
60
91
|
|
|
61
92
|
const handleCopyCode = () => {
|
|
@@ -71,12 +102,16 @@ export default function CodeBlock({
|
|
|
71
102
|
key={String(mounted)}
|
|
72
103
|
theme={prismTheme}
|
|
73
104
|
code={code}
|
|
74
|
-
language={language}>
|
|
105
|
+
language={(language ?? 'text') as Language}>
|
|
75
106
|
{({className, style, tokens, getLineProps, getTokenProps}) => (
|
|
76
107
|
<div
|
|
77
108
|
className={clsx(
|
|
78
109
|
styles.codeBlockContainer,
|
|
79
110
|
blockClassName,
|
|
111
|
+
{
|
|
112
|
+
[`language-${language}`]:
|
|
113
|
+
language && !blockClassName.includes(`language-${language}`),
|
|
114
|
+
},
|
|
80
115
|
ThemeClassNames.common.codeBlock,
|
|
81
116
|
)}>
|
|
82
117
|
{codeBlockTitle && (
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
.codeBlockContent {
|
|
15
15
|
position: relative;
|
|
16
|
-
/*rtl:ignore*/
|
|
16
|
+
/* rtl:ignore */
|
|
17
17
|
direction: ltr;
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -26,19 +26,24 @@
|
|
|
26
26
|
border-top-right-radius: var(--ifm-global-radius);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
.codeBlock {
|
|
30
|
+
margin: 0;
|
|
31
|
+
padding: 0;
|
|
32
|
+
border-radius: var(--ifm-global-radius);
|
|
33
|
+
}
|
|
34
|
+
|
|
29
35
|
.codeBlockTitle + .codeBlockContent .codeBlock {
|
|
30
36
|
border-top-left-radius: 0;
|
|
31
37
|
border-top-right-radius: 0;
|
|
32
38
|
}
|
|
33
39
|
|
|
34
|
-
.
|
|
35
|
-
margin: 0;
|
|
40
|
+
.codeBlockStandalone {
|
|
36
41
|
padding: 0;
|
|
37
42
|
border-radius: var(--ifm-global-radius);
|
|
38
43
|
}
|
|
39
44
|
|
|
40
45
|
.copyButton {
|
|
41
|
-
background:
|
|
46
|
+
background: rgb(0 0 0 / 30%);
|
|
42
47
|
border-radius: var(--ifm-global-radius);
|
|
43
48
|
color: var(--ifm-color-white);
|
|
44
49
|
opacity: 0;
|
|
@@ -50,15 +55,15 @@
|
|
|
50
55
|
transition: opacity 200ms ease-in-out;
|
|
51
56
|
}
|
|
52
57
|
|
|
53
|
-
.
|
|
58
|
+
.copyButton:focus,
|
|
54
59
|
.codeBlockContent:hover > .copyButton,
|
|
55
|
-
.
|
|
60
|
+
.codeBlockTitle:hover + .codeBlockContent .copyButton {
|
|
56
61
|
opacity: 1;
|
|
57
62
|
}
|
|
58
63
|
|
|
59
64
|
.codeBlockLines {
|
|
60
65
|
font: inherit;
|
|
61
|
-
/*rtl:ignore*/
|
|
66
|
+
/* rtl:ignore */
|
|
62
67
|
float: left;
|
|
63
68
|
min-width: 100%;
|
|
64
69
|
padding: var(--ifm-pre-padding);
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import React, {ReactNode} from 'react';
|
|
8
|
+
import React, {type ReactNode} from 'react';
|
|
9
9
|
import Link from '@docusaurus/Link';
|
|
10
|
-
import {
|
|
10
|
+
import type {
|
|
11
11
|
PropSidebarItemCategory,
|
|
12
12
|
PropSidebarItemLink,
|
|
13
13
|
} from '@docusaurus/plugin-content-docs';
|
|
@@ -7,14 +7,13 @@
|
|
|
7
7
|
|
|
8
8
|
.cardContainer {
|
|
9
9
|
height: 8rem;
|
|
10
|
-
|
|
11
10
|
color: var(--ifm-color-emphasis-800);
|
|
12
11
|
--ifm-link-color: var(--ifm-color-emphasis-800);
|
|
13
12
|
--ifm-link-hover-color: var(--ifm-color-emphasis-800);
|
|
14
13
|
--ifm-link-hover-decoration: none;
|
|
15
14
|
|
|
16
15
|
/* box-shadow: var(--ifm-global-shadow-lw); */
|
|
17
|
-
box-shadow: 0 1.5px 3px 0
|
|
16
|
+
box-shadow: 0 1.5px 3px 0 rgb(0 0 0 / 15%);
|
|
18
17
|
border: 1px solid var(--ifm-color-emphasis-200);
|
|
19
18
|
transition: box-shadow var(--ifm-transition-fast) ease,
|
|
20
19
|
background-color var(--ifm-transition-fast) ease;
|
|
@@ -22,8 +21,9 @@
|
|
|
22
21
|
|
|
23
22
|
.cardContainer.cardContainerLink:hover {
|
|
24
23
|
/* box-shadow: var(--ifm-global-shadow-md); */
|
|
25
|
-
box-shadow: 0 4px 8px 0
|
|
24
|
+
box-shadow: 0 4px 8px 0 rgb(0 0 0 / 20%);
|
|
26
25
|
}
|
|
26
|
+
|
|
27
27
|
html[data-theme='dark'] .cardContainer.cardContainerLink:hover {
|
|
28
28
|
--ifm-card-background-color: #2d2d2d; /* original, non-hovered color is #242526 */
|
|
29
29
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
|
|
10
10
|
import DocCard from '@theme/DocCard';
|
|
11
|
-
import {PropSidebarItem} from '@docusaurus/plugin-content-docs';
|
|
11
|
+
import type {PropSidebarItem} from '@docusaurus/plugin-content-docs';
|
|
12
12
|
|
|
13
13
|
export default function DocCardList({
|
|
14
14
|
items,
|
|
@@ -13,7 +13,8 @@ import DocPaginator from '@theme/DocPaginator';
|
|
|
13
13
|
import Seo from '@theme/Seo';
|
|
14
14
|
import DocVersionBanner from '@theme/DocVersionBanner';
|
|
15
15
|
import DocVersionBadge from '@theme/DocVersionBadge';
|
|
16
|
-
import
|
|
16
|
+
import Heading from '@theme/Heading';
|
|
17
|
+
import useBaseUrl from '@docusaurus/useBaseUrl';
|
|
17
18
|
|
|
18
19
|
import styles from './styles.module.css';
|
|
19
20
|
|
|
@@ -26,14 +27,17 @@ export default function DocCategoryGeneratedIndexPage({
|
|
|
26
27
|
<Seo
|
|
27
28
|
title={categoryGeneratedIndex.title}
|
|
28
29
|
description={categoryGeneratedIndex.description}
|
|
30
|
+
keywords={categoryGeneratedIndex.keywords}
|
|
31
|
+
// TODO `require` this?
|
|
32
|
+
image={useBaseUrl(categoryGeneratedIndex.image)}
|
|
29
33
|
/>
|
|
30
34
|
<div className={styles.generatedIndexPage}>
|
|
31
35
|
<DocVersionBanner />
|
|
32
36
|
<DocVersionBadge />
|
|
33
37
|
<header>
|
|
34
|
-
<
|
|
38
|
+
<Heading as="h1" className={styles.title}>
|
|
35
39
|
{categoryGeneratedIndex.title}
|
|
36
|
-
</
|
|
40
|
+
</Heading>
|
|
37
41
|
{categoryGeneratedIndex.description && (
|
|
38
42
|
<p>{categoryGeneratedIndex.description}</p>
|
|
39
43
|
)}
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
-
import useWindowSize from '@theme/hooks/useWindowSize';
|
|
11
10
|
import DocPaginator from '@theme/DocPaginator';
|
|
12
11
|
import DocVersionBanner from '@theme/DocVersionBanner';
|
|
13
12
|
import DocVersionBadge from '@theme/DocVersionBadge';
|
|
@@ -16,9 +15,9 @@ import type {Props} from '@theme/DocItem';
|
|
|
16
15
|
import DocItemFooter from '@theme/DocItemFooter';
|
|
17
16
|
import TOC from '@theme/TOC';
|
|
18
17
|
import TOCCollapsible from '@theme/TOCCollapsible';
|
|
19
|
-
import
|
|
18
|
+
import Heading from '@theme/Heading';
|
|
20
19
|
import styles from './styles.module.css';
|
|
21
|
-
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
20
|
+
import {ThemeClassNames, useWindowSize} from '@docusaurus/theme-common';
|
|
22
21
|
|
|
23
22
|
export default function DocItem(props: Props): JSX.Element {
|
|
24
23
|
const {content: DocContent} = props;
|
|
@@ -34,7 +33,7 @@ export default function DocItem(props: Props): JSX.Element {
|
|
|
34
33
|
const {description, title} = metadata;
|
|
35
34
|
|
|
36
35
|
// We only add a title if:
|
|
37
|
-
// - user asks to hide it with
|
|
36
|
+
// - user asks to hide it with front matter
|
|
38
37
|
// - the markdown content does not already contain a top-level h1 heading
|
|
39
38
|
const shouldAddTitle =
|
|
40
39
|
!hideTitle && typeof DocContent.contentTitle === 'undefined';
|
|
@@ -76,11 +75,15 @@ export default function DocItem(props: Props): JSX.Element {
|
|
|
76
75
|
<div
|
|
77
76
|
className={clsx(ThemeClassNames.docs.docMarkdown, 'markdown')}>
|
|
78
77
|
{/*
|
|
79
|
-
Title can be declared inside md content or declared through
|
|
78
|
+
Title can be declared inside md content or declared through front matter and added manually
|
|
80
79
|
To make both cases consistent, the added title is added under the same div.markdown block
|
|
81
80
|
See https://github.com/facebook/docusaurus/pull/4882#issuecomment-853021120
|
|
82
81
|
*/}
|
|
83
|
-
{shouldAddTitle &&
|
|
82
|
+
{shouldAddTitle && (
|
|
83
|
+
<header>
|
|
84
|
+
<Heading as="h1">{title}</Heading>
|
|
85
|
+
</header>
|
|
86
|
+
)}
|
|
84
87
|
|
|
85
88
|
<DocContent />
|
|
86
89
|
</div>
|
|
@@ -12,7 +12,7 @@ import LastUpdated from '@theme/LastUpdated';
|
|
|
12
12
|
import type {Props} from '@theme/DocItem';
|
|
13
13
|
import EditThisPage from '@theme/EditThisPage';
|
|
14
14
|
import TagsListInline, {
|
|
15
|
-
Props as TagsListInlineProps,
|
|
15
|
+
type Props as TagsListInlineProps,
|
|
16
16
|
} from '@theme/TagsListInline';
|
|
17
17
|
|
|
18
18
|
import styles from './styles.module.css';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import React, {ReactNode, useState, useCallback} from 'react';
|
|
8
|
+
import React, {type ReactNode, useState, useCallback} from 'react';
|
|
9
9
|
import {MDXProvider} from '@mdx-js/react';
|
|
10
10
|
|
|
11
11
|
import renderRoutes from '@docusaurus/renderRoutes';
|
|
@@ -70,9 +70,13 @@ function DocPageContent({
|
|
|
70
70
|
|
|
71
71
|
{sidebar && (
|
|
72
72
|
<aside
|
|
73
|
-
className={clsx(
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
className={clsx(
|
|
74
|
+
ThemeClassNames.docs.docSidebarContainer,
|
|
75
|
+
styles.docSidebarContainer,
|
|
76
|
+
{
|
|
77
|
+
[styles.docSidebarContainerHidden]: hiddenSidebarContainer,
|
|
78
|
+
},
|
|
79
|
+
)}
|
|
76
80
|
onTransitionEnd={(e) => {
|
|
77
81
|
if (
|
|
78
82
|
!e.currentTarget.classList.contains(styles.docSidebarContainer)
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
|
-
import {translate} from '@docusaurus/Translate';
|
|
10
|
-
import
|
|
9
|
+
import Translate, {translate} from '@docusaurus/Translate';
|
|
10
|
+
import PaginatorNavLink from '@theme/PaginatorNavLink';
|
|
11
11
|
import type {Props} from '@theme/DocPaginator';
|
|
12
12
|
|
|
13
13
|
function DocPaginator(props: Props): JSX.Element {
|
|
@@ -22,10 +22,32 @@ function DocPaginator(props: Props): JSX.Element {
|
|
|
22
22
|
description: 'The ARIA label for the docs pagination',
|
|
23
23
|
})}>
|
|
24
24
|
<div className="pagination-nav__item">
|
|
25
|
-
{previous &&
|
|
25
|
+
{previous && (
|
|
26
|
+
<PaginatorNavLink
|
|
27
|
+
{...previous}
|
|
28
|
+
subLabel={
|
|
29
|
+
<Translate
|
|
30
|
+
id="theme.docs.paginator.previous"
|
|
31
|
+
description="The label used to navigate to the previous doc">
|
|
32
|
+
Previous
|
|
33
|
+
</Translate>
|
|
34
|
+
}
|
|
35
|
+
/>
|
|
36
|
+
)}
|
|
26
37
|
</div>
|
|
27
38
|
<div className="pagination-nav__item pagination-nav__item--next">
|
|
28
|
-
{next &&
|
|
39
|
+
{next && (
|
|
40
|
+
<PaginatorNavLink
|
|
41
|
+
{...next}
|
|
42
|
+
subLabel={
|
|
43
|
+
<Translate
|
|
44
|
+
id="theme.docs.paginator.next"
|
|
45
|
+
description="The label used to navigate to the next doc">
|
|
46
|
+
Next
|
|
47
|
+
</Translate>
|
|
48
|
+
}
|
|
49
|
+
/>
|
|
50
|
+
)}
|
|
29
51
|
</div>
|
|
30
52
|
</nav>
|
|
31
53
|
);
|
|
@@ -11,15 +11,15 @@ import {
|
|
|
11
11
|
useThemeConfig,
|
|
12
12
|
useAnnouncementBar,
|
|
13
13
|
MobileSecondaryMenuFiller,
|
|
14
|
-
MobileSecondaryMenuComponent,
|
|
14
|
+
type MobileSecondaryMenuComponent,
|
|
15
15
|
ThemeClassNames,
|
|
16
16
|
useScrollPosition,
|
|
17
|
+
useWindowSize,
|
|
17
18
|
} from '@docusaurus/theme-common';
|
|
18
|
-
import useWindowSize from '@theme/hooks/useWindowSize';
|
|
19
19
|
import Logo from '@theme/Logo';
|
|
20
20
|
import IconArrow from '@theme/IconArrow';
|
|
21
21
|
import {translate} from '@docusaurus/Translate';
|
|
22
|
-
import
|
|
22
|
+
import DocSidebarItems from '@theme/DocSidebarItems';
|
|
23
23
|
import type {Props} from '@theme/DocSidebar';
|
|
24
24
|
|
|
25
25
|
import styles from './styles.module.css';
|