@docusaurus/theme-classic 0.0.0-4735 → 0.0.0-4738
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/theme-classic.d.ts +63 -33
- package/lib-next/theme/BlogArchivePage/index.js +13 -9
- package/lib-next/theme/BlogListPage/index.js +34 -13
- package/lib-next/theme/BlogPostPage/index.js +56 -45
- package/lib-next/theme/BlogTagsListPage/index.js +16 -12
- package/lib-next/theme/BlogTagsPostsPage/index.js +40 -33
- package/lib-next/theme/DocCategoryGeneratedIndexPage/index.js +27 -6
- package/lib-next/theme/DocItem/index.js +78 -63
- package/lib-next/theme/DocPage/index.js +85 -77
- package/lib-next/theme/DocPage/styles.module.css +0 -4
- package/lib-next/theme/DocSidebar/Mobile/index.js +24 -20
- package/lib-next/theme/DocTagDocListPage/index.js +38 -31
- package/lib-next/theme/DocTagsListPage/index.js +21 -16
- package/lib-next/theme/Layout/index.js +15 -10
- package/lib-next/theme/LayoutProviders/index.js +4 -6
- package/lib-next/theme/MDXPage/index.js +32 -26
- package/lib-next/theme/Navbar/ColorModeToggle/index.js +25 -0
- package/lib-next/theme/Navbar/Content/index.js +70 -0
- package/lib-next/theme/Navbar/Content/styles.module.css +15 -0
- package/lib-next/theme/Navbar/Layout/index.js +54 -0
- package/{src/theme/Navbar → lib-next/theme/Navbar/Layout}/styles.module.css +0 -13
- package/lib-next/theme/Navbar/Logo/index.js +17 -0
- package/lib-next/theme/Navbar/MobileSidebar/Header/index.js +33 -0
- package/lib-next/theme/Navbar/MobileSidebar/Layout/index.js +28 -0
- package/lib-next/theme/Navbar/MobileSidebar/PrimaryMenu/index.js +33 -0
- package/lib-next/theme/Navbar/MobileSidebar/SecondaryMenu/index.js +36 -0
- package/lib-next/theme/Navbar/MobileSidebar/Toggle/index.js +23 -0
- package/lib-next/theme/Navbar/MobileSidebar/index.js +31 -0
- package/lib-next/theme/Navbar/index.js +6 -273
- package/lib-next/theme/NotFound.js +38 -33
- package/lib-next/theme/{LayoutHead → SiteMetadata}/index.js +11 -26
- package/package.json +13 -13
- package/src/theme/BlogArchivePage/index.tsx +13 -9
- package/src/theme/BlogListPage/index.tsx +32 -13
- package/src/theme/BlogPostPage/index.tsx +55 -48
- package/src/theme/BlogTagsListPage/index.tsx +16 -12
- package/src/theme/BlogTagsPostsPage/index.tsx +39 -32
- package/src/theme/DocCategoryGeneratedIndexPage/index.tsx +31 -4
- package/src/theme/DocItem/index.tsx +65 -52
- package/src/theme/DocPage/index.tsx +85 -77
- package/src/theme/DocPage/styles.module.css +0 -4
- package/src/theme/DocSidebar/Mobile/index.tsx +26 -23
- package/src/theme/DocTagDocListPage/index.tsx +38 -30
- package/src/theme/DocTagsListPage/index.tsx +21 -16
- package/src/theme/Layout/index.tsx +15 -10
- package/src/theme/LayoutProviders/index.tsx +4 -6
- package/src/theme/MDXPage/index.tsx +32 -26
- package/src/theme/Navbar/ColorModeToggle/index.tsx +30 -0
- package/src/theme/Navbar/Content/index.tsx +81 -0
- package/src/theme/Navbar/Content/styles.module.css +15 -0
- package/src/theme/Navbar/Layout/index.tsx +57 -0
- package/{lib-next/theme/Navbar → src/theme/Navbar/Layout}/styles.module.css +0 -13
- package/src/theme/Navbar/Logo/index.tsx +19 -0
- package/src/theme/Navbar/MobileSidebar/Header/index.tsx +34 -0
- package/src/theme/Navbar/MobileSidebar/Layout/index.tsx +31 -0
- package/src/theme/Navbar/MobileSidebar/PrimaryMenu/index.tsx +38 -0
- package/src/theme/Navbar/MobileSidebar/SecondaryMenu/index.tsx +38 -0
- package/src/theme/Navbar/MobileSidebar/Toggle/index.tsx +25 -0
- package/src/theme/Navbar/MobileSidebar/index.tsx +33 -0
- package/src/theme/Navbar/index.tsx +6 -292
- package/src/theme/NotFound.tsx +38 -33
- package/src/theme/{LayoutHead → SiteMetadata}/index.tsx +11 -25
- package/src/theme-classic.d.ts +63 -33
- package/lib-next/theme/Seo/index.js +0 -40
- package/src/theme/Seo/index.tsx +0 -49
package/src/theme-classic.d.ts
CHANGED
|
@@ -364,31 +364,17 @@ declare module '@theme/Layout' {
|
|
|
364
364
|
|
|
365
365
|
export interface Props {
|
|
366
366
|
readonly children?: ReactNode;
|
|
367
|
-
readonly title?: string;
|
|
368
367
|
readonly noFooter?: boolean;
|
|
369
|
-
readonly description?: string;
|
|
370
|
-
readonly image?: string;
|
|
371
|
-
readonly keywords?: string | string[];
|
|
372
|
-
readonly permalink?: string;
|
|
373
368
|
readonly wrapperClassName?: string;
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
};
|
|
369
|
+
|
|
370
|
+
// Not really layout-related, but kept for convenience/retro-compatibility
|
|
371
|
+
readonly title?: string;
|
|
372
|
+
readonly description?: string;
|
|
379
373
|
}
|
|
380
374
|
|
|
381
375
|
export default function Layout(props: Props): JSX.Element;
|
|
382
376
|
}
|
|
383
377
|
|
|
384
|
-
declare module '@theme/LayoutHead' {
|
|
385
|
-
import type {Props as LayoutProps} from '@theme/Layout';
|
|
386
|
-
|
|
387
|
-
export interface Props extends Omit<LayoutProps, 'children'> {}
|
|
388
|
-
|
|
389
|
-
export default function LayoutHead(props: Props): JSX.Element;
|
|
390
|
-
}
|
|
391
|
-
|
|
392
378
|
declare module '@theme/LayoutProviders' {
|
|
393
379
|
import type {ReactNode} from 'react';
|
|
394
380
|
|
|
@@ -460,6 +446,64 @@ declare module '@theme/Navbar' {
|
|
|
460
446
|
export default function Navbar(): JSX.Element;
|
|
461
447
|
}
|
|
462
448
|
|
|
449
|
+
declare module '@theme/Navbar/ColorModeToggle' {
|
|
450
|
+
export interface Props {
|
|
451
|
+
readonly className?: string;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
export default function NavbarColorModeToggle(
|
|
455
|
+
props: Props,
|
|
456
|
+
): JSX.Element | null;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
declare module '@theme/Navbar/Logo' {
|
|
460
|
+
export default function NavbarLogo(): JSX.Element;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
declare module '@theme/Navbar/Content' {
|
|
464
|
+
export default function NavbarContent(): JSX.Element;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
declare module '@theme/Navbar/Layout' {
|
|
468
|
+
export interface Props {
|
|
469
|
+
readonly children: React.ReactNode;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
export default function NavbarLayout(props: Props): JSX.Element;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
declare module '@theme/Navbar/MobileSidebar' {
|
|
476
|
+
export default function NavbarMobileSidebar(): JSX.Element;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
declare module '@theme/Navbar/MobileSidebar/Layout' {
|
|
480
|
+
import type {ReactNode} from 'react';
|
|
481
|
+
|
|
482
|
+
interface Props {
|
|
483
|
+
header: ReactNode;
|
|
484
|
+
primaryMenu: ReactNode;
|
|
485
|
+
secondaryMenu: ReactNode;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
export default function NavbarMobileSidebarLayout(props: Props): JSX.Element;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
declare module '@theme/Navbar/MobileSidebar/Toggle' {
|
|
492
|
+
export default function NavbarMobileSidebarToggle(): JSX.Element;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
declare module '@theme/Navbar/MobileSidebar/PrimaryMenu' {
|
|
496
|
+
export default function NavbarMobileSidebarPrimaryMenu(): JSX.Element;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
declare module '@theme/Navbar/MobileSidebar/SecondaryMenu' {
|
|
500
|
+
export default function NavbarMobileSidebarSecondaryMenu(): JSX.Element;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
declare module '@theme/Navbar/MobileSidebar/Header' {
|
|
504
|
+
export default function NavbarMobileSidebarHeader(): JSX.Element;
|
|
505
|
+
}
|
|
506
|
+
|
|
463
507
|
declare module '@theme/NavbarItem/DefaultNavbarItem' {
|
|
464
508
|
import type {Props as NavbarNavLinkProps} from '@theme/NavbarItem/NavbarNavLink';
|
|
465
509
|
|
|
@@ -758,7 +802,7 @@ declare module '@theme/ColorModeToggle' {
|
|
|
758
802
|
readonly onChange: (colorMode: ColorMode) => void;
|
|
759
803
|
}
|
|
760
804
|
|
|
761
|
-
export default function
|
|
805
|
+
export default function ColorModeToggle(props: Props): JSX.Element;
|
|
762
806
|
}
|
|
763
807
|
|
|
764
808
|
declare module '@theme/Logo' {
|
|
@@ -869,17 +913,3 @@ declare module '@theme/prism-include-languages' {
|
|
|
869
913
|
PrismObject: typeof PrismNamespace,
|
|
870
914
|
): void;
|
|
871
915
|
}
|
|
872
|
-
|
|
873
|
-
declare module '@theme/Seo' {
|
|
874
|
-
import type {ReactNode} from 'react';
|
|
875
|
-
|
|
876
|
-
export interface Props {
|
|
877
|
-
readonly title?: string;
|
|
878
|
-
readonly description?: string;
|
|
879
|
-
readonly keywords?: readonly string[] | string;
|
|
880
|
-
readonly image?: string;
|
|
881
|
-
readonly children?: ReactNode;
|
|
882
|
-
}
|
|
883
|
-
|
|
884
|
-
export default function Seo(props: Props): JSX.Element;
|
|
885
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import Head from '@docusaurus/Head';
|
|
9
|
-
import {useTitleFormatter} from '@docusaurus/theme-common';
|
|
10
|
-
import {useBaseUrlUtils} from '@docusaurus/useBaseUrl';
|
|
11
|
-
export default function Seo({title, description, keywords, image, children}) {
|
|
12
|
-
const pageTitle = useTitleFormatter(title);
|
|
13
|
-
const {withBaseUrl} = useBaseUrlUtils();
|
|
14
|
-
const pageImage = image
|
|
15
|
-
? withBaseUrl(image, {
|
|
16
|
-
absolute: true,
|
|
17
|
-
})
|
|
18
|
-
: undefined;
|
|
19
|
-
return (
|
|
20
|
-
<Head>
|
|
21
|
-
{title && <title>{pageTitle}</title>}
|
|
22
|
-
{title && <meta property="og:title" content={pageTitle} />}
|
|
23
|
-
|
|
24
|
-
{description && <meta name="description" content={description} />}
|
|
25
|
-
{description && <meta property="og:description" content={description} />}
|
|
26
|
-
|
|
27
|
-
{keywords && (
|
|
28
|
-
<meta
|
|
29
|
-
name="keywords"
|
|
30
|
-
content={Array.isArray(keywords) ? keywords.join(',') : keywords}
|
|
31
|
-
/>
|
|
32
|
-
)}
|
|
33
|
-
|
|
34
|
-
{pageImage && <meta property="og:image" content={pageImage} />}
|
|
35
|
-
{pageImage && <meta name="twitter:image" content={pageImage} />}
|
|
36
|
-
|
|
37
|
-
{children}
|
|
38
|
-
</Head>
|
|
39
|
-
);
|
|
40
|
-
}
|
package/src/theme/Seo/index.tsx
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import React from 'react';
|
|
9
|
-
import Head from '@docusaurus/Head';
|
|
10
|
-
import {useTitleFormatter} from '@docusaurus/theme-common';
|
|
11
|
-
import {useBaseUrlUtils} from '@docusaurus/useBaseUrl';
|
|
12
|
-
|
|
13
|
-
import type {Props} from '@theme/Seo';
|
|
14
|
-
|
|
15
|
-
export default function Seo({
|
|
16
|
-
title,
|
|
17
|
-
description,
|
|
18
|
-
keywords,
|
|
19
|
-
image,
|
|
20
|
-
children,
|
|
21
|
-
}: Props): JSX.Element {
|
|
22
|
-
const pageTitle = useTitleFormatter(title);
|
|
23
|
-
const {withBaseUrl} = useBaseUrlUtils();
|
|
24
|
-
const pageImage = image ? withBaseUrl(image, {absolute: true}) : undefined;
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<Head>
|
|
28
|
-
{title && <title>{pageTitle}</title>}
|
|
29
|
-
{title && <meta property="og:title" content={pageTitle} />}
|
|
30
|
-
|
|
31
|
-
{description && <meta name="description" content={description} />}
|
|
32
|
-
{description && <meta property="og:description" content={description} />}
|
|
33
|
-
|
|
34
|
-
{keywords && (
|
|
35
|
-
<meta
|
|
36
|
-
name="keywords"
|
|
37
|
-
content={
|
|
38
|
-
(Array.isArray(keywords) ? keywords.join(',') : keywords) as string
|
|
39
|
-
}
|
|
40
|
-
/>
|
|
41
|
-
)}
|
|
42
|
-
|
|
43
|
-
{pageImage && <meta property="og:image" content={pageImage} />}
|
|
44
|
-
{pageImage && <meta name="twitter:image" content={pageImage} />}
|
|
45
|
-
|
|
46
|
-
{children}
|
|
47
|
-
</Head>
|
|
48
|
-
);
|
|
49
|
-
}
|