mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-02 03:37:48 +02:00
refactor: prepare types for React 19 (#10746)
This commit is contained in:
parent
e9f0641620
commit
f9825af43e
296 changed files with 1105 additions and 915 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
import type {ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import Heading from '@theme/Heading';
|
import Heading from '@theme/Heading';
|
||||||
import styles from './styles.module.css';
|
import styles from './styles.module.css';
|
||||||
|
@ -5,7 +6,7 @@ import styles from './styles.module.css';
|
||||||
type FeatureItem = {
|
type FeatureItem = {
|
||||||
title: string;
|
title: string;
|
||||||
Svg: React.ComponentType<React.ComponentProps<'svg'>>;
|
Svg: React.ComponentType<React.ComponentProps<'svg'>>;
|
||||||
description: JSX.Element;
|
description: ReactNode;
|
||||||
};
|
};
|
||||||
|
|
||||||
const FeatureList: FeatureItem[] = [
|
const FeatureList: FeatureItem[] = [
|
||||||
|
@ -55,7 +56,7 @@ function Feature({title, Svg, description}: FeatureItem) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function HomepageFeatures(): JSX.Element {
|
export default function HomepageFeatures(): ReactNode {
|
||||||
return (
|
return (
|
||||||
<section className={styles.features}>
|
<section className={styles.features}>
|
||||||
<div className="container">
|
<div className="container">
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import type {ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import Link from '@docusaurus/Link';
|
import Link from '@docusaurus/Link';
|
||||||
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
||||||
|
@ -28,7 +29,7 @@ function HomepageHeader() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function Home(): JSX.Element {
|
export default function Home(): ReactNode {
|
||||||
const {siteConfig} = useDocusaurusContext();
|
const {siteConfig} = useDocusaurusContext();
|
||||||
return (
|
return (
|
||||||
<Layout
|
<Layout
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import type {ReactNode} from 'react';
|
||||||
|
|
||||||
import {mdxLoader} from './loader';
|
import {mdxLoader} from './loader';
|
||||||
|
|
||||||
import type {TOCItem as TOCItemImported} from './remark/toc/types';
|
import type {TOCItem as TOCItemImported} from './remark/toc/types';
|
||||||
|
@ -34,7 +36,7 @@ export type LoadedMDXContent<FrontMatter, Metadata, Assets = undefined> = {
|
||||||
* in priority.
|
* in priority.
|
||||||
*/
|
*/
|
||||||
readonly assets: Assets;
|
readonly assets: Assets;
|
||||||
(): JSX.Element;
|
(): ReactNode;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type {MDXPlugin} from './loader';
|
export type {MDXPlugin} from './loader';
|
||||||
|
|
|
@ -84,10 +84,11 @@ declare module '@theme-original/*';
|
||||||
declare module '@theme-init/*';
|
declare module '@theme-init/*';
|
||||||
|
|
||||||
declare module '@theme/Error' {
|
declare module '@theme/Error' {
|
||||||
|
import type {ReactNode} from 'react';
|
||||||
import type {FallbackParams} from '@docusaurus/ErrorBoundary';
|
import type {FallbackParams} from '@docusaurus/ErrorBoundary';
|
||||||
|
|
||||||
export interface Props extends FallbackParams {}
|
export interface Props extends FallbackParams {}
|
||||||
export default function Error(props: Props): JSX.Element;
|
export default function Error(props: Props): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/Layout' {
|
declare module '@theme/Layout' {
|
||||||
|
@ -96,17 +97,20 @@ declare module '@theme/Layout' {
|
||||||
export interface Props {
|
export interface Props {
|
||||||
readonly children?: ReactNode;
|
readonly children?: ReactNode;
|
||||||
}
|
}
|
||||||
export default function Layout(props: Props): JSX.Element;
|
export default function Layout(props: Props): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/Loading' {
|
declare module '@theme/Loading' {
|
||||||
|
import type {ReactNode} from 'react';
|
||||||
import type {LoadingComponentProps} from 'react-loadable';
|
import type {LoadingComponentProps} from 'react-loadable';
|
||||||
|
|
||||||
export default function Loading(props: LoadingComponentProps): JSX.Element;
|
export default function Loading(props: LoadingComponentProps): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/NotFound' {
|
declare module '@theme/NotFound' {
|
||||||
export default function NotFound(): JSX.Element;
|
import type {ReactNode} from 'react';
|
||||||
|
|
||||||
|
export default function NotFound(): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/Root' {
|
declare module '@theme/Root' {
|
||||||
|
@ -115,11 +119,13 @@ declare module '@theme/Root' {
|
||||||
export interface Props {
|
export interface Props {
|
||||||
readonly children: ReactNode;
|
readonly children: ReactNode;
|
||||||
}
|
}
|
||||||
export default function Root({children}: Props): JSX.Element;
|
export default function Root({children}: Props): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/SiteMetadata' {
|
declare module '@theme/SiteMetadata' {
|
||||||
export default function SiteMetadata(): JSX.Element;
|
import type {ReactNode} from 'react';
|
||||||
|
|
||||||
|
export default function SiteMetadata(): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@docusaurus/constants' {
|
declare module '@docusaurus/constants' {
|
||||||
|
@ -134,13 +140,13 @@ declare module '@docusaurus/ErrorBoundary' {
|
||||||
readonly tryAgain: () => void;
|
readonly tryAgain: () => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type FallbackFunction = (params: FallbackParams) => JSX.Element;
|
export type FallbackFunction = (params: FallbackParams) => ReactNode;
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
readonly fallback?: FallbackFunction;
|
readonly fallback?: FallbackFunction;
|
||||||
readonly children: ReactNode;
|
readonly children: ReactNode;
|
||||||
}
|
}
|
||||||
export default function ErrorBoundary(props: Props): JSX.Element;
|
export default function ErrorBoundary(props: Props): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@docusaurus/Head' {
|
declare module '@docusaurus/Head' {
|
||||||
|
@ -149,11 +155,11 @@ declare module '@docusaurus/Head' {
|
||||||
|
|
||||||
export type Props = HelmetProps & {children: ReactNode};
|
export type Props = HelmetProps & {children: ReactNode};
|
||||||
|
|
||||||
export default function Head(props: Props): JSX.Element;
|
export default function Head(props: Props): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@docusaurus/Link' {
|
declare module '@docusaurus/Link' {
|
||||||
import type {CSSProperties, ComponentProps} from 'react';
|
import type {CSSProperties, ComponentProps, ReactNode} from 'react';
|
||||||
import type {NavLinkProps as RRNavLinkProps} from 'react-router-dom';
|
import type {NavLinkProps as RRNavLinkProps} from 'react-router-dom';
|
||||||
|
|
||||||
type NavLinkProps = Partial<RRNavLinkProps>;
|
type NavLinkProps = Partial<RRNavLinkProps>;
|
||||||
|
@ -169,7 +175,7 @@ declare module '@docusaurus/Link' {
|
||||||
/** Escape hatch in case broken links check doesn't make sense. */
|
/** Escape hatch in case broken links check doesn't make sense. */
|
||||||
readonly 'data-noBrokenLinkCheck'?: boolean;
|
readonly 'data-noBrokenLinkCheck'?: boolean;
|
||||||
};
|
};
|
||||||
export default function Link(props: Props): JSX.Element;
|
export default function Link(props: Props): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@docusaurus/Interpolate' {
|
declare module '@docusaurus/Interpolate' {
|
||||||
|
@ -203,7 +209,7 @@ declare module '@docusaurus/Interpolate' {
|
||||||
|
|
||||||
export default function Interpolate<Str extends string>(
|
export default function Interpolate<Str extends string>(
|
||||||
props: InterpolateProps<Str>,
|
props: InterpolateProps<Str>,
|
||||||
): JSX.Element;
|
): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@docusaurus/Translate' {
|
declare module '@docusaurus/Translate' {
|
||||||
|
@ -241,7 +247,7 @@ declare module '@docusaurus/Translate' {
|
||||||
|
|
||||||
export default function Translate<Str extends string>(
|
export default function Translate<Str extends string>(
|
||||||
props: TranslateProps<Str>,
|
props: TranslateProps<Str>,
|
||||||
): JSX.Element;
|
): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@docusaurus/router' {
|
declare module '@docusaurus/router' {
|
||||||
|
@ -318,11 +324,13 @@ declare module '@docusaurus/ComponentCreator' {
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@docusaurus/BrowserOnly' {
|
declare module '@docusaurus/BrowserOnly' {
|
||||||
|
import type {ReactNode} from 'react';
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
readonly children?: () => JSX.Element;
|
readonly children?: () => ReactNode;
|
||||||
readonly fallback?: JSX.Element;
|
readonly fallback?: ReactNode;
|
||||||
}
|
}
|
||||||
export default function BrowserOnly(props: Props): JSX.Element | null;
|
export default function BrowserOnly(props: Props): ReactNode | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@docusaurus/isInternalUrl' {
|
declare module '@docusaurus/isInternalUrl' {
|
||||||
|
|
|
@ -74,7 +74,7 @@ export function BlogPostProvider({
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
content: PropBlogPostContent;
|
content: PropBlogPostContent;
|
||||||
isBlogPostPage?: boolean;
|
isBlogPostPage?: boolean;
|
||||||
}): JSX.Element {
|
}): ReactNode {
|
||||||
const contextValue = useContextValue({content, isBlogPostPage});
|
const contextValue = useContextValue({content, isBlogPostPage});
|
||||||
return <Context.Provider value={contextValue}>{children}</Context.Provider>;
|
return <Context.Provider value={contextValue}>{children}</Context.Provider>;
|
||||||
}
|
}
|
||||||
|
|
|
@ -663,6 +663,7 @@ declare module '@docusaurus/plugin-content-blog' {
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/BlogPostPage' {
|
declare module '@theme/BlogPostPage' {
|
||||||
|
import type {ReactNode} from 'react';
|
||||||
import type {
|
import type {
|
||||||
BlogPostFrontMatter,
|
BlogPostFrontMatter,
|
||||||
BlogSidebar,
|
BlogSidebar,
|
||||||
|
@ -683,18 +684,23 @@ declare module '@theme/BlogPostPage' {
|
||||||
readonly blogMetadata: BlogMetadata;
|
readonly blogMetadata: BlogMetadata;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function BlogPostPage(props: Props): JSX.Element;
|
export default function BlogPostPage(props: Props): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/BlogPostPage/Metadata' {
|
declare module '@theme/BlogPostPage/Metadata' {
|
||||||
export default function BlogPostPageMetadata(): JSX.Element;
|
import type {ReactNode} from 'react';
|
||||||
|
|
||||||
|
export default function BlogPostPageMetadata(): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/BlogPostPage/StructuredData' {
|
declare module '@theme/BlogPostPage/StructuredData' {
|
||||||
export default function BlogPostStructuredData(): JSX.Element;
|
import type {ReactNode} from 'react';
|
||||||
|
|
||||||
|
export default function BlogPostStructuredData(): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/BlogListPage' {
|
declare module '@theme/BlogListPage' {
|
||||||
|
import type {ReactNode} from 'react';
|
||||||
import type {Content} from '@theme/BlogPostPage';
|
import type {Content} from '@theme/BlogPostPage';
|
||||||
import type {
|
import type {
|
||||||
BlogSidebar,
|
BlogSidebar,
|
||||||
|
@ -713,10 +719,11 @@ declare module '@theme/BlogListPage' {
|
||||||
readonly items: readonly {readonly content: Content}[];
|
readonly items: readonly {readonly content: Content}[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function BlogListPage(props: Props): JSX.Element;
|
export default function BlogListPage(props: Props): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/BlogListPage/StructuredData' {
|
declare module '@theme/BlogListPage/StructuredData' {
|
||||||
|
import type {ReactNode} from 'react';
|
||||||
import type {Content} from '@theme/BlogPostPage';
|
import type {Content} from '@theme/BlogPostPage';
|
||||||
import type {
|
import type {
|
||||||
BlogSidebar,
|
BlogSidebar,
|
||||||
|
@ -735,10 +742,11 @@ declare module '@theme/BlogListPage/StructuredData' {
|
||||||
readonly items: readonly {readonly content: Content}[];
|
readonly items: readonly {readonly content: Content}[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function BlogListPageStructuredData(props: Props): JSX.Element;
|
export default function BlogListPageStructuredData(props: Props): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/BlogTagsListPage' {
|
declare module '@theme/BlogTagsListPage' {
|
||||||
|
import type {ReactNode} from 'react';
|
||||||
import type {BlogSidebar} from '@docusaurus/plugin-content-blog';
|
import type {BlogSidebar} from '@docusaurus/plugin-content-blog';
|
||||||
import type {TagsListItem} from '@docusaurus/utils';
|
import type {TagsListItem} from '@docusaurus/utils';
|
||||||
|
|
||||||
|
@ -749,10 +757,11 @@ declare module '@theme/BlogTagsListPage' {
|
||||||
readonly tags: TagsListItem[];
|
readonly tags: TagsListItem[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function BlogTagsListPage(props: Props): JSX.Element;
|
export default function BlogTagsListPage(props: Props): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/Blog/Pages/BlogAuthorsListPage' {
|
declare module '@theme/Blog/Pages/BlogAuthorsListPage' {
|
||||||
|
import type {ReactNode} from 'react';
|
||||||
import type {
|
import type {
|
||||||
AuthorItemProp,
|
AuthorItemProp,
|
||||||
BlogSidebar,
|
BlogSidebar,
|
||||||
|
@ -765,10 +774,11 @@ declare module '@theme/Blog/Pages/BlogAuthorsListPage' {
|
||||||
readonly authors: AuthorItemProp[];
|
readonly authors: AuthorItemProp[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function BlogAuthorsListPage(props: Props): JSX.Element;
|
export default function BlogAuthorsListPage(props: Props): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/Blog/Pages/BlogAuthorsPostsPage' {
|
declare module '@theme/Blog/Pages/BlogAuthorsPostsPage' {
|
||||||
|
import type {ReactNode} from 'react';
|
||||||
import type {Content} from '@theme/BlogPostPage';
|
import type {Content} from '@theme/BlogPostPage';
|
||||||
import type {
|
import type {
|
||||||
AuthorItemProp,
|
AuthorItemProp,
|
||||||
|
@ -790,10 +800,11 @@ declare module '@theme/Blog/Pages/BlogAuthorsPostsPage' {
|
||||||
readonly items: readonly {readonly content: Content}[];
|
readonly items: readonly {readonly content: Content}[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function BlogAuthorsPostsPage(props: Props): JSX.Element;
|
export default function BlogAuthorsPostsPage(props: Props): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/BlogTagsPostsPage' {
|
declare module '@theme/BlogTagsPostsPage' {
|
||||||
|
import type {ReactNode} from 'react';
|
||||||
import type {Content} from '@theme/BlogPostPage';
|
import type {Content} from '@theme/BlogPostPage';
|
||||||
import type {
|
import type {
|
||||||
BlogSidebar,
|
BlogSidebar,
|
||||||
|
@ -815,10 +826,11 @@ declare module '@theme/BlogTagsPostsPage' {
|
||||||
readonly items: readonly {readonly content: Content}[];
|
readonly items: readonly {readonly content: Content}[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function BlogTagsPostsPage(props: Props): JSX.Element;
|
export default function BlogTagsPostsPage(props: Props): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/BlogArchivePage' {
|
declare module '@theme/BlogArchivePage' {
|
||||||
|
import type {ReactNode} from 'react';
|
||||||
import type {Content} from '@theme/BlogPostPage';
|
import type {Content} from '@theme/BlogPostPage';
|
||||||
|
|
||||||
/** We may add extra metadata or prune some metadata from here */
|
/** We may add extra metadata or prune some metadata from here */
|
||||||
|
@ -832,5 +844,5 @@ declare module '@theme/BlogArchivePage' {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function BlogArchivePage(props: Props): JSX.Element;
|
export default function BlogArchivePage(props: Props): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ export function DocProvider({
|
||||||
}: {
|
}: {
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
content: PropDocContent;
|
content: PropDocContent;
|
||||||
}): JSX.Element {
|
}): ReactNode {
|
||||||
const contextValue = useContextValue(content);
|
const contextValue = useContextValue(content);
|
||||||
return <Context.Provider value={contextValue}>{children}</Context.Provider>;
|
return <Context.Provider value={contextValue}>{children}</Context.Provider>;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ export function DocSidebarItemsExpandedStateProvider({
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
}): JSX.Element {
|
}): ReactNode {
|
||||||
const [expandedItem, setExpandedItem] = useState<number | null>(null);
|
const [expandedItem, setExpandedItem] = useState<number | null>(null);
|
||||||
const contextValue = useMemo(
|
const contextValue = useMemo(
|
||||||
() => ({expandedItem, setExpandedItem}),
|
() => ({expandedItem, setExpandedItem}),
|
||||||
|
|
|
@ -163,7 +163,7 @@ function DocsPreferredVersionContextProviderUnsafe({
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
}): JSX.Element {
|
}): ReactNode {
|
||||||
const value = useContextValue();
|
const value = useContextValue();
|
||||||
return <Context.Provider value={value}>{children}</Context.Provider>;
|
return <Context.Provider value={value}>{children}</Context.Provider>;
|
||||||
}
|
}
|
||||||
|
@ -176,7 +176,7 @@ export function DocsPreferredVersionContextProvider({
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
}): JSX.Element {
|
}): ReactNode {
|
||||||
return (
|
return (
|
||||||
<DocsPreferredVersionContextProviderUnsafe>
|
<DocsPreferredVersionContextProviderUnsafe>
|
||||||
{children}
|
{children}
|
||||||
|
|
|
@ -30,7 +30,7 @@ export function DocsSidebarProvider({
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
name: string | undefined;
|
name: string | undefined;
|
||||||
items: PropSidebar | undefined;
|
items: PropSidebar | undefined;
|
||||||
}): JSX.Element {
|
}): ReactNode {
|
||||||
const stableValue: ContextValue | null = useMemo(
|
const stableValue: ContextValue | null = useMemo(
|
||||||
() => (name && items ? {name, items} : null),
|
() => (name && items ? {name, items} : null),
|
||||||
[name, items],
|
[name, items],
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {useMemo} from 'react';
|
import {type ReactNode, useMemo} from 'react';
|
||||||
import {matchPath, useLocation} from '@docusaurus/router';
|
import {matchPath, useLocation} from '@docusaurus/router';
|
||||||
import renderRoutes from '@docusaurus/renderRoutes';
|
import renderRoutes from '@docusaurus/renderRoutes';
|
||||||
import {
|
import {
|
||||||
|
@ -363,7 +363,7 @@ Available doc ids are:
|
||||||
*/
|
*/
|
||||||
export function useDocRootMetadata({route}: DocRootProps): null | {
|
export function useDocRootMetadata({route}: DocRootProps): null | {
|
||||||
/** The element that should be rendered at the current location. */
|
/** The element that should be rendered at the current location. */
|
||||||
docElement: JSX.Element;
|
docElement: ReactNode;
|
||||||
/**
|
/**
|
||||||
* The name of the sidebar associated with the current doc. `sidebarName` and
|
* The name of the sidebar associated with the current doc. `sidebarName` and
|
||||||
* `sidebarItems` correspond to the value of {@link useDocsSidebar}.
|
* `sidebarItems` correspond to the value of {@link useDocsSidebar}.
|
||||||
|
|
|
@ -20,7 +20,7 @@ export function DocsVersionProvider({
|
||||||
}: {
|
}: {
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
version: PropVersionMetadata | null;
|
version: PropVersionMetadata | null;
|
||||||
}): JSX.Element {
|
}): ReactNode {
|
||||||
return <Context.Provider value={version}>{children}</Context.Provider>;
|
return <Context.Provider value={version}>{children}</Context.Provider>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -562,10 +562,11 @@ declare module '@docusaurus/plugin-content-docs' {
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/DocItem' {
|
declare module '@theme/DocItem' {
|
||||||
|
import type {ReactNode} from 'react';
|
||||||
import type {PropDocContent} from '@docusaurus/plugin-content-docs';
|
import type {PropDocContent} from '@docusaurus/plugin-content-docs';
|
||||||
|
|
||||||
export type DocumentRoute = {
|
export type DocumentRoute = {
|
||||||
readonly component: () => JSX.Element;
|
readonly component: () => ReactNode;
|
||||||
readonly exact: boolean;
|
readonly exact: boolean;
|
||||||
readonly path: string;
|
readonly path: string;
|
||||||
readonly sidebar?: string;
|
readonly sidebar?: string;
|
||||||
|
@ -576,10 +577,11 @@ declare module '@theme/DocItem' {
|
||||||
readonly content: PropDocContent;
|
readonly content: PropDocContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function DocItem(props: Props): JSX.Element;
|
export default function DocItem(props: Props): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/DocCategoryGeneratedIndexPage' {
|
declare module '@theme/DocCategoryGeneratedIndexPage' {
|
||||||
|
import type {ReactNode} from 'react';
|
||||||
import type {PropCategoryGeneratedIndex} from '@docusaurus/plugin-content-docs';
|
import type {PropCategoryGeneratedIndex} from '@docusaurus/plugin-content-docs';
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
|
@ -588,39 +590,45 @@ declare module '@theme/DocCategoryGeneratedIndexPage' {
|
||||||
|
|
||||||
export default function DocCategoryGeneratedIndexPage(
|
export default function DocCategoryGeneratedIndexPage(
|
||||||
props: Props,
|
props: Props,
|
||||||
): JSX.Element;
|
): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/DocTagsListPage' {
|
declare module '@theme/DocTagsListPage' {
|
||||||
|
import type {ReactNode} from 'react';
|
||||||
import type {PropTagsListPage} from '@docusaurus/plugin-content-docs';
|
import type {PropTagsListPage} from '@docusaurus/plugin-content-docs';
|
||||||
|
|
||||||
export interface Props extends PropTagsListPage {}
|
export interface Props extends PropTagsListPage {}
|
||||||
export default function DocTagsListPage(props: Props): JSX.Element;
|
export default function DocTagsListPage(props: Props): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/DocTagDocListPage' {
|
declare module '@theme/DocTagDocListPage' {
|
||||||
|
import type {ReactNode} from 'react';
|
||||||
import type {PropTagDocList} from '@docusaurus/plugin-content-docs';
|
import type {PropTagDocList} from '@docusaurus/plugin-content-docs';
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
readonly tag: PropTagDocList;
|
readonly tag: PropTagDocList;
|
||||||
}
|
}
|
||||||
export default function DocTagDocListPage(props: Props): JSX.Element;
|
export default function DocTagDocListPage(props: Props): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/DocBreadcrumbs' {
|
declare module '@theme/DocBreadcrumbs' {
|
||||||
export default function DocBreadcrumbs(): JSX.Element;
|
import type {ReactNode} from 'react';
|
||||||
|
|
||||||
|
export default function DocBreadcrumbs(): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/DocsRoot' {
|
declare module '@theme/DocsRoot' {
|
||||||
|
import type {ReactNode} from 'react';
|
||||||
import type {RouteConfigComponentProps} from 'react-router-config';
|
import type {RouteConfigComponentProps} from 'react-router-config';
|
||||||
import type {Required} from 'utility-types';
|
import type {Required} from 'utility-types';
|
||||||
|
|
||||||
export interface Props extends Required<RouteConfigComponentProps, 'route'> {}
|
export interface Props extends Required<RouteConfigComponentProps, 'route'> {}
|
||||||
|
|
||||||
export default function DocsRoot(props: Props): JSX.Element;
|
export default function DocsRoot(props: Props): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/DocVersionRoot' {
|
declare module '@theme/DocVersionRoot' {
|
||||||
|
import type {ReactNode} from 'react';
|
||||||
import type {PropVersionMetadata} from '@docusaurus/plugin-content-docs';
|
import type {PropVersionMetadata} from '@docusaurus/plugin-content-docs';
|
||||||
import type {RouteConfigComponentProps} from 'react-router-config';
|
import type {RouteConfigComponentProps} from 'react-router-config';
|
||||||
import type {Required} from 'utility-types';
|
import type {Required} from 'utility-types';
|
||||||
|
@ -629,14 +637,15 @@ declare module '@theme/DocVersionRoot' {
|
||||||
readonly version: PropVersionMetadata;
|
readonly version: PropVersionMetadata;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function DocVersionRoot(props: Props): JSX.Element;
|
export default function DocVersionRoot(props: Props): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/DocRoot' {
|
declare module '@theme/DocRoot' {
|
||||||
|
import type {ReactNode} from 'react';
|
||||||
import type {RouteConfigComponentProps} from 'react-router-config';
|
import type {RouteConfigComponentProps} from 'react-router-config';
|
||||||
import type {Required} from 'utility-types';
|
import type {Required} from 'utility-types';
|
||||||
|
|
||||||
export interface Props extends Required<RouteConfigComponentProps, 'route'> {}
|
export interface Props extends Required<RouteConfigComponentProps, 'route'> {}
|
||||||
|
|
||||||
export default function DocRoot(props: Props): JSX.Element;
|
export default function DocRoot(props: Props): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,6 +85,7 @@ declare module '@docusaurus/plugin-content-pages' {
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/MDXPage' {
|
declare module '@theme/MDXPage' {
|
||||||
|
import type {ReactNode} from 'react';
|
||||||
import type {LoadedMDXContent} from '@docusaurus/mdx-loader';
|
import type {LoadedMDXContent} from '@docusaurus/mdx-loader';
|
||||||
import type {
|
import type {
|
||||||
MDXPageMetadata,
|
MDXPageMetadata,
|
||||||
|
@ -100,5 +101,5 @@ declare module '@theme/MDXPage' {
|
||||||
>;
|
>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function MDXPage(props: Props): JSX.Element;
|
export default function MDXPage(props: Props): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,46 +14,57 @@ declare module '@docusaurus/plugin-debug' {
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/DebugConfig' {
|
declare module '@theme/DebugConfig' {
|
||||||
export default function DebugMetadata(): JSX.Element;
|
import type {ReactNode} from 'react';
|
||||||
|
|
||||||
|
export default function DebugMetadata(): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/DebugContent' {
|
declare module '@theme/DebugContent' {
|
||||||
|
import type {ReactNode} from 'react';
|
||||||
import type {AllContent} from '@docusaurus/types';
|
import type {AllContent} from '@docusaurus/types';
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
readonly allContent: AllContent;
|
readonly allContent: AllContent;
|
||||||
}
|
}
|
||||||
export default function DebugContent(props: Props): JSX.Element;
|
export default function DebugContent(props: Props): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/DebugGlobalData' {
|
declare module '@theme/DebugGlobalData' {
|
||||||
export default function DebugGlobalData(): JSX.Element;
|
import type {ReactNode} from 'react';
|
||||||
|
|
||||||
|
export default function DebugGlobalData(): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/DebugJsonView' {
|
declare module '@theme/DebugJsonView' {
|
||||||
|
import type {ReactNode} from 'react';
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
readonly src: unknown;
|
readonly src: unknown;
|
||||||
readonly collapseDepth?: number;
|
readonly collapseDepth?: number;
|
||||||
}
|
}
|
||||||
export default function DebugJsonView(props: Props): JSX.Element;
|
export default function DebugJsonView(props: Props): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/DebugLayout' {
|
declare module '@theme/DebugLayout' {
|
||||||
import type {ReactNode} from 'react';
|
import type {ReactNode} from 'react';
|
||||||
|
|
||||||
export default function DebugLayout(props: {
|
export default function DebugLayout(props: {children: ReactNode}): ReactNode;
|
||||||
children: ReactNode;
|
|
||||||
}): JSX.Element;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/DebugRegistry' {
|
declare module '@theme/DebugRegistry' {
|
||||||
export default function DebugRegistry(): JSX.Element;
|
import type {ReactNode} from 'react';
|
||||||
|
|
||||||
|
export default function DebugRegistry(): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/DebugRoutes' {
|
declare module '@theme/DebugRoutes' {
|
||||||
export default function DebugRoutes(): JSX.Element;
|
import type {ReactNode} from 'react';
|
||||||
|
|
||||||
|
export default function DebugRoutes(): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/DebugSiteMetadata' {
|
declare module '@theme/DebugSiteMetadata' {
|
||||||
export default function DebugSiteMetadata(): JSX.Element;
|
import type {ReactNode} from 'react';
|
||||||
|
|
||||||
|
export default function DebugSiteMetadata(): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,12 +5,12 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
||||||
import DebugLayout from '@theme/DebugLayout';
|
import DebugLayout from '@theme/DebugLayout';
|
||||||
import DebugJsonView from '@theme/DebugJsonView';
|
import DebugJsonView from '@theme/DebugJsonView';
|
||||||
|
|
||||||
export default function DebugMetadata(): JSX.Element {
|
export default function DebugMetadata(): ReactNode {
|
||||||
const {siteConfig} = useDocusaurusContext();
|
const {siteConfig} = useDocusaurusContext();
|
||||||
return (
|
return (
|
||||||
<DebugLayout>
|
<DebugLayout>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
|
|
||||||
import DebugLayout from '@theme/DebugLayout';
|
import DebugLayout from '@theme/DebugLayout';
|
||||||
import DebugJsonView from '@theme/DebugJsonView';
|
import DebugJsonView from '@theme/DebugJsonView';
|
||||||
|
@ -52,7 +52,7 @@ function PluginContent({
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function DebugContent({allContent}: Props): JSX.Element {
|
export default function DebugContent({allContent}: Props): ReactNode {
|
||||||
return (
|
return (
|
||||||
<DebugLayout>
|
<DebugLayout>
|
||||||
<h2>Plugin content</h2>
|
<h2>Plugin content</h2>
|
||||||
|
|
|
@ -5,12 +5,12 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import useGlobalData from '@docusaurus/useGlobalData';
|
import useGlobalData from '@docusaurus/useGlobalData';
|
||||||
import DebugLayout from '@theme/DebugLayout';
|
import DebugLayout from '@theme/DebugLayout';
|
||||||
import DebugJsonView from '@theme/DebugJsonView';
|
import DebugJsonView from '@theme/DebugJsonView';
|
||||||
|
|
||||||
export default function DebugMetadata(): JSX.Element {
|
export default function DebugMetadata(): ReactNode {
|
||||||
const globalData = useGlobalData();
|
const globalData = useGlobalData();
|
||||||
return (
|
return (
|
||||||
<DebugLayout>
|
<DebugLayout>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import {
|
import {
|
||||||
JsonView,
|
JsonView,
|
||||||
defaultStyles,
|
defaultStyles,
|
||||||
|
@ -32,10 +32,7 @@ const paraisoStyles: JsonViewProps['style'] = {
|
||||||
collapsedContent: styles.collapseContentParaiso!,
|
collapsedContent: styles.collapseContentParaiso!,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function DebugJsonView({
|
export default function DebugJsonView({src, collapseDepth}: Props): ReactNode {
|
||||||
src,
|
|
||||||
collapseDepth,
|
|
||||||
}: Props): JSX.Element {
|
|
||||||
return (
|
return (
|
||||||
<JsonView
|
<JsonView
|
||||||
data={src as object}
|
data={src as object}
|
||||||
|
|
|
@ -29,7 +29,7 @@ export default function DebugLayout({
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
}): JSX.Element {
|
}): ReactNode {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Head>
|
<Head>
|
||||||
|
|
|
@ -5,12 +5,12 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import registry from '@generated/registry';
|
import registry from '@generated/registry';
|
||||||
import DebugLayout from '@theme/DebugLayout';
|
import DebugLayout from '@theme/DebugLayout';
|
||||||
import styles from './styles.module.css';
|
import styles from './styles.module.css';
|
||||||
|
|
||||||
export default function DebugRegistry(): JSX.Element {
|
export default function DebugRegistry(): ReactNode {
|
||||||
return (
|
return (
|
||||||
<DebugLayout>
|
<DebugLayout>
|
||||||
<h2>Registry</h2>
|
<h2>Registry</h2>
|
||||||
|
|
|
@ -5,13 +5,13 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import routes from '@generated/routes';
|
import routes from '@generated/routes';
|
||||||
import DebugLayout from '@theme/DebugLayout';
|
import DebugLayout from '@theme/DebugLayout';
|
||||||
import DebugJsonView from '@theme/DebugJsonView';
|
import DebugJsonView from '@theme/DebugJsonView';
|
||||||
import styles from './styles.module.css';
|
import styles from './styles.module.css';
|
||||||
|
|
||||||
export default function DebugRoutes(): JSX.Element {
|
export default function DebugRoutes(): ReactNode {
|
||||||
return (
|
return (
|
||||||
<DebugLayout>
|
<DebugLayout>
|
||||||
<h2>Routes</h2>
|
<h2>Routes</h2>
|
||||||
|
|
|
@ -5,12 +5,12 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
||||||
import DebugLayout from '@theme/DebugLayout';
|
import DebugLayout from '@theme/DebugLayout';
|
||||||
import styles from './styles.module.css';
|
import styles from './styles.module.css';
|
||||||
|
|
||||||
export default function DebugMetadata(): JSX.Element {
|
export default function DebugMetadata(): ReactNode {
|
||||||
const {siteMetadata} = useDocusaurusContext();
|
const {siteMetadata} = useDocusaurusContext();
|
||||||
return (
|
return (
|
||||||
<DebugLayout>
|
<DebugLayout>
|
||||||
|
|
|
@ -13,7 +13,12 @@
|
||||||
* full state object.
|
* full state object.
|
||||||
*/
|
*/
|
||||||
declare module '@slorber/react-ideal-image' {
|
declare module '@slorber/react-ideal-image' {
|
||||||
import type {ComponentProps, ComponentType, CSSProperties} from 'react';
|
import type {
|
||||||
|
ComponentProps,
|
||||||
|
ComponentType,
|
||||||
|
CSSProperties,
|
||||||
|
ReactNode,
|
||||||
|
} from 'react';
|
||||||
|
|
||||||
export type LoadingState = 'initial' | 'loading' | 'loaded' | 'error';
|
export type LoadingState = 'initial' | 'loading' | 'loaded' | 'error';
|
||||||
|
|
||||||
|
@ -115,5 +120,5 @@ declare module '@slorber/react-ideal-image' {
|
||||||
width: number;
|
width: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function IdealImage(props: ImageProps): JSX.Element;
|
export default function IdealImage(props: ImageProps): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ declare module '@docusaurus/plugin-ideal-image' {
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/IdealImage' {
|
declare module '@theme/IdealImage' {
|
||||||
import type {ComponentProps} from 'react';
|
import type {ComponentProps, ReactNode} from 'react';
|
||||||
|
|
||||||
export type SrcType = {
|
export type SrcType = {
|
||||||
width: number;
|
width: number;
|
||||||
|
@ -72,5 +72,5 @@ declare module '@theme/IdealImage' {
|
||||||
export interface Props extends ComponentProps<'img'> {
|
export interface Props extends ComponentProps<'img'> {
|
||||||
readonly img: {default: string} | {src: SrcImage; preSrc: string} | string;
|
readonly img: {default: string} | {src: SrcImage; preSrc: string} | string;
|
||||||
}
|
}
|
||||||
export default function IdealImage(props: Props): JSX.Element;
|
export default function IdealImage(props: Props): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import ReactIdealImage, {
|
import ReactIdealImage, {
|
||||||
type IconKey,
|
type IconKey,
|
||||||
type State,
|
type State,
|
||||||
|
@ -80,7 +80,7 @@ function getMessage(icon: IconKey, state: State) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function IdealImage(props: Props): JSX.Element {
|
export default function IdealImage(props: Props): ReactNode {
|
||||||
const {img, ...propsRest} = props;
|
const {img, ...propsRest} = props;
|
||||||
|
|
||||||
// In dev env just use regular img with original file
|
// In dev env just use regular img with original file
|
||||||
|
|
|
@ -76,6 +76,8 @@ declare module '@docusaurus/plugin-pwa' {
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@theme/PwaReloadPopup' {
|
declare module '@theme/PwaReloadPopup' {
|
||||||
|
import type {ReactNode} from 'react';
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
/**
|
/**
|
||||||
* The popup should call this callback when the `reload` button is clicked.
|
* The popup should call this callback when the `reload` button is clicked.
|
||||||
|
@ -84,5 +86,5 @@ declare module '@theme/PwaReloadPopup' {
|
||||||
*/
|
*/
|
||||||
readonly onReload: () => void;
|
readonly onReload: () => void;
|
||||||
}
|
}
|
||||||
export default function PwaReloadPopup(props: Props): JSX.Element;
|
export default function PwaReloadPopup(props: Props): ReactNode;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,14 +5,14 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, {useState} from 'react';
|
import React, {type ReactNode, useState} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import Translate, {translate} from '@docusaurus/Translate';
|
import Translate, {translate} from '@docusaurus/Translate';
|
||||||
import type {Props} from '@theme/PwaReloadPopup';
|
import type {Props} from '@theme/PwaReloadPopup';
|
||||||
|
|
||||||
import styles from './styles.module.css';
|
import styles from './styles.module.css';
|
||||||
|
|
||||||
export default function PwaReloadPopup({onReload}: Props): JSX.Element | false {
|
export default function PwaReloadPopup({onReload}: Props): ReactNode {
|
||||||
const [isVisible, setIsVisible] = useState(true);
|
const [isVisible, setIsVisible] = useState(true);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -5,10 +5,10 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import type {Props} from '@theme/Admonition/Icon/Danger';
|
import type {Props} from '@theme/Admonition/Icon/Danger';
|
||||||
|
|
||||||
export default function AdmonitionIconDanger(props: Props): JSX.Element {
|
export default function AdmonitionIconDanger(props: Props): ReactNode {
|
||||||
return (
|
return (
|
||||||
<svg viewBox="0 0 12 16" {...props}>
|
<svg viewBox="0 0 12 16" {...props}>
|
||||||
<path
|
<path
|
||||||
|
|
|
@ -5,10 +5,10 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import type {Props} from '@theme/Admonition/Icon/Info';
|
import type {Props} from '@theme/Admonition/Icon/Info';
|
||||||
|
|
||||||
export default function AdmonitionIconInfo(props: Props): JSX.Element {
|
export default function AdmonitionIconInfo(props: Props): ReactNode {
|
||||||
return (
|
return (
|
||||||
<svg viewBox="0 0 14 16" {...props}>
|
<svg viewBox="0 0 14 16" {...props}>
|
||||||
<path
|
<path
|
||||||
|
|
|
@ -5,10 +5,10 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import type {Props} from '@theme/Admonition/Icon/Note';
|
import type {Props} from '@theme/Admonition/Icon/Note';
|
||||||
|
|
||||||
export default function AdmonitionIconNote(props: Props): JSX.Element {
|
export default function AdmonitionIconNote(props: Props): ReactNode {
|
||||||
return (
|
return (
|
||||||
<svg viewBox="0 0 14 16" {...props}>
|
<svg viewBox="0 0 14 16" {...props}>
|
||||||
<path
|
<path
|
||||||
|
|
|
@ -5,10 +5,10 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import type {Props} from '@theme/Admonition/Icon/Tip';
|
import type {Props} from '@theme/Admonition/Icon/Tip';
|
||||||
|
|
||||||
export default function AdmonitionIconTip(props: Props): JSX.Element {
|
export default function AdmonitionIconTip(props: Props): ReactNode {
|
||||||
return (
|
return (
|
||||||
<svg viewBox="0 0 12 16" {...props}>
|
<svg viewBox="0 0 12 16" {...props}>
|
||||||
<path
|
<path
|
||||||
|
|
|
@ -5,10 +5,10 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import type {Props} from '@theme/Admonition/Icon/Warning';
|
import type {Props} from '@theme/Admonition/Icon/Warning';
|
||||||
|
|
||||||
export default function AdmonitionIconCaution(props: Props): JSX.Element {
|
export default function AdmonitionIconCaution(props: Props): ReactNode {
|
||||||
return (
|
return (
|
||||||
<svg viewBox="0 0 16 16" {...props}>
|
<svg viewBox="0 0 16 16" {...props}>
|
||||||
<path
|
<path
|
||||||
|
|
|
@ -46,7 +46,7 @@ function AdmonitionContent({children}: Pick<Props, 'children'>) {
|
||||||
) : null;
|
) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function AdmonitionLayout(props: Props): JSX.Element {
|
export default function AdmonitionLayout(props: Props): ReactNode {
|
||||||
const {type, icon, title, children, className} = props;
|
const {type, icon, title, children, className} = props;
|
||||||
return (
|
return (
|
||||||
<AdmonitionContainer type={type} className={className}>
|
<AdmonitionContainer type={type} className={className}>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import Translate from '@docusaurus/Translate';
|
import Translate from '@docusaurus/Translate';
|
||||||
import type {Props} from '@theme/Admonition/Type/Caution';
|
import type {Props} from '@theme/Admonition/Type/Caution';
|
||||||
|
@ -27,7 +27,7 @@ const defaultProps = {
|
||||||
|
|
||||||
// TODO remove before v4: Caution replaced by Warning
|
// TODO remove before v4: Caution replaced by Warning
|
||||||
// see https://github.com/facebook/docusaurus/issues/7558
|
// see https://github.com/facebook/docusaurus/issues/7558
|
||||||
export default function AdmonitionTypeCaution(props: Props): JSX.Element {
|
export default function AdmonitionTypeCaution(props: Props): ReactNode {
|
||||||
return (
|
return (
|
||||||
<AdmonitionLayout
|
<AdmonitionLayout
|
||||||
{...defaultProps}
|
{...defaultProps}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import Translate from '@docusaurus/Translate';
|
import Translate from '@docusaurus/Translate';
|
||||||
import type {Props} from '@theme/Admonition/Type/Danger';
|
import type {Props} from '@theme/Admonition/Type/Danger';
|
||||||
|
@ -25,7 +25,7 @@ const defaultProps = {
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function AdmonitionTypeDanger(props: Props): JSX.Element {
|
export default function AdmonitionTypeDanger(props: Props): ReactNode {
|
||||||
return (
|
return (
|
||||||
<AdmonitionLayout
|
<AdmonitionLayout
|
||||||
{...defaultProps}
|
{...defaultProps}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import Translate from '@docusaurus/Translate';
|
import Translate from '@docusaurus/Translate';
|
||||||
import type {Props} from '@theme/Admonition/Type/Info';
|
import type {Props} from '@theme/Admonition/Type/Info';
|
||||||
|
@ -25,7 +25,7 @@ const defaultProps = {
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function AdmonitionTypeInfo(props: Props): JSX.Element {
|
export default function AdmonitionTypeInfo(props: Props): ReactNode {
|
||||||
return (
|
return (
|
||||||
<AdmonitionLayout
|
<AdmonitionLayout
|
||||||
{...defaultProps}
|
{...defaultProps}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import Translate from '@docusaurus/Translate';
|
import Translate from '@docusaurus/Translate';
|
||||||
import type {Props} from '@theme/Admonition/Type/Note';
|
import type {Props} from '@theme/Admonition/Type/Note';
|
||||||
|
@ -25,7 +25,7 @@ const defaultProps = {
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function AdmonitionTypeNote(props: Props): JSX.Element {
|
export default function AdmonitionTypeNote(props: Props): ReactNode {
|
||||||
return (
|
return (
|
||||||
<AdmonitionLayout
|
<AdmonitionLayout
|
||||||
{...defaultProps}
|
{...defaultProps}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import Translate from '@docusaurus/Translate';
|
import Translate from '@docusaurus/Translate';
|
||||||
import type {Props} from '@theme/Admonition/Type/Tip';
|
import type {Props} from '@theme/Admonition/Type/Tip';
|
||||||
|
@ -25,7 +25,7 @@ const defaultProps = {
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function AdmonitionTypeTip(props: Props): JSX.Element {
|
export default function AdmonitionTypeTip(props: Props): ReactNode {
|
||||||
return (
|
return (
|
||||||
<AdmonitionLayout
|
<AdmonitionLayout
|
||||||
{...defaultProps}
|
{...defaultProps}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import Translate from '@docusaurus/Translate';
|
import Translate from '@docusaurus/Translate';
|
||||||
import type {Props} from '@theme/Admonition/Type/Warning';
|
import type {Props} from '@theme/Admonition/Type/Warning';
|
||||||
|
@ -25,7 +25,7 @@ const defaultProps = {
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function AdmonitionTypeWarning(props: Props): JSX.Element {
|
export default function AdmonitionTypeWarning(props: Props): ReactNode {
|
||||||
return (
|
return (
|
||||||
<AdmonitionLayout
|
<AdmonitionLayout
|
||||||
{...defaultProps}
|
{...defaultProps}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, {type ComponentType} from 'react';
|
import React, {type ComponentType, type ReactNode} from 'react';
|
||||||
import {processAdmonitionProps} from '@docusaurus/theme-common';
|
import {processAdmonitionProps} from '@docusaurus/theme-common';
|
||||||
import type {Props} from '@theme/Admonition';
|
import type {Props} from '@theme/Admonition';
|
||||||
import AdmonitionTypes from '@theme/Admonition/Types';
|
import AdmonitionTypes from '@theme/Admonition/Types';
|
||||||
|
@ -21,7 +21,7 @@ function getAdmonitionTypeComponent(type: string): ComponentType<Props> {
|
||||||
return AdmonitionTypes.info!;
|
return AdmonitionTypes.info!;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function Admonition(unprocessedProps: Props): JSX.Element {
|
export default function Admonition(unprocessedProps: Props): ReactNode {
|
||||||
const props = processAdmonitionProps(unprocessedProps);
|
const props = processAdmonitionProps(unprocessedProps);
|
||||||
const AdmonitionTypeComponent = getAdmonitionTypeComponent(props.type);
|
const AdmonitionTypeComponent = getAdmonitionTypeComponent(props.type);
|
||||||
return <AdmonitionTypeComponent {...props} />;
|
return <AdmonitionTypeComponent {...props} />;
|
||||||
|
|
|
@ -5,16 +5,14 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import {translate} from '@docusaurus/Translate';
|
import {translate} from '@docusaurus/Translate';
|
||||||
import IconClose from '@theme/Icon/Close';
|
import IconClose from '@theme/Icon/Close';
|
||||||
import type {Props} from '@theme/AnnouncementBar/CloseButton';
|
import type {Props} from '@theme/AnnouncementBar/CloseButton';
|
||||||
import styles from './styles.module.css';
|
import styles from './styles.module.css';
|
||||||
|
|
||||||
export default function AnnouncementBarCloseButton(
|
export default function AnnouncementBarCloseButton(props: Props): ReactNode {
|
||||||
props: Props,
|
|
||||||
): JSX.Element | null {
|
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
|
|
|
@ -5,15 +5,13 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import {useThemeConfig} from '@docusaurus/theme-common';
|
import {useThemeConfig} from '@docusaurus/theme-common';
|
||||||
import type {Props} from '@theme/AnnouncementBar/Content';
|
import type {Props} from '@theme/AnnouncementBar/Content';
|
||||||
import styles from './styles.module.css';
|
import styles from './styles.module.css';
|
||||||
|
|
||||||
export default function AnnouncementBarContent(
|
export default function AnnouncementBarContent(props: Props): ReactNode {
|
||||||
props: Props,
|
|
||||||
): JSX.Element | null {
|
|
||||||
const {announcementBar} = useThemeConfig();
|
const {announcementBar} = useThemeConfig();
|
||||||
const {content} = announcementBar!;
|
const {content} = announcementBar!;
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import {useThemeConfig} from '@docusaurus/theme-common';
|
import {useThemeConfig} from '@docusaurus/theme-common';
|
||||||
import {useAnnouncementBar} from '@docusaurus/theme-common/internal';
|
import {useAnnouncementBar} from '@docusaurus/theme-common/internal';
|
||||||
import AnnouncementBarCloseButton from '@theme/AnnouncementBar/CloseButton';
|
import AnnouncementBarCloseButton from '@theme/AnnouncementBar/CloseButton';
|
||||||
|
@ -13,7 +13,7 @@ import AnnouncementBarContent from '@theme/AnnouncementBar/Content';
|
||||||
|
|
||||||
import styles from './styles.module.css';
|
import styles from './styles.module.css';
|
||||||
|
|
||||||
export default function AnnouncementBar(): JSX.Element | null {
|
export default function AnnouncementBar(): ReactNode {
|
||||||
const {announcementBar} = useThemeConfig();
|
const {announcementBar} = useThemeConfig();
|
||||||
const {isActive, close} = useAnnouncementBar();
|
const {isActive, close} = useAnnouncementBar();
|
||||||
if (!isActive) {
|
if (!isActive) {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import {translate} from '@docusaurus/Translate';
|
import {translate} from '@docusaurus/Translate';
|
||||||
import {ThemeClassNames} from '@docusaurus/theme-common';
|
import {ThemeClassNames} from '@docusaurus/theme-common';
|
||||||
|
@ -13,7 +13,7 @@ import {useBackToTopButton} from '@docusaurus/theme-common/internal';
|
||||||
|
|
||||||
import styles from './styles.module.css';
|
import styles from './styles.module.css';
|
||||||
|
|
||||||
export default function BackToTopButton(): JSX.Element {
|
export default function BackToTopButton(): ReactNode {
|
||||||
const {shown, scrollToTop} = useBackToTopButton({threshold: 300});
|
const {shown, scrollToTop} = useBackToTopButton({threshold: 300});
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type {ComponentType} from 'react';
|
import type {ComponentType, ReactNode} from 'react';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import Link from '@docusaurus/Link';
|
import Link from '@docusaurus/Link';
|
||||||
|
@ -54,7 +54,7 @@ export default function BlogAuthorSocials({
|
||||||
author,
|
author,
|
||||||
}: {
|
}: {
|
||||||
author: Props['author'];
|
author: Props['author'];
|
||||||
}): JSX.Element {
|
}): ReactNode {
|
||||||
const entries = Object.entries(author.socials ?? {});
|
const entries = Object.entries(author.socials ?? {});
|
||||||
return (
|
return (
|
||||||
<div className={styles.authorSocials}>
|
<div className={styles.authorSocials}>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import Link, {type Props as LinkProps} from '@docusaurus/Link';
|
import Link, {type Props as LinkProps} from '@docusaurus/Link';
|
||||||
import AuthorSocials from '@theme/Blog/Components/Author/Socials';
|
import AuthorSocials from '@theme/Blog/Components/Author/Socials';
|
||||||
|
@ -13,7 +13,7 @@ import type {Props} from '@theme/Blog/Components/Author';
|
||||||
import Heading from '@theme/Heading';
|
import Heading from '@theme/Heading';
|
||||||
import styles from './styles.module.css';
|
import styles from './styles.module.css';
|
||||||
|
|
||||||
function MaybeLink(props: LinkProps): JSX.Element {
|
function MaybeLink(props: LinkProps): ReactNode {
|
||||||
if (props.href) {
|
if (props.href) {
|
||||||
return <Link {...props} />;
|
return <Link {...props} />;
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ export default function BlogAuthor({
|
||||||
author,
|
author,
|
||||||
className,
|
className,
|
||||||
count,
|
count,
|
||||||
}: Props): JSX.Element {
|
}: Props): ReactNode {
|
||||||
const {name, title, url, imageURL, email, page} = author;
|
const {name, title, url, imageURL, email, page} = author;
|
||||||
const link =
|
const link =
|
||||||
page?.permalink || url || (email && `mailto:${email}`) || undefined;
|
page?.permalink || url || (email && `mailto:${email}`) || undefined;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import {
|
import {
|
||||||
PageMetadata,
|
PageMetadata,
|
||||||
|
@ -26,7 +26,7 @@ import type {Props} from '@theme/Blog/Pages/BlogAuthorsPostsPage';
|
||||||
import BlogPostItems from '@theme/BlogPostItems';
|
import BlogPostItems from '@theme/BlogPostItems';
|
||||||
import Author from '@theme/Blog/Components/Author';
|
import Author from '@theme/Blog/Components/Author';
|
||||||
|
|
||||||
function Metadata({author}: Props): JSX.Element {
|
function Metadata({author}: Props): ReactNode {
|
||||||
const title = useBlogAuthorPageTitle(author);
|
const title = useBlogAuthorPageTitle(author);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
@ -45,7 +45,7 @@ function ViewAllAuthorsLink() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function Content({author, items, sidebar, listMetadata}: Props): JSX.Element {
|
function Content({author, items, sidebar, listMetadata}: Props): ReactNode {
|
||||||
return (
|
return (
|
||||||
<BlogLayout sidebar={sidebar}>
|
<BlogLayout sidebar={sidebar}>
|
||||||
<header className="margin-bottom--xl">
|
<header className="margin-bottom--xl">
|
||||||
|
@ -68,7 +68,7 @@ function Content({author, items, sidebar, listMetadata}: Props): JSX.Element {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function BlogAuthorsPostsPage(props: Props): JSX.Element {
|
export default function BlogAuthorsPostsPage(props: Props): ReactNode {
|
||||||
return (
|
return (
|
||||||
<HtmlClassNameProvider
|
<HtmlClassNameProvider
|
||||||
className={clsx(
|
className={clsx(
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import Link from '@docusaurus/Link';
|
import Link from '@docusaurus/Link';
|
||||||
import {translate} from '@docusaurus/Translate';
|
import {translate} from '@docusaurus/Translate';
|
||||||
import {PageMetadata} from '@docusaurus/theme-common';
|
import {PageMetadata} from '@docusaurus/theme-common';
|
||||||
|
@ -76,7 +76,7 @@ function listPostsByYears(blogPosts: readonly ArchiveBlogPost[]): YearProp[] {
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function BlogArchive({archive}: Props): JSX.Element {
|
export default function BlogArchive({archive}: Props): ReactNode {
|
||||||
const title = translate({
|
const title = translate({
|
||||||
id: 'theme.blog.archive.title',
|
id: 'theme.blog.archive.title',
|
||||||
message: 'Archive',
|
message: 'Archive',
|
||||||
|
|
|
@ -5,14 +5,14 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import Layout from '@theme/Layout';
|
import Layout from '@theme/Layout';
|
||||||
import BlogSidebar from '@theme/BlogSidebar';
|
import BlogSidebar from '@theme/BlogSidebar';
|
||||||
|
|
||||||
import type {Props} from '@theme/BlogLayout';
|
import type {Props} from '@theme/BlogLayout';
|
||||||
|
|
||||||
export default function BlogLayout(props: Props): JSX.Element {
|
export default function BlogLayout(props: Props): ReactNode {
|
||||||
const {sidebar, toc, children, ...layoutProps} = props;
|
const {sidebar, toc, children, ...layoutProps} = props;
|
||||||
const hasSidebar = sidebar && sidebar.items.length > 0;
|
const hasSidebar = sidebar && sidebar.items.length > 0;
|
||||||
|
|
||||||
|
|
|
@ -5,12 +5,12 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import Head from '@docusaurus/Head';
|
import Head from '@docusaurus/Head';
|
||||||
import {useBlogListPageStructuredData} from '@docusaurus/plugin-content-blog/client';
|
import {useBlogListPageStructuredData} from '@docusaurus/plugin-content-blog/client';
|
||||||
import type {Props} from '@theme/BlogListPage/StructuredData';
|
import type {Props} from '@theme/BlogListPage/StructuredData';
|
||||||
|
|
||||||
export default function BlogListPageStructuredData(props: Props): JSX.Element {
|
export default function BlogListPageStructuredData(props: Props): ReactNode {
|
||||||
const structuredData = useBlogListPageStructuredData(props);
|
const structuredData = useBlogListPageStructuredData(props);
|
||||||
return (
|
return (
|
||||||
<Head>
|
<Head>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
|
|
||||||
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
||||||
|
@ -21,7 +21,7 @@ import type {Props} from '@theme/BlogListPage';
|
||||||
import BlogPostItems from '@theme/BlogPostItems';
|
import BlogPostItems from '@theme/BlogPostItems';
|
||||||
import BlogListPageStructuredData from '@theme/BlogListPage/StructuredData';
|
import BlogListPageStructuredData from '@theme/BlogListPage/StructuredData';
|
||||||
|
|
||||||
function BlogListPageMetadata(props: Props): JSX.Element {
|
function BlogListPageMetadata(props: Props): ReactNode {
|
||||||
const {metadata} = props;
|
const {metadata} = props;
|
||||||
const {
|
const {
|
||||||
siteConfig: {title: siteTitle},
|
siteConfig: {title: siteTitle},
|
||||||
|
@ -37,7 +37,7 @@ function BlogListPageMetadata(props: Props): JSX.Element {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function BlogListPageContent(props: Props): JSX.Element {
|
function BlogListPageContent(props: Props): ReactNode {
|
||||||
const {metadata, items, sidebar} = props;
|
const {metadata, items, sidebar} = props;
|
||||||
return (
|
return (
|
||||||
<BlogLayout sidebar={sidebar}>
|
<BlogLayout sidebar={sidebar}>
|
||||||
|
@ -47,7 +47,7 @@ function BlogListPageContent(props: Props): JSX.Element {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function BlogListPage(props: Props): JSX.Element {
|
export default function BlogListPage(props: Props): ReactNode {
|
||||||
return (
|
return (
|
||||||
<HtmlClassNameProvider
|
<HtmlClassNameProvider
|
||||||
className={clsx(
|
className={clsx(
|
||||||
|
|
|
@ -5,12 +5,12 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import Translate, {translate} from '@docusaurus/Translate';
|
import Translate, {translate} from '@docusaurus/Translate';
|
||||||
import PaginatorNavLink from '@theme/PaginatorNavLink';
|
import PaginatorNavLink from '@theme/PaginatorNavLink';
|
||||||
import type {Props} from '@theme/BlogListPaginator';
|
import type {Props} from '@theme/BlogListPaginator';
|
||||||
|
|
||||||
export default function BlogListPaginator(props: Props): JSX.Element {
|
export default function BlogListPaginator(props: Props): ReactNode {
|
||||||
const {metadata} = props;
|
const {metadata} = props;
|
||||||
const {previousPage, nextPage} = metadata;
|
const {previousPage, nextPage} = metadata;
|
||||||
|
|
||||||
|
|
|
@ -5,12 +5,12 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import type {Props} from '@theme/BlogPostItem/Container';
|
import type {Props} from '@theme/BlogPostItem/Container';
|
||||||
|
|
||||||
export default function BlogPostItemContainer({
|
export default function BlogPostItemContainer({
|
||||||
children,
|
children,
|
||||||
className,
|
className,
|
||||||
}: Props): JSX.Element {
|
}: Props): ReactNode {
|
||||||
return <article className={className}>{children}</article>;
|
return <article className={className}>{children}</article>;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import {blogPostContainerID} from '@docusaurus/utils-common';
|
import {blogPostContainerID} from '@docusaurus/utils-common';
|
||||||
import {useBlogPost} from '@docusaurus/plugin-content-blog/client';
|
import {useBlogPost} from '@docusaurus/plugin-content-blog/client';
|
||||||
|
@ -15,7 +15,7 @@ import type {Props} from '@theme/BlogPostItem/Content';
|
||||||
export default function BlogPostItemContent({
|
export default function BlogPostItemContent({
|
||||||
children,
|
children,
|
||||||
className,
|
className,
|
||||||
}: Props): JSX.Element {
|
}: Props): ReactNode {
|
||||||
const {isBlogPostPage} = useBlogPost();
|
const {isBlogPostPage} = useBlogPost();
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import Translate, {translate} from '@docusaurus/Translate';
|
import Translate, {translate} from '@docusaurus/Translate';
|
||||||
import Link from '@docusaurus/Link';
|
import Link from '@docusaurus/Link';
|
||||||
import type {Props} from '@theme/BlogPostItem/Footer/ReadMoreLink';
|
import type {Props} from '@theme/BlogPostItem/Footer/ReadMoreLink';
|
||||||
|
@ -24,7 +24,7 @@ function ReadMoreLabel() {
|
||||||
|
|
||||||
export default function BlogPostItemFooterReadMoreLink(
|
export default function BlogPostItemFooterReadMoreLink(
|
||||||
props: Props,
|
props: Props,
|
||||||
): JSX.Element {
|
): ReactNode {
|
||||||
const {blogPostTitle, ...linkProps} = props;
|
const {blogPostTitle, ...linkProps} = props;
|
||||||
return (
|
return (
|
||||||
<Link
|
<Link
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import {useBlogPost} from '@docusaurus/plugin-content-blog/client';
|
import {useBlogPost} from '@docusaurus/plugin-content-blog/client';
|
||||||
import {ThemeClassNames} from '@docusaurus/theme-common';
|
import {ThemeClassNames} from '@docusaurus/theme-common';
|
||||||
|
@ -13,7 +13,7 @@ import EditMetaRow from '@theme/EditMetaRow';
|
||||||
import TagsListInline from '@theme/TagsListInline';
|
import TagsListInline from '@theme/TagsListInline';
|
||||||
import ReadMoreLink from '@theme/BlogPostItem/Footer/ReadMoreLink';
|
import ReadMoreLink from '@theme/BlogPostItem/Footer/ReadMoreLink';
|
||||||
|
|
||||||
export default function BlogPostItemFooter(): JSX.Element | null {
|
export default function BlogPostItemFooter(): ReactNode {
|
||||||
const {metadata, isBlogPostPage} = useBlogPost();
|
const {metadata, isBlogPostPage} = useBlogPost();
|
||||||
const {
|
const {
|
||||||
tags,
|
tags,
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import {useBlogPost} from '@docusaurus/plugin-content-blog/client';
|
import {useBlogPost} from '@docusaurus/plugin-content-blog/client';
|
||||||
import BlogAuthor from '@theme/Blog/Components/Author';
|
import BlogAuthor from '@theme/Blog/Components/Author';
|
||||||
|
@ -15,7 +15,7 @@ import styles from './styles.module.css';
|
||||||
// Component responsible for the authors layout
|
// Component responsible for the authors layout
|
||||||
export default function BlogPostItemHeaderAuthors({
|
export default function BlogPostItemHeaderAuthors({
|
||||||
className,
|
className,
|
||||||
}: Props): JSX.Element | null {
|
}: Props): ReactNode {
|
||||||
const {
|
const {
|
||||||
metadata: {authors},
|
metadata: {authors},
|
||||||
assets,
|
assets,
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import {translate} from '@docusaurus/Translate';
|
import {translate} from '@docusaurus/Translate';
|
||||||
import {usePluralForm} from '@docusaurus/theme-common';
|
import {usePluralForm} from '@docusaurus/theme-common';
|
||||||
|
@ -54,9 +54,7 @@ function Spacer() {
|
||||||
return <>{' · '}</>;
|
return <>{' · '}</>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function BlogPostItemHeaderInfo({
|
export default function BlogPostItemHeaderInfo({className}: Props): ReactNode {
|
||||||
className,
|
|
||||||
}: Props): JSX.Element {
|
|
||||||
const {metadata} = useBlogPost();
|
const {metadata} = useBlogPost();
|
||||||
const {date, readingTime} = metadata;
|
const {date, readingTime} = metadata;
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import Link from '@docusaurus/Link';
|
import Link from '@docusaurus/Link';
|
||||||
import {useBlogPost} from '@docusaurus/plugin-content-blog/client';
|
import {useBlogPost} from '@docusaurus/plugin-content-blog/client';
|
||||||
|
@ -13,9 +13,7 @@ import type {Props} from '@theme/BlogPostItem/Header/Title';
|
||||||
|
|
||||||
import styles from './styles.module.css';
|
import styles from './styles.module.css';
|
||||||
|
|
||||||
export default function BlogPostItemHeaderTitle({
|
export default function BlogPostItemHeaderTitle({className}: Props): ReactNode {
|
||||||
className,
|
|
||||||
}: Props): JSX.Element {
|
|
||||||
const {metadata, isBlogPostPage} = useBlogPost();
|
const {metadata, isBlogPostPage} = useBlogPost();
|
||||||
const {permalink, title} = metadata;
|
const {permalink, title} = metadata;
|
||||||
const TitleHeading = isBlogPostPage ? 'h1' : 'h2';
|
const TitleHeading = isBlogPostPage ? 'h1' : 'h2';
|
||||||
|
|
|
@ -5,12 +5,12 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import BlogPostItemHeaderTitle from '@theme/BlogPostItem/Header/Title';
|
import BlogPostItemHeaderTitle from '@theme/BlogPostItem/Header/Title';
|
||||||
import BlogPostItemHeaderInfo from '@theme/BlogPostItem/Header/Info';
|
import BlogPostItemHeaderInfo from '@theme/BlogPostItem/Header/Info';
|
||||||
import BlogPostItemHeaderAuthors from '@theme/BlogPostItem/Header/Authors';
|
import BlogPostItemHeaderAuthors from '@theme/BlogPostItem/Header/Authors';
|
||||||
|
|
||||||
export default function BlogPostItemHeader(): JSX.Element {
|
export default function BlogPostItemHeader(): ReactNode {
|
||||||
return (
|
return (
|
||||||
<header>
|
<header>
|
||||||
<BlogPostItemHeaderTitle />
|
<BlogPostItemHeaderTitle />
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import {useBlogPost} from '@docusaurus/plugin-content-blog/client';
|
import {useBlogPost} from '@docusaurus/plugin-content-blog/client';
|
||||||
import BlogPostItemContainer from '@theme/BlogPostItem/Container';
|
import BlogPostItemContainer from '@theme/BlogPostItem/Container';
|
||||||
|
@ -20,10 +20,7 @@ function useContainerClassName() {
|
||||||
return !isBlogPostPage ? 'margin-bottom--xl' : undefined;
|
return !isBlogPostPage ? 'margin-bottom--xl' : undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function BlogPostItem({
|
export default function BlogPostItem({children, className}: Props): ReactNode {
|
||||||
children,
|
|
||||||
className,
|
|
||||||
}: Props): JSX.Element {
|
|
||||||
const containerClassName = useContainerClassName();
|
const containerClassName = useContainerClassName();
|
||||||
return (
|
return (
|
||||||
<BlogPostItemContainer className={clsx(containerClassName, className)}>
|
<BlogPostItemContainer className={clsx(containerClassName, className)}>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import {BlogPostProvider} from '@docusaurus/plugin-content-blog/client';
|
import {BlogPostProvider} from '@docusaurus/plugin-content-blog/client';
|
||||||
import BlogPostItem from '@theme/BlogPostItem';
|
import BlogPostItem from '@theme/BlogPostItem';
|
||||||
import type {Props} from '@theme/BlogPostItems';
|
import type {Props} from '@theme/BlogPostItems';
|
||||||
|
@ -13,7 +13,7 @@ import type {Props} from '@theme/BlogPostItems';
|
||||||
export default function BlogPostItems({
|
export default function BlogPostItems({
|
||||||
items,
|
items,
|
||||||
component: BlogPostItemComponent = BlogPostItem,
|
component: BlogPostItemComponent = BlogPostItem,
|
||||||
}: Props): JSX.Element {
|
}: Props): ReactNode {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{items.map(({content: BlogPostContent}) => (
|
{items.map(({content: BlogPostContent}) => (
|
||||||
|
|
|
@ -5,11 +5,11 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import {PageMetadata} from '@docusaurus/theme-common';
|
import {PageMetadata} from '@docusaurus/theme-common';
|
||||||
import {useBlogPost} from '@docusaurus/plugin-content-blog/client';
|
import {useBlogPost} from '@docusaurus/plugin-content-blog/client';
|
||||||
|
|
||||||
export default function BlogPostPageMetadata(): JSX.Element {
|
export default function BlogPostPageMetadata(): ReactNode {
|
||||||
const {assets, metadata} = useBlogPost();
|
const {assets, metadata} = useBlogPost();
|
||||||
const {title, description, date, tags, authors, frontMatter} = metadata;
|
const {title, description, date, tags, authors, frontMatter} = metadata;
|
||||||
|
|
||||||
|
|
|
@ -5,11 +5,11 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import Head from '@docusaurus/Head';
|
import Head from '@docusaurus/Head';
|
||||||
import {useBlogPostStructuredData} from '@docusaurus/plugin-content-blog/client';
|
import {useBlogPostStructuredData} from '@docusaurus/plugin-content-blog/client';
|
||||||
|
|
||||||
export default function BlogPostStructuredData(): JSX.Element {
|
export default function BlogPostStructuredData(): ReactNode {
|
||||||
const structuredData = useBlogPostStructuredData();
|
const structuredData = useBlogPostStructuredData();
|
||||||
return (
|
return (
|
||||||
<Head>
|
<Head>
|
||||||
|
|
|
@ -28,7 +28,7 @@ function BlogPostPageContent({
|
||||||
}: {
|
}: {
|
||||||
sidebar: BlogSidebar;
|
sidebar: BlogSidebar;
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
}): JSX.Element {
|
}): ReactNode {
|
||||||
const {metadata, toc} = useBlogPost();
|
const {metadata, toc} = useBlogPost();
|
||||||
const {nextItem, prevItem, frontMatter} = metadata;
|
const {nextItem, prevItem, frontMatter} = metadata;
|
||||||
const {
|
const {
|
||||||
|
@ -59,7 +59,7 @@ function BlogPostPageContent({
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function BlogPostPage(props: Props): JSX.Element {
|
export default function BlogPostPage(props: Props): ReactNode {
|
||||||
const BlogPostContent = props.content;
|
const BlogPostContent = props.content;
|
||||||
return (
|
return (
|
||||||
<BlogPostProvider content={props.content} isBlogPostPage>
|
<BlogPostProvider content={props.content} isBlogPostPage>
|
||||||
|
|
|
@ -5,12 +5,12 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import Translate, {translate} from '@docusaurus/Translate';
|
import Translate, {translate} from '@docusaurus/Translate';
|
||||||
import PaginatorNavLink from '@theme/PaginatorNavLink';
|
import PaginatorNavLink from '@theme/PaginatorNavLink';
|
||||||
import type {Props} from '@theme/BlogPostPaginator';
|
import type {Props} from '@theme/BlogPostPaginator';
|
||||||
|
|
||||||
export default function BlogPostPaginator(props: Props): JSX.Element {
|
export default function BlogPostPaginator(props: Props): ReactNode {
|
||||||
const {nextItem, prevItem} = props;
|
const {nextItem, prevItem} = props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, {memo} from 'react';
|
import React, {memo, type ReactNode} from 'react';
|
||||||
import {
|
import {
|
||||||
useVisibleBlogSidebarItems,
|
useVisibleBlogSidebarItems,
|
||||||
BlogSidebarItemList,
|
BlogSidebarItemList,
|
||||||
|
@ -29,7 +29,7 @@ const ListComponent: BlogSidebarContentProps['ListComponent'] = ({items}) => {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
function BlogSidebarMobileSecondaryMenu({sidebar}: Props): JSX.Element {
|
function BlogSidebarMobileSecondaryMenu({sidebar}: Props): ReactNode {
|
||||||
const items = useVisibleBlogSidebarItems(sidebar.items);
|
const items = useVisibleBlogSidebarItems(sidebar.items);
|
||||||
return (
|
return (
|
||||||
<BlogSidebarContent
|
<BlogSidebarContent
|
||||||
|
@ -40,7 +40,7 @@ function BlogSidebarMobileSecondaryMenu({sidebar}: Props): JSX.Element {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function BlogSidebarMobile(props: Props): JSX.Element {
|
function BlogSidebarMobile(props: Props): ReactNode {
|
||||||
return (
|
return (
|
||||||
<NavbarSecondaryMenuFiller
|
<NavbarSecondaryMenuFiller
|
||||||
component={BlogSidebarMobileSecondaryMenu}
|
component={BlogSidebarMobileSecondaryMenu}
|
||||||
|
|
|
@ -5,13 +5,13 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import {useWindowSize} from '@docusaurus/theme-common';
|
import {useWindowSize} from '@docusaurus/theme-common';
|
||||||
import BlogSidebarDesktop from '@theme/BlogSidebar/Desktop';
|
import BlogSidebarDesktop from '@theme/BlogSidebar/Desktop';
|
||||||
import BlogSidebarMobile from '@theme/BlogSidebar/Mobile';
|
import BlogSidebarMobile from '@theme/BlogSidebar/Mobile';
|
||||||
import type {Props} from '@theme/BlogSidebar';
|
import type {Props} from '@theme/BlogSidebar';
|
||||||
|
|
||||||
export default function BlogSidebar({sidebar}: Props): JSX.Element | null {
|
export default function BlogSidebar({sidebar}: Props): ReactNode {
|
||||||
const windowSize = useWindowSize();
|
const windowSize = useWindowSize();
|
||||||
if (!sidebar?.items.length) {
|
if (!sidebar?.items.length) {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import {
|
import {
|
||||||
PageMetadata,
|
PageMetadata,
|
||||||
|
@ -19,7 +19,7 @@ import type {Props} from '@theme/BlogTagsListPage';
|
||||||
import SearchMetadata from '@theme/SearchMetadata';
|
import SearchMetadata from '@theme/SearchMetadata';
|
||||||
import Heading from '@theme/Heading';
|
import Heading from '@theme/Heading';
|
||||||
|
|
||||||
export default function BlogTagsListPage({tags, sidebar}: Props): JSX.Element {
|
export default function BlogTagsListPage({tags, sidebar}: Props): ReactNode {
|
||||||
const title = translateTagsPageTitle();
|
const title = translateTagsPageTitle();
|
||||||
return (
|
return (
|
||||||
<HtmlClassNameProvider
|
<HtmlClassNameProvider
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import Translate from '@docusaurus/Translate';
|
import Translate from '@docusaurus/Translate';
|
||||||
import {
|
import {
|
||||||
|
@ -23,7 +23,7 @@ import BlogPostItems from '@theme/BlogPostItems';
|
||||||
import Unlisted from '@theme/ContentVisibility/Unlisted';
|
import Unlisted from '@theme/ContentVisibility/Unlisted';
|
||||||
import Heading from '@theme/Heading';
|
import Heading from '@theme/Heading';
|
||||||
|
|
||||||
function BlogTagsPostsPageMetadata({tag}: Props): JSX.Element {
|
function BlogTagsPostsPageMetadata({tag}: Props): ReactNode {
|
||||||
const title = useBlogTagsPostsPageTitle(tag);
|
const title = useBlogTagsPostsPageTitle(tag);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
@ -38,7 +38,7 @@ function BlogTagsPostsPageContent({
|
||||||
items,
|
items,
|
||||||
sidebar,
|
sidebar,
|
||||||
listMetadata,
|
listMetadata,
|
||||||
}: Props): JSX.Element {
|
}: Props): ReactNode {
|
||||||
const title = useBlogTagsPostsPageTitle(tag);
|
const title = useBlogTagsPostsPageTitle(tag);
|
||||||
return (
|
return (
|
||||||
<BlogLayout sidebar={sidebar}>
|
<BlogLayout sidebar={sidebar}>
|
||||||
|
@ -59,7 +59,7 @@ function BlogTagsPostsPageContent({
|
||||||
</BlogLayout>
|
</BlogLayout>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
export default function BlogTagsPostsPage(props: Props): JSX.Element {
|
export default function BlogTagsPostsPage(props: Props): ReactNode {
|
||||||
return (
|
return (
|
||||||
<HtmlClassNameProvider
|
<HtmlClassNameProvider
|
||||||
className={clsx(
|
className={clsx(
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, {type ComponentProps} from 'react';
|
import React, {type ComponentProps, type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import {ThemeClassNames, usePrismTheme} from '@docusaurus/theme-common';
|
import {ThemeClassNames, usePrismTheme} from '@docusaurus/theme-common';
|
||||||
import {getPrismCssVariables} from '@docusaurus/theme-common/internal';
|
import {getPrismCssVariables} from '@docusaurus/theme-common/internal';
|
||||||
|
@ -14,7 +14,7 @@ import styles from './styles.module.css';
|
||||||
export default function CodeBlockContainer<T extends 'div' | 'pre'>({
|
export default function CodeBlockContainer<T extends 'div' | 'pre'>({
|
||||||
as: As,
|
as: As,
|
||||||
...props
|
...props
|
||||||
}: {as: T} & ComponentProps<T>): JSX.Element {
|
}: {as: T} & ComponentProps<T>): ReactNode {
|
||||||
const prismTheme = usePrismTheme();
|
const prismTheme = usePrismTheme();
|
||||||
const prismCssVariables = getPrismCssVariables(prismTheme);
|
const prismCssVariables = getPrismCssVariables(prismTheme);
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import Container from '@theme/CodeBlock/Container';
|
import Container from '@theme/CodeBlock/Container';
|
||||||
import type {Props} from '@theme/CodeBlock/Content/Element';
|
import type {Props} from '@theme/CodeBlock/Content/Element';
|
||||||
|
@ -15,10 +15,7 @@ import styles from './styles.module.css';
|
||||||
// <pre> tags in markdown map to CodeBlocks. They may contain JSX children. When
|
// <pre> tags in markdown map to CodeBlocks. They may contain JSX children. When
|
||||||
// the children is not a simple string, we just return a styled block without
|
// the children is not a simple string, we just return a styled block without
|
||||||
// actually highlighting.
|
// actually highlighting.
|
||||||
export default function CodeBlockJSX({
|
export default function CodeBlockJSX({children, className}: Props): ReactNode {
|
||||||
children,
|
|
||||||
className,
|
|
||||||
}: Props): JSX.Element {
|
|
||||||
return (
|
return (
|
||||||
<Container
|
<Container
|
||||||
as="pre"
|
as="pre"
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import {useThemeConfig, usePrismTheme} from '@docusaurus/theme-common';
|
import {useThemeConfig, usePrismTheme} from '@docusaurus/theme-common';
|
||||||
import {
|
import {
|
||||||
|
@ -38,7 +38,7 @@ export default function CodeBlockString({
|
||||||
title: titleProp,
|
title: titleProp,
|
||||||
showLineNumbers: showLineNumbersProp,
|
showLineNumbers: showLineNumbersProp,
|
||||||
language: languageProp,
|
language: languageProp,
|
||||||
}: Props): JSX.Element {
|
}: Props): ReactNode {
|
||||||
const {
|
const {
|
||||||
prism: {defaultLanguage, magicComments},
|
prism: {defaultLanguage, magicComments},
|
||||||
} = useThemeConfig();
|
} = useThemeConfig();
|
||||||
|
|
|
@ -5,7 +5,13 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, {useCallback, useState, useRef, useEffect} from 'react';
|
import React, {
|
||||||
|
useCallback,
|
||||||
|
useState,
|
||||||
|
useRef,
|
||||||
|
useEffect,
|
||||||
|
type ReactNode,
|
||||||
|
} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import copy from 'copy-text-to-clipboard';
|
import copy from 'copy-text-to-clipboard';
|
||||||
import {translate} from '@docusaurus/Translate';
|
import {translate} from '@docusaurus/Translate';
|
||||||
|
@ -15,7 +21,7 @@ import IconSuccess from '@theme/Icon/Success';
|
||||||
|
|
||||||
import styles from './styles.module.css';
|
import styles from './styles.module.css';
|
||||||
|
|
||||||
export default function CopyButton({code, className}: Props): JSX.Element {
|
export default function CopyButton({code, className}: Props): ReactNode {
|
||||||
const [isCopied, setIsCopied] = useState(false);
|
const [isCopied, setIsCopied] = useState(false);
|
||||||
const copyTimeout = useRef<number | undefined>(undefined);
|
const copyTimeout = useRef<number | undefined>(undefined);
|
||||||
const handleCopyCode = useCallback(() => {
|
const handleCopyCode = useCallback(() => {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import type {Props} from '@theme/CodeBlock/Line';
|
import type {Props} from '@theme/CodeBlock/Line';
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ export default function CodeBlockLine({
|
||||||
showLineNumbers,
|
showLineNumbers,
|
||||||
getLineProps,
|
getLineProps,
|
||||||
getTokenProps,
|
getTokenProps,
|
||||||
}: Props): JSX.Element {
|
}: Props): ReactNode {
|
||||||
if (line.length === 1 && line[0]!.content === '\n') {
|
if (line.length === 1 && line[0]!.content === '\n') {
|
||||||
line[0]!.content = '';
|
line[0]!.content = '';
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import {translate} from '@docusaurus/Translate';
|
import {translate} from '@docusaurus/Translate';
|
||||||
import type {Props} from '@theme/CodeBlock/WordWrapButton';
|
import type {Props} from '@theme/CodeBlock/WordWrapButton';
|
||||||
|
@ -17,7 +17,7 @@ export default function WordWrapButton({
|
||||||
className,
|
className,
|
||||||
onClick,
|
onClick,
|
||||||
isEnabled,
|
isEnabled,
|
||||||
}: Props): JSX.Element | null {
|
}: Props): ReactNode {
|
||||||
const title = translate({
|
const title = translate({
|
||||||
id: 'theme.CodeBlock.wordWrapToggle',
|
id: 'theme.CodeBlock.wordWrapToggle',
|
||||||
message: 'Toggle word wrap',
|
message: 'Toggle word wrap',
|
||||||
|
|
|
@ -28,7 +28,7 @@ function maybeStringifyChildren(children: ReactNode): ReactNode {
|
||||||
export default function CodeBlock({
|
export default function CodeBlock({
|
||||||
children: rawChildren,
|
children: rawChildren,
|
||||||
...props
|
...props
|
||||||
}: Props): JSX.Element {
|
}: Props): ReactNode {
|
||||||
// The Prism theme on SSR is always the default theme but the site theme can
|
// The Prism theme on SSR is always the default theme but the site theme can
|
||||||
// be in a different mode. React hydration doesn't update DOM styles that come
|
// be in a different mode. React hydration doesn't update DOM styles that come
|
||||||
// from SSR. Hence force a re-render after mounting to apply the current
|
// from SSR. Hence force a re-render after mounting to apply the current
|
||||||
|
|
|
@ -5,12 +5,12 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import type {Props} from '@theme/CodeInline';
|
import type {Props} from '@theme/CodeInline';
|
||||||
|
|
||||||
// Simple component used to render inline code blocks
|
// Simple component used to render inline code blocks
|
||||||
// its purpose is to be swizzled and customized
|
// its purpose is to be swizzled and customized
|
||||||
// MDX 1 used to have a inlineCode comp, see https://mdxjs.com/migrating/v2/
|
// MDX 1 used to have a inlineCode comp, see https://mdxjs.com/migrating/v2/
|
||||||
export default function CodeInline(props: Props): JSX.Element {
|
export default function CodeInline(props: Props): ReactNode {
|
||||||
return <code {...props} />;
|
return <code {...props} />;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import useIsBrowser from '@docusaurus/useIsBrowser';
|
import useIsBrowser from '@docusaurus/useIsBrowser';
|
||||||
import {translate} from '@docusaurus/Translate';
|
import {translate} from '@docusaurus/Translate';
|
||||||
|
@ -20,7 +20,7 @@ function ColorModeToggle({
|
||||||
buttonClassName,
|
buttonClassName,
|
||||||
value,
|
value,
|
||||||
onChange,
|
onChange,
|
||||||
}: Props): JSX.Element {
|
}: Props): ReactNode {
|
||||||
const isBrowser = useIsBrowser();
|
const isBrowser = useIsBrowser();
|
||||||
|
|
||||||
const title = translate(
|
const title = translate(
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import {
|
import {
|
||||||
ThemeClassNames,
|
ThemeClassNames,
|
||||||
|
@ -15,7 +15,7 @@ import {
|
||||||
import Admonition from '@theme/Admonition';
|
import Admonition from '@theme/Admonition';
|
||||||
import type {Props} from '@theme/ContentVisibility/Draft';
|
import type {Props} from '@theme/ContentVisibility/Draft';
|
||||||
|
|
||||||
export default function Draft({className}: Props): JSX.Element | null {
|
export default function Draft({className}: Props): ReactNode {
|
||||||
return (
|
return (
|
||||||
<Admonition
|
<Admonition
|
||||||
type="caution"
|
type="caution"
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import {
|
import {
|
||||||
ThemeClassNames,
|
ThemeClassNames,
|
||||||
|
@ -27,7 +27,7 @@ function UnlistedBanner({className}: Props) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function Unlisted(props: Props): JSX.Element | null {
|
export default function Unlisted(props: Props): ReactNode {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/*
|
{/*
|
||||||
|
|
|
@ -5,15 +5,13 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
|
|
||||||
import type {Props} from '@theme/ContentVisibility';
|
import type {Props} from '@theme/ContentVisibility';
|
||||||
import Draft from '@theme/ContentVisibility/Draft';
|
import Draft from '@theme/ContentVisibility/Draft';
|
||||||
import Unlisted from '@theme/ContentVisibility/Unlisted';
|
import Unlisted from '@theme/ContentVisibility/Unlisted';
|
||||||
|
|
||||||
export default function ContentVisibility({
|
export default function ContentVisibility({metadata}: Props): ReactNode {
|
||||||
metadata,
|
|
||||||
}: Props): JSX.Element | null {
|
|
||||||
const {unlisted, frontMatter} = metadata;
|
const {unlisted, frontMatter} = metadata;
|
||||||
// Reading draft/unlisted status from frontMatter is useful to display
|
// Reading draft/unlisted status from frontMatter is useful to display
|
||||||
// the banners in dev mode (in dev, metadata.unlisted is always false)
|
// the banners in dev mode (in dev, metadata.unlisted is always false)
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import {Details as DetailsGeneric} from '@docusaurus/theme-common/Details';
|
import {Details as DetailsGeneric} from '@docusaurus/theme-common/Details';
|
||||||
import type {Props} from '@theme/Details';
|
import type {Props} from '@theme/Details';
|
||||||
|
@ -16,7 +16,7 @@ import styles from './styles.module.css';
|
||||||
// alert classes?
|
// alert classes?
|
||||||
const InfimaClasses = 'alert alert--info';
|
const InfimaClasses = 'alert alert--info';
|
||||||
|
|
||||||
export default function Details({...props}: Props): JSX.Element {
|
export default function Details({...props}: Props): ReactNode {
|
||||||
return (
|
return (
|
||||||
<DetailsGeneric
|
<DetailsGeneric
|
||||||
{...props}
|
{...props}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import Link from '@docusaurus/Link';
|
import Link from '@docusaurus/Link';
|
||||||
import useBaseUrl from '@docusaurus/useBaseUrl';
|
import useBaseUrl from '@docusaurus/useBaseUrl';
|
||||||
import {translate} from '@docusaurus/Translate';
|
import {translate} from '@docusaurus/Translate';
|
||||||
|
@ -13,7 +13,7 @@ import IconHome from '@theme/Icon/Home';
|
||||||
|
|
||||||
import styles from './styles.module.css';
|
import styles from './styles.module.css';
|
||||||
|
|
||||||
export default function HomeBreadcrumbItem(): JSX.Element {
|
export default function HomeBreadcrumbItem(): ReactNode {
|
||||||
const homeHref = useBaseUrl('/');
|
const homeHref = useBaseUrl('/');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -25,7 +25,7 @@ function BreadcrumbsItemLink({
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
href: string | undefined;
|
href: string | undefined;
|
||||||
isLast: boolean;
|
isLast: boolean;
|
||||||
}): JSX.Element {
|
}): ReactNode {
|
||||||
const className = 'breadcrumbs__link';
|
const className = 'breadcrumbs__link';
|
||||||
if (isLast) {
|
if (isLast) {
|
||||||
return (
|
return (
|
||||||
|
@ -59,7 +59,7 @@ function BreadcrumbsItem({
|
||||||
active?: boolean;
|
active?: boolean;
|
||||||
index: number;
|
index: number;
|
||||||
addMicrodata: boolean;
|
addMicrodata: boolean;
|
||||||
}): JSX.Element {
|
}): ReactNode {
|
||||||
return (
|
return (
|
||||||
<li
|
<li
|
||||||
{...(addMicrodata && {
|
{...(addMicrodata && {
|
||||||
|
@ -76,7 +76,7 @@ function BreadcrumbsItem({
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function DocBreadcrumbs(): JSX.Element | null {
|
export default function DocBreadcrumbs(): ReactNode {
|
||||||
const breadcrumbs = useSidebarBreadcrumbs();
|
const breadcrumbs = useSidebarBreadcrumbs();
|
||||||
const homePageRoute = useHomePageRoute();
|
const homePageRoute = useHomePageRoute();
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ function CardContainer({
|
||||||
}: {
|
}: {
|
||||||
href: string;
|
href: string;
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
}): JSX.Element {
|
}): ReactNode {
|
||||||
return (
|
return (
|
||||||
<Link
|
<Link
|
||||||
href={href}
|
href={href}
|
||||||
|
@ -68,7 +68,7 @@ function CardLayout({
|
||||||
icon: ReactNode;
|
icon: ReactNode;
|
||||||
title: string;
|
title: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
}): JSX.Element {
|
}): ReactNode {
|
||||||
return (
|
return (
|
||||||
<CardContainer href={href}>
|
<CardContainer href={href}>
|
||||||
<Heading
|
<Heading
|
||||||
|
@ -88,11 +88,7 @@ function CardLayout({
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function CardCategory({
|
function CardCategory({item}: {item: PropSidebarItemCategory}): ReactNode {
|
||||||
item,
|
|
||||||
}: {
|
|
||||||
item: PropSidebarItemCategory;
|
|
||||||
}): JSX.Element | null {
|
|
||||||
const href = findFirstSidebarItemLink(item);
|
const href = findFirstSidebarItemLink(item);
|
||||||
const categoryItemsPlural = useCategoryItemsPlural();
|
const categoryItemsPlural = useCategoryItemsPlural();
|
||||||
|
|
||||||
|
@ -111,7 +107,7 @@ function CardCategory({
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function CardLink({item}: {item: PropSidebarItemLink}): JSX.Element {
|
function CardLink({item}: {item: PropSidebarItemLink}): ReactNode {
|
||||||
const icon = isInternalUrl(item.href) ? '📄️' : '🔗';
|
const icon = isInternalUrl(item.href) ? '📄️' : '🔗';
|
||||||
const doc = useDocById(item.docId ?? undefined);
|
const doc = useDocById(item.docId ?? undefined);
|
||||||
return (
|
return (
|
||||||
|
@ -124,7 +120,7 @@ function CardLink({item}: {item: PropSidebarItemLink}): JSX.Element {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function DocCard({item}: Props): JSX.Element {
|
export default function DocCard({item}: Props): ReactNode {
|
||||||
switch (item.type) {
|
switch (item.type) {
|
||||||
case 'link':
|
case 'link':
|
||||||
return <CardLink item={item} />;
|
return <CardLink item={item} />;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import {
|
import {
|
||||||
useCurrentSidebarCategory,
|
useCurrentSidebarCategory,
|
||||||
|
@ -19,7 +19,7 @@ function DocCardListForCurrentSidebarCategory({className}: Props) {
|
||||||
return <DocCardList items={category.items} className={className} />;
|
return <DocCardList items={category.items} className={className} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function DocCardList(props: Props): JSX.Element {
|
export default function DocCardList(props: Props): ReactNode {
|
||||||
const {items, className} = props;
|
const {items, className} = props;
|
||||||
if (!items) {
|
if (!items) {
|
||||||
return <DocCardListForCurrentSidebarCategory {...props} />;
|
return <DocCardListForCurrentSidebarCategory {...props} />;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import {PageMetadata} from '@docusaurus/theme-common';
|
import {PageMetadata} from '@docusaurus/theme-common';
|
||||||
import {useCurrentSidebarCategory} from '@docusaurus/plugin-content-docs/client';
|
import {useCurrentSidebarCategory} from '@docusaurus/plugin-content-docs/client';
|
||||||
import useBaseUrl from '@docusaurus/useBaseUrl';
|
import useBaseUrl from '@docusaurus/useBaseUrl';
|
||||||
|
@ -21,7 +21,7 @@ import styles from './styles.module.css';
|
||||||
|
|
||||||
function DocCategoryGeneratedIndexPageMetadata({
|
function DocCategoryGeneratedIndexPageMetadata({
|
||||||
categoryGeneratedIndex,
|
categoryGeneratedIndex,
|
||||||
}: Props): JSX.Element {
|
}: Props): ReactNode {
|
||||||
return (
|
return (
|
||||||
<PageMetadata
|
<PageMetadata
|
||||||
title={categoryGeneratedIndex.title}
|
title={categoryGeneratedIndex.title}
|
||||||
|
@ -35,7 +35,7 @@ function DocCategoryGeneratedIndexPageMetadata({
|
||||||
|
|
||||||
function DocCategoryGeneratedIndexPageContent({
|
function DocCategoryGeneratedIndexPageContent({
|
||||||
categoryGeneratedIndex,
|
categoryGeneratedIndex,
|
||||||
}: Props): JSX.Element {
|
}: Props): ReactNode {
|
||||||
const category = useCurrentSidebarCategory();
|
const category = useCurrentSidebarCategory();
|
||||||
return (
|
return (
|
||||||
<div className={styles.generatedIndexPage}>
|
<div className={styles.generatedIndexPage}>
|
||||||
|
@ -63,9 +63,7 @@ function DocCategoryGeneratedIndexPageContent({
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function DocCategoryGeneratedIndexPage(
|
export default function DocCategoryGeneratedIndexPage(props: Props): ReactNode {
|
||||||
props: Props,
|
|
||||||
): JSX.Element {
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<DocCategoryGeneratedIndexPageMetadata {...props} />
|
<DocCategoryGeneratedIndexPageMetadata {...props} />
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import {ThemeClassNames} from '@docusaurus/theme-common';
|
import {ThemeClassNames} from '@docusaurus/theme-common';
|
||||||
import {useDoc} from '@docusaurus/plugin-content-docs/client';
|
import {useDoc} from '@docusaurus/plugin-content-docs/client';
|
||||||
|
@ -33,7 +33,7 @@ function useSyntheticTitle(): string | null {
|
||||||
return metadata.title;
|
return metadata.title;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function DocItemContent({children}: Props): JSX.Element {
|
export default function DocItemContent({children}: Props): ReactNode {
|
||||||
const syntheticTitle = useSyntheticTitle();
|
const syntheticTitle = useSyntheticTitle();
|
||||||
return (
|
return (
|
||||||
<div className={clsx(ThemeClassNames.docs.docMarkdown, 'markdown')}>
|
<div className={clsx(ThemeClassNames.docs.docMarkdown, 'markdown')}>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import {ThemeClassNames} from '@docusaurus/theme-common';
|
import {ThemeClassNames} from '@docusaurus/theme-common';
|
||||||
import {useDoc} from '@docusaurus/plugin-content-docs/client';
|
import {useDoc} from '@docusaurus/plugin-content-docs/client';
|
||||||
|
@ -13,7 +13,7 @@ import TagsListInline from '@theme/TagsListInline';
|
||||||
|
|
||||||
import EditMetaRow from '@theme/EditMetaRow';
|
import EditMetaRow from '@theme/EditMetaRow';
|
||||||
|
|
||||||
export default function DocItemFooter(): JSX.Element | null {
|
export default function DocItemFooter(): ReactNode {
|
||||||
const {metadata} = useDoc();
|
const {metadata} = useDoc();
|
||||||
const {editUrl, lastUpdatedAt, lastUpdatedBy, tags} = metadata;
|
const {editUrl, lastUpdatedAt, lastUpdatedBy, tags} = metadata;
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import {useWindowSize} from '@docusaurus/theme-common';
|
import {useWindowSize} from '@docusaurus/theme-common';
|
||||||
import {useDoc} from '@docusaurus/plugin-content-docs/client';
|
import {useDoc} from '@docusaurus/plugin-content-docs/client';
|
||||||
|
@ -46,7 +46,7 @@ function useDocTOC() {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function DocItemLayout({children}: Props): JSX.Element {
|
export default function DocItemLayout({children}: Props): ReactNode {
|
||||||
const docTOC = useDocTOC();
|
const docTOC = useDocTOC();
|
||||||
const {metadata} = useDoc();
|
const {metadata} = useDoc();
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -5,11 +5,11 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import {PageMetadata} from '@docusaurus/theme-common';
|
import {PageMetadata} from '@docusaurus/theme-common';
|
||||||
import {useDoc} from '@docusaurus/plugin-content-docs/client';
|
import {useDoc} from '@docusaurus/plugin-content-docs/client';
|
||||||
|
|
||||||
export default function DocItemMetadata(): JSX.Element {
|
export default function DocItemMetadata(): ReactNode {
|
||||||
const {metadata, frontMatter, assets} = useDoc();
|
const {metadata, frontMatter, assets} = useDoc();
|
||||||
return (
|
return (
|
||||||
<PageMetadata
|
<PageMetadata
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import {useDoc} from '@docusaurus/plugin-content-docs/client';
|
import {useDoc} from '@docusaurus/plugin-content-docs/client';
|
||||||
import DocPaginator from '@theme/DocPaginator';
|
import DocPaginator from '@theme/DocPaginator';
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ import DocPaginator from '@theme/DocPaginator';
|
||||||
* This extra component is needed, because <DocPaginator> should remain generic.
|
* This extra component is needed, because <DocPaginator> should remain generic.
|
||||||
* DocPaginator is used in non-docs contexts too: generated-index pages...
|
* DocPaginator is used in non-docs contexts too: generated-index pages...
|
||||||
*/
|
*/
|
||||||
export default function DocItemPaginator(): JSX.Element {
|
export default function DocItemPaginator(): ReactNode {
|
||||||
const {metadata} = useDoc();
|
const {metadata} = useDoc();
|
||||||
return <DocPaginator previous={metadata.previous} next={metadata.next} />;
|
return <DocPaginator previous={metadata.previous} next={metadata.next} />;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,13 +5,13 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import {ThemeClassNames} from '@docusaurus/theme-common';
|
import {ThemeClassNames} from '@docusaurus/theme-common';
|
||||||
import {useDoc} from '@docusaurus/plugin-content-docs/client';
|
import {useDoc} from '@docusaurus/plugin-content-docs/client';
|
||||||
|
|
||||||
import TOC from '@theme/TOC';
|
import TOC from '@theme/TOC';
|
||||||
|
|
||||||
export default function DocItemTOCDesktop(): JSX.Element {
|
export default function DocItemTOCDesktop(): ReactNode {
|
||||||
const {toc, frontMatter} = useDoc();
|
const {toc, frontMatter} = useDoc();
|
||||||
return (
|
return (
|
||||||
<TOC
|
<TOC
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import {ThemeClassNames} from '@docusaurus/theme-common';
|
import {ThemeClassNames} from '@docusaurus/theme-common';
|
||||||
import {useDoc} from '@docusaurus/plugin-content-docs/client';
|
import {useDoc} from '@docusaurus/plugin-content-docs/client';
|
||||||
|
@ -14,7 +14,7 @@ import TOCCollapsible from '@theme/TOCCollapsible';
|
||||||
|
|
||||||
import styles from './styles.module.css';
|
import styles from './styles.module.css';
|
||||||
|
|
||||||
export default function DocItemTOCMobile(): JSX.Element {
|
export default function DocItemTOCMobile(): ReactNode {
|
||||||
const {toc, frontMatter} = useDoc();
|
const {toc, frontMatter} = useDoc();
|
||||||
return (
|
return (
|
||||||
<TOCCollapsible
|
<TOCCollapsible
|
||||||
|
|
|
@ -5,14 +5,14 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import {HtmlClassNameProvider} from '@docusaurus/theme-common';
|
import {HtmlClassNameProvider} from '@docusaurus/theme-common';
|
||||||
import {DocProvider} from '@docusaurus/plugin-content-docs/client';
|
import {DocProvider} from '@docusaurus/plugin-content-docs/client';
|
||||||
import DocItemMetadata from '@theme/DocItem/Metadata';
|
import DocItemMetadata from '@theme/DocItem/Metadata';
|
||||||
import DocItemLayout from '@theme/DocItem/Layout';
|
import DocItemLayout from '@theme/DocItem/Layout';
|
||||||
import type {Props} from '@theme/DocItem';
|
import type {Props} from '@theme/DocItem';
|
||||||
|
|
||||||
export default function DocItem(props: Props): JSX.Element {
|
export default function DocItem(props: Props): ReactNode {
|
||||||
const docHtmlClassName = `docs-doc-id-${props.content.metadata.id}`;
|
const docHtmlClassName = `docs-doc-id-${props.content.metadata.id}`;
|
||||||
const MDXComponent = props.content;
|
const MDXComponent = props.content;
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -5,12 +5,12 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import Translate, {translate} from '@docusaurus/Translate';
|
import Translate, {translate} from '@docusaurus/Translate';
|
||||||
import PaginatorNavLink from '@theme/PaginatorNavLink';
|
import PaginatorNavLink from '@theme/PaginatorNavLink';
|
||||||
import type {Props} from '@theme/DocPaginator';
|
import type {Props} from '@theme/DocPaginator';
|
||||||
|
|
||||||
export default function DocPaginator(props: Props): JSX.Element {
|
export default function DocPaginator(props: Props): ReactNode {
|
||||||
const {previous, next} = props;
|
const {previous, next} = props;
|
||||||
return (
|
return (
|
||||||
<nav
|
<nav
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React, {type ReactNode} from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import {useDocsSidebar} from '@docusaurus/plugin-content-docs/client';
|
import {useDocsSidebar} from '@docusaurus/plugin-content-docs/client';
|
||||||
import type {Props} from '@theme/DocRoot/Layout/Main';
|
import type {Props} from '@theme/DocRoot/Layout/Main';
|
||||||
|
@ -15,7 +15,7 @@ import styles from './styles.module.css';
|
||||||
export default function DocRootLayoutMain({
|
export default function DocRootLayoutMain({
|
||||||
hiddenSidebarContainer,
|
hiddenSidebarContainer,
|
||||||
children,
|
children,
|
||||||
}: Props): JSX.Element {
|
}: Props): ReactNode {
|
||||||
const sidebar = useDocsSidebar();
|
const sidebar = useDocsSidebar();
|
||||||
return (
|
return (
|
||||||
<main
|
<main
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue