@docusaurus/theme-classic 3.7.0-canary-6287 → 3.7.0-canary-6292
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/Tag/index.js +1 -0
- package/lib/theme/ThemeProvider/TitleFormatter/index.d.ts +9 -0
- package/lib/theme/ThemeProvider/TitleFormatter/index.js +19 -0
- package/lib/theme/ThemeProvider/index.d.ts +9 -0
- package/lib/theme/ThemeProvider/index.js +11 -0
- package/package.json +15 -15
- package/src/theme/Tag/index.tsx +1 -0
- package/src/theme/ThemeProvider/TitleFormatter/index.tsx +27 -0
- package/src/theme/ThemeProvider/index.tsx +14 -0
- package/src/theme-classic.d.ts +11 -0
package/lib/theme/Tag/index.js
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
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 { type ReactNode } from 'react';
|
|
8
|
+
import type { Props } from '@theme/ThemeProvider/TitleFormatter';
|
|
9
|
+
export default function ThemeProviderTitleFormatter({ children, }: Props): ReactNode;
|
|
@@ -0,0 +1,19 @@
|
|
|
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 {TitleFormatterProvider} from '@docusaurus/theme-common/internal';
|
|
9
|
+
const formatter = (params) => {
|
|
10
|
+
// Add your own title formatting logic here!
|
|
11
|
+
return params.defaultFormatter(params);
|
|
12
|
+
};
|
|
13
|
+
export default function ThemeProviderTitleFormatter({children}) {
|
|
14
|
+
return (
|
|
15
|
+
<TitleFormatterProvider formatter={formatter}>
|
|
16
|
+
{children}
|
|
17
|
+
</TitleFormatterProvider>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
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 { type ReactNode } from 'react';
|
|
8
|
+
import type { Props } from '@theme/ThemeProvider';
|
|
9
|
+
export default function ThemeProvider({ children }: Props): ReactNode;
|
|
@@ -0,0 +1,11 @@
|
|
|
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 TitleFormatterProvider from '@theme/ThemeProvider/TitleFormatter';
|
|
9
|
+
export default function ThemeProvider({children}) {
|
|
10
|
+
return <TitleFormatterProvider>{children}</TitleFormatterProvider>;
|
|
11
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/theme-classic",
|
|
3
|
-
"version": "3.7.0-canary-
|
|
3
|
+
"version": "3.7.0-canary-6292",
|
|
4
4
|
"description": "Classic theme for Docusaurus",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/theme-classic.d.ts",
|
|
@@ -20,19 +20,19 @@
|
|
|
20
20
|
"copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@docusaurus/core": "3.7.0-canary-
|
|
24
|
-
"@docusaurus/logger": "3.7.0-canary-
|
|
25
|
-
"@docusaurus/mdx-loader": "3.7.0-canary-
|
|
26
|
-
"@docusaurus/module-type-aliases": "3.7.0-canary-
|
|
27
|
-
"@docusaurus/plugin-content-blog": "3.7.0-canary-
|
|
28
|
-
"@docusaurus/plugin-content-docs": "3.7.0-canary-
|
|
29
|
-
"@docusaurus/plugin-content-pages": "3.7.0-canary-
|
|
30
|
-
"@docusaurus/theme-common": "3.7.0-canary-
|
|
31
|
-
"@docusaurus/theme-translations": "3.7.0-canary-
|
|
32
|
-
"@docusaurus/types": "3.7.0-canary-
|
|
33
|
-
"@docusaurus/utils": "3.7.0-canary-
|
|
34
|
-
"@docusaurus/utils-common": "3.7.0-canary-
|
|
35
|
-
"@docusaurus/utils-validation": "3.7.0-canary-
|
|
23
|
+
"@docusaurus/core": "3.7.0-canary-6292",
|
|
24
|
+
"@docusaurus/logger": "3.7.0-canary-6292",
|
|
25
|
+
"@docusaurus/mdx-loader": "3.7.0-canary-6292",
|
|
26
|
+
"@docusaurus/module-type-aliases": "3.7.0-canary-6292",
|
|
27
|
+
"@docusaurus/plugin-content-blog": "3.7.0-canary-6292",
|
|
28
|
+
"@docusaurus/plugin-content-docs": "3.7.0-canary-6292",
|
|
29
|
+
"@docusaurus/plugin-content-pages": "3.7.0-canary-6292",
|
|
30
|
+
"@docusaurus/theme-common": "3.7.0-canary-6292",
|
|
31
|
+
"@docusaurus/theme-translations": "3.7.0-canary-6292",
|
|
32
|
+
"@docusaurus/types": "3.7.0-canary-6292",
|
|
33
|
+
"@docusaurus/utils": "3.7.0-canary-6292",
|
|
34
|
+
"@docusaurus/utils-common": "3.7.0-canary-6292",
|
|
35
|
+
"@docusaurus/utils-validation": "3.7.0-canary-6292",
|
|
36
36
|
"@mdx-js/react": "^3.0.0",
|
|
37
37
|
"clsx": "^2.0.0",
|
|
38
38
|
"copy-text-to-clipboard": "^3.2.0",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"engines": {
|
|
63
63
|
"node": ">=18.0"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "202a6243823c4fdc0ae16d50fb72193fc1fd7d6a"
|
|
66
66
|
}
|
package/src/theme/Tag/index.tsx
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import React, {type ComponentProps, type ReactNode} from 'react';
|
|
9
|
+
import {TitleFormatterProvider} from '@docusaurus/theme-common/internal';
|
|
10
|
+
import type {Props} from '@theme/ThemeProvider/TitleFormatter';
|
|
11
|
+
|
|
12
|
+
type FormatterProp = ComponentProps<typeof TitleFormatterProvider>['formatter'];
|
|
13
|
+
|
|
14
|
+
const formatter: FormatterProp = (params) => {
|
|
15
|
+
// Add your own title formatting logic here!
|
|
16
|
+
return params.defaultFormatter(params);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default function ThemeProviderTitleFormatter({
|
|
20
|
+
children,
|
|
21
|
+
}: Props): ReactNode {
|
|
22
|
+
return (
|
|
23
|
+
<TitleFormatterProvider formatter={formatter}>
|
|
24
|
+
{children}
|
|
25
|
+
</TitleFormatterProvider>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
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, {type ReactNode} from 'react';
|
|
9
|
+
import TitleFormatterProvider from '@theme/ThemeProvider/TitleFormatter';
|
|
10
|
+
import type {Props} from '@theme/ThemeProvider';
|
|
11
|
+
|
|
12
|
+
export default function ThemeProvider({children}: Props): ReactNode {
|
|
13
|
+
return <TitleFormatterProvider>{children}</TitleFormatterProvider>;
|
|
14
|
+
}
|
package/src/theme-classic.d.ts
CHANGED
|
@@ -1569,6 +1569,17 @@ declare module '@theme/ThemedImage' {
|
|
|
1569
1569
|
export default function ThemedImage(props: Props): ReactNode;
|
|
1570
1570
|
}
|
|
1571
1571
|
|
|
1572
|
+
declare module '@theme/ThemeProvider/TitleFormatter' {
|
|
1573
|
+
import type {ReactNode} from 'react';
|
|
1574
|
+
|
|
1575
|
+
export interface Props {
|
|
1576
|
+
readonly children: ReactNode;
|
|
1577
|
+
}
|
|
1578
|
+
export default function ThemeProviderTitleFormatter({
|
|
1579
|
+
children,
|
|
1580
|
+
}: Props): ReactNode;
|
|
1581
|
+
}
|
|
1582
|
+
|
|
1572
1583
|
declare module '@theme/Details' {
|
|
1573
1584
|
import {Details, type DetailsProps} from '@docusaurus/theme-common/Details';
|
|
1574
1585
|
|