@docusaurus/theme-classic 0.0.0-5077 → 0.0.0-5084

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.
@@ -22,7 +22,7 @@ export default function MDXCode(props) {
22
22
  const shouldBeInline = React.Children.toArray(props.children).every(
23
23
  (el) =>
24
24
  (typeof el === 'string' && !el.includes('\n')) ||
25
- (isValidElement(el) && inlineElements.includes(el.props.mdxType)),
25
+ (isValidElement(el) && inlineElements.includes(el.props?.mdxType)),
26
26
  );
27
27
  return shouldBeInline ? <code {...props} /> : <CodeBlock {...props} />;
28
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/theme-classic",
3
- "version": "0.0.0-5077",
3
+ "version": "0.0.0-5084",
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-5077",
24
- "@docusaurus/mdx-loader": "0.0.0-5077",
25
- "@docusaurus/module-type-aliases": "0.0.0-5077",
26
- "@docusaurus/plugin-content-blog": "0.0.0-5077",
27
- "@docusaurus/plugin-content-docs": "0.0.0-5077",
28
- "@docusaurus/plugin-content-pages": "0.0.0-5077",
29
- "@docusaurus/theme-common": "0.0.0-5077",
30
- "@docusaurus/theme-translations": "0.0.0-5077",
31
- "@docusaurus/types": "0.0.0-5077",
32
- "@docusaurus/utils": "0.0.0-5077",
33
- "@docusaurus/utils-common": "0.0.0-5077",
34
- "@docusaurus/utils-validation": "0.0.0-5077",
23
+ "@docusaurus/core": "0.0.0-5084",
24
+ "@docusaurus/mdx-loader": "0.0.0-5084",
25
+ "@docusaurus/module-type-aliases": "0.0.0-5084",
26
+ "@docusaurus/plugin-content-blog": "0.0.0-5084",
27
+ "@docusaurus/plugin-content-docs": "0.0.0-5084",
28
+ "@docusaurus/plugin-content-pages": "0.0.0-5084",
29
+ "@docusaurus/theme-common": "0.0.0-5084",
30
+ "@docusaurus/theme-translations": "0.0.0-5084",
31
+ "@docusaurus/types": "0.0.0-5084",
32
+ "@docusaurus/utils": "0.0.0-5084",
33
+ "@docusaurus/utils-common": "0.0.0-5084",
34
+ "@docusaurus/utils-validation": "0.0.0-5084",
35
35
  "@mdx-js/react": "^1.6.22",
36
36
  "clsx": "^1.1.1",
37
37
  "copy-text-to-clipboard": "^3.0.1",
@@ -64,5 +64,5 @@
64
64
  "engines": {
65
65
  "node": ">=16.14"
66
66
  },
67
- "gitHead": "c94e9b3454e0518e25d5a8cdf85278a491125b19"
67
+ "gitHead": "4db4f1b0fa7df2b6307358354d1f6743de22e310"
68
68
  }
@@ -11,7 +11,7 @@ import CodeBlock from '@theme/CodeBlock';
11
11
  import type {Props} from '@theme/MDXComponents/Code';
12
12
 
13
13
  export default function MDXCode(props: Props): JSX.Element {
14
- const inlineElements = [
14
+ const inlineElements: (string | undefined)[] = [
15
15
  'a',
16
16
  'b',
17
17
  'big',
@@ -26,7 +26,10 @@ export default function MDXCode(props: Props): JSX.Element {
26
26
  const shouldBeInline = React.Children.toArray(props.children).every(
27
27
  (el) =>
28
28
  (typeof el === 'string' && !el.includes('\n')) ||
29
- (isValidElement(el) && inlineElements.includes(el.props.mdxType)),
29
+ (isValidElement(el) &&
30
+ inlineElements.includes(
31
+ (el.props as {mdxType: string} | null)?.mdxType,
32
+ )),
30
33
  );
31
34
 
32
35
  return shouldBeInline ? (
@@ -15,7 +15,8 @@ export default function MDXDetails(props: Props): JSX.Element {
15
15
  // Details theme component
16
16
  const summary = items.find(
17
17
  (item): item is ReactElement<ComponentProps<'summary'>> =>
18
- React.isValidElement(item) && item.props?.mdxType === 'summary',
18
+ React.isValidElement(item) &&
19
+ (item.props as {mdxType: string} | null)?.mdxType === 'summary',
19
20
  );
20
21
  const children = <>{items.filter((item) => item !== summary)}</>;
21
22
 
@@ -5,8 +5,8 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import React, {type ReactElement, type ComponentProps} from 'react';
9
- import Head from '@docusaurus/Head';
8
+ import React, {type ReactElement} from 'react';
9
+ import Head, {type Props as HeadProps} from '@docusaurus/Head';
10
10
  import type {Props} from '@theme/MDXComponents/Head';
11
11
 
12
12
  // MDX elements are wrapped through the MDX pragma. In some cases (notably usage
@@ -25,7 +25,5 @@ export default function MDXHead(props: Props): JSX.Element {
25
25
  const unwrappedChildren = React.Children.map(props.children, (child) =>
26
26
  React.isValidElement(child) ? unwrapMDXElement(child) : child,
27
27
  );
28
- return (
29
- <Head {...(props as ComponentProps<typeof Head>)}>{unwrappedChildren}</Head>
30
- );
28
+ return <Head {...(props as HeadProps)}>{unwrappedChildren}</Head>;
31
29
  }
@@ -14,7 +14,8 @@ export default function MDXPre(props: Props): JSX.Element {
14
14
  <CodeBlock
15
15
  // If this pre is created by a ``` fenced codeblock, unwrap the children
16
16
  {...(isValidElement(props.children) &&
17
- props.children.props?.originalType === 'code'
17
+ (props.children.props as {originalType: string} | null)?.originalType ===
18
+ 'code'
18
19
  ? props.children.props
19
20
  : {...props})}
20
21
  />