@docusaurus/theme-classic 3.2.0 → 3.3.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 (145) hide show
  1. package/lib/getSwizzleConfig.js +1 -1
  2. package/lib/index.d.ts +1 -0
  3. package/lib/options.d.ts +1 -0
  4. package/lib/theme/Admonition/Icon/Danger.d.ts +1 -0
  5. package/lib/theme/Admonition/Icon/Info.d.ts +1 -0
  6. package/lib/theme/Admonition/Icon/Note.d.ts +1 -0
  7. package/lib/theme/Admonition/Icon/Tip.d.ts +1 -0
  8. package/lib/theme/Admonition/Icon/Warning.d.ts +1 -0
  9. package/lib/theme/Admonition/Layout/index.d.ts +1 -0
  10. package/lib/theme/Admonition/Layout/index.js +1 -1
  11. package/lib/theme/Admonition/Type/Caution.d.ts +1 -0
  12. package/lib/theme/Admonition/Type/Danger.d.ts +1 -0
  13. package/lib/theme/Admonition/Type/Info.d.ts +1 -0
  14. package/lib/theme/Admonition/Type/Note.d.ts +1 -0
  15. package/lib/theme/Admonition/Type/Tip.d.ts +1 -0
  16. package/lib/theme/Admonition/Type/Warning.d.ts +1 -0
  17. package/lib/theme/Admonition/index.d.ts +1 -0
  18. package/lib/theme/AnnouncementBar/CloseButton/index.d.ts +1 -0
  19. package/lib/theme/AnnouncementBar/Content/index.d.ts +1 -0
  20. package/lib/theme/BlogLayout/index.d.ts +1 -0
  21. package/lib/theme/BlogListPaginator/index.d.ts +1 -0
  22. package/lib/theme/BlogPostItem/Container/index.d.ts +1 -0
  23. package/lib/theme/BlogPostItem/Content/index.d.ts +1 -0
  24. package/lib/theme/BlogPostItem/Footer/ReadMoreLink/index.d.ts +1 -0
  25. package/lib/theme/BlogPostItem/Header/Author/index.d.ts +1 -0
  26. package/lib/theme/BlogPostItem/Header/Authors/index.d.ts +1 -0
  27. package/lib/theme/BlogPostItem/Header/Info/index.d.ts +1 -0
  28. package/lib/theme/BlogPostItem/Header/Title/index.d.ts +1 -0
  29. package/lib/theme/BlogPostItem/index.d.ts +1 -0
  30. package/lib/theme/BlogPostItems/index.d.ts +1 -0
  31. package/lib/theme/BlogPostPaginator/index.d.ts +1 -0
  32. package/lib/theme/BlogSidebar/Desktop/index.d.ts +1 -0
  33. package/lib/theme/BlogSidebar/Mobile/index.d.ts +1 -0
  34. package/lib/theme/BlogSidebar/index.d.ts +1 -0
  35. package/lib/theme/CodeBlock/Content/Element.d.ts +1 -0
  36. package/lib/theme/CodeBlock/Content/String.d.ts +1 -0
  37. package/lib/theme/CodeBlock/CopyButton/index.d.ts +1 -0
  38. package/lib/theme/CodeBlock/Line/index.d.ts +1 -0
  39. package/lib/theme/CodeBlock/Line/index.js +1 -1
  40. package/lib/theme/CodeBlock/WordWrapButton/index.d.ts +1 -0
  41. package/lib/theme/CodeBlock/index.d.ts +1 -0
  42. package/lib/theme/CodeInline/index.d.ts +1 -0
  43. package/lib/theme/ColorModeToggle/index.d.ts +1 -0
  44. package/lib/theme/Details/index.d.ts +1 -0
  45. package/lib/theme/DocCard/index.d.ts +1 -0
  46. package/lib/theme/DocCardList/index.d.ts +1 -0
  47. package/lib/theme/DocItem/Content/index.d.ts +1 -0
  48. package/lib/theme/DocItem/Layout/index.d.ts +1 -0
  49. package/lib/theme/DocPaginator/index.d.ts +1 -0
  50. package/lib/theme/DocRoot/Layout/Main/index.d.ts +1 -0
  51. package/lib/theme/DocRoot/Layout/Sidebar/ExpandButton/index.d.ts +1 -0
  52. package/lib/theme/DocRoot/Layout/Sidebar/index.d.ts +1 -0
  53. package/lib/theme/DocRoot/Layout/index.d.ts +1 -0
  54. package/lib/theme/DocSidebar/Desktop/CollapseButton/index.d.ts +1 -0
  55. package/lib/theme/DocSidebar/Desktop/Content/index.d.ts +1 -0
  56. package/lib/theme/DocSidebar/Desktop/index.d.ts +1 -0
  57. package/lib/theme/DocSidebar/Mobile/index.d.ts +1 -0
  58. package/lib/theme/DocSidebar/index.d.ts +1 -0
  59. package/lib/theme/DocSidebarItem/Category/index.d.ts +1 -0
  60. package/lib/theme/DocSidebarItem/Html/index.d.ts +1 -0
  61. package/lib/theme/DocSidebarItem/Link/index.d.ts +1 -0
  62. package/lib/theme/DocSidebarItem/index.d.ts +1 -0
  63. package/lib/theme/DocSidebarItems/index.d.ts +1 -0
  64. package/lib/theme/DocVersionBadge/index.d.ts +1 -0
  65. package/lib/theme/DocVersionBanner/index.d.ts +1 -0
  66. package/lib/theme/EditMetaRow/index.d.ts +1 -0
  67. package/lib/theme/EditThisPage/index.d.ts +1 -0
  68. package/lib/theme/Footer/Copyright/index.d.ts +1 -0
  69. package/lib/theme/Footer/Layout/index.d.ts +1 -0
  70. package/lib/theme/Footer/LinkItem/index.d.ts +1 -0
  71. package/lib/theme/Footer/Links/MultiColumn/index.d.ts +1 -0
  72. package/lib/theme/Footer/Links/Simple/index.d.ts +1 -0
  73. package/lib/theme/Footer/Links/index.d.ts +1 -0
  74. package/lib/theme/Footer/Logo/index.d.ts +1 -0
  75. package/lib/theme/Heading/index.d.ts +1 -0
  76. package/lib/theme/Icon/Arrow/index.d.ts +1 -0
  77. package/lib/theme/Icon/Close/index.d.ts +1 -0
  78. package/lib/theme/Icon/Copy/index.d.ts +1 -0
  79. package/lib/theme/Icon/DarkMode/index.d.ts +1 -0
  80. package/lib/theme/Icon/Edit/index.d.ts +1 -0
  81. package/lib/theme/Icon/ExternalLink/index.d.ts +1 -0
  82. package/lib/theme/Icon/Home/index.d.ts +1 -0
  83. package/lib/theme/Icon/Language/index.d.ts +1 -0
  84. package/lib/theme/Icon/LightMode/index.d.ts +1 -0
  85. package/lib/theme/Icon/Menu/index.d.ts +1 -0
  86. package/lib/theme/Icon/Success/index.d.ts +1 -0
  87. package/lib/theme/Icon/WordWrap/index.d.ts +1 -0
  88. package/lib/theme/LastUpdated/index.d.ts +1 -0
  89. package/lib/theme/Layout/Provider/index.d.ts +1 -0
  90. package/lib/theme/Layout/index.d.ts +2 -0
  91. package/lib/theme/Logo/index.d.ts +1 -0
  92. package/lib/theme/MDXComponents/A.d.ts +1 -0
  93. package/lib/theme/MDXComponents/Code.d.ts +1 -0
  94. package/lib/theme/MDXComponents/Details.d.ts +1 -0
  95. package/lib/theme/MDXComponents/Heading.d.ts +1 -0
  96. package/lib/theme/MDXComponents/Img/index.d.ts +1 -0
  97. package/lib/theme/MDXComponents/Li.d.ts +1 -0
  98. package/lib/theme/MDXComponents/Pre.d.ts +1 -0
  99. package/lib/theme/MDXComponents/Ul/index.d.ts +1 -0
  100. package/lib/theme/MDXComponents/index.d.ts +1 -0
  101. package/lib/theme/MDXComponents/index.js +1 -1
  102. package/lib/theme/MDXContent/index.d.ts +1 -0
  103. package/lib/theme/MDXPage/index.js +22 -1
  104. package/lib/theme/Mermaid.d.ts +1 -0
  105. package/lib/theme/Navbar/ColorModeToggle/index.d.ts +1 -0
  106. package/lib/theme/Navbar/Layout/index.d.ts +1 -0
  107. package/lib/theme/Navbar/MobileSidebar/Layout/index.d.ts +1 -0
  108. package/lib/theme/Navbar/Search/index.d.ts +1 -0
  109. package/lib/theme/Navbar/Search/styles.module.css +2 -9
  110. package/lib/theme/NavbarItem/ComponentTypes.d.ts +1 -0
  111. package/lib/theme/NavbarItem/DefaultNavbarItem.d.ts +1 -0
  112. package/lib/theme/NavbarItem/DocNavbarItem.d.ts +1 -0
  113. package/lib/theme/NavbarItem/DocSidebarNavbarItem.d.ts +1 -0
  114. package/lib/theme/NavbarItem/DocsVersionDropdownNavbarItem.d.ts +1 -0
  115. package/lib/theme/NavbarItem/DocsVersionNavbarItem.d.ts +1 -0
  116. package/lib/theme/NavbarItem/DropdownNavbarItem/index.d.ts +1 -0
  117. package/lib/theme/NavbarItem/HtmlNavbarItem.d.ts +1 -0
  118. package/lib/theme/NavbarItem/LocaleDropdownNavbarItem/index.d.ts +1 -0
  119. package/lib/theme/NavbarItem/NavbarNavLink.d.ts +1 -0
  120. package/lib/theme/NavbarItem/SearchNavbarItem.d.ts +1 -0
  121. package/lib/theme/NavbarItem/index.d.ts +1 -0
  122. package/lib/theme/NotFound/Content/index.d.ts +1 -0
  123. package/lib/theme/PaginatorNavLink/index.d.ts +1 -0
  124. package/lib/theme/SearchBar.d.ts +1 -0
  125. package/lib/theme/SearchMetadata/index.d.ts +1 -0
  126. package/lib/theme/TOC/index.d.ts +1 -0
  127. package/lib/theme/TOCCollapsible/CollapseButton/index.d.ts +1 -0
  128. package/lib/theme/TOCCollapsible/index.d.ts +1 -0
  129. package/lib/theme/TOCInline/index.d.ts +1 -0
  130. package/lib/theme/TOCItems/Tree.d.ts +1 -0
  131. package/lib/theme/TOCItems/index.d.ts +1 -0
  132. package/lib/theme/TabItem/index.d.ts +1 -0
  133. package/lib/theme/Tabs/index.d.ts +1 -0
  134. package/lib/theme/Tabs/index.js +2 -2
  135. package/lib/theme/Tag/index.d.ts +1 -0
  136. package/lib/theme/TagsListByLetter/index.d.ts +1 -0
  137. package/lib/theme/TagsListInline/index.d.ts +1 -0
  138. package/lib/theme/ThemedImage/index.d.ts +1 -0
  139. package/lib/theme/Unlisted/index.d.ts +1 -0
  140. package/package.json +14 -14
  141. package/src/theme/Admonition/Layout/index.tsx +1 -1
  142. package/src/theme/CodeBlock/Line/index.tsx +1 -1
  143. package/src/theme/MDXPage/index.tsx +23 -1
  144. package/src/theme/Navbar/Search/styles.module.css +2 -9
  145. package/src/theme/Tabs/index.tsx +2 -2
@@ -4,6 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
+ /// <reference path="../../../src/theme-classic.d.ts" />
7
8
  /// <reference types="react" />
8
9
  import type { Props } from '@theme/TOCCollapsible';
9
10
  export default function TOCCollapsible({ toc, className, minHeadingLevel, maxHeadingLevel, }: Props): JSX.Element;
@@ -4,6 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
+ /// <reference path="../../../src/theme-classic.d.ts" />
7
8
  /// <reference types="react" />
8
9
  import type { Props } from '@theme/TOCInline';
9
10
  export default function TOCInline({ toc, minHeadingLevel, maxHeadingLevel, }: Props): JSX.Element;
@@ -4,6 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
+ /// <reference path="../../../src/theme-classic.d.ts" />
7
8
  import React from 'react';
8
9
  import type { Props } from '@theme/TOCItems/Tree';
9
10
  declare function TOCItemTree({ toc, className, linkClassName, isChild, }: Props): JSX.Element | null;
@@ -4,6 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
+ /// <reference path="../../../src/theme-classic.d.ts" />
7
8
  /// <reference types="react" />
8
9
  import type { Props } from '@theme/TOCItems';
9
10
  export default function TOCItems({ toc, className, linkClassName, linkActiveClassName, minHeadingLevel: minHeadingLevelOption, maxHeadingLevel: maxHeadingLevelOption, ...props }: Props): JSX.Element | null;
@@ -4,6 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
+ /// <reference path="../../../src/theme-classic.d.ts" />
7
8
  /// <reference types="react" />
8
9
  import type { Props } from '@theme/TabItem';
9
10
  export default function TabItem({ children, hidden, className, }: Props): JSX.Element;
@@ -4,6 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
+ /// <reference path="../../../src/theme-classic.d.ts" />
7
8
  /// <reference types="react" />
8
9
  import type { Props } from '@theme/Tabs';
9
10
  export default function Tabs(props: Props): JSX.Element;
@@ -108,8 +108,8 @@ function TabsComponent(props) {
108
108
  const tabs = useTabs(props);
109
109
  return (
110
110
  <div className={clsx('tabs-container', styles.tabList)}>
111
- <TabList {...props} {...tabs} />
112
- <TabContent {...props} {...tabs} />
111
+ <TabList {...tabs} {...props} />
112
+ <TabContent {...tabs} {...props} />
113
113
  </div>
114
114
  );
115
115
  }
@@ -4,6 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
+ /// <reference path="../../../src/theme-classic.d.ts" />
7
8
  /// <reference types="react" />
8
9
  import type { Props } from '@theme/Tag';
9
10
  export default function Tag({ permalink, label, count }: Props): JSX.Element;
@@ -4,6 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
+ /// <reference path="../../../src/theme-classic.d.ts" />
7
8
  /// <reference types="react" />
8
9
  import type { Props } from '@theme/TagsListByLetter';
9
10
  export default function TagsListByLetter({ tags }: Props): JSX.Element;
@@ -4,6 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
+ /// <reference path="../../../src/theme-classic.d.ts" />
7
8
  /// <reference types="react" />
8
9
  import type { Props } from '@theme/TagsListInline';
9
10
  export default function TagsListInline({ tags }: Props): JSX.Element;
@@ -4,6 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
+ /// <reference path="../../../src/theme-classic.d.ts" />
7
8
  /// <reference types="react" />
8
9
  import type { Props } from '@theme/ThemedImage';
9
10
  export default function ThemedImage(props: Props): JSX.Element;
@@ -4,6 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
+ /// <reference path="../../../src/theme-classic.d.ts" />
7
8
  /// <reference types="react" />
8
9
  import type { Props } from '@theme/Unlisted';
9
10
  export default function Unlisted(props: Props): JSX.Element | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/theme-classic",
3
- "version": "3.2.0",
3
+ "version": "3.3.0",
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": "3.2.0",
24
- "@docusaurus/mdx-loader": "3.2.0",
25
- "@docusaurus/module-type-aliases": "3.2.0",
26
- "@docusaurus/plugin-content-blog": "3.2.0",
27
- "@docusaurus/plugin-content-docs": "3.2.0",
28
- "@docusaurus/plugin-content-pages": "3.2.0",
29
- "@docusaurus/theme-common": "3.2.0",
30
- "@docusaurus/theme-translations": "3.2.0",
31
- "@docusaurus/types": "3.2.0",
32
- "@docusaurus/utils": "3.2.0",
33
- "@docusaurus/utils-common": "3.2.0",
34
- "@docusaurus/utils-validation": "3.2.0",
23
+ "@docusaurus/core": "3.3.0",
24
+ "@docusaurus/mdx-loader": "3.3.0",
25
+ "@docusaurus/module-type-aliases": "3.3.0",
26
+ "@docusaurus/plugin-content-blog": "3.3.0",
27
+ "@docusaurus/plugin-content-docs": "3.3.0",
28
+ "@docusaurus/plugin-content-pages": "3.3.0",
29
+ "@docusaurus/theme-common": "3.3.0",
30
+ "@docusaurus/theme-translations": "3.3.0",
31
+ "@docusaurus/types": "3.3.0",
32
+ "@docusaurus/utils": "3.3.0",
33
+ "@docusaurus/utils-common": "3.3.0",
34
+ "@docusaurus/utils-validation": "3.3.0",
35
35
  "@mdx-js/react": "^3.0.0",
36
36
  "clsx": "^2.0.0",
37
37
  "copy-text-to-clipboard": "^3.2.0",
@@ -61,5 +61,5 @@
61
61
  "engines": {
62
62
  "node": ">=18.0"
63
63
  },
64
- "gitHead": "5af143651b26b39761361acd96e9c5be7ba0cb25"
64
+ "gitHead": "2ec4e078b5ca0c57f2cc04f2fe564d524bb5e858"
65
65
  }
@@ -50,7 +50,7 @@ export default function AdmonitionLayout(props: Props): JSX.Element {
50
50
  const {type, icon, title, children, className} = props;
51
51
  return (
52
52
  <AdmonitionContainer type={type} className={className}>
53
- <AdmonitionHeading title={title} icon={icon} />
53
+ {title || icon ? <AdmonitionHeading title={title} icon={icon} /> : null}
54
54
  <AdmonitionContent>{children}</AdmonitionContent>
55
55
  </AdmonitionContainer>
56
56
  );
@@ -28,7 +28,7 @@ export default function CodeBlockLine({
28
28
  });
29
29
 
30
30
  const lineTokens = line.map((token, key) => (
31
- <span key={key} {...getTokenProps({token, key})} />
31
+ <span key={key} {...getTokenProps({token})} />
32
32
  ));
33
33
 
34
34
  return (
@@ -18,12 +18,21 @@ import TOC from '@theme/TOC';
18
18
  import Unlisted from '@theme/Unlisted';
19
19
  import type {Props} from '@theme/MDXPage';
20
20
 
21
+ import EditMetaRow from '@theme/EditMetaRow';
21
22
  import styles from './styles.module.css';
22
23
 
23
24
  export default function MDXPage(props: Props): JSX.Element {
24
25
  const {content: MDXPageContent} = props;
25
26
  const {
26
- metadata: {title, description, frontMatter, unlisted},
27
+ metadata: {
28
+ title,
29
+ editUrl,
30
+ description,
31
+ frontMatter,
32
+ unlisted,
33
+ lastUpdatedBy,
34
+ lastUpdatedAt,
35
+ },
27
36
  assets,
28
37
  } = MDXPageContent;
29
38
  const {
@@ -33,6 +42,8 @@ export default function MDXPage(props: Props): JSX.Element {
33
42
  } = frontMatter;
34
43
  const image = assets.image ?? frontMatter.image;
35
44
 
45
+ const canDisplayEditMetaRow = !!(editUrl || lastUpdatedAt || lastUpdatedBy);
46
+
36
47
  return (
37
48
  <HtmlClassNameProvider
38
49
  className={clsx(
@@ -55,6 +66,17 @@ export default function MDXPage(props: Props): JSX.Element {
55
66
  <MDXPageContent />
56
67
  </MDXContent>
57
68
  </article>
69
+ {canDisplayEditMetaRow && (
70
+ <EditMetaRow
71
+ className={clsx(
72
+ 'margin-top--sm',
73
+ ThemeClassNames.pages.pageFooterEditMetaRow,
74
+ )}
75
+ editUrl={editUrl}
76
+ lastUpdatedAt={lastUpdatedAt}
77
+ lastUpdatedBy={lastUpdatedBy}
78
+ />
79
+ )}
58
80
  </div>
59
81
  {!hideTableOfContents && MDXPageContent.toc.length > 0 && (
60
82
  <div className="col col--2">
@@ -9,15 +9,8 @@
9
9
  Workaround to avoid rendering empty search container
10
10
  See https://github.com/facebook/docusaurus/pull/9385
11
11
  */
12
- /*
13
- TODO temporary @supports check, remove before 2025
14
- only needed for Firefox < 121
15
- see https://github.com/facebook/docusaurus/issues/9527#issuecomment-1805272379
16
- */
17
- @supports selector(:has(*)) {
18
- .navbarSearchContainer:not(:has(> *)) {
19
- display: none;
20
- }
12
+ .navbarSearchContainer:empty {
13
+ display: none;
21
14
  }
22
15
 
23
16
  @media (max-width: 996px) {
@@ -140,8 +140,8 @@ function TabsComponent(props: Props): JSX.Element {
140
140
  const tabs = useTabs(props);
141
141
  return (
142
142
  <div className={clsx('tabs-container', styles.tabList)}>
143
- <TabList {...props} {...tabs} />
144
- <TabContent {...props} {...tabs} />
143
+ <TabList {...tabs} {...props} />
144
+ <TabContent {...tabs} {...props} />
145
145
  </div>
146
146
  );
147
147
  }