@docusaurus/theme-classic 0.0.0-5150 → 0.0.0-5155
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/index.js +4 -1
- package/lib/theme/BlogTagsListPage/index.js +1 -1
- package/lib/theme/{LayoutProviders → Layout/Provider}/index.d.ts +2 -2
- package/lib/theme/Layout/Provider/index.js +29 -0
- package/lib/theme/Layout/index.d.ts +0 -1
- package/lib/theme/Layout/index.js +10 -5
- package/lib/theme/Layout/{styles.css → styles.module.css} +10 -12
- package/package.json +14 -14
- package/src/index.ts +4 -1
- package/src/theme/BlogTagsListPage/index.tsx +1 -1
- package/src/theme/Layout/Provider/index.tsx +33 -0
- package/src/theme/Layout/index.tsx +10 -5
- package/src/theme/Layout/{styles.css → styles.module.css} +10 -12
- package/src/theme-classic.d.ts +2 -2
- package/lib/theme/LayoutProviders/index.js +0 -33
- package/src/theme/LayoutProviders/index.tsx +0 -36
package/lib/index.js
CHANGED
|
@@ -18,7 +18,9 @@ const ContextReplacementPlugin = requireFromDocusaurusCore('webpack/lib/ContextR
|
|
|
18
18
|
// Need to be inlined to prevent dark mode FOUC
|
|
19
19
|
// Make sure the key is the same as the one in `/theme/hooks/useTheme.js`
|
|
20
20
|
const ThemeStorageKey = 'theme';
|
|
21
|
-
const noFlashColorMode = ({ defaultMode, respectPrefersColorScheme, }) =>
|
|
21
|
+
const noFlashColorMode = ({ defaultMode, respectPrefersColorScheme, }) =>
|
|
22
|
+
/* language=js */
|
|
23
|
+
`(function() {
|
|
22
24
|
var defaultMode = '${defaultMode}';
|
|
23
25
|
var respectPrefersColorScheme = ${respectPrefersColorScheme};
|
|
24
26
|
|
|
@@ -62,6 +64,7 @@ const AnnouncementBarDismissDataAttribute = 'data-announcement-bar-initially-dis
|
|
|
62
64
|
// We always render the announcement bar html on the server, to prevent layout
|
|
63
65
|
// shifts on React hydration. The theme can use CSS + the data attribute to hide
|
|
64
66
|
// the announcement bar asap (before React hydration)
|
|
67
|
+
/* language=js */
|
|
65
68
|
const AnnouncementBarInlineJavaScript = `
|
|
66
69
|
(function() {
|
|
67
70
|
function isDismissed() {
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from '@docusaurus/theme-common';
|
|
15
15
|
import BlogLayout from '@theme/BlogLayout';
|
|
16
16
|
import TagsListByLetter from '@theme/TagsListByLetter';
|
|
17
|
-
import SearchMetadata from '
|
|
17
|
+
import SearchMetadata from '@theme/SearchMetadata';
|
|
18
18
|
export default function BlogTagsListPage({tags, sidebar}) {
|
|
19
19
|
const title = translateTagsPageTitle();
|
|
20
20
|
return (
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
/// <reference types="react" />
|
|
8
|
-
import type { Props } from '@theme/
|
|
9
|
-
export default function
|
|
8
|
+
import type { Props } from '@theme/Layout/Provider';
|
|
9
|
+
export default function LayoutProvider({ children }: Props): JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
import React from 'react';
|
|
8
|
+
import {composeProviders} from '@docusaurus/theme-common';
|
|
9
|
+
import {
|
|
10
|
+
ColorModeProvider,
|
|
11
|
+
TabGroupChoiceProvider,
|
|
12
|
+
AnnouncementBarProvider,
|
|
13
|
+
DocsPreferredVersionContextProvider,
|
|
14
|
+
ScrollControllerProvider,
|
|
15
|
+
NavbarProvider,
|
|
16
|
+
PluginHtmlClassNameProvider,
|
|
17
|
+
} from '@docusaurus/theme-common/internal';
|
|
18
|
+
const Provider = composeProviders([
|
|
19
|
+
ColorModeProvider,
|
|
20
|
+
AnnouncementBarProvider,
|
|
21
|
+
TabGroupChoiceProvider,
|
|
22
|
+
ScrollControllerProvider,
|
|
23
|
+
DocsPreferredVersionContextProvider,
|
|
24
|
+
PluginHtmlClassNameProvider,
|
|
25
|
+
NavbarProvider,
|
|
26
|
+
]);
|
|
27
|
+
export default function LayoutProvider({children}) {
|
|
28
|
+
return <Provider>{children}</Provider>;
|
|
29
|
+
}
|
|
@@ -13,9 +13,9 @@ import SkipToContent from '@theme/SkipToContent';
|
|
|
13
13
|
import AnnouncementBar from '@theme/AnnouncementBar';
|
|
14
14
|
import Navbar from '@theme/Navbar';
|
|
15
15
|
import Footer from '@theme/Footer';
|
|
16
|
-
import
|
|
16
|
+
import LayoutProvider from '@theme/Layout/Provider';
|
|
17
17
|
import ErrorPageContent from '@theme/ErrorPageContent';
|
|
18
|
-
import './styles.css';
|
|
18
|
+
import styles from './styles.module.css';
|
|
19
19
|
export default function Layout(props) {
|
|
20
20
|
const {
|
|
21
21
|
children,
|
|
@@ -27,7 +27,7 @@ export default function Layout(props) {
|
|
|
27
27
|
} = props;
|
|
28
28
|
useKeyboardNavigation();
|
|
29
29
|
return (
|
|
30
|
-
<
|
|
30
|
+
<LayoutProvider>
|
|
31
31
|
<PageMetadata title={title} description={description} />
|
|
32
32
|
|
|
33
33
|
<SkipToContent />
|
|
@@ -36,13 +36,18 @@ export default function Layout(props) {
|
|
|
36
36
|
|
|
37
37
|
<Navbar />
|
|
38
38
|
|
|
39
|
-
<div
|
|
39
|
+
<div
|
|
40
|
+
className={clsx(
|
|
41
|
+
ThemeClassNames.wrapper.main,
|
|
42
|
+
styles.mainWrapper,
|
|
43
|
+
wrapperClassName,
|
|
44
|
+
)}>
|
|
40
45
|
<ErrorBoundary fallback={(params) => <ErrorPageContent {...params} />}>
|
|
41
46
|
{children}
|
|
42
47
|
</ErrorBoundary>
|
|
43
48
|
</div>
|
|
44
49
|
|
|
45
50
|
{!noFooter && <Footer />}
|
|
46
|
-
</
|
|
51
|
+
</LayoutProvider>
|
|
47
52
|
);
|
|
48
53
|
}
|
|
@@ -5,23 +5,21 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
html,
|
|
9
|
-
body {
|
|
8
|
+
:global(html, body) {
|
|
10
9
|
height: 100%;
|
|
11
10
|
}
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
min-height: 100%;
|
|
15
|
-
display: flex;
|
|
16
|
-
flex-direction: column;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.main-wrapper {
|
|
12
|
+
.mainWrapper {
|
|
20
13
|
flex: 1 0 auto;
|
|
21
14
|
}
|
|
22
15
|
|
|
23
|
-
/* Docusaurus-specific utility
|
|
24
|
-
|
|
25
|
-
.docusaurus-mt-lg {
|
|
16
|
+
/* Docusaurus-specific utility class */
|
|
17
|
+
:global(.docusaurus-mt-lg) {
|
|
26
18
|
margin-top: 3rem;
|
|
27
19
|
}
|
|
20
|
+
|
|
21
|
+
:global(#__docusaurus) {
|
|
22
|
+
min-height: 100%;
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
}
|
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-5155",
|
|
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-5155",
|
|
24
|
+
"@docusaurus/mdx-loader": "0.0.0-5155",
|
|
25
|
+
"@docusaurus/module-type-aliases": "0.0.0-5155",
|
|
26
|
+
"@docusaurus/plugin-content-blog": "0.0.0-5155",
|
|
27
|
+
"@docusaurus/plugin-content-docs": "0.0.0-5155",
|
|
28
|
+
"@docusaurus/plugin-content-pages": "0.0.0-5155",
|
|
29
|
+
"@docusaurus/theme-common": "0.0.0-5155",
|
|
30
|
+
"@docusaurus/theme-translations": "0.0.0-5155",
|
|
31
|
+
"@docusaurus/types": "0.0.0-5155",
|
|
32
|
+
"@docusaurus/utils": "0.0.0-5155",
|
|
33
|
+
"@docusaurus/utils-common": "0.0.0-5155",
|
|
34
|
+
"@docusaurus/utils-validation": "0.0.0-5155",
|
|
35
35
|
"@mdx-js/react": "^1.6.22",
|
|
36
36
|
"clsx": "^1.1.1",
|
|
37
37
|
"copy-text-to-clipboard": "^3.0.1",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"engines": {
|
|
65
65
|
"node": ">=16.14"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "4e19c915902d434cddbb68402655c0dccc98c325"
|
|
68
68
|
}
|
package/src/index.ts
CHANGED
|
@@ -29,7 +29,9 @@ const ThemeStorageKey = 'theme';
|
|
|
29
29
|
const noFlashColorMode = ({
|
|
30
30
|
defaultMode,
|
|
31
31
|
respectPrefersColorScheme,
|
|
32
|
-
}: ThemeConfig['colorMode']) =>
|
|
32
|
+
}: ThemeConfig['colorMode']) =>
|
|
33
|
+
/* language=js */
|
|
34
|
+
`(function() {
|
|
33
35
|
var defaultMode = '${defaultMode}';
|
|
34
36
|
var respectPrefersColorScheme = ${respectPrefersColorScheme};
|
|
35
37
|
|
|
@@ -76,6 +78,7 @@ const AnnouncementBarDismissDataAttribute =
|
|
|
76
78
|
// We always render the announcement bar html on the server, to prevent layout
|
|
77
79
|
// shifts on React hydration. The theme can use CSS + the data attribute to hide
|
|
78
80
|
// the announcement bar asap (before React hydration)
|
|
81
|
+
/* language=js */
|
|
79
82
|
const AnnouncementBarInlineJavaScript = `
|
|
80
83
|
(function() {
|
|
81
84
|
function isDismissed() {
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
import BlogLayout from '@theme/BlogLayout';
|
|
17
17
|
import TagsListByLetter from '@theme/TagsListByLetter';
|
|
18
18
|
import type {Props} from '@theme/BlogTagsListPage';
|
|
19
|
-
import SearchMetadata from '
|
|
19
|
+
import SearchMetadata from '@theme/SearchMetadata';
|
|
20
20
|
|
|
21
21
|
export default function BlogTagsListPage({tags, sidebar}: Props): JSX.Element {
|
|
22
22
|
const title = translateTagsPageTitle();
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
import React from 'react';
|
|
9
|
+
import {composeProviders} from '@docusaurus/theme-common';
|
|
10
|
+
import {
|
|
11
|
+
ColorModeProvider,
|
|
12
|
+
TabGroupChoiceProvider,
|
|
13
|
+
AnnouncementBarProvider,
|
|
14
|
+
DocsPreferredVersionContextProvider,
|
|
15
|
+
ScrollControllerProvider,
|
|
16
|
+
NavbarProvider,
|
|
17
|
+
PluginHtmlClassNameProvider,
|
|
18
|
+
} from '@docusaurus/theme-common/internal';
|
|
19
|
+
import type {Props} from '@theme/Layout/Provider';
|
|
20
|
+
|
|
21
|
+
const Provider = composeProviders([
|
|
22
|
+
ColorModeProvider,
|
|
23
|
+
AnnouncementBarProvider,
|
|
24
|
+
TabGroupChoiceProvider,
|
|
25
|
+
ScrollControllerProvider,
|
|
26
|
+
DocsPreferredVersionContextProvider,
|
|
27
|
+
PluginHtmlClassNameProvider,
|
|
28
|
+
NavbarProvider,
|
|
29
|
+
]);
|
|
30
|
+
|
|
31
|
+
export default function LayoutProvider({children}: Props): JSX.Element {
|
|
32
|
+
return <Provider>{children}</Provider>;
|
|
33
|
+
}
|
|
@@ -14,10 +14,10 @@ import SkipToContent from '@theme/SkipToContent';
|
|
|
14
14
|
import AnnouncementBar from '@theme/AnnouncementBar';
|
|
15
15
|
import Navbar from '@theme/Navbar';
|
|
16
16
|
import Footer from '@theme/Footer';
|
|
17
|
-
import
|
|
17
|
+
import LayoutProvider from '@theme/Layout/Provider';
|
|
18
18
|
import ErrorPageContent from '@theme/ErrorPageContent';
|
|
19
|
-
import './styles.css';
|
|
20
19
|
import type {Props} from '@theme/Layout';
|
|
20
|
+
import styles from './styles.module.css';
|
|
21
21
|
|
|
22
22
|
export default function Layout(props: Props): JSX.Element {
|
|
23
23
|
const {
|
|
@@ -32,7 +32,7 @@ export default function Layout(props: Props): JSX.Element {
|
|
|
32
32
|
useKeyboardNavigation();
|
|
33
33
|
|
|
34
34
|
return (
|
|
35
|
-
<
|
|
35
|
+
<LayoutProvider>
|
|
36
36
|
<PageMetadata title={title} description={description} />
|
|
37
37
|
|
|
38
38
|
<SkipToContent />
|
|
@@ -41,13 +41,18 @@ export default function Layout(props: Props): JSX.Element {
|
|
|
41
41
|
|
|
42
42
|
<Navbar />
|
|
43
43
|
|
|
44
|
-
<div
|
|
44
|
+
<div
|
|
45
|
+
className={clsx(
|
|
46
|
+
ThemeClassNames.wrapper.main,
|
|
47
|
+
styles.mainWrapper,
|
|
48
|
+
wrapperClassName,
|
|
49
|
+
)}>
|
|
45
50
|
<ErrorBoundary fallback={(params) => <ErrorPageContent {...params} />}>
|
|
46
51
|
{children}
|
|
47
52
|
</ErrorBoundary>
|
|
48
53
|
</div>
|
|
49
54
|
|
|
50
55
|
{!noFooter && <Footer />}
|
|
51
|
-
</
|
|
56
|
+
</LayoutProvider>
|
|
52
57
|
);
|
|
53
58
|
}
|
|
@@ -5,23 +5,21 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
html,
|
|
9
|
-
body {
|
|
8
|
+
:global(html, body) {
|
|
10
9
|
height: 100%;
|
|
11
10
|
}
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
min-height: 100%;
|
|
15
|
-
display: flex;
|
|
16
|
-
flex-direction: column;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.main-wrapper {
|
|
12
|
+
.mainWrapper {
|
|
20
13
|
flex: 1 0 auto;
|
|
21
14
|
}
|
|
22
15
|
|
|
23
|
-
/* Docusaurus-specific utility
|
|
24
|
-
|
|
25
|
-
.docusaurus-mt-lg {
|
|
16
|
+
/* Docusaurus-specific utility class */
|
|
17
|
+
:global(.docusaurus-mt-lg) {
|
|
26
18
|
margin-top: 3rem;
|
|
27
19
|
}
|
|
20
|
+
|
|
21
|
+
:global(#__docusaurus) {
|
|
22
|
+
min-height: 100%;
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
}
|
package/src/theme-classic.d.ts
CHANGED
|
@@ -596,14 +596,14 @@ declare module '@theme/Layout' {
|
|
|
596
596
|
export default function Layout(props: Props): JSX.Element;
|
|
597
597
|
}
|
|
598
598
|
|
|
599
|
-
declare module '@theme/
|
|
599
|
+
declare module '@theme/Layout/Provider' {
|
|
600
600
|
import type {ReactNode} from 'react';
|
|
601
601
|
|
|
602
602
|
export interface Props {
|
|
603
603
|
readonly children: ReactNode;
|
|
604
604
|
}
|
|
605
605
|
|
|
606
|
-
export default function
|
|
606
|
+
export default function LayoutProvider(props: Props): JSX.Element;
|
|
607
607
|
}
|
|
608
608
|
|
|
609
609
|
declare module '@theme/SearchMetadata' {
|
|
@@ -1,33 +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
|
-
import React from 'react';
|
|
8
|
-
import {
|
|
9
|
-
ColorModeProvider,
|
|
10
|
-
TabGroupChoiceProvider,
|
|
11
|
-
AnnouncementBarProvider,
|
|
12
|
-
DocsPreferredVersionContextProvider,
|
|
13
|
-
ScrollControllerProvider,
|
|
14
|
-
NavbarProvider,
|
|
15
|
-
PluginHtmlClassNameProvider,
|
|
16
|
-
} from '@docusaurus/theme-common/internal';
|
|
17
|
-
export default function LayoutProviders({children}) {
|
|
18
|
-
return (
|
|
19
|
-
<ColorModeProvider>
|
|
20
|
-
<AnnouncementBarProvider>
|
|
21
|
-
<TabGroupChoiceProvider>
|
|
22
|
-
<ScrollControllerProvider>
|
|
23
|
-
<DocsPreferredVersionContextProvider>
|
|
24
|
-
<PluginHtmlClassNameProvider>
|
|
25
|
-
<NavbarProvider>{children}</NavbarProvider>
|
|
26
|
-
</PluginHtmlClassNameProvider>
|
|
27
|
-
</DocsPreferredVersionContextProvider>
|
|
28
|
-
</ScrollControllerProvider>
|
|
29
|
-
</TabGroupChoiceProvider>
|
|
30
|
-
</AnnouncementBarProvider>
|
|
31
|
-
</ColorModeProvider>
|
|
32
|
-
);
|
|
33
|
-
}
|
|
@@ -1,36 +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
|
-
import React from 'react';
|
|
9
|
-
import {
|
|
10
|
-
ColorModeProvider,
|
|
11
|
-
TabGroupChoiceProvider,
|
|
12
|
-
AnnouncementBarProvider,
|
|
13
|
-
DocsPreferredVersionContextProvider,
|
|
14
|
-
ScrollControllerProvider,
|
|
15
|
-
NavbarProvider,
|
|
16
|
-
PluginHtmlClassNameProvider,
|
|
17
|
-
} from '@docusaurus/theme-common/internal';
|
|
18
|
-
import type {Props} from '@theme/LayoutProviders';
|
|
19
|
-
|
|
20
|
-
export default function LayoutProviders({children}: Props): JSX.Element {
|
|
21
|
-
return (
|
|
22
|
-
<ColorModeProvider>
|
|
23
|
-
<AnnouncementBarProvider>
|
|
24
|
-
<TabGroupChoiceProvider>
|
|
25
|
-
<ScrollControllerProvider>
|
|
26
|
-
<DocsPreferredVersionContextProvider>
|
|
27
|
-
<PluginHtmlClassNameProvider>
|
|
28
|
-
<NavbarProvider>{children}</NavbarProvider>
|
|
29
|
-
</PluginHtmlClassNameProvider>
|
|
30
|
-
</DocsPreferredVersionContextProvider>
|
|
31
|
-
</ScrollControllerProvider>
|
|
32
|
-
</TabGroupChoiceProvider>
|
|
33
|
-
</AnnouncementBarProvider>
|
|
34
|
-
</ColorModeProvider>
|
|
35
|
-
);
|
|
36
|
-
}
|