@docusaurus/theme-classic 0.0.0-5273 → 0.0.0-5281
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
CHANGED
|
@@ -24,6 +24,13 @@ function getSwizzleConfig() {
|
|
|
24
24
|
},
|
|
25
25
|
description: 'The color mode toggle to switch between light and dark mode.',
|
|
26
26
|
},
|
|
27
|
+
DocCardList: {
|
|
28
|
+
actions: {
|
|
29
|
+
eject: 'safe',
|
|
30
|
+
wrap: 'safe',
|
|
31
|
+
},
|
|
32
|
+
description: 'The component responsible for rendering a list of sidebar items cards.\nNotable used on the category generated-index pages.',
|
|
33
|
+
},
|
|
27
34
|
DocSidebar: {
|
|
28
35
|
actions: {
|
|
29
36
|
eject: 'unsafe',
|
|
@@ -6,21 +6,24 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
useCurrentSidebarCategory,
|
|
11
|
+
filterDocCardListItems,
|
|
12
|
+
} from '@docusaurus/theme-common';
|
|
10
13
|
import DocCard from '@theme/DocCard';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return items.
|
|
14
|
-
if (item.type === 'category') {
|
|
15
|
-
return !!findFirstCategoryLink(item);
|
|
16
|
-
}
|
|
17
|
-
return true;
|
|
18
|
-
});
|
|
14
|
+
function DocCardListForCurrentSidebarCategory({className}) {
|
|
15
|
+
const category = useCurrentSidebarCategory();
|
|
16
|
+
return <DocCardList items={category.items} className={className} />;
|
|
19
17
|
}
|
|
20
|
-
export default function DocCardList(
|
|
18
|
+
export default function DocCardList(props) {
|
|
19
|
+
const {items, className} = props;
|
|
20
|
+
if (!items) {
|
|
21
|
+
return <DocCardListForCurrentSidebarCategory {...props} />;
|
|
22
|
+
}
|
|
23
|
+
const filteredItems = filterDocCardListItems(items);
|
|
21
24
|
return (
|
|
22
25
|
<section className={clsx('row', className)}>
|
|
23
|
-
{
|
|
26
|
+
{filteredItems.map((item, index) => (
|
|
24
27
|
<article key={index} className="col col--6 margin-bottom--lg">
|
|
25
28
|
<DocCard item={item} />
|
|
26
29
|
</article>
|
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-5281",
|
|
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-5281",
|
|
24
|
+
"@docusaurus/mdx-loader": "0.0.0-5281",
|
|
25
|
+
"@docusaurus/module-type-aliases": "0.0.0-5281",
|
|
26
|
+
"@docusaurus/plugin-content-blog": "0.0.0-5281",
|
|
27
|
+
"@docusaurus/plugin-content-docs": "0.0.0-5281",
|
|
28
|
+
"@docusaurus/plugin-content-pages": "0.0.0-5281",
|
|
29
|
+
"@docusaurus/theme-common": "0.0.0-5281",
|
|
30
|
+
"@docusaurus/theme-translations": "0.0.0-5281",
|
|
31
|
+
"@docusaurus/types": "0.0.0-5281",
|
|
32
|
+
"@docusaurus/utils": "0.0.0-5281",
|
|
33
|
+
"@docusaurus/utils-common": "0.0.0-5281",
|
|
34
|
+
"@docusaurus/utils-validation": "0.0.0-5281",
|
|
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": "30e8125600e78fb976c2d0861ac89314116d6936"
|
|
66
66
|
}
|
package/src/getSwizzleConfig.ts
CHANGED
|
@@ -28,6 +28,14 @@ export default function getSwizzleConfig(): SwizzleConfig {
|
|
|
28
28
|
description:
|
|
29
29
|
'The color mode toggle to switch between light and dark mode.',
|
|
30
30
|
},
|
|
31
|
+
DocCardList: {
|
|
32
|
+
actions: {
|
|
33
|
+
eject: 'safe',
|
|
34
|
+
wrap: 'safe',
|
|
35
|
+
},
|
|
36
|
+
description:
|
|
37
|
+
'The component responsible for rendering a list of sidebar items cards.\nNotable used on the category generated-index pages.',
|
|
38
|
+
},
|
|
31
39
|
DocSidebar: {
|
|
32
40
|
actions: {
|
|
33
41
|
eject: 'unsafe', // Too much technical code in sidebar, not very safe atm
|
|
@@ -7,25 +7,27 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
useCurrentSidebarCategory,
|
|
12
|
+
filterDocCardListItems,
|
|
13
|
+
} from '@docusaurus/theme-common';
|
|
11
14
|
import DocCard from '@theme/DocCard';
|
|
12
15
|
import type {Props} from '@theme/DocCardList';
|
|
13
|
-
import type {PropSidebarItem} from '@docusaurus/plugin-content-docs';
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return items.
|
|
18
|
-
if (item.type === 'category') {
|
|
19
|
-
return !!findFirstCategoryLink(item);
|
|
20
|
-
}
|
|
21
|
-
return true;
|
|
22
|
-
});
|
|
17
|
+
function DocCardListForCurrentSidebarCategory({className}: Props) {
|
|
18
|
+
const category = useCurrentSidebarCategory();
|
|
19
|
+
return <DocCardList items={category.items} className={className} />;
|
|
23
20
|
}
|
|
24
21
|
|
|
25
|
-
export default function DocCardList(
|
|
22
|
+
export default function DocCardList(props: Props): JSX.Element {
|
|
23
|
+
const {items, className} = props;
|
|
24
|
+
if (!items) {
|
|
25
|
+
return <DocCardListForCurrentSidebarCategory {...props} />;
|
|
26
|
+
}
|
|
27
|
+
const filteredItems = filterDocCardListItems(items);
|
|
26
28
|
return (
|
|
27
29
|
<section className={clsx('row', className)}>
|
|
28
|
-
{
|
|
30
|
+
{filteredItems.map((item, index) => (
|
|
29
31
|
<article key={index} className="col col--6 margin-bottom--lg">
|
|
30
32
|
<DocCard item={item} />
|
|
31
33
|
</article>
|
package/src/theme-classic.d.ts
CHANGED
|
@@ -336,7 +336,7 @@ declare module '@theme/DocCardList' {
|
|
|
336
336
|
import type {PropSidebarItem} from '@docusaurus/plugin-content-docs';
|
|
337
337
|
|
|
338
338
|
export interface Props {
|
|
339
|
-
readonly items
|
|
339
|
+
readonly items?: PropSidebarItem[];
|
|
340
340
|
readonly className?: string;
|
|
341
341
|
}
|
|
342
342
|
|