@docusaurus/theme-classic 3.10.1 → 4.0.0-canary-6808
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/lib/nprogress.css +2 -1
- package/lib/theme/Admonition/index.js +1 -0
- package/lib/theme/AnnouncementBar/Content/index.js +0 -1
- package/lib/theme/AnnouncementBar/styles.module.css +1 -1
- package/lib/theme/BlogPostItem/Header/Title/styles.module.css +1 -1
- package/lib/theme/BlogSidebar/Desktop/styles.module.css +1 -1
- package/lib/theme/BlogTagsPostsPage/index.js +2 -6
- package/lib/theme/CodeBlock/Content/index.js +3 -4
- package/lib/theme/ContentVisibility/Unlisted/index.js +8 -1
- package/lib/theme/DocCard/index.js +1 -1
- package/lib/theme/DocCategoryGeneratedIndexPage/styles.module.css +1 -1
- package/lib/theme/DocItem/Layout/styles.module.css +1 -1
- package/lib/theme/DocItem/TOC/Mobile/styles.module.css +1 -1
- package/lib/theme/DocRoot/Layout/Main/styles.module.css +1 -1
- package/lib/theme/DocRoot/Layout/Sidebar/ExpandButton/styles.module.css +1 -1
- package/lib/theme/DocRoot/Layout/Sidebar/styles.module.css +1 -1
- package/lib/theme/DocSidebar/Desktop/CollapseButton/styles.module.css +1 -1
- package/lib/theme/DocSidebar/Desktop/Content/styles.module.css +2 -1
- package/lib/theme/DocSidebar/Desktop/styles.module.css +1 -1
- package/lib/theme/DocSidebarItem/Category/index.js +4 -6
- package/lib/theme/DocSidebarItem/Html/index.js +0 -1
- package/lib/theme/DocSidebarItem/Html/styles.module.css +1 -1
- package/lib/theme/DocSidebarItem/Link/index.js +1 -5
- package/lib/theme/DocTagDocListPage/index.js +3 -6
- package/lib/theme/EditMetaRow/styles.module.css +1 -1
- package/lib/theme/ErrorPageContent.js +7 -17
- package/lib/theme/Footer/Copyright/index.js +0 -1
- package/lib/theme/Footer/Links/MultiColumn/index.js +0 -1
- package/lib/theme/Footer/Links/Simple/index.js +0 -1
- package/lib/theme/Mermaid.js +1 -1
- package/lib/theme/Navbar/Content/styles.module.css +1 -1
- package/lib/theme/Navbar/MobileSidebar/Layout/index.js +2 -13
- package/lib/theme/Navbar/Search/styles.module.css +2 -2
- package/lib/theme/SearchBar.js +1 -1
- package/lib/theme/TOC/styles.module.css +1 -1
- package/lib/theme/prism-include-languages.js +22 -24
- package/package.json +33 -34
- package/src/nprogress.css +2 -1
- package/src/options.ts +2 -2
- package/src/theme/Admonition/index.tsx +1 -0
- package/src/theme/AnnouncementBar/Content/index.tsx +0 -1
- package/src/theme/AnnouncementBar/styles.module.css +1 -1
- package/src/theme/BlogPostItem/Header/Title/styles.module.css +1 -1
- package/src/theme/BlogSidebar/Desktop/styles.module.css +1 -1
- package/src/theme/BlogTagsPostsPage/index.tsx +2 -6
- package/src/theme/CodeBlock/Content/index.tsx +11 -14
- package/src/theme/ContentVisibility/Unlisted/index.tsx +9 -1
- package/src/theme/DocCard/index.tsx +1 -1
- package/src/theme/DocCategoryGeneratedIndexPage/styles.module.css +1 -1
- package/src/theme/DocItem/Layout/styles.module.css +1 -1
- package/src/theme/DocItem/TOC/Mobile/styles.module.css +1 -1
- package/src/theme/DocRoot/Layout/Main/styles.module.css +1 -1
- package/src/theme/DocRoot/Layout/Sidebar/ExpandButton/styles.module.css +1 -1
- package/src/theme/DocRoot/Layout/Sidebar/styles.module.css +1 -1
- package/src/theme/DocSidebar/Desktop/CollapseButton/styles.module.css +1 -1
- package/src/theme/DocSidebar/Desktop/Content/styles.module.css +2 -1
- package/src/theme/DocSidebar/Desktop/styles.module.css +1 -1
- package/src/theme/DocSidebarItem/Category/index.tsx +4 -6
- package/src/theme/DocSidebarItem/Html/index.tsx +0 -1
- package/src/theme/DocSidebarItem/Html/styles.module.css +1 -1
- package/src/theme/DocSidebarItem/Link/index.tsx +1 -5
- package/src/theme/DocTagDocListPage/index.tsx +3 -6
- package/src/theme/EditMetaRow/styles.module.css +1 -1
- package/src/theme/Footer/Copyright/index.tsx +0 -1
- package/src/theme/Footer/Links/MultiColumn/index.tsx +0 -1
- package/src/theme/Footer/Links/Simple/index.tsx +0 -1
- package/src/theme/Navbar/Content/styles.module.css +1 -1
- package/src/theme/Navbar/MobileSidebar/Layout/index.tsx +2 -14
- package/src/theme/Navbar/Search/styles.module.css +2 -2
- package/src/theme/TOC/styles.module.css +1 -1
- package/src/theme/prism-include-languages.ts +2 -2
- package/src/theme-classic.d.ts +1 -8
- package/lib/theme/ThemedImage/styles.module.css +0 -18
- package/src/theme/ThemedImage/styles.module.css +0 -18
package/src/options.ts
CHANGED
|
@@ -150,8 +150,8 @@ const itemWithType = (type: string | RegExp | undefined) => {
|
|
|
150
150
|
type instanceof RegExp
|
|
151
151
|
? Joi.string().required().regex(type)
|
|
152
152
|
: type
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
? Joi.string().required().equal(type)
|
|
154
|
+
: Joi.string().forbidden();
|
|
155
155
|
return Joi.object({
|
|
156
156
|
type: typeSchema,
|
|
157
157
|
})
|
|
@@ -24,5 +24,6 @@ function getAdmonitionTypeComponent(type: string): ComponentType<Props> {
|
|
|
24
24
|
export default function Admonition(unprocessedProps: Props): ReactNode {
|
|
25
25
|
const props = processAdmonitionProps(unprocessedProps);
|
|
26
26
|
const AdmonitionTypeComponent = getAdmonitionTypeComponent(props.type);
|
|
27
|
+
// eslint-disable-next-line react-hooks/static-components
|
|
27
28
|
return <AdmonitionTypeComponent {...props} />;
|
|
28
29
|
}
|
|
@@ -19,7 +19,6 @@ export default function AnnouncementBarContent(props: Props): ReactNode {
|
|
|
19
19
|
{...props}
|
|
20
20
|
className={clsx(styles.content, props.className)}
|
|
21
21
|
// Developer provided the HTML, so assume it's safe.
|
|
22
|
-
// eslint-disable-next-line react/no-danger
|
|
23
22
|
dangerouslySetInnerHTML={{__html: content}}
|
|
24
23
|
/>
|
|
25
24
|
);
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
|
|
8
8
|
import React, {type ReactNode} from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
-
import Translate from '@docusaurus/Translate';
|
|
11
10
|
import {
|
|
12
11
|
PageMetadata,
|
|
13
12
|
HtmlClassNameProvider,
|
|
13
|
+
TagsPageLinkLabel,
|
|
14
14
|
ThemeClassNames,
|
|
15
15
|
} from '@docusaurus/theme-common';
|
|
16
16
|
import {useBlogTagsPostsPageTitle} from '@docusaurus/theme-common/internal';
|
|
@@ -47,11 +47,7 @@ function BlogTagsPostsPageContent({
|
|
|
47
47
|
<Heading as="h1">{title}</Heading>
|
|
48
48
|
{tag.description && <p>{tag.description}</p>}
|
|
49
49
|
<Link href={tag.allTagsPath}>
|
|
50
|
-
<
|
|
51
|
-
id="theme.tags.tagsPageLink"
|
|
52
|
-
description="The label of the link targeting the tag list page">
|
|
53
|
-
View All Tags
|
|
54
|
-
</Translate>
|
|
50
|
+
<TagsPageLinkLabel />
|
|
55
51
|
</Link>
|
|
56
52
|
</header>
|
|
57
53
|
<BlogPostItems items={items} />
|
|
@@ -15,20 +15,17 @@ import Line from '@theme/CodeBlock/Line';
|
|
|
15
15
|
|
|
16
16
|
import styles from './styles.module.css';
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
);
|
|
30
|
-
},
|
|
31
|
-
);
|
|
18
|
+
function Pre({className, ref, ...props}: ComponentProps<'pre'>) {
|
|
19
|
+
return (
|
|
20
|
+
<pre
|
|
21
|
+
ref={ref}
|
|
22
|
+
/* eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex */
|
|
23
|
+
tabIndex={0}
|
|
24
|
+
{...props}
|
|
25
|
+
className={clsx(className, styles.codeBlock, 'thin-scrollbar')}
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
32
29
|
|
|
33
30
|
function Code(props: ComponentProps<'code'>) {
|
|
34
31
|
const {metadata} = useCodeBlockContext();
|
|
@@ -7,15 +7,23 @@
|
|
|
7
7
|
|
|
8
8
|
import React, {type ReactNode} from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
+
import Head from '@docusaurus/Head';
|
|
10
11
|
import {
|
|
11
12
|
ThemeClassNames,
|
|
12
13
|
UnlistedBannerTitle,
|
|
13
14
|
UnlistedBannerMessage,
|
|
14
|
-
UnlistedMetadata,
|
|
15
15
|
} from '@docusaurus/theme-common';
|
|
16
16
|
import Admonition from '@theme/Admonition';
|
|
17
17
|
import type {Props} from '@theme/ContentVisibility/Unlisted';
|
|
18
18
|
|
|
19
|
+
function UnlistedMetadata(): ReactNode {
|
|
20
|
+
return (
|
|
21
|
+
<Head>
|
|
22
|
+
<meta name="robots" content="noindex, nofollow" />
|
|
23
|
+
</Head>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
19
27
|
function UnlistedBanner({className}: Props) {
|
|
20
28
|
return (
|
|
21
29
|
<Admonition
|
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
@media (
|
|
8
|
+
@media (width >= 997px) {
|
|
9
9
|
.menu {
|
|
10
10
|
flex-grow: 1;
|
|
11
11
|
padding: 0.5rem;
|
|
12
12
|
}
|
|
13
|
+
|
|
13
14
|
@supports (scrollbar-gutter: stable) {
|
|
14
15
|
.menu {
|
|
15
16
|
padding: 0.5rem 0 0.5rem 0.5rem;
|
|
@@ -135,11 +135,7 @@ function CollapseButton({
|
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
function CategoryLinkLabel({label}: {label: string}) {
|
|
138
|
-
return
|
|
139
|
-
<span title={label} className={styles.categoryLinkLabel}>
|
|
140
|
-
{label}
|
|
141
|
-
</span>
|
|
142
|
-
);
|
|
138
|
+
return <span className={styles.categoryLinkLabel}>{label}</span>;
|
|
143
139
|
}
|
|
144
140
|
|
|
145
141
|
export default function DocSidebarItemCategory(props: Props): ReactNode {
|
|
@@ -284,7 +280,9 @@ function DocSidebarItemCategoryCollapsible({
|
|
|
284
280
|
aria-current={isCurrentPage ? 'page' : undefined}
|
|
285
281
|
role={collapsible && !href ? 'button' : undefined}
|
|
286
282
|
aria-expanded={collapsible && !href ? !collapsed : undefined}
|
|
287
|
-
href={
|
|
283
|
+
href={
|
|
284
|
+
collapsible ? (hrefWithSSRFallback ?? '#') : hrefWithSSRFallback
|
|
285
|
+
}
|
|
288
286
|
{...props}>
|
|
289
287
|
<CategoryLinkLabel label={label} />
|
|
290
288
|
</Link>
|
|
@@ -17,11 +17,7 @@ import type {Props} from '@theme/DocSidebarItem/Link';
|
|
|
17
17
|
import styles from './styles.module.css';
|
|
18
18
|
|
|
19
19
|
function LinkLabel({label}: {label: string}) {
|
|
20
|
-
return
|
|
21
|
-
<span title={label} className={styles.linkLabel}>
|
|
22
|
-
{label}
|
|
23
|
-
</span>
|
|
24
|
-
);
|
|
20
|
+
return <span className={styles.linkLabel}>{label}</span>;
|
|
25
21
|
}
|
|
26
22
|
|
|
27
23
|
export default function DocSidebarItemLink({
|
|
@@ -12,9 +12,10 @@ import {
|
|
|
12
12
|
PageMetadata,
|
|
13
13
|
HtmlClassNameProvider,
|
|
14
14
|
ThemeClassNames,
|
|
15
|
+
TagsPageLinkLabel,
|
|
15
16
|
usePluralForm,
|
|
16
17
|
} from '@docusaurus/theme-common';
|
|
17
|
-
import
|
|
18
|
+
import {translate} from '@docusaurus/Translate';
|
|
18
19
|
import SearchMetadata from '@theme/SearchMetadata';
|
|
19
20
|
import type {Props} from '@theme/DocTagDocListPage';
|
|
20
21
|
import Unlisted from '@theme/ContentVisibility/Unlisted';
|
|
@@ -88,11 +89,7 @@ function DocTagDocListPageContent({
|
|
|
88
89
|
<Heading as="h1">{title}</Heading>
|
|
89
90
|
{tag.description && <p>{tag.description}</p>}
|
|
90
91
|
<Link href={tag.allTagsPath}>
|
|
91
|
-
<
|
|
92
|
-
id="theme.tags.tagsPageLink"
|
|
93
|
-
description="The label of the link targeting the tag list page">
|
|
94
|
-
View all tags
|
|
95
|
-
</Translate>
|
|
92
|
+
<TagsPageLinkLabel />
|
|
96
93
|
</Link>
|
|
97
94
|
</header>
|
|
98
95
|
<section className="margin-vert--lg">
|
|
@@ -13,7 +13,6 @@ export default function FooterCopyright({copyright}: Props): ReactNode {
|
|
|
13
13
|
<div
|
|
14
14
|
className="footer__copyright"
|
|
15
15
|
// Developer provided the HTML, so assume it's safe.
|
|
16
|
-
// eslint-disable-next-line react/no-danger
|
|
17
16
|
dangerouslySetInnerHTML={{__html: copyright}}
|
|
18
17
|
/>
|
|
19
18
|
);
|
|
@@ -19,7 +19,6 @@ function ColumnLinkItem({item}: {item: ColumnItemType}) {
|
|
|
19
19
|
<li
|
|
20
20
|
className={clsx('footer__item', item.className)}
|
|
21
21
|
// Developer provided the HTML, so assume it's safe.
|
|
22
|
-
// eslint-disable-next-line react/no-danger
|
|
23
22
|
dangerouslySetInnerHTML={{__html: item.html}}
|
|
24
23
|
/>
|
|
25
24
|
) : (
|
|
@@ -19,7 +19,6 @@ function SimpleLinkItem({item}: {item: Props['links'][number]}) {
|
|
|
19
19
|
<span
|
|
20
20
|
className={clsx('footer__link-item', item.className)}
|
|
21
21
|
// Developer provided the HTML, so assume it's safe.
|
|
22
|
-
// eslint-disable-next-line react/no-danger
|
|
23
22
|
dangerouslySetInnerHTML={{__html: item.html}}
|
|
24
23
|
/>
|
|
25
24
|
) : (
|
|
@@ -5,24 +5,12 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import React, {
|
|
8
|
+
import React, {type ReactNode} from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
10
|
import {useNavbarSecondaryMenu} from '@docusaurus/theme-common/internal';
|
|
11
11
|
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
12
12
|
import type {Props} from '@theme/Navbar/MobileSidebar/Layout';
|
|
13
13
|
|
|
14
|
-
// TODO Docusaurus v4: remove temporary inert workaround
|
|
15
|
-
// See https://github.com/facebook/react/issues/17157
|
|
16
|
-
// See https://github.com/radix-ui/themes/pull/509
|
|
17
|
-
function inertProps(inert: boolean) {
|
|
18
|
-
const isBeforeReact19 = parseInt(version!.split('.')[0]!, 10) < 19;
|
|
19
|
-
if (isBeforeReact19) {
|
|
20
|
-
// TODO Docusaurus v4: remove temporary inert workaround
|
|
21
|
-
return {inert: inert ? '' : undefined} as unknown as {inert: boolean};
|
|
22
|
-
}
|
|
23
|
-
return {inert};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
14
|
function NavbarMobileSidebarPanel({
|
|
27
15
|
children,
|
|
28
16
|
inert,
|
|
@@ -36,7 +24,7 @@ function NavbarMobileSidebarPanel({
|
|
|
36
24
|
ThemeClassNames.layout.navbar.mobileSidebar.panel,
|
|
37
25
|
'navbar-sidebar__item menu',
|
|
38
26
|
)}
|
|
39
|
-
{
|
|
27
|
+
inert={inert}>
|
|
40
28
|
{children}
|
|
41
29
|
</div>
|
|
42
30
|
);
|
|
@@ -13,14 +13,14 @@ See https://github.com/facebook/docusaurus/pull/9385
|
|
|
13
13
|
display: none;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
@media (
|
|
16
|
+
@media (width <= 996px) {
|
|
17
17
|
.navbarSearchContainer {
|
|
18
18
|
position: absolute;
|
|
19
19
|
right: var(--ifm-navbar-padding-horizontal);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
@media (
|
|
23
|
+
@media (width >= 997px) {
|
|
24
24
|
.navbarSearchContainer {
|
|
25
25
|
padding: 0 var(--ifm-navbar-item-padding-horizontal);
|
|
26
26
|
}
|
|
@@ -29,10 +29,10 @@ export default function prismIncludeLanguages(
|
|
|
29
29
|
|
|
30
30
|
additionalLanguages.forEach((lang) => {
|
|
31
31
|
if (lang === 'php') {
|
|
32
|
-
// eslint-disable-next-line
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
33
33
|
require('prismjs/components/prism-markup-templating.js');
|
|
34
34
|
}
|
|
35
|
-
// eslint-disable-next-line
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
36
36
|
require(`prismjs/components/prism-${lang}`);
|
|
37
37
|
});
|
|
38
38
|
|
package/src/theme-classic.d.ts
CHANGED
|
@@ -499,8 +499,7 @@ declare module '@theme/CodeBlock/Buttons/WordWrapButton' {
|
|
|
499
499
|
}
|
|
500
500
|
|
|
501
501
|
declare module '@theme/CodeBlock/Container' {
|
|
502
|
-
import type {ReactNode} from 'react';
|
|
503
|
-
import type {ComponentProps} from 'react';
|
|
502
|
+
import type {ReactNode, ComponentProps} from 'react';
|
|
504
503
|
|
|
505
504
|
export default function CodeBlockContainer<T extends 'div' | 'pre'>({
|
|
506
505
|
as: As,
|
|
@@ -1325,9 +1324,6 @@ declare module '@theme/NavbarItem/DefaultNavbarItem' {
|
|
|
1325
1324
|
readonly position?: 'left' | 'right';
|
|
1326
1325
|
};
|
|
1327
1326
|
|
|
1328
|
-
// TODO Docusaurus v4, remove old type name
|
|
1329
|
-
export type DesktopOrMobileNavBarItemProps = DefaultNavbarItemProps;
|
|
1330
|
-
|
|
1331
1327
|
export interface Props extends DefaultNavbarItemProps {
|
|
1332
1328
|
readonly mobile?: boolean;
|
|
1333
1329
|
}
|
|
@@ -1381,9 +1377,6 @@ declare module '@theme/NavbarItem/DropdownNavbarItem' {
|
|
|
1381
1377
|
readonly className?: string;
|
|
1382
1378
|
};
|
|
1383
1379
|
|
|
1384
|
-
// TODO Docusaurus v4, remove old type name
|
|
1385
|
-
export type DesktopOrMobileNavBarItemProps = DropdownNavbarItemProps;
|
|
1386
|
-
|
|
1387
1380
|
export interface Props extends DropdownNavbarItemProps {
|
|
1388
1381
|
readonly mobile?: boolean;
|
|
1389
1382
|
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
.themedImage {
|
|
9
|
-
display: none;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
[data-theme='light'] .themedImage--light {
|
|
13
|
-
display: initial;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
[data-theme='dark'] .themedImage--dark {
|
|
17
|
-
display: initial;
|
|
18
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
.themedImage {
|
|
9
|
-
display: none;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
[data-theme='light'] .themedImage--light {
|
|
13
|
-
display: initial;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
[data-theme='dark'] .themedImage--dark {
|
|
17
|
-
display: initial;
|
|
18
|
-
}
|