@docusaurus/theme-classic 0.0.0-5332 → 0.0.0-5335

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.
@@ -6,6 +6,7 @@
6
6
  */
7
7
  import React from 'react';
8
8
  import Translate from '@docusaurus/Translate';
9
+ import {ErrorBoundaryTryAgainButton} from '@docusaurus/theme-common';
9
10
  export default function ErrorPageContent({error, tryAgain}) {
10
11
  return (
11
12
  <main className="container margin-vert--xl">
@@ -20,13 +21,7 @@ export default function ErrorPageContent({error, tryAgain}) {
20
21
  </h1>
21
22
  <p>{error.message}</p>
22
23
  <div>
23
- <button type="button" onClick={tryAgain}>
24
- <Translate
25
- id="theme.ErrorPageContent.tryAgain"
26
- description="The label of the button to try again when the page crashed">
27
- Try again
28
- </Translate>
29
- </button>
24
+ <ErrorBoundaryTryAgainButton onClick={tryAgain} />
30
25
  </div>
31
26
  </div>
32
27
  </div>
@@ -14,6 +14,7 @@ import MDXHeading from '@theme/MDXComponents/Heading';
14
14
  import MDXUl from '@theme/MDXComponents/Ul';
15
15
  import MDXImg from '@theme/MDXComponents/Img';
16
16
  import Admonition from '@theme/Admonition';
17
+ import Mermaid from '@theme/Mermaid';
17
18
  const MDXComponents = {
18
19
  head: MDXHead,
19
20
  code: MDXCode,
@@ -29,5 +30,6 @@ const MDXComponents = {
29
30
  h5: (props) => <MDXHeading as="h5" {...props} />,
30
31
  h6: (props) => <MDXHeading as="h6" {...props} />,
31
32
  admonition: Admonition,
33
+ mermaid: Mermaid,
32
34
  };
33
35
  export default MDXComponents;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ export { default } from '@docusaurus/Noop';
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ // This component is meant to be implemented by a Mermaid renderer theme
8
+ // It is notable created to be overridden by docusaurus-theme-mermaid
9
+ // By default, the classic theme does not provide any Mermaid implementation
10
+ // Yet we declare it there so that we can register it in MDX
11
+ // TODO later the mermaid theme should be able to register its MDX component
12
+ // see https://github.com/facebook/docusaurus/pull/7490#issuecomment-1279117288
13
+ export {default} from '@docusaurus/Noop';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/theme-classic",
3
- "version": "0.0.0-5332",
3
+ "version": "0.0.0-5335",
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-5332",
24
- "@docusaurus/mdx-loader": "0.0.0-5332",
25
- "@docusaurus/module-type-aliases": "0.0.0-5332",
26
- "@docusaurus/plugin-content-blog": "0.0.0-5332",
27
- "@docusaurus/plugin-content-docs": "0.0.0-5332",
28
- "@docusaurus/plugin-content-pages": "0.0.0-5332",
29
- "@docusaurus/theme-common": "0.0.0-5332",
30
- "@docusaurus/theme-translations": "0.0.0-5332",
31
- "@docusaurus/types": "0.0.0-5332",
32
- "@docusaurus/utils": "0.0.0-5332",
33
- "@docusaurus/utils-common": "0.0.0-5332",
34
- "@docusaurus/utils-validation": "0.0.0-5332",
23
+ "@docusaurus/core": "0.0.0-5335",
24
+ "@docusaurus/mdx-loader": "0.0.0-5335",
25
+ "@docusaurus/module-type-aliases": "0.0.0-5335",
26
+ "@docusaurus/plugin-content-blog": "0.0.0-5335",
27
+ "@docusaurus/plugin-content-docs": "0.0.0-5335",
28
+ "@docusaurus/plugin-content-pages": "0.0.0-5335",
29
+ "@docusaurus/theme-common": "0.0.0-5335",
30
+ "@docusaurus/theme-translations": "0.0.0-5335",
31
+ "@docusaurus/types": "0.0.0-5335",
32
+ "@docusaurus/utils": "0.0.0-5335",
33
+ "@docusaurus/utils-common": "0.0.0-5335",
34
+ "@docusaurus/utils-validation": "0.0.0-5335",
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": "87c793e511060b3753659e150782f38b25694aec"
65
+ "gitHead": "42c59e0828b093f765f6c37d522c02ef74846a31"
66
66
  }
@@ -7,6 +7,7 @@
7
7
 
8
8
  import React from 'react';
9
9
  import Translate from '@docusaurus/Translate';
10
+ import {ErrorBoundaryTryAgainButton} from '@docusaurus/theme-common';
10
11
  import type {Props} from '@theme/Error';
11
12
 
12
13
  export default function ErrorPageContent({
@@ -26,13 +27,7 @@ export default function ErrorPageContent({
26
27
  </h1>
27
28
  <p>{error.message}</p>
28
29
  <div>
29
- <button type="button" onClick={tryAgain}>
30
- <Translate
31
- id="theme.ErrorPageContent.tryAgain"
32
- description="The label of the button to try again when the page crashed">
33
- Try again
34
- </Translate>
35
- </button>
30
+ <ErrorBoundaryTryAgainButton onClick={tryAgain} />
36
31
  </div>
37
32
  </div>
38
33
  </div>
@@ -15,6 +15,7 @@ import MDXHeading from '@theme/MDXComponents/Heading';
15
15
  import MDXUl from '@theme/MDXComponents/Ul';
16
16
  import MDXImg from '@theme/MDXComponents/Img';
17
17
  import Admonition from '@theme/Admonition';
18
+ import Mermaid from '@theme/Mermaid';
18
19
 
19
20
  import type {MDXComponentsObject} from '@theme/MDXComponents';
20
21
 
@@ -33,6 +34,7 @@ const MDXComponents: MDXComponentsObject = {
33
34
  h5: (props) => <MDXHeading as="h5" {...props} />,
34
35
  h6: (props) => <MDXHeading as="h6" {...props} />,
35
36
  admonition: Admonition,
37
+ mermaid: Mermaid,
36
38
  };
37
39
 
38
40
  export default MDXComponents;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ // This component is meant to be implemented by a Mermaid renderer theme
9
+ // It is notable created to be overridden by docusaurus-theme-mermaid
10
+
11
+ // By default, the classic theme does not provide any Mermaid implementation
12
+ // Yet we declare it there so that we can register it in MDX
13
+ // TODO later the mermaid theme should be able to register its MDX component
14
+ // see https://github.com/facebook/docusaurus/pull/7490#issuecomment-1279117288
15
+
16
+ export {default} from '@docusaurus/Noop';
@@ -897,6 +897,7 @@ declare module '@theme/MDXComponents' {
897
897
  import type MDXUl from '@theme/MDXComponents/Ul';
898
898
  import type MDXImg from '@theme/MDXComponents/Img';
899
899
  import type Admonition from '@theme/Admonition';
900
+ import type Mermaid from '@theme/Mermaid';
900
901
 
901
902
  export type MDXComponentsObject = {
902
903
  readonly head: typeof MDXHead;
@@ -913,6 +914,7 @@ declare module '@theme/MDXComponents' {
913
914
  readonly h5: (props: ComponentProps<'h5'>) => JSX.Element;
914
915
  readonly h6: (props: ComponentProps<'h6'>) => JSX.Element;
915
916
  readonly admonition: typeof Admonition;
917
+ readonly mermaid: typeof Mermaid;
916
918
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
917
919
  [tagName: string]: ComponentType<any>;
918
920
  };
@@ -1221,6 +1223,14 @@ declare module '@theme/SearchBar' {
1221
1223
  export default function SearchBar(): JSX.Element;
1222
1224
  }
1223
1225
 
1226
+ declare module '@theme/Mermaid' {
1227
+ export interface Props {
1228
+ value: string;
1229
+ }
1230
+
1231
+ export default function Mermaid(props: Props): JSX.Element;
1232
+ }
1233
+
1224
1234
  declare module '@theme/TabItem' {
1225
1235
  import type {ReactNode} from 'react';
1226
1236