Skip to content

Commit 0d7d7e8

Browse files
committed
Rename Drafted to Draft and move under theme/ContentVisibility
1 parent a852c69 commit 0d7d7e8

File tree

12 files changed

+30
-30
lines changed

12 files changed

+30
-30
lines changed

packages/docusaurus-theme-classic/src/theme-classic.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1602,20 +1602,20 @@ declare module '@theme/Tag' {
16021602
export default function Tag(props: Props): JSX.Element;
16031603
}
16041604

1605-
declare module '@theme/Unlisted' {
1605+
declare module '@theme/ContentVisibility/Unlisted' {
16061606
export interface Props {
16071607
className?: string;
16081608
}
16091609

16101610
export default function Unlisted(props: Props): JSX.Element;
16111611
}
16121612

1613-
declare module '@theme/Drafted' {
1613+
declare module '@theme/ContentVisibility/Draft' {
16141614
export interface Props {
16151615
className?: string;
16161616
}
16171617

1618-
export default function Unlisted(props: Props): JSX.Element;
1618+
export default function Draft(props: Props): JSX.Element;
16191619
}
16201620

16211621
declare module '@theme/prism-include-languages' {

packages/docusaurus-theme-classic/src/theme/BlogPostPage/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import BlogPostPageMetadata from '@theme/BlogPostPage/Metadata';
1919
import BlogPostPageStructuredData from '@theme/BlogPostPage/StructuredData';
2020
import TOC from '@theme/TOC';
2121
import type {Props} from '@theme/BlogPostPage';
22-
import Unlisted from '@theme/Unlisted';
23-
import Drafted from '@theme/Drafted';
22+
import Unlisted from '@theme/ContentVisibility/Unlisted';
23+
import Draft from '@theme/ContentVisibility/Draft';
2424
import type {BlogSidebar} from '@docusaurus/plugin-content-blog';
2525

2626
function BlogPostPageContent({
@@ -50,7 +50,7 @@ function BlogPostPageContent({
5050
) : undefined
5151
}>
5252
{(unlisted || frontMatter.unlisted) && <Unlisted />}
53-
{frontMatter.draft && <Drafted />}
53+
{frontMatter.draft && <Draft />}
5454

5555
<BlogPostItem>{children}</BlogPostItem>
5656

packages/docusaurus-theme-classic/src/theme/BlogTagsPostsPage/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import BlogListPaginator from '@theme/BlogListPaginator';
2020
import SearchMetadata from '@theme/SearchMetadata';
2121
import type {Props} from '@theme/BlogTagsPostsPage';
2222
import BlogPostItems from '@theme/BlogPostItems';
23-
import Unlisted from '@theme/Unlisted';
23+
import Unlisted from '@theme/ContentVisibility/Unlisted';
2424
import Heading from '@theme/Heading';
2525

2626
function BlogTagsPostsPageMetadata({tag}: Props): JSX.Element {

packages/docusaurus-theme-classic/src/theme/Drafted/index.tsx renamed to packages/docusaurus-theme-classic/src/theme/ContentVisibility/Draft/index.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ import React from 'react';
99
import clsx from 'clsx';
1010
import {
1111
ThemeClassNames,
12-
DraftedBannerTitle,
13-
DraftedBannerMessage,
12+
DraftBannerTitle,
13+
DraftBannerMessage,
1414
} from '@docusaurus/theme-common';
1515
import Admonition from '@theme/Admonition';
16-
import type {Props} from '@theme/Drafted';
16+
import type {Props} from '@theme/ContentVisibility/Draft';
1717

18-
export default function Drafted({className}: Props): JSX.Element | null {
18+
export default function Draft({className}: Props): JSX.Element | null {
1919
return (
2020
<Admonition
2121
type="caution"
22-
title={<DraftedBannerTitle />}
23-
className={clsx(className, ThemeClassNames.common.draftedBanner)}>
24-
<DraftedBannerMessage />
22+
title={<DraftBannerTitle />}
23+
className={clsx(className, ThemeClassNames.common.draftBanner)}>
24+
<DraftBannerMessage />
2525
</Admonition>
2626
);
2727
}

packages/docusaurus-theme-classic/src/theme/Unlisted/index.tsx renamed to packages/docusaurus-theme-classic/src/theme/ContentVisibility/Unlisted/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
UnlistedMetadata,
1515
} from '@docusaurus/theme-common';
1616
import Admonition from '@theme/Admonition';
17-
import type {Props} from '@theme/Unlisted';
17+
import type {Props} from '@theme/ContentVisibility/Unlisted';
1818

1919
function UnlistedBanner({className}: Props) {
2020
return (

packages/docusaurus-theme-classic/src/theme/DocItem/Layout/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ import DocItemTOCMobile from '@theme/DocItem/TOC/Mobile';
1717
import DocItemTOCDesktop from '@theme/DocItem/TOC/Desktop';
1818
import DocItemContent from '@theme/DocItem/Content';
1919
import DocBreadcrumbs from '@theme/DocBreadcrumbs';
20-
import Unlisted from '@theme/Unlisted';
20+
import Unlisted from '@theme/ContentVisibility/Unlisted';
21+
import Draft from '@theme/ContentVisibility/Draft';
2122
import type {Props} from '@theme/DocItem/Layout';
2223

23-
import Drafted from '@theme/Drafted';
2424
import styles from './styles.module.css';
2525

2626
/**
@@ -56,7 +56,7 @@ export default function DocItemLayout({children}: Props): JSX.Element {
5656
<div className="row">
5757
<div className={clsx('col', !docTOC.hidden && styles.docItemCol)}>
5858
{(unlisted || frontMatter.unlisted) && <Unlisted />}
59-
{frontMatter.draft && <Drafted />}
59+
{frontMatter.draft && <Draft />}
6060
<DocVersionBanner />
6161
<div className={styles.docItemContainer}>
6262
<article>

packages/docusaurus-theme-classic/src/theme/DocTagDocListPage/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
import Translate, {translate} from '@docusaurus/Translate';
1818
import SearchMetadata from '@theme/SearchMetadata';
1919
import type {Props} from '@theme/DocTagDocListPage';
20-
import Unlisted from '@theme/Unlisted';
20+
import Unlisted from '@theme/ContentVisibility/Unlisted';
2121
import Heading from '@theme/Heading';
2222

2323
// Very simple pluralization: probably good enough for now

packages/docusaurus-theme-classic/src/theme/MDXPage/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ import {
1515
import Layout from '@theme/Layout';
1616
import MDXContent from '@theme/MDXContent';
1717
import TOC from '@theme/TOC';
18-
import Unlisted from '@theme/Unlisted';
18+
import Unlisted from '@theme/ContentVisibility/Unlisted';
19+
import Draft from '@theme/ContentVisibility/Draft';
1920
import type {Props} from '@theme/MDXPage';
2021

2122
import EditMetaRow from '@theme/EditMetaRow';
22-
import Drafted from '@theme/Drafted';
2323
import styles from './styles.module.css';
2424

2525
export default function MDXPage(props: Props): JSX.Element {
@@ -62,7 +62,7 @@ export default function MDXPage(props: Props): JSX.Element {
6262
<div className={clsx('row', styles.mdxPageWrapper)}>
6363
<div className={clsx('col', !hideTableOfContents && 'col--8')}>
6464
{(unlisted || frontMatter.unlisted) && <Unlisted />}
65-
{frontMatter.draft && <Drafted />}
65+
{frontMatter.draft && <Draft />}
6666
<article>
6767
<MDXContent>
6868
<MDXPageContent />

packages/docusaurus-theme-common/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export {
125125
UnlistedMetadata,
126126
} from './utils/unlistedUtils';
127127

128-
export {DraftedBannerTitle, DraftedBannerMessage} from './utils/draftedUtils';
128+
export {DraftBannerTitle, DraftBannerMessage} from './utils/draftUtils';
129129

130130
export {
131131
ErrorBoundaryTryAgainButton,

packages/docusaurus-theme-common/src/utils/ThemeClassNames.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const ThemeClassNames = {
4343
codeBlock: 'theme-code-block',
4444
admonition: 'theme-admonition',
4545
unlistedBanner: 'theme-unlisted-banner',
46-
draftedBanner: 'theme-drafted-banner',
46+
draftBanner: 'theme-drafted-banner',
4747

4848
admonitionType: (type: string) => `theme-admonition-${type}`,
4949
},

0 commit comments

Comments
 (0)