@docusaurus/theme-classic 2.4.1 → 3.0.0-alpha.0

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.
Files changed (155) hide show
  1. package/lib/getSwizzleConfig.js +99 -7
  2. package/lib/index.js +20 -6
  3. package/lib/nprogress.d.ts +1 -1
  4. package/lib/options.js +1 -0
  5. package/lib/theme/Admonition/Icon/Caution.d.ts +9 -0
  6. package/lib/theme/Admonition/Icon/Caution.js +17 -0
  7. package/lib/theme/Admonition/Icon/Danger.d.ts +9 -0
  8. package/lib/theme/Admonition/Icon/Danger.js +17 -0
  9. package/lib/theme/Admonition/Icon/Info.d.ts +9 -0
  10. package/lib/theme/Admonition/Icon/Info.js +17 -0
  11. package/lib/theme/Admonition/Icon/Note.d.ts +9 -0
  12. package/lib/theme/Admonition/Icon/Note.js +17 -0
  13. package/lib/theme/Admonition/Icon/Tip.d.ts +9 -0
  14. package/lib/theme/Admonition/Icon/Tip.js +17 -0
  15. package/lib/theme/Admonition/Layout/index.d.ts +9 -0
  16. package/lib/theme/Admonition/Layout/index.js +45 -0
  17. package/lib/theme/Admonition/{styles.module.css → Layout/styles.module.css} +4 -0
  18. package/lib/theme/Admonition/Type/Caution.d.ts +9 -0
  19. package/lib/theme/Admonition/Type/Caution.js +32 -0
  20. package/lib/theme/Admonition/Type/Danger.d.ts +9 -0
  21. package/lib/theme/Admonition/Type/Danger.js +32 -0
  22. package/lib/theme/Admonition/Type/Info.d.ts +9 -0
  23. package/lib/theme/Admonition/Type/Info.js +32 -0
  24. package/lib/theme/Admonition/Type/Note.d.ts +9 -0
  25. package/lib/theme/Admonition/Type/Note.js +32 -0
  26. package/lib/theme/Admonition/Type/Tip.d.ts +9 -0
  27. package/lib/theme/Admonition/Type/Tip.js +32 -0
  28. package/lib/theme/Admonition/Types.d.ts +12 -0
  29. package/lib/theme/Admonition/Types.js +33 -0
  30. package/lib/theme/Admonition/index.d.ts +1 -1
  31. package/lib/theme/Admonition/index.js +12 -171
  32. package/lib/theme/BlogArchivePage/index.js +7 -2
  33. package/lib/theme/BlogPostPage/index.js +3 -1
  34. package/lib/theme/BlogSidebar/Desktop/index.js +3 -1
  35. package/lib/theme/BlogSidebar/Mobile/index.js +3 -1
  36. package/lib/theme/BlogTagsListPage/index.js +2 -1
  37. package/lib/theme/BlogTagsPostsPage/index.js +4 -2
  38. package/lib/theme/DocBreadcrumbs/index.js +6 -2
  39. package/lib/theme/DocCard/index.js +8 -4
  40. package/lib/theme/DocItem/Layout/index.js +5 -0
  41. package/lib/theme/{DocPage → DocRoot}/Layout/Main/index.d.ts +2 -2
  42. package/lib/theme/{DocPage → DocRoot}/Layout/Main/index.js +1 -1
  43. package/lib/theme/{DocPage → DocRoot}/Layout/Sidebar/ExpandButton/index.d.ts +2 -2
  44. package/lib/theme/{DocPage → DocRoot}/Layout/Sidebar/ExpandButton/index.js +1 -1
  45. package/lib/theme/{DocPage → DocRoot}/Layout/Sidebar/index.d.ts +2 -2
  46. package/lib/theme/{DocPage → DocRoot}/Layout/Sidebar/index.js +2 -2
  47. package/lib/theme/{DocPage → DocRoot}/Layout/index.d.ts +2 -2
  48. package/lib/theme/{DocPage → DocRoot}/Layout/index.js +9 -10
  49. package/lib/theme/{DocPage → DocRoot}/Layout/styles.module.css +1 -2
  50. package/lib/theme/{DocPage → DocRoot}/index.d.ts +2 -2
  51. package/lib/theme/DocRoot/index.js +31 -0
  52. package/lib/theme/DocSidebarItem/Category/index.js +3 -3
  53. package/lib/theme/DocSidebarItems/index.js +6 -4
  54. package/lib/theme/DocTagDocListPage/index.d.ts +1 -1
  55. package/lib/theme/DocTagDocListPage/index.js +53 -39
  56. package/lib/theme/DocTagsListPage/index.d.ts +1 -1
  57. package/lib/theme/DocTagsListPage/index.js +26 -17
  58. package/lib/theme/DocVersionRoot/index.d.ts +10 -0
  59. package/lib/theme/DocVersionRoot/index.js +46 -0
  60. package/lib/theme/DocsRoot/index.d.ts +10 -0
  61. package/lib/theme/DocsRoot/index.js +18 -0
  62. package/lib/theme/EditThisPage/index.js +3 -6
  63. package/lib/theme/ErrorPageContent.js +3 -2
  64. package/lib/theme/MDXComponents/Code.js +2 -36
  65. package/lib/theme/MDXComponents/Details.js +1 -1
  66. package/lib/theme/MDXComponents/Pre.d.ts +2 -2
  67. package/lib/theme/MDXComponents/Pre.js +4 -11
  68. package/lib/theme/MDXComponents/index.js +3 -3
  69. package/lib/theme/MDXContent/index.js +1 -0
  70. package/lib/theme/MDXPage/index.js +16 -4
  71. package/lib/theme/NavbarItem/DocNavbarItem.js +4 -3
  72. package/lib/theme/NavbarItem/LocaleDropdownNavbarItem/index.d.ts +1 -1
  73. package/lib/theme/NavbarItem/LocaleDropdownNavbarItem/index.js +2 -1
  74. package/lib/theme/NotFound/Content/index.d.ts +9 -0
  75. package/lib/theme/NotFound/Content/index.js +42 -0
  76. package/lib/theme/{NotFound.d.ts → NotFound/index.d.ts} +1 -1
  77. package/lib/theme/NotFound/index.js +25 -0
  78. package/lib/theme/TOCItems/Tree.js +3 -4
  79. package/lib/theme/Tabs/index.js +4 -2
  80. package/lib/theme/TagsListByLetter/index.js +4 -1
  81. package/lib/theme/ThemedImage/index.js +8 -24
  82. package/lib/theme/{MDXComponents/Head.d.ts → Unlisted/index.d.ts} +2 -2
  83. package/lib/theme/Unlisted/index.js +38 -0
  84. package/package.json +24 -24
  85. package/src/getSwizzleConfig.ts +107 -8
  86. package/src/index.ts +21 -6
  87. package/src/nprogress.ts +2 -1
  88. package/src/options.ts +1 -0
  89. package/src/theme/Admonition/Icon/Caution.tsx +20 -0
  90. package/src/theme/Admonition/Icon/Danger.tsx +20 -0
  91. package/src/theme/Admonition/Icon/Info.tsx +20 -0
  92. package/src/theme/Admonition/Icon/Note.tsx +20 -0
  93. package/src/theme/Admonition/Icon/Tip.tsx +20 -0
  94. package/src/theme/Admonition/Layout/index.tsx +57 -0
  95. package/src/theme/Admonition/{styles.module.css → Layout/styles.module.css} +4 -0
  96. package/src/theme/Admonition/Type/Caution.tsx +37 -0
  97. package/src/theme/Admonition/Type/Danger.tsx +37 -0
  98. package/src/theme/Admonition/Type/Info.tsx +37 -0
  99. package/src/theme/Admonition/Type/Note.tsx +37 -0
  100. package/src/theme/Admonition/Type/Tip.tsx +37 -0
  101. package/src/theme/Admonition/Types.tsx +38 -0
  102. package/src/theme/Admonition/index.tsx +13 -194
  103. package/src/theme/BlogArchivePage/index.tsx +7 -2
  104. package/src/theme/BlogPostPage/index.tsx +3 -1
  105. package/src/theme/BlogSidebar/Desktop/index.tsx +3 -1
  106. package/src/theme/BlogSidebar/Mobile/index.tsx +3 -1
  107. package/src/theme/BlogTagsListPage/index.tsx +2 -1
  108. package/src/theme/BlogTagsPostsPage/index.tsx +4 -2
  109. package/src/theme/DocBreadcrumbs/index.tsx +6 -2
  110. package/src/theme/DocCard/index.tsx +11 -6
  111. package/src/theme/DocItem/Layout/index.tsx +5 -0
  112. package/src/theme/{DocPage → DocRoot}/Layout/Main/index.tsx +2 -2
  113. package/src/theme/{DocPage → DocRoot}/Layout/Sidebar/ExpandButton/index.tsx +2 -2
  114. package/src/theme/{DocPage → DocRoot}/Layout/Sidebar/index.tsx +3 -3
  115. package/src/theme/{DocPage → DocRoot}/Layout/index.tsx +10 -11
  116. package/src/theme/{DocPage → DocRoot}/Layout/styles.module.css +1 -2
  117. package/src/theme/DocRoot/index.tsx +34 -0
  118. package/src/theme/DocSidebarItem/Category/index.tsx +3 -3
  119. package/src/theme/DocSidebarItems/index.tsx +6 -4
  120. package/src/theme/DocTagDocListPage/index.tsx +60 -39
  121. package/src/theme/DocTagsListPage/index.tsx +33 -17
  122. package/src/theme/DocVersionRoot/index.tsx +51 -0
  123. package/src/theme/DocsRoot/index.tsx +22 -0
  124. package/src/theme/EditThisPage/index.tsx +3 -6
  125. package/src/theme/ErrorPageContent.tsx +3 -2
  126. package/src/theme/MDXComponents/Code.tsx +2 -39
  127. package/src/theme/MDXComponents/Details.tsx +1 -2
  128. package/src/theme/MDXComponents/Pre.tsx +5 -13
  129. package/src/theme/MDXComponents/index.tsx +3 -3
  130. package/src/theme/MDXContent/index.tsx +1 -0
  131. package/src/theme/MDXPage/index.tsx +16 -4
  132. package/src/theme/NavbarItem/DocNavbarItem.tsx +4 -3
  133. package/src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx +2 -1
  134. package/src/theme/NotFound/Content/index.tsx +45 -0
  135. package/src/theme/NotFound/index.tsx +27 -0
  136. package/src/theme/SkipToContent/index.tsx +0 -1
  137. package/src/theme/TOCItems/Tree.tsx +3 -4
  138. package/src/theme/Tabs/index.tsx +4 -2
  139. package/src/theme/TagsListByLetter/index.tsx +4 -2
  140. package/src/theme/ThemedImage/index.tsx +8 -31
  141. package/src/theme/Unlisted/index.tsx +42 -0
  142. package/src/theme/prism-include-languages.ts +2 -1
  143. package/src/theme-classic.d.ts +130 -20
  144. package/lib/theme/DocPage/index.js +0 -67
  145. package/lib/theme/MDXComponents/Head.js +0 -23
  146. package/lib/theme/NotFound.js +0 -52
  147. package/src/theme/DocPage/index.tsx +0 -71
  148. package/src/theme/MDXComponents/Head.tsx +0 -29
  149. package/src/theme/NotFound.tsx +0 -54
  150. /package/lib/theme/{DocPage → DocRoot}/Layout/Main/styles.module.css +0 -0
  151. /package/lib/theme/{DocPage → DocRoot}/Layout/Sidebar/ExpandButton/styles.module.css +0 -0
  152. /package/lib/theme/{DocPage → DocRoot}/Layout/Sidebar/styles.module.css +0 -0
  153. /package/src/theme/{DocPage → DocRoot}/Layout/Main/styles.module.css +0 -0
  154. /package/src/theme/{DocPage → DocRoot}/Layout/Sidebar/ExpandButton/styles.module.css +0 -0
  155. /package/src/theme/{DocPage → DocRoot}/Layout/Sidebar/styles.module.css +0 -0
@@ -21,6 +21,7 @@ export default function LocaleDropdownNavbarItem({
21
21
  mobile,
22
22
  dropdownItemsBefore,
23
23
  dropdownItemsAfter,
24
+ queryString = '',
24
25
  ...props
25
26
  }: Props): JSX.Element {
26
27
  const {
@@ -35,7 +36,7 @@ export default function LocaleDropdownNavbarItem({
35
36
  fullyQualified: false,
36
37
  })}`;
37
38
  // preserve ?search#hash suffix on locale switches
38
- const to = `${baseTo}${search}${hash}`;
39
+ const to = `${baseTo}${search}${hash}${queryString}`;
39
40
  return {
40
41
  label: localeConfigs[locale]!.label,
41
42
  lang: localeConfigs[locale]!.htmlLang,
@@ -0,0 +1,45 @@
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
+ import React from 'react';
9
+ import clsx from 'clsx';
10
+ import Translate from '@docusaurus/Translate';
11
+ import type {Props} from '@theme/NotFound/Content';
12
+ import Heading from '@theme/Heading';
13
+
14
+ export default function NotFoundContent({className}: Props): JSX.Element {
15
+ return (
16
+ <main className={clsx('container margin-vert--xl', className)}>
17
+ <div className="row">
18
+ <div className="col col--6 col--offset-3">
19
+ <Heading as="h1" className="hero__title">
20
+ <Translate
21
+ id="theme.NotFound.title"
22
+ description="The title of the 404 page">
23
+ Page Not Found
24
+ </Translate>
25
+ </Heading>
26
+ <p>
27
+ <Translate
28
+ id="theme.NotFound.p1"
29
+ description="The first paragraph of the 404 page">
30
+ We could not find what you were looking for.
31
+ </Translate>
32
+ </p>
33
+ <p>
34
+ <Translate
35
+ id="theme.NotFound.p2"
36
+ description="The 2nd paragraph of the 404 page">
37
+ Please contact the owner of the site that linked you to the
38
+ original URL and let them know their link is broken.
39
+ </Translate>
40
+ </p>
41
+ </div>
42
+ </div>
43
+ </main>
44
+ );
45
+ }
@@ -0,0 +1,27 @@
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
+ import React from 'react';
9
+ import {translate} from '@docusaurus/Translate';
10
+ import {PageMetadata} from '@docusaurus/theme-common';
11
+ import Layout from '@theme/Layout';
12
+ import NotFoundContent from '@theme/NotFound/Content';
13
+
14
+ export default function Index(): JSX.Element {
15
+ const title = translate({
16
+ id: 'theme.NotFound.title',
17
+ message: 'Page Not Found',
18
+ });
19
+ return (
20
+ <>
21
+ <PageMetadata title={title} />
22
+ <Layout>
23
+ <NotFoundContent />
24
+ </Layout>
25
+ </>
26
+ );
27
+ }
@@ -7,7 +7,6 @@
7
7
 
8
8
  import React from 'react';
9
9
  import {SkipToContentLink} from '@docusaurus/theme-common';
10
-
11
10
  import styles from './styles.module.css';
12
11
 
13
12
  export default function SkipToContent(): JSX.Element {
@@ -6,6 +6,7 @@
6
6
  */
7
7
 
8
8
  import React from 'react';
9
+ import Link from '@docusaurus/Link';
9
10
  import type {Props} from '@theme/TOCItems/Tree';
10
11
 
11
12
  // Recursive component rendering the toc tree
@@ -22,12 +23,10 @@ function TOCItemTree({
22
23
  <ul className={isChild ? undefined : className}>
23
24
  {toc.map((heading) => (
24
25
  <li key={heading.id}>
25
- {/* eslint-disable-next-line jsx-a11y/control-has-associated-label */}
26
- <a
27
- href={`#${heading.id}`}
26
+ <Link
27
+ to={`#${heading.id}`}
28
28
  className={linkClassName ?? undefined}
29
29
  // Developer provided the HTML, so assume it's safe.
30
- // eslint-disable-next-line react/no-danger
31
30
  dangerouslySetInnerHTML={{__html: heading.value}}
32
31
  />
33
32
  <TOCItemTree
@@ -10,6 +10,7 @@ import clsx from 'clsx';
10
10
  import {
11
11
  useScrollPositionBlocker,
12
12
  useTabs,
13
+ sanitizeTabsChildren,
13
14
  type TabItemProps,
14
15
  } from '@docusaurus/theme-common/internal';
15
16
  import useIsBrowser from '@docusaurus/useIsBrowser';
@@ -152,7 +153,8 @@ export default function Tabs(props: Props): JSX.Element {
152
153
  // Remount tabs after hydration
153
154
  // Temporary fix for https://github.com/facebook/docusaurus/issues/5653
154
155
  key={String(isBrowser)}
155
- {...props}
156
- />
156
+ {...props}>
157
+ {sanitizeTabsChildren(props.children)}
158
+ </TabsComponent>
157
159
  );
158
160
  }
@@ -9,13 +9,15 @@ import React from 'react';
9
9
  import {listTagsByLetters, type TagLetterEntry} from '@docusaurus/theme-common';
10
10
  import Tag from '@theme/Tag';
11
11
  import type {Props} from '@theme/TagsListByLetter';
12
-
12
+ import Heading from '@theme/Heading';
13
13
  import styles from './styles.module.css';
14
14
 
15
15
  function TagLetterEntryItem({letterEntry}: {letterEntry: TagLetterEntry}) {
16
16
  return (
17
17
  <article>
18
- <h2>{letterEntry.letter}</h2>
18
+ <Heading as="h2" id={letterEntry.letter}>
19
+ {letterEntry.letter}
20
+ </Heading>
19
21
  <ul className="padding--none">
20
22
  {letterEntry.tags.map((tag) => (
21
23
  <li key={tag.permalink} className={styles.tag}>
@@ -6,44 +6,21 @@
6
6
  */
7
7
 
8
8
  import React from 'react';
9
- import clsx from 'clsx';
10
- import useIsBrowser from '@docusaurus/useIsBrowser';
11
- import {useColorMode} from '@docusaurus/theme-common';
9
+ import {ThemedComponent} from '@docusaurus/theme-common';
12
10
  import type {Props} from '@theme/ThemedImage';
13
11
 
14
- import styles from './styles.module.css';
15
-
16
12
  export default function ThemedImage(props: Props): JSX.Element {
17
- const isBrowser = useIsBrowser();
18
- const {colorMode} = useColorMode();
19
- const {sources, className, alt, ...propsRest} = props;
20
-
21
- type SourceName = keyof Props['sources'];
22
-
23
- const clientThemes: SourceName[] =
24
- colorMode === 'dark' ? ['dark'] : ['light'];
25
-
26
- const renderedSourceNames: SourceName[] = isBrowser
27
- ? clientThemes
28
- : // We need to render both images on the server to avoid flash
29
- // See https://github.com/facebook/docusaurus/pull/3730
30
- ['light', 'dark'];
31
-
13
+ const {sources, className: parentClassName, alt, ...propsRest} = props;
32
14
  return (
33
- <>
34
- {renderedSourceNames.map((sourceName) => (
15
+ <ThemedComponent className={parentClassName}>
16
+ {({theme, className}) => (
35
17
  <img
36
- key={sourceName}
37
- src={sources[sourceName]}
18
+ src={sources[theme]}
38
19
  alt={alt}
39
- className={clsx(
40
- styles.themedImage,
41
- styles[`themedImage--${sourceName}`],
42
- className,
43
- )}
20
+ className={className}
44
21
  {...propsRest}
45
22
  />
46
- ))}
47
- </>
23
+ )}
24
+ </ThemedComponent>
48
25
  );
49
26
  }
@@ -0,0 +1,42 @@
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
+ import React from 'react';
9
+ import clsx from 'clsx';
10
+ import {
11
+ ThemeClassNames,
12
+ UnlistedBannerTitle,
13
+ UnlistedBannerMessage,
14
+ UnlistedMetadata,
15
+ } from '@docusaurus/theme-common';
16
+ import Admonition from '@theme/Admonition';
17
+ import type {Props} from '@theme/Unlisted';
18
+
19
+ function UnlistedBanner({className}: Props) {
20
+ return (
21
+ <Admonition
22
+ type="caution"
23
+ title={<UnlistedBannerTitle />}
24
+ className={clsx(className, ThemeClassNames.common.unlistedBanner)}>
25
+ <UnlistedBannerMessage />
26
+ </Admonition>
27
+ );
28
+ }
29
+
30
+ export default function Unlisted(props: Props): JSX.Element | null {
31
+ return (
32
+ <>
33
+ {/*
34
+ Unlisted metadata declared here for simplicity.
35
+ Ensures we never forget to add the correct noindex metadata.
36
+ Also gives a central place for user to swizzle override default metadata.
37
+ */}
38
+ <UnlistedMetadata />
39
+ <UnlistedBanner {...props} />
40
+ </>
41
+ );
42
+ }
@@ -7,6 +7,7 @@
7
7
 
8
8
  import siteConfig from '@generated/docusaurus.config';
9
9
  import type * as PrismNamespace from 'prismjs';
10
+ import type {Optional} from 'utility-types';
10
11
 
11
12
  export default function prismIncludeLanguages(
12
13
  PrismObject: typeof PrismNamespace,
@@ -29,5 +30,5 @@ export default function prismIncludeLanguages(
29
30
  require(`prismjs/components/prism-${lang}`);
30
31
  });
31
32
 
32
- delete (globalThis as Global & {Prism?: typeof PrismNamespace}).Prism;
33
+ delete (globalThis as Optional<typeof globalThis, 'Prism'>).Prism;
33
34
  }
@@ -44,13 +44,114 @@ declare module '@theme/Admonition' {
44
44
 
45
45
  export interface Props {
46
46
  readonly children: ReactNode;
47
- readonly type: 'note' | 'tip' | 'danger' | 'info' | 'caution';
47
+ readonly type: string;
48
48
  readonly icon?: ReactNode;
49
49
  readonly title?: ReactNode;
50
+ readonly className?: string;
50
51
  }
52
+
51
53
  export default function Admonition(props: Props): JSX.Element;
52
54
  }
53
55
 
56
+ declare module '@theme/Admonition/Type/Note' {
57
+ import type {Props as AdmonitionProps} from '@theme/Admonition';
58
+
59
+ export interface Props extends AdmonitionProps {}
60
+ export default function AdmonitionTypeNote(props: Props): JSX.Element;
61
+ }
62
+
63
+ declare module '@theme/Admonition/Type/Info' {
64
+ import type {Props as AdmonitionProps} from '@theme/Admonition';
65
+
66
+ export interface Props extends AdmonitionProps {}
67
+ export default function AdmonitionTypeInfo(props: Props): JSX.Element;
68
+ }
69
+
70
+ declare module '@theme/Admonition/Type/Tip' {
71
+ import type {Props as AdmonitionProps} from '@theme/Admonition';
72
+
73
+ export interface Props extends AdmonitionProps {}
74
+ export default function AdmonitionTypeTip(props: Props): JSX.Element;
75
+ }
76
+
77
+ declare module '@theme/Admonition/Type/Caution' {
78
+ import type {Props as AdmonitionProps} from '@theme/Admonition';
79
+
80
+ export interface Props extends AdmonitionProps {}
81
+ export default function AdmonitionTypeCaution(props: Props): JSX.Element;
82
+ }
83
+
84
+ declare module '@theme/Admonition/Type/Danger' {
85
+ import type {Props as AdmonitionProps} from '@theme/Admonition';
86
+
87
+ export interface Props extends AdmonitionProps {}
88
+ export default function AdmonitionTypeDanger(props: Props): JSX.Element;
89
+ }
90
+
91
+ declare module '@theme/Admonition/Types' {
92
+ import type {ComponentType} from 'react';
93
+ import type {Props} from '@theme/Admonition';
94
+
95
+ const AdmonitionTypes: {
96
+ [admonitionType: string]: ComponentType<Props>;
97
+ };
98
+
99
+ export default AdmonitionTypes;
100
+ }
101
+
102
+ declare module '@theme/Admonition/Layout' {
103
+ import type {ReactNode} from 'react';
104
+
105
+ export interface Props {
106
+ readonly children: ReactNode;
107
+ readonly type: string;
108
+ readonly icon?: ReactNode;
109
+ readonly title?: ReactNode;
110
+ readonly className?: string;
111
+ }
112
+ export default function AdmonitionLayout(props: Props): JSX.Element;
113
+ }
114
+
115
+ declare module '@theme/Admonition/Icon/Note' {
116
+ import type {ComponentProps} from 'react';
117
+
118
+ export interface Props extends ComponentProps<'svg'> {}
119
+
120
+ export default function AdmonitionIconNote(props: Props): JSX.Element;
121
+ }
122
+
123
+ declare module '@theme/Admonition/Icon/Tip' {
124
+ import type {ComponentProps} from 'react';
125
+
126
+ export interface Props extends ComponentProps<'svg'> {}
127
+
128
+ export default function AdmonitionIconTip(props: Props): JSX.Element;
129
+ }
130
+
131
+ declare module '@theme/Admonition/Icon/Caution' {
132
+ import type {ComponentProps} from 'react';
133
+
134
+ export interface Props extends ComponentProps<'svg'> {}
135
+
136
+ export default function AdmonitionIconCaution(props: Props): JSX.Element;
137
+ }
138
+
139
+ declare module '@theme/Admonition/Icon/Danger' {
140
+ import type {ComponentProps} from 'react';
141
+
142
+ export interface Props extends ComponentProps<'svg'> {}
143
+
144
+ export default function AdmonitionIconDanger(props: Props): JSX.Element;
145
+ }
146
+
147
+ declare module '@theme/Admonition/Icon/Info' {
148
+ import type {ComponentProps} from 'react';
149
+
150
+ export interface Props extends ComponentProps<'svg'> {}
151
+
152
+ export default function AdmonitionIconInfo(props: Props): JSX.Element;
153
+ }
154
+
54
155
  declare module '@theme/AnnouncementBar' {
55
156
  export default function AnnouncementBar(): JSX.Element | null;
56
157
  }
@@ -379,17 +480,17 @@ declare module '@theme/DocItem/Footer' {
379
480
  export default function DocItemFooter(): JSX.Element;
380
481
  }
381
482
 
382
- declare module '@theme/DocPage/Layout' {
483
+ declare module '@theme/DocRoot/Layout' {
383
484
  import type {ReactNode} from 'react';
384
485
 
385
486
  export interface Props {
386
487
  readonly children: ReactNode;
387
488
  }
388
489
 
389
- export default function DocPageLayout(props: Props): JSX.Element;
490
+ export default function DocRootLayout(props: Props): JSX.Element;
390
491
  }
391
492
 
392
- declare module '@theme/DocPage/Layout/Sidebar' {
493
+ declare module '@theme/DocRoot/Layout/Sidebar' {
393
494
  import type {Dispatch, SetStateAction} from 'react';
394
495
  import type {PropSidebar} from '@docusaurus/plugin-content-docs';
395
496
 
@@ -399,20 +500,20 @@ declare module '@theme/DocPage/Layout/Sidebar' {
399
500
  readonly setHiddenSidebarContainer: Dispatch<SetStateAction<boolean>>;
400
501
  }
401
502
 
402
- export default function DocPageLayoutSidebar(props: Props): JSX.Element;
503
+ export default function DocRootLayoutSidebar(props: Props): JSX.Element;
403
504
  }
404
505
 
405
- declare module '@theme/DocPage/Layout/Sidebar/ExpandButton' {
506
+ declare module '@theme/DocRoot/Layout/Sidebar/ExpandButton' {
406
507
  export interface Props {
407
508
  toggleSidebar: () => void;
408
509
  }
409
510
 
410
- export default function DocPageLayoutSidebarExpandButton(
511
+ export default function DocRootLayoutSidebarExpandButton(
411
512
  props: Props,
412
513
  ): JSX.Element;
413
514
  }
414
515
 
415
- declare module '@theme/DocPage/Layout/Main' {
516
+ declare module '@theme/DocRoot/Layout/Main' {
416
517
  import type {ReactNode} from 'react';
417
518
 
418
519
  export interface Props {
@@ -420,7 +521,7 @@ declare module '@theme/DocPage/Layout/Main' {
420
521
  readonly children: ReactNode;
421
522
  }
422
523
 
423
- export default function DocPageLayoutMain(props: Props): JSX.Element;
524
+ export default function DocRootLayoutMain(props: Props): JSX.Element;
424
525
  }
425
526
 
426
527
  declare module '@theme/DocPaginator' {
@@ -662,6 +763,14 @@ declare module '@theme/Heading' {
662
763
  export default function Heading(props: Props): JSX.Element;
663
764
  }
664
765
 
766
+ declare module '@theme/NotFound/Content' {
767
+ export interface Props {
768
+ readonly className?: string;
769
+ }
770
+
771
+ export default function NotFoundContent(props: Props): JSX.Element;
772
+ }
773
+
665
774
  declare module '@theme/Layout' {
666
775
  import type {ReactNode} from 'react';
667
776
 
@@ -752,14 +861,6 @@ declare module '@theme/MDXComponents/Img' {
752
861
  export default function MDXImg(props: Props): JSX.Element;
753
862
  }
754
863
 
755
- declare module '@theme/MDXComponents/Head' {
756
- import type {ComponentProps} from 'react';
757
-
758
- export interface Props extends ComponentProps<'head'> {}
759
-
760
- export default function MDXHead(props: Props): JSX.Element;
761
- }
762
-
763
864
  declare module '@theme/MDXComponents/Heading' {
764
865
  import type {ComponentProps} from 'react';
765
866
  import type Heading from '@theme/Heading';
@@ -780,7 +881,6 @@ declare module '@theme/MDXComponents/Pre' {
780
881
  declare module '@theme/MDXComponents' {
781
882
  import type {ComponentType, ComponentProps} from 'react';
782
883
 
783
- import type MDXHead from '@theme/MDXComponents/Head';
784
884
  import type MDXCode from '@theme/MDXComponents/Code';
785
885
  import type MDXA from '@theme/MDXComponents/A';
786
886
  import type MDXPre from '@theme/MDXComponents/Pre';
@@ -789,13 +889,14 @@ declare module '@theme/MDXComponents' {
789
889
  import type MDXImg from '@theme/MDXComponents/Img';
790
890
  import type Admonition from '@theme/Admonition';
791
891
  import type Mermaid from '@theme/Mermaid';
892
+ import type Head from '@docusaurus/Head';
792
893
 
793
894
  export type MDXComponentsObject = {
794
- readonly head: typeof MDXHead;
895
+ readonly Head: typeof Head;
896
+ readonly Details: typeof MDXDetails;
795
897
  readonly code: typeof MDXCode;
796
898
  readonly a: typeof MDXA;
797
899
  readonly pre: typeof MDXPre;
798
- readonly details: typeof MDXDetails;
799
900
  readonly ul: typeof MDXUl;
800
901
  readonly img: typeof MDXImg;
801
902
  readonly h1: (props: ComponentProps<'h1'>) => JSX.Element;
@@ -963,6 +1064,7 @@ declare module '@theme/NavbarItem/LocaleDropdownNavbarItem' {
963
1064
  export interface Props extends DropdownNavbarItemProps {
964
1065
  readonly dropdownItemsBefore: LinkLikeNavbarItemProps[];
965
1066
  readonly dropdownItemsAfter: LinkLikeNavbarItemProps[];
1067
+ readonly queryString?: string;
966
1068
  }
967
1069
 
968
1070
  export default function LocaleDropdownNavbarItem(props: Props): JSX.Element;
@@ -1389,6 +1491,14 @@ declare module '@theme/Tag' {
1389
1491
  export default function Tag(props: Props): JSX.Element;
1390
1492
  }
1391
1493
 
1494
+ declare module '@theme/Unlisted' {
1495
+ export interface Props {
1496
+ className?: string;
1497
+ }
1498
+
1499
+ export default function Unlisted(props: Props): JSX.Element;
1500
+ }
1501
+
1392
1502
  declare module '@theme/prism-include-languages' {
1393
1503
  import type * as PrismNamespace from 'prismjs';
1394
1504
 
@@ -1,67 +0,0 @@
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
- import React from 'react';
8
- import clsx from 'clsx';
9
- import {
10
- HtmlClassNameProvider,
11
- ThemeClassNames,
12
- PageMetadata,
13
- } from '@docusaurus/theme-common';
14
- import {
15
- docVersionSearchTag,
16
- DocsSidebarProvider,
17
- DocsVersionProvider,
18
- useDocRouteMetadata,
19
- } from '@docusaurus/theme-common/internal';
20
- import DocPageLayout from '@theme/DocPage/Layout';
21
- import NotFound from '@theme/NotFound';
22
- import SearchMetadata from '@theme/SearchMetadata';
23
- function DocPageMetadata(props) {
24
- const {versionMetadata} = props;
25
- return (
26
- <>
27
- <SearchMetadata
28
- version={versionMetadata.version}
29
- tag={docVersionSearchTag(
30
- versionMetadata.pluginId,
31
- versionMetadata.version,
32
- )}
33
- />
34
- <PageMetadata>
35
- {versionMetadata.noIndex && (
36
- <meta name="robots" content="noindex, nofollow" />
37
- )}
38
- </PageMetadata>
39
- </>
40
- );
41
- }
42
- export default function DocPage(props) {
43
- const {versionMetadata} = props;
44
- const currentDocRouteMetadata = useDocRouteMetadata(props);
45
- if (!currentDocRouteMetadata) {
46
- return <NotFound />;
47
- }
48
- const {docElement, sidebarName, sidebarItems} = currentDocRouteMetadata;
49
- return (
50
- <>
51
- <DocPageMetadata {...props} />
52
- <HtmlClassNameProvider
53
- className={clsx(
54
- // TODO: it should be removed from here
55
- ThemeClassNames.wrapper.docsPages,
56
- ThemeClassNames.page.docsDocPage,
57
- props.versionMetadata.className,
58
- )}>
59
- <DocsVersionProvider version={versionMetadata}>
60
- <DocsSidebarProvider name={sidebarName} items={sidebarItems}>
61
- <DocPageLayout>{docElement}</DocPageLayout>
62
- </DocsSidebarProvider>
63
- </DocsVersionProvider>
64
- </HtmlClassNameProvider>
65
- </>
66
- );
67
- }
@@ -1,23 +0,0 @@
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
- import React from 'react';
8
- import Head from '@docusaurus/Head';
9
- // MDX elements are wrapped through the MDX pragma. In some cases (notably usage
10
- // with Head/Helmet) we need to unwrap those elements.
11
- function unwrapMDXElement(element) {
12
- if (element.props?.mdxType && element.props.originalType) {
13
- const {mdxType, originalType, ...newProps} = element.props;
14
- return React.createElement(element.props.originalType, newProps);
15
- }
16
- return element;
17
- }
18
- export default function MDXHead(props) {
19
- const unwrappedChildren = React.Children.map(props.children, (child) =>
20
- React.isValidElement(child) ? unwrapMDXElement(child) : child,
21
- );
22
- return <Head {...props}>{unwrappedChildren}</Head>;
23
- }
@@ -1,52 +0,0 @@
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
- import React from 'react';
8
- import Translate, {translate} from '@docusaurus/Translate';
9
- import {PageMetadata} from '@docusaurus/theme-common';
10
- import Layout from '@theme/Layout';
11
- export default function NotFound() {
12
- return (
13
- <>
14
- <PageMetadata
15
- title={translate({
16
- id: 'theme.NotFound.title',
17
- message: 'Page Not Found',
18
- })}
19
- />
20
- <Layout>
21
- <main className="container margin-vert--xl">
22
- <div className="row">
23
- <div className="col col--6 col--offset-3">
24
- <h1 className="hero__title">
25
- <Translate
26
- id="theme.NotFound.title"
27
- description="The title of the 404 page">
28
- Page Not Found
29
- </Translate>
30
- </h1>
31
- <p>
32
- <Translate
33
- id="theme.NotFound.p1"
34
- description="The first paragraph of the 404 page">
35
- We could not find what you were looking for.
36
- </Translate>
37
- </p>
38
- <p>
39
- <Translate
40
- id="theme.NotFound.p2"
41
- description="The 2nd paragraph of the 404 page">
42
- Please contact the owner of the site that linked you to the
43
- original URL and let them know their link is broken.
44
- </Translate>
45
- </p>
46
- </div>
47
- </div>
48
- </main>
49
- </Layout>
50
- </>
51
- );
52
- }