@docusaurus/theme-classic 3.6.3-canary-6175 → 3.6.3-canary-6178
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/options.js +7 -4
- package/lib/theme/Footer/LinkItem/index.js +3 -2
- package/lib/theme/Footer/Links/MultiColumn/index.js +3 -2
- package/lib/theme/Footer/Links/Simple/index.js +2 -1
- package/package.json +17 -17
- package/src/options.ts +8 -6
- package/src/theme/Footer/LinkItem/index.tsx +3 -3
- package/src/theme/Footer/Links/MultiColumn/index.tsx +3 -2
- package/src/theme/Footer/Links/Simple/index.tsx +2 -1
package/lib/options.js
CHANGED
|
@@ -271,6 +271,7 @@ const FooterLinkItemSchema = utils_validation_1.Joi.object({
|
|
|
271
271
|
href: utils_validation_1.URISchema,
|
|
272
272
|
html: utils_validation_1.Joi.string(),
|
|
273
273
|
label: utils_validation_1.Joi.string(),
|
|
274
|
+
className: utils_validation_1.Joi.string(),
|
|
274
275
|
})
|
|
275
276
|
.xor('to', 'href', 'html')
|
|
276
277
|
.with('to', 'label')
|
|
@@ -279,6 +280,11 @@ const FooterLinkItemSchema = utils_validation_1.Joi.object({
|
|
|
279
280
|
// We allow any unknown attributes on the links (users may need additional
|
|
280
281
|
// attributes like target, aria-role, data-customAttribute...)
|
|
281
282
|
.unknown();
|
|
283
|
+
const FooterColumnItemSchema = utils_validation_1.Joi.object({
|
|
284
|
+
title: utils_validation_1.Joi.string().allow(null).default(null),
|
|
285
|
+
className: utils_validation_1.Joi.string(),
|
|
286
|
+
items: utils_validation_1.Joi.array().items(FooterLinkItemSchema).default([]),
|
|
287
|
+
});
|
|
282
288
|
const LogoSchema = utils_validation_1.Joi.object({
|
|
283
289
|
alt: utils_validation_1.Joi.string().allow(''),
|
|
284
290
|
src: utils_validation_1.Joi.string().required(),
|
|
@@ -340,10 +346,7 @@ exports.ThemeConfigSchema = utils_validation_1.Joi.object({
|
|
|
340
346
|
style: utils_validation_1.Joi.string().equal('dark', 'light').default('light'),
|
|
341
347
|
logo: LogoSchema,
|
|
342
348
|
copyright: utils_validation_1.Joi.string(),
|
|
343
|
-
links: utils_validation_1.Joi.alternatives(utils_validation_1.Joi.array().items(utils_validation_1.Joi.
|
|
344
|
-
title: utils_validation_1.Joi.string().allow(null).default(null),
|
|
345
|
-
items: utils_validation_1.Joi.array().items(FooterLinkItemSchema).default([]),
|
|
346
|
-
})), utils_validation_1.Joi.array().items(FooterLinkItemSchema))
|
|
349
|
+
links: utils_validation_1.Joi.alternatives(utils_validation_1.Joi.array().items(FooterColumnItemSchema), utils_validation_1.Joi.array().items(FooterLinkItemSchema))
|
|
347
350
|
.messages({
|
|
348
351
|
'alternatives.match': `The footer must be either simple or multi-column, and not a mix of the two. See: https://docusaurus.io/docs/api/themes/configuration#footer-links`,
|
|
349
352
|
})
|
|
@@ -5,17 +5,18 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
|
+
import clsx from 'clsx';
|
|
8
9
|
import Link from '@docusaurus/Link';
|
|
9
10
|
import useBaseUrl from '@docusaurus/useBaseUrl';
|
|
10
11
|
import isInternalUrl from '@docusaurus/isInternalUrl';
|
|
11
12
|
import IconExternalLink from '@theme/Icon/ExternalLink';
|
|
12
13
|
export default function FooterLinkItem({item}) {
|
|
13
|
-
const {to, href, label, prependBaseUrlToHref, ...props} = item;
|
|
14
|
+
const {to, href, label, prependBaseUrlToHref, className, ...props} = item;
|
|
14
15
|
const toUrl = useBaseUrl(to);
|
|
15
16
|
const normalizedHref = useBaseUrl(href, {forcePrependBaseUrl: true});
|
|
16
17
|
return (
|
|
17
18
|
<Link
|
|
18
|
-
className=
|
|
19
|
+
className={clsx('footer__link-item', className)}
|
|
19
20
|
{...(href
|
|
20
21
|
? {
|
|
21
22
|
href: prependBaseUrlToHref ? normalizedHref : href,
|
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
|
+
import clsx from 'clsx';
|
|
8
9
|
import LinkItem from '@theme/Footer/LinkItem';
|
|
9
10
|
function ColumnLinkItem({item}) {
|
|
10
11
|
return item.html ? (
|
|
11
12
|
<li
|
|
12
|
-
className=
|
|
13
|
+
className={clsx('footer__item', item.className)}
|
|
13
14
|
// Developer provided the HTML, so assume it's safe.
|
|
14
15
|
// eslint-disable-next-line react/no-danger
|
|
15
16
|
dangerouslySetInnerHTML={{__html: item.html}}
|
|
@@ -22,7 +23,7 @@ function ColumnLinkItem({item}) {
|
|
|
22
23
|
}
|
|
23
24
|
function Column({column}) {
|
|
24
25
|
return (
|
|
25
|
-
<div className=
|
|
26
|
+
<div className={clsx('col footer__col', column.className)}>
|
|
26
27
|
<div className="footer__title">{column.title}</div>
|
|
27
28
|
<ul className="footer__items clean-list">
|
|
28
29
|
{column.items.map((item, i) => (
|
|
@@ -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 clsx from 'clsx';
|
|
8
9
|
import LinkItem from '@theme/Footer/LinkItem';
|
|
9
10
|
function Separator() {
|
|
10
11
|
return <span className="footer__link-separator">·</span>;
|
|
@@ -12,7 +13,7 @@ function Separator() {
|
|
|
12
13
|
function SimpleLinkItem({item}) {
|
|
13
14
|
return item.html ? (
|
|
14
15
|
<span
|
|
15
|
-
className=
|
|
16
|
+
className={clsx('footer__link-item', item.className)}
|
|
16
17
|
// Developer provided the HTML, so assume it's safe.
|
|
17
18
|
// eslint-disable-next-line react/no-danger
|
|
18
19
|
dangerouslySetInnerHTML={{__html: item.html}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/theme-classic",
|
|
3
|
-
"version": "3.6.3-canary-
|
|
3
|
+
"version": "3.6.3-canary-6178",
|
|
4
4
|
"description": "Classic theme for Docusaurus",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/theme-classic.d.ts",
|
|
@@ -20,19 +20,19 @@
|
|
|
20
20
|
"copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@docusaurus/core": "3.6.3-canary-
|
|
24
|
-
"@docusaurus/logger": "3.6.3-canary-
|
|
25
|
-
"@docusaurus/mdx-loader": "3.6.3-canary-
|
|
26
|
-
"@docusaurus/module-type-aliases": "3.6.3-canary-
|
|
27
|
-
"@docusaurus/plugin-content-blog": "3.6.3-canary-
|
|
28
|
-
"@docusaurus/plugin-content-docs": "3.6.3-canary-
|
|
29
|
-
"@docusaurus/plugin-content-pages": "3.6.3-canary-
|
|
30
|
-
"@docusaurus/theme-common": "3.6.3-canary-
|
|
31
|
-
"@docusaurus/theme-translations": "3.6.3-canary-
|
|
32
|
-
"@docusaurus/types": "3.6.3-canary-
|
|
33
|
-
"@docusaurus/utils": "3.6.3-canary-
|
|
34
|
-
"@docusaurus/utils-common": "3.6.3-canary-
|
|
35
|
-
"@docusaurus/utils-validation": "3.6.3-canary-
|
|
23
|
+
"@docusaurus/core": "3.6.3-canary-6178",
|
|
24
|
+
"@docusaurus/logger": "3.6.3-canary-6178",
|
|
25
|
+
"@docusaurus/mdx-loader": "3.6.3-canary-6178",
|
|
26
|
+
"@docusaurus/module-type-aliases": "3.6.3-canary-6178",
|
|
27
|
+
"@docusaurus/plugin-content-blog": "3.6.3-canary-6178",
|
|
28
|
+
"@docusaurus/plugin-content-docs": "3.6.3-canary-6178",
|
|
29
|
+
"@docusaurus/plugin-content-pages": "3.6.3-canary-6178",
|
|
30
|
+
"@docusaurus/theme-common": "3.6.3-canary-6178",
|
|
31
|
+
"@docusaurus/theme-translations": "3.6.3-canary-6178",
|
|
32
|
+
"@docusaurus/types": "3.6.3-canary-6178",
|
|
33
|
+
"@docusaurus/utils": "3.6.3-canary-6178",
|
|
34
|
+
"@docusaurus/utils-common": "3.6.3-canary-6178",
|
|
35
|
+
"@docusaurus/utils-validation": "3.6.3-canary-6178",
|
|
36
36
|
"@mdx-js/react": "^3.0.0",
|
|
37
37
|
"clsx": "^2.0.0",
|
|
38
38
|
"copy-text-to-clipboard": "^3.2.0",
|
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
"utility-types": "^3.10.0"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"react": "^18.0.0",
|
|
60
|
-
"react-dom": "^18.0.0"
|
|
59
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
60
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
61
61
|
},
|
|
62
62
|
"engines": {
|
|
63
63
|
"node": ">=18.0"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "96c269d1cb6dcc96cd643ec8f06a8ed9db66d05e"
|
|
66
66
|
}
|
package/src/options.ts
CHANGED
|
@@ -308,6 +308,7 @@ const FooterLinkItemSchema = Joi.object({
|
|
|
308
308
|
href: URISchema,
|
|
309
309
|
html: Joi.string(),
|
|
310
310
|
label: Joi.string(),
|
|
311
|
+
className: Joi.string(),
|
|
311
312
|
})
|
|
312
313
|
.xor('to', 'href', 'html')
|
|
313
314
|
.with('to', 'label')
|
|
@@ -317,6 +318,12 @@ const FooterLinkItemSchema = Joi.object({
|
|
|
317
318
|
// attributes like target, aria-role, data-customAttribute...)
|
|
318
319
|
.unknown();
|
|
319
320
|
|
|
321
|
+
const FooterColumnItemSchema = Joi.object({
|
|
322
|
+
title: Joi.string().allow(null).default(null),
|
|
323
|
+
className: Joi.string(),
|
|
324
|
+
items: Joi.array().items(FooterLinkItemSchema).default([]),
|
|
325
|
+
});
|
|
326
|
+
|
|
320
327
|
const LogoSchema = Joi.object({
|
|
321
328
|
alt: Joi.string().allow(''),
|
|
322
329
|
src: Joi.string().required(),
|
|
@@ -384,12 +391,7 @@ export const ThemeConfigSchema = Joi.object<ThemeConfig>({
|
|
|
384
391
|
logo: LogoSchema,
|
|
385
392
|
copyright: Joi.string(),
|
|
386
393
|
links: Joi.alternatives(
|
|
387
|
-
Joi.array().items(
|
|
388
|
-
Joi.object({
|
|
389
|
-
title: Joi.string().allow(null).default(null),
|
|
390
|
-
items: Joi.array().items(FooterLinkItemSchema).default([]),
|
|
391
|
-
}),
|
|
392
|
-
),
|
|
394
|
+
Joi.array().items(FooterColumnItemSchema),
|
|
393
395
|
Joi.array().items(FooterLinkItemSchema),
|
|
394
396
|
)
|
|
395
397
|
.messages({
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React, {type ReactNode} from 'react';
|
|
9
|
-
|
|
9
|
+
import clsx from 'clsx';
|
|
10
10
|
import Link from '@docusaurus/Link';
|
|
11
11
|
import useBaseUrl from '@docusaurus/useBaseUrl';
|
|
12
12
|
import isInternalUrl from '@docusaurus/isInternalUrl';
|
|
@@ -14,13 +14,13 @@ import IconExternalLink from '@theme/Icon/ExternalLink';
|
|
|
14
14
|
import type {Props} from '@theme/Footer/LinkItem';
|
|
15
15
|
|
|
16
16
|
export default function FooterLinkItem({item}: Props): ReactNode {
|
|
17
|
-
const {to, href, label, prependBaseUrlToHref, ...props} = item;
|
|
17
|
+
const {to, href, label, prependBaseUrlToHref, className, ...props} = item;
|
|
18
18
|
const toUrl = useBaseUrl(to);
|
|
19
19
|
const normalizedHref = useBaseUrl(href, {forcePrependBaseUrl: true});
|
|
20
20
|
|
|
21
21
|
return (
|
|
22
22
|
<Link
|
|
23
|
-
className=
|
|
23
|
+
className={clsx('footer__link-item', className)}
|
|
24
24
|
{...(href
|
|
25
25
|
? {
|
|
26
26
|
href: prependBaseUrlToHref ? normalizedHref : href,
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React, {type ReactNode} from 'react';
|
|
9
|
+
import clsx from 'clsx';
|
|
9
10
|
import LinkItem from '@theme/Footer/LinkItem';
|
|
10
11
|
import type {Props} from '@theme/Footer/Links/MultiColumn';
|
|
11
12
|
|
|
@@ -15,7 +16,7 @@ type ColumnItemType = ColumnType['items'][number];
|
|
|
15
16
|
function ColumnLinkItem({item}: {item: ColumnItemType}) {
|
|
16
17
|
return item.html ? (
|
|
17
18
|
<li
|
|
18
|
-
className=
|
|
19
|
+
className={clsx('footer__item', item.className)}
|
|
19
20
|
// Developer provided the HTML, so assume it's safe.
|
|
20
21
|
// eslint-disable-next-line react/no-danger
|
|
21
22
|
dangerouslySetInnerHTML={{__html: item.html}}
|
|
@@ -29,7 +30,7 @@ function ColumnLinkItem({item}: {item: ColumnItemType}) {
|
|
|
29
30
|
|
|
30
31
|
function Column({column}: {column: ColumnType}) {
|
|
31
32
|
return (
|
|
32
|
-
<div className=
|
|
33
|
+
<div className={clsx('col footer__col', column.className)}>
|
|
33
34
|
<div className="footer__title">{column.title}</div>
|
|
34
35
|
<ul className="footer__items clean-list">
|
|
35
36
|
{column.items.map((item, i) => (
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React, {type ReactNode} from 'react';
|
|
9
|
+
import clsx from 'clsx';
|
|
9
10
|
import LinkItem from '@theme/Footer/LinkItem';
|
|
10
11
|
import type {Props} from '@theme/Footer/Links/Simple';
|
|
11
12
|
|
|
@@ -16,7 +17,7 @@ function Separator() {
|
|
|
16
17
|
function SimpleLinkItem({item}: {item: Props['links'][number]}) {
|
|
17
18
|
return item.html ? (
|
|
18
19
|
<span
|
|
19
|
-
className=
|
|
20
|
+
className={clsx('footer__link-item', item.className)}
|
|
20
21
|
// Developer provided the HTML, so assume it's safe.
|
|
21
22
|
// eslint-disable-next-line react/no-danger
|
|
22
23
|
dangerouslySetInnerHTML={{__html: item.html}}
|