@docusaurus/theme-classic 0.0.0-4837 → 0.0.0-4838

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.
@@ -1031,7 +1031,7 @@ declare module '@theme/IconExternalLink' {
1031
1031
  }
1032
1032
 
1033
1033
  declare module '@theme/TagsListByLetter' {
1034
- import type {TagsListItem} from '@docusaurus/theme-common';
1034
+ import type {TagsListItem} from '@docusaurus/types';
1035
1035
 
1036
1036
  export interface Props {
1037
1037
  readonly tags: readonly TagsListItem[];
@@ -1040,7 +1040,7 @@ declare module '@theme/TagsListByLetter' {
1040
1040
  }
1041
1041
 
1042
1042
  declare module '@theme/TagsListInline' {
1043
- import type {Tag} from '@docusaurus/utils';
1043
+ import type {Tag} from '@docusaurus/types';
1044
1044
 
1045
1045
  export interface Props {
1046
1046
  readonly tags: readonly Tag[];
@@ -1049,7 +1049,7 @@ declare module '@theme/TagsListInline' {
1049
1049
  }
1050
1050
 
1051
1051
  declare module '@theme/Tag' {
1052
- import type {TagsListItem} from '@docusaurus/theme-common';
1052
+ import type {TagsListItem} from '@docusaurus/types';
1053
1053
  import type {Optional} from 'utility-types';
1054
1054
 
1055
1055
  export interface Props extends Optional<TagsListItem, 'count'> {}
@@ -15,8 +15,7 @@ import {
15
15
  } from '@docusaurus/theme-common';
16
16
  import SearchMetadata from '../SearchMetadata';
17
17
  import clsx from 'clsx';
18
- export default function BlogTagsListPage(props) {
19
- const {tags, sidebar} = props;
18
+ export default function BlogTagsListPage({tags, sidebar}) {
20
19
  const title = translateTagsPageTitle();
21
20
  return (
22
21
  <HtmlClassNameProvider
@@ -28,7 +27,7 @@ export default function BlogTagsListPage(props) {
28
27
  <SearchMetadata tag="blog_tags_list" />
29
28
  <BlogLayout sidebar={sidebar}>
30
29
  <h1>{title}</h1>
31
- <TagsListByLetter tags={Object.values(tags)} />
30
+ <TagsListByLetter tags={tags} />
32
31
  </BlogLayout>
33
32
  </HtmlClassNameProvider>
34
33
  );
@@ -38,9 +38,7 @@ function useBlogPostsPlural() {
38
38
  );
39
39
  }
40
40
 
41
- export default function BlogTagsPostsPage(props) {
42
- const {metadata, items, sidebar, listMetadata} = props;
43
- const {allTagsPath, name: tagName, count} = metadata;
41
+ export default function BlogTagsPostsPage({tag, items, sidebar, listMetadata}) {
44
42
  const blogPostsPlural = useBlogPostsPlural();
45
43
  const title = translate(
46
44
  {
@@ -49,8 +47,8 @@ export default function BlogTagsPostsPage(props) {
49
47
  message: '{nPosts} tagged with "{tagName}"',
50
48
  },
51
49
  {
52
- nPosts: blogPostsPlural(count),
53
- tagName,
50
+ nPosts: blogPostsPlural(tag.count),
51
+ tagName: tag.label,
54
52
  },
55
53
  );
56
54
  return (
@@ -65,7 +63,7 @@ export default function BlogTagsPostsPage(props) {
65
63
  <header className="margin-bottom--xl">
66
64
  <h1>{title}</h1>
67
65
 
68
- <Link href={allTagsPath}>
66
+ <Link href={tag.allTagsPath}>
69
67
  <Translate
70
68
  id="theme.tags.tagsPageLink"
71
69
  description="The label of the link targeting the tag list page">
@@ -56,8 +56,8 @@ export default function DocTagDocListPage({tag}) {
56
56
  message: '{nDocsTagged} with "{tagName}"',
57
57
  },
58
58
  {
59
- nDocsTagged: nDocsTaggedPlural(tag.docs.length),
60
- tagName: tag.name,
59
+ nDocsTagged: nDocsTaggedPlural(tag.count),
60
+ tagName: tag.label,
61
61
  },
62
62
  );
63
63
  return (
@@ -83,7 +83,7 @@ export default function DocTagDocListPage({tag}) {
83
83
  </Link>
84
84
  </header>
85
85
  <section className="margin-vert--lg">
86
- {tag.docs.map((doc) => (
86
+ {tag.items.map((doc) => (
87
87
  <DocItem key={doc.id} doc={doc} />
88
88
  ))}
89
89
  </section>
@@ -8,8 +8,7 @@ import React from 'react';
8
8
  import clsx from 'clsx';
9
9
  import Link from '@docusaurus/Link';
10
10
  import styles from './styles.module.css';
11
- export default function Tag(props) {
12
- const {permalink, name, count} = props;
11
+ export default function Tag({permalink, label, count}) {
13
12
  return (
14
13
  <Link
15
14
  href={permalink}
@@ -17,7 +16,7 @@ export default function Tag(props) {
17
16
  styles.tag,
18
17
  count ? styles.tagWithCount : styles.tagRegular,
19
18
  )}>
20
- {name}
19
+ {label}
21
20
  {count && <span>{count}</span>}
22
21
  </Link>
23
22
  );
@@ -22,7 +22,7 @@ export default function TagsListInline({tags}) {
22
22
  <ul className={clsx(styles.tags, 'padding--none', 'margin-left--sm')}>
23
23
  {tags.map(({label, permalink: tagPermalink}) => (
24
24
  <li key={tagPermalink} className={styles.tag}>
25
- <Tag name={label} permalink={tagPermalink} />
25
+ <Tag label={label} permalink={tagPermalink} />
26
26
  </li>
27
27
  ))}
28
28
  </ul>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/theme-classic",
3
- "version": "0.0.0-4837",
3
+ "version": "0.0.0-4838",
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-4837",
25
- "@docusaurus/plugin-content-blog": "0.0.0-4837",
26
- "@docusaurus/plugin-content-docs": "0.0.0-4837",
27
- "@docusaurus/plugin-content-pages": "0.0.0-4837",
28
- "@docusaurus/theme-common": "0.0.0-4837",
29
- "@docusaurus/theme-translations": "0.0.0-4837",
30
- "@docusaurus/utils": "0.0.0-4837",
31
- "@docusaurus/utils-common": "0.0.0-4837",
32
- "@docusaurus/utils-validation": "0.0.0-4837",
24
+ "@docusaurus/core": "0.0.0-4838",
25
+ "@docusaurus/plugin-content-blog": "0.0.0-4838",
26
+ "@docusaurus/plugin-content-docs": "0.0.0-4838",
27
+ "@docusaurus/plugin-content-pages": "0.0.0-4838",
28
+ "@docusaurus/theme-common": "0.0.0-4838",
29
+ "@docusaurus/theme-translations": "0.0.0-4838",
30
+ "@docusaurus/utils": "0.0.0-4838",
31
+ "@docusaurus/utils-common": "0.0.0-4838",
32
+ "@docusaurus/utils-validation": "0.0.0-4838",
33
33
  "@mdx-js/react": "^1.6.22",
34
34
  "clsx": "^1.1.1",
35
35
  "copy-text-to-clipboard": "^3.0.1",
@@ -42,8 +42,8 @@
42
42
  "rtlcss": "^3.5.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@docusaurus/module-type-aliases": "0.0.0-4837",
46
- "@docusaurus/types": "0.0.0-4837",
45
+ "@docusaurus/module-type-aliases": "0.0.0-4838",
46
+ "@docusaurus/types": "0.0.0-4838",
47
47
  "@types/mdx-js__react": "^1.5.5",
48
48
  "@types/prismjs": "^1.26.0",
49
49
  "@types/rtlcss": "^3.1.3",
@@ -59,5 +59,5 @@
59
59
  "engines": {
60
60
  "node": ">=14"
61
61
  },
62
- "gitHead": "475b73ed768e51837beba5fb7bb3885716120e9a"
62
+ "gitHead": "e9b56f063a75e637632bdede9cc507bece7c06f1"
63
63
  }
@@ -19,8 +19,7 @@ import {
19
19
  import SearchMetadata from '../SearchMetadata';
20
20
  import clsx from 'clsx';
21
21
 
22
- export default function BlogTagsListPage(props: Props): JSX.Element {
23
- const {tags, sidebar} = props;
22
+ export default function BlogTagsListPage({tags, sidebar}: Props): JSX.Element {
24
23
  const title = translateTagsPageTitle();
25
24
  return (
26
25
  <HtmlClassNameProvider
@@ -32,7 +31,7 @@ export default function BlogTagsListPage(props: Props): JSX.Element {
32
31
  <SearchMetadata tag="blog_tags_list" />
33
32
  <BlogLayout sidebar={sidebar}>
34
33
  <h1>{title}</h1>
35
- <TagsListByLetter tags={Object.values(tags)} />
34
+ <TagsListByLetter tags={tags} />
36
35
  </BlogLayout>
37
36
  </HtmlClassNameProvider>
38
37
  );
@@ -40,9 +40,12 @@ function useBlogPostsPlural() {
40
40
  );
41
41
  }
42
42
 
43
- export default function BlogTagsPostsPage(props: Props): JSX.Element {
44
- const {metadata, items, sidebar, listMetadata} = props;
45
- const {allTagsPath, name: tagName, count} = metadata;
43
+ export default function BlogTagsPostsPage({
44
+ tag,
45
+ items,
46
+ sidebar,
47
+ listMetadata,
48
+ }: Props): JSX.Element {
46
49
  const blogPostsPlural = useBlogPostsPlural();
47
50
  const title = translate(
48
51
  {
@@ -50,7 +53,7 @@ export default function BlogTagsPostsPage(props: Props): JSX.Element {
50
53
  description: 'The title of the page for a blog tag',
51
54
  message: '{nPosts} tagged with "{tagName}"',
52
55
  },
53
- {nPosts: blogPostsPlural(count), tagName},
56
+ {nPosts: blogPostsPlural(tag.count), tagName: tag.label},
54
57
  );
55
58
 
56
59
  return (
@@ -65,7 +68,7 @@ export default function BlogTagsPostsPage(props: Props): JSX.Element {
65
68
  <header className="margin-bottom--xl">
66
69
  <h1>{title}</h1>
67
70
 
68
- <Link href={allTagsPath}>
71
+ <Link href={tag.allTagsPath}>
69
72
  <Translate
70
73
  id="theme.tags.tagsPageLink"
71
74
  description="The label of the link targeting the tag list page">
@@ -15,7 +15,6 @@ import {
15
15
  ThemeClassNames,
16
16
  usePluralForm,
17
17
  } from '@docusaurus/theme-common';
18
- import type {PropTagDocListDoc} from '@docusaurus/plugin-content-docs';
19
18
  import Translate, {translate} from '@docusaurus/Translate';
20
19
  import type {Props} from '@theme/DocTagDocListPage';
21
20
  import SearchMetadata from '@theme/SearchMetadata';
@@ -39,7 +38,7 @@ function useNDocsTaggedPlural() {
39
38
  );
40
39
  }
41
40
 
42
- function DocItem({doc}: {doc: PropTagDocListDoc}): JSX.Element {
41
+ function DocItem({doc}: {doc: Props['tag']['items'][number]}): JSX.Element {
43
42
  return (
44
43
  <article className="margin-vert--lg">
45
44
  <Link to={doc.permalink}>
@@ -58,7 +57,7 @@ export default function DocTagDocListPage({tag}: Props): JSX.Element {
58
57
  description: 'The title of the page for a docs tag',
59
58
  message: '{nDocsTagged} with "{tagName}"',
60
59
  },
61
- {nDocsTagged: nDocsTaggedPlural(tag.docs.length), tagName: tag.name},
60
+ {nDocsTagged: nDocsTaggedPlural(tag.count), tagName: tag.label},
62
61
  );
63
62
 
64
63
  return (
@@ -84,7 +83,7 @@ export default function DocTagDocListPage({tag}: Props): JSX.Element {
84
83
  </Link>
85
84
  </header>
86
85
  <section className="margin-vert--lg">
87
- {tag.docs.map((doc) => (
86
+ {tag.items.map((doc) => (
88
87
  <DocItem key={doc.id} doc={doc} />
89
88
  ))}
90
89
  </section>
@@ -12,9 +12,7 @@ import type {Props} from '@theme/Tag';
12
12
 
13
13
  import styles from './styles.module.css';
14
14
 
15
- export default function Tag(props: Props): JSX.Element {
16
- const {permalink, name, count} = props;
17
-
15
+ export default function Tag({permalink, label, count}: Props): JSX.Element {
18
16
  return (
19
17
  <Link
20
18
  href={permalink}
@@ -22,7 +20,7 @@ export default function Tag(props: Props): JSX.Element {
22
20
  styles.tag,
23
21
  count ? styles.tagWithCount : styles.tagRegular,
24
22
  )}>
25
- {name}
23
+ {label}
26
24
  {count && <span>{count}</span>}
27
25
  </Link>
28
26
  );
@@ -26,7 +26,7 @@ export default function TagsListInline({tags}: Props): JSX.Element {
26
26
  <ul className={clsx(styles.tags, 'padding--none', 'margin-left--sm')}>
27
27
  {tags.map(({label, permalink: tagPermalink}) => (
28
28
  <li key={tagPermalink} className={styles.tag}>
29
- <Tag name={label} permalink={tagPermalink} />
29
+ <Tag label={label} permalink={tagPermalink} />
30
30
  </li>
31
31
  ))}
32
32
  </ul>
@@ -1031,7 +1031,7 @@ declare module '@theme/IconExternalLink' {
1031
1031
  }
1032
1032
 
1033
1033
  declare module '@theme/TagsListByLetter' {
1034
- import type {TagsListItem} from '@docusaurus/theme-common';
1034
+ import type {TagsListItem} from '@docusaurus/types';
1035
1035
 
1036
1036
  export interface Props {
1037
1037
  readonly tags: readonly TagsListItem[];
@@ -1040,7 +1040,7 @@ declare module '@theme/TagsListByLetter' {
1040
1040
  }
1041
1041
 
1042
1042
  declare module '@theme/TagsListInline' {
1043
- import type {Tag} from '@docusaurus/utils';
1043
+ import type {Tag} from '@docusaurus/types';
1044
1044
 
1045
1045
  export interface Props {
1046
1046
  readonly tags: readonly Tag[];
@@ -1049,7 +1049,7 @@ declare module '@theme/TagsListInline' {
1049
1049
  }
1050
1050
 
1051
1051
  declare module '@theme/Tag' {
1052
- import type {TagsListItem} from '@docusaurus/theme-common';
1052
+ import type {TagsListItem} from '@docusaurus/types';
1053
1053
  import type {Optional} from 'utility-types';
1054
1054
 
1055
1055
  export interface Props extends Optional<TagsListItem, 'count'> {}