@docusaurus/theme-classic 0.0.0-5333 → 0.0.0-5340
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/getSwizzleConfig.js +7 -0
- package/lib/theme/Layout/index.js +6 -1
- package/lib/theme/MDXComponents/index.js +2 -0
- package/lib/theme/Mermaid.d.ts +7 -0
- package/lib/theme/Mermaid.js +13 -0
- package/lib/theme/SkipToContent/index.js +2 -18
- package/package.json +14 -14
- package/src/getSwizzleConfig.ts +8 -0
- package/src/theme/Layout/index.tsx +6 -1
- package/src/theme/MDXComponents/index.tsx +2 -0
- package/src/theme/Mermaid.tsx +16 -0
- package/src/theme/SkipToContent/index.tsx +2 -18
- package/src/theme-classic.d.ts +10 -0
package/lib/getSwizzleConfig.js
CHANGED
|
@@ -348,6 +348,13 @@ function getSwizzleConfig() {
|
|
|
348
348
|
// By default it's an empty placeholder for the user to fill
|
|
349
349
|
description: 'The search bar component of your site, appearing in the navbar.',
|
|
350
350
|
},
|
|
351
|
+
SkipToContent: {
|
|
352
|
+
actions: {
|
|
353
|
+
eject: 'safe',
|
|
354
|
+
wrap: 'safe',
|
|
355
|
+
},
|
|
356
|
+
description: 'The component responsible for implementing the accessibility "skip to content" link (https://www.w3.org/TR/WCAG20-TECHS/G1.html)',
|
|
357
|
+
},
|
|
351
358
|
'prism-include-languages': {
|
|
352
359
|
actions: {
|
|
353
360
|
eject: 'safe',
|
|
@@ -7,7 +7,11 @@
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
import ErrorBoundary from '@docusaurus/ErrorBoundary';
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
PageMetadata,
|
|
12
|
+
SkipToContentFallbackId,
|
|
13
|
+
ThemeClassNames,
|
|
14
|
+
} from '@docusaurus/theme-common';
|
|
11
15
|
import {useKeyboardNavigation} from '@docusaurus/theme-common/internal';
|
|
12
16
|
import SkipToContent from '@theme/SkipToContent';
|
|
13
17
|
import AnnouncementBar from '@theme/AnnouncementBar';
|
|
@@ -37,6 +41,7 @@ export default function Layout(props) {
|
|
|
37
41
|
<Navbar />
|
|
38
42
|
|
|
39
43
|
<div
|
|
44
|
+
id={SkipToContentFallbackId}
|
|
40
45
|
className={clsx(
|
|
41
46
|
ThemeClassNames.wrapper.main,
|
|
42
47
|
styles.mainWrapper,
|
|
@@ -14,6 +14,7 @@ import MDXHeading from '@theme/MDXComponents/Heading';
|
|
|
14
14
|
import MDXUl from '@theme/MDXComponents/Ul';
|
|
15
15
|
import MDXImg from '@theme/MDXComponents/Img';
|
|
16
16
|
import Admonition from '@theme/Admonition';
|
|
17
|
+
import Mermaid from '@theme/Mermaid';
|
|
17
18
|
const MDXComponents = {
|
|
18
19
|
head: MDXHead,
|
|
19
20
|
code: MDXCode,
|
|
@@ -29,5 +30,6 @@ const MDXComponents = {
|
|
|
29
30
|
h5: (props) => <MDXHeading as="h5" {...props} />,
|
|
30
31
|
h6: (props) => <MDXHeading as="h6" {...props} />,
|
|
31
32
|
admonition: Admonition,
|
|
33
|
+
mermaid: Mermaid,
|
|
32
34
|
};
|
|
33
35
|
export default MDXComponents;
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
// This component is meant to be implemented by a Mermaid renderer theme
|
|
8
|
+
// It is notable created to be overridden by docusaurus-theme-mermaid
|
|
9
|
+
// By default, the classic theme does not provide any Mermaid implementation
|
|
10
|
+
// Yet we declare it there so that we can register it in MDX
|
|
11
|
+
// TODO later the mermaid theme should be able to register its MDX component
|
|
12
|
+
// see https://github.com/facebook/docusaurus/pull/7490#issuecomment-1279117288
|
|
13
|
+
export {default} from '@docusaurus/Noop';
|
|
@@ -5,24 +5,8 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
|
-
import
|
|
9
|
-
import {useSkipToContent} from '@docusaurus/theme-common/internal';
|
|
8
|
+
import {SkipToContentLink} from '@docusaurus/theme-common';
|
|
10
9
|
import styles from './styles.module.css';
|
|
11
10
|
export default function SkipToContent() {
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<div
|
|
15
|
-
ref={containerRef}
|
|
16
|
-
role="region"
|
|
17
|
-
aria-label={translate({id: 'theme.common.skipToMainContent'})}>
|
|
18
|
-
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
|
|
19
|
-
<a href="#" className={styles.skipToContent} onClick={handleSkip}>
|
|
20
|
-
<Translate
|
|
21
|
-
id="theme.common.skipToMainContent"
|
|
22
|
-
description="The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation">
|
|
23
|
-
Skip to main content
|
|
24
|
-
</Translate>
|
|
25
|
-
</a>
|
|
26
|
-
</div>
|
|
27
|
-
);
|
|
11
|
+
return <SkipToContentLink className={styles.skipToContent} />;
|
|
28
12
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/theme-classic",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-5340",
|
|
4
4
|
"description": "Classic theme for Docusaurus",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/theme-classic.d.ts",
|
|
@@ -20,18 +20,18 @@
|
|
|
20
20
|
"copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@docusaurus/core": "0.0.0-
|
|
24
|
-
"@docusaurus/mdx-loader": "0.0.0-
|
|
25
|
-
"@docusaurus/module-type-aliases": "0.0.0-
|
|
26
|
-
"@docusaurus/plugin-content-blog": "0.0.0-
|
|
27
|
-
"@docusaurus/plugin-content-docs": "0.0.0-
|
|
28
|
-
"@docusaurus/plugin-content-pages": "0.0.0-
|
|
29
|
-
"@docusaurus/theme-common": "0.0.0-
|
|
30
|
-
"@docusaurus/theme-translations": "0.0.0-
|
|
31
|
-
"@docusaurus/types": "0.0.0-
|
|
32
|
-
"@docusaurus/utils": "0.0.0-
|
|
33
|
-
"@docusaurus/utils-common": "0.0.0-
|
|
34
|
-
"@docusaurus/utils-validation": "0.0.0-
|
|
23
|
+
"@docusaurus/core": "0.0.0-5340",
|
|
24
|
+
"@docusaurus/mdx-loader": "0.0.0-5340",
|
|
25
|
+
"@docusaurus/module-type-aliases": "0.0.0-5340",
|
|
26
|
+
"@docusaurus/plugin-content-blog": "0.0.0-5340",
|
|
27
|
+
"@docusaurus/plugin-content-docs": "0.0.0-5340",
|
|
28
|
+
"@docusaurus/plugin-content-pages": "0.0.0-5340",
|
|
29
|
+
"@docusaurus/theme-common": "0.0.0-5340",
|
|
30
|
+
"@docusaurus/theme-translations": "0.0.0-5340",
|
|
31
|
+
"@docusaurus/types": "0.0.0-5340",
|
|
32
|
+
"@docusaurus/utils": "0.0.0-5340",
|
|
33
|
+
"@docusaurus/utils-common": "0.0.0-5340",
|
|
34
|
+
"@docusaurus/utils-validation": "0.0.0-5340",
|
|
35
35
|
"@mdx-js/react": "^1.6.22",
|
|
36
36
|
"clsx": "^1.2.1",
|
|
37
37
|
"copy-text-to-clipboard": "^3.0.1",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"engines": {
|
|
63
63
|
"node": ">=16.14"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "4ca40b74f67cede21e3ff2f88d4764f596057e72"
|
|
66
66
|
}
|
package/src/getSwizzleConfig.ts
CHANGED
|
@@ -377,6 +377,14 @@ export default function getSwizzleConfig(): SwizzleConfig {
|
|
|
377
377
|
description:
|
|
378
378
|
'The search bar component of your site, appearing in the navbar.',
|
|
379
379
|
},
|
|
380
|
+
SkipToContent: {
|
|
381
|
+
actions: {
|
|
382
|
+
eject: 'safe',
|
|
383
|
+
wrap: 'safe',
|
|
384
|
+
},
|
|
385
|
+
description:
|
|
386
|
+
'The component responsible for implementing the accessibility "skip to content" link (https://www.w3.org/TR/WCAG20-TECHS/G1.html)',
|
|
387
|
+
},
|
|
380
388
|
'prism-include-languages': {
|
|
381
389
|
actions: {
|
|
382
390
|
eject: 'safe',
|
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
10
|
import ErrorBoundary from '@docusaurus/ErrorBoundary';
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
PageMetadata,
|
|
13
|
+
SkipToContentFallbackId,
|
|
14
|
+
ThemeClassNames,
|
|
15
|
+
} from '@docusaurus/theme-common';
|
|
12
16
|
import {useKeyboardNavigation} from '@docusaurus/theme-common/internal';
|
|
13
17
|
import SkipToContent from '@theme/SkipToContent';
|
|
14
18
|
import AnnouncementBar from '@theme/AnnouncementBar';
|
|
@@ -42,6 +46,7 @@ export default function Layout(props: Props): JSX.Element {
|
|
|
42
46
|
<Navbar />
|
|
43
47
|
|
|
44
48
|
<div
|
|
49
|
+
id={SkipToContentFallbackId}
|
|
45
50
|
className={clsx(
|
|
46
51
|
ThemeClassNames.wrapper.main,
|
|
47
52
|
styles.mainWrapper,
|
|
@@ -15,6 +15,7 @@ import MDXHeading from '@theme/MDXComponents/Heading';
|
|
|
15
15
|
import MDXUl from '@theme/MDXComponents/Ul';
|
|
16
16
|
import MDXImg from '@theme/MDXComponents/Img';
|
|
17
17
|
import Admonition from '@theme/Admonition';
|
|
18
|
+
import Mermaid from '@theme/Mermaid';
|
|
18
19
|
|
|
19
20
|
import type {MDXComponentsObject} from '@theme/MDXComponents';
|
|
20
21
|
|
|
@@ -33,6 +34,7 @@ const MDXComponents: MDXComponentsObject = {
|
|
|
33
34
|
h5: (props) => <MDXHeading as="h5" {...props} />,
|
|
34
35
|
h6: (props) => <MDXHeading as="h6" {...props} />,
|
|
35
36
|
admonition: Admonition,
|
|
37
|
+
mermaid: Mermaid,
|
|
36
38
|
};
|
|
37
39
|
|
|
38
40
|
export default MDXComponents;
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
// This component is meant to be implemented by a Mermaid renderer theme
|
|
9
|
+
// It is notable created to be overridden by docusaurus-theme-mermaid
|
|
10
|
+
|
|
11
|
+
// By default, the classic theme does not provide any Mermaid implementation
|
|
12
|
+
// Yet we declare it there so that we can register it in MDX
|
|
13
|
+
// TODO later the mermaid theme should be able to register its MDX component
|
|
14
|
+
// see https://github.com/facebook/docusaurus/pull/7490#issuecomment-1279117288
|
|
15
|
+
|
|
16
|
+
export {default} from '@docusaurus/Noop';
|
|
@@ -6,26 +6,10 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
|
-
import
|
|
10
|
-
import {useSkipToContent} from '@docusaurus/theme-common/internal';
|
|
9
|
+
import {SkipToContentLink} from '@docusaurus/theme-common';
|
|
11
10
|
|
|
12
11
|
import styles from './styles.module.css';
|
|
13
12
|
|
|
14
13
|
export default function SkipToContent(): JSX.Element {
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<div
|
|
18
|
-
ref={containerRef}
|
|
19
|
-
role="region"
|
|
20
|
-
aria-label={translate({id: 'theme.common.skipToMainContent'})}>
|
|
21
|
-
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
|
|
22
|
-
<a href="#" className={styles.skipToContent} onClick={handleSkip}>
|
|
23
|
-
<Translate
|
|
24
|
-
id="theme.common.skipToMainContent"
|
|
25
|
-
description="The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation">
|
|
26
|
-
Skip to main content
|
|
27
|
-
</Translate>
|
|
28
|
-
</a>
|
|
29
|
-
</div>
|
|
30
|
-
);
|
|
14
|
+
return <SkipToContentLink className={styles.skipToContent} />;
|
|
31
15
|
}
|
package/src/theme-classic.d.ts
CHANGED
|
@@ -897,6 +897,7 @@ declare module '@theme/MDXComponents' {
|
|
|
897
897
|
import type MDXUl from '@theme/MDXComponents/Ul';
|
|
898
898
|
import type MDXImg from '@theme/MDXComponents/Img';
|
|
899
899
|
import type Admonition from '@theme/Admonition';
|
|
900
|
+
import type Mermaid from '@theme/Mermaid';
|
|
900
901
|
|
|
901
902
|
export type MDXComponentsObject = {
|
|
902
903
|
readonly head: typeof MDXHead;
|
|
@@ -913,6 +914,7 @@ declare module '@theme/MDXComponents' {
|
|
|
913
914
|
readonly h5: (props: ComponentProps<'h5'>) => JSX.Element;
|
|
914
915
|
readonly h6: (props: ComponentProps<'h6'>) => JSX.Element;
|
|
915
916
|
readonly admonition: typeof Admonition;
|
|
917
|
+
readonly mermaid: typeof Mermaid;
|
|
916
918
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
917
919
|
[tagName: string]: ComponentType<any>;
|
|
918
920
|
};
|
|
@@ -1221,6 +1223,14 @@ declare module '@theme/SearchBar' {
|
|
|
1221
1223
|
export default function SearchBar(): JSX.Element;
|
|
1222
1224
|
}
|
|
1223
1225
|
|
|
1226
|
+
declare module '@theme/Mermaid' {
|
|
1227
|
+
export interface Props {
|
|
1228
|
+
value: string;
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
export default function Mermaid(props: Props): JSX.Element;
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1224
1234
|
declare module '@theme/TabItem' {
|
|
1225
1235
|
import type {ReactNode} from 'react';
|
|
1226
1236
|
|