@docusaurus/theme-classic 0.0.0-5143 → 0.0.0-5149
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/theme/AnnouncementBar/index.js +2 -1
- package/lib/theme/BackToTopButton/index.js +2 -1
- package/lib/theme/CodeBlock/Container/index.js +2 -5
- package/lib/theme/CodeBlock/Content/String.js +2 -3
- package/lib/theme/DocBreadcrumbs/index.js +2 -2
- package/lib/theme/DocCard/index.js +4 -1
- package/lib/theme/DocCardList/index.js +1 -1
- package/lib/theme/DocItem/Content/index.js +2 -1
- package/lib/theme/DocItem/Footer/index.js +2 -1
- package/lib/theme/DocItem/Layout/index.js +2 -1
- package/lib/theme/DocItem/Metadata/index.js +2 -1
- package/lib/theme/DocItem/Paginator/index.js +1 -1
- package/lib/theme/DocItem/TOC/Desktop/index.js +2 -1
- package/lib/theme/DocItem/TOC/Mobile/index.js +2 -1
- package/lib/theme/DocItem/index.js +2 -1
- package/lib/theme/DocPage/Layout/Main/index.js +1 -1
- package/lib/theme/DocPage/Layout/Sidebar/index.js +2 -1
- package/lib/theme/DocPage/Layout/index.js +1 -1
- package/lib/theme/DocPage/index.js +2 -3
- package/lib/theme/DocSidebar/Desktop/Content/index.js +2 -2
- package/lib/theme/DocSidebar/Mobile/index.js +1 -1
- package/lib/theme/DocSidebarItem/Category/index.js +6 -4
- package/lib/theme/DocSidebarItem/Link/index.js +2 -1
- package/lib/theme/DocSidebarItems/index.js +1 -1
- package/lib/theme/DocVersionBadge/index.js +2 -1
- package/lib/theme/DocVersionBanner/index.js +2 -2
- package/lib/theme/Footer/Logo/index.js +3 -1
- package/lib/theme/Layout/index.js +2 -5
- package/lib/theme/LayoutProviders/index.js +1 -1
- package/lib/theme/Logo/index.js +34 -22
- package/lib/theme/Navbar/Content/index.js +2 -2
- package/lib/theme/Navbar/Layout/index.js +2 -2
- package/lib/theme/Navbar/MobileSidebar/Header/index.js +1 -1
- package/lib/theme/Navbar/MobileSidebar/Layout/index.js +1 -1
- package/lib/theme/Navbar/MobileSidebar/PrimaryMenu/index.js +2 -1
- package/lib/theme/Navbar/MobileSidebar/SecondaryMenu/index.js +2 -1
- package/lib/theme/Navbar/MobileSidebar/Toggle/index.js +1 -1
- package/lib/theme/Navbar/MobileSidebar/index.js +1 -1
- package/lib/theme/NavbarItem/DocNavbarItem.js +1 -1
- package/lib/theme/NavbarItem/DocSidebarNavbarItem.js +1 -1
- package/lib/theme/NavbarItem/DocsVersionDropdownNavbarItem.js +1 -1
- package/lib/theme/NavbarItem/DocsVersionNavbarItem.js +1 -1
- package/lib/theme/NavbarItem/DropdownNavbarItem.js +2 -3
- package/lib/theme/NavbarItem/LocaleDropdownNavbarItem/index.js +1 -1
- package/lib/theme/SiteMetadata/index.js +2 -3
- package/lib/theme/SkipToContent/index.js +1 -1
- package/lib/theme/TOCItems/index.js +2 -2
- package/lib/theme/Tabs/index.js +2 -2
- package/lib/validateThemeConfig.js +13 -19
- package/package.json +15 -15
- package/src/theme/AnnouncementBar/index.tsx +2 -1
- package/src/theme/BackToTopButton/index.tsx +2 -1
- package/src/theme/CodeBlock/Container/index.tsx +2 -5
- package/src/theme/CodeBlock/Content/String.tsx +2 -3
- package/src/theme/DocBreadcrumbs/index.tsx +2 -2
- package/src/theme/DocCard/index.tsx +4 -1
- package/src/theme/DocCardList/index.tsx +1 -1
- package/src/theme/DocItem/Content/index.tsx +2 -1
- package/src/theme/DocItem/Footer/index.tsx +2 -5
- package/src/theme/DocItem/Layout/index.tsx +2 -1
- package/src/theme/DocItem/Metadata/index.tsx +2 -1
- package/src/theme/DocItem/Paginator/index.tsx +1 -1
- package/src/theme/DocItem/TOC/Desktop/index.tsx +2 -1
- package/src/theme/DocItem/TOC/Mobile/index.tsx +3 -1
- package/src/theme/DocItem/index.tsx +2 -1
- package/src/theme/DocPage/Layout/Main/index.tsx +1 -1
- package/src/theme/DocPage/Layout/Sidebar/index.tsx +2 -1
- package/src/theme/DocPage/Layout/index.tsx +1 -1
- package/src/theme/DocPage/index.tsx +2 -3
- package/src/theme/DocSidebar/Desktop/Content/index.tsx +2 -2
- package/src/theme/DocSidebar/Mobile/index.tsx +1 -1
- package/src/theme/DocSidebarItem/Category/index.tsx +6 -4
- package/src/theme/DocSidebarItem/Link/index.tsx +2 -1
- package/src/theme/DocSidebarItems/index.tsx +1 -1
- package/src/theme/DocVersionBadge/index.tsx +2 -1
- package/src/theme/DocVersionBanner/index.tsx +2 -3
- package/src/theme/Footer/Logo/index.tsx +3 -1
- package/src/theme/Layout/index.tsx +2 -5
- package/src/theme/LayoutProviders/index.tsx +1 -1
- package/src/theme/Logo/index.tsx +45 -24
- package/src/theme/Navbar/Content/index.tsx +2 -2
- package/src/theme/Navbar/Layout/index.tsx +2 -2
- package/src/theme/Navbar/MobileSidebar/Header/index.tsx +1 -1
- package/src/theme/Navbar/MobileSidebar/Layout/index.tsx +1 -1
- package/src/theme/Navbar/MobileSidebar/PrimaryMenu/index.tsx +2 -1
- package/src/theme/Navbar/MobileSidebar/SecondaryMenu/index.tsx +2 -1
- package/src/theme/Navbar/MobileSidebar/Toggle/index.tsx +1 -1
- package/src/theme/Navbar/MobileSidebar/index.tsx +1 -1
- package/src/theme/NavbarItem/DocNavbarItem.tsx +1 -1
- package/src/theme/NavbarItem/DocSidebarNavbarItem.tsx +1 -1
- package/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx +1 -1
- package/src/theme/NavbarItem/DocsVersionNavbarItem.tsx +1 -1
- package/src/theme/NavbarItem/DropdownNavbarItem.tsx +2 -3
- package/src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx +1 -1
- package/src/theme/SiteMetadata/index.tsx +2 -3
- package/src/theme/SkipToContent/index.tsx +1 -1
- package/src/theme/TOCItems/index.tsx +3 -3
- package/src/theme/Tabs/index.tsx +2 -2
- package/src/theme-classic.d.ts +1 -1
- package/src/validateThemeConfig.ts +14 -19
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import Translate from '@docusaurus/Translate';
|
|
9
|
-
import {useSkipToContent} from '@docusaurus/theme-common';
|
|
9
|
+
import {useSkipToContent} from '@docusaurus/theme-common/internal';
|
|
10
10
|
import styles from './styles.module.css';
|
|
11
11
|
export default function SkipToContent() {
|
|
12
12
|
const {containerRef, handleSkip} = useSkipToContent();
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import React, {useMemo} from 'react';
|
|
8
|
+
import {useThemeConfig} from '@docusaurus/theme-common';
|
|
8
9
|
import {
|
|
9
|
-
useThemeConfig,
|
|
10
10
|
useTOCHighlight,
|
|
11
11
|
useFilteredAndTreeifiedTOC,
|
|
12
|
-
} from '@docusaurus/theme-common';
|
|
12
|
+
} from '@docusaurus/theme-common/internal';
|
|
13
13
|
import TOCItemTree from '@theme/TOCItems/Tree';
|
|
14
14
|
export default function TOCItems({
|
|
15
15
|
toc,
|
package/lib/theme/Tabs/index.js
CHANGED
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
import React, {useState, cloneElement, isValidElement} from 'react';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
import useIsBrowser from '@docusaurus/useIsBrowser';
|
|
10
|
+
import {duplicates} from '@docusaurus/theme-common';
|
|
10
11
|
import {
|
|
11
12
|
useScrollPositionBlocker,
|
|
12
|
-
duplicates,
|
|
13
13
|
useTabGroupChoice,
|
|
14
|
-
} from '@docusaurus/theme-common';
|
|
14
|
+
} from '@docusaurus/theme-common/internal';
|
|
15
15
|
import styles from './styles.module.css';
|
|
16
16
|
// A very rough duck type, but good enough to guard against mistakes while
|
|
17
17
|
// allowing customization
|
|
@@ -268,6 +268,17 @@ const FooterLinkItemSchema = utils_validation_1.Joi.object({
|
|
|
268
268
|
const CustomCssSchema = utils_validation_1.Joi.alternatives()
|
|
269
269
|
.try(utils_validation_1.Joi.array().items(utils_validation_1.Joi.string().required()), utils_validation_1.Joi.string().required())
|
|
270
270
|
.optional();
|
|
271
|
+
const LogoSchema = utils_validation_1.Joi.object({
|
|
272
|
+
alt: utils_validation_1.Joi.string().allow(''),
|
|
273
|
+
src: utils_validation_1.Joi.string().required(),
|
|
274
|
+
srcDark: utils_validation_1.Joi.string(),
|
|
275
|
+
width: utils_validation_1.Joi.alternatives().try(utils_validation_1.Joi.string(), utils_validation_1.Joi.number()),
|
|
276
|
+
height: utils_validation_1.Joi.alternatives().try(utils_validation_1.Joi.string(), utils_validation_1.Joi.number()),
|
|
277
|
+
href: utils_validation_1.Joi.string(),
|
|
278
|
+
target: utils_validation_1.Joi.string(),
|
|
279
|
+
style: utils_validation_1.Joi.object(),
|
|
280
|
+
className: utils_validation_1.Joi.string(),
|
|
281
|
+
});
|
|
271
282
|
exports.ThemeConfigSchema = utils_validation_1.Joi.object({
|
|
272
283
|
// TODO temporary (@alpha-58)
|
|
273
284
|
// @ts-expect-error: forbidden
|
|
@@ -309,28 +320,11 @@ exports.ThemeConfigSchema = utils_validation_1.Joi.object({
|
|
|
309
320
|
.items(NavbarItemSchema)
|
|
310
321
|
.default(exports.DEFAULT_CONFIG.navbar.items),
|
|
311
322
|
title: utils_validation_1.Joi.string().allow('', null),
|
|
312
|
-
logo:
|
|
313
|
-
alt: utils_validation_1.Joi.string().allow(''),
|
|
314
|
-
src: utils_validation_1.Joi.string().required(),
|
|
315
|
-
srcDark: utils_validation_1.Joi.string(),
|
|
316
|
-
width: utils_validation_1.Joi.alternatives().try(utils_validation_1.Joi.string(), utils_validation_1.Joi.number()),
|
|
317
|
-
height: utils_validation_1.Joi.alternatives().try(utils_validation_1.Joi.string(), utils_validation_1.Joi.number()),
|
|
318
|
-
href: utils_validation_1.Joi.string(),
|
|
319
|
-
target: utils_validation_1.Joi.string(),
|
|
320
|
-
}),
|
|
323
|
+
logo: LogoSchema,
|
|
321
324
|
}).default(exports.DEFAULT_CONFIG.navbar),
|
|
322
325
|
footer: utils_validation_1.Joi.object({
|
|
323
326
|
style: utils_validation_1.Joi.string().equal('dark', 'light').default('light'),
|
|
324
|
-
logo:
|
|
325
|
-
alt: utils_validation_1.Joi.string().allow(''),
|
|
326
|
-
src: utils_validation_1.Joi.string().required(),
|
|
327
|
-
srcDark: utils_validation_1.Joi.string(),
|
|
328
|
-
// TODO infer this from reading the image
|
|
329
|
-
width: utils_validation_1.Joi.alternatives().try(utils_validation_1.Joi.string(), utils_validation_1.Joi.number()),
|
|
330
|
-
height: utils_validation_1.Joi.alternatives().try(utils_validation_1.Joi.string(), utils_validation_1.Joi.number()),
|
|
331
|
-
href: utils_validation_1.Joi.string(),
|
|
332
|
-
target: utils_validation_1.Joi.string(),
|
|
333
|
-
}),
|
|
327
|
+
logo: LogoSchema,
|
|
334
328
|
copyright: utils_validation_1.Joi.string(),
|
|
335
329
|
links: utils_validation_1.Joi.alternatives(utils_validation_1.Joi.array().items(utils_validation_1.Joi.object({
|
|
336
330
|
title: utils_validation_1.Joi.string().allow(null).default(null),
|
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-5149",
|
|
4
4
|
"description": "Classic theme for Docusaurus",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/theme-classic.d.ts",
|
|
@@ -20,22 +20,22 @@
|
|
|
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-5149",
|
|
24
|
+
"@docusaurus/mdx-loader": "0.0.0-5149",
|
|
25
|
+
"@docusaurus/module-type-aliases": "0.0.0-5149",
|
|
26
|
+
"@docusaurus/plugin-content-blog": "0.0.0-5149",
|
|
27
|
+
"@docusaurus/plugin-content-docs": "0.0.0-5149",
|
|
28
|
+
"@docusaurus/plugin-content-pages": "0.0.0-5149",
|
|
29
|
+
"@docusaurus/theme-common": "0.0.0-5149",
|
|
30
|
+
"@docusaurus/theme-translations": "0.0.0-5149",
|
|
31
|
+
"@docusaurus/types": "0.0.0-5149",
|
|
32
|
+
"@docusaurus/utils": "0.0.0-5149",
|
|
33
|
+
"@docusaurus/utils-common": "0.0.0-5149",
|
|
34
|
+
"@docusaurus/utils-validation": "0.0.0-5149",
|
|
35
35
|
"@mdx-js/react": "^1.6.22",
|
|
36
36
|
"clsx": "^1.1.1",
|
|
37
37
|
"copy-text-to-clipboard": "^3.0.1",
|
|
38
|
-
"infima": "0.2.0-alpha.
|
|
38
|
+
"infima": "0.2.0-alpha.40",
|
|
39
39
|
"lodash": "^4.17.21",
|
|
40
40
|
"nprogress": "^0.2.0",
|
|
41
41
|
"postcss": "^8.4.14",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"engines": {
|
|
65
65
|
"node": ">=16.14"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "da6a2b7ca96c6fac667884ea6c1f9e83370690c6"
|
|
68
68
|
}
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
-
import {useThemeConfig
|
|
10
|
+
import {useThemeConfig} from '@docusaurus/theme-common';
|
|
11
|
+
import {useAnnouncementBar} from '@docusaurus/theme-common/internal';
|
|
11
12
|
import {translate} from '@docusaurus/Translate';
|
|
12
13
|
import IconClose from '@theme/IconClose';
|
|
13
14
|
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
10
|
import {translate} from '@docusaurus/Translate';
|
|
11
|
-
import {ThemeClassNames
|
|
11
|
+
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
12
|
+
import {useBackToTopButton} from '@docusaurus/theme-common/internal';
|
|
12
13
|
|
|
13
14
|
import styles from './styles.module.css';
|
|
14
15
|
|
|
@@ -7,11 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
import React, {type ComponentProps} from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
getPrismCssVariables,
|
|
13
|
-
ThemeClassNames,
|
|
14
|
-
} from '@docusaurus/theme-common';
|
|
10
|
+
import {ThemeClassNames, usePrismTheme} from '@docusaurus/theme-common';
|
|
11
|
+
import {getPrismCssVariables} from '@docusaurus/theme-common/internal';
|
|
15
12
|
import styles from './styles.module.css';
|
|
16
13
|
|
|
17
14
|
export default function CodeBlockContainer<T extends 'div' | 'pre'>({
|
|
@@ -7,15 +7,14 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
+
import {useThemeConfig, usePrismTheme} from '@docusaurus/theme-common';
|
|
10
11
|
import {
|
|
11
|
-
useThemeConfig,
|
|
12
12
|
parseCodeBlockTitle,
|
|
13
13
|
parseLanguage,
|
|
14
14
|
parseLines,
|
|
15
15
|
containsLineNumbers,
|
|
16
|
-
usePrismTheme,
|
|
17
16
|
useCodeWordWrap,
|
|
18
|
-
} from '@docusaurus/theme-common';
|
|
17
|
+
} from '@docusaurus/theme-common/internal';
|
|
19
18
|
import Highlight, {defaultProps, type Language} from 'prism-react-renderer';
|
|
20
19
|
import Line from '@theme/CodeBlock/Line';
|
|
21
20
|
import CopyButton from '@theme/CodeBlock/CopyButton';
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
|
|
8
8
|
import React, {type ReactNode} from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
+
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
10
11
|
import {
|
|
11
|
-
ThemeClassNames,
|
|
12
12
|
useSidebarBreadcrumbs,
|
|
13
13
|
useHomePageRoute,
|
|
14
|
-
} from '@docusaurus/theme-common';
|
|
14
|
+
} from '@docusaurus/theme-common/internal';
|
|
15
15
|
import Link from '@docusaurus/Link';
|
|
16
16
|
import useBaseUrl from '@docusaurus/useBaseUrl';
|
|
17
17
|
import {translate} from '@docusaurus/Translate';
|
|
@@ -8,7 +8,10 @@
|
|
|
8
8
|
import React, {type ReactNode} from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
10
|
import Link from '@docusaurus/Link';
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
findFirstCategoryLink,
|
|
13
|
+
useDocById,
|
|
14
|
+
} from '@docusaurus/theme-common/internal';
|
|
12
15
|
import isInternalUrl from '@docusaurus/isInternalUrl';
|
|
13
16
|
import {translate} from '@docusaurus/Translate';
|
|
14
17
|
import type {Props} from '@theme/DocCard';
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
-
import {findFirstCategoryLink} from '@docusaurus/theme-common';
|
|
10
|
+
import {findFirstCategoryLink} from '@docusaurus/theme-common/internal';
|
|
11
11
|
import DocCard from '@theme/DocCard';
|
|
12
12
|
import type {Props} from '@theme/DocCardList';
|
|
13
13
|
import type {PropSidebarItem} from '@docusaurus/plugin-content-docs';
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
-
import {ThemeClassNames
|
|
10
|
+
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
11
|
+
import {useDoc} from '@docusaurus/theme-common/internal';
|
|
11
12
|
import Heading from '@theme/Heading';
|
|
12
13
|
import MDXContent from '@theme/MDXContent';
|
|
13
14
|
import type {Props} from '@theme/DocItem/Content';
|
|
@@ -7,11 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
useDoc,
|
|
13
|
-
type DocContextValue,
|
|
14
|
-
} from '@docusaurus/theme-common';
|
|
10
|
+
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
11
|
+
import {useDoc, type DocContextValue} from '@docusaurus/theme-common/internal';
|
|
15
12
|
import LastUpdated from '@theme/LastUpdated';
|
|
16
13
|
import EditThisPage from '@theme/EditThisPage';
|
|
17
14
|
import TagsListInline, {
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
-
import {useWindowSize
|
|
10
|
+
import {useWindowSize} from '@docusaurus/theme-common';
|
|
11
|
+
import {useDoc} from '@docusaurus/theme-common/internal';
|
|
11
12
|
import DocItemPaginator from '@theme/DocItem/Paginator';
|
|
12
13
|
import DocVersionBanner from '@theme/DocVersionBanner';
|
|
13
14
|
import DocVersionBadge from '@theme/DocVersionBadge';
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
|
-
import {PageMetadata
|
|
9
|
+
import {PageMetadata} from '@docusaurus/theme-common';
|
|
10
|
+
import {useDoc} from '@docusaurus/theme-common/internal';
|
|
10
11
|
|
|
11
12
|
export default function DocItemMetadata(): JSX.Element {
|
|
12
13
|
const {metadata, frontMatter, assets} = useDoc();
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
|
-
import {ThemeClassNames
|
|
9
|
+
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
10
|
+
import {useDoc} from '@docusaurus/theme-common/internal';
|
|
10
11
|
|
|
11
12
|
import TOC from '@theme/TOC';
|
|
12
13
|
|
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
-
import {ThemeClassNames
|
|
10
|
+
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
11
|
+
import {useDoc} from '@docusaurus/theme-common/internal';
|
|
12
|
+
|
|
11
13
|
import TOCCollapsible from '@theme/TOCCollapsible';
|
|
12
14
|
|
|
13
15
|
import styles from './styles.module.css';
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
|
-
import {HtmlClassNameProvider
|
|
9
|
+
import {HtmlClassNameProvider} from '@docusaurus/theme-common';
|
|
10
|
+
import {DocProvider} from '@docusaurus/theme-common/internal';
|
|
10
11
|
import DocItemMetadata from '@theme/DocItem/Metadata';
|
|
11
12
|
import DocItemLayout from '@theme/DocItem/Layout';
|
|
12
13
|
import type {Props} from '@theme/DocItem';
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
-
import {useDocsSidebar} from '@docusaurus/theme-common';
|
|
10
|
+
import {useDocsSidebar} from '@docusaurus/theme-common/internal';
|
|
11
11
|
import type {Props} from '@theme/DocPage/Layout/Main';
|
|
12
12
|
|
|
13
13
|
import styles from './styles.module.css';
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
import React, {type ReactNode, useState, useCallback} from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
-
import {ThemeClassNames
|
|
10
|
+
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
11
|
+
import {useDocsSidebar} from '@docusaurus/theme-common/internal';
|
|
11
12
|
import {useLocation} from '@docusaurus/router';
|
|
12
13
|
import DocSidebar from '@theme/DocSidebar';
|
|
13
14
|
import ExpandButton from '@theme/DocPage/Layout/Sidebar/ExpandButton';
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React, {useState} from 'react';
|
|
9
|
-
import {useDocsSidebar} from '@docusaurus/theme-common';
|
|
9
|
+
import {useDocsSidebar} from '@docusaurus/theme-common/internal';
|
|
10
10
|
import Layout from '@theme/Layout';
|
|
11
11
|
import BackToTopButton from '@theme/BackToTopButton';
|
|
12
12
|
import DocPageLayoutSidebar from '@theme/DocPage/Layout/Sidebar';
|
|
@@ -7,14 +7,13 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
+
import {HtmlClassNameProvider, ThemeClassNames} from '@docusaurus/theme-common';
|
|
10
11
|
import {
|
|
11
|
-
HtmlClassNameProvider,
|
|
12
|
-
ThemeClassNames,
|
|
13
12
|
docVersionSearchTag,
|
|
14
13
|
DocsSidebarProvider,
|
|
15
14
|
DocsVersionProvider,
|
|
16
15
|
useDocRouteMetadata,
|
|
17
|
-
} from '@docusaurus/theme-common';
|
|
16
|
+
} from '@docusaurus/theme-common/internal';
|
|
18
17
|
import DocPageLayout from '@theme/DocPage/Layout';
|
|
19
18
|
import NotFound from '@theme/NotFound';
|
|
20
19
|
import SearchMetadata from '@theme/SearchMetadata';
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
|
|
8
8
|
import React, {useState} from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
+
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
10
11
|
import {
|
|
11
|
-
ThemeClassNames,
|
|
12
12
|
useAnnouncementBar,
|
|
13
13
|
useScrollPosition,
|
|
14
|
-
} from '@docusaurus/theme-common';
|
|
14
|
+
} from '@docusaurus/theme-common/internal';
|
|
15
15
|
import DocSidebarItems from '@theme/DocSidebarItems';
|
|
16
16
|
import type {Props} from '@theme/DocSidebar/Desktop/Content';
|
|
17
17
|
|
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
NavbarSecondaryMenuFiller,
|
|
12
12
|
type NavbarSecondaryMenuComponent,
|
|
13
13
|
ThemeClassNames,
|
|
14
|
-
useNavbarMobileSidebar,
|
|
15
14
|
} from '@docusaurus/theme-common';
|
|
15
|
+
import {useNavbarMobileSidebar} from '@docusaurus/theme-common/internal';
|
|
16
16
|
import DocSidebarItems from '@theme/DocSidebarItems';
|
|
17
17
|
import type {Props} from '@theme/DocSidebar/Mobile';
|
|
18
18
|
|
|
@@ -8,16 +8,18 @@
|
|
|
8
8
|
import React, {type ComponentProps, useEffect, useMemo} from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
10
|
import {
|
|
11
|
-
|
|
11
|
+
ThemeClassNames,
|
|
12
|
+
useThemeConfig,
|
|
12
13
|
usePrevious,
|
|
13
14
|
Collapsible,
|
|
14
15
|
useCollapsible,
|
|
16
|
+
} from '@docusaurus/theme-common';
|
|
17
|
+
import {
|
|
18
|
+
isActiveSidebarItem,
|
|
15
19
|
findFirstCategoryLink,
|
|
16
|
-
ThemeClassNames,
|
|
17
|
-
useThemeConfig,
|
|
18
20
|
useDocSidebarItemsExpandedState,
|
|
19
21
|
isSamePath,
|
|
20
|
-
} from '@docusaurus/theme-common';
|
|
22
|
+
} from '@docusaurus/theme-common/internal';
|
|
21
23
|
import Link from '@docusaurus/Link';
|
|
22
24
|
import {translate} from '@docusaurus/Translate';
|
|
23
25
|
import useIsBrowser from '@docusaurus/useIsBrowser';
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
-
import {
|
|
10
|
+
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
11
|
+
import {isActiveSidebarItem} from '@docusaurus/theme-common/internal';
|
|
11
12
|
import Link from '@docusaurus/Link';
|
|
12
13
|
import isInternalUrl from '@docusaurus/isInternalUrl';
|
|
13
14
|
import IconExternalLink from '@theme/IconExternalLink';
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React, {memo} from 'react';
|
|
9
|
-
import {DocSidebarItemsExpandedStateProvider} from '@docusaurus/theme-common';
|
|
9
|
+
import {DocSidebarItemsExpandedStateProvider} from '@docusaurus/theme-common/internal';
|
|
10
10
|
import DocSidebarItem from '@theme/DocSidebarItem';
|
|
11
11
|
|
|
12
12
|
import type {Props} from '@theme/DocSidebarItems';
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
10
|
import Translate from '@docusaurus/Translate';
|
|
11
|
-
import {ThemeClassNames
|
|
11
|
+
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
12
|
+
import {useDocsVersion} from '@docusaurus/theme-common/internal';
|
|
12
13
|
import type {Props} from '@theme/DocVersionBadge';
|
|
13
14
|
|
|
14
15
|
export default function DocVersionBadge({
|
|
@@ -15,12 +15,11 @@ import {
|
|
|
15
15
|
useDocVersionSuggestions,
|
|
16
16
|
type GlobalVersion,
|
|
17
17
|
} from '@docusaurus/plugin-content-docs/client';
|
|
18
|
+
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
18
19
|
import {
|
|
19
|
-
ThemeClassNames,
|
|
20
20
|
useDocsPreferredVersion,
|
|
21
21
|
useDocsVersion,
|
|
22
|
-
} from '@docusaurus/theme-common';
|
|
23
|
-
|
|
22
|
+
} from '@docusaurus/theme-common/internal';
|
|
24
23
|
import type {Props} from '@theme/DocVersionBanner';
|
|
25
24
|
import type {
|
|
26
25
|
VersionBanner,
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
|
+
import clsx from 'clsx';
|
|
9
10
|
import Link from '@docusaurus/Link';
|
|
10
11
|
import {useBaseUrlUtils} from '@docusaurus/useBaseUrl';
|
|
11
12
|
import ThemedImage from '@theme/ThemedImage';
|
|
@@ -21,11 +22,12 @@ function LogoImage({logo}: Props) {
|
|
|
21
22
|
};
|
|
22
23
|
return (
|
|
23
24
|
<ThemedImage
|
|
24
|
-
className=
|
|
25
|
+
className={clsx('footer__logo', logo.className)}
|
|
25
26
|
alt={logo.alt}
|
|
26
27
|
sources={sources}
|
|
27
28
|
width={logo.width}
|
|
28
29
|
height={logo.height}
|
|
30
|
+
style={logo.style}
|
|
29
31
|
/>
|
|
30
32
|
);
|
|
31
33
|
}
|
|
@@ -8,11 +8,8 @@
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
10
|
import ErrorBoundary from '@docusaurus/ErrorBoundary';
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
ThemeClassNames,
|
|
14
|
-
useKeyboardNavigation,
|
|
15
|
-
} from '@docusaurus/theme-common';
|
|
11
|
+
import {PageMetadata, ThemeClassNames} from '@docusaurus/theme-common';
|
|
12
|
+
import {useKeyboardNavigation} from '@docusaurus/theme-common/internal';
|
|
16
13
|
import SkipToContent from '@theme/SkipToContent';
|
|
17
14
|
import AnnouncementBar from '@theme/AnnouncementBar';
|
|
18
15
|
import Navbar from '@theme/Navbar';
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
ScrollControllerProvider,
|
|
15
15
|
NavbarProvider,
|
|
16
16
|
PluginHtmlClassNameProvider,
|
|
17
|
-
} from '@docusaurus/theme-common';
|
|
17
|
+
} from '@docusaurus/theme-common/internal';
|
|
18
18
|
import type {Props} from '@theme/LayoutProviders';
|
|
19
19
|
|
|
20
20
|
export default function LayoutProviders({children}: Props): JSX.Element {
|
package/src/theme/Logo/index.tsx
CHANGED
|
@@ -9,24 +9,53 @@ import React from 'react';
|
|
|
9
9
|
import Link from '@docusaurus/Link';
|
|
10
10
|
import useBaseUrl from '@docusaurus/useBaseUrl';
|
|
11
11
|
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
|
12
|
-
import {useThemeConfig} from '@docusaurus/theme-common';
|
|
12
|
+
import {useThemeConfig, type NavbarLogo} from '@docusaurus/theme-common';
|
|
13
13
|
import ThemedImage from '@theme/ThemedImage';
|
|
14
14
|
import type {Props} from '@theme/Logo';
|
|
15
15
|
|
|
16
|
+
function LogoThemedImage({
|
|
17
|
+
logo,
|
|
18
|
+
alt,
|
|
19
|
+
imageClassName,
|
|
20
|
+
}: {
|
|
21
|
+
logo: NavbarLogo;
|
|
22
|
+
alt: string;
|
|
23
|
+
imageClassName?: string;
|
|
24
|
+
}) {
|
|
25
|
+
const sources = {
|
|
26
|
+
light: useBaseUrl(logo.src),
|
|
27
|
+
dark: useBaseUrl(logo.srcDark || logo.src),
|
|
28
|
+
};
|
|
29
|
+
const themedImage = (
|
|
30
|
+
<ThemedImage
|
|
31
|
+
className={logo.className}
|
|
32
|
+
sources={sources}
|
|
33
|
+
height={logo.height}
|
|
34
|
+
width={logo.width}
|
|
35
|
+
alt={alt}
|
|
36
|
+
style={logo.style}
|
|
37
|
+
/>
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
// Is this extra div really necessary?
|
|
41
|
+
// introduced in https://github.com/facebook/docusaurus/pull/5666
|
|
42
|
+
return imageClassName ? (
|
|
43
|
+
<div className={imageClassName}>{themedImage}</div>
|
|
44
|
+
) : (
|
|
45
|
+
themedImage
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
16
49
|
export default function Logo(props: Props): JSX.Element {
|
|
17
50
|
const {
|
|
18
51
|
siteConfig: {title},
|
|
19
52
|
} = useDocusaurusContext();
|
|
20
53
|
const {
|
|
21
|
-
navbar: {title: navbarTitle, logo
|
|
54
|
+
navbar: {title: navbarTitle, logo},
|
|
22
55
|
} = useThemeConfig();
|
|
23
56
|
|
|
24
57
|
const {imageClassName, titleClassName, ...propsRest} = props;
|
|
25
|
-
const logoLink = useBaseUrl(logo
|
|
26
|
-
const sources = {
|
|
27
|
-
light: useBaseUrl(logo.src),
|
|
28
|
-
dark: useBaseUrl(logo.srcDark || logo.src),
|
|
29
|
-
};
|
|
58
|
+
const logoLink = useBaseUrl(logo?.href || '/');
|
|
30
59
|
|
|
31
60
|
// If visible title is shown, fallback alt text should be
|
|
32
61
|
// an empty string to mark the logo as decorative.
|
|
@@ -34,28 +63,20 @@ export default function Logo(props: Props): JSX.Element {
|
|
|
34
63
|
|
|
35
64
|
// Use logo alt text if provided (including empty string),
|
|
36
65
|
// and provide a sensible fallback otherwise.
|
|
37
|
-
const alt = logo
|
|
38
|
-
|
|
39
|
-
const themedImage = (
|
|
40
|
-
<ThemedImage
|
|
41
|
-
sources={sources}
|
|
42
|
-
height={logo.height}
|
|
43
|
-
width={logo.width}
|
|
44
|
-
alt={alt}
|
|
45
|
-
/>
|
|
46
|
-
);
|
|
66
|
+
const alt = logo?.alt ?? fallbackAlt;
|
|
47
67
|
|
|
48
68
|
return (
|
|
49
69
|
<Link
|
|
50
70
|
to={logoLink}
|
|
51
71
|
{...propsRest}
|
|
52
|
-
{...(logo
|
|
53
|
-
{logo
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
72
|
+
{...(logo?.target && {target: logo.target})}>
|
|
73
|
+
{logo && (
|
|
74
|
+
<LogoThemedImage
|
|
75
|
+
logo={logo}
|
|
76
|
+
alt={alt}
|
|
77
|
+
imageClassName={imageClassName}
|
|
78
|
+
/>
|
|
79
|
+
)}
|
|
59
80
|
{navbarTitle != null && <b className={titleClassName}>{navbarTitle}</b>}
|
|
60
81
|
</Link>
|
|
61
82
|
);
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React, {type ReactNode} from 'react';
|
|
9
|
+
import {useThemeConfig} from '@docusaurus/theme-common';
|
|
9
10
|
import {
|
|
10
11
|
splitNavbarItems,
|
|
11
12
|
useNavbarMobileSidebar,
|
|
12
|
-
|
|
13
|
-
} from '@docusaurus/theme-common';
|
|
13
|
+
} from '@docusaurus/theme-common/internal';
|
|
14
14
|
import NavbarItem, {type Props as NavbarItemConfig} from '@theme/NavbarItem';
|
|
15
15
|
import NavbarColorModeToggle from '@theme/Navbar/ColorModeToggle';
|
|
16
16
|
import SearchBar from '@theme/SearchBar';
|