@docusaurus/theme-classic 0.0.0-4493 → 0.0.0-4505
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-next/theme/BlogPostItem/index.js +11 -1
- package/lib-next/theme/DocCard/index.js +12 -1
- package/lib-next/theme/DocVersionBadge/index.js +8 -1
- package/lib-next/theme/NavbarItem/LocaleDropdownNavbarItem/index.js +8 -1
- package/lib-next/theme/Toggle/index.js +6 -1
- package/package.json +13 -13
- package/src/theme/BlogPostItem/index.tsx +9 -1
- package/src/theme/DocCard/index.tsx +10 -1
- package/src/theme/DocVersionBadge/index.tsx +6 -1
- package/src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx +8 -1
- package/src/theme/Toggle/index.tsx +6 -1
|
@@ -138,7 +138,17 @@ function BlogPostItem(props) {
|
|
|
138
138
|
})}>
|
|
139
139
|
<Link
|
|
140
140
|
to={metadata.permalink}
|
|
141
|
-
aria-label={
|
|
141
|
+
aria-label={translate(
|
|
142
|
+
{
|
|
143
|
+
message: 'Read more about {title}',
|
|
144
|
+
id: 'theme.blog.post.readMoreLabel',
|
|
145
|
+
description:
|
|
146
|
+
'The ARIA label for the link to full blog posts from excerpts',
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
title,
|
|
150
|
+
},
|
|
151
|
+
)}>
|
|
142
152
|
<b>
|
|
143
153
|
<Translate
|
|
144
154
|
id="theme.blog.post.readMore"
|
|
@@ -10,6 +10,7 @@ import {findFirstCategoryLink, useDocById} from '@docusaurus/theme-common';
|
|
|
10
10
|
import clsx from 'clsx';
|
|
11
11
|
import styles from './styles.module.css';
|
|
12
12
|
import isInternalUrl from '@docusaurus/isInternalUrl';
|
|
13
|
+
import {translate} from '@docusaurus/Translate';
|
|
13
14
|
|
|
14
15
|
function CardContainer({href, children}) {
|
|
15
16
|
const className = clsx(
|
|
@@ -48,7 +49,17 @@ function CardCategory({item}) {
|
|
|
48
49
|
href={href}
|
|
49
50
|
icon="🗃️"
|
|
50
51
|
title={item.label}
|
|
51
|
-
description={
|
|
52
|
+
description={translate(
|
|
53
|
+
{
|
|
54
|
+
message: '{count} items',
|
|
55
|
+
id: 'theme.docs.DocCard.categoryDescription',
|
|
56
|
+
description:
|
|
57
|
+
'The default description for a category card in the generated index about how many items this category includes',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
count: item.items.length,
|
|
61
|
+
},
|
|
62
|
+
)}
|
|
52
63
|
/>
|
|
53
64
|
);
|
|
54
65
|
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
|
+
import Translate from '@docusaurus/Translate';
|
|
8
9
|
import {ThemeClassNames, useDocsVersion} from '@docusaurus/theme-common';
|
|
9
10
|
import clsx from 'clsx';
|
|
10
11
|
export default function DocVersionBadge({className}) {
|
|
@@ -18,7 +19,13 @@ export default function DocVersionBadge({className}) {
|
|
|
18
19
|
ThemeClassNames.docs.docVersionBadge,
|
|
19
20
|
'badge badge--secondary',
|
|
20
21
|
)}>
|
|
21
|
-
|
|
22
|
+
<Translate
|
|
23
|
+
id="theme.docs.versionBadge.label"
|
|
24
|
+
values={{
|
|
25
|
+
versionLabel: versionMetadata.label,
|
|
26
|
+
}}>
|
|
27
|
+
{'Version: {versionLabel}'}
|
|
28
|
+
</Translate>
|
|
22
29
|
</span>
|
|
23
30
|
);
|
|
24
31
|
}
|
|
@@ -9,6 +9,7 @@ import DropdownNavbarItem from '@theme/NavbarItem/DropdownNavbarItem';
|
|
|
9
9
|
import IconLanguage from '@theme/IconLanguage';
|
|
10
10
|
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
|
11
11
|
import {useAlternatePageUtils} from '@docusaurus/theme-common';
|
|
12
|
+
import {translate} from '@docusaurus/Translate';
|
|
12
13
|
import styles from './styles.module.css';
|
|
13
14
|
export default function LocaleDropdownNavbarItem({
|
|
14
15
|
mobile,
|
|
@@ -41,7 +42,13 @@ export default function LocaleDropdownNavbarItem({
|
|
|
41
42
|
});
|
|
42
43
|
const items = [...dropdownItemsBefore, ...localeItems, ...dropdownItemsAfter]; // Mobile is handled a bit differently
|
|
43
44
|
|
|
44
|
-
const dropdownLabel = mobile
|
|
45
|
+
const dropdownLabel = mobile
|
|
46
|
+
? translate({
|
|
47
|
+
message: 'Languages',
|
|
48
|
+
id: 'theme.navbar.mobileLanguageDropdown.label',
|
|
49
|
+
description: 'The label for the mobile language switcher dropdown',
|
|
50
|
+
})
|
|
51
|
+
: getLocaleLabel(currentLocale);
|
|
45
52
|
return (
|
|
46
53
|
<DropdownNavbarItem
|
|
47
54
|
{...props}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import React, {useState, useRef, memo} from 'react';
|
|
8
8
|
import {useThemeConfig} from '@docusaurus/theme-common';
|
|
9
9
|
import useIsBrowser from '@docusaurus/useIsBrowser';
|
|
10
|
+
import {translate} from '@docusaurus/Translate';
|
|
10
11
|
import clsx from 'clsx';
|
|
11
12
|
import styles from './styles.module.css'; // Based on react-toggle (https://github.com/aaronshaf/react-toggle/).
|
|
12
13
|
|
|
@@ -47,7 +48,11 @@ const ToggleComponent = memo(
|
|
|
47
48
|
checked={checked}
|
|
48
49
|
type="checkbox"
|
|
49
50
|
className={styles.toggleScreenReader}
|
|
50
|
-
aria-label=
|
|
51
|
+
aria-label={translate({
|
|
52
|
+
message: 'Switch between dark and light mode',
|
|
53
|
+
id: 'theme.colorToggle.ariaLabel',
|
|
54
|
+
description: 'The ARIA label for the navbar color mode toggle',
|
|
55
|
+
})}
|
|
51
56
|
onChange={onChange}
|
|
52
57
|
onClick={() => setChecked(!checked)}
|
|
53
58
|
onFocus={() => setFocused(true)}
|
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-4505",
|
|
4
4
|
"description": "Classic theme for Docusaurus",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/theme-classic.d.ts",
|
|
@@ -21,15 +21,15 @@
|
|
|
21
21
|
"format:lib-next": "prettier --config ../../.prettierrc --write \"lib-next/**/*.{js,ts,jsx,tsc}\""
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@docusaurus/core": "0.0.0-
|
|
25
|
-
"@docusaurus/plugin-content-blog": "0.0.0-
|
|
26
|
-
"@docusaurus/plugin-content-docs": "0.0.0-
|
|
27
|
-
"@docusaurus/plugin-content-pages": "0.0.0-
|
|
28
|
-
"@docusaurus/theme-common": "0.0.0-
|
|
29
|
-
"@docusaurus/theme-translations": "0.0.0-
|
|
30
|
-
"@docusaurus/utils": "0.0.0-
|
|
31
|
-
"@docusaurus/utils-common": "0.0.0-
|
|
32
|
-
"@docusaurus/utils-validation": "0.0.0-
|
|
24
|
+
"@docusaurus/core": "0.0.0-4505",
|
|
25
|
+
"@docusaurus/plugin-content-blog": "0.0.0-4505",
|
|
26
|
+
"@docusaurus/plugin-content-docs": "0.0.0-4505",
|
|
27
|
+
"@docusaurus/plugin-content-pages": "0.0.0-4505",
|
|
28
|
+
"@docusaurus/theme-common": "0.0.0-4505",
|
|
29
|
+
"@docusaurus/theme-translations": "0.0.0-4505",
|
|
30
|
+
"@docusaurus/utils": "0.0.0-4505",
|
|
31
|
+
"@docusaurus/utils-common": "0.0.0-4505",
|
|
32
|
+
"@docusaurus/utils-validation": "0.0.0-4505",
|
|
33
33
|
"@mdx-js/react": "^1.6.21",
|
|
34
34
|
"clsx": "^1.1.1",
|
|
35
35
|
"copy-text-to-clipboard": "^3.0.1",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"rtlcss": "^3.3.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@docusaurus/module-type-aliases": "0.0.0-
|
|
46
|
-
"@docusaurus/types": "0.0.0-
|
|
45
|
+
"@docusaurus/module-type-aliases": "0.0.0-4505",
|
|
46
|
+
"@docusaurus/types": "0.0.0-4505",
|
|
47
47
|
"@types/mdx-js__react": "^1.5.4",
|
|
48
48
|
"@types/parse-numeric-range": "^0.0.1",
|
|
49
49
|
"@types/prismjs": "^1.16.2",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"engines": {
|
|
61
61
|
"node": ">=14"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "1036abcdfaae4e9c51fdb4be1529172cae0fde0d"
|
|
64
64
|
}
|
|
@@ -135,7 +135,15 @@ function BlogPostItem(props: Props): JSX.Element {
|
|
|
135
135
|
})}>
|
|
136
136
|
<Link
|
|
137
137
|
to={metadata.permalink}
|
|
138
|
-
aria-label={
|
|
138
|
+
aria-label={translate(
|
|
139
|
+
{
|
|
140
|
+
message: 'Read more about {title}',
|
|
141
|
+
id: 'theme.blog.post.readMoreLabel',
|
|
142
|
+
description:
|
|
143
|
+
'The ARIA label for the link to full blog posts from excerpts',
|
|
144
|
+
},
|
|
145
|
+
{title},
|
|
146
|
+
)}>
|
|
139
147
|
<b>
|
|
140
148
|
<Translate
|
|
141
149
|
id="theme.blog.post.readMore"
|
|
@@ -16,6 +16,7 @@ import {findFirstCategoryLink, useDocById} from '@docusaurus/theme-common';
|
|
|
16
16
|
import clsx from 'clsx';
|
|
17
17
|
import styles from './styles.module.css';
|
|
18
18
|
import isInternalUrl from '@docusaurus/isInternalUrl';
|
|
19
|
+
import {translate} from '@docusaurus/Translate';
|
|
19
20
|
|
|
20
21
|
function CardContainer({
|
|
21
22
|
href,
|
|
@@ -70,7 +71,15 @@ function CardCategory({item}: {item: PropSidebarItemCategory}): JSX.Element {
|
|
|
70
71
|
href={href}
|
|
71
72
|
icon="🗃️"
|
|
72
73
|
title={item.label}
|
|
73
|
-
description={
|
|
74
|
+
description={translate(
|
|
75
|
+
{
|
|
76
|
+
message: '{count} items',
|
|
77
|
+
id: 'theme.docs.DocCard.categoryDescription',
|
|
78
|
+
description:
|
|
79
|
+
'The default description for a category card in the generated index about how many items this category includes',
|
|
80
|
+
},
|
|
81
|
+
{count: item.items.length},
|
|
82
|
+
)}
|
|
74
83
|
/>
|
|
75
84
|
);
|
|
76
85
|
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
|
+
import Translate from '@docusaurus/Translate';
|
|
9
10
|
import {ThemeClassNames, useDocsVersion} from '@docusaurus/theme-common';
|
|
10
11
|
import clsx from 'clsx';
|
|
11
12
|
import type {Props} from '@theme/DocVersionBadge';
|
|
@@ -22,7 +23,11 @@ export default function DocVersionBadge({
|
|
|
22
23
|
ThemeClassNames.docs.docVersionBadge,
|
|
23
24
|
'badge badge--secondary',
|
|
24
25
|
)}>
|
|
25
|
-
|
|
26
|
+
<Translate
|
|
27
|
+
id="theme.docs.versionBadge.label"
|
|
28
|
+
values={{versionLabel: versionMetadata.label}}>
|
|
29
|
+
{'Version: {versionLabel}'}
|
|
30
|
+
</Translate>
|
|
26
31
|
</span>
|
|
27
32
|
);
|
|
28
33
|
}
|
|
@@ -11,6 +11,7 @@ import IconLanguage from '@theme/IconLanguage';
|
|
|
11
11
|
import type {Props} from '@theme/NavbarItem/LocaleDropdownNavbarItem';
|
|
12
12
|
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
|
13
13
|
import {useAlternatePageUtils} from '@docusaurus/theme-common';
|
|
14
|
+
import {translate} from '@docusaurus/Translate';
|
|
14
15
|
import type {LinkLikeNavbarItemProps} from '@theme/NavbarItem';
|
|
15
16
|
|
|
16
17
|
import styles from './styles.module.css';
|
|
@@ -48,7 +49,13 @@ export default function LocaleDropdownNavbarItem({
|
|
|
48
49
|
const items = [...dropdownItemsBefore, ...localeItems, ...dropdownItemsAfter];
|
|
49
50
|
|
|
50
51
|
// Mobile is handled a bit differently
|
|
51
|
-
const dropdownLabel = mobile
|
|
52
|
+
const dropdownLabel = mobile
|
|
53
|
+
? translate({
|
|
54
|
+
message: 'Languages',
|
|
55
|
+
id: 'theme.navbar.mobileLanguageDropdown.label',
|
|
56
|
+
description: 'The label for the mobile language switcher dropdown',
|
|
57
|
+
})
|
|
58
|
+
: getLocaleLabel(currentLocale);
|
|
52
59
|
|
|
53
60
|
return (
|
|
54
61
|
<DropdownNavbarItem
|
|
@@ -9,6 +9,7 @@ import React, {useState, useRef, memo} from 'react';
|
|
|
9
9
|
import type {Props} from '@theme/Toggle';
|
|
10
10
|
import {useThemeConfig, type ColorModeConfig} from '@docusaurus/theme-common';
|
|
11
11
|
import useIsBrowser from '@docusaurus/useIsBrowser';
|
|
12
|
+
import {translate} from '@docusaurus/Translate';
|
|
12
13
|
|
|
13
14
|
import clsx from 'clsx';
|
|
14
15
|
import styles from './styles.module.css';
|
|
@@ -61,7 +62,11 @@ const ToggleComponent = memo(
|
|
|
61
62
|
checked={checked}
|
|
62
63
|
type="checkbox"
|
|
63
64
|
className={styles.toggleScreenReader}
|
|
64
|
-
aria-label=
|
|
65
|
+
aria-label={translate({
|
|
66
|
+
message: 'Switch between dark and light mode',
|
|
67
|
+
id: 'theme.colorToggle.ariaLabel',
|
|
68
|
+
description: 'The ARIA label for the navbar color mode toggle',
|
|
69
|
+
})}
|
|
65
70
|
onChange={onChange}
|
|
66
71
|
onClick={() => setChecked(!checked)}
|
|
67
72
|
onFocus={() => setFocused(true)}
|