@docusaurus/theme-classic 0.0.0-5456 → 0.0.0-5462

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.
@@ -18,6 +18,16 @@ export default function Heading({as: As, id, ...props}) {
18
18
  if (As === 'h1' || !id) {
19
19
  return <As {...props} id={undefined} />;
20
20
  }
21
+ const anchorTitle = translate(
22
+ {
23
+ id: 'theme.common.headingLinkTitle',
24
+ message: 'Direct link to {heading}',
25
+ description: 'Title for link to heading',
26
+ },
27
+ {
28
+ heading: typeof props.children === 'string' ? props.children : id,
29
+ },
30
+ );
21
31
  return (
22
32
  <As
23
33
  {...props}
@@ -33,11 +43,8 @@ export default function Heading({as: As, id, ...props}) {
33
43
  <Link
34
44
  className="hash-link"
35
45
  to={`#${id}`}
36
- title={translate({
37
- id: 'theme.common.headingLinkTitle',
38
- message: 'Direct link to heading',
39
- description: 'Title for link to heading',
40
- })}>
46
+ aria-label={anchorTitle}
47
+ title={anchorTitle}>
41
48
  &#8203;
42
49
  </Link>
43
50
  </As>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/theme-classic",
3
- "version": "0.0.0-5456",
3
+ "version": "0.0.0-5462",
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-5456",
24
- "@docusaurus/mdx-loader": "0.0.0-5456",
25
- "@docusaurus/module-type-aliases": "0.0.0-5456",
26
- "@docusaurus/plugin-content-blog": "0.0.0-5456",
27
- "@docusaurus/plugin-content-docs": "0.0.0-5456",
28
- "@docusaurus/plugin-content-pages": "0.0.0-5456",
29
- "@docusaurus/theme-common": "0.0.0-5456",
30
- "@docusaurus/theme-translations": "0.0.0-5456",
31
- "@docusaurus/types": "0.0.0-5456",
32
- "@docusaurus/utils": "0.0.0-5456",
33
- "@docusaurus/utils-common": "0.0.0-5456",
34
- "@docusaurus/utils-validation": "0.0.0-5456",
23
+ "@docusaurus/core": "0.0.0-5462",
24
+ "@docusaurus/mdx-loader": "0.0.0-5462",
25
+ "@docusaurus/module-type-aliases": "0.0.0-5462",
26
+ "@docusaurus/plugin-content-blog": "0.0.0-5462",
27
+ "@docusaurus/plugin-content-docs": "0.0.0-5462",
28
+ "@docusaurus/plugin-content-pages": "0.0.0-5462",
29
+ "@docusaurus/theme-common": "0.0.0-5462",
30
+ "@docusaurus/theme-translations": "0.0.0-5462",
31
+ "@docusaurus/types": "0.0.0-5462",
32
+ "@docusaurus/utils": "0.0.0-5462",
33
+ "@docusaurus/utils-common": "0.0.0-5462",
34
+ "@docusaurus/utils-validation": "0.0.0-5462",
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": "ccafd006910933d7c754ee09e9871a401180361d"
65
+ "gitHead": "dccf63ea9e58192feda38f4cb48a10ab4a632f37"
66
66
  }
@@ -23,6 +23,17 @@ export default function Heading({as: As, id, ...props}: Props): JSX.Element {
23
23
  return <As {...props} id={undefined} />;
24
24
  }
25
25
 
26
+ const anchorTitle = translate(
27
+ {
28
+ id: 'theme.common.headingLinkTitle',
29
+ message: 'Direct link to {heading}',
30
+ description: 'Title for link to heading',
31
+ },
32
+ {
33
+ heading: typeof props.children === 'string' ? props.children : id,
34
+ },
35
+ );
36
+
26
37
  return (
27
38
  <As
28
39
  {...props}
@@ -38,11 +49,8 @@ export default function Heading({as: As, id, ...props}: Props): JSX.Element {
38
49
  <Link
39
50
  className="hash-link"
40
51
  to={`#${id}`}
41
- title={translate({
42
- id: 'theme.common.headingLinkTitle',
43
- message: 'Direct link to heading',
44
- description: 'Title for link to heading',
45
- })}>
52
+ aria-label={anchorTitle}
53
+ title={anchorTitle}>
46
54
  &#8203;
47
55
  </Link>
48
56
  </As>